source: trunk/include/wprocess.h@ 8017

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

* empty log message *

File size: 1.6 KB
RevLine 
[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]19typedef ULONG PDB;
[1067]20#endif
[127]21#include <thread.h>
22
[8017]23#define MAKE_THREADID(processid, threadid) ((processid << 16) | threadid)
24#define ODIN_TO_OS2_THREADID(threadid) (threadid & 0xFFFF)
25
[5335]26TEB * WIN32API InitializeTIB(BOOL fMainThread = FALSE);
27void WIN32API DestroyTIB();
28ULONG WIN32API GetProcessTIBSel();
[124]29
[7829]30#define TIB_SWITCH_DEFAULT 0 //executable type determines whether or not FS is changed
31#define TIB_SWITCH_FORCE_WIN32 1 //always switch to win32 TIB (FS is changed)
[7810]32//
33//Switch to WIN32 TIB (FS selector)
34//NOTE: This is not done for Odin32 applications (LX), unless
35// fForceSwitch is TRUE)
36USHORT WIN32API SetWin32TIB(BOOL fForceSwitch = TIB_SWITCH_DEFAULT);
[281]37void WIN32API RestoreOS2TIB();
[7810]38
[1891]39void SetPDBInstance(HINSTANCE hInstance);
[127]40
41extern BOOL fExeStarted;
[953]42extern BOOL fFreeLibrary;
[1222]43extern BOOL fIsOS2Image; //TRUE -> Odin32 OS/2 application (not converted!)
44 //FALSE -> otherwise
[4232]45extern BOOL fExitProcess;
[127]46
[281]47//Flat pointer to thread TIB structure
48extern DWORD *TIBFlatPtr;
49
[1885]50extern PDB ProcessPDB;
51
52#define NtCurrentTeb GetThreadTEB
[320]53TEB *WIN32API GetThreadTEB();
[4657]54TEB *WIN32API GetTEBFromThreadId(ULONG threadId);
55TEB *WIN32API GetTEBFromThreadHandle(HANDLE hThread);
[320]56
[1887]57#ifndef OS2_INCLUDED
58inline PDB * PROCESS_Current(void)
[1885]59{
60 return NtCurrentTeb()->process;
61}
[1887]62#endif
[1885]63
[4234]64ULONG InitCommandLine(const char *pszPeExe);
65
66#endif
Note: See TracBrowser for help on using the repository browser.