Exit programs automatically by System unit

This commit is contained in:
Владислав Джавадов 2020-06-07 21:55:00 +03:00
parent 7add2ddf38
commit b366037e72
17 changed files with 20 additions and 26 deletions

View File

@ -52,7 +52,7 @@ begin
BLACK_BUTTON: BLACK_BUTTON:
SetWindowCaption('Black'); SetWindowCaption('Black');
1: 1:
TerminateThread; Break;
end; end;
end; end;
end. end.

View File

@ -50,5 +50,4 @@ begin
until KBHit; until KBHit;
ConsoleExit(1); ConsoleExit(1);
TerminateThread;
end. end.

View File

@ -90,6 +90,6 @@ begin
GetKey; GetKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -148,6 +148,6 @@ begin
GetKey; GetKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -43,6 +43,6 @@ begin
end; end;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -32,5 +32,4 @@ begin
printf('CurrentDirectory is "%s"'#10, Buffer); printf('CurrentDirectory is "%s"'#10, Buffer);
ConsoleExit(0); ConsoleExit(0);
TerminateThread;
end. end.

View File

@ -53,6 +53,6 @@ begin
end; end;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -57,7 +57,7 @@ begin
end; end;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
NO_EVENT: NO_EVENT:
UpdateInfo; UpdateInfo;
end; end;

View File

@ -28,6 +28,6 @@ begin
GetKey; GetKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -24,5 +24,4 @@ begin
WriteN(Buffer, FileSize); WriteN(Buffer, FileSize);
ConsoleExit(0); ConsoleExit(0);
TerminateThread;
end. end.

View File

@ -65,5 +65,4 @@ begin
end; end;
ConsoleExit(0); ConsoleExit(0);
TerminateThread;
end. end.

View File

@ -90,6 +90,6 @@ begin
GetKey; GetKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -130,7 +130,7 @@ begin
WAIT_BUTTON: WAIT_BUTTON:
SetCursor(hWaitCursor); SetCursor(hWaitCursor);
1: 1:
TerminateThread; Break;
end; end;
end; end;
end. end.

View File

@ -46,6 +46,6 @@ begin
GetKey; GetKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -79,6 +79,6 @@ begin
OnKey; OnKey;
BUTTON_EVENT: BUTTON_EVENT:
if GetButton.ID = 1 then if GetButton.ID = 1 then
TerminateThread; Break;
end; end;
end. end.

View File

@ -7,8 +7,6 @@ unit SysInit;
interface interface
procedure _InitExe; procedure _InitExe;
procedure _Halt0;
procedure _InitLib(Context: PInitContext);
var var
ModuleIsLib: Boolean; ModuleIsLib: Boolean;
@ -20,16 +18,8 @@ const
implementation implementation
procedure _InitLib(context: pinitcontext);
asm
end;
procedure _InitExe; procedure _InitExe;
asm asm
end; end;
procedure _Halt0; end.
asm
end;
end.

View File

@ -29,6 +29,7 @@ type
DLLInitState: byte; DLLInitState: byte;
end; end;
procedure _Halt0;
procedure _HandleFinally; procedure _HandleFinally;
implementation implementation
@ -36,6 +37,13 @@ implementation
uses uses
SysInit; SysInit;
procedure _Halt0;
asm
XOR EAX, EAX
DEC EAX
INT $40
end;
procedure _HandleFinally; procedure _HandleFinally;
asm asm
end; end;