2010-01-07 21:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
+ Added free SVN book link.
* src/vm/extrap.c
% Marked exception filter callback as 'static'
; TOCHECK: Please verify that OS/2 still works this way.
* src/rtl/oemansi.c
! Fixed two tabs.
* src/rtl/gtwvt/gtwvt.c
* contrib/gtwvg/gtwvg.c
* contrib/rddads/adsfunc.c
! Fixed to not use unsafe/ANSI CharToOemBuffA() API.
; Please review me.
* config/win/mingw.mk
+ Added information about MinGW alternatives for MSVC
security features. Unfortunately they need Cygwin
binary plus some depend on MinGW host platform
and/or version.
* include/hbwince.h
* src/common/hbwince.c
- Deleted CharToOemBuffA(), OemToCharBuffA(). No longer
needed by Harbour.
; TODO: Delete rest of not anymore used ANSI WinAPI
functions. Now Harbour never uses ANSI
WinAPI functions in UNICODE mode.
* config/win/global.mk
- Deleted reference to CharToOemBuffA(), OemToCharBuffA().
This commit is contained in:
@@ -17,6 +17,40 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-01-07 21:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* INSTALL
|
||||
+ Added free SVN book link.
|
||||
|
||||
* src/vm/extrap.c
|
||||
% Marked exception filter callback as 'static'
|
||||
; TOCHECK: Please verify that OS/2 still works this way.
|
||||
|
||||
* src/rtl/oemansi.c
|
||||
! Fixed two tabs.
|
||||
|
||||
* src/rtl/gtwvt/gtwvt.c
|
||||
* contrib/gtwvg/gtwvg.c
|
||||
* contrib/rddads/adsfunc.c
|
||||
! Fixed to not use unsafe/ANSI CharToOemBuffA() API.
|
||||
; Please review me.
|
||||
|
||||
* config/win/mingw.mk
|
||||
+ Added information about MinGW alternatives for MSVC
|
||||
security features. Unfortunately they need Cygwin
|
||||
binary plus some depend on MinGW host platform
|
||||
and/or version.
|
||||
|
||||
* include/hbwince.h
|
||||
* src/common/hbwince.c
|
||||
- Deleted CharToOemBuffA(), OemToCharBuffA(). No longer
|
||||
needed by Harbour.
|
||||
; TODO: Delete rest of not anymore used ANSI WinAPI
|
||||
functions. Now Harbour never uses ANSI
|
||||
WinAPI functions in UNICODE mode.
|
||||
|
||||
* config/win/global.mk
|
||||
- Deleted reference to CharToOemBuffA(), OemToCharBuffA().
|
||||
|
||||
2010-01-07 10:34 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbide/idethemes.prg
|
||||
* contrib/hbide/resources/selectionlist.ui
|
||||
|
||||
@@ -1399,6 +1399,8 @@ HARBOUR
|
||||
|
||||
Netiquette Guidelines
|
||||
http://tools.ietf.org/html/rfc1855
|
||||
Subversion book (free)
|
||||
http://svnbook.red-bean.com/
|
||||
|
||||
|
||||
14. HOW TO PARTICIPATE
|
||||
|
||||
@@ -15,7 +15,7 @@ ifneq ($(HB_CPU),x86)
|
||||
endif
|
||||
|
||||
# kernel32: needed by some compilers (pocc/watcom)
|
||||
# user32: *Clipboard*(), MessageBox(), CharToOemBuff(), OemToCharBuff(), GetKeyState(), GetKeyboardState(), SetKeyboardState()
|
||||
# user32: *Clipboard*(), MessageBox(), GetKeyState(), GetKeyboardState(), SetKeyboardState()
|
||||
# ws2_32: hbsocket
|
||||
# advapi32: GetUserName()
|
||||
# gdi32: gtwvt
|
||||
|
||||
@@ -18,6 +18,15 @@ CC_OUT := -o
|
||||
|
||||
CFLAGS += -I. -I$(HB_INC_COMPILE)
|
||||
|
||||
# Equivalent to MSVC -GS (default) option, available in GCC 4.1 and upper:
|
||||
# -fstack-protector
|
||||
# Equivalent to -dynamicbase MSVC linker option:
|
||||
# peflags --dynamicbase=true
|
||||
# Equivalent to -nxcompat MSVC linker option:
|
||||
# peflags --nxcompat=true
|
||||
# Equivalent to -tsaware MSVC linker option:
|
||||
# peflags --tsaware=true
|
||||
|
||||
ifneq ($(HB_BUILD_WARN),no)
|
||||
CFLAGS += -Wall -W
|
||||
endif
|
||||
|
||||
@@ -689,14 +689,19 @@ static void hb_gt_wvt_TranslateKey( PHB_GTWVT pWVT, int key, int shiftkey, int a
|
||||
|
||||
static int hb_gt_wvt_key_ansi_to_oem( int c )
|
||||
{
|
||||
BYTE pszAnsi[ 2 ];
|
||||
BYTE pszOem[ 2 ];
|
||||
BYTE pszSrc[ 2 ];
|
||||
wchar_t pszWide[ 1 ];
|
||||
BYTE pszDst[ 2 ];
|
||||
|
||||
pszAnsi[ 0 ] = ( CHAR ) c;
|
||||
pszAnsi[ 1 ] = 0;
|
||||
CharToOemBuffA( ( LPCSTR ) pszAnsi, ( LPSTR ) pszOem, 1 );
|
||||
pszSrc[ 0 ] = ( CHAR ) c;
|
||||
pszSrc[ 1 ] =
|
||||
pszDst[ 0 ] =
|
||||
pszDst[ 1 ] = 0;
|
||||
|
||||
return * pszOem;
|
||||
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, ( LPCSTR ) pszSrc, 1, ( LPWSTR ) pszWide, 1 );
|
||||
WideCharToMultiByte( CP_OEMCP, 0, ( LPCWSTR ) pszWide, 1, ( LPSTR ) pszDst, 1, NULL, NULL );
|
||||
|
||||
return pszDst[ 0 ];
|
||||
}
|
||||
|
||||
static BOOL hb_gt_wvt_FitRows( PHB_GTWVT pWVT )
|
||||
|
||||
@@ -82,34 +82,58 @@ ADSHANDLE hb_ads_hConnect = 0;
|
||||
|
||||
BOOL hb_ads_bOEM = FALSE;
|
||||
|
||||
char * hb_adsOemToAnsi( const char * pcString, ULONG ulLen )
|
||||
char * hb_adsOemToAnsi( const char * pszSrc, ULONG nLen )
|
||||
{
|
||||
if( hb_ads_bOEM )
|
||||
{
|
||||
char * pszDst = ( char * ) hb_xgrab( ulLen + 1 );
|
||||
OemToCharBuffA( ( LPCSTR ) pcString, ( LPSTR ) pszDst, ( DWORD ) ulLen );
|
||||
pszDst[ ulLen ] = '\0';
|
||||
int nWideLen = MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED, pszSrc, nLen, NULL, 0 );
|
||||
LPWSTR pszWide = ( LPWSTR ) hb_xgrab( ( nWideLen + 1 ) * sizeof( wchar_t ) );
|
||||
|
||||
char * pszDst;
|
||||
|
||||
MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED, pszSrc, nLen, pszWide, nWideLen );
|
||||
|
||||
nLen = WideCharToMultiByte( CP_ACP, 0, pszWide, nWideLen, NULL, 0, NULL, NULL );
|
||||
pszDst = ( char * ) hb_xgrab( nLen + 1 );
|
||||
|
||||
WideCharToMultiByte( CP_ACP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
|
||||
hb_xfree( pszWide );
|
||||
|
||||
pszDst[ nLen ] = '\0';
|
||||
return pszDst;
|
||||
}
|
||||
return ( char * ) pcString;
|
||||
return ( char * ) pszSrc;
|
||||
}
|
||||
|
||||
char * hb_adsAnsiToOem( const char * pcString, ULONG ulLen )
|
||||
char * hb_adsAnsiToOem( const char * pszSrc, ULONG nLen )
|
||||
{
|
||||
if( hb_ads_bOEM )
|
||||
{
|
||||
char * pszDst = ( char * ) hb_xgrab( ulLen + 1 );
|
||||
CharToOemBuffA( ( LPCSTR ) pcString, ( LPSTR ) pszDst, ( DWORD ) ulLen );
|
||||
pszDst[ ulLen ] = '\0';
|
||||
int nWideLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, pszSrc, nLen, NULL, 0 );
|
||||
LPWSTR pszWide = ( LPWSTR ) hb_xgrab( ( nWideLen + 1 ) * sizeof( wchar_t ) );
|
||||
|
||||
char * pszDst;
|
||||
|
||||
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, pszSrc, nLen, pszWide, nWideLen );
|
||||
|
||||
nLen = WideCharToMultiByte( CP_OEMCP, 0, pszWide, nWideLen, NULL, 0, NULL, NULL );
|
||||
pszDst = ( char * ) hb_xgrab( nLen + 1 );
|
||||
|
||||
WideCharToMultiByte( CP_OEMCP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
|
||||
hb_xfree( pszWide );
|
||||
|
||||
pszDst[ nLen ] = '\0';
|
||||
return pszDst;
|
||||
}
|
||||
return ( char * ) pcString;
|
||||
return ( char * ) pszSrc;
|
||||
}
|
||||
|
||||
void hb_adsOemAnsiFree( char * pcString )
|
||||
void hb_adsOemAnsiFree( char * pszSrc )
|
||||
{
|
||||
if( hb_ads_bOEM )
|
||||
hb_xfree( pcString );
|
||||
hb_xfree( pszSrc );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -133,8 +133,6 @@ extern char * strerror( int errnum );
|
||||
BOOL WINAPI RemoveDirectoryA( LPCSTR path );
|
||||
BOOL WINAPI CreateDirectoryA( LPCSTR path, LPSECURITY_ATTRIBUTES attr );
|
||||
BOOL WINAPI SetFileAttributesA( LPCSTR filename, DWORD attr );
|
||||
BOOL WINAPI CharToOemBuffA( LPCSTR src, LPSTR dst, DWORD len );
|
||||
BOOL WINAPI OemToCharBuffA( LPCSTR src, LPSTR dst, DWORD len );
|
||||
HANDLE WINAPI FindFirstFileA( LPCSTR path, WIN32_FIND_DATAA * data );
|
||||
BOOL WINAPI FindNextFileA( HANDLE handle, WIN32_FIND_DATAA * data );
|
||||
BOOL WINAPI GetVersionExA( OSVERSIONINFOA * v );
|
||||
|
||||
@@ -510,20 +510,6 @@ BOOL WINAPI SetFileAttributesA( LPCSTR filename, DWORD attr )
|
||||
return b;
|
||||
}
|
||||
|
||||
BOOL WINAPI CharToOemBuffA( LPCSTR src, LPSTR dst, DWORD len )
|
||||
{
|
||||
if( len )
|
||||
hb_strncpy( dst, src, len - 1 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI OemToCharBuffA( LPCSTR src, LPSTR dst, DWORD len )
|
||||
{
|
||||
if( len )
|
||||
hb_strncpy( dst, src, len - 1 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HANDLE WINAPI FindFirstFileA( LPCSTR path, WIN32_FIND_DATAA * data )
|
||||
{
|
||||
DWORD dwError;
|
||||
|
||||
@@ -557,14 +557,19 @@ static void hb_gt_wvt_TranslateKey( PHB_GTWVT pWVT, int key, int shiftkey, int a
|
||||
|
||||
static int hb_gt_wvt_key_ansi_to_oem( int c )
|
||||
{
|
||||
BYTE pszAnsi[ 2 ];
|
||||
BYTE pszOem[ 2 ];
|
||||
BYTE pszSrc[ 2 ];
|
||||
wchar_t pszWide[ 1 ];
|
||||
BYTE pszDst[ 2 ];
|
||||
|
||||
pszAnsi[ 0 ] = ( CHAR ) c;
|
||||
pszAnsi[ 1 ] = 0;
|
||||
CharToOemBuffA( ( LPCSTR ) pszAnsi, ( LPSTR ) pszOem, 1 );
|
||||
pszSrc[ 0 ] = ( CHAR ) c;
|
||||
pszSrc[ 1 ] =
|
||||
pszDst[ 0 ] =
|
||||
pszDst[ 1 ] = 0;
|
||||
|
||||
return * pszOem;
|
||||
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, ( LPCSTR ) pszSrc, 1, ( LPWSTR ) pszWide, 1 );
|
||||
WideCharToMultiByte( CP_OEMCP, 0, ( LPCWSTR ) pszWide, 1, ( LPSTR ) pszDst, 1, NULL, NULL );
|
||||
|
||||
return pszDst[ 0 ];
|
||||
}
|
||||
|
||||
static void hb_gt_wvt_FitRows( PHB_GTWVT pWVT )
|
||||
|
||||
@@ -78,7 +78,7 @@ HB_FUNC( HB_ANSITOOEM )
|
||||
nLen = WideCharToMultiByte( CP_OEMCP, 0, pszWide, nWideLen, NULL, 0, NULL, NULL );
|
||||
pszDst = ( char * ) hb_xgrab( nLen + 1 );
|
||||
|
||||
WideCharToMultiByte( CP_OEMCP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
WideCharToMultiByte( CP_OEMCP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
|
||||
hb_xfree( pszWide );
|
||||
hb_retclen_buffer( pszDst, nLen );
|
||||
@@ -110,7 +110,7 @@ HB_FUNC( HB_OEMTOANSI )
|
||||
nLen = WideCharToMultiByte( CP_ACP, 0, pszWide, nWideLen, NULL, 0, NULL, NULL );
|
||||
pszDst = ( char * ) hb_xgrab( nLen + 1 );
|
||||
|
||||
WideCharToMultiByte( CP_ACP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
WideCharToMultiByte( CP_ACP, 0, pszWide, nWideLen, pszDst, nLen, NULL, NULL );
|
||||
|
||||
hb_xfree( pszWide );
|
||||
hb_retclen_buffer( pszDst, nLen );
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
#if defined( HB_OS_WIN ) && !defined( HB_OS_WIN_CE )
|
||||
|
||||
LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInfo )
|
||||
static LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInfo )
|
||||
{
|
||||
char errmsg[ 8192 ];
|
||||
int errmsglen = sizeof( errmsg ) - 1;
|
||||
@@ -288,10 +288,10 @@ LONG WINAPI hb_winExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInfo
|
||||
|
||||
static EXCEPTIONREGISTRATIONRECORD s_regRec; /* Exception Registration Record */
|
||||
|
||||
ULONG _System hb_os2ExceptionHandler( PEXCEPTIONREPORTRECORD p1,
|
||||
PEXCEPTIONREGISTRATIONRECORD p2,
|
||||
PCONTEXTRECORD p3,
|
||||
PVOID pv )
|
||||
static ULONG _System hb_os2ExceptionHandler( PEXCEPTIONREPORTRECORD p1,
|
||||
PEXCEPTIONREGISTRATIONRECORD p2,
|
||||
PCONTEXTRECORD p3,
|
||||
PVOID pv )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( p1 );
|
||||
HB_SYMBOL_UNUSED( p2 );
|
||||
|
||||
Reference in New Issue
Block a user