source: trunk/include/wprocess.h@ 9909

Last change on this file since 9909 was 9909, checked in by sandervl, 22 years ago

header updates

File size: 2.2 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>
[9909]22#include <FastInfoBlocks.h>
[127]23
[8017]24#define MAKE_THREADID(processid, threadid) ((processid << 16) | threadid)
25#define ODIN_TO_OS2_THREADID(threadid) (threadid & 0xFFFF)
26
[9909]27#define ODIN_GetCurrentThreadId() MAKE_THREADID(fibGetPid(), fibGetTid())
28#define ODIN_GetCurrentProcessId() fibGetPid()
29
[8645]30TEB *WIN32API CreateTEB(HANDLE hThread, DWORD dwThreadId);
31TEB *WIN32API InitializeMainThread();
32
33//******************************************************************************
34// Set up the TEB structure of the CURRENT (!) thread
35//******************************************************************************
36BOOL WIN32API InitializeThread(TEB *teb, BOOL fMainThread = FALSE);
37
38void WIN32API DestroyTEB(TEB *teb);
[5335]39ULONG WIN32API GetProcessTIBSel();
[124]40
[7829]41#define TIB_SWITCH_DEFAULT 0 //executable type determines whether or not FS is changed
42#define TIB_SWITCH_FORCE_WIN32 1 //always switch to win32 TIB (FS is changed)
[7810]43//
44//Switch to WIN32 TIB (FS selector)
45//NOTE: This is not done for Odin32 applications (LX), unless
46// fForceSwitch is TRUE)
47USHORT WIN32API SetWin32TIB(BOOL fForceSwitch = TIB_SWITCH_DEFAULT);
[281]48void WIN32API RestoreOS2TIB();
[7810]49
[1891]50void SetPDBInstance(HINSTANCE hInstance);
[127]51
52extern BOOL fExeStarted;
[953]53extern BOOL fFreeLibrary;
[9798]54extern BOOL fIsOS2Image; //TRUE -> Odin32 OS/2 application (not converted!)
55 //FALSE -> otherwise
56extern BOOL fSwitchTIBSel; // TRUE -> switch TIB selectors
57 // FALSE -> don't
[4232]58extern BOOL fExitProcess;
[127]59
[281]60//Flat pointer to thread TIB structure
61extern DWORD *TIBFlatPtr;
62
[1885]63extern PDB ProcessPDB;
64
65#define NtCurrentTeb GetThreadTEB
[320]66TEB *WIN32API GetThreadTEB();
[4657]67TEB *WIN32API GetTEBFromThreadId(ULONG threadId);
68TEB *WIN32API GetTEBFromThreadHandle(HANDLE hThread);
[320]69
[1887]70#ifndef OS2_INCLUDED
71inline PDB * PROCESS_Current(void)
[1885]72{
73 return NtCurrentTeb()->process;
74}
[1887]75#endif
[1885]76
[4234]77ULONG InitCommandLine(const char *pszPeExe);
[9494]78BOOL InitLoaders();
[4234]79
80#endif
Note: See TracBrowser for help on using the repository browser.