source: trunk/include/wprocess.h@ 7810

Last change on this file since 7810 was 7810, checked in by sandervl, 24 years ago

header updates

File size: 1.4 KB
Line 
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
13#define WIN32_TIBSEL
14
15#ifndef OS2_INCLUDED
16#include <winprocess.h>
17#else
18#include <winconst.h>
19typedef ULONG PDB;
20#endif
21#include <thread.h>
22
23TEB * WIN32API InitializeTIB(BOOL fMainThread = FALSE);
24void WIN32API DestroyTIB();
25ULONG WIN32API GetProcessTIBSel();
26
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)
33USHORT WIN32API SetWin32TIB(BOOL fForceSwitch = TIB_SWITCH_DEFAULT);
34void WIN32API RestoreOS2TIB();
35
36void SetPDBInstance(HINSTANCE hInstance);
37
38extern BOOL fExeStarted;
39extern BOOL fFreeLibrary;
40extern BOOL fIsOS2Image; //TRUE -> Odin32 OS/2 application (not converted!)
41 //FALSE -> otherwise
42extern BOOL fExitProcess;
43
44//Flat pointer to thread TIB structure
45extern DWORD *TIBFlatPtr;
46
47extern PDB ProcessPDB;
48
49#define NtCurrentTeb GetThreadTEB
50TEB *WIN32API GetThreadTEB();
51TEB *WIN32API GetTEBFromThreadId(ULONG threadId);
52TEB *WIN32API GetTEBFromThreadHandle(HANDLE hThread);
53
54#ifndef OS2_INCLUDED
55inline PDB * PROCESS_Current(void)
56{
57 return NtCurrentTeb()->process;
58}
59#endif
60
61ULONG InitCommandLine(const char *pszPeExe);
62
63#endif
Note: See TracBrowser for help on using the repository browser.