diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index 61c23d3077a..ee436305568 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -111,7 +111,6 @@ typedef struct _ZONE_HEADER { #define PROTECTED_POOL 0x80000000 - /****************************************************************************** * I/O Manager Types * ******************************************************************************/ @@ -3238,6 +3237,7 @@ extern NTKERNELAPI ULONG64 MmUserProbeAddress; /****************************************************************************** * Executive Functions * ******************************************************************************/ + static __inline PVOID ExAllocateFromZone( IN PZONE_HEADER Zone) @@ -3330,8 +3330,6 @@ Exfi386InterlockedExchangeUlong( IN ULONG Value); #endif - - #if (NTDDI_VERSION >= NTDDI_WIN2K) NTKERNELAPI NTSTATUS @@ -3377,10 +3375,8 @@ VOID NTAPI ExRaiseDatatypeMisalignment(VOID); - #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - /* Hardware Abstraction Layer Functions */ #if (NTDDI_VERSION >= NTDDI_WIN2K) @@ -3653,10 +3649,10 @@ HalBugCheckSystem( #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ - /****************************************************************************** * I/O Manager Functions * ******************************************************************************/ + /* * VOID IoAssignArcName( * IN PUNICODE_STRING ArcName, @@ -3682,9 +3678,8 @@ IoInitializeDriverCreateContext( DriverContext->Size = sizeof(IO_DRIVER_CREATE_CONTEXT); } - - #if (NTDDI_VERSION >= NTDDI_WIN2K) + #if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) NTKERNELAPI NTSTATUS @@ -3903,6 +3898,7 @@ IoSetFileOrigin( #endif /* (NTDDI_VERSION >= NTDDI_WIN2KSP3) */ #if (NTDDI_VERSION >= NTDDI_WINXP) + NTKERNELAPI NTSTATUS FASTCALL @@ -4016,8 +4012,8 @@ IoAttachDeviceToDeviceStackSafe( IN PDEVICE_OBJECT TargetDevice, OUT PDEVICE_OBJECT *AttachedToDeviceObject); -#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ #if (NTDDI_VERSION >= NTDDI_WS03) NTKERNELAPI @@ -4095,20 +4091,16 @@ NTAPI IoIsFileObjectIgnoringSharing( IN PFILE_OBJECT FileObject); - #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ - #if (NTDDI_VERSION >= NTDDI_WIN7) NTSTATUS NTAPI IoSetFileObjectIgnoreSharing( IN PFILE_OBJECT FileObject); - #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ - /****************************************************************************** * Kernel Debugger Functions * ******************************************************************************/ diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 2742d758ed8..6c3f09ee724 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1967,7 +1967,6 @@ extern ULONG NtGlobalFlag; #define IF_NTOS_DEBUG(FlagName) if(FALSE) #endif - /****************************************************************************** * Security Manager Types * ******************************************************************************/ @@ -11183,7 +11182,6 @@ CmGetBoundTransaction( * I/O Manager Functions * ******************************************************************************/ - /* * NTSTATUS * IoAcquireRemoveLock( @@ -12378,7 +12376,6 @@ IoSetTopLevelIrp( #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ - #if (NTDDI_VERSION >= NTDDI_WINXP) NTKERNELAPI @@ -12538,6 +12535,7 @@ IoWMISetSingleItem( IN ULONG Version, IN ULONG ValueBufferSize, IN PVOID ValueBuffer); + #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ #if (NTDDI_VERSION >= NTDDI_WINXPSP1) @@ -12550,7 +12548,6 @@ IoValidateDeviceIoControlAccess( #endif #if (NTDDI_VERSION >= NTDDI_WS03) - NTKERNELAPI NTSTATUS NTAPI @@ -12573,9 +12570,7 @@ IoCsqInsertIrpEx( IN PVOID InsertContext OPTIONAL); #endif /* (NTDDI_VERSION >= NTDDI_WS03) */ - #if (NTDDI_VERSION >= NTDDI_VISTA) - NTKERNELAPI NTSTATUS NTAPI @@ -12724,7 +12719,6 @@ IoReplacePartitionUnit( #endif #if (NTDDI_VERSION >= NTDDI_WIN7) - NTKERNELAPI NTSTATUS NTAPI @@ -13408,7 +13402,6 @@ ExInitializeFastMutex( } #if (NTDDI_VERSION >= NTDDI_WIN2K) - NTKERNELAPI VOID FASTCALL @@ -14068,7 +14061,6 @@ ExFreeToNPagedLookasideList( } } - /****************************************************************************** * Object Manager Functions * ******************************************************************************/ @@ -14664,6 +14656,7 @@ HalGetDmaAlignment( } #endif /* USE_DMA_MACROS ... */ + #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ #ifndef _NTTMAPI_ diff --git a/include/psdk/devioctl.h b/include/psdk/devioctl.h index d192b32462d..413b112141c 100644 --- a/include/psdk/devioctl.h +++ b/include/psdk/devioctl.h @@ -26,7 +26,6 @@ #define _DEVIOCTL_ - #define FILE_DEVICE_BEEP 0x00000001 #define FILE_DEVICE_CD_ROM 0x00000002 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 @@ -98,7 +97,6 @@ /* DEVICE_OBJECT.DeviceType */ #define DEVICE_TYPE ULONG - #define CTL_CODE(DeviceType, Function, Method, Access) \ (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) @@ -106,7 +104,6 @@ #define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3)) - #define METHOD_BUFFERED 0 #define METHOD_IN_DIRECT 1 #define METHOD_OUT_DIRECT 2 @@ -115,12 +112,10 @@ #define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT #define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT - #define FILE_ANY_ACCESS 0x00000000 #define FILE_SPECIAL_ACCESS FILE_ANY_ACCESS #define FILE_READ_ACCESS 0x00000001 #define FILE_WRITE_ACCESS 0x00000002 - #endif /*_DEVIOCTL_ */ diff --git a/include/xdk/cmfuncs.h b/include/xdk/cmfuncs.h index 9fb3de09a7f..44571a7d2bc 100644 --- a/include/xdk/cmfuncs.h +++ b/include/xdk/cmfuncs.h @@ -66,5 +66,5 @@ CmGetBoundTransaction( #endif // NTDDI_VERSION >= NTDDI_VISTA -$endif +$endif (_WDMDDK_) diff --git a/include/xdk/cmtypes.h b/include/xdk/cmtypes.h index 2599a78cfc4..dd9cac2a6e7 100644 --- a/include/xdk/cmtypes.h +++ b/include/xdk/cmtypes.h @@ -1005,9 +1005,8 @@ typedef enum _CM_ERROR_CONTROL_TYPE { CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | \ CM_SERVICE_USB_DISK_BOOT_LOAD) -$endif +$endif (_WDMDDK_) $if (_NTDDK_) - typedef struct _KEY_NAME_INFORMATION { ULONG NameLength; WCHAR Name[1]; @@ -1045,4 +1044,4 @@ typedef struct _CM_PCCARD_DEVICE_DATA { UCHAR IRQMap[16]; } CM_PCCARD_DEVICE_DATA, *PCM_PCCARD_DEVICE_DATA; -$endif /* _NTDDK_ */ +$endif (_NTDDK_) diff --git a/include/xdk/exfuncs.h b/include/xdk/exfuncs.h index 46a5387733a..3b215d9382d 100644 --- a/include/xdk/exfuncs.h +++ b/include/xdk/exfuncs.h @@ -1,6 +1,7 @@ /****************************************************************************** * Executive Functions * ******************************************************************************/ + $if (_NTDDK_) static __inline PVOID ExAllocateFromZone( @@ -94,8 +95,7 @@ Exfi386InterlockedExchangeUlong( IN ULONG Value); #endif -$endif - +$endif (_NTDDK_) $if (_WDMDDK_) #define ExInterlockedIncrementLong(Addend,Lock) Exfi386InterlockedIncrementLong(Addend) #define ExInterlockedDecrementLong(Addend,Lock) Exfi386InterlockedDecrementLong(Addend) @@ -325,8 +325,8 @@ ExInitializeFastMutex( KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); return; } -$endif +$endif (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WIN2K) $if (_NTDDK_) NTKERNELAPI @@ -372,8 +372,8 @@ DECLSPEC_NORETURN VOID NTAPI ExRaiseDatatypeMisalignment(VOID); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI VOID @@ -750,8 +750,8 @@ VOID NTAPI ExUnregisterCallback( IN OUT PVOID CbRegistration); -$endif +$endif (_WDMDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ $if (_WDMDDK_) @@ -1036,5 +1036,4 @@ ExFreeToNPagedLookasideList( } } -$endif - +$endif (_WDMDDK_) diff --git a/include/xdk/extypes.h b/include/xdk/extypes.h index 4d18ac12f04..c734d3b0dc7 100644 --- a/include/xdk/extypes.h +++ b/include/xdk/extypes.h @@ -1,8 +1,8 @@ /****************************************************************************** * Executive Types * ******************************************************************************/ -$if (_WDMDDK_) +$if (_WDMDDK_) #define EX_RUNDOWN_ACTIVE 0x1 #define EX_RUNDOWN_COUNT_SHIFT 0x1 #define EX_RUNDOWN_COUNT_INC (1 << EX_RUNDOWN_COUNT_SHIFT) @@ -268,9 +268,8 @@ extern ULONG NtGlobalFlag; #define IF_NTOS_DEBUG(FlagName) if(FALSE) #endif -$endif /* _WDMDDK_ */ +$endif (_WDMDDK_) $if (_NTDDK_) - typedef struct _ZONE_SEGMENT_HEADER { SINGLE_LIST_ENTRY SegmentList; PVOID Reserved; @@ -285,5 +284,4 @@ typedef struct _ZONE_HEADER { #define PROTECTED_POOL 0x80000000 -$endif /* _NTDDK_ */ - +$endif (_NTDDK_) diff --git a/include/xdk/halfuncs.h b/include/xdk/halfuncs.h index 547f4e4b7ce..d257b7407e9 100644 --- a/include/xdk/halfuncs.h +++ b/include/xdk/halfuncs.h @@ -3,8 +3,8 @@ #if (NTDDI_VERSION >= NTDDI_WIN2K) #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) -$if (_WDMDDK_) +$if (_WDMDDK_) FORCEINLINE PVOID NTAPI @@ -69,9 +69,8 @@ HalGetDmaAlignment( return alignment; } -$endif +$endif (_WDMDDK_) $if (_NTDDK_) - /* Nothing here */ #else /* USE_DMA_MACROS ... */ @@ -141,10 +140,10 @@ HalAllocateAdapterChannel( IN ULONG NumberOfMapRegisters, IN PDRIVER_CONTROL ExecutionRoutine); -$endif /* _NTDDK_ */ +$endif (_NTDDK_) #endif /* USE_DMA_MACROS ... */ -$if (_NTDDK_) +$if (_NTDDK_) #if !defined(NO_LEGACY_DRIVERS) NTHALAPI NTSTATUS @@ -273,10 +272,10 @@ HalPutScatterGatherList( IN PSCATTER_GATHER_LIST ScatterGather, IN BOOLEAN WriteToDevice); -$endif /* _NTDDK_ */ +$endif (_NTDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ -$if (_NTDDK_) +$if (_NTDDK_) #if (NTDDI_VERSION >= NTDDI_WINXP) NTKERNELAPI VOID @@ -342,5 +341,4 @@ HalBugCheckSystem( #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ -$endif /* _NTDDK_ */ - +$endif (_NTDDK_) diff --git a/include/xdk/haltypes.h b/include/xdk/haltypes.h index a9a031776fd..2084fac7f7f 100644 --- a/include/xdk/haltypes.h +++ b/include/xdk/haltypes.h @@ -547,5 +547,5 @@ typedef struct _HAL_PLATFORM_INFORMATION { #define HAL_PLATFORM_DISABLE_UC_MAIN_MEMORY 0x08L #define HAL_PLATFORM_ENABLE_WRITE_COMBINING_MMIO 0x10L #define HAL_PLATFORM_ACPI_TABLES_CACHED 0x20L -$endif +$endif (_NTDDK_) diff --git a/include/xdk/iofuncs.h b/include/xdk/iofuncs.h index a1a2fcf88ee..16724c0ba9f 100644 --- a/include/xdk/iofuncs.h +++ b/include/xdk/iofuncs.h @@ -1,6 +1,7 @@ /****************************************************************************** * I/O Manager Functions * ******************************************************************************/ + $if (_NTDDK_) /* * VOID IoAssignArcName( @@ -26,9 +27,8 @@ IoInitializeDriverCreateContext( RtlZeroMemory(DriverContext, sizeof(IO_DRIVER_CREATE_CONTEXT)); DriverContext->Size = sizeof(IO_DRIVER_CREATE_CONTEXT); } -$endif - +$endif (_NTDDK_) $if (_WDMDDK_) /* * NTSTATUS @@ -571,9 +571,10 @@ IoMapTransfer( WriteToDevice); } #endif -$endif +$endif (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WIN2K) + $if (_NTDDK_) #if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) NTKERNELAPI @@ -772,8 +773,8 @@ BOOLEAN NTAPI IoSetThreadHardErrorMode( IN BOOLEAN EnableHardErrors); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI VOID @@ -1423,7 +1424,7 @@ NTAPI IoSetTopLevelIrp( IN PIRP Irp OPTIONAL); -$endif +$endif (_WDMDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ $if (_NTDDK_) @@ -1443,9 +1444,10 @@ IoSetFileOrigin( IN BOOLEAN Remote); #endif /* (NTDDI_VERSION >= NTDDI_WIN2KSP3) */ -$endif +$endif (_NTDDK_) #if (NTDDI_VERSION >= NTDDI_WINXP) + $if (_NTDDK_) NTKERNELAPI NTSTATUS @@ -1559,8 +1561,8 @@ IoAttachDeviceToDeviceStackSafe( IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, OUT PDEVICE_OBJECT *AttachedToDeviceObject); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI NTSTATUS @@ -1719,7 +1721,8 @@ IoWMISetSingleItem( IN ULONG Version, IN ULONG ValueBufferSize, IN PVOID ValueBuffer); -$endif +$endif (_WDMDDK_) + #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ $if (_WDMDDK_) @@ -1731,8 +1734,8 @@ IoValidateDeviceIoControlAccess( IN PIRP Irp, IN ULONG RequiredAccess); #endif -$endif +$endif (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WS03) $if (_NTDDK_) NTKERNELAPI @@ -1740,8 +1743,8 @@ IO_PAGING_PRIORITY FASTCALL IoGetPagingIoPriority( IN PIRP Irp); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI NTSTATUS @@ -1763,7 +1766,7 @@ IoCsqInsertIrpEx( IN PIRP Irp, IN PIO_CSQ_IRP_CONTEXT Context OPTIONAL, IN PVOID InsertContext OPTIONAL); -$endif +$endif (_WDMDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WS03) */ $if (_NTDDK_) @@ -1777,8 +1780,8 @@ IoTranslateBusAddress( IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress); #endif -$endif +$endif (_NTDDK_) #if (NTDDI_VERSION >= NTDDI_VISTA) $if (_NTDDK_) NTKERNELAPI @@ -1835,8 +1838,8 @@ BOOLEAN NTAPI IoIsFileObjectIgnoringSharing( IN PFILE_OBJECT FileObject); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI NTSTATUS @@ -1970,8 +1973,8 @@ IoGetDevicePropertyData( PVOID Data, PULONG RequiredSize, PDEVPROPTYPE Type); -$endif +$endif (_WDMDDK_) #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ $if (_WDMDDK_) @@ -1986,16 +1989,16 @@ IoReplacePartitionUnit( IN PDEVICE_OBJECT SparePdo, IN ULONG Flags); #endif -$endif +$endif (_WDMDDK_) #if (NTDDI_VERSION >= NTDDI_WIN7) $if (_NTDDK_) NTSTATUS NTAPI IoSetFileObjectIgnoreSharing( IN PFILE_OBJECT FileObject); -$endif +$endif (_NTDDK_) $if (_WDMDDK_) NTKERNELAPI NTSTATUS @@ -2038,8 +2041,8 @@ NTAPI IoGetDeviceNumaNode( IN PDEVICE_OBJECT Pdo, OUT PUSHORT NodeNumber); -$endif +$endif (_WDMDDK_) #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ $if (_WDMDDK_) @@ -2280,5 +2283,5 @@ IoInitializeThreadedDpcRequest( DeviceObject ); } #endif -$endif +$endif (_WDMDDK_)