diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 96a75238b2..78eeb84c44 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-08 16:12 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/diskspac.c + * src/rtl/disksphb.c + * contrib/hbwin/wapi_winbase.c + + Added trick to make dynamic calls to WIDE API functions via + UNICOWS.DLL in UNICODE (default) builds when running on Win9x + systems. This fixes DISKSPACE(), HB_DISKSPACE() and + WAPI_GETLONGPATHNAME() in this scenario. (IOW this patch + makes these calls work in UNICOWS situations) + 2010-03-08 15:38 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/hbsocket.c * bin/hb-mkdyn.sh diff --git a/harbour/contrib/hbwin/wapi_winbase.c b/harbour/contrib/hbwin/wapi_winbase.c index f8affe788e..dd574f304a 100644 --- a/harbour/contrib/hbwin/wapi_winbase.c +++ b/harbour/contrib/hbwin/wapi_winbase.c @@ -365,10 +365,11 @@ HB_FUNC( WAPI_GETLONGPATHNAME ) if( !s_getPathNameAddr ) { s_getPathNameAddr = ( _HB_GETPATHNAME ) - GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), #if defined( UNICODE ) + GetProcAddress( GetModuleHandle( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) ), "GetLongPathNameW" ); #else + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), "GetLongPathNameA" ); #endif if( !s_getPathNameAddr ) diff --git a/harbour/src/rtl/diskspac.c b/harbour/src/rtl/diskspac.c index 7dd837f15c..fe45ca37df 100644 --- a/harbour/src/rtl/diskspac.c +++ b/harbour/src/rtl/diskspac.c @@ -144,7 +144,7 @@ HB_FUNC( DISKSPACE ) lpPath[ 2 ] = TEXT( '\\' ); lpPath[ 3 ] = TEXT( '\0' ); -#if defined( HB_OS_WIN_CE ) || defined( HB_NO_WIN95 ) +#if defined( HB_OS_WIN_CE ) bError = ! GetDiskFreeSpaceEx( lpPath, ( PULARGE_INTEGER ) &i64FreeBytesToCaller, @@ -166,10 +166,11 @@ HB_FUNC( DISKSPACE ) { s_fInit = HB_TRUE; s_pGetDiskFreeSpaceEx = ( P_GDFSE ) - GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), #if defined( UNICODE ) + GetProcAddress( GetModuleHandle( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) ), "GetDiskFreeSpaceExW" ); #else + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), "GetDiskFreeSpaceExA" ); #endif } diff --git a/harbour/src/rtl/disksphb.c b/harbour/src/rtl/disksphb.c index c126db19da..7a617ff30f 100644 --- a/harbour/src/rtl/disksphb.c +++ b/harbour/src/rtl/disksphb.c @@ -180,7 +180,7 @@ HB_FUNC( HB_DISKSPACE ) LPTSTR lpPath = HB_TCHAR_CONVTO( szPath ); -#if defined( HB_OS_WIN_CE ) || defined( HB_NO_WIN95 ) +#if defined( HB_OS_WIN_CE ) fResult = GetDiskFreeSpaceEx( lpPath, ( PULARGE_INTEGER ) &i64FreeBytesToCaller, @@ -224,10 +224,11 @@ HB_FUNC( HB_DISKSPACE ) { s_fInit = HB_TRUE; s_pGetDiskFreeSpaceEx = ( P_GDFSE ) - GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), #if defined( UNICODE ) + GetProcAddress( GetModuleHandle( hb_iswin9x() ? TEXT( "unicows.dll" ) : TEXT( "kernel32.dll" ) ), "GetDiskFreeSpaceExW" ); #else + GetProcAddress( GetModuleHandle( TEXT( "kernel32.dll" ) ), "GetDiskFreeSpaceExA" ); #endif }