Author: akhaldi Date: Tue Aug 10 13:53:10 2010 New Revision: 48511
URL: http://svn.reactos.org/svn/reactos?rev=48511&view=rev Log: [XDK] - Introduce some _ANONYMOUS_STRUCT and NONAMELESSUNION based definitions. [DDK] - Update XDK generated headers to reflect the recent changes. - Update some header guards. - Add some missing new lines at the end of files. - Fix PUSB_DEVICE_HANDLE guard. - Introduce some _ANONYMOUS_STRUCT and NONAMELESSUNION based definitions. [PSDK] - Update some header guards. - Add missing new line at the end of driverspecs.h [NDIS] - Update the ndis header guard.
Modified: trunk/reactos/drivers/network/ndis/include/miniport.h trunk/reactos/include/ddk/dxapi.h trunk/reactos/include/ddk/mce.h trunk/reactos/include/ddk/ndis.h trunk/reactos/include/ddk/ndistapi.h trunk/reactos/include/ddk/ndiswan.h trunk/reactos/include/ddk/ntddpcm.h trunk/reactos/include/ddk/oprghdlr.h trunk/reactos/include/ddk/usbbusif.h trunk/reactos/include/ddk/wdm.h trunk/reactos/include/psdk/driverspecs.h trunk/reactos/include/psdk/ntdd8042.h trunk/reactos/include/psdk/ntddcdrm.h trunk/reactos/include/psdk/ntddcdvd.h trunk/reactos/include/psdk/ntdddisk.h trunk/reactos/include/psdk/ntddndis.h trunk/reactos/include/psdk/ntddpar.h trunk/reactos/include/psdk/ntddser.h trunk/reactos/include/psdk/ntddtape.h trunk/reactos/include/psdk/ntddvdeo.h trunk/reactos/include/psdk/ntddvol.h trunk/reactos/include/psdk/winddi.h trunk/reactos/include/xdk/exfuncs.h trunk/reactos/include/xdk/iofuncs.h trunk/reactos/include/xdk/iotypes.h trunk/reactos/include/xdk/ketypes.h trunk/reactos/include/xdk/wmifuncs.h trunk/reactos/include/xdk/x86/ke.h
Modified: trunk/reactos/drivers/network/ndis/include/miniport.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/includ... ============================================================================== --- trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/include/miniport.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -27,7 +27,7 @@ PDRIVER_OBJECT DriverObject; /* Driver object of miniport */ LIST_ENTRY DeviceList; /* Adapters created by miniport */ PUNICODE_STRING RegistryPath; /* SCM Registry key */ -#if !defined(_MSC_VER) && defined(__NDIS_H) +#if !defined(_MSC_VER) && defined(_NDIS_) } NDIS_M_DRIVER_BLOCK_COMPATIBILITY_HACK_DONT_USE; #else } NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK;
Modified: trunk/reactos/include/ddk/dxapi.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/dxapi.h?rev=485... ============================================================================== --- trunk/reactos/include/ddk/dxapi.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/dxapi.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -1,5 +1,5 @@ ULONG -DxApiGetVersion(); +DxApiGetVersion(void);
ULONG DxApi(
Modified: trunk/reactos/include/ddk/mce.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/mce.h?rev=48511... ============================================================================== --- trunk/reactos/include/ddk/mce.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/mce.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -3,7 +3,7 @@ #if defined(_X86_) || defined(_IA64_) || defined(_AMD64_)
typedef union _MCI_ADDR { - struct { + _ANONYMOUS_STRUCT struct { ULONG Address; ULONG Reserved; } DUMMYSTRUCTNAME; @@ -157,7 +157,7 @@
typedef union _ERROR_REVISION { USHORT Revision; - struct { + _ANONYMOUS_STRUCT struct { UCHAR Minor; UCHAR Major; } DUMMYSTRUCTNAME; @@ -174,7 +174,7 @@
typedef union _ERROR_TIMESTAMP { ULONGLONG TimeStamp; - struct { + _ANONYMOUS_STRUCT struct { UCHAR Seconds; UCHAR Minutes; UCHAR Hours; @@ -201,7 +201,7 @@
typedef union _ERROR_RECORD_VALID { UCHAR Valid; - struct { + _ANONYMOUS_STRUCT struct { UCHAR OemPlatformID:1; UCHAR Reserved:7; } DUMMYSTRUCTNAME; @@ -219,7 +219,7 @@
typedef union _ERROR_RECOVERY_INFO { UCHAR RecoveryInfo; - struct { + _ANONYMOUS_STRUCT struct { UCHAR Corrected:1; UCHAR NotContained:1; UCHAR Reset:1; @@ -236,7 +236,7 @@ ULONG Length; } ERROR_SECTION_HEADER, *PERROR_SECTION_HEADER;
-#if !defined(__midl) && defined(_MSC_EXTENSIONS) +#if !defined(__midl) __inline USHORT NTAPI @@ -245,16 +245,20 @@ { PERROR_SECTION_HEADER section = (PERROR_SECTION_HEADER)((ULONG64)Log + sizeof(*Log)); USHORT lid = (USHORT)((UCHAR)(section->Reserved)); +#ifdef NONAMELESSUNION + lid |= (USHORT)((UCHAR)(Log->TimeStamp.s.Reserved) << 8); +#else lid |= (USHORT)((UCHAR)(Log->TimeStamp.Reserved) << 8); +#endif return( lid ); } -#endif +#endif /* !__midl */
#define ERROR_PROCESSOR_GUID {0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}}
typedef union _ERROR_MODINFO_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG CheckInfo:1; ULONGLONG RequestorIdentifier:1; ULONGLONG ResponderIdentifier:1; @@ -291,7 +295,7 @@
typedef union _ERROR_CACHE_CHECK { ULONGLONG CacheCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Operation:4; ULONGLONG Level:2; ULONGLONG Reserved1:2; @@ -324,7 +328,7 @@
typedef union _ERROR_CACHE_CHECK { ULONGLONG CacheCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Operation:4; ULONGLONG Level:2; ULONGLONG Reserved1:2; @@ -367,7 +371,7 @@
typedef union _ERROR_TLB_CHECK { ULONGLONG TlbCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG TRSlot:8; ULONGLONG TRSlotValid:1; ULONGLONG Reserved1:1; @@ -407,7 +411,7 @@
typedef union _ERROR_BUS_CHECK { ULONGLONG BusCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Size:5; ULONGLONG Internal:1; ULONGLONG External:1; @@ -434,7 +438,7 @@
typedef union _ERROR_BUS_CHECK { ULONGLONG BusCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Size:5; ULONGLONG Internal:1; ULONGLONG External:1; @@ -484,7 +488,7 @@
typedef union _ERROR_REGFILE_CHECK { ULONGLONG RegFileCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Identifier:4; ULONGLONG Operation:4; ULONGLONG RegisterNumber:7; @@ -518,7 +522,7 @@
typedef union _ERROR_MS_CHECK { ULONGLONG MsCheck; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG StructureIdentifier:5; ULONGLONG Level:3; ULONGLONG ArrayId:4; @@ -561,7 +565,7 @@
typedef union _ERROR_PROCESSOR_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorMap:1; ULONGLONG StateParameter:1; ULONGLONG CRLid:1; @@ -578,7 +582,7 @@
typedef union _ERROR_PROCESSOR_ERROR_MAP { ULONGLONG ErrorMap; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Cid:4; ULONGLONG Tid:4; ULONGLONG Eic:4; @@ -597,7 +601,7 @@
typedef union _ERROR_PROCESSOR_STATE_PARAMETER { ULONGLONG StateParameter; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG reserved0:2; ULONGLONG rz:1; ULONGLONG ra:1; @@ -641,7 +645,7 @@
typedef union _PROCESSOR_LOCAL_ID { ULONGLONG LocalId; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG reserved:16; ULONGLONG eid:8; ULONGLONG id:8; @@ -664,7 +668,7 @@
typedef union _ERROR_PROCESSOR_STATIC_INFO_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG MinState:1; ULONGLONG BR:1; ULONGLONG CR:1; @@ -730,7 +734,7 @@
typedef union _ERROR_STATUS { ULONGLONG Status; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG Reserved0:8; ULONGLONG Type:8; ULONGLONG Address:1; @@ -750,7 +754,7 @@
typedef union _ERROR_BUS_SPECIFIC_DATA { ULONGLONG BusSpecificData; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG LockAsserted:1; ULONGLONG DeferLogged:1; ULONGLONG IOQEmpty:1; @@ -777,7 +781,7 @@
typedef union _ERROR_MEMORY_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG PhysicalAddress:1; ULONGLONG AddressMask:1; @@ -825,7 +829,7 @@
typedef union _ERROR_PCI_BUS_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG ErrorType:1; ULONGLONG Id:1; @@ -881,7 +885,7 @@
typedef union _ERROR_PCI_COMPONENT_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG Info:1; ULONGLONG MemoryMappedRegistersPairs:1; @@ -919,7 +923,7 @@
typedef union _ERROR_SYSTEM_EVENT_LOG_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG RecordId:1; ULONGLONG RecordType:1; ULONGLONG GeneratorId:1; @@ -954,7 +958,7 @@
typedef union _ERROR_SMBIOS_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG EventType:1; ULONGLONG Length:1; ULONGLONG TimeStamp:1; @@ -978,7 +982,7 @@
typedef union _ERROR_PLATFORM_SPECIFIC_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG RequestorId:1; ULONGLONG ResponderId:1; @@ -1007,7 +1011,7 @@
typedef union _ERROR_PLATFORM_BUS_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG RequestorId:1; ULONGLONG ResponderId:1; @@ -1036,7 +1040,7 @@
typedef union _ERROR_PLATFORM_HOST_CONTROLLER_VALID { ULONGLONG Valid; - struct { + _ANONYMOUS_STRUCT struct { ULONGLONG ErrorStatus:1; ULONGLONG RequestorId:1; ULONGLONG ResponderId:1;
Modified: trunk/reactos/include/ddk/ndis.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndis.h?rev=4851... ============================================================================== --- trunk/reactos/include/ddk/ndis.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ndis.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -29,8 +29,8 @@ * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver */
-#ifndef __NDIS_H -#define __NDIS_H +#ifndef _NDIS_ +#define _NDIS_
#ifndef NDIS_WDM #define NDIS_WDM 0 @@ -5987,6 +5987,6 @@ } #endif
-#endif /* __NDIS_H */ +#endif /* _NDIS_ */
/* EOF */
Modified: trunk/reactos/include/ddk/ndistapi.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndistapi.h?rev=... ============================================================================== --- trunk/reactos/include/ddk/ndistapi.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ndistapi.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,10 @@ * */
-#ifndef __NDISTAPI_H -#define __NDISTAPI_H +#pragma once + +#ifndef _NDIS_TAPI_ +#define _NDIS_TAPI_
#include "ndis.h"
@@ -1301,4 +1303,4 @@ } #endif
-#endif /* __NDISTAPI_H */ +#endif /* _NDIS_TAPI_ */
Modified: trunk/reactos/include/ddk/ndiswan.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ndiswan.h?rev=4... ============================================================================== --- trunk/reactos/include/ddk/ndiswan.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ndiswan.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -21,6 +21,9 @@ */
#pragma once + +#ifndef _NDIS_WAN_ +#define _NDIS_WAN_
#ifdef __cplusplus extern "C" { @@ -352,3 +355,6 @@ #ifdef __cplusplus } #endif + +#endif /* _NDIS_WAN_ */ +
Modified: trunk/reactos/include/ddk/ntddpcm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddpcm.h?rev=4... ============================================================================== --- trunk/reactos/include/ddk/ntddpcm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddpcm.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDPCM_H -#define __NTDDPCM_H +#ifndef _NTDDPCMH_ +#define _NTDDPCMH_
#ifdef __cplusplus extern "C" { @@ -156,4 +156,4 @@ } #endif
-#endif /* __NTDDPCM_H */ +#endif /* _NTDDPCMH_ */
Modified: trunk/reactos/include/ddk/oprghdlr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/oprghdlr.h?rev=... ============================================================================== --- trunk/reactos/include/ddk/oprghdlr.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/oprghdlr.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -40,4 +40,4 @@ #define ACPI_OPREGION_REGION_SPACE_SMB 0x4 #define ACPI_OPREGION_READ 0x0 #define ACPI_OPREGION_WRITE 0x1 -#define ACPI_OPREGION_ACCESS_AT_HIGH_LEVEL 0x1 +#define ACPI_OPREGION_ACCESS_AT_HIGH_LEVEL 0x1
Modified: trunk/reactos/include/ddk/usbbusif.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbbusif.h?rev=... ============================================================================== --- trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -8,7 +8,7 @@
#if (NTDDI_VERSION >= NTDDI_WINXP)
-#if !defined(_USBBUSIF_) +#if !defined(_HUBBUSIF_) typedef PVOID PUSB_DEVICE_HANDLE; #endif
Modified: trunk/reactos/include/ddk/wdm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=48511... ============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -1242,7 +1242,7 @@ CSHORT Size; LIST_ENTRY DeviceListHead; KSPIN_LOCK Lock; - #if defined(_AMD64_) +# if defined(_AMD64_) _ANONYMOUS_UNION union { BOOLEAN Busy; _ANONYMOUS_STRUCT struct { @@ -1250,9 +1250,9 @@ LONG64 Hint:56; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; - #else +# else BOOLEAN Busy; - #endif +# endif } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
#define TIMER_EXPIRED_INDEX_BITS 6 @@ -1374,9 +1374,9 @@ ULARGE_INTEGER DueTime; LIST_ENTRY TimerListEntry; struct _KDPC *Dpc; - #if !defined(_X86_) +# if !defined(_X86_) ULONG Processor; - #endif +# endif ULONG Period; } KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
@@ -5692,30 +5692,35 @@ ULONG_PTR Reserved; } SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT;
-#if defined(_MSC_EXTENSIONS) - +#if defined(_MSC_EXTENSIONS) || defined(__GNUC__) + +#if defined(_MSC_VER) #if _MSC_VER >= 1200 #pragma warning(push) #endif #pragma warning(disable:4200) +#endif /* _MSC_VER */ + typedef struct _SCATTER_GATHER_LIST { ULONG NumberOfElements; ULONG_PTR Reserved; SCATTER_GATHER_ELEMENT Elements[1]; } SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
+#if defined(_MSC_VER) #if _MSC_VER >= 1200 #pragma warning(pop) #else #pragma warning(default:4200) #endif - -#else +#endif /* _MSC_VER */ + +#else /* defined(_MSC_EXTENSIONS) || defined(__GNUC__) */
struct _SCATTER_GATHER_LIST; typedef struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
-#endif +#endif /* defined(_MSC_EXTENSIONS) || defined(__GNUC__) */
typedef NTSTATUS (NTAPI DRIVER_ADD_DEVICE)( @@ -7803,9 +7808,15 @@ OUT PLARGE_INTEGER CurrentCount) { for (;;) { +#ifdef NONAMELESSUNION + CurrentCount->s.HighPart = KeTickCount.High1Time; + CurrentCount->s.LowPart = KeTickCount.LowPart; + if (CurrentCount->s.HighPart == KeTickCount.High2Time) break; +#else CurrentCount->HighPart = KeTickCount.High1Time; CurrentCount->LowPart = KeTickCount.LowPart; if (CurrentCount->HighPart == KeTickCount.High2Time) break; +#endif YieldProcessor(); } } @@ -12748,7 +12759,11 @@ { ASSERT(Irp->CurrentLocation <= Irp->StackCount); Irp->CurrentLocation++; +#ifdef NONAMELESSUNION + Irp->Tail.Overlay.s.u.CurrentStackLocation++; +#else Irp->Tail.Overlay.CurrentStackLocation++; +#endif }
FORCEINLINE @@ -12758,7 +12773,11 @@ { ASSERT(Irp->CurrentLocation > 0); Irp->CurrentLocation--; +#ifdef NONAMELESSUNION + Irp->Tail.Overlay.s.u.CurrentStackLocation--; +#else Irp->Tail.Overlay.CurrentStackLocation--; +#endif }
FORCEINLINE @@ -12767,7 +12786,11 @@ IN PIRP Irp) { ASSERT(Irp->CurrentLocation > 0); +#ifdef NONAMELESSUNION + return ((Irp)->Tail.Overlay.s.u.CurrentStackLocation - 1 ); +#else return ((Irp)->Tail.Overlay.CurrentStackLocation - 1 ); +#endif }
FORCEINLINE @@ -12858,7 +12881,11 @@ IN PIRP Irp) { ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1); +#ifdef NONAMELESSUNION + return Irp->Tail.Overlay.s.u.CurrentStackLocation; +#else return Irp->Tail.Overlay.CurrentStackLocation; +#endif }
FORCEINLINE @@ -13243,7 +13270,11 @@
#else /* !defined(_WIN64) */
+#ifdef NONAMELESSUNION +#define ExQueryDepthSList(listhead) (listhead)->s.Depth +#else #define ExQueryDepthSList(listhead) (listhead)->Depth +#endif
NTKERNELAPI PSINGLE_LIST_ENTRY @@ -13300,6 +13331,15 @@ PVOID Entry;
Lookaside->L.TotalAllocates++; +#ifdef NONAMELESSUNION + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses++; + Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); + } +#else /* NONAMELESSUNION */ Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); if (Entry == NULL) { Lookaside->L.AllocateMisses++; @@ -13307,6 +13347,7 @@ Lookaside->L.Size, Lookaside->L.Tag); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -13317,12 +13358,21 @@ IN PVOID Entry) { Lookaside->L.TotalFrees++; +#ifdef NONAMELESSUNION + if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.u3.FreeMisses++; + (Lookaside->L.u5.Free)(Entry); + } else { + InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry); + } +#else /* NONAMELESSUNION */ if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { Lookaside->L.FreeMisses++; (Lookaside->L.Free)(Entry); } else { InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); } +#endif /* NONAMELESSUNION */ }
#endif /* _WIN2K_COMPAT_SLIST_USAGE */ @@ -13936,6 +13986,16 @@ PVOID Entry;
Lookaside->L.TotalAllocates += 1; +#ifdef NONAMELESSUNION + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses += 1; + Entry = (Lookaside->L.u4.AllocateEx)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag, + Lookaside); + } +#else /* NONAMELESSUNION */ Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); if (Entry == NULL) { Lookaside->L.AllocateMisses += 1; @@ -13944,6 +14004,7 @@ Lookaside->L.Tag, Lookaside); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -13986,6 +14047,20 @@ PVOID Entry;
Lookaside->L.TotalAllocates++; +#ifdef NONAMELESSUNION +#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) + Entry = ExInterlockedPopEntrySList(&Lookaside->L.u.ListHead, + &Lookaside->Lock__ObsoleteButDoNotDelete); +#else + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); +#endif + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses++; + Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); + } +#else /* NONAMELESSUNION */ #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) Entry = ExInterlockedPopEntrySList(&Lookaside->L.ListHead, &Lookaside->Lock__ObsoleteButDoNotDelete); @@ -13998,6 +14073,7 @@ Lookaside->L.Size, Lookaside->L.Tag); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -14007,6 +14083,20 @@ IN PVOID Entry) { Lookaside->L.TotalFrees++; +#ifdef NONAMELESSUNION + if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.u3.FreeMisses++; + (Lookaside->L.u5.Free)(Entry); + } else { +#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) + ExInterlockedPushEntrySList(&Lookaside->L.u.ListHead, + (PSLIST_ENTRY)Entry, + &Lookaside->Lock__ObsoleteButDoNotDelete); +#else + InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry); +#endif + } +#else /* NONAMELESSUNION */ if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { Lookaside->L.FreeMisses++; (Lookaside->L.Free)(Entry); @@ -14019,6 +14109,7 @@ InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); #endif } +#endif /* NONAMELESSUNION */ }
/****************************************************************************** @@ -14225,7 +14316,7 @@ #endif #endif /* RUN_WPP */
- #if (NTDDI_VERSION >= NTDDI_WINXP) +#if (NTDDI_VERSION >= NTDDI_WINXP)
NTKERNELAPI NTSTATUS
Modified: trunk/reactos/include/psdk/driverspecs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/driverspecs.h?... ============================================================================== --- trunk/reactos/include/psdk/driverspecs.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/driverspecs.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -26,4 +26,4 @@
#define __inout
-#define __deref_out_ecount(Size) +#define __deref_out_ecount(Size)
Modified: trunk/reactos/include/psdk/ntdd8042.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdd8042.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntdd8042.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntdd8042.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDD8042_H -#define __NTDD8042_H +#ifndef _NTDD8042_ +#define _NTDD8042_
#include "ntddkbd.h" #include "ntddmou.h" @@ -205,4 +205,4 @@ } #endif
-#endif /* __NTDD8042_H */ +#endif /* _NTDD8042_ */
Modified: trunk/reactos/include/psdk/ntddcdrm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddcdrm.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntddcdrm.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddcdrm.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDCDRM_H -#define __NTDDCDRM_H +#ifndef _NTDDCDRM_ +#define _NTDDCDRM_
#include "ntddstor.h"
@@ -342,4 +342,4 @@ } #endif
-#endif /* __NTDDCDRM_H */ +#endif /* _NTDDCDRM_ */
Modified: trunk/reactos/include/psdk/ntddcdvd.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddcdvd.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntddcdvd.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddcdvd.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDCDVD_H -#define __NTDDCDVD_H +#ifndef _NTDDCDVD_ +#define _NTDDCDVD_
#include "ntddstor.h"
@@ -205,4 +205,4 @@ } #endif
-#endif /* __NTDDCDVD_H */ +#endif /* _NTDDCDVD_ */
Modified: trunk/reactos/include/psdk/ntdddisk.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdddisk.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntdddisk.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntdddisk.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDDISK_H -#define __NTDDDISK_H +#ifndef _NTDDDISK_H_ +#define _NTDDDISK_H_
/* Helper macro to enable gcc's extension. */ #ifndef __GNU_EXTENSION @@ -606,4 +606,4 @@ } #endif
-#endif /* __NTDDDISK_H */ +#endif /* _NTDDDISK_H_ */
Modified: trunk/reactos/include/psdk/ntddndis.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddndis.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntddndis.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddndis.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDNDIS_H -#define __NTDDNDIS_H +#ifndef _NTDDNDIS_ +#define _NTDDNDIS_
#ifdef __cplusplus extern "C" { @@ -326,7 +326,7 @@ NdisMediaStateDisconnected } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
-#ifndef __NDIS_H +#ifndef _NDIS_ typedef int NDIS_STATUS, *PNDIS_STATUS; #endif
@@ -379,4 +379,4 @@ } #endif
-#endif /* __NTDDNDIS_H */ +#endif /* _NTDDNDIS_ */
Modified: trunk/reactos/include/psdk/ntddpar.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddpar.h?rev=... ============================================================================== --- trunk/reactos/include/psdk/ntddpar.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddpar.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDPAR_H -#define __NTDDPAR_H +#ifndef _NTDDPAR_ +#define _NTDDPAR_
#ifdef __cplusplus extern "C" { @@ -110,4 +110,4 @@ } #endif
-#endif /* __NTDDPAR_H */ +#endif /* _NTDDPAR_ */
Modified: trunk/reactos/include/psdk/ntddser.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddser.h?rev=... ============================================================================== --- trunk/reactos/include/psdk/ntddser.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddser.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDSER_H -#define __NTDDSER_H +#ifndef _NTDDSER_ +#define _NTDDSER_
#ifdef __cplusplus extern "C" { @@ -444,4 +444,4 @@ } #endif
-#endif /* __NTDDSER_H */ +#endif /* _NTDDSER_ */
Modified: trunk/reactos/include/psdk/ntddtape.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddtape.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntddtape.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddtape.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDTAPE_H -#define __NTDDTAPE_H +#ifndef _NTDDTAPE_ +#define _NTDDTAPE_
#include "ntddstor.h"
@@ -71,4 +71,4 @@ } #endif
-#endif /* __NTDDTAPE_H */ +#endif /* _NTDDTAPE_ */
Modified: trunk/reactos/include/psdk/ntddvdeo.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddvdeo.h?rev... ============================================================================== --- trunk/reactos/include/psdk/ntddvdeo.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddvdeo.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDVDEO_H -#define __NTDDVDEO_H +#ifndef _NTDDVDEO_ +#define _NTDDVDEO_
#ifdef __cplusplus extern "C" { @@ -473,4 +473,4 @@ } #endif
-#endif /* __NTDDVDEO_H */ +#endif /* _NTDDVDEO_ */
Modified: trunk/reactos/include/psdk/ntddvol.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntddvol.h?rev=... ============================================================================== --- trunk/reactos/include/psdk/ntddvol.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntddvol.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -20,8 +20,8 @@ * */
-#ifndef __NTDDVOL_H -#define __NTDDVOL_H +#ifndef _NTDDVOL_ +#define _NTDDVOL_
#ifdef __cplusplus extern "C" { @@ -132,4 +132,4 @@ } #endif
-#endif /* __NTDDVOL_H */ +#endif /* _NTDDVOL_ */
Modified: trunk/reactos/include/psdk/winddi.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winddi.h?rev=4... ============================================================================== --- trunk/reactos/include/psdk/winddi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winddi.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -84,7 +84,7 @@ DECLARE_HANDLE(DHPDEV); DECLARE_HANDLE(HDRVOBJ);
-#ifndef __NTDDVDEO_H +#ifndef _NTDDVDEO_ typedef struct _ENG_EVENT *PEVENT; #endif
Modified: trunk/reactos/include/xdk/exfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/exfuncs.h?rev=4... ============================================================================== --- trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/exfuncs.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -114,7 +114,11 @@
#else /* !defined(_WIN64) */
+#ifdef NONAMELESSUNION +#define ExQueryDepthSList(listhead) (listhead)->s.Depth +#else #define ExQueryDepthSList(listhead) (listhead)->Depth +#endif
NTKERNELAPI PSINGLE_LIST_ENTRY @@ -171,6 +175,15 @@ PVOID Entry;
Lookaside->L.TotalAllocates++; +#ifdef NONAMELESSUNION + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses++; + Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); + } +#else /* NONAMELESSUNION */ Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); if (Entry == NULL) { Lookaside->L.AllocateMisses++; @@ -178,6 +191,7 @@ Lookaside->L.Size, Lookaside->L.Tag); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -188,12 +202,21 @@ IN PVOID Entry) { Lookaside->L.TotalFrees++; +#ifdef NONAMELESSUNION + if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.u3.FreeMisses++; + (Lookaside->L.u5.Free)(Entry); + } else { + InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry); + } +#else /* NONAMELESSUNION */ if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { Lookaside->L.FreeMisses++; (Lookaside->L.Free)(Entry); } else { InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); } +#endif /* NONAMELESSUNION */ }
#endif /* _WIN2K_COMPAT_SLIST_USAGE */ @@ -1002,6 +1025,16 @@ PVOID Entry;
Lookaside->L.TotalAllocates += 1; +#ifdef NONAMELESSUNION + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses += 1; + Entry = (Lookaside->L.u4.AllocateEx)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag, + Lookaside); + } +#else /* NONAMELESSUNION */ Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); if (Entry == NULL) { Lookaside->L.AllocateMisses += 1; @@ -1010,6 +1043,7 @@ Lookaside->L.Tag, Lookaside); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -1052,6 +1086,20 @@ PVOID Entry;
Lookaside->L.TotalAllocates++; +#ifdef NONAMELESSUNION +#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) + Entry = ExInterlockedPopEntrySList(&Lookaside->L.u.ListHead, + &Lookaside->Lock__ObsoleteButDoNotDelete); +#else + Entry = InterlockedPopEntrySList(&Lookaside->L.u.ListHead); +#endif + if (Entry == NULL) { + Lookaside->L.u2.AllocateMisses++; + Entry = (Lookaside->L.u4.Allocate)(Lookaside->L.Type, + Lookaside->L.Size, + Lookaside->L.Tag); + } +#else /* NONAMELESSUNION */ #if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) Entry = ExInterlockedPopEntrySList(&Lookaside->L.ListHead, &Lookaside->Lock__ObsoleteButDoNotDelete); @@ -1064,6 +1112,7 @@ Lookaside->L.Size, Lookaside->L.Tag); } +#endif /* NONAMELESSUNION */ return Entry; }
@@ -1073,6 +1122,20 @@ IN PVOID Entry) { Lookaside->L.TotalFrees++; +#ifdef NONAMELESSUNION + if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) { + Lookaside->L.u3.FreeMisses++; + (Lookaside->L.u5.Free)(Entry); + } else { +#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) + ExInterlockedPushEntrySList(&Lookaside->L.u.ListHead, + (PSLIST_ENTRY)Entry, + &Lookaside->Lock__ObsoleteButDoNotDelete); +#else + InterlockedPushEntrySList(&Lookaside->L.u.ListHead, (PSLIST_ENTRY)Entry); +#endif + } +#else /* NONAMELESSUNION */ if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { Lookaside->L.FreeMisses++; (Lookaside->L.Free)(Entry); @@ -1085,6 +1148,7 @@ InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); #endif } +#endif /* NONAMELESSUNION */ }
-$endif (_WDMDDK_) +$endif (_WDMDDK_)
Modified: trunk/reactos/include/xdk/iofuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iofuncs.h?rev=4... ============================================================================== --- trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -2435,7 +2435,11 @@ { ASSERT(Irp->CurrentLocation <= Irp->StackCount); Irp->CurrentLocation++; +#ifdef NONAMELESSUNION + Irp->Tail.Overlay.s.u.CurrentStackLocation++; +#else Irp->Tail.Overlay.CurrentStackLocation++; +#endif }
FORCEINLINE @@ -2445,7 +2449,11 @@ { ASSERT(Irp->CurrentLocation > 0); Irp->CurrentLocation--; +#ifdef NONAMELESSUNION + Irp->Tail.Overlay.s.u.CurrentStackLocation--; +#else Irp->Tail.Overlay.CurrentStackLocation--; +#endif }
FORCEINLINE @@ -2454,7 +2462,11 @@ IN PIRP Irp) { ASSERT(Irp->CurrentLocation > 0); +#ifdef NONAMELESSUNION + return ((Irp)->Tail.Overlay.s.u.CurrentStackLocation - 1 ); +#else return ((Irp)->Tail.Overlay.CurrentStackLocation - 1 ); +#endif }
FORCEINLINE @@ -2545,7 +2557,11 @@ IN PIRP Irp) { ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1); +#ifdef NONAMELESSUNION + return Irp->Tail.Overlay.s.u.CurrentStackLocation; +#else return Irp->Tail.Overlay.CurrentStackLocation; +#endif }
FORCEINLINE
Modified: trunk/reactos/include/xdk/iotypes.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iotypes.h?rev=4... ============================================================================== --- trunk/reactos/include/xdk/iotypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iotypes.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -2029,30 +2029,35 @@ ULONG_PTR Reserved; } SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT;
-#if defined(_MSC_EXTENSIONS) - +#if defined(_MSC_EXTENSIONS) || defined(__GNUC__) + +#if defined(_MSC_VER) #if _MSC_VER >= 1200 #pragma warning(push) #endif #pragma warning(disable:4200) +#endif /* _MSC_VER */ + typedef struct _SCATTER_GATHER_LIST { ULONG NumberOfElements; ULONG_PTR Reserved; SCATTER_GATHER_ELEMENT Elements[1]; } SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
+#if defined(_MSC_VER) #if _MSC_VER >= 1200 #pragma warning(pop) #else #pragma warning(default:4200) #endif - -#else +#endif /* _MSC_VER */ + +#else /* defined(_MSC_EXTENSIONS) || defined(__GNUC__) */
struct _SCATTER_GATHER_LIST; typedef struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
-#endif +#endif /* defined(_MSC_EXTENSIONS) || defined(__GNUC__) */
typedef NTSTATUS (NTAPI DRIVER_ADD_DEVICE)(
Modified: trunk/reactos/include/xdk/ketypes.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ketypes.h?rev=4... ============================================================================== --- trunk/reactos/include/xdk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ketypes.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -678,7 +678,7 @@ CSHORT Size; LIST_ENTRY DeviceListHead; KSPIN_LOCK Lock; - #if defined(_AMD64_) +# if defined(_AMD64_) _ANONYMOUS_UNION union { BOOLEAN Busy; _ANONYMOUS_STRUCT struct { @@ -686,9 +686,9 @@ LONG64 Hint:56; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; - #else +# else BOOLEAN Busy; - #endif +# endif } KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
#define TIMER_EXPIRED_INDEX_BITS 6 @@ -810,9 +810,9 @@ ULARGE_INTEGER DueTime; LIST_ENTRY TimerListEntry; struct _KDPC *Dpc; - #if !defined(_X86_) +# if !defined(_X86_) ULONG Processor; - #endif +# endif ULONG Period; } KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
Modified: trunk/reactos/include/xdk/wmifuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/wmifuncs.h?rev=... ============================================================================== --- trunk/reactos/include/xdk/wmifuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/wmifuncs.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -16,7 +16,7 @@ #endif #endif /* RUN_WPP */
- #if (NTDDI_VERSION >= NTDDI_WINXP) +#if (NTDDI_VERSION >= NTDDI_WINXP)
NTKERNELAPI NTSTATUS
Modified: trunk/reactos/include/xdk/x86/ke.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/x86/ke.h?rev=48... ============================================================================== --- trunk/reactos/include/xdk/x86/ke.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/x86/ke.h [iso-8859-1] Tue Aug 10 13:53:10 2010 @@ -151,9 +151,15 @@ OUT PLARGE_INTEGER CurrentCount) { for (;;) { +#ifdef NONAMELESSUNION + CurrentCount->s.HighPart = KeTickCount.High1Time; + CurrentCount->s.LowPart = KeTickCount.LowPart; + if (CurrentCount->s.HighPart == KeTickCount.High2Time) break; +#else CurrentCount->HighPart = KeTickCount.High1Time; CurrentCount->LowPart = KeTickCount.LowPart; if (CurrentCount->HighPart == KeTickCount.High2Time) break; +#endif YieldProcessor(); } }