2010-03-13 00:34:48 +00:00
|
|
|
/*
|
|
|
|
* wdm.h
|
|
|
|
*
|
|
|
|
* Windows NT WDM Driver Developer Kit
|
|
|
|
*
|
|
|
|
* This file is part of the ReactOS DDK package.
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* Amine Khaldi
|
|
|
|
* Timo Kreuzer (timo.kreuzer@reactos.org)
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
|
|
|
*
|
|
|
|
* This source code is offered for use in the public domain. You may
|
|
|
|
* use, modify or distribute it freely.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful but
|
|
|
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
|
|
|
* DISCLAIMED. This includes but is not limited to warranties of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef _WDMDDK_
|
|
|
|
#define _WDMDDK_
|
|
|
|
|
|
|
|
/* Included via ntddk.h? */
|
|
|
|
#ifndef _NTDDK_
|
|
|
|
#define _NTDDK_
|
|
|
|
#define _WDM_INCLUDED_
|
|
|
|
#define _DDK_DRIVER_
|
|
|
|
#define NO_INTERLOCKED_INTRINSICS
|
|
|
|
#endif /* _NTDDK_ */
|
|
|
|
|
|
|
|
/* Dependencies */
|
|
|
|
#define NT_INCLUDED
|
|
|
|
#include <excpt.h>
|
|
|
|
#include <ntdef.h>
|
|
|
|
#include <ntstatus.h>
|
2010-03-18 14:14:27 +00:00
|
|
|
#include <ntiologc.h>
|
2010-03-13 00:34:48 +00:00
|
|
|
|
[EXT2FSD]
- Remove a couple of duplicate definitions (that exist now in wdm.h).
[XDK]
- Move several definitions to their appropriate places.
- Group some related definitions.
- Add vKdPrintEx, DEFINE_GUIDEX, STATICGUIDOF, RTLVERLIB_DDI, LOWBYTE_MASK, FIRSTBYTE, SECONDBYTE, THIRDBYTE, FOURTHBYTE and several missing TRANSACTIONMANAGER_*, TRANSACTION_*, RESOURCEMANAGER_*, ENLISTMENT_*, PFN_NT_*, Nt*, SHORT_*, LONG_*, PFN_RTL_*, LONGLONG_* and Rtl* definitions.
- Fix RtlCheckBit definition.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46276
2010-03-19 20:01:04 +00:00
|
|
|
#ifndef GUID_DEFINED
|
|
|
|
#include <guiddef.h>
|
|
|
|
#endif
|
|
|
|
|
[PSDK]
- Add devpropdef.h and evntprov.h
- Fix UOW redefinition.
[DDK]
- Fix PGUID redefinition.
[XDK]
- Add wmitypes.h and include it in wdm.h autogeneration template.
- Move several definitions to their appropriate places.
- Add HalGetDmaAlignment, LEGACY_BUS_INFORMATION, IO_DEVICE_EJECT_CALLBACK, PLUGPLAY_PROPERTY_PERSISTENT, and several missing Io*, DEVICE_*, REENUMERATE_*, PCI_*, PNP_*, Ob*, OB_*, PO_*, Wmi*, Etw* and ACPI related definitions.
- Add CmKeyObjectType to exported object types.
- Fix UOW redefinition.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46329
2010-03-22 01:00:05 +00:00
|
|
|
#ifndef _KTMTYPES_
|
|
|
|
typedef GUID UOW, *PUOW;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef GUID *PGUID;
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
|
|
|
#include <dpfilter.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "intrin.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(_NTHALDLL_) && !defined(_BLDR_)
|
|
|
|
#define NTHALAPI DECLSPEC_IMPORT
|
|
|
|
#else
|
|
|
|
#define NTHALAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* For ReactOS */
|
|
|
|
#if !defined(_NTOSKRNL_) && !defined(_BLDR_)
|
|
|
|
#define NTKERNELAPI DECLSPEC_IMPORT
|
|
|
|
#else
|
|
|
|
#define NTKERNELAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_X86_) && !defined(_NTHAL_)
|
|
|
|
#define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT
|
|
|
|
#elif defined(_X86_)
|
|
|
|
#define _DECL_HAL_KE_IMPORT
|
|
|
|
#else
|
|
|
|
#define _DECL_HAL_KE_IMPORT NTKERNELAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_WIN64)
|
|
|
|
#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
|
|
|
|
#else
|
|
|
|
#define POINTER_ALIGNMENT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Helper macro to enable gcc's extension. */
|
|
|
|
#ifndef __GNU_EXTENSION
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define __GNU_EXTENSION __extension__
|
|
|
|
#else
|
|
|
|
#define __GNU_EXTENSION
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
|
|
|
|
/* Indicate if #pragma alloc_text() is supported */
|
|
|
|
#if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_IA64)
|
|
|
|
#define ALLOC_PRAGMA 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Indicate if #pragma data_seg() is supported */
|
|
|
|
#if defined(_M_IX86) || defined(_M_AMD64)
|
|
|
|
#define ALLOC_DATA_PRAGMA 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Forward declarations */
|
|
|
|
struct _IRP;
|
|
|
|
struct _MDL;
|
|
|
|
struct _KAPC;
|
|
|
|
struct _KDPC;
|
|
|
|
struct _FILE_OBJECT;
|
|
|
|
struct _DMA_ADAPTER;
|
|
|
|
struct _DEVICE_OBJECT;
|
|
|
|
struct _DRIVER_OBJECT;
|
|
|
|
struct _IO_STATUS_BLOCK;
|
|
|
|
struct _DEVICE_DESCRIPTION;
|
|
|
|
struct _SCATTER_GATHER_LIST;
|
|
|
|
struct _DRIVE_LAYOUT_INFORMATION;
|
|
|
|
struct _COMPRESSED_DATA_INFO;
|
|
|
|
struct _IO_RESOURCE_DESCRIPTOR;
|
|
|
|
|
|
|
|
/* Structures not exposed to drivers */
|
|
|
|
typedef struct _OBJECT_TYPE *POBJECT_TYPE;
|
|
|
|
typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE;
|
|
|
|
typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
|
|
|
|
typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
|
|
|
|
typedef struct _EPROCESS *PEPROCESS;
|
2010-03-17 11:07:59 +00:00
|
|
|
typedef struct _ETHREAD *PETHREAD;
|
2010-03-13 00:34:48 +00:00
|
|
|
typedef struct _IO_TIMER *PIO_TIMER;
|
|
|
|
typedef struct _KINTERRUPT *PKINTERRUPT;
|
|
|
|
typedef struct _KPROCESS *PKPROCESS;
|
|
|
|
typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
|
|
|
|
typedef struct _CONTEXT *PCONTEXT;
|
|
|
|
|
[DDK]
- Fix PIO_CSQ_INSERT_IRP_EX redefinition.
[NTDDK]
- Remove a couple of duplicate definitions.
[XDK]
- Move several definitions to their appropriate places.
- Add COMPUTE_PAGES_SPANNED, NODE_REQUIREMENT, MM_ANY_NODE_OK, PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR, PsWrapApcWow64Thread, IRP_MN_DEVICE_ENUMERATED, USE_DMA_MACROS, NO_LEGACY_DRIVERS, FO_FLAGS_VALID_ONLY_DURING_CREATE, LOADER_PARTITION_INFORMATION_EX, BOOTDISK_INFORMATION_LITE, IO_CSQ_INSERT_IRP_EX, STATUS_CONTINUE_COMPLETION and several missing Ex*, REG_*, Cm*, Mm*, SL_*, Io*, IO_*, CONNECT_*, WDM_* and WMI* definitions.
- Update ExGetCurrentResourceThread and PADAPTER_OBJECT.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46290
2010-03-20 23:01:57 +00:00
|
|
|
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && ( defined(_NTDDK_) || defined(_NTDRIVER_) || defined(_NTOSP_))
|
|
|
|
typedef struct _DMA_ADAPTER *PADAPTER_OBJECT;
|
|
|
|
#elif defined(_WDM_INCLUDED_)
|
|
|
|
typedef struct _DMA_ADAPTER *PADAPTER_OBJECT;
|
|
|
|
#else
|
|
|
|
typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
|
|
|
|
#endif
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
$define (_WDMDDK_)
|
|
|
|
$include (interlocked.h)
|
|
|
|
$include (rtltypes.h)
|
|
|
|
$include (ketypes.h)
|
|
|
|
$include (mmtypes.h)
|
|
|
|
$include (extypes.h)
|
|
|
|
$include (setypes.h)
|
|
|
|
$include (potypes.h)
|
|
|
|
$include (cmtypes.h)
|
|
|
|
$include (iotypes.h)
|
|
|
|
$include (obtypes.h)
|
|
|
|
$include (pstypes.h)
|
[PSDK]
- Add devpropdef.h and evntprov.h
- Fix UOW redefinition.
[DDK]
- Fix PGUID redefinition.
[XDK]
- Add wmitypes.h and include it in wdm.h autogeneration template.
- Move several definitions to their appropriate places.
- Add HalGetDmaAlignment, LEGACY_BUS_INFORMATION, IO_DEVICE_EJECT_CALLBACK, PLUGPLAY_PROPERTY_PERSISTENT, and several missing Io*, DEVICE_*, REENUMERATE_*, PCI_*, PNP_*, Ob*, OB_*, PO_*, Wmi*, Etw* and ACPI related definitions.
- Add CmKeyObjectType to exported object types.
- Fix UOW redefinition.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46329
2010-03-22 01:00:05 +00:00
|
|
|
$include (wmitypes.h)
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#if defined(_M_IX86)
|
|
|
|
$include(x86/ke.h)
|
|
|
|
#elif defined(_M_AMD64)
|
|
|
|
$include(amd64/ke.h)
|
|
|
|
#elif defined(_M_IA64)
|
|
|
|
$include(ia64/ke.h)
|
|
|
|
#elif defined(_M_PPC)
|
|
|
|
$include(ppc/ke.h)
|
|
|
|
#elif defined(_M_MIPS)
|
|
|
|
$include(mips/ke.h)
|
|
|
|
#elif defined(_M_ARM)
|
|
|
|
$include(arm/ke.h)
|
|
|
|
#else
|
|
|
|
#error Unknown Architecture
|
|
|
|
#endif
|
|
|
|
|
|
|
|
$include (rtlfuncs.h)
|
|
|
|
$include (kefuncs.h)
|
|
|
|
$include (mmfuncs.h)
|
|
|
|
$include (sefuncs.h)
|
|
|
|
$include (cmfuncs.h)
|
|
|
|
$include (iofuncs.h)
|
|
|
|
$include (pofuncs.h)
|
|
|
|
$include (exfuncs.h)
|
|
|
|
$include (obfuncs.h)
|
|
|
|
$include (psfuncs.h)
|
|
|
|
$include (wmifuncs.h)
|
|
|
|
$include (kdfuncs.h)
|
|
|
|
$include (halfuncs.h)
|
|
|
|
$include (nttmapi.h)
|
|
|
|
$include (zwfuncs.h)
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* Unsorted *
|
|
|
|
******************************************************************************/
|
|
|
|
|
[XDK]
- Move several definitions to their appropriate places.
- Add DEVICE_FLAGS, InitializeListHead32, AppendTailList, RTL_QUERY_REGISTRY_NOSTRING, NT_VERIFY, NT_VERIFYMSG, NT_VERIFYMSGW, SLIST_ENTRY32, SLIST_HEADER32 and several missing SERVICE_*, CM_*, EISA_* and IRQ_*.
- Update SLIST_HEADER.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46273
2010-03-19 14:10:13 +00:00
|
|
|
#ifdef _MAC
|
|
|
|
|
|
|
|
#ifndef _INC_STRING
|
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
|
|
|
#include <string.h>
|
|
|
|
#endif /* _MAC */
|
|
|
|
|
[EXT2FSD]
- Remove a couple of duplicate definitions (that exist now in wdm.h).
[XDK]
- Move several definitions to their appropriate places.
- Group some related definitions.
- Add vKdPrintEx, DEFINE_GUIDEX, STATICGUIDOF, RTLVERLIB_DDI, LOWBYTE_MASK, FIRSTBYTE, SECONDBYTE, THIRDBYTE, FOURTHBYTE and several missing TRANSACTIONMANAGER_*, TRANSACTION_*, RESOURCEMANAGER_*, ENLISTMENT_*, PFN_NT_*, Nt*, SHORT_*, LONG_*, PFN_RTL_*, LONGLONG_* and Rtl* definitions.
- Fix RtlCheckBit definition.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46276
2010-03-19 20:01:04 +00:00
|
|
|
#ifndef DEFINE_GUIDEX
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
|
|
|
|
#else
|
|
|
|
#define DEFINE_GUIDEX(name) EXTERN_C const GUID name
|
|
|
|
#endif
|
|
|
|
#endif /* DEFINE_GUIDEX */
|
|
|
|
|
|
|
|
#ifndef STATICGUIDOF
|
|
|
|
#define STATICGUIDOF(guid) STATIC_##guid
|
|
|
|
#endif
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
/* GUID Comparison */
|
|
|
|
#ifndef __IID_ALIGNED__
|
|
|
|
#define __IID_ALIGNED__
|
|
|
|
#ifdef __cplusplus
|
|
|
|
inline int IsEqualGUIDAligned(REFGUID guid1, REFGUID guid2)
|
|
|
|
{
|
|
|
|
return ( (*(PLONGLONG)(&guid1) == *(PLONGLONG)(&guid2)) &&
|
|
|
|
(*((PLONGLONG)(&guid1) + 1) == *((PLONGLONG)(&guid2) + 1)) );
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define IsEqualGUIDAligned(guid1, guid2) \
|
|
|
|
( (*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && \
|
|
|
|
(*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1)) )
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* !__IID_ALIGNED__ */
|
|
|
|
|
|
|
|
#define MAXIMUM_SUSPEND_COUNT MAXCHAR
|
|
|
|
|
|
|
|
#define MAXIMUM_FILENAME_LENGTH 256
|
|
|
|
|
|
|
|
#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
|
|
|
|
|
|
|
|
#define OBJECT_TYPE_CREATE (0x0001)
|
|
|
|
#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
|
|
|
|
|
|
|
|
#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)
|
|
|
|
|
|
|
|
#define SYMBOLIC_LINK_QUERY 0x0001
|
|
|
|
#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
|
|
|
|
|
|
|
|
#define DUPLICATE_CLOSE_SOURCE 0x00000001
|
|
|
|
#define DUPLICATE_SAME_ACCESS 0x00000002
|
|
|
|
#define DUPLICATE_SAME_ATTRIBUTES 0x00000004
|
|
|
|
|
|
|
|
/* Global debug flag */
|
[XDK]
- Move several definitions to their appropriate places.
- Add FIELD_OFFSET, FIELD_SIZE, POOL_TAGGING, IF_DEBUG, IF_NTOS_DEBUG, LOOKASIDE_CHECK, KIPI_COUNTS, KTIMER_ACTUAL_LENGTH, LOGICAL_PROCESSOR_RELATIONSHIP, LTP_PC_SMT, SYSTEM_LOGICAL_PROCESSOR_INFORMATION, NUMA_NODE_RELATIONSHIP, GROUP_RELATIONSHIP, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, SINGLE_GROUP_LEGACY_API, KMESSAGE_SERVICE_ROUTINE, KSEMAPHORE_ACTUAL_LENGTH and several missing CACHE_*, PROCESSOR_* and KAPC_* definitions.
- Group some related definitions.
- Base several ASSERT_* macros on NT_ASSERT instead of ASSERT.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46284
2010-03-20 11:47:30 +00:00
|
|
|
#if DEVL
|
2010-03-13 00:34:48 +00:00
|
|
|
extern ULONG NtGlobalFlag;
|
[XDK]
- Move several definitions to their appropriate places.
- Add FIELD_OFFSET, FIELD_SIZE, POOL_TAGGING, IF_DEBUG, IF_NTOS_DEBUG, LOOKASIDE_CHECK, KIPI_COUNTS, KTIMER_ACTUAL_LENGTH, LOGICAL_PROCESSOR_RELATIONSHIP, LTP_PC_SMT, SYSTEM_LOGICAL_PROCESSOR_INFORMATION, NUMA_NODE_RELATIONSHIP, GROUP_RELATIONSHIP, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, SINGLE_GROUP_LEGACY_API, KMESSAGE_SERVICE_ROUTINE, KSEMAPHORE_ACTUAL_LENGTH and several missing CACHE_*, PROCESSOR_* and KAPC_* definitions.
- Group some related definitions.
- Base several ASSERT_* macros on NT_ASSERT instead of ASSERT.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46284
2010-03-20 11:47:30 +00:00
|
|
|
#define IF_NTOS_DEBUG(FlagName) if (NtGlobalFlag & (FLG_ ## FlagName))
|
|
|
|
#else
|
|
|
|
#define IF_NTOS_DEBUG(FlagName) if(FALSE)
|
|
|
|
#endif
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifndef _TRACEHANDLE_DEFINED
|
|
|
|
#define _TRACEHANDLE_DEFINED
|
|
|
|
typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
|
|
|
|
#endif
|
|
|
|
|
[DDK]
- Fix PIO_CSQ_INSERT_IRP_EX redefinition.
[NTDDK]
- Remove a couple of duplicate definitions.
[XDK]
- Move several definitions to their appropriate places.
- Add COMPUTE_PAGES_SPANNED, NODE_REQUIREMENT, MM_ANY_NODE_OK, PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR, PsWrapApcWow64Thread, IRP_MN_DEVICE_ENUMERATED, USE_DMA_MACROS, NO_LEGACY_DRIVERS, FO_FLAGS_VALID_ONLY_DURING_CREATE, LOADER_PARTITION_INFORMATION_EX, BOOTDISK_INFORMATION_LITE, IO_CSQ_INSERT_IRP_EX, STATUS_CONTINUE_COMPLETION and several missing Ex*, REG_*, Cm*, Mm*, SL_*, Io*, IO_*, CONNECT_*, WDM_* and WMI* definitions.
- Update ExGetCurrentResourceThread and PADAPTER_OBJECT.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46290
2010-03-20 23:01:57 +00:00
|
|
|
extern PBOOLEAN Mm64BitPhysicalAddress;
|
|
|
|
|
|
|
|
extern PVOID MmBadPointer;
|
2010-03-13 00:34:48 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !_WDMDDK_ */
|