PB x64 - Bug load dll

Post bugreports for the Windows version here
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

PB x64 - Bug load dll

Post by User_Russian »

I found a very strange bug in x64 dll (in x86 doesn't have this problem).
If a structure field is assigned a value, the dll is loaded from the second time. It is very strange.
Test code dll.

Code: Select all

x.RECT
x\left=0

ProcedureDLL Test()
  
EndProcedure
Test code exe.

Code: Select all

Debug OpenLibrary(0, "dll.dll")
Debug OpenLibrary(0, "dll.dll")
Result.
0
6442450944
Test code exe on WinAPI.

Code: Select all

h = LoadLibrary_("dll.dll")
e = GetLastError_()
Debug h
Debug e
Debug ""
h = LoadLibrary_("dll.dll")
e = GetLastError_()
Debug h
Debug e
Result.
0
0

6442450944
0
The first time try to load a dll, the LoadLibrary() function returns 0, but at the same time, the GetLastError() function also returns 0 (no errors). It is very strange.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB x64 - Bug load dll

Post by mk-soft »

Do not code outside procedures! Stack corruption

See PB-Help and DLL's

Code: Select all

;-TOP

ProcedureDLL AttachProcess(Instance)
  Global x.rect
  x\left = 10
EndProcedure

; Or

; Procedure InitVariables()
;   Global x.rect
;   x\left = 10
; EndProcedure : InitVariables()

ProcedureDLL MyFc()
  ;
EndProcedure
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply