Skip to content

Commit b2712f1

Browse files
committed
1 parent 0fe42b1 commit b2712f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/MethodCallBack.pas

+3-3
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ procedure GetCodeMem(var ptr: PByte; size: integer);
194194
{$IFEND}
195195
if mprotect(page, PageSize, flags) <> 0 then
196196
raise EMProtectError.CreateFmt('MProtect error: %s', [
197-
SysErrorMessage(GetLastError())]);
197+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
198198
{$ENDIF}
199199
page^.next:=CodeMemPages;
200200
CodeMemPages:=page;
@@ -210,7 +210,7 @@ procedure GetCodeMem(var ptr: PByte; size: integer);
210210
//RW permission to the entire page for new changes...
211211
if mprotect(page, PageSize, PROT_READ or PROT_WRITE) <> 0 then
212212
raise EMProtectError.CreateFmt('MProtect error: %s', [
213-
SysErrorMessage(GetLastError())]);
213+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
214214
end;
215215
{$ELSE}
216216
end;
@@ -751,7 +751,7 @@ function GetCallBack(Self: TObject; Method: Pointer; ArgNum: Integer;
751751
//X permission to the entire page for executions...
752752
if mprotect(CodeMemPages, PageSize, PROT_EXEC) <> 0 then
753753
raise EMProtectError.CreateFmt('MProtect error: %s', [
754-
SysErrorMessage(GetLastError())]);
754+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
755755
{$IFEND}
756756

757757
Result := Pointer(Q); //set arm mode

0 commit comments

Comments
 (0)