Jump to content

DevHlp KillProc: Difference between revisions

From EDM2
Created page with "DevHlp_KillProc kills a process unconditionally. ==Syntax== ===C=== <PRE> </PRE> ===Assembler=== Calling Sequence in Assembler <PRE> MOV BX, pid MOV DL, DevHlp_KillProc CA..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:DevHlp_KillProc}}
DevHlp_KillProc kills a process unconditionally.
DevHlp_KillProc kills a process unconditionally.
This is a special entry into DosKillProcess, which is more rigid in killing processes: the killed process won’t be able to execute its kill signal handler, thus open files might not be closed properly. A process currently operating in ring 0 will terminate as soon as it returns to ring 3 (this means, a process blocked in the kernel, e.g. on a pending I/O, can still not be killed). This devhlp corresponds to the SESKillProcess API.


==Syntax==
==Syntax==
===C===
===C===
<PRE>
There is no direct C calling Sequence.
 
</PRE>


===Assembler===
===Assembler===
Line 17: Line 18:
==Parameters==
==Parameters==
===C===
===C===
<PRE>
N/A
 
</PRE>


===Assembler===
===Assembler===
<PRE>
* BX = Pid of process to kill, 0 = current process
 
* DL = 07dh
</PRE>


==Return Code==
==Return Code==
===C===
===C===
<PRE>
N/A
 
</PRE>


===Assembler===
===Assembler===
Line 40: Line 36:
; 217 ERROR_ZOMBIE_PROCESS Process is already dead pending collection of result codes by parent.
; 217 ERROR_ZOMBIE_PROCESS Process is already dead pending collection of result codes by parent.
; 303 ERROR_INVALID_PROCID PID is invalid.
; 303 ERROR_INVALID_PROCID PID is invalid.
or:
    CY=0, AX = 0, okay
    CY=1, AX = APIRET error code




==Remarks==
==Remarks==
The process is killed unconditionally. Signal and exception handlers are not run. This Device Help may be called at
Task Time only.


==Example Code==
==Example Code==
===C===
===C===
<PRE>
N/A
 
</PRE>


===Assembler===
===Assembler===
<PRE>
</PRE>


==Related Functions==
==Related Functions==


[[Category:DevHlps]]
[[Category:DevHlps]]

Latest revision as of 15:29, 18 May 2025

DevHlp_KillProc kills a process unconditionally.

This is a special entry into DosKillProcess, which is more rigid in killing processes: the killed process won’t be able to execute its kill signal handler, thus open files might not be closed properly. A process currently operating in ring 0 will terminate as soon as it returns to ring 3 (this means, a process blocked in the kernel, e.g. on a pending I/O, can still not be killed). This devhlp corresponds to the SESKillProcess API.

Syntax

C

There is no direct C calling Sequence.

Assembler

Calling Sequence in Assembler

MOV BX, pid
MOV DL, DevHlp_KillProc

CALL [Device_Help]

Parameters

C

N/A

Assembler

  • BX = Pid of process to kill, 0 = current process
  • DL = 07dh

Return Code

C

N/A

Assembler

Results in Assembler

  • C Clear if the process is killed. AX = zero.
  • C Set if error. AX = Error code.

Possible errors

217 ERROR_ZOMBIE_PROCESS Process is already dead pending collection of result codes by parent.
303 ERROR_INVALID_PROCID PID is invalid.

or:

   CY=0, AX = 0, okay
   CY=1, AX = APIRET error code 


Remarks

The process is killed unconditionally. Signal and exception handlers are not run. This Device Help may be called at Task Time only.

Example Code

C

N/A

Assembler

Related Functions