diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 712fcec3eb..0d19f82f34 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,17 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-07 01:40 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/Makefile + - contrib/hbwin/win_err.c + + contrib/hbwin/wapi_err.c + * contrib/hbwin/hbwin.h + * contrib/hbwin/hbwapi.h + * contrib/hbwin/wapi_winbase.c + * contrib/hbwin/wapi_winuser.c + * contrib/hbwin/wapi_winbase_mutex.c + * Naming cleanup of recent change. + 2010-01-07 00:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/win_err.c * contrib/hbwin/hbwin.h diff --git a/harbour/contrib/hbwin/Makefile b/harbour/contrib/hbwin/Makefile index c25d155ed3..2c9d734f9f 100644 --- a/harbour/contrib/hbwin/Makefile +++ b/harbour/contrib/hbwin/Makefile @@ -22,7 +22,6 @@ C_SOURCES := \ wce_smsc.c \ win_com.c \ win_dll.c \ - win_err.c \ win_misc.c \ win_osc.c \ win_prn1.c \ @@ -30,6 +29,7 @@ C_SOURCES := \ win_prn3.c \ win_regc.c \ wapi_commctrl.c \ + wapi_err.c \ wapi_shellapi.c \ wapi_winbase.c \ wapi_winbase_mutex.c \ diff --git a/harbour/contrib/hbwin/hbwapi.h b/harbour/contrib/hbwin/hbwapi.h index 06974daa1d..546f03bbdc 100644 --- a/harbour/contrib/hbwin/hbwapi.h +++ b/harbour/contrib/hbwin/hbwapi.h @@ -53,8 +53,6 @@ #ifndef __HBWAPI_H #define __HBWAPI_H -#include "hbwin.h" - #define wapi_par_WNDPROC( n ) ( ( WNDPROC ) hb_parptr( n ) ) #define wapi_par_WPARAM( n ) ( ( WPARAM ) hb_parptr( n ) ) #define wapi_par_LPARAM( n ) ( ( LPARAM ) hb_parptr( n ) ) @@ -99,4 +97,11 @@ #define wapi_ret_LRESULT( hr ) ( hb_retnint( hr ) ) #define wapi_ret_COLORREF( cr ) ( hb_retnint( cr ) ) +HB_EXTERN_BEGIN + +HB_EXPORT void hbwapi_SetLastError( DWORD dwLastError ); +HB_EXPORT DWORD hbwapi_GetLastError( void ); + +HB_EXTERN_END + #endif /* __HBWAPI_H */ diff --git a/harbour/contrib/hbwin/hbwin.h b/harbour/contrib/hbwin/hbwin.h index d447b1002b..cfb926986a 100644 --- a/harbour/contrib/hbwin/hbwin.h +++ b/harbour/contrib/hbwin/hbwin.h @@ -77,11 +77,4 @@ #define WIN_COM_DBGQUEUE 0x20 #define WIN_COM_DBGALL 0x3F -HB_EXTERN_BEGIN - -HB_EXPORT void hbwin_SetLastError( DWORD dwLastError ); -HB_EXPORT DWORD hbwin_GetLastError( void ); - -HB_EXTERN_END - #endif /* __HBWIN_H */ diff --git a/harbour/contrib/hbwin/win_err.c b/harbour/contrib/hbwin/wapi_err.c similarity index 86% rename from harbour/contrib/hbwin/win_err.c rename to harbour/contrib/hbwin/wapi_err.c index cfecb63104..4c18711f2d 100644 --- a/harbour/contrib/hbwin/win_err.c +++ b/harbour/contrib/hbwin/wapi_err.c @@ -58,20 +58,20 @@ typedef struct { DWORD dwLastError; -} HB_WINERRDATA, * PHB_WINERRDATA; +} HB_WAPIERRDATA, * PHB_WAPIERRDATA; -static HB_TSD_NEW( s_winerrData, sizeof( HB_WINERRDATA ), NULL, NULL ); +static HB_TSD_NEW( s_wapierrData, sizeof( HB_WAPIERRDATA ), NULL, NULL ); -void hbwin_SetLastError( DWORD dwLastError ) +void hbwapi_SetLastError( DWORD dwLastError ) { - PHB_WINERRDATA pWinErrData = ( PHB_WINERRDATA ) hb_stackGetTSD( &s_winerrData ); + PHB_WAPIERRDATA pWinErrData = ( PHB_WAPIERRDATA ) hb_stackGetTSD( &s_wapierrData ); pWinErrData->dwLastError = dwLastError; } -DWORD hbwin_GetLastError( void ) +DWORD hbwapi_GetLastError( void ) { - PHB_WINERRDATA pWinErrData = ( PHB_WINERRDATA ) hb_stackGetTSD( &s_winerrData ); + PHB_WAPIERRDATA pWinErrData = ( PHB_WAPIERRDATA ) hb_stackGetTSD( &s_wapierrData ); return pWinErrData->dwLastError; } diff --git a/harbour/contrib/hbwin/wapi_winbase.c b/harbour/contrib/hbwin/wapi_winbase.c index a857a1c7ba..9aa6fb1d6c 100644 --- a/harbour/contrib/hbwin/wapi_winbase.c +++ b/harbour/contrib/hbwin/wapi_winbase.c @@ -80,7 +80,7 @@ HB_FUNC( WAPI_GETCURRENTTHREAD ) HB_FUNC( WAPI_WAITFORSINGLEOBJECT ) { DWORD dwResult = WaitForSingleObject( wapi_par_HANDLE( 1 ), ( DWORD ) hb_parnl( 2 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retnl( dwResult ); } @@ -97,7 +97,7 @@ HB_FUNC( WAPI_WAITFORSINGLEOBJECTEX ) dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); hb_retnl( dwResult ); } @@ -117,7 +117,7 @@ HB_FUNC( WAPI_WAITFORMULTIPLEOBJECTS ) dwResult = WaitForMultipleObjects( nLen, handles, hb_parl( 3 ), ( DWORD ) hb_parnl( 4 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retnl( dwResult ); hb_xfree( handles ); @@ -143,7 +143,7 @@ HB_FUNC( WAPI_WAITFORMULTIPLEOBJECTSEX ) dwResult = WaitForMultipleObjectsEx( nLen, handles, hb_parl( 3 ), ( DWORD ) hb_parnl( 4 ), hb_parl( 5 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retnl( dwResult ); hb_xfree( handles ); @@ -151,7 +151,7 @@ HB_FUNC( WAPI_WAITFORMULTIPLEOBJECTSEX ) else hb_errRT_BASE( EG_ARG, 1001, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); #else - hbwin_SetLastError( ERROR_INVALID_FUNCTION ); + hbwapi_SetLastError( ERROR_INVALID_FUNCTION ); hb_retnl( 0 ); #endif } @@ -172,20 +172,20 @@ HB_FUNC( WAPI_SETPROCESSWORKINGSETSIZE ) dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); wapi_ret_L( bResult ); } HB_FUNC( WAPI_GETLASTERROR ) { - hb_retnl( ( long ) hbwin_GetLastError() ); + hb_retnl( ( long ) hbwapi_GetLastError() ); } HB_FUNC( WAPI_SETLASTERROR ) { DWORD dwLastError = ( DWORD ) hb_parnl( 1 ); SetLastError( dwLastError ); - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); } HB_FUNC( WAPI_SETERRORMODE ) @@ -198,7 +198,7 @@ HB_FUNC( WAPI_LOADLIBRARY ) void * hFileName; HMODULE hResult = LoadLibrary( HB_PARSTRDEF( 1, &hFileName, NULL ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retptr( hResult ); hb_strfree( hFileName ); @@ -207,7 +207,7 @@ HB_FUNC( WAPI_LOADLIBRARY ) HB_FUNC( WAPI_FREELIBRARY ) { BOOL bResult = FreeLibrary( ( HMODULE ) hb_parptr( 1 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retl( bResult ); } @@ -222,7 +222,7 @@ HB_FUNC( WAPI_GETPROCADDRESS ) pProc = GetProcAddress( ( HMODULE ) hb_parptr( 1 ), HB_ISCHAR( 2 ) ? ( LPCSTR ) hb_parc( 2 ) : ( LPCSTR ) ( HB_PTRDIFF ) hb_parnint( 2 ) ); dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); hb_retptr( ( void * ) pProc ); } @@ -232,7 +232,7 @@ HB_FUNC( WAPI_GETMODULEHANDLE ) void * hModuleName; HMODULE hResult = GetModuleHandle( HB_PARSTR( 1, &hModuleName, NULL ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_ret_HANDLE( hResult ); hb_strfree( hModuleName ); diff --git a/harbour/contrib/hbwin/wapi_winbase_mutex.c b/harbour/contrib/hbwin/wapi_winbase_mutex.c index 955efb52ee..ede29e978e 100644 --- a/harbour/contrib/hbwin/wapi_winbase_mutex.c +++ b/harbour/contrib/hbwin/wapi_winbase_mutex.c @@ -99,7 +99,7 @@ HB_FUNC( WAPI_CREATEMUTEX ) void * hName; HANDLE hMutex = CreateMutex( ( LPSECURITY_ATTRIBUTES ) hb_parptr( 1 ), hb_parl( 2 ), HB_PARSTR( 3, &hName, NULL ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_mutex_ret( hMutex ); hb_strfree( hName ); @@ -112,7 +112,7 @@ HB_FUNC( WAPI_OPENMUTEX ) void * hName; HANDLE hMutex = OpenMutex( hb_parnl( 1 ), hb_parl( 2 ), HB_PARSTR( 3, &hName, NULL ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_mutex_ret( hMutex ); hb_strfree( hName ); @@ -129,7 +129,7 @@ HB_FUNC( WAPI_RELEASEMUTEX ) if( hMutex ) { BOOL bResult = ReleaseMutex( hMutex ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retl( bResult ); } else diff --git a/harbour/contrib/hbwin/wapi_winuser.c b/harbour/contrib/hbwin/wapi_winuser.c index a91089919c..211bb239fc 100644 --- a/harbour/contrib/hbwin/wapi_winuser.c +++ b/harbour/contrib/hbwin/wapi_winuser.c @@ -74,7 +74,7 @@ HB_FUNC( WAPI_MESSAGEBOX ) void * hStr1; void * hStr2; int iResult = MessageBox( ( HWND ) hb_parptr( 1 ), HB_PARSTR( 2, &hStr1, NULL ), HB_PARSTR( 3, &hStr2, NULL ), hb_parni( 4 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retni( iResult ); hb_strfree( hStr1 ); hb_strfree( hStr2 ); @@ -99,7 +99,7 @@ HB_FUNC( WAPI_CREATEWINDOWEX ) ( HINSTANCE ) hb_parptr( 11 ) /* hInstance */, ( LPVOID ) hb_parptr( 12 ) /* lpParam */ ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retptr( hResult ); hb_strfree( hClassName ); @@ -109,7 +109,7 @@ HB_FUNC( WAPI_CREATEWINDOWEX ) HB_FUNC( WAPI_DESTROYWINDOW ) { BOOL bResult = DestroyWindow( ( HWND ) hb_parptr( 1 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retl( bResult ); } @@ -134,7 +134,7 @@ HB_FUNC( WAPI_ENABLESCROLLBAR ) dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); wapi_ret_L( bResult ); } /*----------------------------------------------------------------------*/ @@ -164,7 +164,7 @@ HB_FUNC( WAPI_GETSCROLLBARINFO ) wapi_par_LONG( 2 ), sbi ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); if( bSuccess ) hb_storclen( ( char * ) &sbi, sizeof( SCROLLBARINFO ), 3 ); @@ -185,7 +185,7 @@ HB_FUNC( WAPI_GETSCROLLINFO ) wapi_par_INT( 2 ), si ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); if( bSuccess ) hb_storclen( ( char * ) &si, 3, sizeof( SCROLLINFO ) ); @@ -210,7 +210,7 @@ HB_FUNC( WAPI_GETSCROLLPOS ) dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); wapi_ret_NI( iResult ); } /*----------------------------------------------------------------------*/ @@ -241,7 +241,7 @@ HB_FUNC( WAPI_GETSCROLLRANGE ) } #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); wapi_ret_L( bSuccess ); } /*----------------------------------------------------------------------*/ @@ -296,7 +296,7 @@ HB_FUNC( WAPI_SETSCROLLPOS ) wapi_par_INT( 2 ), wapi_par_INT( 3 ), wapi_par_BOOL( 4 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_ret_NI( iResult ); } /*----------------------------------------------------------------------*/ @@ -310,7 +310,7 @@ HB_FUNC( WAPI_SETSCROLLRANGE ) wapi_par_INT( 3 ), wapi_par_INT( 4 ), HB_ISLOG( 5 ) ? wapi_par_BOOL( 5 ) : TRUE ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_ret_L( bResult ); } /*----------------------------------------------------------------------*/ @@ -332,7 +332,7 @@ HB_FUNC( WAPI_SHOWSCROLLBAR ) dwLastError = GetLastError(); #endif - hbwin_SetLastError( dwLastError ); + hbwapi_SetLastError( dwLastError ); wapi_ret_L( bResult ); } /*----------------------------------------------------------------------*/ @@ -342,7 +342,7 @@ HWND SetFocus( HWND hWnd ); HB_FUNC( WAPI_SETFOCUS ) { HWND hResult = SetFocus( wapi_par_HWND( 1 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); wapi_ret_HANDLE( hResult ); } /*----------------------------------------------------------------------*/ @@ -368,6 +368,6 @@ HB_FUNC( WAPI_GETACTIVEWINDOW ) HB_FUNC( WAPI_SETACTIVEWINDOW ) { HWND hResult = SetActiveWindow( wapi_par_HWND( 1 ) ); - hbwin_SetLastError( GetLastError() ); + hbwapi_SetLastError( GetLastError() ); hb_retptr( hResult ); }