source: trunk/include/wprocess.h@ 21352

Last change on this file since 21352 was 21352, checked in by rlwalsh, 16 years ago

eliminate VACPP warning & info msgs - see Ticket #1

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