Search found 10 matches

by romk
Tue Nov 18, 2014 3:20 am
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

Well, I could not find a solution to change the behaviour of the DLL loading order, but some other guy gave me the idea to hack the compiled executable that uses the "wrong" DLL, and to change the reference of DLL there it wants to load. Now it is looking for wsocipx.dll rather than wsock32.dll and ...
by romk
Mon Nov 17, 2014 7:35 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

It was loading wsock.dll successful the whole time. The problem is that it loads the wrong DLL. Or rather not from the path i want.
by romk
Mon Nov 17, 2014 7:25 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

Yes, it is above all other code.

The MessageBox test retrieves:
Is wSock.DLL loaded? 5513152
by romk
Mon Nov 17, 2014 6:54 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

Thunder93 wrote:Specify the path or you'll see it test out....

:wink:
Well, I did try both.
romk wrote:no matter if this line is on top of my code or not:

Code: Select all

OpenLibrary(#PB_Any,"C:\windows\system32\wSock32.dll")

Code: Select all

OpenLibrary(#PB_Any,"wSock32.dll")
by romk
Mon Nov 17, 2014 6:36 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

With PB 5.31 x64 & x86 I specified path to the system folder and using bogus / not existing file. However the file exists in the executable location. Testing, the DLL file with the executable is never used.


Information seen in PB doc about OpenLibrary filename$ parameter. Is completely observed ...
by romk
Mon Nov 17, 2014 5:47 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

Are you saying the PB doc's are wrong?
Result = OpenLibrary(#Library, Filename$)
Description
Opens a shared library in order that the functions within it may be accessed.
Parameters

#Library A number to identify this library. #PB_Any can be used to auto-generate this number.
Filename$ The ...
by romk
Mon Nov 17, 2014 5:22 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

I tested that one with both LoadLibrary_() and LoadLibraryEx_() , without success. The error still occurs.

But I found an interesting Function documented in MSDN: SetSearchPathMode . The pages about LoadLibrary_() and LoadLibraryEx_() both hyperlinked me there. Unfortunately PB does not recognize ...
by romk
Mon Nov 17, 2014 2:21 pm
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

So, the question really is: why are two different apps installed to the same directory?

And the easiest way to fix your problem: install your app into its own unique directory. That is for a reason. The other application is being updated and launched by my program. For the sake of simplicity it's ...
by romk
Mon Nov 17, 2014 2:20 am
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Re: Prevent loading of a local *.dll

I already tried this in form of

Code: Select all

OpenLibrary(#PB_Any, "C:\windows\system32\wsock32.dll")
but it still does not prevent the program too look it up in its local directory.
by romk
Mon Nov 17, 2014 1:13 am
Forum: Coding Questions
Topic: Prevent loading of a local *.dll
Replies: 28
Views: 9553

Prevent loading of a local *.dll

I believe my question is very specific, as I was not able to find anything related to it.

As far as I understood, DLLs are being imported on the very beginning of the compiled code, first checking in the local directory and then in the path variable directories. For my situation I need the ...