Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
[Forgot to copy this to the list, + new question] * Aurimas Černius wrote, On 03/10/08 12:12: If I'm not wrong, GetModuleHandle(NULL) returns the handle of the current module (should be DLL handle, when called from DLL). So saving handle to a global variable is not needed. thanks! I think

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
Sam Liddicott wrote on 03 October 2008 13:12: [Forgot to copy this to the list, + new question] * Aurimas Černius wrote, On 03/10/08 12:12: If I'm not wrong, GetModuleHandle(NULL) returns the handle of the current module (should be DLL handle, when called from DLL). So saving handle to a

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
[sent again without optional alternative html part] * Dave Korn wrote, On 03/10/08 13:34: Sam Liddicott wrote on 03 October 2008 13:12: [Forgot to copy this to the list, + new question] * Aurimas Černius wrote, On 03/10/08 12:12: If I'm not wrong, GetModuleHandle(NULL) returns the

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* Dave Korn wrote, On 03/10/08 13:34: DllMain is special. There's a lot you cannot do in there, in particular file i/o, printf etc, because you're running inside a lock and it's a sort of critical section-y sort of situation, and indeed the MSVC CRT probably isn't inited yet, so you

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
Sam Liddicott wrote on 03 October 2008 14:00: It crashes when I do the first sendmessage after hooking. ... with presumably a null pointer dereference? it's hard to tell, it's explorer.exe that is crashing. ... and? Explorer is just a program like any other. Install WinDbg and

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* Dave Korn wrote, On 03/10/08 14:38: Sam Liddicott wrote on 03 October 2008 14:00: It crashes when I do the first sendmessage after hooking. ... with presumably a null pointer dereference? it's hard to tell, it's explorer.exe that is crashing. ... and?

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
Sam Liddicott wrote on 03 October 2008 14:04: * Dave Korn wrote, On 03/10/08 13:34: DllMain is special. There's a lot you cannot do in there, in particular file i/o, printf etc, because you're running inside a lock and it's a sort of critical section-y sort of situation, and indeed the

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* Dave Korn wrote, On 03/10/08 15:58: Sam Liddicott wrote on 03 October 2008 14:04: * Dave Korn wrote, On 03/10/08 13:34: DllMain is special. There's a lot you cannot do in there, in particular file i/o, printf etc, because you're running inside a lock and it's a sort of