From 45ff380f7139e110fec9430c9194fff87c320051 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 14 Feb 2010 14:33:27 +0000 Subject: [PATCH] 2010-02-14 15:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/hbdyn.c % Minor cleanup. * contrib/hbwin/win_dllf.prg ! Fixed to be case-insentitive for keywords. --- harbour/ChangeLog | 7 +++++++ harbour/contrib/hbwin/hbdyn.c | 15 +++++++++++---- harbour/contrib/hbwin/win_dllf.prg | 10 +++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 38694a754b..e87a10da2a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-14 15:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbwin/hbdyn.c + % Minor cleanup. + + * contrib/hbwin/win_dllf.prg + ! Fixed to be case-insentitive for keywords. + 2010-02-14 15:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbwince.h * redirect GetProcAddress() to GetProcAddressA() in WinCE builds. diff --git a/harbour/contrib/hbwin/hbdyn.c b/harbour/contrib/hbwin/hbdyn.c index b0ce17d781..f254d202a5 100644 --- a/harbour/contrib/hbwin/hbdyn.c +++ b/harbour/contrib/hbwin/hbdyn.c @@ -205,7 +205,7 @@ static HB_U64 hb_u64par( PHB_ITEM pParam, PHB_DYNARG pArg ) HB_SIZE nLen = hb_itemGetCLen( pParam ); pArg->hString = hb_xgrab( nLen + sizeof( char ) ); pArg->bRawBuffer = HB_TRUE; - memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), hb_itemGetCLen( pParam ) ); + memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), nLen ); ( ( char * ) pArg->hString )[ nLen ] = '\0'; r = ( HB_PTRUINT ) pArg->hString; pArg->value.t.n64 = r; @@ -241,7 +241,7 @@ static HB_U64 hb_u64par( PHB_ITEM pParam, PHB_DYNARG pArg ) HB_SIZE nLen = hb_itemGetCLen( pParam ); pArg->hString = hb_xgrab( nLen + sizeof( char ) ); pArg->bRawBuffer = HB_TRUE; - memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), hb_itemGetCLen( pParam ) ); + memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), nLen ); ( ( char * ) pArg->hString )[ nLen ] = '\0'; r = ( HB_PTRUINT ) pArg->hString; break; @@ -579,7 +579,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r HB_SIZE nLen = hb_itemGetCLen( pParam ); pArg->hString = hb_xgrab( nLen + sizeof( char ) ); pArg->bRawBuffer = HB_TRUE; - memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), hb_itemGetCLen( pParam ) ); + memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), nLen ); ( ( char * ) pArg->hString )[ nLen ] = '\0'; *r1 = ( HB_PTRUINT ) pArg->hString; pArg->value.t.n32 = *r1; @@ -615,7 +615,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r HB_SIZE nLen = hb_itemGetCLen( pParam ); pArg->hString = hb_xgrab( nLen + sizeof( char ) ); pArg->bRawBuffer = HB_TRUE; - memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), hb_itemGetCLen( pParam ) ); + memcpy( ( char * ) pArg->hString, hb_itemGetCPtr( pParam ), nLen ); ( ( char * ) pArg->hString )[ nLen ] = '\0'; *r1 = ( HB_PTRUINT ) pArg->hString; break; @@ -806,6 +806,7 @@ typedef HB_U32 ( _stdcall * FX86_S32P27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef HB_U32 ( _stdcall * FX86_S32P28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U32 ( _stdcall * FX86_S32P29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U32 ( _stdcall * FX86_S32P30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef HB_U64 ( _stdcall * FX86_S64P00 )( void ); typedef HB_U64 ( _stdcall * FX86_S64P01 )( HB_U32 ); typedef HB_U64 ( _stdcall * FX86_S64P02 )( HB_U32, HB_U32 ); @@ -837,6 +838,7 @@ typedef HB_U64 ( _stdcall * FX86_S64P27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef HB_U64 ( _stdcall * FX86_S64P28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U64 ( _stdcall * FX86_S64P29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U64 ( _stdcall * FX86_S64P30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef double ( _stdcall * FX86_SDBP00 )( void ); typedef double ( _stdcall * FX86_SDBP01 )( HB_U32 ); typedef double ( _stdcall * FX86_SDBP02 )( HB_U32, HB_U32 ); @@ -868,6 +870,7 @@ typedef double ( _stdcall * FX86_SDBP27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef double ( _stdcall * FX86_SDBP28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef double ( _stdcall * FX86_SDBP29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef double ( _stdcall * FX86_SDBP30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef float ( _stdcall * FX86_SFLP00 )( void ); typedef float ( _stdcall * FX86_SFLP01 )( HB_U32 ); typedef float ( _stdcall * FX86_SFLP02 )( HB_U32, HB_U32 ); @@ -899,6 +902,7 @@ typedef float ( _stdcall * FX86_SFLP27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef float ( _stdcall * FX86_SFLP28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef float ( _stdcall * FX86_SFLP29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef float ( _stdcall * FX86_SFLP30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef HB_U32 ( _cdecl * FX86_C32P00 )( void ); typedef HB_U32 ( _cdecl * FX86_C32P01 )( HB_U32 ); typedef HB_U32 ( _cdecl * FX86_C32P02 )( HB_U32, HB_U32 ); @@ -930,6 +934,7 @@ typedef HB_U32 ( _cdecl * FX86_C32P27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef HB_U32 ( _cdecl * FX86_C32P28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U32 ( _cdecl * FX86_C32P29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U32 ( _cdecl * FX86_C32P30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef HB_U64 ( _cdecl * FX86_C64P00 )( void ); typedef HB_U64 ( _cdecl * FX86_C64P01 )( HB_U32 ); typedef HB_U64 ( _cdecl * FX86_C64P02 )( HB_U32, HB_U32 ); @@ -961,6 +966,7 @@ typedef HB_U64 ( _cdecl * FX86_C64P27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef HB_U64 ( _cdecl * FX86_C64P28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U64 ( _cdecl * FX86_C64P29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef HB_U64 ( _cdecl * FX86_C64P30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef double ( _cdecl * FX86_CDBP00 )( void ); typedef double ( _cdecl * FX86_CDBP01 )( HB_U32 ); typedef double ( _cdecl * FX86_CDBP02 )( HB_U32, HB_U32 ); @@ -992,6 +998,7 @@ typedef double ( _cdecl * FX86_CDBP27 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U3 typedef double ( _cdecl * FX86_CDBP28 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef double ( _cdecl * FX86_CDBP29 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); typedef double ( _cdecl * FX86_CDBP30 )( HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32, HB_U32 ); + typedef float ( _cdecl * FX86_CFLP00 )( void ); typedef float ( _cdecl * FX86_CFLP01 )( HB_U32 ); typedef float ( _cdecl * FX86_CFLP02 )( HB_U32, HB_U32 ); diff --git a/harbour/contrib/hbwin/win_dllf.prg b/harbour/contrib/hbwin/win_dllf.prg index 7ffd16c63e..4e62a9ebd0 100644 --- a/harbour/contrib/hbwin/win_dllf.prg +++ b/harbour/contrib/hbwin/win_dllf.prg @@ -72,11 +72,11 @@ FUNCTION win_dllCallFoxPro( cCommand, ... ) LOCAL aParam - IF nPos <= Len( aCommand ) .AND. aCommand[ nPos ] == "DECLARE" + IF nPos <= Len( aCommand ) .AND. Upper( aCommand[ nPos ] ) == "DECLARE" ++nPos ENDIF - IF nPos <= Len( aCommand ) .AND. ( tmp := AScan( aTypeS, {| tmp | tmp == aCommand[ nPos ] } ) ) > 0 + IF nPos <= Len( aCommand ) .AND. ( tmp := AScan( aTypeS, {| tmp | tmp == Upper( aCommand[ nPos ] ) } ) ) > 0 nFuncFlags := hb_bitOr( nFuncFlags, aTypeN[ tmp ] ) ++nPos ELSE @@ -90,7 +90,7 @@ FUNCTION win_dllCallFoxPro( cCommand, ... ) RETURN NIL ENDIF - IF nPos <= Len( aCommand ) .AND. aCommand[ nPos ] == "IN" + IF nPos <= Len( aCommand ) .AND. Upper( aCommand[ nPos ] ) == "IN" ++nPos ELSE RETURN NIL @@ -103,14 +103,14 @@ FUNCTION win_dllCallFoxPro( cCommand, ... ) RETURN NIL ENDIF - IF nPos <= Len( aCommand ) .AND. aCommand[ nPos ] == "AS" + IF nPos <= Len( aCommand ) .AND. Upper( aCommand[ nPos ] ) == "AS" nPos += 2 ENDIF aParam := { cFunction, cLibrary, nFuncFlags } DO WHILE nPos <= Len( aCommand ) - IF ( tmp := AScan( aTypeS, {| tmp | tmp == aCommand[ nPos ] } ) ) > 0 + IF ( tmp := AScan( aTypeS, {| tmp | tmp == Upper( aCommand[ nPos ] ) } ) ) > 0 AAdd( aParam, hb_bitOr( HB_DYN_ENC_RAW, aTypeN[ tmp ] ) ) ++nPos ENDIF