mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2024-11-10 02:00:33 +01:00
Program exit code support in KoW
This commit is contained in:
parent
d7a6530b18
commit
fa788aeb37
@ -12,12 +12,15 @@ type
|
|||||||
HRSRC = THandle;
|
HRSRC = THandle;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
ExitCode: Integer;
|
||||||
MainWindow: THandle;
|
MainWindow: THandle;
|
||||||
|
|
||||||
const
|
const
|
||||||
kernel32 = 'kernel32.dll';
|
kernel32 = 'kernel32.dll';
|
||||||
user32 = 'user32.dll';
|
user32 = 'user32.dll';
|
||||||
|
|
||||||
|
procedure _Halt(ExitCode: Integer);
|
||||||
|
|
||||||
procedure ExitProcess(ExitCode: Cardinal); stdcall;
|
procedure ExitProcess(ExitCode: Cardinal); stdcall;
|
||||||
external kernel32 name 'ExitProcess';
|
external kernel32 name 'ExitProcess';
|
||||||
function GetCommandLine: PKolibriChar; stdcall;
|
function GetCommandLine: PKolibriChar; stdcall;
|
||||||
|
@ -24,11 +24,17 @@ begin
|
|||||||
HeapHandle := GetProcessHeap;
|
HeapHandle := GetProcessHeap;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure _Halt(ExitCode: Integer);
|
||||||
|
asm
|
||||||
|
CALL FinalizeUnits
|
||||||
|
PUSH ExitCode
|
||||||
|
CALL ExitProcess
|
||||||
|
end;
|
||||||
|
|
||||||
procedure _Halt0;
|
procedure _Halt0;
|
||||||
asm
|
asm
|
||||||
PUSH EAX
|
MOV EAX, ExitCode
|
||||||
CALL FinalizeUnits
|
JMP _Halt
|
||||||
CALL ExitProcess
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ErrorMessage(Msg: PKolibriChar; Count: Byte);
|
procedure ErrorMessage(Msg: PKolibriChar; Count: Byte);
|
||||||
|
@ -447,10 +447,12 @@ asm
|
|||||||
SUB EDX, EAX
|
SUB EDX, EAX
|
||||||
CALL ErrorMessage
|
CALL ErrorMessage
|
||||||
|
|
||||||
{$IFNDEF KolibriOS}
|
{$IFDEF KolibriOS}
|
||||||
POP EAX
|
|
||||||
{$ENDIF}
|
|
||||||
JMP _Halt0
|
JMP _Halt0
|
||||||
|
{$ELSE}
|
||||||
|
POP EAX
|
||||||
|
JMP _Halt
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF KolibriOS}
|
{$IFDEF KolibriOS}
|
||||||
|
Loading…
Reference in New Issue
Block a user