Hi all,
... its users job to
passing parameters according to call specification of
.dll function.
Yes, but I think it's not only Harbour.
Apply the patch attached to testdll.prg
Could someone test that about xBase++ and/or xHarbour?
--
Xavi
El 08/02/2010 10:54, Viktor Szakáts escribió:
Hi,
... I wonder if it's possible to fix this
function to not be sensitive on this setting.
Any idea?
Yes, of course. ??? :)
I can fix this without ASM, but a bad use of these functions always cause GPF.
That would be the nicest. I guess protection against
'bad use' is not entirely possible, as its users job to
passing parameters according to call specification of
.dll function.
Brgds,
Viktor
Index: testdll.prg
===================================================================
--- testdll.prg (revision 13328)
+++ testdll.prg (working copy)
@@ -69,7 +69,8 @@
? cData
DllUnload( hDLL )
- ? "MsgBox:", DllCall( "user32.dll", NIL, "MessageBoxA", 0, "Hello world!",
"Harbour sez", hb_bitOr( MB_OKCANCEL, MB_ICONEXCLAMATION, MB_HELP ) )
+ /* Cause GPF [jarabal] */
+ ? "MsgBox:", DllCall( "user32.dll", NIL, "MessageBoxA", 0,
MB_ICONEXCLAMATION /*"Hello world!"*/, "Harbour sez", hb_bitOr( MB_OKCANCEL,
MB_ICONEXCLAMATION, MB_HELP ) )
IF hb_FileExists( "libcurl.dll" )
hDLL := DllLoad( "libcurl.dll" )
@@ -96,17 +97,20 @@
hDLL := DllLoad( "shell32.dll" )
? "ValType( hDLL ): ", ValType( hDLL )
cData := Space( MAX_PATH )
+ cData := '' /* Cause GPF [jarabal] */
? "CALLDLLBOOL: ", CallDllBool( GetProcAddress( hDLL,
"SHGetSpecialFolderPath" ), 0, @cData, CSIDL_APPDATA, 0 )
? "@cData: ", cData
? "CALLDLL: ", CallDll( GetProcAddress( hDLL, "SHGetFolderPath" ), 0,
CSIDL_ADMINTOOLS, 0, 0, cData ) // WRONG
? "cData:", cData
cData := Space( MAX_PATH )
+ cData := '123' /* Cause GPF [jarabal] */
? "CALDLL: ", CallDll( GetProcAddress( hDLL, "SHGetFolderPath" ), 0,
CSIDL_ADMINTOOLS, 0, 0, @cData )
? "@cData: ", cData
DllUnload( hDLL )
? "DLLCALL"
cData := Space( MAX_PATH )
+ cData := 123 /* Cause GPF [jarabal] */
? DllCall( "shell32.dll", NIL, "SHGetFolderPath", 0, CSIDL_ADMINTOOLS, 0,
0, @cData )
? cData
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour