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_
|
|
|
|
|
2010-04-10 11:32:36 +00:00
|
|
|
#define WDM_MAJORVERSION 0x06
|
|
|
|
#define WDM_MINORVERSION 0x00
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
/* 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
|
|
|
|
|
2010-03-23 19:24:29 +00:00
|
|
|
#ifdef _MAC
|
|
|
|
#ifndef _INC_STRING
|
|
|
|
#include <string.h>
|
|
|
|
#endif /* _INC_STRING */
|
|
|
|
#else
|
|
|
|
#include <string.h>
|
|
|
|
#endif /* _MAC */
|
|
|
|
|
[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)
|
|
|
|
|
2010-03-23 18:34:15 +00:00
|
|
|
/* Disable some warnings */
|
|
|
|
#pragma warning(disable:4115) /* Named type definition in parentheses */
|
|
|
|
#pragma warning(disable:4201) /* Nameless unions and structs */
|
|
|
|
#pragma warning(disable:4214) /* Bit fields of other types than int */
|
|
|
|
#pragma warning(disable:4820) /* Padding added, due to alignemnet requirement */
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
/* 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
|
|
|
|
|
2010-04-10 11:32:36 +00:00
|
|
|
#if defined(_WIN64)
|
|
|
|
#if !defined(USE_DMA_MACROS) && !defined(_NTHAL_)
|
|
|
|
#define USE_DMA_MACROS
|
|
|
|
#endif
|
2010-06-26 10:27:25 +00:00
|
|
|
#if !defined(NO_LEGACY_DRIVERS) && !defined(__REACTOS__)
|
2010-04-10 11:32:36 +00:00
|
|
|
#define NO_LEGACY_DRIVERS
|
|
|
|
#endif
|
|
|
|
#endif /* defined(_WIN64) */
|
|
|
|
|
2010-03-13 00:34:48 +00:00
|
|
|
/* 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;
|
|
|
|
|
2010-04-10 11:32:36 +00:00
|
|
|
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_)
|
[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
|
|
|
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-23 19:24:29 +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
|
|
|
|
|
|
|
|
/* 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__ */
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !_WDMDDK_ */
|