mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 08:54:40 +00:00
b2c1de9860
- Add several missing ntiologc.h definitions. [XDK] - Include ntiologc.h in wdm.h [WDM] - Update wdm.h to reflect XDK changes. svn path=/branches/header-work/; revision=46261
260 lines
6.2 KiB
C
260 lines
6.2 KiB
C
/*
|
|
* 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>
|
|
#include <ntiologc.h>
|
|
|
|
#ifndef GUID_DEFINED
|
|
#include <guiddef.h>
|
|
#endif /* GUID_DEFINED */
|
|
|
|
#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 _ADAPTER_OBJECT *PADAPTER_OBJECT;
|
|
typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
|
|
typedef struct _EPROCESS *PEPROCESS;
|
|
typedef struct _ETHREAD *PETHREAD;
|
|
typedef struct _IO_TIMER *PIO_TIMER;
|
|
typedef struct _KINTERRUPT *PKINTERRUPT;
|
|
typedef struct _KPROCESS *PKPROCESS;
|
|
typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
|
|
typedef struct _CONTEXT *PCONTEXT;
|
|
|
|
|
|
$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)
|
|
|
|
#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 *
|
|
******************************************************************************/
|
|
|
|
/* 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__ */
|
|
|
|
typedef enum {
|
|
LT_DONT_CARE,
|
|
LT_LOWEST_LATENCY
|
|
} LATENCY_TIME;
|
|
|
|
#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 EVENT_QUERY_STATE (0x0001)
|
|
#define EVENT_MODIFY_STATE (0x0002)
|
|
#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
|
|
|
|
#define SEMAPHORE_QUERY_STATE (0x0001)
|
|
#define SEMAPHORE_MODIFY_STATE (0x0002)
|
|
#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3)
|
|
|
|
#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 */
|
|
extern ULONG NtGlobalFlag;
|
|
|
|
/* Service Start Types */
|
|
#define SERVICE_BOOT_START 0x00000000
|
|
#define SERVICE_SYSTEM_START 0x00000001
|
|
#define SERVICE_AUTO_START 0x00000002
|
|
#define SERVICE_DEMAND_START 0x00000003
|
|
#define SERVICE_DISABLED 0x00000004
|
|
|
|
#ifndef _TRACEHANDLE_DEFINED
|
|
#define _TRACEHANDLE_DEFINED
|
|
typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* !_WDMDDK_ */
|