2014-02-01 09:11 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/hbwince.h
    - removed GetProcAddress() redefinition which forced ANSI
      version not supported in recent Windows Mobile MSVC libraries

  * include/hbwinuni.h
    + added new macros which hide differences between Windows systems
      in GetProcAddress() usage: HB_WINAPI_GETPROCADDRESS() and
      HB_WINAPI_GETPROCADDRESST()
      The second one adds "W" or "A" suffix to function names.
    - removed not longer used HB_WINAPI_FUNCTION_NAME() macro

  * src/vm/dynlibhb.c
    * updated hb_libSymAddr() to work with Unicode version of
      GetProcAddress() in WinCE builds

  * src/vm/maindllp/dllpcode.c
    * updated hb_dllGetProcAddress() to work with Unicode version of
      GetProcAddress() in WinCE builds

  * contrib/hbwin/wapi_winbase.c
    * updated WAPI_GetProcAddress() to work with Unicode version of
      GetProcAddress() in WinCE builds

  * src/common/hbdate.c
  * src/common/hbver.c
  * src/rtl/diskspac.c
  * src/rtl/disksphb.c
  * src/rtl/fslink.c
  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
  * src/vm/extrap.c
  * contrib/gtwvg/gtwvgd.c
  * contrib/gtwvg/wvgwin.c
  * contrib/hbwin/axcore.c
  * contrib/hbwin/mapi.c
  * contrib/hbwin/wapi_shellapi.c
  * contrib/hbwin/wapi_winbase.c
  * contrib/hbwin/wapi_wingdi_font.c
  * contrib/hbwin/win_prn2.c
  * contrib/hbwin/win_prn3.c
  * contrib/hbwin/win_rpc.c
  * extras/gtwvw/gtwvwd.c
    * use HB_WINAPI_GETPROCADDRESS*()
This commit is contained in:
Przemysław Czerpak
2014-02-01 09:11:23 +01:00
parent e82806cc1b
commit 43a0697b3d
24 changed files with 131 additions and 61 deletions

View File

@@ -10,6 +10,51 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2014-02-01 09:11 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbwince.h
- removed GetProcAddress() redefinition which forced ANSI
version not supported in recent Windows Mobile MSVC libraries
* include/hbwinuni.h
+ added new macros which hide differences between Windows systems
in GetProcAddress() usage: HB_WINAPI_GETPROCADDRESS() and
HB_WINAPI_GETPROCADDRESST()
The second one adds "W" or "A" suffix to function names.
- removed not longer used HB_WINAPI_FUNCTION_NAME() macro
* src/vm/dynlibhb.c
* updated hb_libSymAddr() to work with Unicode version of
GetProcAddress() in WinCE builds
* src/vm/maindllp/dllpcode.c
* updated hb_dllGetProcAddress() to work with Unicode version of
GetProcAddress() in WinCE builds
* contrib/hbwin/wapi_winbase.c
* updated WAPI_GetProcAddress() to work with Unicode version of
GetProcAddress() in WinCE builds
* src/common/hbdate.c
* src/common/hbver.c
* src/rtl/diskspac.c
* src/rtl/disksphb.c
* src/rtl/fslink.c
* src/rtl/gtwin/gtwin.c
* src/rtl/gtwvt/gtwvt.c
* src/vm/extrap.c
* contrib/gtwvg/gtwvgd.c
* contrib/gtwvg/wvgwin.c
* contrib/hbwin/axcore.c
* contrib/hbwin/mapi.c
* contrib/hbwin/wapi_shellapi.c
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/wapi_wingdi_font.c
* contrib/hbwin/win_prn2.c
* contrib/hbwin/win_prn3.c
* contrib/hbwin/win_rpc.c
* extras/gtwvw/gtwvwd.c
* use HB_WINAPI_GETPROCADDRESS*()
2014-01-30 16:28 UTC-0200 Raphael Gozzo (raphaelgz users.noreply.github.com)
* package/harbour.spec
+ Added detection of CentOS

View File

