Page 1 of 1

GetProcAddress and problem in unicode

Posted: Mon Nov 03, 2008 1:30 am
by Fredi
Hi

M$ doesn't support unicode in GetProcAddress API unfortunately so how can we fix this problem? I used PBOSL_LoadDllMemory but it doesn't work too in unicode...

I using this API for start hook, this is example:

Code: Select all

#WH_CALLWNDPROCRET = 12 

threadID = GetWindowThreadProcessId_(WindowID, @processID)
hDLL = OpenLibrary(0,"c:\1.dll")

SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetProcAddress_(hDLL, "MyCallWndRetProc"), hDLL, threadID)
Any idea?

Posted: Mon Nov 03, 2008 2:39 am
by ts-soft

Code: Select all

#WH_CALLWNDPROCRET = 12

threadID = GetWindowThreadProcessId_(WindowID, @processID)
hDLL = OpenLibrary(0,"c:\1.dll")
function_u.s = "MyCallWndRetProc"
function_a.s = Space(StringByteLength(function_u, #PB_Ascii) + 1)
PokeS(@function_a, function_u, -1, #PB_Ascii)
SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetProcAddress_(hDLL, @function_a), hDLL, threadID)

GetProcAddress and problem in unicode

Posted: Mon Nov 03, 2008 11:42 am
by Fredi
Many many thanks thomas, you are a kind man :D

Posted: Tue Nov 04, 2008 12:33 am
by Fred
Is there a problem with GetFunction() ?

Code: Select all

SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetFunction(0, "MyCallWndRetProc" ), hDLL, threadID)