6 * POSIX subsystem process environment data structure
8 * This file is part of the ReactOS Operating System.
11 * Created by KJK::Hyperion <noog@libero.it>
13 * THIS SOFTWARE IS NOT COPYRIGHTED
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
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.
24 #ifndef __PSX_PDATA_H_INCLUDED__
25 #define __PSX_PDATA_H_INCLUDED__
28 #include <ddk/ntddk.h>
29 #include <ntdll/rtl.h>
31 #include <psx/fdtable.h>
36 typedef struct __tagPDX_PDATA
38 UNICODE_STRING NativePathBuffer
;
39 UNICODE_STRING CurDir
;
40 UNICODE_STRING RootPath
;
43 } __PDX_PDATA
, * __PPDX_PDATA
;
50 #define __PdxAcquirePdataLock() (RtlAcquirePebLock())
51 #define __PdxReleasePdataLock() (RtlReleasePebLock())
53 #define __PdxSetProcessData()(PPDATA) ((void)((NtCurrentPeb()->SubSystemData) = (PPDATA)))
54 #define __PdxGetProcessData() ((__PPDX_PDATA)(&(NtCurrentPeb()->SubSystemData)))
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))
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)))
68 #endif /* __PSX_PDATA_H_INCLUDED__ */