@@ -2702,10 +2702,10 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT )
rt.bottom = 0;
#ifdef MONITOR_DEFAULTTONEAREST
pMonitorFromWindow = ( P_MFW ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"MonitorFromWindow" );
pGetMonitorInfo = ( P_GMI ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"GetMonitorInfo" );
pMonitorFromWindow = ( P_MFW ) HB_WINAPI_GETPROCADDRESS( GetModuleHandle( TEXT( "user32.dll" ) ),
"MonitorFromWindow" );
pGetMonitorInfo = ( P_GMI ) HB_WINAPI_GETPROCADDRESS( GetModuleHandle( TEXT( "user32.dll" ) ),
"GetMonitorInfo" );
if( pMonitorFromWindow && pGetMonitorInfo )
{
@@ -4313,7 +4313,7 @@ static void hb_wvt_gtLoadGuiData( void )
if( h )
{
/* workaround for wrong declarations in some old C compilers */
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, "GradientFill" );
s_guiData->pfnGF = ( wvtGradientFill ) HB_WINAPI_GETPROCADDRESS( h, "GradientFill" );
if( s_guiData->pfnGF )
s_guiData->hMSImg32 = h;
}
@@ -4321,7 +4321,7 @@ static void hb_wvt_gtLoadGuiData( void )
h = GetModuleHandle( TEXT( "user32.dll" ) );
if( h )
{
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) HB_WINAPI_GETPROCADDRESS( h, "SetLayeredWindowAttributes" );
if( s_guiData->pfnLayered )
s_guiData->hUser32 = h;
}

View File

@@ -1036,7 +1036,7 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES )
h = GetModuleHandle( TEXT( "user32.dll" ) );
if( h )
{
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );
pfnLayered = ( wvtSetLayeredWindowAttributes ) HB_WINAPI_GETPROCADDRESS( h, "SetLayeredWindowAttributes" );
if( pfnLayered )
{
HWND hWnd = hbwapi_par_raw_HWND( 1 );

View File

@@ -109,8 +109,8 @@ HB_BOOL hb_oleAxInit( void )
s_hLib = NULL;
return HB_FALSE;
}
pAtlAxWinInit = ( PHB_AX_WININIT ) GetProcAddress( s_hLib, "AtlAxWinInit" );
s_pAtlAxGetControl = ( PHB_AX_GETCTRL ) GetProcAddress( s_hLib, "AtlAxGetControl" );
pAtlAxWinInit = ( PHB_AX_WININIT ) HB_WINAPI_GETPROCADDRESS( s_hLib, "AtlAxWinInit" );
s_pAtlAxGetControl = ( PHB_AX_GETCTRL ) HB_WINAPI_GETPROCADDRESS( s_hLib, "AtlAxGetControl" );
if( pAtlAxWinInit )
( *pAtlAxWinInit )();

View File

