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;
|
||||
|
||||
var
|
||||
ExitCode: Integer;
|
||||
MainWindow: THandle;
|
||||
|
||||
const
|
||||
kernel32 = 'kernel32.dll';
|
||||
user32 = 'user32.dll';
|
||||
|
||||
procedure _Halt(ExitCode: Integer);
|
||||
|
||||
procedure ExitProcess(ExitCode: Cardinal); stdcall;
|
||||
external kernel32 name 'ExitProcess';
|
||||
function GetCommandLine: PKolibriChar; stdcall;
|
||||
|
@ -24,11 +24,17 @@ begin
|
||||
HeapHandle := GetProcessHeap;
|
||||
end;
|
||||
|
||||
procedure _Halt(ExitCode: Integer);
|
||||
asm
|
||||
CALL FinalizeUnits
|
||||
PUSH ExitCode
|
||||
CALL ExitProcess
|
||||
end;
|
||||
|
||||
procedure _Halt0;
|
||||
asm
|
||||
PUSH EAX
|
||||
CALL FinalizeUnits
|
||||
CALL ExitProcess
|
||||
MOV EAX, ExitCode
|
||||
JMP _Halt
|
||||
end;
|
||||
|
||||
procedure ErrorMessage(Msg: PKolibriChar; Count: Byte);
|
||||
|
@ -447,10 +447,12 @@ asm
|
||||
SUB EDX, EAX
|
||||
CALL ErrorMessage
|
||||
|
||||
{$IFNDEF KolibriOS}
|
||||
POP EAX
|
||||
{$ENDIF}
|
||||
{$IFDEF KolibriOS}
|
||||
JMP _Halt0
|
||||
{$ELSE}
|
||||
POP EAX
|
||||
JMP _Halt
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{$IFDEF KolibriOS}
|
||||
|
Loading…
Reference in New Issue
Block a user