Fri Oct 3 11:02:00 GMT 2008
I'm trying to use the Win32::GuiTest perl module on WinXP SP3.
I installed it under cygwin with something like:
perl -MCPAN -e 'install Win32::GuiTest'
However certain use is failing on the SetWindowHookEx because it is
passing a NULL hModule, which is surprising because dllmain shows that
hModule is saved in g_hDLL - except it's not working like that.
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call,
// Value used by SetWindowsHookEx, etc.
g_hDLL = (HINSTANCE)hModule;
g_hDLL is always 0.
If I put in DllMain
if (! hModule) return FALSE;
then the load does NOT abort like a plain return FALSE, so I know
hModule is passed in as non-zero
Further debugging shows the following:
return FALSE; aborts the program - the only debugging tool that works,
setting global variables in DllMain has no effect, when examined later
in the DLL, they have their default initialized values. Even variables
that don't have a specific initialized don't retain any value set during
calling functions like fprintf, fopen have no effect in DllMain, not
even strace shows up their attempted use. Not even setenv does anything
So, in short, DllMain doesn't save the hModule because it can't save
global variables, in fact it seems so ephemeral that the only thing it
CAN do is: return FALSE or return TRUE.
Anyone recognize this problem or have suggestions on what to do?
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin