Rev | Line | |
---|
[124] | 1 | /*
|
---|
| 2 | * Process help functions
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 1999 Sander van Leeuwen
|
---|
| 5 | *
|
---|
| 6 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 7 | *
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | #ifndef _WPROCESS_H__
|
---|
| 11 | #define _WPROCESS_H__
|
---|
| 12 |
|
---|
[130] | 13 | #define WIN32_TIBSEL
|
---|
[125] | 14 |
|
---|
[1067] | 15 | #ifndef OS2_INCLUDED
|
---|
[1887] | 16 | #include <winprocess.h>
|
---|
| 17 | #else
|
---|
[2086] | 18 | #include <winconst.h>
|
---|
[1887] | 19 | typedef ULONG PDB;
|
---|
[1067] | 20 | #endif
|
---|
[127] | 21 | #include <thread.h>
|
---|
| 22 |
|
---|
[5335] | 23 | TEB * WIN32API InitializeTIB(BOOL fMainThread = FALSE);
|
---|
| 24 | void WIN32API DestroyTIB();
|
---|
| 25 | ULONG WIN32API GetProcessTIBSel();
|
---|
[124] | 26 |
|
---|
[7810] | 27 | #define TIB_SWITCH_DEFAULT 0
|
---|
| 28 | #define TIB_SWITCH_FORCE_WIN32 1
|
---|
| 29 | //
|
---|
| 30 | //Switch to WIN32 TIB (FS selector)
|
---|
| 31 | //NOTE: This is not done for Odin32 applications (LX), unless
|
---|
| 32 | // fForceSwitch is TRUE)
|
---|
| 33 | USHORT WIN32API SetWin32TIB(BOOL fForceSwitch = TIB_SWITCH_DEFAULT);
|
---|
[281] | 34 | void WIN32API RestoreOS2TIB();
|
---|
[7810] | 35 |
|
---|
[1891] | 36 | void SetPDBInstance(HINSTANCE hInstance);
|
---|
[127] | 37 |
|
---|
| 38 | extern BOOL fExeStarted;
|
---|
[953] | 39 | extern BOOL fFreeLibrary;
|
---|
[1222] | 40 | extern BOOL fIsOS2Image; //TRUE -> Odin32 OS/2 application (not converted!)
|
---|
| 41 | //FALSE -> otherwise
|
---|
[4232] | 42 | extern BOOL fExitProcess;
|
---|
[127] | 43 |
|
---|
[281] | 44 | //Flat pointer to thread TIB structure
|
---|
| 45 | extern DWORD *TIBFlatPtr;
|
---|
| 46 |
|
---|
[1885] | 47 | extern PDB ProcessPDB;
|
---|
| 48 |
|
---|
| 49 | #define NtCurrentTeb GetThreadTEB
|
---|
[320] | 50 | TEB *WIN32API GetThreadTEB();
|
---|
[4657] | 51 | TEB *WIN32API GetTEBFromThreadId(ULONG threadId);
|
---|
| 52 | TEB *WIN32API GetTEBFromThreadHandle(HANDLE hThread);
|
---|
[320] | 53 |
|
---|
[1887] | 54 | #ifndef OS2_INCLUDED
|
---|
| 55 | inline PDB * PROCESS_Current(void)
|
---|
[1885] | 56 | {
|
---|
| 57 | return NtCurrentTeb()->process;
|
---|
| 58 | }
|
---|
[1887] | 59 | #endif
|
---|
[1885] | 60 |
|
---|
[4234] | 61 | ULONG InitCommandLine(const char *pszPeExe);
|
---|
| 62 |
|
---|
| 63 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.