@@ -93,7 +93,7 @@ HB_FUNC( WIN_MAPISENDMAIL )
#endif
) ) >= ( HINSTANCE ) 32 )
{
LPMAPISENDMAIL MAPISendMail = ( LPMAPISENDMAIL ) GetProcAddress( hMapiDll, "MAPISendMail" );
LPMAPISENDMAIL MAPISendMail = ( LPMAPISENDMAIL ) HB_WINAPI_GETPROCADDRESS( hMapiDll, "MAPISendMail" );
if( MAPISendMail )
{

View File

@@ -87,7 +87,7 @@ HB_FUNC( WAPI_ISUSERANADMIN )
{
typedef int ( WINAPI * ISUSERANADMIN )( void );
ISUSERANADMIN pIsUserAnAdmin = ( ISUSERANADMIN )
GetProcAddress( hLib, "IsUserAnAdmin" );
HB_WINAPI_GETPROCADDRESS( hLib, "IsUserAnAdmin" );
if( pIsUserAnAdmin )
bResult = ( pIsUserAnAdmin )();

View File

@@ -229,9 +229,20 @@ HB_FUNC( WAPI_GETPROCADDRESS )
{
FARPROC pProc;
DWORD dwLastError;
pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ), HB_ISCHAR( 2 ) ?
hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) );
#if defined( HB_OS_WIN_CE )
void * hProcName;
LPCTSTR lpProcName = HB_PARSTR( 2, &hProcName, NULL );
pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ),
lpProcName ? lpProcName :
( 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 * ) ( HB_PTRDIFF ) pProc );
}
@@ -381,8 +392,8 @@ HB_FUNC( WAPI_GETLONGPATHNAME )
{
s_getPathNameAddr =
( _HB_GETPATHNAME )
GetProcAddress( GetModuleHandle( HB_WINAPI_KERNEL32_DLL() ),
HB_WINAPI_FUNCTION_NAME( "GetLongPathName" ) );
HB_WINAPI_GETPROCADDRESST( GetModuleHandle( HB_WINAPI_KERNEL32_DLL() ),
"GetLongPathName" );
if( ! s_getPathNameAddr )
s_getPathNameAddr = GetShortPathName;

View File

@@ -75,8 +75,8 @@ HB_FUNC( WAPI_ADDFONTRESOURCEEX )
static _HB_ADDFONTRESOURCEEX s_pAddFontResourceEx = NULL;
if( ! s_pAddFontResourceEx )
s_pAddFontResourceEx = ( _HB_ADDFONTRESOURCEEX ) GetProcAddress( GetModuleHandle( TEXT( "gdi32.dll" ) ),
HB_WINAPI_FUNCTION_NAME( "AddFontResourceEx" ) );
s_pAddFontResourceEx = ( _HB_ADDFONTRESOURCEEX ) HB_WINAPI_GETPROCADDRESST( GetModuleHandle( TEXT( "gdi32.dll" ) ),
"AddFontResourceEx" );
if( s_pAddFontResourceEx )
{
@@ -101,8 +101,8 @@ HB_FUNC( WAPI_REMOVEFONTRESOURCEEX )
static _HB_REMOVEFONTRESOURCEEX s_pRemoveFontResourceEx = NULL;
if( ! s_pRemoveFontResourceEx )
s_pRemoveFontResourceEx = ( _HB_REMOVEFONTRESOURCEEX ) GetProcAddress( GetModuleHandle( TEXT( "gdi32.dll" ) ),
HB_WINAPI_FUNCTION_NAME( "RemoveFontResourceEx" ) );
s_pRemoveFontResourceEx = ( _HB_REMOVEFONTRESOURCEEX ) HB_WINAPI_GETPROCADDRESST( GetModuleHandle( TEXT( "gdi32.dll" ) ),
"RemoveFontResourceEx" );
if( s_pRemoveFontResourceEx )
{

View File

@@ -132,8 +132,8 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName )
if( hWinSpool )
{
fnGetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool,
HB_WINAPI_FUNCTION_NAME( "GetDefaultPrinter" ) );
fnGetDefaultPrinter = ( DEFPRINTER ) HB_WINAPI_GETPROCADDRESST( hWinSpool,
"GetDefaultPrinter" );
if( fnGetDefaultPrinter )
{

View File

@@ -125,8 +125,8 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName )
if( ! hWinSpool )
return HB_FALSE;
fnSetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool,
HB_WINAPI_FUNCTION_NAME( "SetDefaultPrinter" ) );
fnSetDefaultPrinter = ( DEFPRINTER ) HB_WINAPI_GETPROCADDRESST( hWinSpool,
"SetDefaultPrinter" );
if( ! fnSetDefaultPrinter )
{

View File

@@ -72,10 +72,10 @@ HB_FUNC( WIN_UUIDCREATESTRING )
{
HMODULE hRpcrt4 = GetModuleHandle( TEXT( "rpcrt4.dll" ) );
s_pUuidCreate = ( _HB_UUIDCREATE ) GetProcAddress( hRpcrt4, "UuidCreate" );
s_pUuidCreate = ( _HB_UUIDCREATE ) HB_WINAPI_GETPROCADDRESS( hRpcrt4, "UuidCreate" );
s_pUuidToString = ( _HB_UUIDTOSTRING ) GetProcAddress( hRpcrt4, HB_WINAPI_FUNCTION_NAME( "UuidToString" ) );
s_pRpcStringFree = ( _HB_RPCSTRINGFREE ) GetProcAddress( hRpcrt4, HB_WINAPI_FUNCTION_NAME( "RpcStringFree" ) );
s_pUuidToString = ( _HB_UUIDTOSTRING ) HB_WINAPI_GETPROCADDRESST( hRpcrt4, "UuidToString" );
s_pRpcStringFree = ( _HB_RPCSTRINGFREE ) HB_WINAPI_GETPROCADDRESST( hRpcrt4, "RpcStringFree" );
}
if( s_pUuidCreate &&

View File

@@ -4527,7 +4527,7 @@ static void hb_gtInitStatics( UINT usWinNum, LPCTSTR lpszWinName, USHORT usRow1,
h = LoadLibrary( "msimg32.dll" );
if( h )
{
s_pWvwData->s_sApp->pfnGF = ( wvwGradientFill ) GetProcAddress( h, "GradientFill" );
s_pWvwData->s_sApp->pfnGF = ( wvwGradientFill ) HB_WINAPI_GETPROCADDRESS( h, "GradientFill" );
if( s_pWvwData->s_sApp->pfnGF )
s_pWvwData->s_sApp->hMSImg32 = h;
}

View File

@@ -54,12 +54,6 @@
#include <windows.h>
/* 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 )

View File

@@ -86,8 +86,14 @@
#define HB_OSSTRDUP( str ) hb_osStrU16Decode( str )
#define HB_OSSTRDUP2( str, buf, len ) hb_osStrU16Decode2( str, buf, len )
#define HB_WINAPI_SYSTEM( cmd ) _wsystem( cmd )
#define HB_WINAPI_FUNCTION_NAME( a ) ( a "W" )
#define HB_WINAPI_KERNEL32_DLL() ( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) )
#if defined( HB_OS_WIN_CE )
#define HB_WINAPI_GETPROCADDRESS( h, n ) GetProcAddress( h, TEXT( n ) )
#define HB_WINAPI_GETPROCADDRESST( h, n ) GetProcAddress( h, TEXT( n ) TEXT( "W" ) )
#else
#define HB_WINAPI_GETPROCADDRESS( h, n ) GetProcAddress( h, n )
#define HB_WINAPI_GETPROCADDRESST( h, n ) GetProcAddress( h, n "W" )
#endif
#else
#define HB_PARSTR( n, h, len ) hb_parstr( n, hb_setGetOSCP(), h, len )
#define HB_PARSTRDEF( n, h, len ) hb_strnull( hb_parstr( n, hb_setGetOSCP(), h, len ) )
@@ -119,8 +125,9 @@
#define HB_OSSTRDUP( str ) hb_osStrDecode( str )
#define HB_OSSTRDUP2( str, buf, len ) hb_osStrDecode2( str, buf, len )
#define HB_WINAPI_SYSTEM( cmd ) system( cmd )
#define HB_WINAPI_FUNCTION_NAME( a ) ( a "A" )
#define HB_WINAPI_KERNEL32_DLL() ( TEXT( "kernel32.dll" ) )
#define HB_WINAPI_GETPROCADDRESS( h, n ) GetProcAddress( h, n )
#define HB_WINAPI_GETPROCADDRESST( h, n ) GetProcAddress( h, n "A" )
#endif
#endif /* HB_OS_WIN */

View File

@@ -77,6 +77,7 @@
# include <sys/time.h>
#elif defined( HB_OS_WIN )
# include <windows.h>
# include "hbwinuni.h"
# if defined( HB_OS_WIN_CE )
# include "hbwince.h"
# endif
@@ -960,7 +961,7 @@ long hb_timeStampUTCOffset( int iYear, int iMonth, int iDay,
HMODULE hModule = GetModuleHandle( TEXT( "kernel32" ) );
if( hModule )
s_pTzSpecificLocalTimeToSystemTime = ( P_TZSPECIFICLOCALTIMETOSYSTEMTIME )
GetProcAddress( hModule, "TzSpecificLocalTimeToSystemTime" );
HB_WINAPI_GETPROCADDRESS( hModule, "TzSpecificLocalTimeToSystemTime" );
s_fInit = HB_FALSE;
}

View File

@@ -151,7 +151,7 @@ static HB_BOOL s_win_iswow64( void )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32" ) );
if( hModule )
pIsWow64Process = ( P_ISWOW64PROCESS ) GetProcAddress( hModule, "IsWow64Process" );
pIsWow64Process = ( P_ISWOW64PROCESS ) HB_WINAPI_GETPROCADDRESS( hModule, "IsWow64Process" );
else
pIsWow64Process = NULL;
@@ -363,7 +363,7 @@ char * hb_verPlatform( void )
const char * pszWine = "";
const char * pszName = "";
if( hntdll && GetProcAddress( hntdll, "wine_get_version" ) )
if( hntdll && HB_WINAPI_GETPROCADDRESS( hntdll, "wine_get_version" ) )
pszWine = " (Wine)";
switch( osVer.dwPlatformId )

View File

@@ -166,7 +166,7 @@ HB_FUNC( DISKSPACE )
HMODULE hModule = GetModuleHandle( HB_WINAPI_KERNEL32_DLL() );
if( hModule )
s_pGetDiskFreeSpaceEx = ( P_GDFSE )
GetProcAddress( hModule, HB_WINAPI_FUNCTION_NAME( "GetDiskFreeSpaceEx" ) );
HB_WINAPI_GETPROCADDRESST( hModule, "GetDiskFreeSpaceEx" );
s_fInit = HB_TRUE;
}

View File

@@ -125,7 +125,7 @@ HB_FUNC( HB_DISKSPACE )
HMODULE hModule = GetModuleHandle( HB_WINAPI_KERNEL32_DLL() );
if( hModule )
s_pGetDiskFreeSpaceEx = ( P_GDFSE )
GetProcAddress( hModule, HB_WINAPI_FUNCTION_NAME( "GetDiskFreeSpaceEx" ) );
HB_WINAPI_GETPROCADDRESST( hModule, "GetDiskFreeSpaceEx" );
s_fInit = HB_TRUE;
}

View File

@@ -79,7 +79,7 @@ HB_BOOL hb_fsLink( const char * pszExisting, const char * pszNewFile )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
s_pCreateHardLink = ( _HB_CREATEHARDLINK )
GetProcAddress( hModule, HB_WINAPI_FUNCTION_NAME( "CreateHardLink" ) );
HB_WINAPI_GETPROCADDRESST( hModule, "CreateHardLink" );
}
if( s_pCreateHardLink )
@@ -163,7 +163,7 @@ HB_BOOL hb_fsLinkSym( const char * pszTarget, const char * pszNewFile )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
s_pCreateSymbolicLink = ( _HB_CREATESYMBOLICLINK )
GetProcAddress( hModule, HB_WINAPI_FUNCTION_NAME( "CreateSymbolicLink" ) );
HB_WINAPI_GETPROCADDRESST( hModule, "CreateSymbolicLink" );
}
if( s_pCreateSymbolicLink )
@@ -269,7 +269,7 @@ char * hb_fsLinkRead( const char * pszFile )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
s_pGetFinalPathNameByHandle = ( _HB_GETFINALPATHNAMEBYHANDLE )
GetProcAddress( hModule, HB_WINAPI_FUNCTION_NAME( "GetFinalPathNameByHandle" ) );
HB_WINAPI_GETPROCADDRESST( hModule, "GetFinalPathNameByHandle" );
}
if( s_pGetFinalPathNameByHandle )

View File

@@ -750,8 +750,8 @@ static HB_BOOL hb_gt_win_SetPalette_Vista( HB_BOOL bSet, COLORREF * colors )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
{
s_pGetConsoleScreenBufferInfoEx = ( P_GETCONSOLESCREENBUFFERINFOEX ) GetProcAddress( hModule, "GetConsoleScreenBufferInfoEx" );
s_pSetConsoleScreenBufferInfoEx = ( P_SETCONSOLESCREENBUFFERINFOEX ) GetProcAddress( hModule, "SetConsoleScreenBufferInfoEx" );
s_pGetConsoleScreenBufferInfoEx = ( P_GETCONSOLESCREENBUFFERINFOEX ) HB_WINAPI_GETPROCADDRESS( hModule, "GetConsoleScreenBufferInfoEx" );
s_pSetConsoleScreenBufferInfoEx = ( P_SETCONSOLESCREENBUFFERINFOEX ) HB_WINAPI_GETPROCADDRESS( hModule, "SetConsoleScreenBufferInfoEx" );
}
s_bChecked = HB_TRUE;
}
@@ -839,9 +839,9 @@ static HB_BOOL hb_gt_win_SetCloseButton( HB_BOOL bSet, HB_BOOL bClosable )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
{
s_pGetConsoleWindow = ( P_GETCONSOLEWINDOW ) GetProcAddress( hModule, "GetConsoleWindow" );
s_pGetConsoleWindow = ( P_GETCONSOLEWINDOW ) HB_WINAPI_GETPROCADDRESS( hModule, "GetConsoleWindow" );
#if defined( HB_GTWIN_USE_SETCONSOLEMENUCLOSE )
s_pSetConsoleMenuClose = ( P_SETCONSOLEMENUCLOSE ) GetProcAddress( hModule, "SetConsoleMenuClose" );
s_pSetConsoleMenuClose = ( P_SETCONSOLEMENUCLOSE ) HB_WINAPI_GETPROCADDRESS( hModule, "SetConsoleMenuClose" );
#endif
}
s_bChecked = HB_TRUE;
@@ -1766,7 +1766,7 @@ static HB_BOOL hb_gt_win_IsFullScreen( void )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
pGetConsoleDisplayMode = ( P_GCDM ) GetProcAddress( hModule, "GetConsoleDisplayMode" );
pGetConsoleDisplayMode = ( P_GCDM ) HB_WINAPI_GETPROCADDRESS( hModule, "GetConsoleDisplayMode" );
else
pGetConsoleDisplayMode = NULL;
@@ -1789,7 +1789,7 @@ static HB_BOOL hb_gt_win_FullScreen( HB_BOOL bFullScreen )
HMODULE hModule = GetModuleHandle( TEXT( "kernel32.dll" ) );
if( hModule )
pSetConsoleDisplayMode = ( P_SCDM ) GetProcAddress( hModule, "SetConsoleDisplayMode" );
pSetConsoleDisplayMode = ( P_SCDM ) HB_WINAPI_GETPROCADDRESS( hModule, "SetConsoleDisplayMode" );
else
pSetConsoleDisplayMode = NULL;

