Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / question about DLL_PROCESS_DETACH

Author
Message
Mussi
16
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 27th Oct 2004 06:11
would it still be called if a process crashes? like a dark basic app.



Specs: AMD Athlon 1800+, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce4 Ti4400 128mb
OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 27th Oct 2004 06:16
It probably wont if the program crashes before the DLL system is initialised...

He who knows the cat becomes his slave; he who knows the dog becomes his King.
Mussi
16
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 27th Oct 2004 06:25
Of course , but I mean after the DLL is loaded into the virtual address space of the current process



Specs: AMD Athlon 1800+, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce4 Ti4400 128mb
OSX Using Happy Dude
15
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Oct 2004 03:55
Its very doubtful...

He who knows the cat becomes his slave; he who knows the dog becomes his King.
IanM
Retired Moderator
16
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Oct 2004 21:48
Test it.

Write a DLL with a messagebox in the detach section, and then write an app that uses it but deliberately writes to an uninitialised pointer. See if the messagebox appears.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Mussi
16
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 29th Oct 2004 03:09 Edited at: 29th Oct 2004 03:10
Okey, I got some very weird results.

I made a simple plugin that gives a message box when a dll attaches and when it detaches. And I made a simple bugged DBP program:



now when I run that, I get an attach message, then a detach message, then another attach message, then another detach, and like that aint enough... I get another attach message when the window pops up. Now when the program ends by the crash, I get no detach message when the bla command is the first command in the code, but when it's called after a DBP command it does give me a detach message.

Now tell me... how weird is that ?



Specs: AMD Athlon 1800+, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce4 Ti4400 128mb
IanM
Retired Moderator
16
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Oct 2004 07:01
You have to be a little careful with plug-in DLLs - the compiler loads the DLL at least once, so that may be causing some of your attaches/detaches. That's why Lee included the Constructer/Destructor function calls.

I suggest that you build the exe, and then run it stand-alone from explorer.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Mussi
16
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 30th Oct 2004 03:01 Edited at: 30th Oct 2004 03:02
ah, I only see one attach message now, that's good, but there is still a bug with the detaching stuff.

this one crashes with no detach message:


this one craches with a detach message:


why is that ?

oh and while we're at it, how can you manually detach plugins?



Specs: AMD Athlon 1800+, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce4 Ti4400 128mb
IanG
14
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 30th Oct 2004 21:19
Quote: "how can you manually detach plugins"

i don't think you can appart from using load dll, call dll etc.

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2ghz, 512mb, geforce fx5200 128mb, 200gb, xp pro sp2

Login to post a reply

Server time is: 2019-04-26 12:01:02
Your offset time is: 2019-04-26 12:01:02