*/
#define DDKAPI __stdcall
#define DDKFASTAPI __fastcall
+#define FASTCALL __fastcall
#define DDKCDECLAPI __cdecl
/* FIXME: REMOVE THIS UNCOMPATIBLE CRUFT!!! */
#endif
#endif
+/*
+ * Alignment Macros
+ */
+#define ALIGN_DOWN(s, t) \
+ ((ULONG)(s) & ~(sizeof(t) - 1))
+
+#define ALIGN_UP(s, t) \
+ (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
+
+#define ALIGN_DOWN_POINTER(p, t) \
+ ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
+
+#define ALIGN_UP_POINTER(p, t) \
+ (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
+
/*
** Forward declarations
*/
struct _DMA_ADAPTER;
struct _DEVICE_OBJECT;
struct _DRIVER_OBJECT;
-struct _SECTION_OBJECT;
struct _IO_STATUS_BLOCK;
struct _DEVICE_DESCRIPTION;
struct _SCATTER_GATHER_LIST;
struct _DRIVE_LAYOUT_INFORMATION;
struct _DRIVE_LAYOUT_INFORMATION_EX;
+typedef PVOID PSECURITY_DESCRIPTOR;
+typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION;
+typedef PVOID PSID;
+
DECLARE_INTERNAL_OBJECT(ADAPTER_OBJECT)
DECLARE_INTERNAL_OBJECT(DMA_ADAPTER)
DECLARE_INTERNAL_OBJECT(IO_STATUS_BLOCK)
-DECLARE_INTERNAL_OBJECT(SECTION_OBJECT)
#if 1
/* FIXME: Unknown definitions */
*/
#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )
-static __inline struct _KPCR * KeGetCurrentKPCR(
- VOID)
-{
- ULONG Value;
-#if defined(__GNUC__)
- __asm__ __volatile__ ("movl %%fs:0x1C, %0\n\t"
- : "=r" (Value)
- : /* no inputs */
- );
-#elif defined(_MSC_VER)
- __asm mov eax, fs:[1Ch]
- __asm mov [Value], eax
-#endif
- return (struct _KPCR *) Value;
-}
-
-static __inline struct _KPRCB * KeGetCurrentPrcb(
- VOID)
-{
- ULONG Value;
-#if defined(__GNUC__)
- __asm__ __volatile__ ("movl %%fs:0x20, %0\n\t"
- : "=r" (Value)
- : /* no inputs */
- );
-#elif defined(_MSC_VER)
- __asm mov eax, fs:[20h]
- __asm mov [Value], eax
-#endif
- return (struct _KPRCB *) Value;
-}
-
/*
** Simple structures
*/
typedef LONG KPRIORITY;
typedef UCHAR KIRQL, *PKIRQL;
typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
-typedef ULONG KAFFINITY, *PKAFFINITY;
typedef UCHAR KPROCESSOR_MODE;
typedef enum _MODE {
#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )
#define ZwCurrentThread() NtCurrentThread()
+#define KERNEL_STACK_SIZE 12288
+#define KERNEL_LARGE_STACK_SIZE 61440
+
+
#define DPFLTR_ERROR_LEVEL 0
#define DPFLTR_WARNING_LEVEL 1
#define DPFLTR_TRACE_LEVEL 2
#define MAXIMUM_WAIT_OBJECTS 64
+#define EX_RUNDOWN_ACTIVE 0x1
+#define EX_RUNDOWN_COUNT_SHIFT 0x1
+#define EX_RUNDOWN_COUNT_INC (1 << EX_RUNDOWN_COUNT_SHIFT)
+
#define METHOD_BUFFERED 0
#define METHOD_IN_DIRECT 1
#define METHOD_OUT_DIRECT 2
#define THREAD_ALERT (0x0004)
+#define FM_LOCK_BIT (0x1)
+#define FM_LOCK_BIT_V (0x0)
+#define FM_LOCK_WAITER_WOKEN (0x2)
+#define FM_LOCK_WAITER_INC (0x4)
+
/* Exported object types */
extern NTOSAPI POBJECT_TYPE ExDesktopObjectType;
extern NTOSAPI POBJECT_TYPE ExEventObjectType;
extern NTOSAPI CCHAR KeNumberProcessors;
#define PROCESSOR_FEATURE_MAX 64
+#define MAX_WOW64_SHARED_ENTRIES 16
typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
{
volatile KSYSTEM_TIME TimeZoneBias;
USHORT ImageNumberLow;
USHORT ImageNumberHigh;
- WCHAR NtSystemRoot[ 260 ];
+ WCHAR NtSystemRoot[260];
ULONG MaxStackTraceDepth;
ULONG CryptoExponent;
ULONG TimeZoneId;
ULONG LargePageMinimum;
- ULONG Reserved2[ 7 ];
+ ULONG Reserved2[7];
NT_PRODUCT_TYPE NtProductType;
BOOLEAN ProductTypeIsValid;
ULONG NtMajorVersion;
ULONG NumberOfPhysicalPages;
BOOLEAN SafeBootMode;
ULONG TraceLogging;
- ULONGLONG Fill0;
- ULONGLONG SystemCall[4];
+ ULONG Fill0;
+ ULONGLONG TestRetInstruction;
+ ULONG SystemCall;
+ ULONG SystemCallReturn;
+ ULONGLONG SystemCallPad[3];
union {
volatile KSYSTEM_TIME TickCount;
volatile ULONG64 TickCountQuad;
};
+ ULONG Cookie;
+ LONGLONG ConsoleSessionForegroundProcessId;
+ ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
+ ULONG UserModeGlobalLogging;
} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
/*
IN PVOID MapRegisterBase,
IN PVOID Context);
+typedef EXCEPTION_DISPOSITION
+(DDKAPI *PEXCEPTION_ROUTINE)(
+ IN struct _EXCEPTION_RECORD *ExceptionRecord,
+ IN PVOID EstablisherFrame,
+ IN OUT struct _CONTEXT *ContextRecord,
+ IN OUT PVOID DispatcherContext);
+
typedef VOID
(DDKAPI *PDRIVER_LIST_CONTROL)(
IN struct _DEVICE_OBJECT *DeviceObject,
IN ULONG Offset,
IN ULONG Length);
+/* PCI_DEVICE_PRESENCE_PARAMETERS.Flags */
+#define PCI_USE_SUBSYSTEM_IDS 0x00000001
+#define PCI_USE_REVISION 0x00000002
+#define PCI_USE_VENDEV_IDS 0x00000004
+#define PCI_USE_CLASS_SUBCLASS 0x00000008
+#define PCI_USE_PROGIF 0x00000010
+#define PCI_USE_LOCAL_BUS 0x00000020
+#define PCI_USE_LOCAL_DEVICE 0x00000040
+
+typedef struct _PCI_DEVICE_PRESENCE_PARAMETERS {
+ ULONG Size;
+ ULONG Flags;
+ USHORT VendorID;
+ USHORT DeviceID;
+ UCHAR RevisionID;
+ USHORT SubVendorID;
+ USHORT SubSystemID;
+ UCHAR BaseClass;
+ UCHAR SubClass;
+ UCHAR ProgIf;
+} PCI_DEVICE_PRESENCE_PARAMETERS, *PPCI_DEVICE_PRESENCE_PARAMETERS;
+
+typedef BOOLEAN
+(DDKAPI *PPCI_IS_DEVICE_PRESENT)(
+ IN USHORT VendorID,
+ IN USHORT DeviceID,
+ IN UCHAR RevisionID,
+ IN USHORT SubVendorID,
+ IN USHORT SubSystemID,
+ IN ULONG Flags);
+
+typedef BOOLEAN
+(DDKAPI *PPCI_IS_DEVICE_PRESENT_EX)(
+ IN PVOID Context,
+ IN PPCI_DEVICE_PRESENCE_PARAMETERS Parameters);
+
typedef union _POWER_STATE {
SYSTEM_POWER_STATE SystemState;
DEVICE_POWER_STATE DeviceState;
PGET_SET_DEVICE_DATA GetBusData;
} BUS_INTERFACE_STANDARD, *PBUS_INTERFACE_STANDARD;
+typedef struct _PCI_DEVICE_PRESENT_INTERFACE {
+ USHORT Size;
+ USHORT Version;
+ PVOID Context;
+ PINTERFACE_REFERENCE InterfaceReference;
+ PINTERFACE_DEREFERENCE InterfaceDereference;
+ PPCI_IS_DEVICE_PRESENT IsDevicePresent;
+ PPCI_IS_DEVICE_PRESENT_EX IsDevicePresentEx;
+} PCI_DEVICE_PRESENT_INTERFACE, *PPCI_DEVICE_PRESENT_INTERFACE;
+
typedef struct _DEVICE_CAPABILITIES {
USHORT Size;
USHORT Version;
(DDKAPI *PKTRANSFER_ROUTINE)(
VOID);
-typedef struct _KAPC {
- CSHORT Type;
- CSHORT Size;
- ULONG Spare0;
- struct _KTHREAD *Thread;
- LIST_ENTRY ApcListEntry;
- PKKERNEL_ROUTINE KernelRoutine;
- PKRUNDOWN_ROUTINE RundownRoutine;
- PKNORMAL_ROUTINE NormalRoutine;
- PVOID NormalContext;
- PVOID SystemArgument1;
- PVOID SystemArgument2;
- CCHAR ApcStateIndex;
- KPROCESSOR_MODE ApcMode;
- BOOLEAN Inserted;
+typedef struct _KAPC
+{
+ UCHAR Type;
+ UCHAR SpareByte0;
+ UCHAR Size;
+ UCHAR SpareByte1;
+ ULONG SpareLong0;
+ struct _KTHREAD *Thread;
+ LIST_ENTRY ApcListEntry;
+ PKKERNEL_ROUTINE KernelRoutine;
+ PKRUNDOWN_ROUTINE RundownRoutine;
+ PKNORMAL_ROUTINE NormalRoutine;
+ PVOID NormalContext;
+ PVOID SystemArgument1;
+ PVOID SystemArgument2;
+ CCHAR ApcStateIndex;
+ KPROCESSOR_MODE ApcMode;
+ BOOLEAN Inserted;
} KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
typedef struct _KDEVICE_QUEUE {
PKDPC BufferChainingDpc;
} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
-typedef struct _DISPATCHER_HEADER {
- UCHAR Type;
- UCHAR Absolute;
- UCHAR Size;
- UCHAR Inserted;
- LONG SignalState;
- LIST_ENTRY WaitListHead;
+typedef struct _DISPATCHER_HEADER
+{
+ union
+ {
+ struct
+ {
+ UCHAR Type;
+ union
+ {
+ UCHAR Absolute;
+ UCHAR NpxIrql;
+ };
+ union
+ {
+ UCHAR Size;
+ UCHAR Hand;
+ };
+ union
+ {
+ UCHAR Inserted;
+ BOOLEAN DebugActive;
+ };
+ };
+ volatile LONG Lock;
+ };
+ LONG SignalState;
+ LIST_ENTRY WaitListHead;
} DISPATCHER_HEADER, *PDISPATCHER_HEADER;
typedef struct _KEVENT {
LONG Limit;
} KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE;
-typedef struct _FAST_MUTEX {
- LONG Count;
- struct _KTHREAD *Owner;
- ULONG Contention;
- KEVENT Event;
- ULONG OldIrql;
+typedef struct _FAST_MUTEX
+{
+ LONG Count;
+ PKTHREAD Owner;
+ ULONG Contention;
+ KEVENT Gate;
+ ULONG OldIrql;
} FAST_MUTEX, *PFAST_MUTEX;
+typedef struct _EX_RUNDOWN_REF
+{
+ union
+ {
+ ULONG_PTR Count;
+ PVOID Ptr;
+ };
+} EX_RUNDOWN_REF, *PEX_RUNDOWN_REF;
+
typedef struct _KGATE
{
DISPATCHER_HEADER Header;
pHalMirrorVerify HalMirrorVerify;
} HAL_DISPATCH, *PHAL_DISPATCH;
-#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_)
+#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTHAL_)
extern DECL_IMPORT PHAL_DISPATCH HalDispatchTable;
#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable)
#else
BOOLEAN DeleteFile;
} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_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_END_OF_FILE_INFORMATION {
LARGE_INTEGER EndOfFile;
} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
#define SL_INVOKE_ON_SUCCESS 0x40
#define SL_INVOKE_ON_ERROR 0x80
+/* IO_STACK_LOCATION.Parameters.ReadWriteControl.WhichSpace */
+
+#define PCI_WHICHSPACE_CONFIG 0x0
+#define PCI_WHICHSPACE_ROM 0x52696350 /* 'PciR' */
+
typedef enum _KEY_INFORMATION_CLASS {
KeyBasicInformation,
KeyNodeInformation,
IN REG_NOTIFY_CLASS Argument1,
IN PVOID Argument2);
+typedef struct _REG_DELETE_KEY_INFORMATION
+{
+ PVOID Object;
+} REG_DELETE_KEY_INFORMATION, *PREG_DELETE_KEY_INFORMATION;
+
+typedef struct _REG_SET_VALUE_KEY_INFORMATION
+{
+ PVOID Object;
+ PUNICODE_STRING ValueName;
+ ULONG TitleIndex;
+ ULONG Type;
+ PVOID Data;
+ ULONG DataSize;
+} REG_SET_VALUE_KEY_INFORMATION, *PREG_SET_VALUE_KEY_INFORMATION;
+
+typedef struct _REG_DELETE_VALUE_KEY_INFORMATION
+{
+ PVOID Object;
+ PUNICODE_STRING ValueName;
+} REG_DELETE_VALUE_KEY_INFORMATION, *PREG_DELETE_VALUE_KEY_INFORMATION;
+
+typedef struct _REG_SET_INFORMATION_KEY_INFORMATION
+{
+ PVOID Object;
+ KEY_SET_INFORMATION_CLASS KeySetInformationClass;
+ PVOID KeySetInformation;
+ ULONG KeySetInformationLength;
+} REG_SET_INFORMATION_KEY_INFORMATION, *PREG_SET_INFORMATION_KEY_INFORMATION;
+
+typedef struct _REG_ENUMERATE_KEY_INFORMATION
+{
+ PVOID Object;
+ ULONG Index;
+ KEY_INFORMATION_CLASS KeyInformationClass;
+ PVOID KeyInformation;
+ ULONG Length;
+ PULONG ResultLength;
+} REG_ENUMERATE_KEY_INFORMATION, *PREG_ENUMERATE_KEY_INFORMATION;
+
+typedef struct _REG_ENUMERATE_VALUE_KEY_INFORMATION
+{
+ PVOID Object;
+ ULONG Index;
+ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
+ PVOID KeyValueInformation;
+ ULONG Length;
+ PULONG ResultLength;
+} REG_ENUMERATE_VALUE_KEY_INFORMATION, *PREG_ENUMERATE_VALUE_KEY_INFORMATION;
+
+typedef struct _REG_QUERY_KEY_INFORMATION
+{
+ PVOID Object;
+ KEY_INFORMATION_CLASS KeyInformationClass;
+ PVOID KeyInformation;
+ ULONG Length;
+ PULONG ResultLength;
+} REG_QUERY_KEY_INFORMATION, *PREG_QUERY_KEY_INFORMATION;
+
+typedef struct _REG_QUERY_VALUE_KEY_INFORMATION
+{
+ PVOID Object;
+ PUNICODE_STRING ValueName;
+ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
+ PVOID KeyValueInformation;
+ ULONG Length;
+ PULONG ResultLength;
+} REG_QUERY_VALUE_KEY_INFORMATION, *PREG_QUERY_VALUE_KEY_INFORMATION;
+
+typedef struct _REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION
+{
+ PVOID Object;
+ PKEY_VALUE_ENTRY ValueEntries;
+ ULONG EntryCount;
+ PVOID ValueBuffer;
+ PULONG BufferLength;
+ PULONG RequiredBufferLength;
+} REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION;
+
+typedef struct _REG_PRE_CREATE_KEY_INFORMATION
+{
+ PUNICODE_STRING CompleteName;
+} REG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_CREATE_KEY_INFORMATION;
+typedef struct _REG_POST_CREATE_KEY_INFORMATION
+{
+ PUNICODE_STRING CompleteName;
+ PVOID Object;
+ NTSTATUS Status;
+} REG_POST_CREATE_KEY_INFORMATION, *PREG_POST_CREATE_KEY_INFORMATION;
+
+typedef struct _REG_PRE_OPEN_KEY_INFORMATION
+{
+ PUNICODE_STRING CompleteName;
+} REG_PRE_OPEN_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;
+
+typedef struct _REG_POST_OPEN_KEY_INFORMATION
+{
+ PUNICODE_STRING CompleteName;
+ PVOID Object;
+ NTSTATUS Status;
+} REG_POST_OPEN_KEY_INFORMATION, *PREG_POST_OPEN_KEY_INFORMATION;
+
+typedef struct _REG_POST_OPERATION_INFORMATION
+{
+ PVOID Object;
+ NTSTATUS Status;
+} REG_POST_OPERATION_INFORMATION,*PREG_POST_OPERATION_INFORMATION;
/*
** Storage structures
KeGetCurrentIrql(
VOID);
-/*
- * ULONG
- * KeGetCurrentProcessorNumber(
- * VOID)
- */
-#define KeGetCurrentProcessorNumber() \
- ((ULONG)KeGetCurrentKPCR()->Number)
+static __inline
+ULONG
+DDKAPI
+KeGetCurrentProcessorNumber(VOID)
+{
+#if defined(__GNUC__)
+ ULONG ret;
+ __asm__ __volatile__ (
+ "movl %%fs:%c1, %0\n"
+ : "=r" (ret)
+ : "i" (FIELD_OFFSET(KPCR, Number))
+ );
+ return ret;
+#elif defined(_MSC_VER)
+#if _MSC_FULL_VER >= 13012035
+ return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
+#else
+ __asm { movzx eax, _PCR KPCR.Number }
+#endif
+#else
+#error Unknown compiler
+#endif
+}
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
PKGUARDED_MUTEX GuardedMutex
);
-/** Executive support routines **/
+/* Fast Mutex */
+#define ExInitializeFastMutex(_FastMutex) \
+{ \
+ (_FastMutex)->Count = FM_LOCK_BIT; \
+ (_FastMutex)->Owner = NULL; \
+ (_FastMutex)->Contention = 0; \
+ KeInitializeEvent(&(_FastMutex)->Gate, SynchronizationEvent, FALSE); \
+}
+
+NTOSAPI
+VOID
+FASTCALL
+ExAcquireFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex);
+
+NTOSAPI
+VOID
+FASTCALL
+ExReleaseFastMutexUnsafe(IN OUT PFAST_MUTEX FastMutex);
+
+#if defined(_NTHAL_) && defined(_X86_)
+NTOSAPI
+VOID
+FASTCALL
+ExiAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex);
+
+NTOSAPI
+VOID
+FASTCALL
+ExiReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex);
+
+NTOSAPI
+BOOLEAN
+FASTCALL
+ExiTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex);
+
+#define ExAcquireFastMutex(FastMutex) ExiAcquireFastMutex(FastMutex)
+#define ExReleaseFastMutex(FastMutex) ExiReleaseFastMutex(FastMutex)
+#define ExTryToAcquireFastMutex(FastMutex) ExiTryToAcquireFastMutex(FastMutex)
-#if defined(_X86_)
-NTHALAPI
#else
+
NTOSAPI
-#endif
VOID
-DDKFASTAPI
-ExAcquireFastMutex(
- IN PFAST_MUTEX FastMutex);
+FASTCALL
+ExAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex);
NTOSAPI
VOID
-DDKFASTAPI
-ExAcquireFastMutexUnsafe(
- IN PFAST_MUTEX FastMutex);
+FASTCALL
+ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex);
+
+NTOSAPI
+BOOLEAN
+FASTCALL
+ExTryToAcquireFastMutex(IN OUT PFAST_MUTEX FastMutex);
+#endif
+
+/** Executive support routines **/
NTOSAPI
BOOLEAN
IN EVENT_TYPE Type,
IN BOOLEAN State);
-/*
- * VOID DDKAPI
- * ExInitializeFastMutex(
- * IN PFAST_MUTEX FastMutex)
- */
-#define ExInitializeFastMutex(_FastMutex) \
-{ \
- (_FastMutex)->Count = 1; \
- (_FastMutex)->Owner = NULL; \
- (_FastMutex)->Contention = 0; \
- KeInitializeEvent(&(_FastMutex)->Event, SynchronizationEvent, FALSE); \
-}
-
NTOSAPI
VOID
DDKAPI
IN PERESOURCE Resource);
NTOSAPI
-USHORT
+ULONG
DDKAPI
ExIsResourceAcquiredSharedLite(
IN PERESOURCE Resource);
IN PVOID CallbackContext);
NTOSAPI
-VOID
+NTSTATUS
DDKAPI
ExReinitializeResourceLite(
IN PERESOURCE Resource);
-#if defined(_X86_)
-NTHALAPI
-#else
-NTOSAPI
-#endif
-VOID
-DDKFASTAPI
-ExReleaseFastMutex(
- IN PFAST_MUTEX FastMutex);
-
-NTOSAPI
-VOID
-DDKFASTAPI
-ExReleaseFastMutexUnsafe(
- IN PFAST_MUTEX FastMutex);
-
NTOSAPI
VOID
DDKAPI
IN PLARGE_INTEGER SystemTime,
OUT PLARGE_INTEGER LocalTime);
-#ifdef _M_IX86
-NTHALAPI
-#else
-NTOSAPI
-#endif
-BOOLEAN
-DDKFASTAPI
-ExTryToAcquireFastMutex(
- IN PFAST_MUTEX FastMutex);
-
NTOSAPI
BOOLEAN
DDKAPI
VOID
DDKAPI
ProbeForWrite(
- IN CONST VOID *Address,
+ IN PVOID Address,
IN ULONG Length,
IN ULONG Alignment);
IN ULONG MBRTypeIdentifier,
OUT PVOID *Buffer);
+VOID
+NTAPI
+HalPutDmaAdapter(
+ PADAPTER_OBJECT AdapterObject
+);
+
+NTSTATUS
+NTAPI
+IoAllocateAdapterChannel(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG NumberOfMapRegisters,
+ IN PDRIVER_CONTROL ExecutionRoutine,
+ IN PVOID Context
+);
+
NTHALAPI
VOID
DDKAPI
KeLeaveCriticalRegion(
VOID);
+#ifdef _X86_
+
static __inline
VOID
KeMemoryBarrier(
#endif
}
+#endif
+
NTOSAPI
LONG
DDKAPI
NTSTATUS
DDKAPI
MmCreateSection(
- OUT PSECTION_OBJECT *SectionObject,
+ OUT PVOID *SectionObject,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN PLARGE_INTEGER MaximumSize,
#endif /* !DBG */
-#if defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
+#if defined(_NTDDK_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
extern NTOSAPI PBOOLEAN KdDebuggerNotPresent;
extern NTOSAPI PBOOLEAN KdDebuggerEnabled;
#endif
+/* Available as intrinsics on MSVC */
+static __inline void _disable(void) {__asm__("cli\n\t");}
+static __inline void _enable(void) {__asm__("sti\n\t");}
+
#ifdef __cplusplus
}
#endif