1
0
mirror of synced 2024-12-22 09:13:07 +01:00

Resolved 64-bit incompatibility in singe instance checks

This commit is contained in:
Roald van Doorn 2023-12-04 11:01:23 +01:00
parent df699f4088
commit a78d55b527

View File

@ -300,7 +300,7 @@ begin
{ Attempt to create shared memory } { Attempt to create shared memory }
SetLastError(0); SetLastError(0);
FFileMapping := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, FFileMapping := CreateFileMapping(INVALID_HANDLE_VALUE, nil, PAGE_READWRITE, 0,
SizeOf(TX2InstanceMapData), SizeOf(TX2InstanceMapData),
PChar(ScopePrefix[Global] + PChar(ScopePrefix[Global] +
'SingleInstance.' + ApplicationID)); 'SingleInstance.' + ApplicationID));
@ -330,8 +330,7 @@ begin
if FileMapData^.Window = 0 then if FileMapData^.Window = 0 then
RaiseLastOSError(); RaiseLastOSError();
SetWindowLong(FileMapData^.Window, GWL_WNDPROC, SetWindowLongPtr(FileMapData^.Window, GWL_WNDPROC, NativeInt(MakeObjectInstance(WindowProc)));
Integer(MakeObjectInstance(WindowProc)));
end; end;
Inc(FFileMapData^.RefCount); Inc(FFileMapData^.RefCount);