It is currently Mon Nov 20, 2017 1:12 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Process hangs when OpenLibrary() is called twice in this way
PostPosted: Tue Nov 07, 2017 7:48 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3107
This was actually a mistake on my part but I was surprised that it hung. Run the following snippet and the process will fail to terminate.

Tested on Windows 10 x64 with PureBasic 5.60 x64 with the debugger on:

Code:
Lib_advapi32=OpenLibrary(#PB_Any,"advapi32.dll")
OpenLibrary(Lib_advapi32, "advapi32.dll")


The process will not hang when using the same code to load user32.dll:

Code:
Lib_user32=OpenLibrary(#PB_Any,"user32.dll")
OpenLibrary(Lib_user32, "user32.dll")


And it does not hang when using LoadLibrary_() to load the library twice:

Code:
LoadLibrary_(@"advapi32.dll")
LoadLibrary_(@"advapi32.dll")


I would argue that despite this being a bug on my part I was lucky that I was only testing a small bit of code. Because it only hung as the process was attempting to terminate, there is no indication as to the source of the problem.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye