ReactOS 0.4.16-dev-297-gc569aee
process.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPLv2 - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/dos/dos32krnl/process.h
5 * PURPOSE: DOS32 Processes
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9#pragma once
10
11/* DEFINITIONS ****************************************************************/
12
13#define DOS_CMDLINE_LENGTH 127
14#define DOS_PROGRAM_NAME_TAG 0x0001
15
16#define SEGMENT_TO_PSP(seg) ((PDOS_PSP)SEG_OFF_TO_PTR((seg), 0))
17
18typedef enum
19{
22 DOS_LOAD_OVERLAY = 0x03
24
25#pragma pack(push, 1)
26
27typedef struct _DOS_PSP
28{
51
53{
54 union
55 {
56 struct
57 {
58 /* Input variables */
63
64 /* Output variables */
67 };
68
69 struct
70 {
74 };
76
77typedef struct _DOS_REGISTER_STATE
78{
79 WORD AX, BX, CX, DX, SI, DI, BP, DS, ES;
80// WORD IP, CS, Flags; // They are supposed to be already
81 // pushed on stack by the DOS caller.
83
84#pragma pack(pop)
85
86/* FUNCTIONS ******************************************************************/
87
88VOID DosClonePsp(WORD DestSegment, WORD SourceSegment);
89VOID DosCreatePsp(WORD Segment, WORD ProgramSize);
91
93(
94 IN DOS_EXEC_TYPE LoadType,
95 IN LPBYTE ExeBuffer,
96 IN DWORD ExeBufferSize,
97 IN LPCSTR ExePath,
99 IN LPCSTR CommandLine OPTIONAL,
101 IN DWORD ReturnAddress OPTIONAL
102);
103
105(
106 IN DOS_EXEC_TYPE LoadType,
107 IN LPCSTR ExecutablePath,
109 IN LPCSTR CommandLine OPTIONAL,
111 IN DWORD ReturnAddress OPTIONAL
112);
113
115(
116 LPCSTR ProgramName,
118 IN DWORD ReturnAddress OPTIONAL
119);
120
121VOID DosTerminateProcess(WORD Psp, BYTE ReturnCode, WORD KeepResident);
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
PVOID PVOID PWCHAR PVOID Environment
Definition: env.c:47
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
struct _DOS_EXEC_PARAM_BLOCK::@5056::@5060 Overlay
Definition: dos.h:54
DWORD CriticalAddress
Definition: process.h:34
BYTE HandleTable[20]
Definition: process.h:36
BYTE Reserved2[14]
Definition: process.h:44
BYTE Reserved3[9]
Definition: process.h:46
BYTE FarCall[3]
Definition: process.h:45
DOS_FCB Fcb
Definition: process.h:47
CHAR CommandLine[DOS_CMDLINE_LENGTH]
Definition: process.h:49
DWORD TerminateAddress
Definition: process.h:32
WORD LastParagraph
Definition: process.h:30
DWORD PreviousPsp
Definition: process.h:41
WORD HandleTableSize
Definition: process.h:39
WORD DosVersion
Definition: process.h:43
WORD EnvBlock
Definition: process.h:37
WORD ParentPsp
Definition: process.h:35
DWORD BreakAddress
Definition: process.h:33
DWORD LastStack
Definition: process.h:38
BYTE Reserved0[6]
Definition: process.h:31
BYTE CommandLineSize
Definition: process.h:48
DWORD Reserved1
Definition: process.h:42
DWORD HandleTablePtr
Definition: process.h:40
BYTE Exit[2]
Definition: process.h:29
VOID DosClonePsp(WORD DestSegment, WORD SourceSegment)
Definition: process.c:251
struct _DOS_EXEC_PARAM_BLOCK DOS_EXEC_PARAM_BLOCK
struct _DOS_PSP * PDOS_PSP
VOID DosCreatePsp(WORD Segment, WORD ProgramSize)
Definition: process.c:278
DOS_EXEC_TYPE
Definition: process.h:19
@ DOS_LOAD_OVERLAY
Definition: process.h:22
@ DOS_LOAD_ONLY
Definition: process.h:21
@ DOS_LOAD_AND_EXECUTE
Definition: process.h:20
DWORD DosLoadExecutableInternal(IN DOS_EXEC_TYPE LoadType, IN LPBYTE ExeBuffer, IN DWORD ExeBufferSize, IN LPCSTR ExePath, IN PDOS_EXEC_PARAM_BLOCK Parameters, IN LPCSTR CommandLine OPTIONAL, IN LPCSTR Environment OPTIONAL, IN DWORD ReturnAddress OPTIONAL)
Definition: process.c:335
struct _DOS_EXEC_PARAM_BLOCK * PDOS_EXEC_PARAM_BLOCK
DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, IN LPCSTR ExecutablePath, IN PDOS_EXEC_PARAM_BLOCK Parameters, IN LPCSTR CommandLine OPTIONAL, IN LPCSTR Environment OPTIONAL, IN DWORD ReturnAddress OPTIONAL)
Definition: process.c:705
struct _DOS_PSP DOS_PSP
WORD DosCreateProcess(LPCSTR ProgramName, PDOS_EXEC_PARAM_BLOCK Parameters, IN DWORD ReturnAddress OPTIONAL)
VOID DosSetProcessContext(WORD Segment)
Definition: process.c:329
struct _DOS_REGISTER_STATE * PDOS_REGISTER_STATE
VOID DosTerminateProcess(WORD Psp, BYTE ReturnCode, WORD KeepResident)
Definition: process.c:936
#define DOS_CMDLINE_LENGTH
Definition: process.h:13
struct _DOS_REGISTER_STATE DOS_REGISTER_STATE
unsigned char * LPBYTE
Definition: typedefs.h:53
#define IN
Definition: typedefs.h:39
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
const char * LPCSTR
Definition: xmlstorage.h:183
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193