high6 Posted May 13, 2009 Posted May 13, 2009 I currently am getting around it by doingCreateThread(0, 0, (LPTHREAD_START_ROUTINE)Init, 0, 0, 0);But from what I understand, when you create a thread in DllMain it queues it up to be executed after DllMain executes. So how can I have a MSIL DeInit function? Creating a thread wont work because it will execute after the dll is no longer in memory.
evlncrn8 Posted May 13, 2009 Posted May 13, 2009 you could possibly try using createremotethread on yourself... createremotethread behaves somewhat differently
high6 Posted May 13, 2009 Author Posted May 13, 2009 you could possibly try using createremotethread on yourself... createremotethread behaves somewhat differently CreateThread uses CreateRemoteThread . I may try opening the current process and doing that but I think it would queue every new thread.
evlncrn8 Posted May 14, 2009 Posted May 14, 2009 yep, but with slightly different parameters...for example...make 2 exe's, one is a launcher, the other a dumb program that prints some outputprogram 1 -> launch and suspend program 2program 1 -> createremotethread on the now suspended program...what happens?well, the thread actually runs, even though the process its 'attached' to is suspendedthus createthread != createremotethreadwhich is why i suggested trying it
high6 Posted May 14, 2009 Author Posted May 14, 2009 yep, but with slightly different parameters...for example...make 2 exe's, one is a launcher, the other a dumb program that prints some outputprogram 1 -> launch and suspend program 2program 1 -> createremotethread on the now suspended program...what happens?well, the thread actually runs, even though the process its 'attached' to is suspendedthus createthread != createremotethreadwhich is why i suggested trying itI am talking about DllMain though. Which when it is executing there is a lock in place.http://blogs.msdn.com/oldnewthing/archive/...04/4731478.aspxhttp://download.microsoft.com/download/a/f...LL_bestprac.doc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now