You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(16) |
Aug
(203) |
Sep
(142) |
Oct
(113) |
Nov
(73) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(7) |
Feb
(38) |
Mar
(6) |
Apr
(1) |
May
(9) |
Jun
(104) |
Jul
(6) |
Aug
(11) |
Sep
(13) |
Oct
(6) |
Nov
(15) |
Dec
(37) |
2008 |
Jan
(17) |
Feb
(4) |
Mar
(6) |
Apr
(4) |
May
(2) |
Jun
(5) |
Jul
(1) |
Aug
(3) |
Sep
(21) |
Oct
(7) |
Nov
|
Dec
(3) |
2009 |
Jan
(4) |
Feb
(15) |
Mar
|
Apr
(34) |
May
(44) |
Jun
(12) |
Jul
(6) |
Aug
(15) |
Sep
(20) |
Oct
(10) |
Nov
(1) |
Dec
(20) |
2010 |
Jan
(19) |
Feb
(5) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ped...@us...> - 2007-09-02 22:51:14
|
Revision: 1052 http://cegcc.svn.sourceforge.net/cegcc/?rev=1052&view=rev Author: pedroalves Date: 2007-09-02 15:51:09 -0700 (Sun, 02 Sep 2007) Log Message: ----------- * cwd.h (libcwd_fixpath): Declare. * cwd.c (XCEGetCurrentDirectoryA): Delay XCEGetCurrentDirectoryW call to after checking for valid buffer. (libcwd_fixpath): New. Modified Paths: -------------- trunk/cegcc/tools/libcwd/ChangeLog trunk/cegcc/tools/libcwd/cwd.c trunk/cegcc/tools/libcwd/cwd.h Modified: trunk/cegcc/tools/libcwd/ChangeLog =================================================================== --- trunk/cegcc/tools/libcwd/ChangeLog 2007-09-02 17:59:12 UTC (rev 1051) +++ trunk/cegcc/tools/libcwd/ChangeLog 2007-09-02 22:51:09 UTC (rev 1052) @@ -1,3 +1,10 @@ +2007-09-02 Pedro Alves <ped...@po...> + + * cwd.h (libcwd_fixpath): Declare. + * cwd.c (XCEGetCurrentDirectoryA): Delay XCEGetCurrentDirectoryW + call to after checking for valid buffer. + (libcwd_fixpath): New. + 2007-06-25 Pedro Alves <ped...@po...> Initial import. Modified: trunk/cegcc/tools/libcwd/cwd.c =================================================================== --- trunk/cegcc/tools/libcwd/cwd.c 2007-09-02 17:59:12 UTC (rev 1051) +++ trunk/cegcc/tools/libcwd/cwd.c 2007-09-02 22:51:09 UTC (rev 1052) @@ -169,9 +169,9 @@ DWORD dwLen; wchar_t wbuf[MAX_PATH+1]; - dwLen = XCEGetCurrentDirectoryW (dwSize, wbuf); if (dwSize == 0 && buf == 0) return dwSize; + dwLen = XCEGetCurrentDirectoryW (dwSize, wbuf); WideCharToMultiByte (CP_ACP, 0, wbuf, -1, buf, MIN(dwLen, dwSize), NULL, NULL); buf[MIN(dwLen, dwSize)] = 0; @@ -318,3 +318,46 @@ { return _getcwd (buf, size); } + +char* +libcwd_fixpath (char* out, const char *in) +{ + wchar_t wout[MAX_PATH]; + wchar_t win[MAX_PATH]; + + mbstowcs (win, in, MAX_PATH); +// XCEFixPathW (win, wout); + const wchar_t *wpathin = win; + wchar_t *wpathout = wout; + { + wchar_t wdir[MAX_PATH+1]; + wchar_t *p; + + wpathout[0] = 0; + + if(wpathin[0] != '\\' && wpathin[0] != '/') + { + XCEGetCurrentDirectoryW (sizeof(wdir), wdir); + wcscat (wpathout, wdir); + append_slash_if_needed (wpathout); + } + + wcscat (wpathout, wpathin); + + for(p = wpathout; *p; p++) + { + if(*p == '/') + *p = '\\'; + } + + /* Don't allow slash at end of directory name... */ + if(p[-1] == '\\' && p != wpathout + 1) + p[-1] = 0; + + /* Now remove . and .. */ + XCECanonicalizePathW (wpathout); + } + + wcstombs (out, wout, MAX_PATH); + return out; +} Modified: trunk/cegcc/tools/libcwd/cwd.h =================================================================== --- trunk/cegcc/tools/libcwd/cwd.h 2007-09-02 17:59:12 UTC (rev 1051) +++ trunk/cegcc/tools/libcwd/cwd.h 2007-09-02 22:51:09 UTC (rev 1052) @@ -12,6 +12,8 @@ extern int chdir (const char *path); extern int _chdir (const char *path); +extern char* libcwd_fixpath (char* out, const char *in); + #ifdef __cplusplus } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-09-02 17:59:20
|
Revision: 1051 http://cegcc.svn.sourceforge.net/cegcc/?rev=1051&view=rev Author: pedroalves Date: 2007-09-02 10:59:12 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Fix dumm bug. Writting to a pipe from a ro buffer, eg: write (pipe, "", 1) ... would fail, because of the reverse IsBadWritePtr/IsBadReadPtr usage. * PipeLib.cpp (Read): Switch to IsBadWritePtr. Only set last error to ERROR_BROKEN_PIPE if returning. (Write): Switch to IsBadReadPtr. Modified Paths: -------------- trunk/cegcc/tools/PipeLib/ChangeLog trunk/cegcc/tools/PipeLib/PipeDev.cpp Modified: trunk/cegcc/tools/PipeLib/ChangeLog =================================================================== --- trunk/cegcc/tools/PipeLib/ChangeLog 2007-09-02 17:55:11 UTC (rev 1050) +++ trunk/cegcc/tools/PipeLib/ChangeLog 2007-09-02 17:59:12 UTC (rev 1051) @@ -1,3 +1,9 @@ +2007-09-02 Pedro Alves <ped...@po...> + + * PipeLib.cpp (Read): Switch to IsBadWritePtr. Only set last + error to ERROR_BROKEN_PIPE if returning. + (Write): Switch to IsBadReadPtr. + 2007-07-02 Danny Backx <dan...@us...> Pedro Alves <ped...@po...> Modified: trunk/cegcc/tools/PipeLib/PipeDev.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeDev.cpp 2007-09-02 17:55:11 UTC (rev 1050) +++ trunk/cegcc/tools/PipeLib/PipeDev.cpp 2007-09-02 17:59:12 UTC (rev 1051) @@ -673,7 +673,7 @@ { LOGSCOPE ("\n"); - if (IsBadReadPtr (pBuffer, dwCount)) + if (IsBadWritePtr (pBuffer, dwCount)) { SetLastError (ERROR_INVALID_PARAMETER); LOG ("\n"); @@ -719,7 +719,6 @@ || dev->OpenCount == 0 /* or, ... weird */ ) { - SetLastError (ERROR_BROKEN_PIPE); if (needed - dwCount) { /* I don't know a way to report error and 'valid @@ -729,6 +728,7 @@ break; } LOG ("Pipe broken\n"); + SetLastError (ERROR_BROKEN_PIPE); return (DWORD) -1; } @@ -772,7 +772,7 @@ { LOGSCOPE ("\n"); - if (IsBadWritePtr ((void*) pBuffer, dwCount)) + if (IsBadReadPtr (pBuffer, dwCount)) { SetLastError (ERROR_INVALID_PARAMETER); LOG ("\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-09-02 17:57:30
|
Revision: 1050 http://cegcc.svn.sourceforge.net/cegcc/?rev=1050&view=rev Author: pedroalves Date: 2007-09-02 10:55:11 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Changelog entry credits should layed in chronological order. Modified Paths: -------------- trunk/cegcc/tools/PipeLib/ChangeLog Modified: trunk/cegcc/tools/PipeLib/ChangeLog =================================================================== --- trunk/cegcc/tools/PipeLib/ChangeLog 2007-08-09 06:57:30 UTC (rev 1049) +++ trunk/cegcc/tools/PipeLib/ChangeLog 2007-09-02 17:55:11 UTC (rev 1050) @@ -1,5 +1,5 @@ -2007-07-02 Pedro Alves <ped...@po...> - Danny Backx <dan...@us...> +2007-07-02 Danny Backx <dan...@us...> + Pedro Alves <ped...@po...> * PipeLib.cpp (CreatePipe): Handle unexpected ActivateDevice failures. Record last error as ERROR_TOO_MANY_OPEN_FILES when This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-08-09 06:57:32
|
Revision: 1049 http://cegcc.svn.sourceforge.net/cegcc/?rev=1049&view=rev Author: dannybackx Date: 2007-08-08 23:57:30 -0700 (Wed, 08 Aug 2007) Log Message: ----------- Also define values for dwServiceState field Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/service.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-09 06:50:59 UTC (rev 1048) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-09 06:57:30 UTC (rev 1049) @@ -1,5 +1,12 @@ 2007-08-09 Danny Backx <dan...@us...> + * include/service.h (SERVICE_STATE_OFF, SERVICE_STATE_ON, + SERVICE_STATE_STARTING_UP, SERVICE_STATE_SHUTTING_DOWN, + SERVICE_STATE_UNLOADING, SERVICE_STATE_UNINITIALIZED, + SERVICE_STATE_UNKNOWN): Define values for dwServiceState field. + +2007-08-09 Danny Backx <dan...@us...> + * include/service.h: New file. Declares functions and a structure as documented on MSDN. Used only on CE > 4. * include/service.h (ServiceEnumInfo): New struct. Modified: trunk/cegcc/src/w32api/include/service.h =================================================================== --- trunk/cegcc/src/w32api/include/service.h 2007-08-09 06:50:59 UTC (rev 1048) +++ trunk/cegcc/src/w32api/include/service.h 2007-08-09 06:57:30 UTC (rev 1049) @@ -27,6 +27,15 @@ DWORD dwServiceState; } ServiceEnumInfo; +/* Values for dwServiceState */ +#define SERVICE_STATE_OFF 0 +#define SERVICE_STATE_ON 1 +#define SERVICE_STATE_STARTING_UP 2 +#define SERVICE_STATE_SHUTTING_DOWN 3 +#define SERVICE_STATE_UNLOADING 4 +#define SERVICE_STATE_UNINITIALIZED 5 +#define SERVICE_STATE_UNKNOWN 0xffffffff + HANDLE RegisterService (LPCWSTR lpszType, DWORD dwIndex, LPCWSTR lpszLib, DWORD dwInfo); HANDLE ActivateService (LPCWSTR lpszDevKey, DWORD dwClientInfo); @@ -41,6 +50,7 @@ DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); BOOL ServiceUnbindPorts (HANDLE hService); + #endif /* _WIN32_WCE */ #ifdef __cplusplus This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-08-09 06:51:01
|
Revision: 1048 http://cegcc.svn.sourceforge.net/cegcc/?rev=1048&view=rev Author: dannybackx Date: 2007-08-08 23:50:59 -0700 (Wed, 08 Aug 2007) Log Message: ----------- New file, defines functions and a struct as documented on MSDN. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce Added Paths: ----------- trunk/cegcc/src/w32api/include/service.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 22:28:44 UTC (rev 1047) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-09 06:50:59 UTC (rev 1048) @@ -1,3 +1,13 @@ +2007-08-09 Danny Backx <dan...@us...> + + * include/service.h: New file. Declares functions and a structure as + documented on MSDN. Used only on CE > 4. + * include/service.h (ServiceEnumInfo): New struct. + * include/service.h (RegisterService, ActivateService, + DeregisterService, EnumServices, GetServiceHandle, ServiceAddPort, + ServiceClosePort, ServiceIoControl, ServiceUnbindPorts): New + functions. + 2007-08-06 Pedro Alves <ped...@po...> * include/aygshell.h (SHIDIM_FLAGS, SHIDIF_DONEBUTTON, Added: trunk/cegcc/src/w32api/include/service.h =================================================================== --- trunk/cegcc/src/w32api/include/service.h (rev 0) +++ trunk/cegcc/src/w32api/include/service.h 2007-08-09 06:50:59 UTC (rev 1048) @@ -0,0 +1,50 @@ +/* + service.h + + THIS SOFTWARE IS NOT COPYRIGHTED + + This source code is offered for use in the public domain. You may use, + modify or distribute it freely. + + This code is distributed in the hope that it will be useful but + WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + DISCLAIMED. This includes but is not limited to warranties of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#ifndef __SERVICE_H__ +#define __SERVICE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0400) +typedef struct ServiceEnumInfo { + WCHAR szPrefix[6]; + WCHAR szDllName; + HANDLE hServiceHandle; + DWORD dwServiceState; +} ServiceEnumInfo; + +HANDLE RegisterService (LPCWSTR lpszType, DWORD dwIndex, LPCWSTR lpszLib, + DWORD dwInfo); +HANDLE ActivateService (LPCWSTR lpszDevKey, DWORD dwClientInfo); +BOOL DeregisterService (HANDLE hDevice); +BOOL EnumServices (PBYTE pBuffer, DWORD *pdwServiceEntries, DWORD *pdwBufferLen); +HANDLE GetServiceHandle (LPWSTR szPrefix, LPWSTR szDllName, DWORD *pdwDllBuf); +BOOL ServiceAddPort (HANDLE hService, SOCKADDR *pSockAddr, INT cbSockAddr, + INT iProtocol, WCHAR szRegWritePath); +BOOL ServiceClosePort (HANDLE hService, SOCKADDR *pSockAddr, int cbSockAddr, + int iProtocol, BOOL fRemoveFromRegistry); +BOOL ServiceIoControl (HANDLE hService, DWORD dwIoControlCode, LPVOID lpInBuf, + DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, + LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped); +BOOL ServiceUnbindPorts (HANDLE hService); +#endif /* _WIN32_WCE */ + +#ifdef __cplusplus +} +#endif + +#endif /* __SERVICE_H__ */ Property changes on: trunk/cegcc/src/w32api/include/service.h ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 22:28:46
|
Revision: 1047 http://cegcc.svn.sourceforge.net/cegcc/?rev=1047&view=rev Author: pedroalves Date: 2007-08-06 15:28:44 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. (WINCE_OBJS): Add lfind.o. * mingwex/wince/lfind.c: New file. * include/search.h (_lfind, lfind): Expose. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/search.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/lfind.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-08-06 22:28:44 UTC (rev 1047) @@ -1,3 +1,10 @@ +2007-08-06 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (WINCE_DISTFILES): Add lfind.c. + (WINCE_OBJS): Add lfind.o. + * mingwex/wince/lfind.c: New file. + * include/search.h (_lfind, lfind): Expose. + 2007-06-24 Pedro Alves <ped...@po...> * mingwex/Makefile.in (WINCE_OBJS): Add chsize.o, findfile.o, Modified: trunk/cegcc/src/mingw/include/search.h =================================================================== --- trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/include/search.h 2007-08-06 22:28:44 UTC (rev 1047) @@ -43,7 +43,6 @@ /* bsearch and qsort are also declared in stdlib.h */ _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, int (*)(const void*, const void*)); -#ifndef __COREDLL__ _CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); _CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, @@ -54,7 +53,6 @@ _CRTIMP void* __cdecl lsearch (const void*, void*, unsigned int*, unsigned int, int (*)(const void*, const void*)); #endif -#endif /* Not __COREDLL__ */ #ifdef __cplusplus } Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:20:14 UTC (rev 1046) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-08-06 22:28:44 UTC (rev 1047) @@ -88,7 +88,7 @@ asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c \ close.c isalnum.c isalpha.c iscntrl.c isgraph.c islower.c isprint.c \ - ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c + ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c lfind.c MATHCE_DISTFILES = \ e_acosf.c e_acosh.c e_acoshf.c e_asinf.c e_atan2f.c e_atanh.c e_coshf.c \ @@ -217,7 +217,7 @@ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o \ mb_cur_max.o rename.o stat.o chmod.o utime.o futime.o timeutil.o \ - ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o + ctime.o chsize.o findfile.o bsearch.o access.o mkdir.o rmdir.o lfind.o MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ Added: trunk/cegcc/src/mingw/mingwex/wince/lfind.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lfind.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/lfind.c 2007-08-06 22:28:44 UTC (rev 1047) @@ -0,0 +1,65 @@ +/* $Id: lfind.c,v 1.3 2005/12/27 15:08:22 dron Exp $ */ + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Roger L. Snyder. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; +__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $"); +#endif + +#include <sys/types.h> + +#ifndef NULL +# define NULL 0 +#endif + +void * +_lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + char *element, *end; + + end = (char *)base + *nmemb * size; + for (element = (char *)base; element < end; element += size) + if (!compar(element, key)) /* key found */ + return element; + + return NULL; +} + +void * +lfind(const void *key, const void *base, size_t *nmemb, size_t size, + int(*compar)(const void *, const void *)) +{ + return _lfind(key, base, nmemb, size, compar); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/lfind.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 22:20:15
|
Revision: 1046 http://cegcc.svn.sourceforge.net/cegcc/?rev=1046&view=rev Author: pedroalves Date: 2007-08-06 15:20:14 -0700 (Mon, 06 Aug 2007) Log Message: ----------- Had these here for a while. Needed for the Qt port. I've added all the defines I could test. From the MSDN pages, there a few more that were added for WinCE 6. I don't have such a device to test. Start here: [SHInitDialog] http://msdn2.microsoft.com/en-US/library/aa932176.aspx * include/aygshell.h (SHIDIM_FLAGS, SHIDIF_DONEBUTTON, SHIDIF_SIZEDLG, SHIDIF_SIZEDLGFULLSCREEN, SHIDIF_SIPDOWN, SHIDIF_FULLSCREENNOMENUBAR, SHIDIF_EMPTYMENU): New defines. (SHINITDLGINFO): New struct. (SHInitDialog): New function. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/aygshell.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 22:14:05 UTC (rev 1045) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 22:20:14 UTC (rev 1046) @@ -1,5 +1,13 @@ 2007-08-06 Pedro Alves <ped...@po...> + * include/aygshell.h (SHIDIM_FLAGS, SHIDIF_DONEBUTTON, + SHIDIF_SIZEDLG, SHIDIF_SIZEDLGFULLSCREEN, SHIDIF_SIPDOWN, + SHIDIF_FULLSCREENNOMENUBAR, SHIDIF_EMPTYMENU): New defines. + (SHINITDLGINFO): New struct. + (SHInitDialog): New function. + +2007-08-06 Pedro Alves <ped...@po...> + * include/sipapi.h: New file. * include/aygshell.h (SIPINFO): Moved to new sipapi.h. Modified: trunk/cegcc/src/w32api/include/aygshell.h =================================================================== --- trunk/cegcc/src/w32api/include/aygshell.h 2007-08-06 22:14:05 UTC (rev 1045) +++ trunk/cegcc/src/w32api/include/aygshell.h 2007-08-06 22:20:14 UTC (rev 1046) @@ -37,15 +37,33 @@ #define SHCMBF_COLORBK 0x08 #define SHCMBF_HMENU 0x10 -typedef struct tagSHACTIVATEINFO { - DWORD cbSize; - HWND hwndLastFocus; - UINT fSipUp:1; - UINT fSipOnDeactivation:1; - UINT fActive:1; - UINT fReserved:29; +#define SHIDIM_FLAGS 0x0001 + +#define SHIDIF_DONEBUTTON 0x0001 +#define SHIDIF_SIZEDLG 0x0002 +#define SHIDIF_SIZEDLGFULLSCREEN 0x0004 +#define SHIDIF_SIPDOWN 0x0008 +#define SHIDIF_FULLSCREENNOMENUBAR 0x0010 +#define SHIDIF_EMPTYMENU 0x0020 + +typedef struct tagSHACTIVATEINFO +{ + DWORD cbSize; + HWND hwndLastFocus; + UINT fSipUp:1; + UINT fSipOnDeactivation:1; + UINT fActive:1; + UINT fReserved:29; } SHACTIVATEINFO, *PSHACTIVATEINFO; +typedef struct tagSHINITDLGINFO +{ + DWORD dwMask; + HWND hDlg; + DWORD dwFlags; +} SHINITDLGINFO, *PSHINITDLGINFO; + +WINSHELLAPI BOOL WINAPI SHInitDialog(PSHINITDLGINFO); WINSHELLAPI BOOL WINAPI SHCreateMenuBar(SHMENUBARINFO *); WINSHELLAPI HWND WINAPI SHFindMenuBar(HWND); WINSHELLAPI HRESULT WINAPI SHCreateNewItem(HWND,REFCLSID); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 22:14:08
|
Revision: 1045 http://cegcc.svn.sourceforge.net/cegcc/?rev=1045&view=rev Author: pedroalves Date: 2007-08-06 15:14:05 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * include/sipapi.h: New file. * include/aygshell.h (SIPINFO): Moved to new sipapi.h. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/aygshell.h Added Paths: ----------- trunk/cegcc/src/w32api/include/sipapi.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:32:34 UTC (rev 1044) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 22:14:05 UTC (rev 1045) @@ -1,5 +1,10 @@ 2007-08-06 Pedro Alves <ped...@po...> + * include/sipapi.h: New file. + * include/aygshell.h (SIPINFO): Moved to new sipapi.h. + +2007-08-06 Pedro Alves <ped...@po...> + * include/winbase.h (GetCharABCWidths): Remove the W suffix on WinCE. Modified: trunk/cegcc/src/w32api/include/aygshell.h =================================================================== --- trunk/cegcc/src/w32api/include/aygshell.h 2007-08-06 21:32:34 UTC (rev 1044) +++ trunk/cegcc/src/w32api/include/aygshell.h 2007-08-06 22:14:05 UTC (rev 1045) @@ -62,18 +62,6 @@ extern BOOL SHHandleWMSettingChange(HWND, WPARAM, LPARAM, SHACTIVATEINFO *); extern BOOL SHHandleWMActivate(HWND, WPARAM, LPARAM, SHACTIVATEINFO *, DWORD); -/* - * Query the SIP state - */ -typedef struct SIPINFO { - DWORD cbSize; - DWORD fdwFlags; - RECT rcVisibleDesktop; - RECT rcSipRect; - DWORD dwImDataSize; - void *pvImData; -} SIPINFO, *PSIPINFO; - #define SPI_SETCOMPLETIONINFO 223 #define SPI_SETSIPINFO 224 #define SPI_GETSIPINFO 225 Added: trunk/cegcc/src/w32api/include/sipapi.h =================================================================== --- trunk/cegcc/src/w32api/include/sipapi.h (rev 0) +++ trunk/cegcc/src/w32api/include/sipapi.h 2007-08-06 22:14:05 UTC (rev 1045) @@ -0,0 +1,58 @@ +#ifndef _SIPAPI_H +#define _SIPAPI_H +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if _WIN32_WCE >= 0x0201 + +/* + * Query the SIP state + */ +typedef struct SIPINFO { + DWORD cbSize; + DWORD fdwFlags; + RECT rcVisibleDesktop; + RECT rcSipRect; + DWORD dwImDataSize; + VOID* pvImData; +} SIPINFO, *PSIPINFO; + +#define SPI_SETCOMPLETIONINFO 223 +#define SPI_SETSIPINFO 224 +#define SPI_GETSIPINFO 225 +#define SPI_SETCURRENTIM 226 +#define SPI_GETCURRENTIM 227 +#define SPI_APPBUTTONCHANGE 228 +#define SPI_RESERVED 229 +#define SPI_SYNCSETTINGSCHANGE 230 + +#define SIPF_OFF 0 +#define SIPF_ON 1 +#define SIPF_DOCKED 2 +#define SIPF_LOCKED 4 + +BOOL WINAPI SipGetInfo(SIPINFO*); +BOOL WINAPI SipSetInfo(SIPINFO*); + +typedef struct tagIMENUMINFO +{ + WCHAR szName[MAX_PATH]; + CLSID clsid; +} IMENUMINFO, *PIMENUMINFO; + +typedef int (*IMENUMPROC)(IMENUMINFO *); + +int WINAPI SipEnumIM(IMENUMPROC); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _SIPAPI_H */ Property changes on: trunk/cegcc/src/w32api/include/sipapi.h ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 21:32:36
|
Revision: 1044 http://cegcc.svn.sourceforge.net/cegcc/?rev=1044&view=rev Author: pedroalves Date: 2007-08-06 14:32:34 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * include/winbase.h (GetCharABCWidths): Remove the W suffix on WinCE. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/wingdi.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:18:55 UTC (rev 1043) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:32:34 UTC (rev 1044) @@ -1,5 +1,10 @@ 2007-08-06 Pedro Alves <ped...@po...> + * include/winbase.h (GetCharABCWidths): Remove the W suffix on + WinCE. + +2007-08-06 Pedro Alves <ped...@po...> + * include/winbase.h (LocalFlags, LocalHandle, LocalLock, LocalUnlock): Define for WinCE. Modified: trunk/cegcc/src/w32api/include/wingdi.h =================================================================== --- trunk/cegcc/src/w32api/include/wingdi.h 2007-08-06 21:18:55 UTC (rev 1043) +++ trunk/cegcc/src/w32api/include/wingdi.h 2007-08-06 21:32:34 UTC (rev 1044) @@ -2797,8 +2797,12 @@ WINGDIAPI int WINAPI GetBkMode(HDC); WINGDIAPI UINT WINAPI GetBoundsRect(HDC,LPRECT,UINT); WINGDIAPI BOOL WINAPI GetBrushOrgEx(HDC,LPPOINT); +#ifndef _WIN32_WCE WINGDIAPI BOOL WINAPI GetCharABCWidthsA(HDC,UINT,UINT,LPABC); WINGDIAPI BOOL WINAPI GetCharABCWidthsW(HDC,UINT,UINT,LPABC); +#else +WINGDIAPI BOOL WINAPI GetCharABCWidths(HDC,UINT,UINT,LPABC); +#endif WINGDIAPI BOOL WINAPI GetCharABCWidthsFloatA(HDC,UINT,UINT,LPABCFLOAT); WINGDIAPI BOOL WINAPI GetCharABCWidthsFloatW(HDC,UINT,UINT,LPABCFLOAT); WINGDIAPI DWORD WINAPI GetCharacterPlacementA(HDC,LPCSTR,int,int,LPGCP_RESULTSA,DWORD); @@ -3099,7 +3103,9 @@ #define EnumICMProfiles EnumICMProfilesW #define ExtTextOut ExtTextOutW #define GetCharABCWidthsFloat GetCharABCWidthsFloatW +#ifndef _WIN32_WCE #define GetCharABCWidths GetCharABCWidthsW +#endif #define GetCharacterPlacement GetCharacterPlacementW #ifndef _WIN32_WCE #define GetCharWidth32 GetCharWidth32W This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 21:18:58
|
Revision: 1043 http://cegcc.svn.sourceforge.net/cegcc/?rev=1043&view=rev Author: pedroalves Date: 2007-08-06 14:18:55 -0700 (Mon, 06 Aug 2007) Log Message: ----------- This page from the Japanese MSDN: http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/jpmemory/html/_win32_locallock.asp Automatically translated to english like this: http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ja_en&url=http%3A%2F%2Fmsdn.microsoft.com%2Flibrary%2Fja%2Fdefault.asp%3Furl%3D%2Flibrary%2Fja%2Fjpmemory%2Fhtml%2F_win32_locallock.asp States these are unsupported on WinCE. "Windows CE:It is not corresponding" Then looking at the desktop versions of these functions here: [LocalLock] http://msdn2.microsoft.com/EN-US/library/aa366737.aspx [LocalHandle] http://msdn2.microsoft.com/en-US/library/aa366733.aspx [LocalUnlock] http://msdn2.microsoft.com/EN-US/library/aa366747.aspx [LocalFlags] http://msdn2.microsoft.com/EN-US/library/aa366728.aspx One comes up with this implementation: * include/winbase.h (LocalFlags, LocalHandle, LocalLock, LocalUnlock): Define for WinCE. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winbase.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:03:25 UTC (rev 1042) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:18:55 UTC (rev 1043) @@ -1,5 +1,10 @@ 2007-08-06 Pedro Alves <ped...@po...> + * include/winbase.h (LocalFlags, LocalHandle, LocalLock, LocalUnlock): + Define for WinCE. + +2007-08-06 Pedro Alves <ped...@po...> + * include/winbase.h (LocalLock): Change return type to LPVOID as per MSDN. Modified: trunk/cegcc/src/w32api/include/winbase.h =================================================================== --- trunk/cegcc/src/w32api/include/winbase.h 2007-08-06 21:03:25 UTC (rev 1042) +++ trunk/cegcc/src/w32api/include/winbase.h 2007-08-06 21:18:55 UTC (rev 1043) @@ -1776,14 +1776,30 @@ WINBASEAPI SIZE_T WINAPI LocalCompact(UINT); /* Obsolete: Has no effect. */ WINBASEAPI HLOCAL LocalDiscard(HLOCAL); WINBASEAPI BOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *,LPFILETIME); +#ifndef _WIN32_WCE WINBASEAPI UINT WINAPI LocalFlags(HLOCAL); /* Obsolete: Has no effect. */ +#else +# define LocalFlags(H) ((UINT)0) +#endif WINBASEAPI HLOCAL WINAPI LocalFree(HLOCAL); +#ifndef _WIN32_WCE WINBASEAPI HLOCAL WINAPI LocalHandle(LPCVOID); +#else +# define LocalHandle(H) ((HLOCAL)(H)) +#endif +#ifndef _WIN32_WCE WINBASEAPI LPVOID WINAPI LocalLock(HLOCAL); +#else +# define LocalLock(H) ((LPVOID)(H)) +#endif WINBASEAPI HLOCAL WINAPI LocalReAlloc(HLOCAL,SIZE_T,UINT); WINBASEAPI SIZE_T WINAPI LocalShrink(HLOCAL,UINT); /* Obsolete: Has no effect. */ WINBASEAPI UINT WINAPI LocalSize(HLOCAL); +#ifndef _WIN32_WCE WINBASEAPI BOOL WINAPI LocalUnlock(HLOCAL); +#else +# define LocalUnlock(H) ((BOOL)0) +#endif WINBASEAPI BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD); WINBASEAPI BOOL WINAPI LockFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPOVERLAPPED); #ifdef _WIN32_WCE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-06 21:03:28
|
Revision: 1042 http://cegcc.svn.sourceforge.net/cegcc/?rev=1042&view=rev Author: pedroalves Date: 2007-08-06 14:03:25 -0700 (Mon, 06 Aug 2007) Log Message: ----------- * include/winbase.h (LocalLock): Change return type to LPVOID as per MSDN. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winbase.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-05 22:02:18 UTC (rev 1041) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-06 21:03:25 UTC (rev 1042) @@ -1,3 +1,8 @@ +2007-08-06 Pedro Alves <ped...@po...> + + * include/winbase.h (LocalLock): + Change return type to LPVOID as per MSDN. + 2007-08-01 Pedro Alves <ped...@po...> * include/commdlg.h (PrintDlg): Remove the W suffix on WinCE. Modified: trunk/cegcc/src/w32api/include/winbase.h =================================================================== --- trunk/cegcc/src/w32api/include/winbase.h 2007-08-05 22:02:18 UTC (rev 1041) +++ trunk/cegcc/src/w32api/include/winbase.h 2007-08-06 21:03:25 UTC (rev 1042) @@ -1779,7 +1779,7 @@ WINBASEAPI UINT WINAPI LocalFlags(HLOCAL); /* Obsolete: Has no effect. */ WINBASEAPI HLOCAL WINAPI LocalFree(HLOCAL); WINBASEAPI HLOCAL WINAPI LocalHandle(LPCVOID); -WINBASEAPI PVOID WINAPI LocalLock(HLOCAL); +WINBASEAPI LPVOID WINAPI LocalLock(HLOCAL); WINBASEAPI HLOCAL WINAPI LocalReAlloc(HLOCAL,SIZE_T,UINT); WINBASEAPI SIZE_T WINAPI LocalShrink(HLOCAL,UINT); /* Obsolete: Has no effect. */ WINBASEAPI UINT WINAPI LocalSize(HLOCAL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-05 22:02:19
|
Revision: 1041 http://cegcc.svn.sourceforge.net/cegcc/?rev=1041&view=rev Author: pedroalves Date: 2007-08-05 15:02:18 -0700 (Sun, 05 Aug 2007) Log Message: ----------- Fix svn browse url. Modified Paths: -------------- trunk/cegcc/website/index.html Modified: trunk/cegcc/website/index.html =================================================================== --- trunk/cegcc/website/index.html 2007-08-05 10:20:47 UTC (rev 1040) +++ trunk/cegcc/website/index.html 2007-08-05 22:02:18 UTC (rev 1041) @@ -86,7 +86,7 @@ <h2 align=center>Getting it</h2> <ul> <li> <a href="http://sourceforge.net/project/showfiles.php?group_id=173455"> Download CeGCC </a> - <li> <a href="http://svn.sourceforge.net/cegcc"> SVN Repository </a> + <li> <a href="http://cegcc.svn.sourceforge.net"> Browse SVN Repository </a> </ul> <h2 align=center>Support</h2> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2007-08-05 10:20:49
|
Revision: 1040 http://cegcc.svn.sourceforge.net/cegcc/?rev=1040&view=rev Author: dannybackx Date: 2007-08-05 03:20:47 -0700 (Sun, 05 Aug 2007) Log Message: ----------- This is the support for the __exception_handler__ attribute. Code as originally posted on the list has been changed as Pedro suggested. 2007-08-05 Danny Backx <dan...@us...> * c-common.c (handle_exception_handler_attribute) : Add new handler to support the __exception_handler__ attribute. * config/arm/arm.c (arm_exception_handler) : Add function to query the structures built by the compiler for the exception handler for the function that we're currently generating code for. * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_NAME) : Add macro to generate function header including an exception handler spec and an entry in the .pdata segment, call the one in pe.h to reuse the existing code. * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_SIZE) : Add macro to generate function trailer (one additional local label) so we can do a size calculation. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME) : Rename to ARM_PE_DECLARE_FUNCTION_NAME so it can be called from ASM_DECLARE_FUNCTION_NAME in config/arm/wince-pe.h . Code reuse instead of code duplication. Modified Paths: -------------- trunk/cegcc/src/gcc/gcc/ChangeLog.ce trunk/cegcc/src/gcc/gcc/c-common.c trunk/cegcc/src/gcc/gcc/config/arm/arm.c trunk/cegcc/src/gcc/gcc/config/arm/pe.h trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h Modified: trunk/cegcc/src/gcc/gcc/ChangeLog.ce =================================================================== --- trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/ChangeLog.ce 2007-08-05 10:20:47 UTC (rev 1040) @@ -197,3 +197,23 @@ * config/arm/t-wince-cegcc: Make it empty, we now inherit the generic t-wince-pe. * ChangeLog.ce: New file. + +2007-08-05 Danny Backx <dan...@us...> + + * c-common.c (handle_exception_handler_attribute) : Add new handler to + support the __exception_handler__ attribute. + * config/arm/arm.c (arm_exception_handler) : Add function to query the + structures built by the compiler for the exception handler for the + function that we're currently generating code for. + * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_NAME) : Add macro to + generate function header including an exception handler spec and an + entry in the .pdata segment, call the one in pe.h to reuse the + existing code. + * config/arm/wince-pe.h (ASM_DECLARE_FUNCTION_SIZE) : Add macro to + generate function trailer (one additional local label) so we can do a + size calculation. + * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME) : Rename to + ARM_PE_DECLARE_FUNCTION_NAME so it can be called from + ASM_DECLARE_FUNCTION_NAME in config/arm/wince-pe.h . Code reuse + instead of code duplication. + Modified: trunk/cegcc/src/gcc/gcc/c-common.c =================================================================== --- trunk/cegcc/src/gcc/gcc/c-common.c 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/c-common.c 2007-08-05 10:20:47 UTC (rev 1040) @@ -505,6 +505,8 @@ static tree handle_noinline_attribute (tree *, tree, tree, int, bool *); static tree handle_always_inline_attribute (tree *, tree, tree, int, bool *); +static tree handle_exception_handler_attribute (tree *, tree, tree, int, + bool *); static tree handle_flatten_attribute (tree *, tree, tree, int, bool *); static tree handle_used_attribute (tree *, tree, tree, int, bool *); static tree handle_unused_attribute (tree *, tree, tree, int, bool *); @@ -633,6 +635,8 @@ handle_cleanup_attribute }, { "warn_unused_result", 0, 0, false, true, true, handle_warn_unused_result_attribute }, + { "exception_handler", 1, 1, true, false, false, + handle_exception_handler_attribute }, { "sentinel", 0, 1, false, true, true, handle_sentinel_attribute }, { NULL, 0, 0, false, false, false, NULL } @@ -4216,6 +4220,59 @@ return NULL_TREE; } +/* + * Handle a "exception_handler" attribute. + * + * One argument is required : the name of a function to call in case of exceptions. + * Example syntax : + * + * int main(int argc, char *argv[]) + * __attribute__((__exception_handler__(handler))); + */ + +static tree +handle_exception_handler_attribute (tree *node, tree name, + tree args, + int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + { + /* + * We need to pass the name of the exception handler. The + * right code then gets generated from config/arm/mingw32.h + * or similar, the assembler and linker will do the hard work. + * + * FIX ME We don't support passing data to the exception handler. + * + * This should be possible though, by using an additional argument + * which needs to fit in the dword (e.g. a pointer) and storing that + * in the right field as we do with the exception handler. + */ + + /* Handle mode attribute, handle_section_attribute, .. use args */ + tree id = TREE_VALUE (args); + tree attr = NULL_TREE; + +#if 1 + attr = tree_cons (get_identifier ("exception_handler"), args, attr); +#else + /* Works too */ + const char *x = IDENTIFIER_POINTER(id); + + attr = tree_cons (get_identifier ("exception_handler"), + build_string (strlen (x), x), attr); +#endif + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "flatten" attribute; arguments as in struct attribute_spec.handler. */ Modified: trunk/cegcc/src/gcc/gcc/config/arm/arm.c =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/arm.c 2007-08-05 10:20:47 UTC (rev 1040) @@ -15553,4 +15553,28 @@ return (insn_flags & FL_THUMB) == FL_THUMB; } +/* + * called from ASM_DECLARE_FUNCTION_NAME in gcc/config/arm/wince-pe.h + */ +char * +arm_exception_handler (FILE *fp, char *name, tree decl) +{ + tree attr, a2; + + attr = DECL_ATTRIBUTES (decl); + if (! attr) + return NULL; + a2 = lookup_attribute ("__exception_handler__", attr); + if (! a2) + return NULL; + if (a2) + { + return IDENTIFIER_POINTER (TREE_VALUE (TREE_VALUE (a2))); + } + + warning (0, "exception handler information not found for function %s", + name); + return NULL; +} + #include "gt-arm.h" Modified: trunk/cegcc/src/gcc/gcc/config/arm/pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/pe.h 2007-08-05 10:20:47 UTC (rev 1040) @@ -117,8 +117,11 @@ /* Write the extra assembler code needed to declare a function properly. If we are generating SDB debugging information, this will happen automatically, so we only need to handle other cases. */ -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ +/* Give this another name so more sub-architectures can overrule ARM_DECLARE_FUNCTION_NAME + * and still call ARM_PE_DECLARE_FUNCTION_NAME. The alternative is to duplicate the code + * below to the sub-architectures, that's a bad idea. + * This is currently done in wince-pe.h . */ +#define ARM_PE_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ do \ { \ if (arm_pe_dllexport_name_p (NAME)) \ @@ -132,6 +135,9 @@ } \ while (0) +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME ARM_PE_DECLARE_FUNCTION_NAME + /* Output function declarations at the end of the file. */ #undef TARGET_ASM_FILE_END #define TARGET_ASM_FILE_END arm_pe_file_end Modified: trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h =================================================================== --- trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-08-01 00:04:32 UTC (rev 1039) +++ trunk/cegcc/src/gcc/gcc/config/arm/wince-pe.h 2007-08-05 10:20:47 UTC (rev 1040) @@ -234,3 +234,48 @@ #ifndef BUFSIZ # undef FILE #endif + +/* + * An ARM specific header for function declarations. + * + * This one is needed for exception handlers : the entry in the pdata section + * needs to know the size of the function for which we handle exceptions. + */ +#undef ASM_DECLARE_FUNCTION_NAME +#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \ + do \ + { \ + char *eh; \ + eh = arm_exception_handler(STREAM, NAME, DECL); \ + if (eh) \ + { \ + asm_fprintf (STREAM, "%@ %s has exception handler %s\n", \ + NAME, eh); \ + asm_fprintf (STREAM, "\t.section .pdata\n"); \ + asm_fprintf (STREAM, "\t.word %s\n", NAME); \ + asm_fprintf (STREAM, "\t.word 0xc0000002 | " \ + "((((.L%s_end - %s) / 4) & 0x3ffffff) << 8) " \ + "/* _cegcc_%s size */\n", NAME, NAME, NAME); \ + asm_fprintf (STREAM, "\t.text\n"); \ + asm_fprintf (STREAM, ".L%s_data:\n", NAME); \ + asm_fprintf (STREAM, "\t.word %s /* .L%s_handler */\n", \ + eh, NAME); \ + asm_fprintf (STREAM, "\t.word 0 /* .L%s_handler_data */\n", \ + NAME); \ + } \ + ARM_PE_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL); \ + } \ + while (0) + +/* + * An ARM specific trailer for function declarations. + * + * This one is needed for exception handlers : the entry in the pdata section + * needs to know the size of the function for which we handle exceptions. + */ +#undef ASM_DECLARE_FUNCTION_SIZE +#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \ + { \ + if (arm_exception_handler(STREAM, NAME, DECL)) \ + asm_fprintf (STREAM, ".L%s_end:\n", NAME); \ + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-08-01 00:04:45
|
Revision: 1039 http://cegcc.svn.sourceforge.net/cegcc/?rev=1039&view=rev Author: pedroalves Date: 2007-07-31 17:04:32 -0700 (Tue, 31 Jul 2007) Log Message: ----------- * include/commdlg.h (PrintDlg): Remove the W suffix on WinCE. * include/shellapi.h (ShellExecuteEx, ShellGetFileInfo): Likewise. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/commdlg.h trunk/cegcc/src/w32api/include/shellapi.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-07-31 23:52:06 UTC (rev 1038) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-08-01 00:04:32 UTC (rev 1039) @@ -1,3 +1,8 @@ +2007-08-01 Pedro Alves <ped...@po...> + + * include/commdlg.h (PrintDlg): Remove the W suffix on WinCE. + * include/shellapi.h (ShellExecuteEx, ShellGetFileInfo): Likewise. + 2007-08-01 Steven Hicks <cra...@gm...> * include/winbase.h (DeregisterDevice, RegisterDevice): Declare. Modified: trunk/cegcc/src/w32api/include/commdlg.h =================================================================== --- trunk/cegcc/src/w32api/include/commdlg.h 2007-07-31 23:52:06 UTC (rev 1038) +++ trunk/cegcc/src/w32api/include/commdlg.h 2007-08-01 00:04:32 UTC (rev 1039) @@ -541,7 +541,11 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA); BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW); BOOL WINAPI PrintDlgA(LPPRINTDLGA); +#ifndef _WIN32_WCE BOOL WINAPI PrintDlgW(LPPRINTDLGW); +#else +BOOL WINAPI PrintDlg(LPPRINTDLGW); +#endif HWND WINAPI ReplaceTextA(LPFINDREPLACEA); HWND WINAPI ReplaceTextW(LPFINDREPLACEW); #if (WINVER >= 0x0500) && !defined (_OBJC_NO_COM) @@ -571,7 +575,9 @@ #define GetOpenFileName GetOpenFileNameW #define GetSaveFileName GetSaveFileNameW #define PageSetupDlg PageSetupDlgW +#ifndef _WIN32_WCE #define PrintDlg PrintDlgW +#endif #define ReplaceText ReplaceTextW #if (WINVER >= 0x0500) && !defined (_OBJC_NO_COM) typedef PRINTDLGEXW PRINTDLGEX, *LPPRINTDLGEX; Modified: trunk/cegcc/src/w32api/include/shellapi.h =================================================================== --- trunk/cegcc/src/w32api/include/shellapi.h 2007-07-31 23:52:06 UTC (rev 1038) +++ trunk/cegcc/src/w32api/include/shellapi.h 2007-08-01 00:04:32 UTC (rev 1039) @@ -300,12 +300,20 @@ HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT); HINSTANCE WINAPI ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT); BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA); +#ifndef _WIN32_WCE BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW); +#else +BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFOW); +#endif int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA); int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW); void WINAPI SHFreeNameMappings(HANDLE); DWORD WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); +#ifndef _WIN32_WCE DWORD WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); +#else +DWORD WINAPI SHGetFileInfo(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); +#endif HRESULT WINAPI SHQueryRecycleBinA(LPCSTR, LPSHQUERYRBINFO); HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR, LPSHQUERYRBINFO); HRESULT WINAPI SHEmptyRecycleBinA(HWND,LPCSTR,DWORD); @@ -333,9 +341,13 @@ #define Shell_NotifyIcon Shell_NotifyIconW #define ShellAbout ShellAboutW #define ShellExecute ShellExecuteW +#ifndef _WIN32_WCE #define ShellExecuteEx ShellExecuteExW +#endif #define SHFileOperation SHFileOperationW +#ifndef _WIN32_WCE #define SHGetFileInfo SHGetFileInfoW +#endif #define SHQueryRecycleBin SHQueryRecycleBinW #define SHEmptyRecycleBin SHEmptyRecycleBinW This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-31 23:52:08
|
Revision: 1038 http://cegcc.svn.sourceforge.net/cegcc/?rev=1038&view=rev Author: pedroalves Date: 2007-07-31 16:52:06 -0700 (Tue, 31 Jul 2007) Log Message: ----------- * include/winbase.h (DeregisterDevice, RegisterDevice): Declare. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winbase.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2007-07-02 01:46:14 UTC (rev 1037) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2007-07-31 23:52:06 UTC (rev 1038) @@ -1,3 +1,7 @@ +2007-08-01 Steven Hicks <cra...@gm...> + + * include/winbase.h (DeregisterDevice, RegisterDevice): Declare. + 2007-06-10 Pedro Alves <ped...@po...> * include/winbase.h (ActivateDevice, ActivateDeviceEx, Modified: trunk/cegcc/src/w32api/include/winbase.h =================================================================== --- trunk/cegcc/src/w32api/include/winbase.h 2007-07-02 01:46:14 UTC (rev 1037) +++ trunk/cegcc/src/w32api/include/winbase.h 2007-07-31 23:52:06 UTC (rev 1038) @@ -2524,6 +2524,8 @@ WINBASEAPI HANDLE WINAPI ActivateDevice(LPCWSTR, DWORD); WINBASEAPI HANDLE WINAPI ActivateDeviceEx(LPCWSTR, LPCVOID, DWORD, LPVOID); WINBASEAPI BOOL WINAPI DeactivateDevice(HANDLE); +WINBASEAPI BOOL DeregisterDevice(HANDLE); +WINBASEAPI HANDLE RegisterDevice(LPCWSTR, DWORD, LPCWSTR, DWORD); #endif /* _WIN32_WCE */ #ifdef __cplusplus This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-02 01:46:15
|
Revision: 1037 http://svn.sourceforge.net/cegcc/?rev=1037&view=rev Author: pedroalves Date: 2007-07-01 18:46:14 -0700 (Sun, 01 Jul 2007) Log Message: ----------- * rshd.c (create_child): Pass struct client_data_t* as parameter, instead of the pipe array pointers. Report CreatePipe and CreateProcess failures to the host. (handle_connection): Pass client_data to create_child. Don't report create_child failures here. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-07-02 01:20:56 UTC (rev 1036) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-07-02 01:46:14 UTC (rev 1037) @@ -1,5 +1,14 @@ 2007-07-02 Pedro Alves <ped...@po...> + Danny Backx <dan...@us...> + * rshd.c (create_child): Pass struct client_data_t* as parameter, + instead of the pipe array pointers. Report CreatePipe and + CreateProcess failures to the host. + (handle_connection): Pass client_data to create_child. Don't report + create_child failures here. + +2007-07-02 Pedro Alves <ped...@po...> + * rshd.c (handle_connection): If closing because the child died, wait for stdout to flush before closing the socket. Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-07-02 01:20:56 UTC (rev 1036) +++ trunk/cegcc/tools/rshd/rshd.c 2007-07-02 01:46:14 UTC (rev 1037) @@ -493,7 +493,9 @@ /* Start a new process. Returns the new process' handle on success, NULL on failure. */ static HANDLE -create_child (char *program, HANDLE *readh, HANDLE *writeh, PROCESS_INFORMATION *pi) +create_child (char *program, + struct client_data_t* child, + PROCESS_INFORMATION *pi) { BOOL ret; char *args; @@ -536,13 +538,31 @@ for (i = 0; i < 3; i++) { wchar_t devname[MAX_PATH]; - if (!CreatePipe (&readh[i], &writeh[i], NULL, 0)) - return NULL; + if (!CreatePipe (&child->readh[i], &child->writeh[i], NULL, 0)) + { + char buf[1024]; + DWORD err = GetLastError (); + if (err == ERROR_FILE_NOT_FOUND) + { + sprintf (buf, + "Error creating pipe. " + "Copy PipeDev.dll to the device.\n"); + logprintf ("%s", buf); + } + else + { + sprintf (buf, "Error creating pipe\n" + "%s (%lu)\n", strwinerror (err), err); + logprintf ("%s", buf); + } + send (child->sockfd, buf, strlen (buf), 0); + return NULL; + } wsprintf (devname, L"dev%d", i); - SetPipeTag (readh[i], devname); + SetPipeTag (child->readh[i], devname); - GetPipeName (readh[i], devname); + GetPipeName (child->readh[i], devname); DWORD dwLen = MAX_PATH; GetStdioPathW (i, prev_path[i], &dwLen); SetStdioPathW (i, devname); @@ -567,13 +587,19 @@ if (!ret) { DWORD err = GetLastError (); - fprintf (stderr, "Error creating process \"%s %s\", (error %d): %s\n", - program, args, (int) err, strwinerror (err)); + char buf[1024]; + sprintf (buf, + "Error creating process \"%s\"\n" + "%s (error %lu)\n", + program, strwinerror (err), err); + logprintf ("%s", buf); + send (child->sockfd, buf, strlen (buf), 0); + for (i = 0; i < 3; i++) { - SafeCloseHandle (&readh[i]); - SafeCloseHandle (&writeh[i]); + SafeCloseHandle (&child->readh[i]); + SafeCloseHandle (&child->writeh[i]); } return NULL; } @@ -827,17 +853,10 @@ client_data->stderrsockfd = stderrsockfd; logprintf ("handle_connection: starting command... \n"); - hndproc = create_child (command, client_data->readh, client_data->writeh, &pi); + hndproc = create_child (command, client_data, &pi); if (!hndproc) - { - static char buf[1024]; - DWORD err = GetLastError (); - logprintf ("handle_connection: ERROR can't create child process, " - "winerr %lu\n", err); - sprintf (buf, "can't create process\n%s\n", strwinerror (err)); - send (s2, buf, strlen (buf), 0); - goto shutdown; - } + /* create_child already reports the errors to the host. */ + goto shutdown; thread[0] = CreateThread (NULL, 0, stdin_thread, client_data, 0, NULL); thread[1] = CreateThread (NULL, 0, stdout_thread, client_data, 0, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-02 01:20:57
|
Revision: 1036 http://svn.sourceforge.net/cegcc/?rev=1036&view=rev Author: pedroalves Date: 2007-07-01 18:20:56 -0700 (Sun, 01 Jul 2007) Log Message: ----------- * PipeLib.cpp (CreatePipe): Handle unexpected ActivateDevice failures. Record last error as ERROR_TOO_MANY_OPEN_FILES when there aren't any pipe slots left. Modified Paths: -------------- trunk/cegcc/tools/PipeLib/ChangeLog trunk/cegcc/tools/PipeLib/PipeLib.cpp Modified: trunk/cegcc/tools/PipeLib/ChangeLog =================================================================== --- trunk/cegcc/tools/PipeLib/ChangeLog 2007-07-02 00:54:55 UTC (rev 1035) +++ trunk/cegcc/tools/PipeLib/ChangeLog 2007-07-02 01:20:56 UTC (rev 1036) @@ -1,3 +1,10 @@ +2007-07-02 Pedro Alves <ped...@po...> + Danny Backx <dan...@us...> + + * PipeLib.cpp (CreatePipe): Handle unexpected ActivateDevice + failures. Record last error as ERROR_TOO_MANY_OPEN_FILES when + there aren't any pipe slots left. + 2007-07-01 Pedro Alves <ped...@po...> * PipeDev.cpp (Write): Remove breaknext and its usage. Modified: trunk/cegcc/tools/PipeLib/PipeLib.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeLib.cpp 2007-07-02 00:54:55 UTC (rev 1035) +++ trunk/cegcc/tools/PipeLib/PipeLib.cpp 2007-07-02 01:20:56 UTC (rev 1036) @@ -147,6 +147,13 @@ RegDeleteKey (HKEY_LOCAL_MACHINE, wsKey); free (wsKey); + if (!h && GetLastError() != ERROR_DEVICE_IN_USE) + { + /* Something went wrong. Use GetLastError for extended + information. */ + return FALSE; + } + /* Although MSDN documents the error as INVALID_HANDLE_VALUE, I see it returning NULL here. */ if (h != INVALID_HANDLE_VALUE && h != NULL) @@ -154,7 +161,10 @@ } if (inst == MAX_INSTANCES) - return FALSE; + { + SetLastError (ERROR_TOO_MANY_OPEN_FILES); + return FALSE; + } /* name + num + ':' + '\0' */ wchar_t device_name[(sizeof (NAME_BASE) - 1) + 2 + 1 + 1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-02 00:56:29
|
Revision: 1035 http://svn.sourceforge.net/cegcc/?rev=1035&view=rev Author: pedroalves Date: 2007-07-01 17:54:55 -0700 (Sun, 01 Jul 2007) Log Message: ----------- * rshd.c (handle_connection): If closing because the child died, wait for stdout to flush before closing the socket. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-07-01 01:56:21 UTC (rev 1034) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-07-02 00:54:55 UTC (rev 1035) @@ -1,3 +1,8 @@ +2007-07-02 Pedro Alves <ped...@po...> + + * rshd.c (handle_connection): If closing because the child died, + wait for stdout to flush before closing the socket. + 2007-07-01 Pedro Alves <ped...@po...> * rshd.c (logprintf): Avoid name clash. Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-07-01 01:56:21 UTC (rev 1034) +++ trunk/cegcc/tools/rshd/rshd.c 2007-07-02 00:54:55 UTC (rev 1035) @@ -678,6 +678,7 @@ struct client_data_t* client_data; + HANDLE thread[3]; HANDLE waith[4]; HANDLE hndproc; DWORD stopped; @@ -822,6 +823,9 @@ /* send OK */ send (s2, "", 1, 0); + client_data->sockfd = s2; + client_data->stderrsockfd = stderrsockfd; + logprintf ("handle_connection: starting command... \n"); hndproc = create_child (command, client_data->readh, client_data->writeh, &pi); if (!hndproc) @@ -835,13 +839,13 @@ goto shutdown; } - client_data->sockfd = s2; - client_data->stderrsockfd = stderrsockfd; + thread[0] = CreateThread (NULL, 0, stdin_thread, client_data, 0, NULL); + thread[1] = CreateThread (NULL, 0, stdout_thread, client_data, 0, NULL); + thread[2] = CreateThread (NULL, 0, stderr_thread, client_data, 0, NULL); - waith[0] = CreateThread (NULL, 0, stdin_thread, client_data, 0, NULL); - waith[1] = CreateThread (NULL, 0, stdout_thread, client_data, 0, NULL); - waith[2] = CreateThread (NULL, 0, stderr_thread, client_data, 0, NULL); - waith[3] = hndproc; + for (i = 0; i < COUNTOF (thread); i++) + waith[i] = thread[i]; + waith[i] = hndproc; ResumeThread (pi.hThread); CloseHandle (pi.hThread); @@ -871,57 +875,66 @@ i++; abrupt = (h != hndproc - && !client_data->stop - && (GetExitCodeThread (h, &ec) && ec == 1)); + && !client_data->stop + && (GetExitCodeThread (h, &ec) && ec == 1)); - if (debug) + logprintf ("j = %ld, abrupt = %d, stopped = %ld, i = %d\n", + j, abrupt, stopped, i); + + + if (abrupt) { - fprintf (stderr, "j = %ld, abrupt = %d, stopped = %ld, i = %d\n", - j, abrupt, stopped, i); - fflush (stderr); + /* Record that we are stopping. */ + client_data->stop = 1; + + /* A thread died abruptly. This means the remote side + is gone (SIGINT p.ex.). Let's kill the child. */ + TerminateProcess (hndproc, 1); } - - if (abrupt - || (h == hndproc && stopped < COUNTOF (waith))) + else if (h == hndproc) { - int k; - - /* if (h == hndproc, the child died without ever opening - it's side of the pipe, so our threads didn't see it - close, because we never closed our side. */ - - /* Tell the threads we are stopping. */ + /* Record that we are stopping. */ client_data->stop = 1; - if (abrupt) - /* A thread died abruptly. This means the remote side - is gone (SIGINT p.ex.). Let's kill the child. */ - TerminateProcess (hndproc, 1); + /* Close our unused sides of the pipes, since the child + may have never opened its version, thus we might + never have closed them. If we don't do this, the + threads won't see the broken pipes, as the number of + readers/writers won't reach 0. */ + SafeCloseHandle (&client_data->readh[0]); + SafeCloseHandle (&client_data->writeh[1]); + SafeCloseHandle (&client_data->writeh[2]); + } - /* Close them now. */ - for (k = 0; k < 3; k++) + if (client_data->stop) + { + if (h == thread[1]) { - SafeCloseHandle (&client_data->writeh[k]); - SafeCloseHandle (&client_data->readh[k]); + /* The child is gone, and so is the stdout thread. + All the data is now flushed to the host. Close + the socket, enabling stdin_thread to unblock. */ + if (s2 != -1) + { + logprintf ("closing stdin/stdout socket\n"); + shutdown (s2, SD_BOTH); + closesocket (s2); + s2 = -1; + client_data->sockfd = -1; + } } - - /* Also close the sockets. At least stdin - will be frequenly blocked in a recv call. */ - if (s2 != -1) + else if (h == thread[2]) { - shutdown (s2, 2); - closesocket (s2); - s2 = -1; - client_data->sockfd = -1; + /* Not sure how the host rsh handles *only* stderr + closing. */ + if (stderrsockfd != -1) + { + logprintf ("closing socket stderr\n"); + shutdown (stderrsockfd, SD_BOTH); + closesocket (stderrsockfd); + stderrsockfd = -1; + client_data->stderrsockfd = -1; + } } - - if (stderrsockfd != -1) - { - shutdown (stderrsockfd, 2); - closesocket (stderrsockfd); - stderrsockfd = -1; - client_data->stderrsockfd = -1; - } } /* Let's not wait for this handle again. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-01 01:56:24
|
Revision: 1034 http://svn.sourceforge.net/cegcc/?rev=1034&view=rev Author: pedroalves Date: 2007-06-30 18:56:21 -0700 (Sat, 30 Jun 2007) Log Message: ----------- * rshd.c (logprintf): Avoid name clash. (initclientdata): Clear the correct pipes. (stdin_thread): Enhance comment. Add a totalread variable, and logprint it. (stdout_thread): Add a totalread variable, and logprint it. (stderr_thread): Likewise. (connect_stderr): Remove unneeded extra closesocket. (usage): Print to stdout instead of stderr. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-07-01 01:47:48 UTC (rev 1033) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-07-01 01:56:21 UTC (rev 1034) @@ -1,5 +1,16 @@ 2007-07-01 Pedro Alves <ped...@po...> + * rshd.c (logprintf): Avoid name clash. + (initclientdata): Clear the correct pipes. + (stdin_thread): Enhance comment. Add a totalread variable, and + logprint it. + (stdout_thread): Add a totalread variable, and logprint it. + (stderr_thread): Likewise. + (connect_stderr): Remove unneeded extra closesocket. + (usage): Print to stdout instead of stderr. + +2007-07-01 Pedro Alves <ped...@po...> + * rshd.c (stdin_thread): Revert previous commit - return 0 if the child is still running. (stdin_thread, stdout_thread, stderr_thread): Close reading and Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-07-01 01:47:48 UTC (rev 1033) +++ trunk/cegcc/tools/rshd/rshd.c 2007-07-01 01:56:21 UTC (rev 1034) @@ -54,15 +54,15 @@ { if (logfile) { - FILE *logfile = fopen(logfile, "a+"); + FILE *f = fopen(logfile, "a+"); - if (logfile) + if (f) { va_list ap; va_start (ap, fmt); - vfprintf (logfile, fmt, ap); + vfprintf (f, fmt, ap); va_end (ap); - fclose (logfile); + fclose (f); } } else if (debug) @@ -192,8 +192,8 @@ for (i = 0; i < 3; i++) { - data->readh[0] = INVALID_HANDLE_VALUE; - data->writeh[0] = INVALID_HANDLE_VALUE; + data->readh[i] = INVALID_HANDLE_VALUE; + data->writeh[i] = INVALID_HANDLE_VALUE; } data->stop = FALSE; @@ -257,7 +257,7 @@ broken due to the child closing them, and 1 if the remote side closed the sockets before the child died. We use this knowledge in the main WaitForMultipleObjects to kill the child if the remote - side closed the connection. */ + side closed the connection abruptly (user 'CTRL-C'ed, p.ex). */ static DWORD WINAPI stdin_thread (void *arg) @@ -265,6 +265,7 @@ struct client_data_t *data = arg; const char *thread_name = "stdin_thread"; DWORD ret = 0; + DWORD totalread = 0; addref_data (data); @@ -298,11 +299,17 @@ logprintf ("%s: connection closed\n", thread_name); break; } - - if (read) + else { DWORD dwwritten; + + totalread += read; + + logprintf ("%s (%d): totalread = %lu\n", + thread_name, __LINE__, totalread); + /* Stuff it into the child's stdin. */ + logprintf ("%s (%d): going to WriteFile\n", thread_name, __LINE__); if (!WriteFile (data->writeh[0], buf, read, &dwwritten, NULL)) { logprintf ("%s: broken pipe (2)\n", thread_name); @@ -316,6 +323,7 @@ returns something - which means the child opened stdin. */ SafeCloseHandle (&data->readh[0]); } + logprintf ("%s: written to pipe\n", thread_name); if (localecho) { @@ -339,6 +347,7 @@ struct client_data_t *data = arg; const char *thread_name = "stdout_thread"; DWORD ret = 0; + DWORD totalread = 0; addref_data (data); @@ -354,17 +363,18 @@ } else { - logprintf ("%s (%d): ReadFile ok: %lu\n", thread_name, __LINE__, read); /* We can't close the write side of the pipe until the child opens its version. Since it will only be open on the first stdout access, we have to wait until the read side returns something - which means the child opened stdout. */ SafeCloseHandle (&data->writeh[1]); - logprintf ("%s (%d): SafeCloseHandle ok\n", thread_name, __LINE__); } if (read) { int written; + totalread += read; + logprintf ("%s (%d): totalread = %lu\n", + thread_name, __LINE__, totalread); logprintf ("%s (%d): going to send\n", thread_name, __LINE__); written = send (data->sockfd, buf, read, 0); ret = 1; @@ -407,6 +417,7 @@ const char *thread_name = "stderr_thread"; int sockfd; DWORD ret = 0; + DWORD totalread = 0; addref_data (data); @@ -436,7 +447,11 @@ } if (read) { - int written = send (sockfd, buf, read, 0); + int written; + totalread += read; + logprintf ("%s (%d): totalread = %lu\n", + thread_name, __LINE__, totalread); + written = send (sockfd, buf, read, 0); ret = 1; if (written < 0) logprintf ("%s: write ERROR, winerr %d\n", @@ -633,7 +648,6 @@ } logprintf ("connect: %s\n", strwinerror (WSAGetLastError ()));; - closesocket (s); return -1; } @@ -1049,7 +1063,7 @@ static void usage (void) { - fprintf (stderr, + printf ( "%s: RSH server for Windows CE\n" "Usage: rsh [-h] [-d] [-e] [-l FILE]\n" "-h Give this help list\n" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-07-01 01:53:45
|
Revision: 1033 http://svn.sourceforge.net/cegcc/?rev=1033&view=rev Author: pedroalves Date: 2007-06-30 18:47:48 -0700 (Sat, 30 Jun 2007) Log Message: ----------- Damn stupid bug. Writes should block until *all* the data is flushed. * PipeDev.cpp (Write): Remove breaknext and its usage. Modified Paths: -------------- trunk/cegcc/tools/PipeLib/ChangeLog trunk/cegcc/tools/PipeLib/PipeDev.cpp Modified: trunk/cegcc/tools/PipeLib/ChangeLog =================================================================== --- trunk/cegcc/tools/PipeLib/ChangeLog 2007-06-30 23:55:43 UTC (rev 1032) +++ trunk/cegcc/tools/PipeLib/ChangeLog 2007-07-01 01:47:48 UTC (rev 1033) @@ -1,3 +1,7 @@ +2007-07-01 Pedro Alves <ped...@po...> + + * PipeDev.cpp (Write): Remove breaknext and its usage. + 2007-06-30 Pedro Alves <ped...@po...> * Makefile (download): Depend on all instead of only on Modified: trunk/cegcc/tools/PipeLib/PipeDev.cpp =================================================================== --- trunk/cegcc/tools/PipeLib/PipeDev.cpp 2007-06-30 23:55:43 UTC (rev 1032) +++ trunk/cegcc/tools/PipeLib/PipeDev.cpp 2007-07-01 01:47:48 UTC (rev 1033) @@ -180,7 +180,7 @@ { #ifndef NOLOCKS /* auto - only release one at a time. */ - EventHandle = CreateEvent (NULL, FALSE, FALSE, NULL); + EventHandle = CreateEvent (NULL, FALSE, FALSE, NULL); #endif } @@ -794,7 +794,6 @@ PipeDeviceContext* dev = pOpenContext->DeviceContext; - BOOL breaknext = FALSE; HANDLE Events[2]; do @@ -847,9 +846,6 @@ if (dwCount == 0) break; - - if (breaknext) - break; } LOG ("going to wait for event\n"); @@ -857,7 +853,6 @@ { case WAIT_OBJECT_0 + 1: LOG ("got read event\n"); - breaknext = TRUE; break; default: /* With either wait error or AbortEvent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-30 23:55:44
|
Revision: 1032 http://svn.sourceforge.net/cegcc/?rev=1032&view=rev Author: pedroalves Date: 2007-06-30 16:55:43 -0700 (Sat, 30 Jun 2007) Log Message: ----------- The "commit-as-fast-as-you-can-before-anyone-notices-the-lameness" commit. * rcp.c (LogThread): Use Sleep instead of WaitForSingleObject. Modified Paths: -------------- trunk/cegcc/tools/rcp/ChangeLog trunk/cegcc/tools/rcp/rcp.c Modified: trunk/cegcc/tools/rcp/ChangeLog =================================================================== --- trunk/cegcc/tools/rcp/ChangeLog 2007-06-30 23:50:20 UTC (rev 1031) +++ trunk/cegcc/tools/rcp/ChangeLog 2007-06-30 23:55:43 UTC (rev 1032) @@ -1,5 +1,9 @@ 2007-07-01 Pedro Alves <ped...@po...> + * rcp.c (LogThread): Use Sleep instead of WaitForSingleObject. + +2007-07-01 Pedro Alves <ped...@po...> + * rcp.c (error): Output a newline. (totalread): New global. (LogThread): New. Modified: trunk/cegcc/tools/rcp/rcp.c =================================================================== --- trunk/cegcc/tools/rcp/rcp.c 2007-06-30 23:50:20 UTC (rev 1031) +++ trunk/cegcc/tools/rcp/rcp.c 2007-06-30 23:55:43 UTC (rev 1032) @@ -118,10 +118,10 @@ int count = 0; while (1) - if (WAIT_TIMEOUT == (WaitForSingleObject (GetModuleHandle (NULL), 1000))) + { debug ("(%08d)\ttotalread = %lu\n", count++, totalread); - else - break; + Sleep (1000); + } return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-30 23:50:21
|
Revision: 1031 http://svn.sourceforge.net/cegcc/?rev=1031&view=rev Author: pedroalves Date: 2007-06-30 16:50:20 -0700 (Sat, 30 Jun 2007) Log Message: ----------- * rcp.c (error): Output a newline. (totalread): New global. (LogThread): New. (RcpReceive): Change log message when stdin is closed. Don't increment read counter when stdin returned 0 bytes. Increment totalread. (RcpSvrSend): Add to totalread. (RcpSvrRecv): Add to totalread. Don't wait for the extra NULL byte afterwards here. (rcp_main): If debugFlag is set, create the LogThread. Modified Paths: -------------- trunk/cegcc/tools/rcp/ChangeLog trunk/cegcc/tools/rcp/rcp.c Modified: trunk/cegcc/tools/rcp/ChangeLog =================================================================== --- trunk/cegcc/tools/rcp/ChangeLog 2007-06-30 23:34:03 UTC (rev 1030) +++ trunk/cegcc/tools/rcp/ChangeLog 2007-06-30 23:50:20 UTC (rev 1031) @@ -1,3 +1,16 @@ +2007-07-01 Pedro Alves <ped...@po...> + + * rcp.c (error): Output a newline. + (totalread): New global. + (LogThread): New. + (RcpReceive): Change log message when stdin is closed. Don't + increment read counter when stdin returned 0 bytes. Increment + totalread. + (RcpSvrSend): Add to totalread. + (RcpSvrRecv): Add to totalread. Don't wait for the extra NULL + byte afterwards here. + (rcp_main): If debugFlag is set, create the LogThread. + 2007-06-30 Pedro Alves <ped...@po...> * rcp.c (get_logfile): Delete. Modified: trunk/cegcc/tools/rcp/rcp.c =================================================================== --- trunk/cegcc/tools/rcp/rcp.c 2007-06-30 23:34:03 UTC (rev 1030) +++ trunk/cegcc/tools/rcp/rcp.c 2007-06-30 23:50:20 UTC (rev 1031) @@ -89,6 +89,7 @@ va_list ap; va_start (ap, format); vlog ("error: ", format, ap); + vlog ("", "\n", ap); va_end (ap); } } @@ -109,6 +110,22 @@ #define MIN(A, B) ((A) < (B) ? (A) : (B)) #endif +static volatile DWORD totalread; + +DWORD WINAPI +LogThread (void *arg) +{ + int count = 0; + + while (1) + if (WAIT_TIMEOUT == (WaitForSingleObject (GetModuleHandle (NULL), 1000))) + debug ("(%08d)\ttotalread = %lu\n", count++, totalread); + else + break; + + return 0; +} + /* This is the size of the buffer used with rcp */ #define RCP_BUFFER_SIZE 8192 @@ -125,26 +142,34 @@ int i; int rlen; char tchar; + int fildes = fileno (stdin); i = 0; buff[0] = 0; do { - rlen = read (fileno (stdin), &buff[i], 1); + rlen = read (fildes, &buff[i], 1); if (rlen == -1) { - error ("Cannot receive client data."); - return rlen; + error ("stdin closed.\n"); + return -1; } + if (rlen == 0) - debug ("...got %d chars. \n", rlen); - else - debug ("...got %d chars. [%c]\n", rlen, buff[i]); + { + debug ("...got 0 chars.\n"); + continue; + } + + debug ("...got 1 char. [%c]\n", buff[i]); tchar = buff[i]; i++; + totalread++; + if (i > blen) { /* The buffer has overflowed. */ + debug ("buffer overflow (%d/%d)\n", i, blen); SetLastError (WSAEMSGSIZE); return -1; } @@ -541,6 +566,8 @@ return; } + totalread += nBytesRead; + nBytesSent += nBytesRead; if (write (fileno (stdout), buff, nBytesRead) < 1) { @@ -870,6 +897,8 @@ return; } + totalread += dwBytes; + dwBytesRecv += dwBytes; debug ("Got %lu (%lu/%lu).\n", dwBytes, dwBytesRecv, dwFileSize); @@ -889,13 +918,6 @@ return; } } - - if ((dwBytes = read (fileno (stdin), buff, 1)) == -1) - error ("Cannot receive NULL byte."); - else if (buff[0] != '\0') - error ("Got invalid data (0x%02x).", (int)buff[0]); - else - debug ("Done receiving.\n"); } close (FileId); @@ -971,6 +993,9 @@ debug ("starting up\n"); + if (debugFlag) + CloseHandle (CreateThread (NULL, 0, LogThread, NULL, 0, NULL)); + if (bSvrRecv) { if (bRecursive) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-30 23:34:56
|
Revision: 1030 http://svn.sourceforge.net/cegcc/?rev=1030&view=rev Author: pedroalves Date: 2007-06-30 16:34:03 -0700 (Sat, 30 Jun 2007) Log Message: ----------- * rshd.c (stdin_thread): Revert previous commit - return 0 if the child is still running. (stdin_thread, stdout_thread, stderr_thread): Close reading and writing side of the pipes before returning. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 21:37:41 UTC (rev 1029) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 23:34:03 UTC (rev 1030) @@ -1,3 +1,10 @@ +2007-07-01 Pedro Alves <ped...@po...> + + * rshd.c (stdin_thread): Revert previous commit - return 0 if the + child is still running. + (stdin_thread, stdout_thread, stderr_thread): Close reading and + writing side of the pipes before returning. + 2007-06-30 Pedro Alves <ped...@po...> * rshd.c (create_child): Add a few comments. Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-06-30 21:37:41 UTC (rev 1029) +++ trunk/cegcc/tools/rshd/rshd.c 2007-06-30 23:34:03 UTC (rev 1030) @@ -296,8 +296,6 @@ else if (read == 0) { logprintf ("%s: connection closed\n", thread_name); - if (!data->stop) - ret = 1; break; } @@ -328,6 +326,8 @@ } out: + SafeCloseHandle (&data->readh[0]); + SafeCloseHandle (&data->writeh[0]); release_data (data); logprintf ("%s gone : %lu\n", thread_name, ret); return ret; @@ -393,6 +393,8 @@ } out: + SafeCloseHandle (&data->readh[1]); + SafeCloseHandle (&data->writeh[1]); release_data (data); logprintf ("%s gone : %lu\n", thread_name, ret); return ret; @@ -458,6 +460,8 @@ } out: + SafeCloseHandle (&data->readh[2]); + SafeCloseHandle (&data->writeh[2]); release_data (data); logprintf ("%s gone : %lu\n", thread_name, ret); return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-30 21:37:43
|
Revision: 1029 http://svn.sourceforge.net/cegcc/?rev=1029&view=rev Author: pedroalves Date: 2007-06-30 14:37:41 -0700 (Sat, 30 Jun 2007) Log Message: ----------- * rshd.c (create_child): Add a few comments. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 21:15:46 UTC (rev 1028) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 21:37:41 UTC (rev 1029) @@ -1,10 +1,14 @@ 2007-06-30 Pedro Alves <ped...@po...> - * rshd.c (stdin_thread): If connection closed gracefully but child - is still running, return 1. Remove unneeded log call. + * rshd.c (create_child): Add a few comments. 2007-06-30 Pedro Alves <ped...@po...> + * rshd.c (stdin_thread): If the connection closed gracefully but + the child is still running, return 1. Remove unneeded log call. + +2007-06-30 Pedro Alves <ped...@po...> + * Makefile (LDFLAGS): Clear. (CFLAGS): Remove PipeLib reference. (PIPELIBDIR): New. Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-06-30 21:15:46 UTC (rev 1028) +++ trunk/cegcc/tools/rshd/rshd.c 2007-06-30 21:37:41 UTC (rev 1029) @@ -507,8 +507,13 @@ to_back_slashes (program); wprogram = alloca ((strlen (program) + 1) * sizeof (wchar_t)); mbstowcs (wprogram, program, strlen (program) + 1); - /* Do the PipeLib/WinCE dup dance. */ + /* Do the PipeLib/WinCE dup dance: + Create the pipes, redirect stdin/stdout/stderr to them, + create the child, which inherits the parent's + stdin/stdout/stderr paths, and restore the parent's + paths. */ + for (i = 0; i < 3; i++) { wchar_t devname[MAX_PATH]; @@ -523,6 +528,7 @@ GetStdioPathW (i, prev_path[i], &dwLen); SetStdioPathW (i, devname); } + flags = CREATE_SUSPENDED; ret = CreateProcessW (wprogram, /* image name */ wargs, /* command line */ @@ -535,6 +541,7 @@ NULL, /* start info, not supported */ pi); /* proc info */ + /* Restore the paths. */ for (i = 0; i < 3; i++) SetStdioPathW (i, prev_path[i]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-06-30 21:15:48
|
Revision: 1028 http://svn.sourceforge.net/cegcc/?rev=1028&view=rev Author: pedroalves Date: 2007-06-30 14:15:46 -0700 (Sat, 30 Jun 2007) Log Message: ----------- * rshd.c (stdin_thread): If connection closed gracefully but child is still running, return 1. Remove unneeded log call. Modified Paths: -------------- trunk/cegcc/tools/rshd/ChangeLog trunk/cegcc/tools/rshd/rshd.c Modified: trunk/cegcc/tools/rshd/ChangeLog =================================================================== --- trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 21:13:29 UTC (rev 1027) +++ trunk/cegcc/tools/rshd/ChangeLog 2007-06-30 21:15:46 UTC (rev 1028) @@ -1,5 +1,10 @@ 2007-06-30 Pedro Alves <ped...@po...> + * rshd.c (stdin_thread): If connection closed gracefully but child + is still running, return 1. Remove unneeded log call. + +2007-06-30 Pedro Alves <ped...@po...> + * Makefile (LDFLAGS): Clear. (CFLAGS): Remove PipeLib reference. (PIPELIBDIR): New. Modified: trunk/cegcc/tools/rshd/rshd.c =================================================================== --- trunk/cegcc/tools/rshd/rshd.c 2007-06-30 21:13:29 UTC (rev 1027) +++ trunk/cegcc/tools/rshd/rshd.c 2007-06-30 21:15:46 UTC (rev 1028) @@ -296,6 +296,8 @@ else if (read == 0) { logprintf ("%s: connection closed\n", thread_name); + if (!data->stop) + ret = 1; break; } @@ -391,7 +393,6 @@ } out: - logprintf ("%s (%d): at out\n", thread_name, __LINE__); release_data (data); logprintf ("%s gone : %lu\n", thread_name, ret); return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |