2010-01-18 20:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* src/vm/extrap.c
  * src/rtl/diskspac.c
  * src/rtl/disksphb.c
  * src/rtl/gtwvt/gtwvt.c
  * contrib/gtwvg/gtwvg.c
  * contrib/gtwvg/wvgwin.c
  * contrib/hbwin/win_prn2.c
  * contrib/hbwin/win_prn3.c
    + Using HBTEXT() macro on 2nd parameter of GetProcAddress()
      in _all_ cases. This can't hurt, but it's useful to never
      forget it for WinCE targets/branches.
      Recent change got also simplified after this.
      Pls review me.
This commit is contained in:
Viktor Szakats
2010-01-18 19:37:26 +00:00
parent 6dbdd9e61a
commit b822fa0dbf
9 changed files with 37 additions and 32 deletions

View File

@@ -17,6 +17,21 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-18 20:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/vm/extrap.c
* src/rtl/diskspac.c
* src/rtl/disksphb.c
* src/rtl/gtwvt/gtwvt.c
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/wvgwin.c
* contrib/hbwin/win_prn2.c
* contrib/hbwin/win_prn3.c
+ Using HBTEXT() macro on 2nd parameter of GetProcAddress()
in _all_ cases. This can't hurt, but it's useful to never
forget it for WinCE targets/branches.
Recent change got also simplified after this.
Pls review me.
2010-01-18 20:08 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbwin/win_tprn.prg
! fixed GetDefaultPrinter() => win_PrinterGetDefault()

View File

@@ -2561,11 +2561,11 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT )
#if defined( UNICODE ) && defined( GetProcAddress )
P_SLWA pSetLayeredWindowAttributes = ( P_SLWA )
GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
TEXT( "SetLayeredWindowAttributes" ) );
HBTEXT( "SetLayeredWindowAttributes" ) );
#else
P_SLWA pSetLayeredWindowAttributes = ( P_SLWA )
GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"SetLayeredWindowAttributes" );
HBTEXT( "SetLayeredWindowAttributes" ) );
#endif
if( pSetLayeredWindowAttributes )
@@ -4200,9 +4200,9 @@ static void hb_wvt_gtLoadGuiData( void )
{
/* workaround for wrong declarations in some old C compilers */
#if defined( UNICODE ) && defined( GetProcAddress )
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddressW( h, TEXT( "GradientFill" ) );
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddressW( h, HBTEXT( "GradientFill" ) );
#else
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, "GradientFill" );
s_guiData->pfnGF = ( wvtGradientFill ) GetProcAddress( h, HBTEXT( "GradientFill" ) );
#endif
if( s_guiData->pfnGF )
{
@@ -4215,9 +4215,9 @@ static void hb_wvt_gtLoadGuiData( void )
{
/* workaround for wrong declarations in some old C compilers */
#if defined( UNICODE ) && defined( GetProcAddress )
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, TEXT( "SetLayeredWindowAttributes" ) );
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) );
#else
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) );
#endif
if( s_guiData->pfnLayered )
{

View File

@@ -1160,9 +1160,9 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES )
if( h )
{
#if defined( UNICODE ) && defined( GetProcAddress )
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, TEXT( "SetLayeredWindowAttributes" ) );
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddressW( h, HBTEXT( "SetLayeredWindowAttributes" ) );
#else
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, HBTEXT( "SetLayeredWindowAttributes" ) );
#endif
if( pfnLayered )
{

View File

@@ -139,12 +139,10 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName )
if( hWinSpool )
{
fnGetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool,
#if defined( HB_OS_WIN_CE )
TEXT( "GetDefaultPrinterW" ) );
#elif defined( UNICODE )
"GetDefaultPrinterW" );
#if defined( UNICODE )
HBTEXT( "GetDefaultPrinterW" ) );
#else
"GetDefaultPrinterA" );
HBTEXT( "GetDefaultPrinterA" ) );
#endif
if( fnGetDefaultPrinter )

View File

@@ -168,12 +168,10 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName )
if( ! hWinSpool )
return HB_FALSE;
fnSetDefaultPrinter = ( DEFPRINTER ) GetProcAddress( hWinSpool,
#if defined( HB_OS_WIN_CE )
TEXT( "SetDefaultPrinterW" ) );
#elif defined( UNICODE )
"SetDefaultPrinterW" );
#if defined( UNICODE )
HBTEXT( "SetDefaultPrinterW" ) );
#else
"SetDefaultPrinterA" );
HBTEXT( "SetDefaultPrinterA" ) );
#endif
if( ! fnSetDefaultPrinter )
{

View File

@@ -142,9 +142,9 @@ HB_FUNC( DISKSPACE )
P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE )
GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ),
#if defined( UNICODE )
"GetDiskFreeSpaceExW" );
HBTEXT( "GetDiskFreeSpaceExW" ) );
#else
"GetDiskFreeSpaceExA" );
HBTEXT( "GetDiskFreeSpaceExA" ) );
#endif
if( pGetDiskFreeSpaceEx )

View File

@@ -213,9 +213,9 @@ HB_FUNC( HB_DISKSPACE )
P_GDFSE pGetDiskFreeSpaceEx = ( P_GDFSE )
GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ),
#if defined( UNICODE )
"GetDiskFreeSpaceExW" );
HBTEXT( "GetDiskFreeSpaceExW" ) );
#else
"GetDiskFreeSpaceExA" );
HBTEXT( "GetDiskFreeSpaceExA" ) );
#endif
if( pGetDiskFreeSpaceEx )

View File

@@ -1860,15 +1860,9 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT )
{
typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD );
#if defined( HB_OS_WIN_CE )
P_SLWA pSetLayeredWindowAttributes = ( P_SLWA )
GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
TEXT( "SetLayeredWindowAttributes" ) );
#else
P_SLWA pSetLayeredWindowAttributes = ( P_SLWA )
GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"SetLayeredWindowAttributes" );
#endif
HBTEXT( "SetLayeredWindowAttributes" ) );
if( pSetLayeredWindowAttributes )
{

View File

@@ -235,9 +235,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, "CreateToolhelp32Snapshot" );
P_M32F pModule32First = ( P_M32F ) GetProcAddress( hKernel32, "Module32First" );
P_M32N pModule32Next = ( P_M32N ) GetProcAddress( hKernel32, "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" ) );
if( pCreateToolhelp32Snapshot &&
pModule32First &&