4 * Copyright 1995 Alexandre Julliard
17 extern BOOL
TASK_Init(void);
18 extern void TASK_KillCurrentTask( int exitCode
);
20 /* Process database (i.e. a normal DOS PSP) */
24 WORD int20
; /* 00 int 20h instruction */
25 WORD nextParagraph
; /* 02 Segment of next paragraph */
27 BYTE dispatcher
[5]; /* 05 Long call to DOS */
28 SEGPTR savedint22 WINE_PACKED
; /* 0a Saved int 22h handler */
29 SEGPTR savedint23 WINE_PACKED
; /* 0e Saved int 23h handler */
30 SEGPTR savedint24 WINE_PACKED
; /* 12 Saved int 24h handler */
31 WORD parentPSP
; /* 16 Selector of parent PSP */
32 BYTE fileHandles
[20]; /* 18 Open file handles */
33 HANDLE environment
; /* 2c Selector of environment */
35 WORD nbFiles
; /* 32 Number of file handles */
36 SEGPTR fileHandlesPtr
; /* 34 Pointer to file handle table */
38 BYTE fcb1
[16]; /* 5c First FCB */
39 BYTE fcb2
[20]; /* 6c Second FCB */
40 BYTE cmdLine
[128]; /* 80 Command-line (first byte is len) */
44 /* Segment containing MakeProcInstance() thunks */
47 WORD next
; /* Selector of next segment */
48 WORD magic
; /* Thunks signature */
50 WORD free
; /* Head of the free list */
51 WORD thunks
[4]; /* Each thunk is 4 words long */
54 #define THUNK_MAGIC ('P' | ('T' << 8))
57 /* Task database. See 'Windows Internals' p. 226 */
60 HTASK hNext
; /* Selector of next TDB */
61 WORD sp
; /* Stack pointer of task */
62 WORD ss
; /* Stack segment of task */
63 WORD nEvents
; /* Events for this task */
64 char priority
; /* Task priority, between -32 and 15 */
66 HGLOBAL hStack32
; /* Handle to 32-bit stack */
67 HTASK hSelf
; /* Selector of this TDB */
68 HANDLE hPrevInstance
; /* Previous instance of the module */
69 DWORD esp
; /* 32-bit stack pointer */
70 WORD ctrlword8087
; /* 80x87 control word */
71 WORD flags
; /* Task flags */
72 UINT error_mode
; /* Error mode (see SetErrorMode) */
73 WORD version
; /* Expected Windows version */
74 HANDLE hInstance
; /* Instance handle for this task */
75 HMODULE hModule
; /* Module handle */
76 HQUEUE hQueue
; /* Selector of task message queue */
77 HTASK hParent
; /* Selector of TDB of parent task */
78 WORD signal_flags
; /* Flags related to signal handler */
79 DWORD sighandler WINE_PACKED
; /* Signal handler */
80 DWORD userhandler WINE_PACKED
; /* USER signal handler */
81 DWORD discardhandler WINE_PACKED
; /* Handler for GlobalDiscard() */
82 DWORD int0 WINE_PACKED
; /* int 0 (divide by zero) handler */
83 DWORD int2 WINE_PACKED
; /* int 2 (NMI) handler */
84 DWORD int4 WINE_PACKED
; /* int 4 (INTO) handler */
85 DWORD int6 WINE_PACKED
; /* int 6 (invalid opcode) handler */
86 DWORD int7 WINE_PACKED
; /* int 7 (coprocessor) handler */
87 DWORD int3e WINE_PACKED
; /* int 3e (80x87 emulator) handler */
88 DWORD int75 WINE_PACKED
; /* int 75 (80x87 error) handler */
89 DWORD compat_flags WINE_PACKED
; /* Compatibility flags */
91 HANDLE hPDB
; /* Selector of PDB (i.e. PSP) */
92 SEGPTR dta WINE_PACKED
; /* Current DTA */
93 BYTE curdrive
; /* Current drive */
94 BYTE curdir
[65]; /* Current directory */
95 WORD nCmdShow
; /* cmdShow parameter to WinMain */
96 HTASK hYieldTo
; /* Next task to schedule */
97 DWORD dlls_to_init
; /* Ptr to list of DLL to initialize */
98 HANDLE hCSAlias
; /* Code segment alias for this TDB */
99 THUNKS thunks WINE_PACKED
; /* Make proc instance thunks */
100 WORD more_thunks
[6*4]; /* Space for 6 more thunks */
101 BYTE module_name
[8]; /* Module name for task */
102 WORD magic
; /* TDB signature */
104 PDB pdb
; /* PDB for this task */
107 #define TDB_MAGIC ('T' | ('D' << 8))
110 #define TDBF_WINOLDAP 0x0001
111 #define TDBF_OS2APP 0x0008
112 #define TDBF_WIN32S 0x0010
118 extern HTASK
TASK_CreateTask( HMODULE hModule
, HANDLE hInstance
,
119 HANDLE hPrevInstance
, HANDLE hEnvironment
,
120 char *cmdLine
, WORD cmdShow
);
122 /* TASK_Reschedule() 16-bit entry point */
123 extern FARPROC RELAY_RescheduleProcAddr
;
125 #endif /* _WINE_TASK_H */