From feb9517ee2088f20b80e10839fc94338b21ee70e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Mar 2010 23:11:09 +0000 Subject: [PATCH] 2010-03-08 00:09 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * include/hbapi.h * src/common/hbver.c + Added hb_iswin2k() low-level function to detect if running under Windows 2000 or newer. * include/hbextern.ch * src/rtl/version.c + Added HB_OSISWIN2K() .prg level function. * src/rtl/gtwin/gtwin.c * src/rtl/gtwvt/gtwvt.c * contrib/gtwvg/gtwvg.c * contrib/gtwvg/wvggui.c * examples/gtwvw/gtwvw.c * contrib/hbwin/win_prn2.c * contrib/hbwin/win_prn3.c % Changed to use hb_iswin*() API instead of implementing version detection locally. * contrib/hbmysql/mysql.c * contrib/hbpgsql/postgres.c + Added my partial copyright. * contrib/hbpgsql/tests/tstpgrdd.prg * Formatting. * contrib/hbpgsql/postgres.c ! Fixed to define all .prg level functions regardless of pgsql lib it's built against. They return permanent failure in this case. ! Fixed PQCREATETRACE() to return NULL pointer instead of NIL for static builds. ! PQFREECANCEL() marked with HB_LEGACY_LEVEL3. * contrib/hbwin/win_os.prg + Using HB_OSISWIN2K() core API. * contrib/hbide/ideprojmanager.prg * Minor alignment. --- harbour/ChangeLog | 41 ++++++++++++++++++++++ harbour/contrib/gtwvg/gtwvg.c | 6 +--- harbour/contrib/gtwvg/wvggui.c | 6 +--- harbour/contrib/hbide/ideprojmanager.prg | 2 +- harbour/contrib/hbmysql/mysql.c | 1 + harbour/contrib/hbpgsql/postgres.c | 30 +++++++++++++--- harbour/contrib/hbpgsql/tests/tstpgrdd.prg | 2 +- harbour/contrib/hbwin/win_os.prg | 2 +- harbour/contrib/hbwin/win_prn2.c | 6 +--- harbour/contrib/hbwin/win_prn3.c | 2 +- harbour/examples/gtwvw/gtwvw.c | 13 ++----- harbour/include/hbapi.h | 5 +-- harbour/include/hbextern.ch | 1 + harbour/src/common/hbver.c | 13 +++++++ harbour/src/rtl/gtwin/gtwin.c | 10 ++---- harbour/src/rtl/gtwvt/gtwvt.c | 13 +++---- harbour/src/rtl/version.c | 5 +++ 17 files changed, 108 insertions(+), 50 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2b4f86e01c..60fd2f582a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,47 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-08 00:09 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * include/hbapi.h + * src/common/hbver.c + + Added hb_iswin2k() low-level function to detect + if running under Windows 2000 or newer. + + * include/hbextern.ch + * src/rtl/version.c + + Added HB_OSISWIN2K() .prg level function. + + * src/rtl/gtwin/gtwin.c + * src/rtl/gtwvt/gtwvt.c + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/wvggui.c + * examples/gtwvw/gtwvw.c + * contrib/hbwin/win_prn2.c + * contrib/hbwin/win_prn3.c + % Changed to use hb_iswin*() API instead of implementing + version detection locally. + + * contrib/hbmysql/mysql.c + * contrib/hbpgsql/postgres.c + + Added my partial copyright. + + * contrib/hbpgsql/tests/tstpgrdd.prg + * Formatting. + + * contrib/hbpgsql/postgres.c + ! Fixed to define all .prg level functions regardless + of pgsql lib it's built against. They return + permanent failure in this case. + ! Fixed PQCREATETRACE() to return NULL pointer instead + of NIL for static builds. + ! PQFREECANCEL() marked with HB_LEGACY_LEVEL3. + + * contrib/hbwin/win_os.prg + + Using HB_OSISWIN2K() core API. + + * contrib/hbide/ideprojmanager.prg + * Minor alignment. + 2010-03-07 20:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbpgsql/tests/tstpgrdd.prg * contrib/hbpgsql/tests/async.prg diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 5355187fef..dd8c0ecc8c 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -319,10 +319,6 @@ static void hb_gt_wvt_Free( PHB_GTWVT pWVT ) static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) { PHB_GTWVT pWVT; - OSVERSIONINFO osvi; - - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &osvi ); pWVT = ( PHB_GTWVT ) hb_xgrab( sizeof( HB_GTWVT ) ); memset( pWVT, 0, sizeof( HB_GTWVT ) ); @@ -384,7 +380,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->boxCodePage = OEM_CHARSET; /* GetACP(); - set code page to default system */ #endif - pWVT->Win9X = ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ); + pWVT->Win9X = hb_iswin9x(); pWVT->AltF4Close = HB_FALSE; pWVT->IgnoreWM_SYSCHAR = HB_FALSE; diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index ea4d4dcb99..e333e6befc 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -226,10 +226,6 @@ static void hb_gt_wvt_Free( PHB_GTWVT pWVT ) static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) { PHB_GTWVT pWVT; - OSVERSIONINFO osvi; - - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &osvi ); pWVT = ( PHB_GTWVT ) hb_xgrab( sizeof( HB_GTWVT ) ); memset( pWVT, 0, sizeof( HB_GTWVT ) ); @@ -267,7 +263,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->CentreWindow = HB_TRUE; /* Default is to always display window in centre of screen */ pWVT->CodePage = OEM_CHARSET; /* GetACP(); - set code page to default system */ - pWVT->Win9X = ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ); + pWVT->Win9X = hb_iswin9x(); pWVT->IgnoreWM_SYSCHAR = HB_FALSE; diff --git a/harbour/contrib/hbide/ideprojmanager.prg b/harbour/contrib/hbide/ideprojmanager.prg index df6bb37554..abce26d3bb 100644 --- a/harbour/contrib/hbide/ideprojmanager.prg +++ b/harbour/contrib/hbide/ideprojmanager.prg @@ -137,7 +137,7 @@ CLASS IdeProject DATA hSources INIT {=>} DATA hPaths INIT {=>} DATA lPathAbs INIT .F. // Lets try relative paths first . xhp and hbp will be relative anyway - DATA projPath INIT "" + DATA projPath INIT "" METHOD new( oIDE, aProps ) diff --git a/harbour/contrib/hbmysql/mysql.c b/harbour/contrib/hbmysql/mysql.c index 27e5354892..76b515f59d 100644 --- a/harbour/contrib/hbmysql/mysql.c +++ b/harbour/contrib/hbmysql/mysql.c @@ -6,6 +6,7 @@ * Harbour Project source code: * MySQL DBMS low level (client api) interface code. * + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) (GC support) * Copyright 2000 Maurilio Longo * www - http://www.harbour-project.org * diff --git a/harbour/contrib/hbpgsql/postgres.c b/harbour/contrib/hbpgsql/postgres.c index 7294fa5810..51f711a49b 100644 --- a/harbour/contrib/hbpgsql/postgres.c +++ b/harbour/contrib/hbpgsql/postgres.c @@ -6,6 +6,7 @@ * Harbour Project source code: * PostgreSQL RDBMS low level (client api) interface code. * + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) (GC support) * Copyright 2003 Rodrigo Moreno rodrigo_moreno@yahoo.com * www - http://www.harbour-project.org * @@ -1037,6 +1038,8 @@ HB_FUNC( PQCREATETRACE ) { #ifdef NODLL hb_FILE_ret( fopen( hb_parcx( 1 ), "w+b" ) ); +#else + hb_retptr( NULL ); #endif } @@ -1133,30 +1136,37 @@ HB_FUNC( LO_UNLINK ) hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -#if HB_PGVERSION >= 0x0800 - HB_FUNC( PQSERVERVERSION ) { +#if HB_PGVERSION >= 0x0800 PGconn * conn = hb_PGconn_par( 1 ); if( conn ) hb_retni( PQserverVersion( conn ) ); else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +#else + hb_retni( 0 ); +#endif } HB_FUNC( PQGETCANCEL ) { +#if HB_PGVERSION >= 0x0800 PGconn * conn = hb_PGconn_par( 1 ); if( conn ) hb_PGcancel_ret( PQgetCancel( conn ) ); else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +#else + hb_retptr( NULL ); +#endif } HB_FUNC( PQCANCEL ) { +#if HB_PGVERSION >= 0x0800 PGcancel * cancel = hb_PGcancel_par( 1 ); if( cancel ) @@ -1171,11 +1181,18 @@ HB_FUNC( PQCANCEL ) } else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); +#else + hb_retl( HB_FALSE ); + hb_storc( NULL, 2 ); +#endif } +#if defined( HB_LEGACY_LEVEL3 ) + /* NOTE: Deprecated */ HB_FUNC( PQFREECANCEL ) { +#if HB_PGVERSION >= 0x0800 void ** ph = ( void ** ) hb_parptrGC( &s_gcPGcancelFuncs, 1 ); /* Check if pointer is not NULL to avoid multiple freeing */ @@ -1187,10 +1204,14 @@ HB_FUNC( PQFREECANCEL ) /* set pointer to NULL to avoid multiple freeing */ * ph = NULL; } +#endif } +#endif + HB_FUNC( PQESCAPEBYTEACONN ) { +#if HB_PGVERSION >= 0x0800 PGconn * conn = hb_PGconn_par( 1 ); if( conn && HB_ISCHAR( 2 ) ) @@ -1205,9 +1226,10 @@ HB_FUNC( PQESCAPEBYTEACONN ) } else hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); -} - +#else + hb_retc_null(); #endif +} /* diff --git a/harbour/contrib/hbpgsql/tests/tstpgrdd.prg b/harbour/contrib/hbpgsql/tests/tstpgrdd.prg index 08fe021ea4..88ceaf993c 100644 --- a/harbour/contrib/hbpgsql/tests/tstpgrdd.prg +++ b/harbour/contrib/hbpgsql/tests/tstpgrdd.prg @@ -11,7 +11,7 @@ PROCEDURE Main() - LOCAL NCONN + LOCAL nConn SET DELETED ON diff --git a/harbour/contrib/hbwin/win_os.prg b/harbour/contrib/hbwin/win_os.prg index 6aa2386c78..699600ba82 100644 --- a/harbour/contrib/hbwin/win_os.prg +++ b/harbour/contrib/hbwin/win_os.prg @@ -106,7 +106,7 @@ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UtilizeNtCaching", 0, lSetIt ) bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, cKeyWks, "UseLockReadUnlock", 0, lSetIt ) - IF win_osIs2000OrUpper() + IF hb_osIsWin2K() bRetVal := bRetVal .AND. win_regQuery( WIN_HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Services\MRXSmb\Parameters", "OpLocksDisabled", 1, lSetIt ) ENDIF ENDIF diff --git a/harbour/contrib/hbwin/win_prn2.c b/harbour/contrib/hbwin/win_prn2.c index 454db3352c..7bfdd5992e 100644 --- a/harbour/contrib/hbwin/win_prn2.c +++ b/harbour/contrib/hbwin/win_prn2.c @@ -119,14 +119,10 @@ static void hb_GetDefaultPrinter( PHB_ITEM pPrinterName ) { #if ! defined( HB_OS_WIN_CE ) HB_BOOL bResult = HB_FALSE; - OSVERSIONINFO osvi; hb_itemPutC( pPrinterName, NULL ); - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &osvi ); - - if( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 ) /* Windows 2000 or later */ + if( hb_iswin2k() ) /* Windows 2000 or later */ { typedef BOOL( WINAPI * DEFPRINTER ) ( LPTSTR, LPDWORD ); DEFPRINTER fnGetDefaultPrinter; diff --git a/harbour/contrib/hbwin/win_prn3.c b/harbour/contrib/hbwin/win_prn3.c index ab631432c3..744359bd75 100644 --- a/harbour/contrib/hbwin/win_prn3.c +++ b/harbour/contrib/hbwin/win_prn3.c @@ -104,7 +104,7 @@ static HB_BOOL hb_SetDefaultPrinter( LPCTSTR lpPrinterName ) GetVersionEx( &osv ); /* If Windows 95 or 98, use SetPrinter. */ - if( osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + if( hb_iswin9x() ) { /* Open this printer so you can get information about it. */ bFlag = OpenPrinter( ( LPTSTR ) lpPrinterName, &hPrinter, NULL ); diff --git a/harbour/examples/gtwvw/gtwvw.c b/harbour/examples/gtwvw/gtwvw.c index a2a4c1713c..ee347f6f28 100644 --- a/harbour/examples/gtwvw/gtwvw.c +++ b/harbour/examples/gtwvw/gtwvw.c @@ -1576,8 +1576,6 @@ static void gt_wNtTone( double dFreq, double dDurat ) /* */ static void hb_gt_wvw_Tone( PHB_GT pGT, double dFrequency, double dDuration ) { - OSVERSIONINFO osv; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_wvw_Tone(%lf, %lf)", dFrequency, dDuration)); HB_SYMBOL_UNUSED( pGT ); @@ -1592,14 +1590,9 @@ static void hb_gt_wvw_Tone( PHB_GT pGT, double dFrequency, double dDuration ) /* keep the frequency in an acceptable range */ dFrequency = HB_MIN( HB_MAX( 0.0, dFrequency ), 32767.0 ); - /* What version of Windows are you running? */ - osv.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &osv ); - /* If Windows 95 or 98, use w9xTone for BCC32, MSVC */ - if ( osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + if( hb_iswin9x() ) { - #if defined( __BORLANDC__ ) || defined( _MSC_VER ) || defined( __WATCOMC__ ) || defined(__MINGW32__) gt_w9xTone( dFrequency, dDuration ); #else @@ -1609,9 +1602,9 @@ static void hb_gt_wvw_Tone( PHB_GT pGT, double dFrequency, double dDuration ) /* If Windows NT or NT2k, use wNtTone, which provides TONE() reset sequence support (new) */ - else if ( osv.dwPlatformId == VER_PLATFORM_WIN32_NT ) + else if( hb_iswinnt() ) { - gt_wNtTone( dFrequency, dDuration ); + gt_wNtTone( dFrequency, dDuration ); } } diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 7f5efdc63a..841252fd79 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -1133,8 +1133,9 @@ extern HB_EXPORT const char * hb_verHB_PLAT( void ); /* retrieves a stat extern HB_EXPORT const char * hb_verHB_COMP( void ); /* retrieves a static buffer containing build time HB_COMPILER setting */ extern HB_EXPORT HB_BOOL hb_iswin9x( void ); /* return HB_TRUE if OS == Windows 9x, ME */ -extern HB_EXPORT HB_BOOL hb_iswinnt( void ); /* return HB_TRUE if OS == Windows NT, 2000, XP or newer */ -extern HB_EXPORT HB_BOOL hb_iswinvista( void ); /* return HB_TRUE if OS == Windows Vista, 7, 2008 or newer */ +extern HB_EXPORT HB_BOOL hb_iswinnt( void ); /* return HB_TRUE if OS == Windows NT or newer */ +extern HB_EXPORT HB_BOOL hb_iswin2k( void ); /* return HB_TRUE if OS == Windows 2000 or newer */ +extern HB_EXPORT HB_BOOL hb_iswinvista( void ); /* return HB_TRUE if OS == Windows Vista or newer */ extern HB_EXPORT HB_BOOL hb_iswince( void ); /* return HB_TRUE if OS is Windows CE or Windows Mobile */ extern HB_EXPORT HB_BOOL hb_printerIsReady( const char * pszPrinterName ); diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 630ddfab2d..f00b9c1659 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -948,6 +948,7 @@ EXTERNAL HB_MILLISECONDS EXTERNAL HB_CURDRIVE EXTERNAL HB_OSNEWLINE EXTERNAL HB_OSISWINNT +EXTERNAL HB_OSISWIN2K EXTERNAL HB_OSISWINVISTA EXTERNAL HB_OSISWINCE EXTERNAL HB_APARAMS diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index 6535d00796..bfc97274a7 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -400,6 +400,7 @@ char * hb_verPlatform( void ) static HB_BOOL s_fWinVerInit = HB_FALSE; static HB_BOOL s_fWinVista = HB_FALSE; +static HB_BOOL s_fWin2K = HB_FALSE; static HB_BOOL s_fWinNT = HB_FALSE; static HB_BOOL s_fWin9x = HB_FALSE; @@ -411,6 +412,7 @@ static void s_hb_winVerInit( void ) if( GetVersionEx( &osvi ) ) { s_fWinVista = osvi.dwMajorVersion >= 6; + s_fWin2K = osvi.dwMajorVersion >= 5; s_fWinNT = osvi.dwPlatformId == VER_PLATFORM_WIN32_NT; /* && osvi.dwMajorVersion >= 4); */ s_fWin9x = osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS; } @@ -429,6 +431,17 @@ HB_BOOL hb_iswinvista( void ) #endif } +HB_BOOL hb_iswin2k( void ) +{ +#if defined( HB_OS_WIN ) + if( ! s_fWinVerInit ) + s_hb_winVerInit(); + return s_fWin2K; +#else + return HB_FALSE; +#endif +} + HB_BOOL hb_iswinnt( void ) { #if defined( HB_OS_WIN ) diff --git a/harbour/src/rtl/gtwin/gtwin.c b/harbour/src/rtl/gtwin/gtwin.c index 8f4982a677..3f9bc08676 100644 --- a/harbour/src/rtl/gtwin/gtwin.c +++ b/harbour/src/rtl/gtwin/gtwin.c @@ -209,8 +209,6 @@ static int s_mouseLast; /* Last mouse button to be pressed static int s_mouse_iCol; static int s_mouse_iRow; -static OSVERSIONINFO s_osv; - typedef struct _CLIPKEYCODE { int key; @@ -808,9 +806,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil { HB_TRACE(HB_TR_DEBUG, ("hb_gt_win_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRDIFF ) hFilenoStdin, ( void * ) ( HB_PTRDIFF ) hFilenoStdout, ( void * ) ( HB_PTRDIFF ) hFilenoStderr)); - s_osv.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &s_osv ); - if( s_osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + if( hb_iswin9x() ) s_dwAltGrBits = RIGHT_ALT_PRESSED; else s_dwAltGrBits = LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED; @@ -1478,9 +1474,9 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask ) if( s_bSpecialKeyHandling && ( dwState & CAPSLOCK_ON ) && - s_osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + hb_iswin9x() ) { - ch = SpecialHandling( &wChar, wKey, ch, (dwState & SHIFT_PRESSED) ); + ch = SpecialHandling( &wChar, wKey, ch, ( dwState & SHIFT_PRESSED ) ); } if( s_wRepeated == 0 ) diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 6d4eacc746..48772139a8 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -132,9 +132,10 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance ) { - WNDCLASS wndclass; + WNDCLASSEX wndclass; - memset( &wndclass, 0, sizeof( WNDCLASS ) ); + memset( &wndclass, 0, sizeof( WNDCLASSEX ) ); + wndclass.cbSize = sizeof( WNDCLASSEX ); wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wndclass.lpfnWndProc = hb_gt_wvt_WndProc; /* wndclass.cbClsExtra = 0; */ @@ -146,7 +147,7 @@ static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance ) /* wndclass.lpszMenuName = NULL; */ wndclass.lpszClassName = s_szClassName; - if( ! RegisterClass( &wndclass ) ) + if( ! RegisterClassEx( &wndclass ) ) { if( GetLastError() != 1410 ) hb_errInternal( 10001, "Failed to register WVT window class", NULL, NULL ); @@ -251,10 +252,6 @@ static void hb_gt_wvt_Free( PHB_GTWVT pWVT ) static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) { PHB_GTWVT pWVT; - OSVERSIONINFO osvi; - - osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO ); - GetVersionEx( &osvi ); pWVT = ( PHB_GTWVT ) hb_xgrab( sizeof( HB_GTWVT ) ); memset( pWVT, 0, sizeof( HB_GTWVT ) ); @@ -319,7 +316,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->boxCodePage = OEM_CHARSET; /* GetACP(); - set code page to default system */ #endif - pWVT->Win9X = ( osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ); + pWVT->Win9X = hb_iswin9x(); pWVT->AltF4Close = HB_FALSE; pWVT->IgnoreWM_SYSCHAR = HB_FALSE; diff --git a/harbour/src/rtl/version.c b/harbour/src/rtl/version.c index 94966ffa2a..3722d53ea3 100644 --- a/harbour/src/rtl/version.c +++ b/harbour/src/rtl/version.c @@ -196,6 +196,11 @@ HB_FUNC( HB_OSISWINNT ) hb_retl( hb_iswinnt() ); } +HB_FUNC( HB_OSISWIN2K ) +{ + hb_retl( hb_iswin2k() ); +} + HB_FUNC( HB_OSISWINVISTA ) { hb_retl( hb_iswinvista() );