View File

@@ -3123,10 +3123,12 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT )
*/
#if 0
#ifdef MONITOR_DEFAULTTONEAREST
pMonitorFromWindow = ( P_MFW ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"MonitorFromWindow" );
pGetMonitorInfo = ( P_GMI ) GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"GetMonitorInfo" );
pMonitorFromWindow = ( P_MFW )
HB_WINAPI_GETPROCADDRESS( GetModuleHandle( TEXT( "user32.dll" ) ),
"MonitorFromWindow" );
pGetMonitorInfo = ( P_GMI )
HB_WINAPI_GETPROCADDRESS( GetModuleHandle( TEXT( "user32.dll" ) ),
"GetMonitorInfo" );
if( pMonitorFromWindow && pGetMonitorInfo )
{

View File

@@ -208,7 +208,12 @@ void * hb_libSymAddr( PHB_ITEM pDynLib, const char * pszSymbol )
if( hDynLib )
{
#if defined( HB_OS_WIN )
#if defined( HB_OS_WIN_CE )
LPTSTR lpSymbol = hb_mbtowc( pszSymbol );
void * hFuncAddr = ( void * ) GetProcAddress( ( HMODULE ) hDynLib, lpSymbol );
hb_xfree( lpSymbol );
return hFuncAddr;
#elif defined( HB_OS_WIN )
return ( void * ) GetProcAddress( ( HMODULE ) hDynLib, pszSymbol );
#elif defined( HB_OS_OS2 )
PFN pProcAddr = NULL;

View File

@@ -84,6 +84,7 @@
# if ! defined( __TINYC__ )
# include <tlhelp32.h>
# endif
# include "hbwinuni.h"
# if defined( HB_OS_WIN_CE )
# include "hbwince.h"
# endif
@@ -374,9 +375,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( hToolhelp, "CreateToolhelp32Snapshot" );
P_M32F pModule32First = ( P_M32F ) GetProcAddress( hToolhelp, "Module32First" );
P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hToolhelp, "Module32Next" );
P_CTH32SSH pCreateToolhelp32Snapshot = ( P_CTH32SSH ) HB_WINAPI_GETPROCADDRESS( hToolhelp, "CreateToolhelp32Snapshot" );
P_M32F pModule32First = ( P_M32F ) HB_WINAPI_GETPROCADDRESS( hToolhelp, "Module32First" );
P_M32N pModule32Next = ( P_M32N ) HB_WINAPI_GETPROCADDRESS( hToolhelp, "Module32Next" );
if( pCreateToolhelp32Snapshot &&
pModule32First &&

View File

@@ -132,15 +132,19 @@ PHB_FUNC hb_dllGetProcAddress( const char * szProcName )
if( s_hModule != NULL )
{
static const char * s_szGetProcAddr = "_dll_hb_vmProcAddress";
int i = 6;
int i = 5;
do
{
i -= i == 4 ? 3 : 1;
#if defined( HB_OS_WIN_CE )
LPCTSTR s_lpGetProcAddr = TEXT( "_dll_hb_vmProcAddress" );
s_pProcGet = ( HB_PROC_GET ) GetProcAddress( s_hModule, s_lpGetProcAddr + i );
#else
static const char * s_szGetProcAddr = "_dll_hb_vmProcAddress";
s_pProcGet = ( HB_PROC_GET ) GetProcAddress( s_hModule, s_szGetProcAddr + i );
#endif
}
while( s_pProcGet == NULL && i > 0 );
while( s_pProcGet == NULL && ( i -= i == 4 ? 3 : 1 ) >= 0 );
if( s_pProcGet == NULL )
HB_DLL_MSG_NO_FUNC( "hb_vmProcAddress" );
}