From cdd7cd30db6f07590e478f2efb21def001076aba Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sun, 14 Feb 2010 14:18:13 +0000 Subject: [PATCH] 2010-02-14 15:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbwince.h * redirect GetProcAddress() to GetProcAddressA() in WinCE builds. ASCII version of GetProcAddress() is supported by WinCE 3.0 and later versions. * harbour/include/hbdefs.h - removed HBTEXT() macro * harbour/src/common/hbver.c * harbour/src/rtl/diskspac.c * harbour/src/rtl/disksphb.c * harbour/src/rtl/gtwvt/gtwvt.c * harbour/src/vm/extrap.c * harbour/src/vm/maindllp/dllpcode.c * harbour/contrib/gtwvg/gtwvg.c * harbour/contrib/gtwvg/gtwvg.h * harbour/contrib/gtwvg/wvgwin.c * harbour/contrib/hbwin/wapi_winbase.c * harbour/contrib/hbwin/axcore.c * harbour/contrib/hbwin/mapi.c * harbour/contrib/hbwin/win_prn2.c * harbour/contrib/hbwin/win_prn3.c * harbour/contrib/hbwin/wapi_shellapi.c * eliminated HBTEXT() macro * harbour/src/rtl/diskspac.c * harbour/src/rtl/disksphb.c * harbour/contrib/hbwin/wapi_winbase.c % optimized GetProcAddress() calls to store function addresses in static variables --- harbour/ChangeLog | 32 ++++++++++++++++++++++++++ harbour/contrib/gtwvg/gtwvg.c | 21 +++-------------- harbour/contrib/gtwvg/gtwvg.h | 4 ++++ harbour/contrib/gtwvg/wvgwin.c | 6 +---- harbour/contrib/hbwin/axcore.c | 7 ++++-- harbour/contrib/hbwin/mapi.c | 5 +++- harbour/contrib/hbwin/wapi_shellapi.c | 6 ++++- harbour/contrib/hbwin/wapi_winbase.c | 33 ++++++++------------------- harbour/contrib/hbwin/win_prn2.c | 4 ++-- harbour/contrib/hbwin/win_prn3.c | 4 ++-- harbour/include/hbdefs.h | 5 ---- harbour/include/hbwince.h | 6 +++++ harbour/src/common/hbver.c | 5 +++- harbour/src/rtl/diskspac.c | 32 ++++++++++++++++---------- harbour/src/rtl/disksphb.c | 31 ++++++++++++++----------- harbour/src/rtl/gtwvt/gtwvt.c | 2 +- harbour/src/vm/extrap.c | 6 ++--- harbour/src/vm/maindllp/dllpcode.c | 10 ++++---- 18 files changed, 124 insertions(+), 95 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cc44eca0f0..38694a754b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,38 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-14 15:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbwince.h + * redirect GetProcAddress() to GetProcAddressA() in WinCE builds. + ASCII version of GetProcAddress() is supported by WinCE 3.0 and + later versions. + + * harbour/include/hbdefs.h + - removed HBTEXT() macro + + * harbour/src/common/hbver.c + * harbour/src/rtl/diskspac.c + * harbour/src/rtl/disksphb.c + * harbour/src/rtl/gtwvt/gtwvt.c + * harbour/src/vm/extrap.c + * harbour/src/vm/maindllp/dllpcode.c + * harbour/contrib/gtwvg/gtwvg.c + * harbour/contrib/gtwvg/gtwvg.h + * harbour/contrib/gtwvg/wvgwin.c + * harbour/contrib/hbwin/wapi_winbase.c + * harbour/contrib/hbwin/axcore.c + * harbour/contrib/hbwin/mapi.c + * harbour/contrib/hbwin/win_prn2.c + * harbour/contrib/hbwin/win_prn3.c + * harbour/contrib/hbwin/wapi_shellapi.c + * eliminated HBTEXT() macro + + * harbour/src/rtl/diskspac.c + * harbour/src/rtl/disksphb.c + * harbour/contrib/hbwin/wapi_winbase.c + % optimized GetProcAddress() calls to store function addresses + in static variables + 2010-02-14 15:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/hbdyn.c ! Fixed handling of HB_DYN_ENC_RAW and HB_DYN_CTYPE_CHAR_UNSIGNED diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 985fa5c81b..fc6ac78e0e 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -2556,15 +2556,9 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) { typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD ); -#if defined( UNICODE ) && defined( GetProcAddress ) P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - HBTEXT( "SetLayeredWindowAttributes" ) ); -#else - P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) - GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - HBTEXT( "SetLayeredWindowAttributes" ) ); -#endif + "SetLayeredWindowAttributes" ); if( pSetLayeredWindowAttributes ) { @@ -4188,11 +4182,7 @@ static void hb_wvt_gtLoadGuiData( void ) if( h ) { /* workaround for wrong declarations in some old C compilers */ -#if defined( UNICODE ) && defined( GetProcAddress ) - s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddressW( h, HBTEXT( "GradientFill" ) ); -#else - s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, HBTEXT( "GradientFill" ) ); -#endif + s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, "GradientFill" ); if( s_guiData->pfnGF ) { s_guiData->hMSImg32 = h; @@ -4202,12 +4192,7 @@ static void hb_wvt_gtLoadGuiData( void ) h = LoadLibraryEx( TEXT( "user32.dll" ), NULL, 0 ); if( h ) { - /* workaround for wrong declarations in some old C compilers */ -#if defined( UNICODE ) && defined( GetProcAddress ) - s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) ); -#else - s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) ); -#endif + s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" ); if( s_guiData->pfnLayered ) { s_guiData->hUser32 = h; diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index 055de38429..cf3b949a52 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -100,6 +100,10 @@ #include "hbgtwvg.ch" +#if defined( HB_OS_WIN_CE ) + #include "hbwince.h" +#endif + HB_EXTERN_BEGIN /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/gtwvg/wvgwin.c b/harbour/contrib/gtwvg/wvgwin.c index 455d298d7b..bd99124d5c 100644 --- a/harbour/contrib/gtwvg/wvgwin.c +++ b/harbour/contrib/gtwvg/wvgwin.c @@ -1158,11 +1158,7 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES ) h = LoadLibraryEx( TEXT( "user32.dll" ), NULL, 0 ); if( h ) { -#if defined( UNICODE ) && defined( GetProcAddress ) - pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) ); -#else - pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) ); -#endif + pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" ); if( pfnLayered ) { HWND hWnd = wapi_par_HWND( 1 ); diff --git a/harbour/contrib/hbwin/axcore.c b/harbour/contrib/hbwin/axcore.c index fbd87c7f6e..3c7755cbc7 100644 --- a/harbour/contrib/hbwin/axcore.c +++ b/harbour/contrib/hbwin/axcore.c @@ -51,6 +51,9 @@ */ #include "hbwinole.h" +#if defined( HB_OS_WIN_CE ) + #include "hbwince.h" +#endif typedef BOOL ( CALLBACK * PHB_AX_WININIT )( void ); typedef HRESULT ( CALLBACK * PHB_AX_GETCTRL )( HWND, IUnknown** ); @@ -103,8 +106,8 @@ HB_BOOL hb_oleAxInit( void ) s_hLib = NULL; return HB_FALSE; } - pAtlAxWinInit = ( PHB_AX_WININIT ) GetProcAddress( s_hLib, HBTEXT( "AtlAxWinInit" ) ); - s_pAtlAxGetControl = ( PHB_AX_GETCTRL ) GetProcAddress( s_hLib, HBTEXT( "AtlAxGetControl" ) ); + pAtlAxWinInit = ( PHB_AX_WININIT ) GetProcAddress( s_hLib, "AtlAxWinInit" ); + s_pAtlAxGetControl = ( PHB_AX_GETCTRL ) GetProcAddress( s_hLib, "AtlAxGetControl" ); if( pAtlAxWinInit ) ( *pAtlAxWinInit )(); diff --git a/harbour/contrib/hbwin/mapi.c b/harbour/contrib/hbwin/mapi.c index b2e5c6ec8e..85f2c707ea 100644 --- a/harbour/contrib/hbwin/mapi.c +++ b/harbour/contrib/hbwin/mapi.c @@ -52,6 +52,9 @@ */ #include "hbwin.h" +#if defined( HB_OS_WIN_CE ) + #include "hbwince.h" +#endif #include @@ -80,7 +83,7 @@ HB_FUNC( WIN_MAPISENDMAIL ) if( ( hMapiDll = LoadLibrary( TEXT( "mapi32.dll" ) ) ) >= ( HINSTANCE ) 32 ) { - LPMAPISENDMAIL MAPISendMail = ( LPMAPISENDMAIL ) GetProcAddress( hMapiDll, HBTEXT( "MAPISendMail" ) ); + LPMAPISENDMAIL MAPISendMail = ( LPMAPISENDMAIL ) GetProcAddress( hMapiDll, "MAPISendMail" ); if( MAPISendMail ) { diff --git a/harbour/contrib/hbwin/wapi_shellapi.c b/harbour/contrib/hbwin/wapi_shellapi.c index 7886f97947..5d03493f1f 100644 --- a/harbour/contrib/hbwin/wapi_shellapi.c +++ b/harbour/contrib/hbwin/wapi_shellapi.c @@ -51,6 +51,9 @@ */ #include "hbwapi.h" +#if defined( HB_OS_WIN_CE ) + #include "hbwince.h" +#endif HB_FUNC( WAPI_SHELLEXECUTE ) { @@ -85,7 +88,8 @@ HB_FUNC( WAPI_ISUSERANADMIN ) if( hLib ) { typedef int ( WINAPI * ISUSERANADMIN )( void ); - ISUSERANADMIN pIsUserAnAdmin = ( ISUSERANADMIN ) GetProcAddress( hLib, HBTEXT( "IsUserAnAdmin" ) ); + ISUSERANADMIN pIsUserAnAdmin = ( ISUSERANADMIN ) + GetProcAddress( hLib, "IsUserAnAdmin" ); if( pIsUserAnAdmin ) bResult = ( pIsUserAnAdmin )(); diff --git a/harbour/contrib/hbwin/wapi_winbase.c b/harbour/contrib/hbwin/wapi_winbase.c index c88707e158..41439887a9 100644 --- a/harbour/contrib/hbwin/wapi_winbase.c +++ b/harbour/contrib/hbwin/wapi_winbase.c @@ -225,19 +225,9 @@ HB_FUNC( WAPI_GETPROCADDRESS ) { FARPROC pProc; DWORD dwLastError; -#if defined( HB_OS_WIN_CE ) - void * hProcName; - - pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ), HB_ISCHAR( 2 ) ? - hb_parstr_u16( 2, HB_CDP_ENDIAN_NATIVE, &hProcName, NULL ) : - ( LPCTSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) ); - dwLastError = GetLastError(); - hb_strfree( hProcName ); -#else pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ), HB_ISCHAR( 2 ) ? hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) ); dwLastError = GetLastError(); -#endif hbwapi_SetLastError( dwLastError ); hb_retptr( ( void * ) pProc ); } @@ -370,20 +360,17 @@ HB_FUNC( WAPI_GETSHORTPATHNAME ) HB_FUNC( WAPI_GETLONGPATHNAME ) { - _HB_GETPATHNAME getPathName = NULL; - HMODULE hLib = LoadLibrary( TEXT( "kernel32.dll" ) ); + static _HB_GETPATHNAME s_getPathNameAddr = NULL; - if( hLib ) - getPathName = ( _HB_GETPATHNAME ) - GetProcAddress( hLib, HBTEXT( "GetLongPathName" ) ); - - if( !getPathName ) - getPathName = GetShortPathName; - - s_getPathName( getPathName ); - - if( hLib ) - FreeLibrary( hLib ); + if( !s_getPathNameAddr ) + { + s_getPathNameAddr = ( _HB_GETPATHNAME ) + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), + "GetLongPathName" ); + if( !s_getPathNameAddr ) + s_getPathNameAddr = GetShortPathName; + } + s_getPathName( s_getPathNameAddr ); } #endif diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index a7733d2390..02a271bfe2 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -135,9 +135,9 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName ) { fnGetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool, #if defined( UNICODE ) - HBTEXT( "GetDefaultPrinterW" ) ); + "GetDefaultPrinterW" ); #else - HBTEXT( "GetDefaultPrinterA" ) ); + "GetDefaultPrinterA" ); #endif if( fnGetDefaultPrinter ) diff --git a/harbour/contrib/hbwin/win_prn3.c b/harbour/contrib/hbwin/win_prn3.c index 3eefa77622..07c970b755 100644 --- a/harbour/contrib/hbwin/win_prn3.c +++ b/harbour/contrib/hbwin/win_prn3.c @@ -165,9 +165,9 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName ) return HB_FALSE; fnSetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool, #if defined( UNICODE ) - HBTEXT( "SetDefaultPrinterW" ) ); + "SetDefaultPrinterW" ); #else - HBTEXT( "SetDefaultPrinterA" ) ); + "SetDefaultPrinterA" ); #endif if( ! fnSetDefaultPrinter ) { diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 3d5a3f7790..f048327878 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -1583,11 +1583,6 @@ typedef HB_U32 HB_FATTR; extern HB_EXPORT void hb_wctombget( char * dstA, const wchar_t * srcW, HB_SIZE ulLen ); HB_EXTERN_END - #if defined( HB_OS_WIN_CE ) - #define HBTEXT( x ) TEXT( x ) - #else - #define HBTEXT( x ) x - #endif #endif #if defined( HB_OS_WIN ) && defined( UNICODE ) diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index e91405f893..cfb35e4572 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -58,6 +58,12 @@ #include +/* use ASCII version of GetProcAddress() to keep the same code for desktop + * windows and WinCE/Mobile. It's supported by WinCE 3.0 and later versions. + */ +#undef GetProcAddress +#define GetProcAddress GetProcAddressA + HB_EXTERN_BEGIN #if defined( _MSC_VER ) diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index 13b83871f3..780d16e7c6 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -80,6 +80,9 @@ #if defined( HB_OS_WIN ) #include + #if defined( HB_OS_WIN_CE ) + #include "hbwince.h" + #endif #ifndef VER_PLATFORM_WIN32_WINDOWS #define VER_PLATFORM_WIN32_WINDOWS 1 @@ -269,7 +272,7 @@ char * hb_verPlatform( void ) const char * pszWine = ""; const char * pszName = ""; - if( hntdll && GetProcAddress( hntdll, HBTEXT( "wine_get_version" ) ) ) + if( hntdll && GetProcAddress( hntdll, "wine_get_version" ) ) pszWine = " (Wine)"; switch( osVer.dwPlatformId ) diff --git a/harbour/src/rtl/diskspac.c b/harbour/src/rtl/diskspac.c index 72167a7f31..a345a9e48c 100644 --- a/harbour/src/rtl/diskspac.c +++ b/harbour/src/rtl/diskspac.c @@ -154,20 +154,28 @@ HB_FUNC( DISKSPACE ) { typedef BOOL ( WINAPI * P_GDFSE )( LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER ); - P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE ) - GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), -#if defined( UNICODE ) - HBTEXT( "GetDiskFreeSpaceExW" ) ); -#else - HBTEXT( "GetDiskFreeSpaceExA" ) ); -#endif - if( pGetDiskFreeSpaceEx ) + static P_GDFSE s_pGetDiskFreeSpaceEx = NULL; + static HB_BOOL s_fInit = HB_FALSE; + + if( !s_fInit ) { - bError = pGetDiskFreeSpaceEx( lpPath, - ( PULARGE_INTEGER ) &i64FreeBytesToCaller, - ( PULARGE_INTEGER ) &i64TotalBytes, - ( PULARGE_INTEGER ) &i64FreeBytes ) ? HB_FALSE : HB_TRUE; + s_fInit = HB_TRUE; + s_pGetDiskFreeSpaceEx = ( P_GDFSE ) + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), +#if defined( UNICODE ) + "GetDiskFreeSpaceExW" ); +#else + "GetDiskFreeSpaceExA" ); +#endif + } + + if( s_pGetDiskFreeSpaceEx ) + { + bError = s_pGetDiskFreeSpaceEx( lpPath, + ( PULARGE_INTEGER ) &i64FreeBytesToCaller, + ( PULARGE_INTEGER ) &i64TotalBytes, + ( PULARGE_INTEGER ) &i64FreeBytes ) ? HB_FALSE : HB_TRUE; if( ! bError ) dSpace = HB_GET_LARGE_UINT( i64FreeBytesToCaller ); } diff --git a/harbour/src/rtl/disksphb.c b/harbour/src/rtl/disksphb.c index aa41fa7806..5240d4f85f 100644 --- a/harbour/src/rtl/disksphb.c +++ b/harbour/src/rtl/disksphb.c @@ -210,24 +210,29 @@ HB_FUNC( HB_DISKSPACE ) } #else { - typedef BOOL ( WINAPI * P_GDFSE )( LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER ); - P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE ) - GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), -#if defined( UNICODE ) - HBTEXT( "GetDiskFreeSpaceExW" ) ); -#else - HBTEXT( "GetDiskFreeSpaceExA" ) ); -#endif + static P_GDFSE s_pGetDiskFreeSpaceEx = NULL; + static HB_BOOL s_fInit = HB_FALSE; - if( pGetDiskFreeSpaceEx ) + if( !s_fInit ) { - fResult = pGetDiskFreeSpaceEx( lpPath, - ( PULARGE_INTEGER ) &i64FreeBytesToCaller, - ( PULARGE_INTEGER ) &i64TotalBytes, - ( PULARGE_INTEGER ) &i64FreeBytes ) ? HB_TRUE : HB_FALSE; + s_fInit = HB_TRUE; + s_pGetDiskFreeSpaceEx = ( P_GDFSE ) + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), +#if defined( UNICODE ) + "GetDiskFreeSpaceExW" ); +#else + "GetDiskFreeSpaceExA" ); +#endif + } + if( s_pGetDiskFreeSpaceEx ) + { + fResult = s_pGetDiskFreeSpaceEx( lpPath, + ( PULARGE_INTEGER ) &i64FreeBytesToCaller, + ( PULARGE_INTEGER ) &i64TotalBytes, + ( PULARGE_INTEGER ) &i64FreeBytes ) ? HB_TRUE : HB_FALSE; hb_fsSetIOError( fResult, 0 ); if( fResult ) { diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 1d9c46cc69..f8426bac65 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -1860,7 +1860,7 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), - HBTEXT( "SetLayeredWindowAttributes" ) ); + "SetLayeredWindowAttributes" ); if( pSetLayeredWindowAttributes ) { diff --git a/harbour/src/vm/extrap.c b/harbour/src/vm/extrap.c index 182521db6e..345c373720 100644 --- a/harbour/src/vm/extrap.c +++ b/harbour/src/vm/extrap.c @@ -234,9 +234,9 @@ static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExcepti typedef BOOL ( WINAPI * P_M32F )( HANDLE, LPMODULEENTRY32 ); /* Module32First() */ typedef BOOL ( WINAPI * P_M32N )( HANDLE, LPMODULEENTRY32 ); /* Module32Next() */ - P_CTH32SSH pCreateToolhelp32Snapshot = ( P_CTH32SSH ) GetProcAddress( hKernel32, HBTEXT( "CreateToolhelp32Snapshot" ) ); - P_M32F pModule32First = ( P_M32F ) GetProcAddress( hKernel32, HBTEXT( "Module32First" ) ); - P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hKernel32, HBTEXT( "Module32Next" ) ); + P_CTH32SSH pCreateToolhelp32Snapshot = ( P_CTH32SSH ) GetProcAddress( hKernel32, "CreateToolhelp32Snapshot" ); + P_M32F pModule32First = ( P_M32F ) GetProcAddress( hKernel32, "Module32First" ); + P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hKernel32, "Module32Next" ); if( pCreateToolhelp32Snapshot && pModule32First && diff --git a/harbour/src/vm/maindllp/dllpcode.c b/harbour/src/vm/maindllp/dllpcode.c index ffa1581b1f..30b4ea2e0d 100644 --- a/harbour/src/vm/maindllp/dllpcode.c +++ b/harbour/src/vm/maindllp/dllpcode.c @@ -58,6 +58,9 @@ #if defined( HB_OS_WIN ) #include + #if defined( HB_OS_WIN_CE ) + #include "hbwince.h" + #endif #endif #define HB_DLL_PREF TEXT( "harbour" ) @@ -146,12 +149,7 @@ PHB_FUNC hb_dllGetProcAddress( const char * szProcName ) if( s_hModule != NULL ) { -#if defined( HB_OS_WIN_CE ) -# define HBTEXTSTR LPCTSTR -#else -# define HBTEXTSTR LPCSTR -#endif - static HBTEXTSTR s_szGetProcAddr = HBTEXT( "_dll_hb_vmProcAddress" ); + static const char * s_szGetProcAddr = "_dll_hb_vmProcAddress"; int i = 6; do