mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +00:00
Major cleanup of NDK. I've decided that it would be much cleaner to accumulate all types, regardless of their um/km availabilty, into each header. Thus, umtypes.h now only contains the equivalent of ntdef.h and is automatically not-included if the DDK is. Similary, I've removed all the NTIFS hacks and added a single ifssupp.h file, which is automatically removed if the IFS is added. That file will be deleted then the Longhorn WDK is made public (it contains the IFS/DDK). Nothing has changed on the includer-side, the same rules still apply
svn path=/trunk/; revision=17420
This commit is contained in:
parent
eacc9d1b3a
commit
e7d010c5de
25 changed files with 1616 additions and 1602 deletions
|
@ -7,8 +7,12 @@
|
||||||
|
|
||||||
#define VERSION "0.0.3"
|
#define VERSION "0.0.3"
|
||||||
|
|
||||||
|
#ifndef PAGE_ROUND_UP
|
||||||
#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
||||||
|
#endif
|
||||||
|
#ifndef ROUND_UP
|
||||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define __DISKDUMP_H
|
#define __DISKDUMP_H
|
||||||
|
|
||||||
#include <ddk/ntddscsi.h>
|
#include <ddk/ntddscsi.h>
|
||||||
#include <ndk/ketypes.h>
|
#include <ndk/ntndk.h>
|
||||||
|
|
||||||
#define MM_CORE_DUMP_HEADER_MAGIC (0xdeafbead)
|
#define MM_CORE_DUMP_HEADER_MAGIC (0xdeafbead)
|
||||||
#define MM_CORE_DUMP_HEADER_VERSION (0x1)
|
#define MM_CORE_DUMP_HEADER_VERSION (0x1)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#ifndef _ARCH_KETYPES_H
|
#ifndef _ARCH_KETYPES_H
|
||||||
#define _ARCH_KETYPES_H
|
#define _ARCH_KETYPES_H
|
||||||
|
|
||||||
/* Shared structure needed by Arch-specific headers */
|
/* Shared structures needed by Arch-specific headers */
|
||||||
typedef struct _KDPC_DATA
|
typedef struct _KDPC_DATA
|
||||||
{
|
{
|
||||||
LIST_ENTRY DpcListHead;
|
LIST_ENTRY DpcListHead;
|
||||||
|
@ -18,6 +18,12 @@ typedef struct _KDPC_DATA
|
||||||
ULONG DpcCount;
|
ULONG DpcCount;
|
||||||
} KDPC_DATA, *PKDPC_DATA;
|
} KDPC_DATA, *PKDPC_DATA;
|
||||||
|
|
||||||
|
typedef struct _PP_LOOKASIDE_LIST
|
||||||
|
{
|
||||||
|
struct _GENERAL_LOOKASIDE *P;
|
||||||
|
struct _GENERAL_LOOKASIDE *L;
|
||||||
|
} PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST;
|
||||||
|
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
#include <ndk/i386/ketypes.h>
|
#include <ndk/i386/ketypes.h>
|
||||||
#else
|
#else
|
||||||
|
|
129
reactos/include/ndk/cmtypes.h
Normal file
129
reactos/include/ndk/cmtypes.h
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Native Headers
|
||||||
|
* FILE: include/ndk/cmtypes.h
|
||||||
|
* PURPOSE: Definitions for Config Manager Types not defined in DDK/IFS
|
||||||
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
* Created 06/10/04
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _CMTYPES_H
|
||||||
|
#define _CMTYPES_H
|
||||||
|
|
||||||
|
/* DEPENDENCIES **************************************************************/
|
||||||
|
|
||||||
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
|
||||||
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef enum _KEY_INFORMATION_CLASS
|
||||||
|
{
|
||||||
|
KeyBasicInformation,
|
||||||
|
KeyNodeInformation,
|
||||||
|
KeyFullInformation,
|
||||||
|
KeyNameInformation,
|
||||||
|
KeyCachedInformation,
|
||||||
|
KeyFlagsInformation
|
||||||
|
} KEY_INFORMATION_CLASS;
|
||||||
|
|
||||||
|
typedef enum _KEY_VALUE_INFORMATION_CLASS
|
||||||
|
{
|
||||||
|
KeyValueBasicInformation,
|
||||||
|
KeyValueFullInformation,
|
||||||
|
KeyValuePartialInformation,
|
||||||
|
KeyValueFullInformationAlign64,
|
||||||
|
KeyValuePartialInformationAlign64
|
||||||
|
} KEY_VALUE_INFORMATION_CLASS;
|
||||||
|
|
||||||
|
typedef enum _KEY_SET_INFORMATION_CLASS
|
||||||
|
{
|
||||||
|
KeyWriteTimeInformation,
|
||||||
|
KeyUserFlagsInformation,
|
||||||
|
MaxKeySetInfoClass
|
||||||
|
} KEY_SET_INFORMATION_CLASS;
|
||||||
|
|
||||||
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
typedef struct _KEY_WRITE_TIME_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_USER_FLAGS_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG UserFlags;
|
||||||
|
} KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_FULL_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG ClassOffset;
|
||||||
|
ULONG ClassLength;
|
||||||
|
ULONG SubKeys;
|
||||||
|
ULONG MaxNameLen;
|
||||||
|
ULONG MaxClassLen;
|
||||||
|
ULONG Values;
|
||||||
|
ULONG MaxValueNameLen;
|
||||||
|
ULONG MaxValueDataLen;
|
||||||
|
WCHAR Class[1];
|
||||||
|
} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_NODE_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG ClassOffset;
|
||||||
|
ULONG ClassLength;
|
||||||
|
ULONG NameLength;
|
||||||
|
WCHAR Name[1];
|
||||||
|
} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_VALUE_ENTRY
|
||||||
|
{
|
||||||
|
PUNICODE_STRING ValueName;
|
||||||
|
ULONG DataLength;
|
||||||
|
ULONG DataOffset;
|
||||||
|
ULONG Type;
|
||||||
|
} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
|
||||||
|
|
||||||
|
typedef struct _KEY_VALUE_PARTIAL_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG Type;
|
||||||
|
ULONG DataLength;
|
||||||
|
UCHAR Data[1];
|
||||||
|
} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_VALUE_BASIC_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG Type;
|
||||||
|
ULONG NameLength;
|
||||||
|
WCHAR Name[1];
|
||||||
|
} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_VALUE_FULL_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG Type;
|
||||||
|
ULONG DataOffset;
|
||||||
|
ULONG DataLength;
|
||||||
|
ULONG NameLength;
|
||||||
|
WCHAR Name[1];
|
||||||
|
} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _KEY_BASIC_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
ULONG TitleIndex;
|
||||||
|
ULONG NameLength;
|
||||||
|
WCHAR Name[1];
|
||||||
|
} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,36 +11,37 @@
|
||||||
#define _EXTYPES_H
|
#define _EXTYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "ketypes.h"
|
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
extern POBJECT_TYPE NTOSAPI ExIoCompletionType;
|
extern POBJECT_TYPE NTOSAPI ExIoCompletionType;
|
||||||
extern NTOSAPI POBJECT_TYPE ExMutantObjectType;
|
extern NTOSAPI POBJECT_TYPE ExMutantObjectType;
|
||||||
extern NTOSAPI POBJECT_TYPE ExTimerType;
|
extern NTOSAPI POBJECT_TYPE ExTimerType;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
#define INVALID_HANDLE_VALUE (HANDLE)-1
|
#define INVALID_HANDLE_VALUE (HANDLE)-1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Increments */
|
/* Increments */
|
||||||
#define MUTANT_INCREMENT 1
|
#define MUTANT_INCREMENT 1
|
||||||
|
|
||||||
/* Callback Object Access Rights */
|
/* Executive Object Access Rights */
|
||||||
#define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
|
#define CALLBACK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x0001)
|
||||||
#define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
|
#define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001)
|
||||||
#define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
|
#define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001)
|
||||||
#define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
|
#define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001)
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
#define EVENT_QUERY_STATE 0x0001
|
||||||
|
#define SEMAPHORE_QUERY_STATE 0x0001
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
/* You'll need the IFS for this, so use an equivalent version */
|
#ifndef NTOS_MODE_USER
|
||||||
#ifndef _NTIFS_
|
|
||||||
typedef PVOID EX_RUNDOWN_REF;
|
|
||||||
typedef PVOID EX_PUSH_LOCK;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _EX_QUEUE_WORKER_INFO
|
typedef struct _EX_QUEUE_WORKER_INFO
|
||||||
{
|
{
|
||||||
UCHAR QueueDisabled:1;
|
UCHAR QueueDisabled:1;
|
||||||
|
@ -120,4 +121,5 @@ typedef struct _HANDLE_TABLE
|
||||||
} HANDLE_TABLE, *PHANDLE_TABLE;
|
} HANDLE_TABLE, *PHANDLE_TABLE;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -33,45 +33,10 @@ List:
|
||||||
Priority 4:
|
Priority 4:
|
||||||
- FIXED: Kernel and Memory Types are not architecture-specific (Eric) [ketypes.h, mmtypes.h]
|
- FIXED: Kernel and Memory Types are not architecture-specific (Eric) [ketypes.h, mmtypes.h]
|
||||||
- FIXED: Win32K Builds with windows.h (Filip) [extypes.h, ketypes.h]
|
- FIXED: Win32K Builds with windows.h (Filip) [extypes.h, ketypes.h]
|
||||||
- Move out stuff from umtypes.h into the actual header where they should go. Use ifdeffing
|
- FIXED: Modify design of NDK so that all the types are in their respective files (Alex) [*.h]
|
||||||
directly in that file to protect user-mode versus kernel-mode types. umtypes.h will only
|
|
||||||
end up containing the misc types that are needed for compatibility. This would create a
|
|
||||||
significant cleanup.
|
|
||||||
|
|
||||||
Priority 5:
|
Priority 5:
|
||||||
- FIXED: LPC Types are totally wrong. (Alex) [lpctypes.h]
|
- FIXED: LPC Types are totally wrong. (Alex) [lpctypes.h]
|
||||||
- Missing System Info Classes [zwtypes.h]
|
- Missing System Info Classes [zwtypes.h]
|
||||||
- FIXED: Process Priority Classes are messed up (Alex) [pstypes.h]
|
- FIXED: Process Priority Classes are messed up (Alex) [pstypes.h]
|
||||||
|
|
||||||
Generic Note:
|
|
||||||
One of the most difficult things is when certain structures require the IFS for some of their
|
|
||||||
members. Up until some time ago, the IFS was 1000$, so it was senseless to require it in order
|
|
||||||
to allow people to use the NDK. Recently, however, the IFS price went down to 100$. This is
|
|
||||||
still way too much. Even though the GNU NTIFS.H exists, I don't want to fallback on it. The
|
|
||||||
good news is that the WDK (Windows Driver Kit), which will supplant the DDK in about a year,
|
|
||||||
includes the IFS. At that point we can remove all the #ifndef/ifdef NTIFS hacks, since it'll
|
|
||||||
be OK to "force" IFS usage.
|
|
||||||
|
|
||||||
UPDATE:
|
|
||||||
However, I'm giving serious consideration of making the IFS a requirement, and suggesting
|
|
||||||
usage of the GNU IFS for anyone that needs it. The problem, however, is that the official
|
|
||||||
GNU IFS is outdated and quite invalid in many ways, compared to the ReactOS IFS (which still
|
|
||||||
isn't perfect yet). Also, this would include many more definitions then needed. A third
|
|
||||||
option that I'm considering is creating a new header, until the WDK is out, which will be
|
|
||||||
called ifstypes. It would be the brother of umtypes, but for kernel mode. Only a small
|
|
||||||
number of types will need to be included, and hence they will be easy to locate in case
|
|
||||||
the official ones change (by the time they do, the WDK will be out however, so no worries).
|
|
||||||
It would reduce all the ifdeffing to a single file.
|
|
||||||
|
|
||||||
UPDATE2:
|
|
||||||
No. This is a bad idea. I've just added a note to purge out large parts of umtypes.h into the
|
|
||||||
actual xxtypes.h files, and then use iffdefing. This is a direct contradiction to my idea of
|
|
||||||
generalizing all the IFS stuff together.
|
|
||||||
|
|
||||||
UPDATE3:
|
|
||||||
No. This is different...the user-mode types will always be unavailable in kernel-mode, and
|
|
||||||
dissipating them into the real files is a good thing, because they will never move out and
|
|
||||||
they are much easier to maintain. However, once the WDK comes out, all #ifdef ntifs will
|
|
||||||
become obsolete, and they will have to be hunted down and removed. Having a single file that
|
|
||||||
is automatically added if the IFS is not detected is much easier to remove once the time
|
|
||||||
comes.
|
|
||||||
|
|
|
@ -9,4 +9,17 @@
|
||||||
#ifndef _I386_MMTYPES_H
|
#ifndef _I386_MMTYPES_H
|
||||||
#define _I386_MMTYPES_H
|
#define _I386_MMTYPES_H
|
||||||
|
|
||||||
|
/* DEPENDENCIES **************************************************************/
|
||||||
|
|
||||||
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
|
||||||
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
#define PAGE_SIZE 0x1000
|
||||||
|
#define PAGE_SHIFT 12L
|
||||||
|
|
||||||
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
116
reactos/include/ndk/ifssupp.h
Normal file
116
reactos/include/ndk/ifssupp.h
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Native Headers
|
||||||
|
* FILE: include/ndk/ifssupp.h
|
||||||
|
* PURPOSE: Defintions present in IFS, required for NDK usage.
|
||||||
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
||||||
|
* UPDATE HISTORY:
|
||||||
|
* Created 08/16/05
|
||||||
|
*/
|
||||||
|
#ifndef _NTIFS_
|
||||||
|
#define _NTIFS_
|
||||||
|
|
||||||
|
/* DEPENDENCIES **************************************************************/
|
||||||
|
|
||||||
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
|
||||||
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
typedef PVOID PRTL_HEAP_PARAMETERS;
|
||||||
|
|
||||||
|
#if defined(USE_LPC6432)
|
||||||
|
#define LPC_CLIENT_ID CLIENT_ID64
|
||||||
|
#define LPC_SIZE_T ULONGLONG
|
||||||
|
#define LPC_PVOID ULONGLONG
|
||||||
|
#define LPC_HANDLE ULONGLONG
|
||||||
|
#else
|
||||||
|
#define LPC_CLIENT_ID CLIENT_ID
|
||||||
|
#define LPC_SIZE_T SIZE_T
|
||||||
|
#define LPC_PVOID PVOID
|
||||||
|
#define LPC_HANDLE HANDLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct _PORT_MESSAGE
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
CSHORT DataLength;
|
||||||
|
CSHORT TotalLength;
|
||||||
|
} s1;
|
||||||
|
ULONG Length;
|
||||||
|
} u1;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
CSHORT Type;
|
||||||
|
CSHORT DataInfoOffset;
|
||||||
|
} s2;
|
||||||
|
ULONG ZeroInit;
|
||||||
|
} u2;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
LPC_CLIENT_ID ClientId;
|
||||||
|
double DoNotUseThisField;
|
||||||
|
};
|
||||||
|
ULONG MessageId;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
LPC_SIZE_T ClientViewSize;
|
||||||
|
ULONG CallbackId;
|
||||||
|
};
|
||||||
|
} PORT_MESSAGE, *PPORT_MESSAGE;
|
||||||
|
|
||||||
|
typedef struct _PORT_VIEW
|
||||||
|
{
|
||||||
|
ULONG Length;
|
||||||
|
LPC_HANDLE SectionHandle;
|
||||||
|
ULONG SectionOffset;
|
||||||
|
LPC_SIZE_T ViewSize;
|
||||||
|
LPC_PVOID ViewBase;
|
||||||
|
LPC_PVOID ViewRemoteBase;
|
||||||
|
} PORT_VIEW, *PPORT_VIEW;
|
||||||
|
|
||||||
|
typedef struct _REMOTE_PORT_VIEW
|
||||||
|
{
|
||||||
|
ULONG Length;
|
||||||
|
LPC_SIZE_T ViewSize;
|
||||||
|
LPC_PVOID ViewBase;
|
||||||
|
} REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
|
||||||
|
|
||||||
|
typedef struct _KAPC_STATE
|
||||||
|
{
|
||||||
|
LIST_ENTRY ApcListHead[2];
|
||||||
|
PKPROCESS Process;
|
||||||
|
BOOLEAN KernelApcInProgress;
|
||||||
|
BOOLEAN KernelApcPending;
|
||||||
|
BOOLEAN UserApcPending;
|
||||||
|
} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
|
||||||
|
|
||||||
|
typedef struct _KQUEUE
|
||||||
|
{
|
||||||
|
DISPATCHER_HEADER Header;
|
||||||
|
LIST_ENTRY EntryListHead;
|
||||||
|
ULONG CurrentCount;
|
||||||
|
ULONG MaximumCount;
|
||||||
|
LIST_ENTRY ThreadListHead;
|
||||||
|
} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
|
||||||
|
|
||||||
|
typedef PVOID EX_RUNDOWN_REF;
|
||||||
|
typedef PVOID EX_PUSH_LOCK;
|
||||||
|
|
||||||
|
typedef struct _SECURITY_CLIENT_CONTEXT
|
||||||
|
{
|
||||||
|
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||||
|
PACCESS_TOKEN ClientToken;
|
||||||
|
BOOLEAN DirectlyAccessClientToken;
|
||||||
|
BOOLEAN DirectAccessEffectiveOnly;
|
||||||
|
BOOLEAN ServerIsRemote;
|
||||||
|
TOKEN_CONTROL ClientTokenControl;
|
||||||
|
} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,17 +11,82 @@
|
||||||
#define _IOTYPES_H
|
#define _IOTYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "potypes.h"
|
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
extern POBJECT_TYPE NTOSAPI IoAdapterObjectType;
|
extern POBJECT_TYPE NTOSAPI IoAdapterObjectType;
|
||||||
extern POBJECT_TYPE NTOSAPI IoDeviceHandlerObjectType;
|
extern POBJECT_TYPE NTOSAPI IoDeviceHandlerObjectType;
|
||||||
extern POBJECT_TYPE NTOSAPI IoDeviceObjectType;
|
extern POBJECT_TYPE NTOSAPI IoDeviceObjectType;
|
||||||
extern POBJECT_TYPE NTOSAPI IoDriverObjectType;
|
extern POBJECT_TYPE NTOSAPI IoDriverObjectType;
|
||||||
extern POBJECT_TYPE NTOSAPI IoFileObjectType;
|
extern POBJECT_TYPE NTOSAPI IoFileObjectType;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
/* Object Access Rights */
|
||||||
|
#define SYMBOLIC_LINK_QUERY 0x0001
|
||||||
|
#define SYMBOLIC_LINK_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | 0x0001
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* File Result Flags */
|
||||||
|
#define FILE_SUPERSEDED 0x00000000
|
||||||
|
#define FILE_OPENED 0x00000001
|
||||||
|
#define FILE_CREATED 0x00000002
|
||||||
|
#define FILE_OVERWRITTEN 0x00000003
|
||||||
|
#define FILE_EXISTS 0x00000004
|
||||||
|
#define FILE_DOES_NOT_EXIST 0x00000005
|
||||||
|
|
||||||
|
/* Pipe Flags */
|
||||||
|
#define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
|
||||||
|
#define FILE_PIPE_MESSAGE_MODE 0x00000001
|
||||||
|
#define FILE_PIPE_QUEUE_OPERATION 0x00000000
|
||||||
|
#define FILE_PIPE_COMPLETE_OPERATION 0x00000001
|
||||||
|
#define FILE_PIPE_INBOUND 0x00000000
|
||||||
|
#define FILE_PIPE_OUTBOUND 0x00000001
|
||||||
|
#define FILE_PIPE_FULL_DUPLEX 0x00000002
|
||||||
|
#define FILE_PIPE_CLIENT_END 0x00000000
|
||||||
|
#define FILE_PIPE_SERVER_END 0x00000001
|
||||||
|
|
||||||
|
/* File Attributes */
|
||||||
|
#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
|
||||||
|
#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
|
||||||
|
|
||||||
|
/* File Flags */
|
||||||
|
#define FILE_SUPERSEDE 0x00000000
|
||||||
|
#define FILE_OPEN 0x00000001
|
||||||
|
#define FILE_CREATE 0x00000002
|
||||||
|
#define FILE_OPEN_IF 0x00000003
|
||||||
|
#define FILE_OVERWRITE 0x00000004
|
||||||
|
#define FILE_OVERWRITE_IF 0x00000005
|
||||||
|
#define FILE_MAXIMUM_DISPOSITION 0x00000005
|
||||||
|
|
||||||
|
/* File Types */
|
||||||
|
#define FILE_DIRECTORY_FILE 0x00000001
|
||||||
|
#define FILE_WRITE_THROUGH 0x00000002
|
||||||
|
#define FILE_SEQUENTIAL_ONLY 0x00000004
|
||||||
|
#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
|
||||||
|
#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
|
||||||
|
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
|
||||||
|
#define FILE_NON_DIRECTORY_FILE 0x00000040
|
||||||
|
#define FILE_CREATE_TREE_CONNECTION 0x00000080
|
||||||
|
#define FILE_COMPLETE_IF_OPLOCKED 0x00000100
|
||||||
|
#define FILE_NO_EA_KNOWLEDGE 0x00000200
|
||||||
|
#define FILE_OPEN_FOR_RECOVERY 0x00000400
|
||||||
|
#define FILE_RANDOM_ACCESS 0x00000800
|
||||||
|
#define FILE_DELETE_ON_CLOSE 0x00001000
|
||||||
|
#define FILE_OPEN_BY_FILE_ID 0x00002000
|
||||||
|
#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
|
||||||
|
#define FILE_NO_COMPRESSION 0x00008000
|
||||||
|
#define FILE_RESERVE_OPFILTER 0x00100000
|
||||||
|
#define FILE_OPEN_REPARSE_POINT 0x00200000
|
||||||
|
#define FILE_OPEN_NO_RECALL 0x00400000
|
||||||
|
#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
|
||||||
|
|
||||||
|
/* Device Charactertics */
|
||||||
|
#define FILE_REMOVABLE_MEDIA 0x00000001
|
||||||
|
#define FILE_REMOTE_DEVICE 0x00000010
|
||||||
|
|
||||||
/* Device Object Extension Flags */
|
/* Device Object Extension Flags */
|
||||||
#define DOE_UNLOAD_PENDING 0x1
|
#define DOE_UNLOAD_PENDING 0x1
|
||||||
#define DOE_DELETE_PENDING 0x2
|
#define DOE_DELETE_PENDING 0x2
|
||||||
|
@ -67,6 +132,90 @@ extern POBJECT_TYPE NTOSAPI IoFileObjectType;
|
||||||
#define DNUF_NOT_DISABLEABLE 0x0008
|
#define DNUF_NOT_DISABLEABLE 0x0008
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef enum _INTERFACE_TYPE
|
||||||
|
{
|
||||||
|
InterfaceTypeUndefined = -1,
|
||||||
|
Internal,
|
||||||
|
Isa,
|
||||||
|
Eisa,
|
||||||
|
MicroChannel,
|
||||||
|
TurboChannel,
|
||||||
|
PCIBus,
|
||||||
|
VMEBus,
|
||||||
|
NuBus,
|
||||||
|
PCMCIABus,
|
||||||
|
CBus,
|
||||||
|
MPIBus,
|
||||||
|
MPSABus,
|
||||||
|
ProcessorInternal,
|
||||||
|
InternalPowerBus,
|
||||||
|
PNPISABus,
|
||||||
|
PNPBus,
|
||||||
|
MaximumInterfaceType
|
||||||
|
}INTERFACE_TYPE, *PINTERFACE_TYPE;
|
||||||
|
|
||||||
|
typedef enum _FILE_INFORMATION_CLASS
|
||||||
|
{
|
||||||
|
FileDirectoryInformation = 1,
|
||||||
|
FileFullDirectoryInformation,
|
||||||
|
FileBothDirectoryInformation,
|
||||||
|
FileBasicInformation,
|
||||||
|
FileStandardInformation,
|
||||||
|
FileInternalInformation,
|
||||||
|
FileEaInformation,
|
||||||
|
FileAccessInformation,
|
||||||
|
FileNameInformation,
|
||||||
|
FileRenameInformation,
|
||||||
|
FileLinkInformation,
|
||||||
|
FileNamesInformation,
|
||||||
|
FileDispositionInformation,
|
||||||
|
FilePositionInformation,
|
||||||
|
FileFullEaInformation,
|
||||||
|
FileModeInformation,
|
||||||
|
FileAlignmentInformation,
|
||||||
|
FileAllInformation,
|
||||||
|
FileAllocationInformation,
|
||||||
|
FileEndOfFileInformation,
|
||||||
|
FileAlternateNameInformation,
|
||||||
|
FileStreamInformation,
|
||||||
|
FilePipeInformation,
|
||||||
|
FilePipeLocalInformation,
|
||||||
|
FilePipeRemoteInformation,
|
||||||
|
FileMailslotQueryInformation,
|
||||||
|
FileMailslotSetInformation,
|
||||||
|
FileCompressionInformation,
|
||||||
|
FileObjectIdInformation,
|
||||||
|
FileCompletionInformation,
|
||||||
|
FileMoveClusterInformation,
|
||||||
|
FileQuotaInformation,
|
||||||
|
FileReparsePointInformation,
|
||||||
|
FileNetworkOpenInformation,
|
||||||
|
FileAttributeTagInformation,
|
||||||
|
FileTrackingInformation,
|
||||||
|
FileIdBothDirectoryInformation,
|
||||||
|
FileIdFullDirectoryInformation,
|
||||||
|
FileValidDataLengthInformation,
|
||||||
|
FileShortNameInformation,
|
||||||
|
FileMaximumInformation
|
||||||
|
} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
|
||||||
|
|
||||||
|
typedef enum _FSINFOCLASS
|
||||||
|
{
|
||||||
|
FileFsVolumeInformation = 1,
|
||||||
|
FileFsLabelInformation,
|
||||||
|
FileFsSizeInformation,
|
||||||
|
FileFsDeviceInformation,
|
||||||
|
FileFsAttributeInformation,
|
||||||
|
FileFsControlInformation,
|
||||||
|
FileFsFullSizeInformation,
|
||||||
|
FileFsObjectIdInformation,
|
||||||
|
FileFsDriverPathInformation,
|
||||||
|
FileFsMaximumInformation
|
||||||
|
} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum _PNP_DEVNODE_STATE
|
typedef enum _PNP_DEVNODE_STATE
|
||||||
{
|
{
|
||||||
DeviceNodeUnspecified = 0x300,
|
DeviceNodeUnspecified = 0x300,
|
||||||
|
@ -95,6 +244,279 @@ typedef enum _PNP_DEVNODE_STATE
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef struct _FILE_BASIC_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER CreationTime;
|
||||||
|
LARGE_INTEGER LastAccessTime;
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
LARGE_INTEGER ChangeTime;
|
||||||
|
ULONG FileAttributes;
|
||||||
|
} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_STANDARD_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER AllocationSize;
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
ULONG NumberOfLinks;
|
||||||
|
BOOLEAN DeletePending;
|
||||||
|
BOOLEAN Directory;
|
||||||
|
} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_NETWORK_OPEN_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER CreationTime;
|
||||||
|
LARGE_INTEGER LastAccessTime;
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
LARGE_INTEGER ChangeTime;
|
||||||
|
LARGE_INTEGER AllocationSize;
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
ULONG FileAttributes;
|
||||||
|
} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_EA_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG EaSize;
|
||||||
|
} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_COMPRESSION_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER CompressedFileSize;
|
||||||
|
USHORT CompressionFormat;
|
||||||
|
UCHAR CompressionUnitShift;
|
||||||
|
UCHAR ChunkShift;
|
||||||
|
UCHAR ClusterShift;
|
||||||
|
UCHAR Reserved[3];
|
||||||
|
} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_POSITION_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER CurrentByteOffset;
|
||||||
|
} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_DISPOSITION_INFORMATION
|
||||||
|
{
|
||||||
|
BOOLEAN DeleteFile;
|
||||||
|
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FULL_EA_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG NextEntryOffset;
|
||||||
|
UCHAR Flags;
|
||||||
|
UCHAR EaNameLength;
|
||||||
|
USHORT EaValueLength;
|
||||||
|
CHAR EaName[1];
|
||||||
|
} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_QUOTA_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG NextEntryOffset;
|
||||||
|
ULONG SidLength;
|
||||||
|
LARGE_INTEGER ChangeTime;
|
||||||
|
LARGE_INTEGER QuotaUsed;
|
||||||
|
LARGE_INTEGER QuotaThreshold;
|
||||||
|
LARGE_INTEGER QuotaLimit;
|
||||||
|
SID Sid;
|
||||||
|
} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_INTERNAL_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER IndexNumber;
|
||||||
|
} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_RENAME_INFORMATION
|
||||||
|
{
|
||||||
|
BOOLEAN ReplaceIfExists;
|
||||||
|
HANDLE RootDirectory;
|
||||||
|
ULONG FileNameLength;
|
||||||
|
WCHAR FileName[1];
|
||||||
|
} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_PIPE_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG ReadMode;
|
||||||
|
ULONG CompletionMode;
|
||||||
|
} FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_PIPE_LOCAL_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG NamedPipeType;
|
||||||
|
ULONG NamedPipeConfiguration;
|
||||||
|
ULONG MaximumInstances;
|
||||||
|
ULONG CurrentInstances;
|
||||||
|
ULONG InboundQuota;
|
||||||
|
ULONG ReadDataAvailable;
|
||||||
|
ULONG OutboundQuota;
|
||||||
|
ULONG WriteQuotaAvailable;
|
||||||
|
ULONG NamedPipeState;
|
||||||
|
ULONG NamedPipeEnd;
|
||||||
|
} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_PIPE_REMOTE_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER CollectDataTime;
|
||||||
|
ULONG MaximumCollectionCount;
|
||||||
|
} FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG MaximumMessageSize;
|
||||||
|
ULONG MailslotQuota;
|
||||||
|
ULONG NextMessageSize;
|
||||||
|
ULONG MessagesAvailable;
|
||||||
|
LARGE_INTEGER ReadTimeout;
|
||||||
|
} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_MAILSLOT_SET_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER ReadTimeout;
|
||||||
|
} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_BOTH_DIR_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG NextEntryOffset;
|
||||||
|
ULONG FileIndex;
|
||||||
|
LARGE_INTEGER CreationTime;
|
||||||
|
LARGE_INTEGER LastAccessTime;
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
LARGE_INTEGER ChangeTime;
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
LARGE_INTEGER AllocationSize;
|
||||||
|
ULONG FileAttributes;
|
||||||
|
ULONG FileNameLength;
|
||||||
|
ULONG EaSize;
|
||||||
|
CCHAR ShortNameLength;
|
||||||
|
WCHAR ShortName[12];
|
||||||
|
WCHAR FileName[1];
|
||||||
|
} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_COMPLETION_INFORMATION
|
||||||
|
{
|
||||||
|
HANDLE Port;
|
||||||
|
PVOID Key;
|
||||||
|
} FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_LINK_INFORMATION
|
||||||
|
{
|
||||||
|
BOOLEAN ReplaceIfExists;
|
||||||
|
HANDLE RootDirectory;
|
||||||
|
ULONG FileNameLength;
|
||||||
|
WCHAR FileName[1];
|
||||||
|
} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_NAME_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG FileNameLength;
|
||||||
|
WCHAR FileName[1];
|
||||||
|
} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_ALLOCATION_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER AllocationSize;
|
||||||
|
} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_END_OF_FILE_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER ValidDataLength;
|
||||||
|
} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FS_DEVICE_INFORMATION
|
||||||
|
{
|
||||||
|
DEVICE_TYPE DeviceType;
|
||||||
|
ULONG Characteristics;
|
||||||
|
} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG FileSystemAttributes;
|
||||||
|
ULONG MaximumComponentNameLength;
|
||||||
|
ULONG FileSystemNameLength;
|
||||||
|
WCHAR FileSystemName[1];
|
||||||
|
} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FS_SIZE_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER TotalAllocationUnits;
|
||||||
|
LARGE_INTEGER AvailableAllocationUnits;
|
||||||
|
ULONG SectorsPerAllocationUnit;
|
||||||
|
ULONG BytesPerSector;
|
||||||
|
} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FS_LABEL_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG VolumeLabelLength;
|
||||||
|
WCHAR VolumeLabel[1];
|
||||||
|
} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_FS_VOLUME_INFORMATION
|
||||||
|
{
|
||||||
|
LARGE_INTEGER VolumeCreationTime;
|
||||||
|
ULONG VolumeSerialNumber;
|
||||||
|
ULONG VolumeLabelLength;
|
||||||
|
BOOLEAN SupportsObjects;
|
||||||
|
WCHAR VolumeLabel[1];
|
||||||
|
} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
|
||||||
|
{
|
||||||
|
LARGE_INTEGER Timeout;
|
||||||
|
ULONG NameLength;
|
||||||
|
BOOLEAN TimeoutSpecified;
|
||||||
|
WCHAR Name[1];
|
||||||
|
} FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
|
||||||
|
|
||||||
|
typedef struct _FILE_PIPE_PEEK_BUFFER
|
||||||
|
{
|
||||||
|
ULONG NamedPipeState;
|
||||||
|
ULONG ReadDataAvailable;
|
||||||
|
ULONG NumberOfMessages;
|
||||||
|
ULONG MessageLength;
|
||||||
|
CHAR Data[1];
|
||||||
|
} FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
|
||||||
|
|
||||||
|
typedef struct _IO_STATUS_BLOCK
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
|
PVOID Pointer;
|
||||||
|
};
|
||||||
|
ULONG_PTR Information;
|
||||||
|
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
|
||||||
|
|
||||||
|
typedef struct _IO_ERROR_LOG_PACKET
|
||||||
|
{
|
||||||
|
UCHAR MajorFunctionCode;
|
||||||
|
UCHAR RetryCount;
|
||||||
|
USHORT DumpDataSize;
|
||||||
|
USHORT NumberOfStrings;
|
||||||
|
USHORT StringOffset;
|
||||||
|
USHORT EventCategory;
|
||||||
|
NTSTATUS ErrorCode;
|
||||||
|
ULONG UniqueErrorValue;
|
||||||
|
NTSTATUS FinalStatus;
|
||||||
|
ULONG SequenceNumber;
|
||||||
|
ULONG IoControlCode;
|
||||||
|
LARGE_INTEGER DeviceOffset;
|
||||||
|
ULONG DumpData[1];
|
||||||
|
}IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET;
|
||||||
|
|
||||||
|
typedef struct _IO_ERROR_LOG_MESSAGE
|
||||||
|
{
|
||||||
|
USHORT Type;
|
||||||
|
USHORT Size;
|
||||||
|
USHORT DriverNameLength;
|
||||||
|
LARGE_INTEGER TimeStamp;
|
||||||
|
ULONG DriverNameOffset;
|
||||||
|
IO_ERROR_LOG_PACKET EntryData;
|
||||||
|
} IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _MAILSLOT_CREATE_PARAMETERS
|
typedef struct _MAILSLOT_CREATE_PARAMETERS
|
||||||
{
|
{
|
||||||
ULONG MailslotQuota;
|
ULONG MailslotQuota;
|
||||||
|
@ -115,6 +537,7 @@ typedef struct _NAMED_PIPE_CREATE_PARAMETERS
|
||||||
BOOLEAN TimeoutSpecified;
|
BOOLEAN TimeoutSpecified;
|
||||||
} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
|
} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
typedef struct _IO_TIMER
|
typedef struct _IO_TIMER
|
||||||
{
|
{
|
||||||
USHORT Type;
|
USHORT Type;
|
||||||
|
@ -127,52 +550,33 @@ typedef struct _IO_TIMER
|
||||||
|
|
||||||
typedef struct _DEVICE_NODE
|
typedef struct _DEVICE_NODE
|
||||||
{
|
{
|
||||||
/* A tree structure. */
|
|
||||||
struct _DEVICE_NODE *Parent;
|
struct _DEVICE_NODE *Parent;
|
||||||
struct _DEVICE_NODE *PrevSibling;
|
struct _DEVICE_NODE *PrevSibling;
|
||||||
struct _DEVICE_NODE *NextSibling;
|
struct _DEVICE_NODE *NextSibling;
|
||||||
struct _DEVICE_NODE *Child;
|
struct _DEVICE_NODE *Child;
|
||||||
/* The level of deepness in the tree. */
|
|
||||||
UINT Level;
|
UINT Level;
|
||||||
PPO_DEVICE_NOTIFY Notify;
|
struct _PO_DEVICE_NOTIFY *Notify;
|
||||||
/* State machine. */
|
|
||||||
PNP_DEVNODE_STATE State;
|
PNP_DEVNODE_STATE State;
|
||||||
PNP_DEVNODE_STATE PreviousState;
|
PNP_DEVNODE_STATE PreviousState;
|
||||||
PNP_DEVNODE_STATE StateHistory[20];
|
PNP_DEVNODE_STATE StateHistory[20];
|
||||||
UINT StateHistoryEntry;
|
UINT StateHistoryEntry;
|
||||||
/* ? */
|
|
||||||
INT CompletionStatus;
|
INT CompletionStatus;
|
||||||
/* ? */
|
|
||||||
PIRP PendingIrp;
|
PIRP PendingIrp;
|
||||||
/* See DNF_* flags below (WinDBG documentation has WRONG values) */
|
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
/* See DNUF_* flags below (and IRP_MN_QUERY_PNP_DEVICE_STATE) */
|
|
||||||
ULONG UserFlags;
|
ULONG UserFlags;
|
||||||
/* See CM_PROB_* values are defined in cfg.h */
|
|
||||||
ULONG Problem;
|
ULONG Problem;
|
||||||
/* Pointer to the PDO corresponding to the device node. */
|
|
||||||
PDEVICE_OBJECT PhysicalDeviceObject;
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
||||||
/* Resource list as assigned by the PnP arbiter. See IRP_MN_START_DEVICE
|
|
||||||
and ARBITER_INTERFACE (not documented in DDK, but present in headers). */
|
|
||||||
PCM_RESOURCE_LIST ResourceList;
|
PCM_RESOURCE_LIST ResourceList;
|
||||||
/* Resource list as assigned by the PnP arbiter (translated version). */
|
|
||||||
PCM_RESOURCE_LIST ResourceListTranslated;
|
PCM_RESOURCE_LIST ResourceListTranslated;
|
||||||
/* Instance path relative to the Enum key in registry. */
|
|
||||||
UNICODE_STRING InstancePath;
|
UNICODE_STRING InstancePath;
|
||||||
/* Name of the driver service. */
|
|
||||||
UNICODE_STRING ServiceName;
|
UNICODE_STRING ServiceName;
|
||||||
/* ? */
|
|
||||||
PDEVICE_OBJECT DuplicatePDO;
|
PDEVICE_OBJECT DuplicatePDO;
|
||||||
/* See IRP_MN_QUERY_RESOURCE_REQUIREMENTS. */
|
|
||||||
PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements;
|
PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements;
|
||||||
/* Information about bus for bus drivers. */
|
|
||||||
INTERFACE_TYPE InterfaceType;
|
INTERFACE_TYPE InterfaceType;
|
||||||
ULONG BusNumber;
|
ULONG BusNumber;
|
||||||
/* Information about underlying bus for child devices. */
|
|
||||||
INTERFACE_TYPE ChildInterfaceType;
|
INTERFACE_TYPE ChildInterfaceType;
|
||||||
ULONG ChildBusNumber;
|
ULONG ChildBusNumber;
|
||||||
USHORT ChildBusTypeIndex;
|
USHORT ChildBusTypeIndex;
|
||||||
/* ? */
|
|
||||||
UCHAR RemovalPolicy;
|
UCHAR RemovalPolicy;
|
||||||
UCHAR HardwareRemovalPolicy;
|
UCHAR HardwareRemovalPolicy;
|
||||||
LIST_ENTRY TargetDeviceNotify;
|
LIST_ENTRY TargetDeviceNotify;
|
||||||
|
@ -191,9 +595,7 @@ typedef struct _DEVICE_NODE
|
||||||
{
|
{
|
||||||
struct _DEVICE_NODE *NextResourceDeviceNode;
|
struct _DEVICE_NODE *NextResourceDeviceNode;
|
||||||
} OverUsed2;
|
} OverUsed2;
|
||||||
/* See IRP_MN_QUERY_RESOURCES/IRP_MN_FILTER_RESOURCES. */
|
|
||||||
PCM_RESOURCE_LIST BootResources;
|
PCM_RESOURCE_LIST BootResources;
|
||||||
/* See the bitfields in DEVICE_CAPABILITIES structure. */
|
|
||||||
ULONG CapabilityFlags;
|
ULONG CapabilityFlags;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
@ -245,6 +647,77 @@ typedef struct _PRIVATE_DRIVER_EXTENSIONS
|
||||||
PVOID ClientIdentificationAddress;
|
PVOID ClientIdentificationAddress;
|
||||||
CHAR Extension[1];
|
CHAR Extension[1];
|
||||||
} PRIVATE_DRIVER_EXTENSIONS, *PPRIVATE_DRIVER_EXTENSIONS;
|
} PRIVATE_DRIVER_EXTENSIONS, *PPRIVATE_DRIVER_EXTENSIONS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FUNCTION TYPES ************************************************************/
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PIO_APC_ROUTINE)(
|
||||||
|
IN PVOID ApcContext,
|
||||||
|
IN PIO_STATUS_BLOCK IoStatusBlock,
|
||||||
|
IN ULONG Reserved);
|
||||||
|
|
||||||
|
/* I/O CONTROL CODES *********************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
/* Mailslots */
|
||||||
|
#define FSCTL_MAILSLOT_PEEK \
|
||||||
|
CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
|
||||||
|
|
||||||
|
/* Pipes */
|
||||||
|
#define FSCTL_PIPE_ASSIGN_EVENT \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_DISCONNECT \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_LISTEN \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_PEEK \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
|
||||||
|
#define FSCTL_PIPE_QUERY_EVENT \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_TRANSCEIVE \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
|
||||||
|
#define FSCTL_PIPE_WAIT \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_IMPERSONATE \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_SET_CLIENT_PROCESS \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
|
#define FSCTL_PIPE_INTERNAL_READ \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
|
||||||
|
#define FSCTL_PIPE_INTERNAL_WRITE \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
|
||||||
|
#define FSCTL_PIPE_INTERNAL_TRANSCEIVE \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
|
||||||
|
#define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
|
||||||
|
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
|
||||||
|
|
||||||
|
/* Tapes */
|
||||||
|
#define IOCTL_TAPE_ERASE \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||||
|
#define IOCTL_TAPE_PREPARE \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_WRITE_MARKS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||||
|
#define IOCTL_TAPE_GET_POSITION \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_SET_POSITION \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_GET_DRIVE_PARAMS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_SET_DRIVE_PARAMS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||||
|
#define IOCTL_TAPE_GET_MEDIA_PARAMS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_SET_MEDIA_PARAMS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_GET_STATUS \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||||
|
#define IOCTL_TAPE_CREATE_PARTITION \
|
||||||
|
CTL_CODE(FILE_DEVICE_TAPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "kdtypes.h"
|
#include "kdtypes.h"
|
||||||
|
|
||||||
/* FUNCTION TYPES ************************************************************/
|
|
||||||
|
|
||||||
/* PROTOTYPES ****************************************************************/
|
/* PROTOTYPES ****************************************************************/
|
||||||
|
|
||||||
BYTE
|
BYTE
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "ketypes.h"
|
#include "ketypes.h"
|
||||||
|
|
||||||
/* FUNCTION TYPES ************************************************************/
|
|
||||||
|
|
||||||
/* PROTOTYPES ****************************************************************/
|
/* PROTOTYPES ****************************************************************/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -10,28 +10,24 @@
|
||||||
#define _KETYPES_H
|
#define _KETYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "haltypes.h"
|
#ifndef NTOS_MODE_USER
|
||||||
#include "potypes.h"
|
|
||||||
#include "mmtypes.h"
|
|
||||||
#include <arc/arc.h>
|
#include <arc/arc.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* Architecture-specific types
|
|
||||||
* NB: Although KPROCESS is Arch-Specific,
|
|
||||||
* only some members are different and we will use #ifdef
|
|
||||||
* directly in the structure to avoid dependency-hell
|
|
||||||
*/
|
|
||||||
#include "arch/ketypes.h"
|
#include "arch/ketypes.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
#define SSDT_MAX_ENTRIES 4
|
#define SSDT_MAX_ENTRIES 4
|
||||||
#define PROCESSOR_FEATURE_MAX 64
|
#define PROCESSOR_FEATURE_MAX 64
|
||||||
|
|
||||||
#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
|
#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
|
||||||
|
|
||||||
#define THREAD_WAIT_OBJECTS 4
|
#define THREAD_WAIT_OBJECTS 4
|
||||||
|
#define THREAD_ALERT 0x4
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
#define SharedUserData ((KUSER_SHARED_DATA * CONST) USER_SHARED_DATA)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
extern CHAR NTOSAPI KeNumberProcessors;
|
extern CHAR NTOSAPI KeNumberProcessors;
|
||||||
extern LOADER_PARAMETER_BLOCK NTOSAPI KeLoaderBlock;
|
extern LOADER_PARAMETER_BLOCK NTOSAPI KeLoaderBlock;
|
||||||
extern ULONG NTOSAPI KeDcacheFlushCount;
|
extern ULONG NTOSAPI KeDcacheFlushCount;
|
||||||
|
@ -43,11 +39,203 @@ extern ULONG NTOSAPI KeMinimumIncrement;
|
||||||
extern ULONG NTOSAPI NtBuildNumber;
|
extern ULONG NTOSAPI NtBuildNumber;
|
||||||
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES];
|
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES];
|
||||||
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES];
|
extern SSDT_ENTRY NTOSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES];
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef enum _EVENT_TYPE
|
||||||
|
{
|
||||||
|
NotificationEvent,
|
||||||
|
SynchronizationEvent
|
||||||
|
} EVENT_TYPE;
|
||||||
|
|
||||||
|
typedef enum _TIMER_TYPE
|
||||||
|
{
|
||||||
|
NotificationTimer,
|
||||||
|
SynchronizationTimer
|
||||||
|
} TIMER_TYPE;
|
||||||
|
|
||||||
|
typedef enum _WAIT_TYPE
|
||||||
|
{
|
||||||
|
WaitAll,
|
||||||
|
WaitAny
|
||||||
|
} WAIT_TYPE;
|
||||||
|
|
||||||
|
typedef enum _MODE
|
||||||
|
{
|
||||||
|
KernelMode,
|
||||||
|
UserMode,
|
||||||
|
MaximumMode
|
||||||
|
} MODE;
|
||||||
|
|
||||||
|
typedef enum _KWAIT_REASON
|
||||||
|
{
|
||||||
|
Executive,
|
||||||
|
FreePage,
|
||||||
|
PageIn,
|
||||||
|
PoolAllocation,
|
||||||
|
DelayExecution,
|
||||||
|
Suspended,
|
||||||
|
UserRequest,
|
||||||
|
WrExecutive,
|
||||||
|
WrFreePage,
|
||||||
|
WrPageIn,
|
||||||
|
WrPoolAllocation,
|
||||||
|
WrDelayExecution,
|
||||||
|
WrSuspended,
|
||||||
|
WrUserRequest,
|
||||||
|
WrEventPair,
|
||||||
|
WrQueue,
|
||||||
|
WrLpcReceive,
|
||||||
|
WrLpcReply,
|
||||||
|
WrVirtualMemory,
|
||||||
|
WrPageOut,
|
||||||
|
WrRendezvous,
|
||||||
|
Spare2,
|
||||||
|
WrGuardedMutex,
|
||||||
|
Spare4,
|
||||||
|
Spare5,
|
||||||
|
Spare6,
|
||||||
|
WrKernel,
|
||||||
|
WrResource,
|
||||||
|
WrPushLock,
|
||||||
|
WrMutex,
|
||||||
|
WrQuantumEnd,
|
||||||
|
WrDispatchInt,
|
||||||
|
WrPreempted,
|
||||||
|
WrYieldExecution,
|
||||||
|
MaximumWaitReason
|
||||||
|
} KWAIT_REASON;
|
||||||
|
|
||||||
|
typedef enum _KPROFILE_SOURCE
|
||||||
|
{
|
||||||
|
ProfileTime,
|
||||||
|
ProfileAlignmentFixup,
|
||||||
|
ProfileTotalIssues,
|
||||||
|
ProfilePipelineDry,
|
||||||
|
ProfileLoadInstructions,
|
||||||
|
ProfilePipelineFrozen,
|
||||||
|
ProfileBranchInstructions,
|
||||||
|
ProfileTotalNonissues,
|
||||||
|
ProfileDcacheMisses,
|
||||||
|
ProfileIcacheMisses,
|
||||||
|
ProfileCacheMisses,
|
||||||
|
ProfileBranchMispredictions,
|
||||||
|
ProfileStoreInstructions,
|
||||||
|
ProfileFpInstructions,
|
||||||
|
ProfileIntegerInstructions,
|
||||||
|
Profile2Issue,
|
||||||
|
Profile3Issue,
|
||||||
|
Profile4Issue,
|
||||||
|
ProfileSpecialInstructions,
|
||||||
|
ProfileTotalCycles,
|
||||||
|
ProfileIcacheIssues,
|
||||||
|
ProfileDcacheAccesses,
|
||||||
|
ProfileMemoryBarrierCycles,
|
||||||
|
ProfileLoadLinkedIssues,
|
||||||
|
ProfileMaximum
|
||||||
|
} KPROFILE_SOURCE;
|
||||||
|
|
||||||
|
typedef enum _NT_PRODUCT_TYPE
|
||||||
|
{
|
||||||
|
NtProductWinNt = 1,
|
||||||
|
NtProductLanManNt,
|
||||||
|
NtProductServer
|
||||||
|
} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
|
||||||
|
|
||||||
|
typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
|
||||||
|
{
|
||||||
|
StandardDesign,
|
||||||
|
NEC98x86,
|
||||||
|
EndAlternatives
|
||||||
|
} ALTERNATIVE_ARCHITECTURE_TYPE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum _KTHREAD_STATE
|
||||||
|
{
|
||||||
|
Initialized,
|
||||||
|
Ready,
|
||||||
|
Running,
|
||||||
|
Standby,
|
||||||
|
Terminated,
|
||||||
|
Waiting,
|
||||||
|
Transition,
|
||||||
|
DeferredReady,
|
||||||
|
} KTHREAD_STATE, *PKTHREAD_STATE;
|
||||||
|
|
||||||
|
/* FUNCTION TYPES ************************************************************/
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PKNORMAL_ROUTINE)(
|
||||||
|
IN PVOID NormalContext,
|
||||||
|
IN PVOID SystemArgument1,
|
||||||
|
IN PVOID SystemArgument2);
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PTIMER_APC_ROUTINE)(
|
||||||
|
IN PVOID TimerContext,
|
||||||
|
IN ULONG TimerLowValue,
|
||||||
|
IN LONG TimerHighValue);
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
typedef LONG KPRIORITY;
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef CCHAR KPROCESSOR_MODE;
|
||||||
|
|
||||||
|
typedef struct _KSYSTEM_TIME
|
||||||
|
{
|
||||||
|
ULONG LowPart;
|
||||||
|
LONG High1Time;
|
||||||
|
LONG High2Time;
|
||||||
|
} KSYSTEM_TIME, *PKSYSTEM_TIME;
|
||||||
|
|
||||||
|
typedef struct _KUSER_SHARED_DATA
|
||||||
|
{
|
||||||
|
ULONG TickCountLowDeprecated;
|
||||||
|
ULONG TickCountMultiplier;
|
||||||
|
volatile KSYSTEM_TIME InterruptTime;
|
||||||
|
volatile KSYSTEM_TIME SystemTime;
|
||||||
|
volatile KSYSTEM_TIME TimeZoneBias;
|
||||||
|
USHORT ImageNumberLow;
|
||||||
|
USHORT ImageNumberHigh;
|
||||||
|
WCHAR NtSystemRoot[260];
|
||||||
|
ULONG MaxStackTraceDepth;
|
||||||
|
ULONG CryptoExponent;
|
||||||
|
ULONG TimeZoneId;
|
||||||
|
ULONG LargePageMinimum;
|
||||||
|
ULONG Reserved2[7];
|
||||||
|
NT_PRODUCT_TYPE NtProductType;
|
||||||
|
BOOLEAN ProductTypeIsValid;
|
||||||
|
ULONG NtMajorVersion;
|
||||||
|
ULONG NtMinorVersion;
|
||||||
|
BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
|
||||||
|
ULONG Reserved1;
|
||||||
|
ULONG Reserved3;
|
||||||
|
volatile ULONG TimeSlip;
|
||||||
|
ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
|
||||||
|
LARGE_INTEGER SystemExpirationDate;
|
||||||
|
ULONG SuiteMask;
|
||||||
|
BOOLEAN KdDebuggerEnabled;
|
||||||
|
volatile ULONG ActiveConsoleId;
|
||||||
|
volatile ULONG DismountCount;
|
||||||
|
ULONG ComPlusPackage;
|
||||||
|
ULONG LastSystemRITEventTickCount;
|
||||||
|
ULONG NumberOfPhysicalPages;
|
||||||
|
BOOLEAN SafeBootMode;
|
||||||
|
ULONG TraceLogging;
|
||||||
|
ULONGLONG Fill0;
|
||||||
|
ULONGLONG SystemCall[4];
|
||||||
|
union {
|
||||||
|
volatile KSYSTEM_TIME TickCount;
|
||||||
|
volatile ULONG64 TickCountQuad;
|
||||||
|
};
|
||||||
|
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
typedef struct _CONFIGURATION_COMPONENT_DATA
|
typedef struct _CONFIGURATION_COMPONENT_DATA
|
||||||
{
|
{
|
||||||
struct _CONFIGURATION_COMPONENT_DATA *Parent;
|
struct _CONFIGURATION_COMPONENT_DATA *Parent;
|
||||||
|
@ -63,27 +251,6 @@ typedef enum _KAPC_ENVIRONMENT
|
||||||
CurrentApcEnvironment
|
CurrentApcEnvironment
|
||||||
} KAPC_ENVIRONMENT;
|
} KAPC_ENVIRONMENT;
|
||||||
|
|
||||||
/* We don't want to force NTIFS usage only for two structures */
|
|
||||||
#ifndef _NTIFS_
|
|
||||||
typedef struct _KAPC_STATE
|
|
||||||
{
|
|
||||||
LIST_ENTRY ApcListHead[2];
|
|
||||||
PKPROCESS Process;
|
|
||||||
BOOLEAN KernelApcInProgress;
|
|
||||||
BOOLEAN KernelApcPending;
|
|
||||||
BOOLEAN UserApcPending;
|
|
||||||
} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
|
|
||||||
|
|
||||||
typedef struct _KQUEUE
|
|
||||||
{
|
|
||||||
DISPATCHER_HEADER Header;
|
|
||||||
LIST_ENTRY EntryListHead;
|
|
||||||
ULONG CurrentCount;
|
|
||||||
ULONG MaximumCount;
|
|
||||||
LIST_ENTRY ThreadListHead;
|
|
||||||
} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _KNODE
|
typedef struct _KNODE
|
||||||
{
|
{
|
||||||
SLIST_HEADER DeadStackList;
|
SLIST_HEADER DeadStackList;
|
||||||
|
@ -319,17 +486,6 @@ typedef struct _KPROCESS
|
||||||
ULONG StackCount; /* 06C */
|
ULONG StackCount; /* 06C */
|
||||||
LIST_ENTRY ProcessListEntry; /* 070 */
|
LIST_ENTRY ProcessListEntry; /* 070 */
|
||||||
} KPROCESS;
|
} KPROCESS;
|
||||||
|
#endif /* !NTOS_MODE_USER */
|
||||||
typedef enum _KTHREAD_STATE
|
|
||||||
{
|
|
||||||
Initialized,
|
|
||||||
Ready,
|
|
||||||
Running,
|
|
||||||
Standby,
|
|
||||||
Terminated,
|
|
||||||
Waiting,
|
|
||||||
Transition,
|
|
||||||
DeferredReady,
|
|
||||||
} KTHREAD_STATE, *PKTHREAD_STATE;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,12 +34,7 @@ typedef enum _LPC_TYPE
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
/*
|
#ifdef NTOS_MODE_USER
|
||||||
* Native Structures in IFS. Duplicated here for user-mode.
|
|
||||||
* Also duplicated if the IFS is not present. Until the WDK is
|
|
||||||
* released, we should not force the usage of a 100$ kit.
|
|
||||||
*/
|
|
||||||
#if defined(NTOS_MODE_USER) || !(defined(_NTIFS_))
|
|
||||||
|
|
||||||
#if defined(USE_LPC6432)
|
#if defined(USE_LPC6432)
|
||||||
#define LPC_CLIENT_ID CLIENT_ID64
|
#define LPC_CLIENT_ID CLIENT_ID64
|
||||||
|
@ -130,7 +125,6 @@ typedef struct _LPCP_PORT_QUEUE
|
||||||
LIST_ENTRY ReceiveHead;
|
LIST_ENTRY ReceiveHead;
|
||||||
} LPCP_PORT_QUEUE, *PLPCP_PORT_QUEUE;
|
} LPCP_PORT_QUEUE, *PLPCP_PORT_QUEUE;
|
||||||
|
|
||||||
#ifdef _NTIFS_
|
|
||||||
typedef struct _LPCP_PORT_OBJECT
|
typedef struct _LPCP_PORT_OBJECT
|
||||||
{
|
{
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
|
@ -177,8 +171,6 @@ typedef struct _LPCP_CONNECTION_MESSAGE
|
||||||
} LPCP_CONNECTION_MESSAGE, *PLPCP_CONNECTION_MESSAGE;
|
} LPCP_CONNECTION_MESSAGE, *PLPCP_CONNECTION_MESSAGE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
#define PORT_MAXIMUM_MESSAGE_LENGTH 256
|
#define PORT_MAXIMUM_MESSAGE_LENGTH 256
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#define _MMTYPES_H
|
#define _MMTYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
|
|
||||||
#include "arch/mmtypes.h"
|
#include "arch/mmtypes.h"
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
@ -18,6 +17,34 @@
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef enum _SECTION_INHERIT
|
||||||
|
{
|
||||||
|
ViewShare = 1,
|
||||||
|
ViewUnmap = 2
|
||||||
|
} SECTION_INHERIT;
|
||||||
|
|
||||||
|
typedef enum _POOL_TYPE
|
||||||
|
{
|
||||||
|
NonPagedPool,
|
||||||
|
PagedPool,
|
||||||
|
NonPagedPoolMustSucceed,
|
||||||
|
DontUseThisType,
|
||||||
|
NonPagedPoolCacheAligned,
|
||||||
|
PagedPoolCacheAligned,
|
||||||
|
NonPagedPoolCacheAlignedMustS,
|
||||||
|
MaxPoolType,
|
||||||
|
NonPagedPoolSession = 32,
|
||||||
|
PagedPoolSession,
|
||||||
|
NonPagedPoolMustSucceedSession,
|
||||||
|
DontUseThisTypeSession,
|
||||||
|
NonPagedPoolCacheAlignedSession,
|
||||||
|
PagedPoolCacheAlignedSession,
|
||||||
|
NonPagedPoolCacheAlignedMustSSession
|
||||||
|
} POOL_TYPE;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum _PP_NPAGED_LOOKASIDE_NUMBER
|
typedef enum _PP_NPAGED_LOOKASIDE_NUMBER
|
||||||
{
|
{
|
||||||
LookasideSmallIrpList = 0,
|
LookasideSmallIrpList = 0,
|
||||||
|
@ -32,6 +59,40 @@ typedef enum _PP_NPAGED_LOOKASIDE_NUMBER
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef struct _VM_COUNTERS
|
||||||
|
{
|
||||||
|
SIZE_T PeakVirtualSize;
|
||||||
|
SIZE_T VirtualSize;
|
||||||
|
ULONG PageFaultCount;
|
||||||
|
SIZE_T PeakWorkingSetSize;
|
||||||
|
SIZE_T WorkingSetSize;
|
||||||
|
SIZE_T QuotaPeakPagedPoolUsage;
|
||||||
|
SIZE_T QuotaPagedPoolUsage;
|
||||||
|
SIZE_T QuotaPeakNonPagedPoolUsage;
|
||||||
|
SIZE_T QuotaNonPagedPoolUsage;
|
||||||
|
SIZE_T PagefileUsage;
|
||||||
|
SIZE_T PeakPagefileUsage;
|
||||||
|
} VM_COUNTERS, *PVM_COUNTERS;
|
||||||
|
|
||||||
|
typedef struct _VM_COUNTERS_EX
|
||||||
|
{
|
||||||
|
SIZE_T PeakVirtualSize;
|
||||||
|
SIZE_T VirtualSize;
|
||||||
|
ULONG PageFaultCount;
|
||||||
|
SIZE_T PeakWorkingSetSize;
|
||||||
|
SIZE_T WorkingSetSize;
|
||||||
|
SIZE_T QuotaPeakPagedPoolUsage;
|
||||||
|
SIZE_T QuotaPagedPoolUsage;
|
||||||
|
SIZE_T QuotaPeakNonPagedPoolUsage;
|
||||||
|
SIZE_T QuotaNonPagedPoolUsage;
|
||||||
|
SIZE_T PagefileUsage;
|
||||||
|
SIZE_T PeakPagefileUsage;
|
||||||
|
SIZE_T PrivateUsage;
|
||||||
|
} VM_COUNTERS_EX, *PVM_COUNTERS_EX;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
/* FIXME: Forced to do this for now, because of EPROCESS, will go away before 0.3.0 */
|
/* FIXME: Forced to do this for now, because of EPROCESS, will go away before 0.3.0 */
|
||||||
typedef struct _MADDRESS_SPACE
|
typedef struct _MADDRESS_SPACE
|
||||||
{
|
{
|
||||||
|
@ -43,12 +104,6 @@ typedef struct _MADDRESS_SPACE
|
||||||
ULONG PageTableRefCountTableSize;
|
ULONG PageTableRefCountTableSize;
|
||||||
} MADDRESS_SPACE, *PMADDRESS_SPACE;
|
} MADDRESS_SPACE, *PMADDRESS_SPACE;
|
||||||
|
|
||||||
typedef struct _PP_LOOKASIDE_LIST
|
|
||||||
{
|
|
||||||
struct _GENERAL_LOOKASIDE *P;
|
|
||||||
struct _GENERAL_LOOKASIDE *L;
|
|
||||||
} PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST;
|
|
||||||
|
|
||||||
typedef struct _ADDRESS_RANGE
|
typedef struct _ADDRESS_RANGE
|
||||||
{
|
{
|
||||||
ULONG BaseAddrLow;
|
ULONG BaseAddrLow;
|
||||||
|
@ -161,3 +216,4 @@ typedef struct _MMSUPPORT
|
||||||
} MMSUPPORT, *PMMSUPPORT;
|
} MMSUPPORT, *PMMSUPPORT;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -16,43 +16,45 @@
|
||||||
/* Helper Header */
|
/* Helper Header */
|
||||||
#include <helper.h>
|
#include <helper.h>
|
||||||
|
|
||||||
|
/* A version of ntdef.h to be used with PSDK headers. */
|
||||||
|
#include "umtypes.h"
|
||||||
|
|
||||||
/* Kernel-Mode NDK */
|
/* Kernel-Mode NDK */
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef NTOS_MODE_USER
|
||||||
#include "kdtypes.h" /* Kernel Debugger Types */
|
#include "ifssupp.h" /* IFS Support Header */
|
||||||
#include "kdfuncs.h" /* Kernel Debugger Functions */
|
#include "kdfuncs.h" /* Kernel Debugger Functions */
|
||||||
#include "cctypes.h" /* Cache Manager Types */
|
#include "cctypes.h" /* Cache Manager Types */
|
||||||
#include "dbgktypes.h" /* User-Mode Kernel Debugging Types */
|
#include "potypes.h" /* Power Manager Types */
|
||||||
#include "extypes.h" /* Executive Types */
|
#include "dbgktypes.h" /* User-Mode Kernel Debugging Types */
|
||||||
#include "haltypes.h" /* Hardware Abstraction Layer Types */
|
#include "haltypes.h" /* Hardware Abstraction Layer Types */
|
||||||
#include "halfuncs.h" /* Hardware Abstraction Layer Functions */
|
#include "halfuncs.h" /* Hardware Abstraction Layer Functions */
|
||||||
#include "inbvfuncs.h" /* Initialization Boot Video Functions */
|
#include "inbvfuncs.h" /* Initialization Boot Video Functions */
|
||||||
#include "iotypes.h" /* Input/Output Manager Types */
|
#include "iofuncs.h" /* Input/Output Manager Functions */
|
||||||
#include "iofuncs.h" /* Input/Output Manager Functions */
|
#include "kefuncs.h" /* Kernel Functions */
|
||||||
#include "ketypes.h" /* Kernel Types */
|
#include "mmfuncs.h" /* Memory Manager Functions */
|
||||||
#include "kefuncs.h" /* Kernel Functions */
|
#include "obfuncs.h" /* Object Manager Functions */
|
||||||
#include "mmtypes.h" /* Memory Manager Types */
|
#include "psfuncs.h" /* Process Manager Functions */
|
||||||
#include "mmfuncs.h" /* Memory Manager Functions */
|
#include "setypes.h" /* Security Subsystem Types */
|
||||||
#include "obtypes.h" /* Object Manager Types */
|
#include "sefuncs.h" /* Security Subsystem Functions */
|
||||||
#include "obfuncs.h" /* Object Manager Functions */
|
#endif /* !NTOS_MODE_USER */
|
||||||
#include "potypes.h" /* Power Manager Types */
|
|
||||||
#include "psfuncs.h" /* Process Manager Functions */
|
|
||||||
#include "setypes.h" /* Security Subsystem Types */
|
|
||||||
#include "sefuncs.h" /* Security Subsystem Functions */
|
|
||||||
#else
|
|
||||||
/* User-Mode NDK */
|
|
||||||
#include "umtypes.h" /* Native Types in DDK/IFS but not in PSDK */
|
|
||||||
#include "umfuncs.h" /* User-Mode NT Library Functions */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Shared NDK */
|
/* Shared NDK */
|
||||||
#include "ldrfuncs.h" /* Loader Functions */
|
#include "extypes.h" /* Executive Types */
|
||||||
|
#include "cmtypes.h" /* Configuration Manager Types */
|
||||||
|
#include "kdtypes.h" /* Kernel Debugger Types */
|
||||||
|
#include "ketypes.h" /* Kernel Types */
|
||||||
|
#include "iotypes.h" /* Input/Output Manager Types */
|
||||||
#include "ldrtypes.h" /* Loader Types */
|
#include "ldrtypes.h" /* Loader Types */
|
||||||
#include "lpctypes.h" /* Local Procedure Call Types */
|
#include "ldrfuncs.h" /* Loader Functions */
|
||||||
|
#include "mmtypes.h" /* Memory Manager Types */
|
||||||
|
#include "obtypes.h" /* Object Manager Types */
|
||||||
#include "pstypes.h" /* Process Manager Types */
|
#include "pstypes.h" /* Process Manager Types */
|
||||||
#include "rtltypes.h" /* Runtime Library Types */
|
#include "lpctypes.h" /* Local Procedure Call Types */
|
||||||
#include "rtlfuncs.h" /* Runtime Library Functions */
|
|
||||||
#include "zwtypes.h" /* Native Types */
|
#include "zwtypes.h" /* Native Types */
|
||||||
#include "zwfuncs.h" /* Native Functions (System Calls) */
|
#include "zwfuncs.h" /* Native Functions (System Calls) */
|
||||||
|
#include "rtltypes.h" /* Runtime Library Types */
|
||||||
|
#include "rtlfuncs.h" /* Runtime Library Functions */
|
||||||
|
#include "umfuncs.h" /* User-Mode NT Library Functions */
|
||||||
#include "i386/floatsave.h" /* Floating Point Save Area Definitions for i386 */
|
#include "i386/floatsave.h" /* Floating Point Save Area Definitions for i386 */
|
||||||
#include "i386/segment.h" /* Kernel CPU Segment Definitions for i386 */
|
#include "i386/segment.h" /* Kernel CPU Segment Definitions for i386 */
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,35 @@
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
/* Definitions for Object Creation */
|
||||||
|
#define OBJ_INHERIT 2L
|
||||||
|
#define OBJ_PERMANENT 16L
|
||||||
|
#define OBJ_EXCLUSIVE 32L
|
||||||
|
#define OBJ_CASE_INSENSITIVE 64L
|
||||||
|
#define OBJ_OPENIF 128L
|
||||||
|
#define OBJ_OPENLINK 256L
|
||||||
|
#define OBJ_VALID_ATTRIBUTES 498L
|
||||||
|
#define InitializeObjectAttributes(p,n,a,r,s) { \
|
||||||
|
(p)->Length = sizeof(OBJECT_ATTRIBUTES); \
|
||||||
|
(p)->RootDirectory = (r); \
|
||||||
|
(p)->Attributes = (a); \
|
||||||
|
(p)->ObjectName = (n); \
|
||||||
|
(p)->SecurityDescriptor = (s); \
|
||||||
|
(p)->SecurityQualityOfService = NULL; \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Directory Object Access Rights */
|
||||||
|
#define DIRECTORY_QUERY 0x0001
|
||||||
|
#define DIRECTORY_TRAVERSE 0x0002
|
||||||
|
#define DIRECTORY_CREATE_OBJECT 0x0004
|
||||||
|
#define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
|
||||||
|
#define DIRECTORY_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | 0xF
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Duplication Flags */
|
||||||
|
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
|
||||||
|
|
||||||
/* Values for DosDeviceDriveType */
|
/* Values for DosDeviceDriveType */
|
||||||
#define DOSDEVICE_DRIVE_UNKNOWN 0
|
#define DOSDEVICE_DRIVE_UNKNOWN 0
|
||||||
#define DOSDEVICE_DRIVE_CALCULATE 1
|
#define DOSDEVICE_DRIVE_CALCULATE 1
|
||||||
|
@ -22,6 +51,7 @@
|
||||||
#define DOSDEVICE_DRIVE_CDROM 5
|
#define DOSDEVICE_DRIVE_CDROM 5
|
||||||
#define DOSDEVICE_DRIVE_RAMDISK 6
|
#define DOSDEVICE_DRIVE_RAMDISK 6
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
/* Object Flags */
|
/* Object Flags */
|
||||||
#define OB_FLAG_CREATE_INFO 0x01
|
#define OB_FLAG_CREATE_INFO 0x01
|
||||||
#define OB_FLAG_KERNEL_MODE 0x02
|
#define OB_FLAG_KERNEL_MODE 0x02
|
||||||
|
@ -95,11 +125,10 @@ typedef PVOID
|
||||||
ULONG Attributes
|
ULONG Attributes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
typedef NTSTATUS
|
typedef NTSTATUS
|
||||||
(STDCALL *OB_SECURITY_METHOD)(
|
(STDCALL *OB_SECURITY_METHOD)(
|
||||||
PVOID Object,
|
PVOID Object,
|
||||||
SECURITY_OPERATION_CODE OperationType,
|
SECURITY_OPERATION_CODE OperationType,
|
||||||
SECURITY_INFORMATION SecurityInformation,
|
SECURITY_INFORMATION SecurityInformation,
|
||||||
PSECURITY_DESCRIPTOR NewSecurityDescriptor,
|
PSECURITY_DESCRIPTOR NewSecurityDescriptor,
|
||||||
PULONG ReturnLength,
|
PULONG ReturnLength,
|
||||||
|
@ -116,9 +145,18 @@ typedef NTSTATUS
|
||||||
PWSTR RemainingPath,
|
PWSTR RemainingPath,
|
||||||
struct _OBJECT_ATTRIBUTES* ObjectAttributes
|
struct _OBJECT_ATTRIBUTES* ObjectAttributes
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef struct _OBJECT_NAME_INFORMATION
|
||||||
|
{
|
||||||
|
UNICODE_STRING Name;
|
||||||
|
} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
typedef struct _OBJECT_BASIC_INFORMATION
|
typedef struct _OBJECT_BASIC_INFORMATION
|
||||||
{
|
{
|
||||||
ULONG Attributes;
|
ULONG Attributes;
|
||||||
|
@ -292,5 +330,6 @@ typedef struct _DEVICE_MAP
|
||||||
|
|
||||||
extern NTOSAPI POBJECT_TYPE ObDirectoryType;
|
extern NTOSAPI POBJECT_TYPE ObDirectoryType;
|
||||||
extern NTOSAPI PDEVICE_MAP ObSystemDeviceMap;
|
extern NTOSAPI PDEVICE_MAP ObSystemDeviceMap;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,13 +11,20 @@
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "ldrtypes.h"
|
#include "ldrtypes.h"
|
||||||
#include "rtltypes.h"
|
#include "mmtypes.h"
|
||||||
|
#include "obtypes.h"
|
||||||
|
#include "extypes.h"
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
|
#include "setypes.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
extern NTOSAPI struct _EPROCESS* PsInitialSystemProcess;
|
extern NTOSAPI struct _EPROCESS* PsInitialSystemProcess;
|
||||||
extern NTOSAPI POBJECT_TYPE PsProcessType;
|
extern NTOSAPI POBJECT_TYPE PsProcessType;
|
||||||
extern NTOSAPI POBJECT_TYPE PsThreadType;
|
extern NTOSAPI POBJECT_TYPE PsThreadType;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CONSTANTS *****************************************************************/
|
/* CONSTANTS *****************************************************************/
|
||||||
|
|
||||||
|
@ -31,10 +38,16 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
|
||||||
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
|
#define JOB_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|31)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define THREAD_ALERT 0x4
|
|
||||||
|
|
||||||
#define USER_SHARED_DATA (0x7FFE0000)
|
#define USER_SHARED_DATA (0x7FFE0000)
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
/* Macros for current Process/Thread built-in 'special' ID */
|
||||||
|
#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
|
||||||
|
#define ZwCurrentProcess() NtCurrentProcess()
|
||||||
|
#define NtCurrentThread() ((HANDLE)(LONG_PTR)-2)
|
||||||
|
#define ZwCurrentThread() NtCurrentThread()
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Process priority classes */
|
/* Process priority classes */
|
||||||
#define PROCESS_PRIORITY_CLASS_INVALID 0
|
#define PROCESS_PRIORITY_CLASS_INVALID 0
|
||||||
#define PROCESS_PRIORITY_CLASS_IDLE 1
|
#define PROCESS_PRIORITY_CLASS_IDLE 1
|
||||||
|
@ -75,9 +88,74 @@ extern NTOSAPI POBJECT_TYPE PsThreadType;
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef enum _PROCESSINFOCLASS
|
||||||
|
{
|
||||||
|
ProcessBasicInformation,
|
||||||
|
ProcessQuotaLimits,
|
||||||
|
ProcessIoCounters,
|
||||||
|
ProcessVmCounters,
|
||||||
|
ProcessTimes,
|
||||||
|
ProcessBasePriority,
|
||||||
|
ProcessRaisePriority,
|
||||||
|
ProcessDebugPort,
|
||||||
|
ProcessExceptionPort,
|
||||||
|
ProcessAccessToken,
|
||||||
|
ProcessLdtInformation,
|
||||||
|
ProcessLdtSize,
|
||||||
|
ProcessDefaultHardErrorMode,
|
||||||
|
ProcessIoPortHandlers,
|
||||||
|
ProcessPooledUsageAndLimits,
|
||||||
|
ProcessWorkingSetWatch,
|
||||||
|
ProcessUserModeIOPL,
|
||||||
|
ProcessEnableAlignmentFaultFixup,
|
||||||
|
ProcessPriorityClass,
|
||||||
|
ProcessWx86Information,
|
||||||
|
ProcessHandleCount,
|
||||||
|
ProcessAffinityMask,
|
||||||
|
ProcessPriorityBoost,
|
||||||
|
ProcessDeviceMap,
|
||||||
|
ProcessSessionInformation,
|
||||||
|
ProcessForegroundInformation,
|
||||||
|
ProcessWow64Information,
|
||||||
|
ProcessImageFileName,
|
||||||
|
ProcessLUIDDeviceMapsEnabled,
|
||||||
|
ProcessBreakOnTermination,
|
||||||
|
ProcessDebugObjectHandle,
|
||||||
|
ProcessDebugFlags,
|
||||||
|
ProcessHandleTracing,
|
||||||
|
MaxProcessInfoClass
|
||||||
|
} PROCESSINFOCLASS;
|
||||||
|
|
||||||
|
typedef enum _THREADINFOCLASS
|
||||||
|
{
|
||||||
|
ThreadBasicInformation,
|
||||||
|
ThreadTimes,
|
||||||
|
ThreadPriority,
|
||||||
|
ThreadBasePriority,
|
||||||
|
ThreadAffinityMask,
|
||||||
|
ThreadImpersonationToken,
|
||||||
|
ThreadDescriptorTableEntry,
|
||||||
|
ThreadEnableAlignmentFaultFixup,
|
||||||
|
ThreadEventPair_Reusable,
|
||||||
|
ThreadQuerySetWin32StartAddress,
|
||||||
|
ThreadZeroTlsCell,
|
||||||
|
ThreadPerformanceCount,
|
||||||
|
ThreadAmILastThread,
|
||||||
|
ThreadIdealProcessor,
|
||||||
|
ThreadPriorityBoost,
|
||||||
|
ThreadSetTlsArrayAddress,
|
||||||
|
ThreadIsIoPending,
|
||||||
|
ThreadHideFromDebugger,
|
||||||
|
ThreadBreakOnTermination,
|
||||||
|
MaxThreadInfoClass
|
||||||
|
} THREADINFOCLASS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* FUNCTION TYPES ************************************************************/
|
/* FUNCTION TYPES ************************************************************/
|
||||||
typedef VOID (NTAPI *PPEBLOCKROUTINE)(PVOID);
|
typedef VOID (NTAPI *PPEBLOCKROUTINE)(PVOID);
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
typedef NTSTATUS
|
typedef NTSTATUS
|
||||||
(NTAPI *PW32_PROCESS_CALLBACK)(
|
(NTAPI *PW32_PROCESS_CALLBACK)(
|
||||||
struct _EPROCESS *Process,
|
struct _EPROCESS *Process,
|
||||||
|
@ -89,9 +167,18 @@ typedef NTSTATUS
|
||||||
struct _ETHREAD *Thread,
|
struct _ETHREAD *Thread,
|
||||||
BOOLEAN Create
|
BOOLEAN Create
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef struct _CLIENT_ID
|
||||||
|
{
|
||||||
|
HANDLE UniqueProcess;
|
||||||
|
HANDLE UniqueThread;
|
||||||
|
} CLIENT_ID, *PCLIENT_ID;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _W32THREAD;
|
struct _W32THREAD;
|
||||||
struct _W32PROCESS;
|
struct _W32PROCESS;
|
||||||
|
|
||||||
|
@ -118,7 +205,7 @@ typedef struct _PEB
|
||||||
HANDLE Mutant; /* 04h */
|
HANDLE Mutant; /* 04h */
|
||||||
PVOID ImageBaseAddress; /* 08h */
|
PVOID ImageBaseAddress; /* 08h */
|
||||||
PPEB_LDR_DATA Ldr; /* 0Ch */
|
PPEB_LDR_DATA Ldr; /* 0Ch */
|
||||||
PRTL_USER_PROCESS_PARAMETERS ProcessParameters; /* 10h */
|
struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters; /* 10h */
|
||||||
PVOID SubSystemData; /* 14h */
|
PVOID SubSystemData; /* 14h */
|
||||||
PVOID ProcessHeap; /* 18h */
|
PVOID ProcessHeap; /* 18h */
|
||||||
PVOID FastPebLock; /* 1Ch */
|
PVOID FastPebLock; /* 1Ch */
|
||||||
|
@ -168,7 +255,7 @@ typedef struct _PEB
|
||||||
ULONG SessionId; /* 1D4h */
|
ULONG SessionId; /* 1D4h */
|
||||||
PVOID AppCompatInfo; /* 1D8h */
|
PVOID AppCompatInfo; /* 1D8h */
|
||||||
UNICODE_STRING CSDVersion; /* 1DCh */
|
UNICODE_STRING CSDVersion; /* 1DCh */
|
||||||
} PEB;
|
} PEB, *PPEB;
|
||||||
|
|
||||||
typedef struct _GDI_TEB_BATCH
|
typedef struct _GDI_TEB_BATCH
|
||||||
{
|
{
|
||||||
|
@ -276,14 +363,7 @@ typedef struct _TEB
|
||||||
PVOID WineDebugInfo; /* FBCh */
|
PVOID WineDebugInfo; /* FBCh */
|
||||||
} TEB, *PTEB;
|
} TEB, *PTEB;
|
||||||
|
|
||||||
/* KERNEL MODE ONLY **********************************************************/
|
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef NTOS_MODE_USER
|
||||||
|
|
||||||
#include "mmtypes.h"
|
|
||||||
#include "obtypes.h"
|
|
||||||
#include "extypes.h"
|
|
||||||
#include "setypes.h"
|
|
||||||
|
|
||||||
/* FIXME: see note in mmtypes.h */
|
/* FIXME: see note in mmtypes.h */
|
||||||
#ifdef _NTOSKRNL_
|
#ifdef _NTOSKRNL_
|
||||||
#include <internal/mm.h>
|
#include <internal/mm.h>
|
||||||
|
@ -323,13 +403,6 @@ typedef struct _PS_IMPERSONATION_INFORMATION
|
||||||
} PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
|
} PS_IMPERSONATION_INFORMATION, *PPS_IMPERSONATION_INFORMATION;
|
||||||
|
|
||||||
#include <pshpack4.h>
|
#include <pshpack4.h>
|
||||||
/*
|
|
||||||
* NAME: ETHREAD
|
|
||||||
* DESCRIPTION: Internal Executive Thread Structure.
|
|
||||||
* PORTABILITY: Architecture Independent.
|
|
||||||
* KERNEL VERSION: 5.2
|
|
||||||
* DOCUMENTATION: http://reactos.com/wiki/index.php/ETHREAD
|
|
||||||
*/
|
|
||||||
typedef struct _ETHREAD
|
typedef struct _ETHREAD
|
||||||
{
|
{
|
||||||
KTHREAD Tcb; /* 1C0 */
|
KTHREAD Tcb; /* 1C0 */
|
||||||
|
@ -373,7 +446,7 @@ typedef struct _ETHREAD
|
||||||
PKSTART_ROUTINE StartAddress; /* 21C */
|
PKSTART_ROUTINE StartAddress; /* 21C */
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
PTHREAD_START_ROUTINE Win32StartAddress; /* 220 */
|
PVOID Win32StartAddress; /* 220 */
|
||||||
ULONG LpcReceivedMessageId; /* 220 */
|
ULONG LpcReceivedMessageId; /* 220 */
|
||||||
};
|
};
|
||||||
LIST_ENTRY ThreadListEntry; /* 224 */
|
LIST_ENTRY ThreadListEntry; /* 224 */
|
||||||
|
@ -431,13 +504,6 @@ typedef struct _ETHREAD
|
||||||
UCHAR ActiveFaultCount; /* 24E */
|
UCHAR ActiveFaultCount; /* 24E */
|
||||||
} ETHREAD;
|
} ETHREAD;
|
||||||
|
|
||||||
/*
|
|
||||||
* NAME: EPROCESS
|
|
||||||
* DESCRIPTION: Internal Executive Process Structure.
|
|
||||||
* PORTABILITY: Architecture Independent.
|
|
||||||
* KERNEL VERSION: 5.2
|
|
||||||
* DOCUMENTATION: http://reactos.com/wiki/index.php/EPROCESS
|
|
||||||
*/
|
|
||||||
typedef struct _EPROCESS
|
typedef struct _EPROCESS
|
||||||
{
|
{
|
||||||
KPROCESS Pcb; /* 000 */
|
KPROCESS Pcb; /* 000 */
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
#define _RTLFUNCS_H
|
#define _RTLFUNCS_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "rtltypes.h"
|
|
||||||
#include "pstypes.h"
|
|
||||||
#include <ntnls.h>
|
#include <ntnls.h>
|
||||||
|
|
||||||
/* PROTOTYPES ****************************************************************/
|
/* PROTOTYPES ****************************************************************/
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#define _RTLTYPES_H
|
#define _RTLTYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "zwtypes.h"
|
|
||||||
#include "excpt.h"
|
#include "excpt.h"
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
@ -52,6 +51,167 @@
|
||||||
#define RTL_RANGE_SHARED 0x01
|
#define RTL_RANGE_SHARED 0x01
|
||||||
#define RTL_RANGE_CONFLICT 0x02
|
#define RTL_RANGE_CONFLICT 0x02
|
||||||
|
|
||||||
|
/* Run-Time Library (RTL) Registry Constants */
|
||||||
|
#define RTL_REGISTRY_ABSOLUTE 0
|
||||||
|
#define RTL_REGISTRY_SERVICES 1
|
||||||
|
#define RTL_REGISTRY_CONTROL 2
|
||||||
|
#define RTL_REGISTRY_WINDOWS_NT 3
|
||||||
|
#define RTL_REGISTRY_DEVICEMAP 4
|
||||||
|
#define RTL_REGISTRY_USER 5
|
||||||
|
#define RTL_REGISTRY_MAXIMUM 6
|
||||||
|
#define RTL_REGISTRY_HANDLE 0x40000000
|
||||||
|
#define RTL_REGISTRY_OPTIONAL 0x80000000
|
||||||
|
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
|
||||||
|
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
|
||||||
|
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
|
||||||
|
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
|
||||||
|
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
|
||||||
|
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020
|
||||||
|
#define RTL_QUERY_REGISTRY_DELETE 0x00000040
|
||||||
|
|
||||||
|
/* Version Constants */
|
||||||
|
#define VER_MINORVERSION 0x0000001
|
||||||
|
#define VER_MAJORVERSION 0x0000002
|
||||||
|
#define VER_BUILDNUMBER 0x0000004
|
||||||
|
#define VER_PLATFORMID 0x0000008
|
||||||
|
#define VER_SERVICEPACKMINOR 0x0000010
|
||||||
|
#define VER_SERVICEPACKMAJOR 0x0000020
|
||||||
|
#define VER_SUITENAME 0x0000040
|
||||||
|
#define VER_PRODUCT_TYPE 0x0000080
|
||||||
|
#define VER_PLATFORM_WIN32s 0
|
||||||
|
#define VER_PLATFORM_WIN32_WINDOWS 1
|
||||||
|
#define VER_PLATFORM_WIN32_NT 2
|
||||||
|
#define VER_EQUAL 1
|
||||||
|
#define VER_GREATER 2
|
||||||
|
#define VER_GREATER_EQUAL 3
|
||||||
|
#define VER_LESS 4
|
||||||
|
#define VER_LESS_EQUAL 5
|
||||||
|
#define VER_AND 6
|
||||||
|
#define VER_OR 7
|
||||||
|
#define VER_CONDITION_MASK 7
|
||||||
|
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
||||||
|
|
||||||
|
/* RTL String Hash Algorithms */
|
||||||
|
#define HASH_STRING_ALGORITHM_DEFAULT 0
|
||||||
|
#define HASH_STRING_ALGORITHM_X65599 1
|
||||||
|
#define HASH_STRING_ALGORITHM_INVALID 0xffffffff
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
/* List Macros */
|
||||||
|
static __inline
|
||||||
|
VOID
|
||||||
|
InitializeListHead(
|
||||||
|
IN PLIST_ENTRY ListHead)
|
||||||
|
{
|
||||||
|
ListHead->Flink = ListHead->Blink = ListHead;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline
|
||||||
|
VOID
|
||||||
|
InsertHeadList(
|
||||||
|
IN PLIST_ENTRY ListHead,
|
||||||
|
IN PLIST_ENTRY Entry)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY OldFlink;
|
||||||
|
OldFlink = ListHead->Flink;
|
||||||
|
Entry->Flink = OldFlink;
|
||||||
|
Entry->Blink = ListHead;
|
||||||
|
OldFlink->Blink = Entry;
|
||||||
|
ListHead->Flink = Entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline
|
||||||
|
VOID
|
||||||
|
InsertTailList(
|
||||||
|
IN PLIST_ENTRY ListHead,
|
||||||
|
IN PLIST_ENTRY Entry)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY OldBlink;
|
||||||
|
OldBlink = ListHead->Blink;
|
||||||
|
Entry->Flink = ListHead;
|
||||||
|
Entry->Blink = OldBlink;
|
||||||
|
OldBlink->Flink = Entry;
|
||||||
|
ListHead->Blink = Entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define IsListEmpty(ListHead) \
|
||||||
|
((ListHead)->Flink == (ListHead))
|
||||||
|
|
||||||
|
#define PopEntryList(ListHead) \
|
||||||
|
(ListHead)->Next; \
|
||||||
|
{ \
|
||||||
|
PSINGLE_LIST_ENTRY _FirstEntry; \
|
||||||
|
_FirstEntry = (ListHead)->Next; \
|
||||||
|
if (_FirstEntry != NULL) \
|
||||||
|
(ListHead)->Next = _FirstEntry->Next; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define PushEntryList(_ListHead, _Entry) \
|
||||||
|
(_Entry)->Next = (_ListHead)->Next; \
|
||||||
|
(_ListHead)->Next = (_Entry); \
|
||||||
|
|
||||||
|
static __inline
|
||||||
|
BOOLEAN
|
||||||
|
RemoveEntryList(
|
||||||
|
IN PLIST_ENTRY Entry)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY OldFlink;
|
||||||
|
PLIST_ENTRY OldBlink;
|
||||||
|
|
||||||
|
OldFlink = Entry->Flink;
|
||||||
|
OldBlink = Entry->Blink;
|
||||||
|
OldFlink->Blink = OldBlink;
|
||||||
|
OldBlink->Flink = OldFlink;
|
||||||
|
return (OldFlink == OldBlink);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline
|
||||||
|
PLIST_ENTRY
|
||||||
|
RemoveHeadList(
|
||||||
|
IN PLIST_ENTRY ListHead)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY Flink;
|
||||||
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
|
Entry = ListHead->Flink;
|
||||||
|
Flink = Entry->Flink;
|
||||||
|
ListHead->Flink = Flink;
|
||||||
|
Flink->Blink = ListHead;
|
||||||
|
return Entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline
|
||||||
|
PLIST_ENTRY
|
||||||
|
RemoveTailList(
|
||||||
|
IN PLIST_ENTRY ListHead)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY Blink;
|
||||||
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
|
Entry = ListHead->Blink;
|
||||||
|
Blink = Entry->Blink;
|
||||||
|
ListHead->Blink = Blink;
|
||||||
|
Blink->Flink = ListHead;
|
||||||
|
return Entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define IsFirstEntry(ListHead, Entry) \
|
||||||
|
((ListHead)->Flink == Entry)
|
||||||
|
|
||||||
|
#define IsLastEntry(ListHead, Entry) \
|
||||||
|
((ListHead)->Blink == Entry)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constant String Macro
|
||||||
|
*/
|
||||||
|
#define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
|
||||||
|
{ \
|
||||||
|
sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
|
||||||
|
sizeof(__SOURCE_STRING__), \
|
||||||
|
(__SOURCE_STRING__) \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* FIXME: Rename these */
|
/* FIXME: Rename these */
|
||||||
#define PDI_MODULES 0x01 /* The loaded modules of the process */
|
#define PDI_MODULES 0x01 /* The loaded modules of the process */
|
||||||
#define PDI_BACKTRACE 0x02 /* The heap stack back traces */
|
#define PDI_BACKTRACE 0x02 /* The heap stack back traces */
|
||||||
|
@ -68,6 +228,21 @@
|
||||||
|
|
||||||
/* ENUMERATIONS **************************************************************/
|
/* ENUMERATIONS **************************************************************/
|
||||||
|
|
||||||
|
typedef enum _TABLE_SEARCH_RESULT
|
||||||
|
{
|
||||||
|
TableEmptyTree,
|
||||||
|
TableFoundNode,
|
||||||
|
TableInsertAsLeft,
|
||||||
|
TableInsertAsRight
|
||||||
|
} TABLE_SEARCH_RESULT;
|
||||||
|
|
||||||
|
typedef enum _RTL_GENERIC_COMPARE_RESULTS
|
||||||
|
{
|
||||||
|
GenericLessThan,
|
||||||
|
GenericGreaterThan,
|
||||||
|
GenericEqual
|
||||||
|
} RTL_GENERIC_COMPARE_RESULTS;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
INVALID_PATH = 0,
|
INVALID_PATH = 0,
|
||||||
|
@ -81,6 +256,10 @@ typedef enum
|
||||||
} DOS_PATHNAME_TYPE;
|
} DOS_PATHNAME_TYPE;
|
||||||
|
|
||||||
/* FUNCTION TYPES ************************************************************/
|
/* FUNCTION TYPES ************************************************************/
|
||||||
|
struct _RTL_AVL_TABLE;
|
||||||
|
struct _RTL_GENERIC_TABLE;
|
||||||
|
struct _RTL_RANGE;
|
||||||
|
|
||||||
typedef NTSTATUS
|
typedef NTSTATUS
|
||||||
(*PHEAP_ENUMERATION_ROUTINE)(
|
(*PHEAP_ENUMERATION_ROUTINE)(
|
||||||
IN PVOID HeapHandle,
|
IN PVOID HeapHandle,
|
||||||
|
@ -109,18 +288,219 @@ typedef VOID
|
||||||
PVOID Parameter
|
PVOID Parameter
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef NTSTATUS
|
||||||
|
(NTAPI *PRTL_AVL_MATCH_FUNCTION)(
|
||||||
|
struct _RTL_AVL_TABLE *Table,
|
||||||
|
PVOID UserData,
|
||||||
|
PVOID MatchData
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
||||||
|
(NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
|
||||||
|
struct _RTL_AVL_TABLE *Table,
|
||||||
|
PVOID FirstStruct,
|
||||||
|
PVOID SecondStruct
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
||||||
|
(NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
|
||||||
|
struct _RTL_GENERIC_TABLE *Table,
|
||||||
|
PVOID FirstStruct,
|
||||||
|
PVOID SecondStruct
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef PVOID
|
||||||
|
(NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
|
||||||
|
struct _RTL_GENERIC_TABLE *Table,
|
||||||
|
LONG ByteSize
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
|
||||||
|
struct _RTL_GENERIC_TABLE *Table,
|
||||||
|
PVOID Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
|
||||||
|
struct _RTL_AVL_TABLE *Table,
|
||||||
|
LONG ByteSize
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef VOID
|
||||||
|
(NTAPI *PRTL_AVL_FREE_ROUTINE) (
|
||||||
|
struct _RTL_AVL_TABLE *Table,
|
||||||
|
PVOID Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef NTSTATUS
|
||||||
|
(NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
|
||||||
|
IN PWSTR ValueName,
|
||||||
|
IN ULONG ValueType,
|
||||||
|
IN PVOID ValueData,
|
||||||
|
IN ULONG ValueLength,
|
||||||
|
IN PVOID Context,
|
||||||
|
IN PVOID EntryContext
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef NTSTATUS
|
||||||
|
(NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
|
||||||
|
IN PVOID Base,
|
||||||
|
IN OUT PVOID *CommitAddress,
|
||||||
|
IN OUT PSIZE_T CommitSize
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef BOOLEAN
|
||||||
|
(NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
|
||||||
|
PVOID Context,
|
||||||
|
struct _RTL_RANGE *Range
|
||||||
|
);
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
typedef unsigned short RTL_ATOM;
|
#ifdef NTOS_MODE_USER
|
||||||
typedef unsigned short *PRTL_ATOM;
|
typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
|
||||||
|
typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
|
||||||
|
typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
|
||||||
|
typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
|
||||||
|
|
||||||
/* Once again, we don't want to force NTIFS for something like this */
|
typedef struct _RTL_HEAP_PARAMETERS
|
||||||
#if !defined(_NTIFS_) && !defined(NTOS_MODE_USER)
|
{
|
||||||
typedef PVOID PRTL_HEAP_PARAMETERS;
|
ULONG Length;
|
||||||
#endif
|
SIZE_T SegmentReserve;
|
||||||
|
SIZE_T SegmentCommit;
|
||||||
|
SIZE_T DeCommitFreeBlockThreshold;
|
||||||
|
SIZE_T DeCommitTotalFreeThreshold;
|
||||||
|
SIZE_T MaximumAllocationSize;
|
||||||
|
SIZE_T VirtualMemoryThreshold;
|
||||||
|
SIZE_T InitialCommit;
|
||||||
|
SIZE_T InitialReserve;
|
||||||
|
PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
|
||||||
|
SIZE_T Reserved[2];
|
||||||
|
} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
|
||||||
|
|
||||||
|
typedef struct _RTL_BITMAP
|
||||||
|
{
|
||||||
|
ULONG SizeOfBitMap;
|
||||||
|
PULONG Buffer;
|
||||||
|
} RTL_BITMAP, *PRTL_BITMAP;
|
||||||
|
|
||||||
|
typedef struct _RTL_BITMAP_RUN
|
||||||
|
{
|
||||||
|
ULONG StartingIndex;
|
||||||
|
ULONG NumberOfBits;
|
||||||
|
} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
|
||||||
|
|
||||||
|
typedef struct _COMPRESSED_DATA_INFO
|
||||||
|
{
|
||||||
|
USHORT CompressionFormatAndEngine;
|
||||||
|
UCHAR CompressionUnitShift;
|
||||||
|
UCHAR ChunkShift;
|
||||||
|
UCHAR ClusterShift;
|
||||||
|
UCHAR Reserved;
|
||||||
|
USHORT NumberOfChunks;
|
||||||
|
ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
|
||||||
|
} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
|
||||||
|
|
||||||
|
typedef struct _GENERATE_NAME_CONTEXT
|
||||||
|
{
|
||||||
|
USHORT Checksum;
|
||||||
|
BOOLEAN CheckSumInserted;
|
||||||
|
UCHAR NameLength;
|
||||||
|
WCHAR NameBuffer[8];
|
||||||
|
ULONG ExtensionLength;
|
||||||
|
WCHAR ExtensionBuffer[4];
|
||||||
|
ULONG LastIndexValue;
|
||||||
|
} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
|
||||||
|
|
||||||
|
typedef struct _RTL_SPLAY_LINKS
|
||||||
|
{
|
||||||
|
struct _RTL_SPLAY_LINKS *Parent;
|
||||||
|
struct _RTL_SPLAY_LINKS *LeftChild;
|
||||||
|
struct _RTL_SPLAY_LINKS *RightChild;
|
||||||
|
} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
|
||||||
|
|
||||||
typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
|
typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
|
||||||
typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
|
typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _RTL_GENERIC_TABLE
|
||||||
|
{
|
||||||
|
PRTL_SPLAY_LINKS TableRoot;
|
||||||
|
LIST_ENTRY InsertOrderList;
|
||||||
|
PLIST_ENTRY OrderedPointer;
|
||||||
|
ULONG WhichOrderedElement;
|
||||||
|
ULONG NumberGenericTableElements;
|
||||||
|
PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
|
||||||
|
PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
|
||||||
|
PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
|
||||||
|
PVOID TableContext;
|
||||||
|
} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
|
||||||
|
|
||||||
|
typedef struct _RTL_BALANCED_LINKS
|
||||||
|
{
|
||||||
|
struct _RTL_BALANCED_LINKS *Parent;
|
||||||
|
struct _RTL_BALANCED_LINKS *LeftChild;
|
||||||
|
struct _RTL_BALANCED_LINKS *RightChild;
|
||||||
|
CHAR Balance;
|
||||||
|
UCHAR Reserved[3];
|
||||||
|
} RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
|
||||||
|
|
||||||
|
typedef struct _RTL_AVL_TABLE
|
||||||
|
{
|
||||||
|
RTL_BALANCED_LINKS BalancedRoot;
|
||||||
|
PVOID OrderedPointer;
|
||||||
|
ULONG WhichOrderedElement;
|
||||||
|
ULONG NumberGenericTableElements;
|
||||||
|
ULONG DepthOfTree;
|
||||||
|
PRTL_BALANCED_LINKS RestartKey;
|
||||||
|
ULONG DeleteCount;
|
||||||
|
PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
|
||||||
|
PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
|
||||||
|
PRTL_AVL_FREE_ROUTINE FreeRoutine;
|
||||||
|
PVOID TableContext;
|
||||||
|
} RTL_AVL_TABLE, *PRTL_AVL_TABLE;
|
||||||
|
|
||||||
|
typedef struct _RTL_QUERY_REGISTRY_TABLE
|
||||||
|
{
|
||||||
|
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
|
||||||
|
ULONG Flags;
|
||||||
|
PWSTR Name;
|
||||||
|
PVOID EntryContext;
|
||||||
|
ULONG DefaultType;
|
||||||
|
PVOID DefaultData;
|
||||||
|
ULONG DefaultLength;
|
||||||
|
} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
|
||||||
|
|
||||||
|
typedef struct _UNICODE_PREFIX_TABLE_ENTRY
|
||||||
|
{
|
||||||
|
CSHORT NodeTypeCode;
|
||||||
|
CSHORT NameLength;
|
||||||
|
struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
|
||||||
|
struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
|
||||||
|
RTL_SPLAY_LINKS Links;
|
||||||
|
PUNICODE_STRING Prefix;
|
||||||
|
} UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
|
||||||
|
|
||||||
|
typedef struct _UNICODE_PREFIX_TABLE
|
||||||
|
{
|
||||||
|
CSHORT NodeTypeCode;
|
||||||
|
CSHORT NameLength;
|
||||||
|
PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
|
||||||
|
PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
|
||||||
|
} UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
|
||||||
|
|
||||||
|
typedef struct _TIME_FIELDS
|
||||||
|
{
|
||||||
|
CSHORT Year;
|
||||||
|
CSHORT Month;
|
||||||
|
CSHORT Day;
|
||||||
|
CSHORT Hour;
|
||||||
|
CSHORT Minute;
|
||||||
|
CSHORT Second;
|
||||||
|
CSHORT Milliseconds;
|
||||||
|
CSHORT Weekday;
|
||||||
|
} TIME_FIELDS, *PTIME_FIELDS;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _ACE
|
typedef struct _ACE
|
||||||
{
|
{
|
||||||
ACE_HEADER Header;
|
ACE_HEADER Header;
|
||||||
|
@ -269,12 +649,6 @@ typedef struct _RTL_RANGE
|
||||||
UCHAR Flags; /* RTL_RANGE_... flags */
|
UCHAR Flags; /* RTL_RANGE_... flags */
|
||||||
} RTL_RANGE, *PRTL_RANGE;
|
} RTL_RANGE, *PRTL_RANGE;
|
||||||
|
|
||||||
typedef BOOLEAN
|
|
||||||
(NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
|
|
||||||
PVOID Context,
|
|
||||||
PRTL_RANGE Range
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef struct _RTL_RESOURCE
|
typedef struct _RTL_RESOURCE
|
||||||
{
|
{
|
||||||
RTL_CRITICAL_SECTION Lock;
|
RTL_CRITICAL_SECTION Lock;
|
||||||
|
@ -381,6 +755,10 @@ typedef struct _RTL_ATOM_TABLE_ENTRY
|
||||||
WCHAR Name[1];
|
WCHAR Name[1];
|
||||||
} RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
|
} RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
|
||||||
|
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef RTL_CRITICAL_SECTION FAST_MUTEX;
|
||||||
|
typedef RTL_HANDLE_TABLE HANDLE_TABLE, *PHANDLE_TABLE;
|
||||||
|
#endif
|
||||||
typedef struct _RTL_ATOM_TABLE
|
typedef struct _RTL_ATOM_TABLE
|
||||||
{
|
{
|
||||||
ULONG Signature;
|
ULONG Signature;
|
||||||
|
|
|
@ -8,9 +8,6 @@
|
||||||
#define _UMFUNCS_H
|
#define _UMFUNCS_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "ldrtypes.h"
|
|
||||||
#include "lpctypes.h"
|
|
||||||
#include "rtltypes.h"
|
|
||||||
|
|
||||||
/* PROTOTYPES ****************************************************************/
|
/* PROTOTYPES ****************************************************************/
|
||||||
|
|
||||||
|
@ -28,6 +25,7 @@ CsrClientConnectToServer(
|
||||||
PBOOLEAN ServerToServerCall
|
PBOOLEAN ServerToServerCall
|
||||||
);
|
);
|
||||||
|
|
||||||
|
struct _CSR_API_MESSAGE;
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDCALL
|
STDCALL
|
||||||
CsrClientCallServer(
|
CsrClientCallServer(
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -10,9 +10,6 @@
|
||||||
#define _ZWFUNCS_H
|
#define _ZWFUNCS_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "lpctypes.h"
|
|
||||||
#include "zwtypes.h"
|
|
||||||
#include "kdtypes.h"
|
|
||||||
#define _WMIKM_
|
#define _WMIKM_
|
||||||
#include <evntrace.h>
|
#include <evntrace.h>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#define _ZWTYPES_H
|
#define _ZWTYPES_H
|
||||||
|
|
||||||
/* DEPENDENCIES **************************************************************/
|
/* DEPENDENCIES **************************************************************/
|
||||||
#include "rtltypes.h"
|
|
||||||
#include <cfg.h>
|
#include <cfg.h>
|
||||||
|
|
||||||
/* EXPORTED DATA *************************************************************/
|
/* EXPORTED DATA *************************************************************/
|
||||||
|
@ -285,8 +284,8 @@ typedef enum _PLUGPLAY_CONTROL_CLASS
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
|
||||||
typedef unsigned short LANGID;
|
typedef USHORT LANGID, *PLANGID;
|
||||||
typedef LANGID *PLANGID;
|
typedef USHORT RTL_ATOM, *PRTL_ATOM;
|
||||||
|
|
||||||
typedef struct _PLUGPLAY_EVENT_BLOCK
|
typedef struct _PLUGPLAY_EVENT_BLOCK
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,6 +115,9 @@ typedef unsigned __int64 UINT64, *PUINT64;
|
||||||
typedef signed short INT16, *PINT16;
|
typedef signed short INT16, *PINT16;
|
||||||
typedef unsigned short UINT16, *PUINT16;
|
typedef unsigned short UINT16, *PUINT16;
|
||||||
|
|
||||||
|
typedef ULONG_PTR KAFFINITY;
|
||||||
|
typedef KAFFINITY *PKAFFINITY;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3338,6 +3338,7 @@ typedef struct _SYSTEM_BATTERY_STATE {
|
||||||
ULONG DefaultAlert2;
|
ULONG DefaultAlert2;
|
||||||
} SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE;
|
} SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE;
|
||||||
|
|
||||||
|
typedef DWORD EXECUTION_STATE;
|
||||||
typedef enum _POWER_INFORMATION_LEVEL {
|
typedef enum _POWER_INFORMATION_LEVEL {
|
||||||
SystemPowerPolicyAc,
|
SystemPowerPolicyAc,
|
||||||
SystemPowerPolicyDc,
|
SystemPowerPolicyDc,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue