56d730802b760eba6e15e7c76503a2fd059dc7c6
[reactos.git] / posix / include / psx / pdata.h
1 /* $Id: pdata.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
2 */
3 /*
4 * psx/pdata.h
5 *
6 * POSIX+ subsystem process environment data structure
7 *
8 * This file is part of the ReactOS Operating System.
9 *
10 * Contributors:
11 * Created by KJK::Hyperion <noog@libero.it>
12 *
13 * THIS SOFTWARE IS NOT COPYRIGHTED
14 *
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
17 *
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 */
24 #ifndef __PSX_PDATA_H_INCLUDED__
25 #define __PSX_PDATA_H_INCLUDED__
26
27 /* INCLUDES */
28 #include <ddk/ntddk.h>
29 #include <ntdll/rtl.h>
30 #include <limits.h>
31 #include <psx/fdtable.h>
32
33 /* OBJECTS */
34
35 /* TYPES */
36 typedef struct __tagPDX_PDATA
37 {
38 UNICODE_STRING NativePathBuffer;
39 UNICODE_STRING CurDir;
40 UNICODE_STRING RootPath;
41 HANDLE RootHandle;
42 __fdtable_t *FdTable;
43 } __PDX_PDATA, * __PPDX_PDATA;
44
45 /* CONSTANTS */
46
47 /* PROTOTYPES */
48
49 /* MACROS */
50 #define __PdxAcquirePdataLock() (RtlAcquirePebLock())
51 #define __PdxReleasePdataLock() (RtlReleasePebLock())
52
53 #define __PdxSetProcessData()(PPDATA) ((void)((NtCurrentPeb()->SubSystemData) = (PPDATA)))
54 #define __PdxGetProcessData() ((__PPDX_PDATA)(&(NtCurrentPeb()->SubSystemData)))
55
56 #define __PdxGetNativePathBuffer() ((PUNICODE_STRING)(&(__PdxGetProcessData()->NativePathBuffer)))
57 #define __PdxGetCurDir() ((PUNICODE_STRING)(&(__PdxGetProcessData()->CurDir)))
58 #define __PdxGetRootPath() ((PUNICODE_STRING)(&(__PdxGetProcessData()->RootPath)))
59 #define __PdxGetRootHandle() ((HANDLE)(__PdxGetProcessData()->RootHandle))
60 #define __PdxGetFdTable() ((__fdtable_t *)(__PdxGetProcessData()->FdTable))
61
62 #define __PdxSetNativePathBuffer(BUF) ((void)((__PdxGetProcessData()->NativePathBuffer) = (BUF)))
63 #define __PdxSetCurDir(CURDIR) ((void)((__PdxGetProcessData()->CurDir) = (CURDIR)))
64 #define __PdxSetRootPath(ROOTPATH) ((void)((__PdxGetProcessData()->RootPath) = (ROOTPATH)))
65 #define __PdxSetRootHandle(ROOTHANDLE) ((void)((__PdxGetProcessData()->RootHandle) = (ROOTHANDLE)))
66 #define __PdxSetFdTable(FDTABLE) ((void)((__PdxGetProcessData()->FdTable) = (FDTABLE)))
67
68 #endif /* __PSX_PDATA_H_INCLUDED__ */
69
70 /* EOF */
71