2009-12-21 14:38 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbwince.h
+ added hack for missing GetEnvironmentVariable?() declarations in
POCC header files for WinCE.
* harbour/src/common/hbwince.c
* minor simplification
* harbour/src/pp/pplib.c
* workaround for MSVC6 errors
This commit is contained in:
@@ -17,6 +17,17 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-12-21 14:38 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbwince.h
|
||||
+ added hack for missing GetEnvironmentVariable?() declarations in
|
||||
POCC header files for WinCE.
|
||||
|
||||
* harbour/src/common/hbwince.c
|
||||
* minor simplification
|
||||
|
||||
* harbour/src/pp/pplib.c
|
||||
* workaround for MSVC6 errors
|
||||
|
||||
2009-12-21 13:33 UTC+0500 April White (april users.sourceforge.net)
|
||||
* contrib/hbbtree/hb_btree.c
|
||||
* formatting
|
||||
|
||||
@@ -183,6 +183,12 @@ extern char * strerror( int errnum );
|
||||
#endif
|
||||
#endif /* HB_OS_WIN_USED && _MSC_VER */
|
||||
|
||||
#if !defined( GetEnvironmentVariable )
|
||||
DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size );
|
||||
DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size );
|
||||
#define GetEnvironmentVariable GetEnvironmentVariableW
|
||||
#endif
|
||||
|
||||
#endif /* HB_OS_WIN_CE */
|
||||
|
||||
extern HB_EXPORT wchar_t * hb_mbtowc( const char *srcA );
|
||||
|
||||
@@ -187,7 +187,6 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size )
|
||||
/* use registry instead of "environment variable". */
|
||||
HKEY hk;
|
||||
LONG lret;
|
||||
LPBYTE lpData;
|
||||
DWORD dwType = REG_SZ, cbData;
|
||||
TCHAR buf[ MAX_PATH ] = { 0 };
|
||||
LPWSTR wname;
|
||||
@@ -202,28 +201,25 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size )
|
||||
return 0;
|
||||
}
|
||||
|
||||
lpData = ( LPBYTE ) buf;
|
||||
cbData = MAX_PATH * sizeof( *buf );
|
||||
wname = hb_mbtowc( name );
|
||||
|
||||
lret = RegQueryValueExW( hk, wname, NULL, &dwType, lpData, &cbData );
|
||||
lret = RegQueryValueExW( hk, wname, NULL, &dwType, ( LPBYTE ) buf, &cbData );
|
||||
hb_xfree( wname );
|
||||
RegCloseKey( hk );
|
||||
|
||||
if( lret != ERROR_SUCCESS )
|
||||
{
|
||||
if( value && size )
|
||||
value[ 0 ] = '\0';
|
||||
hb_xfree( wname );
|
||||
return 0;
|
||||
}
|
||||
|
||||
avalue = hb_wctomb( ( LPCWSTR ) lpData );
|
||||
avalue = hb_wctomb( buf );
|
||||
if( value && size )
|
||||
hb_strncpy( value, avalue, size - 1 );
|
||||
size = strlen( avalue );
|
||||
|
||||
hb_xfree( avalue );
|
||||
hb_xfree( wname );
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -60,16 +60,6 @@
|
||||
|
||||
HB_EXTERN_BEGIN
|
||||
|
||||
static HB_GARBAGE_FUNC( hb_pp_Destructor );
|
||||
static void hb_pp_ErrorMessage( void * cargo, const char * szMsgTable[],
|
||||
char cPrefix, int iCode,
|
||||
const char * szParam1, const char * szParam2 );
|
||||
static void hb_pp_Disp( void * cargo, const char * szMessage );
|
||||
static BOOL hb_pp_CompilerSwitch( void * cargo, const char * szSwitch,
|
||||
int iValue );
|
||||
|
||||
HB_EXTERN_END
|
||||
|
||||
static void hb_pp_ErrorMessage( void * cargo, const char * szMsgTable[],
|
||||
char cPrefix, int iCode,
|
||||
const char * szParam1, const char * szParam2 )
|
||||
@@ -122,6 +112,8 @@ static HB_GARBAGE_FUNC( hb_pp_Destructor )
|
||||
}
|
||||
}
|
||||
|
||||
HB_EXTERN_END
|
||||
|
||||
static const HB_GC_FUNCS s_gcPPFuncs =
|
||||
{
|
||||
hb_pp_Destructor,
|
||||
|
||||
Reference in New Issue
Block a user