]> sourceware.org Git - newlib-cygwin.git/commitdiff
2004-10-15 Robert Wruck <wruck@tweerlei.de>
authorDanny Smith <dannysmith@users.sourceforge.net>
Fri, 15 Oct 2004 01:18:11 +0000 (01:18 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Fri, 15 Oct 2004 01:18:11 +0000 (01:18 +0000)
            Danny Smith  <dannysmith@users.sourceforge.net>

= include/winbase.h (InitializeSListHead, Interlocked*):
Guard with !__USE_NTOSKRNL__.

* include/ddk/ntddk.h (__USE_NTOSKRNL__): Define.
* include/ddk/winddk.h (InitializeSListHead, Interlocked*):
Guard with  __USE_NTOSKRNL__.
(ExInterlockedPopEntrySList, ExInterlockedPushEntrySList):
Add prototypes.  Guard macro definition with __USE_NTOSKRNL__
&& _WIN32_WINNT >= 0x0501
(ExAllocateFromNPagedLookasideList, ExAllocateFromPagedLookasideList,
ExFreeToNPagedLookasideList, ExFreeToPagedLookasideList):
Replace calts to InterlockedPopEntrySList, InterlockedPushEntrySList
with ExInterlockedPopEntrySList, ExInterlockedPushEntrySList.

* lib/ddk/ntosknl.def (ExInterlockedPopEntrySList,
ExInterlockedPushEntrySList)  Add stubs with fastcall decoration.
(ExDesktopObjectType, ExEventObjectType, ExSemaphoreObjectType,
ExWindowStationObjectType, IoAdapterObjectType,
IoDeviceHandlerObjectSize, IoDeviceHandlerObjectType,
IoDeviceObjectType, IoDriverObjectType, IoFileObjectType,
LpcPortObjectType, MmSectionObjectType, SeTokenObjectType):
Uncomment stubs.

winsup/w32api/ChangeLog
winsup/w32api/include/ddk/ntddk.h
winsup/w32api/include/ddk/winddk.h
winsup/w32api/include/winbase.h
winsup/w32api/lib/ddk/ntoskrnl.def

index 321f23ec81fa7939191af00098e86c6a0631e539..a8afaf14c7c96b729203dec20cdf83e20a61c365 100644 (file)
@@ -1,3 +1,29 @@
+2004-10-15  Robert Wruck  <wruck@tweerlei.de>
+            Danny Smith  <dannysmith@users.sourceforge.net>
+
+       = include/winbase.h (InitializeSListHead, Interlocked*):
+       Guard with !__USE_NTOSKRNL__.
+
+       * include/ddk/ntddk.h (__USE_NTOSKRNL__): Define.
+       * include/ddk/winddk.h (InitializeSListHead, Interlocked*):
+       Guard with  __USE_NTOSKRNL__. 
+       (ExInterlockedPopEntrySList, ExInterlockedPushEntrySList):
+       Add prototypes.  Guard macro definition with __USE_NTOSKRNL__ 
+       && _WIN32_WINNT >= 0x0501
+       (ExAllocateFromNPagedLookasideList, ExAllocateFromPagedLookasideList,
+       ExFreeToNPagedLookasideList, ExFreeToPagedLookasideList):
+       Replace calts to InterlockedPopEntrySList, InterlockedPushEntrySList
+       with ExInterlockedPopEntrySList, ExInterlockedPushEntrySList.
+
+       * lib/ddk/ntosknl.def (ExInterlockedPopEntrySList,
+       ExInterlockedPushEntrySList)  Add stubs with fastcall decoration.
+       (ExDesktopObjectType, ExEventObjectType, ExSemaphoreObjectType,
+       ExWindowStationObjectType, IoAdapterObjectType,
+       IoDeviceHandlerObjectSize, IoDeviceHandlerObjectType,
+       IoDeviceObjectType, IoDriverObjectType, IoFileObjectType,
+       LpcPortObjectType, MmSectionObjectType, SeTokenObjectType):
+       Uncomment stubs.
+
 2004-10-11  Robert Wruck  <wruck@tweerlei.de>
 
         * include/ddk/winddk.h (IoReleaseRemoveLockAndWait): Fix
index d227fe98ebdb1e68eccbcc0c074f25e48f63f2f4..fd78905fd0a8ab09bae1ac8b0a6a7d6485c2d77d 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
  * DEFINES:
- *    DBG          - Debugging enabled/disabled (0/1)
- *    POOL_TAGGING - Enable pool tagging
- *    _X86_        - X86 environment
+ *    DBG             - Debugging enabled/disabled (0/1)
+ *    POOL_TAGGING    - Enable pool tagging
+ *    _X86_           - X86 environment
+ *   __USE_NTOSKRNL__ - Use ntoskrnl.exe exports instead of kernel32.dll
  */
 
 #ifndef __NTDDK_H
 #pragma GCC system_header
 #endif
 
+#ifndef __USE_NTOSKRNL__
+#define __USE_NTOSKRNL__ 1
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index a183efd80b5d774cb10400d1955d86d1dea01c4d..771f57418b9ef862706db2d8eb7f8a937352f28c 100644 (file)
@@ -3809,6 +3809,11 @@ KeGetCurrentIrql(
 #define KeGetCurrentProcessorNumber() \
   ((ULONG)KeGetCurrentKPCR()->ProcessorNumber)
 
+
+#if  __USE_NTOSKRNL__
+/* CAREFUL: These are exported from ntoskrnl.exe as __fastcall functions,
+   but are also exported from kernel32.dll and declared in winbase.h as
+   __stdcall */
 #if !defined(__INTERLOCKED_DECLARED)
 #define __INTERLOCKED_DECLARED
 
@@ -3865,7 +3870,22 @@ InterlockedExchangeAdd(
 #define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \
   ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand))
 
+#if  (_WIN32_WINNT >= 0x0501)
+PSLIST_ENTRY
+DDKFASTAPI
+InterlockedPopEntrySList(
+  IN PSLIST_HEADER  ListHead);
+
+NTOSAPI
+PSLIST_ENTRY
+DDKFASTAPI
+InterlockedPushEntrySList(
+  IN PSLIST_HEADER  ListHead,
+  IN PSLIST_ENTRY  ListEntry);
+#endif /* _WIN32_WINNT >= 0x0501 */
+
 #endif /* !__INTERLOCKED_DECLARED */
+#endif /*  __USE_NTOSKRNL__ */
 
 NTOSAPI
 VOID
@@ -4150,23 +4170,6 @@ RemoveTailList(
   return Entry;
 }
 
-#if !defined(_WINBASE_H) || _WIN32_WINNT < 0x0501
-
-NTOSAPI
-PSLIST_ENTRY
-DDKFASTAPI
-InterlockedPopEntrySList(
-  IN PSLIST_HEADER  ListHead);
-
-NTOSAPI
-PSLIST_ENTRY
-DDKFASTAPI
-InterlockedPushEntrySList(
-  IN PSLIST_HEADER  ListHead,
-  IN PSLIST_ENTRY  ListEntry);
-
-#endif
-
 /*
  * USHORT
  * QueryDepthSList(
@@ -5063,18 +5066,52 @@ ExAcquireSharedWaitForExclusive(
   IN PERESOURCE  Resource,
   IN BOOLEAN  Wait);
 
+
+NTOSAPI
+PSINGLE_LIST_ENTRY
+DDKFASTAPI
+ExInterlockedPopEntrySList(
+  IN PSLIST_HEADER  ListHead,
+  IN PKSPIN_LOCK  Lock);
+
+
+NTOSAPI
+PSINGLE_LIST_ENTRY
+DDKFASTAPI
+ExInterlockedPushEntrySList(
+  IN PSLIST_HEADER  ListHead,
+  IN PSINGLE_LIST_ENTRY  ListEntry,
+  IN PKSPIN_LOCK  Lock);
+
+
+#if (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501)
+#define ExInterlockedPopEntrySList(_ListHead, \
+                                   _Lock) \
+  InterlockedPopEntrySList(_ListHead)
+
+#define ExInterlockedPushEntrySList(_ListHead, \
+                                    _ListEntry, \
+                                    _Lock) \
+  InterlockedPushEntrySList(_ListHead, _ListEntry)
+#endif /*  __USE_NTOSKRNL__ */
+
+#define ExQueryDepthSList(ListHead) QueryDepthSList(ListHead)
+
 static __inline PVOID
 ExAllocateFromNPagedLookasideList(
   IN PNPAGED_LOOKASIDE_LIST  Lookaside)
 {
-       PVOID Entry;
+  PVOID Entry;
 
-       Lookaside->TotalAllocates++;
-  Entry = InterlockedPopEntrySList(&Lookaside->ListHead);
-       if (Entry == NULL) {
-               Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
-               Entry = (Lookaside->Allocate)(Lookaside->Type, Lookaside->Size, Lookaside->Tag);
-       }
+  Lookaside->TotalAllocates++;
+  Entry = ExInterlockedPopEntrySList(&Lookaside->ListHead,
+                                    &Lookaside->Obsoleted);
+  if (Entry == NULL) {
+    Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
+    Entry = (Lookaside->Allocate)(Lookaside->Type,
+                                 Lookaside->Size,
+                                 Lookaside->Tag);
+  }
   return Entry;
 }
 
@@ -5085,15 +5122,49 @@ ExAllocateFromPagedLookasideList(
   PVOID Entry;
 
   Lookaside->TotalAllocates++;
-  Entry = InterlockedPopEntrySList(&Lookaside->ListHead);
+  Entry = ExInterlockedPopEntrySList(&Lookaside->ListHead,
+                                    &Lookaside->Obsoleted);
   if (Entry == NULL) {
     Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
     Entry = (Lookaside->Allocate)(Lookaside->Type,
-      Lookaside->Size, Lookaside->Tag);
+                                 Lookaside->Size,
+                                 Lookaside->Tag);
   }
   return Entry;
 }
 
+static __inline VOID
+ExFreeToNPagedLookasideList(
+  IN PNPAGED_LOOKASIDE_LIST  Lookaside,
+  IN PVOID  Entry)
+{
+  Lookaside->TotalFrees++;
+  if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
+    Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
+    (Lookaside->Free)(Entry);
+  } else {
+    ExInterlockedPushEntrySList(&Lookaside->ListHead,
+                               (PSLIST_ENTRY)Entry,
+                               &Lookaside->Obsoleted);
+  }
+}
+
+static __inline VOID
+ExFreeToPagedLookasideList(
+  IN PPAGED_LOOKASIDE_LIST  Lookaside,
+  IN PVOID  Entry)
+{
+  Lookaside->TotalFrees++;
+  if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
+    Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
+    (Lookaside->Free)(Entry);
+  } else {
+    ExInterlockedPushEntrySList(&Lookaside->ListHead,
+                               (PSLIST_ENTRY)Entry,
+                               &Lookaside->Obsoleted);
+  }
+}
+
 NTOSAPI
 PVOID
 DDKAPI
@@ -5194,37 +5265,6 @@ ExFreePoolWithTag(
   IN PVOID  P,
   IN ULONG  Tag);
 
-#define ExQueryDepthSList(ListHead) QueryDepthSList(ListHead)
-
-static __inline VOID
-ExFreeToNPagedLookasideList(
-  IN PNPAGED_LOOKASIDE_LIST  Lookaside,
-  IN PVOID  Entry)
-{
-  Lookaside->TotalFrees++;
-       if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
-               Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
-               (Lookaside->Free)(Entry);
-  } else {
-               InterlockedPushEntrySList(&Lookaside->ListHead,
-      (PSLIST_ENTRY)Entry);
-       }
-}
-
-static __inline VOID
-ExFreeToPagedLookasideList(
-  IN PPAGED_LOOKASIDE_LIST  Lookaside,
-  IN PVOID  Entry)
-{
-  Lookaside->TotalFrees++;
-  if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
-    Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
-    (Lookaside->Free)(Entry);
-  } else {
-    InterlockedPushEntrySList(&Lookaside->ListHead, (PSLIST_ENTRY)Entry);
-  }
-}
-
 /*
  * ERESOURCE_THREAD
  * ExGetCurrentResourceThread(
@@ -5404,15 +5444,6 @@ ExfInterlockedPopEntryList(
   IN PSINGLE_LIST_ENTRY  ListHead,
   IN PKSPIN_LOCK  Lock);
 
-/*
- * PSINGLE_LIST_ENTRY
- * ExInterlockedPopEntrySList(
- *   IN PSLIST_HEADER  ListHead,
- *   IN PKSPIN_LOCK  Lock)
- */
-#define ExInterlockedPopEntrySList(_ListHead, \
-                                   _Lock) \
-  InterlockedPopEntrySList(_ListHead)
 
 NTOSAPI
 PSINGLE_LIST_ENTRY
@@ -5430,17 +5461,6 @@ ExfInterlockedPushEntryList(
   IN PSINGLE_LIST_ENTRY  ListEntry,
   IN PKSPIN_LOCK  Lock);
 
-/*
- * PSINGLE_LIST_ENTRY FASTCALL
- * ExInterlockedPushEntrySList(
- *   IN PSLIST_HEADER  ListHead,
- *   IN PSINGLE_LIST_ENTRY  ListEntry,
- *   IN PKSPIN_LOCK  Lock)
- */
-#define ExInterlockedPushEntrySList(_ListHead, \
-                                    _ListEntry, \
-                                    _Lock) \
-  InterlockedPushEntrySList(_ListHead, _ListEntry)
 
 NTOSAPI
 PLIST_ENTRY
index ad82353e7b67857ca4bca82675c13e682f386b44..eb31442cad155153cf7efe8e703eff6993a64682 100644 (file)
@@ -1574,7 +1574,11 @@ WINBASEAPI BOOL WINAPI InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION,
 WINBASEAPI DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD);
 WINBASEAPI BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
 WINBASEAPI BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
-#if !defined(__WINDDK_H) && _WIN32_WINNT >= 0x0501
+
+#if !(__USE_NTOSKRNL__)
+/* CAREFUL: These are exported from ntoskrnl.exe and declared in winddk.h
+   as __fastcall functions, but are  exported from kernel32.dll as __stdcall */
+#if (_WIN32_WINNT >= 0x0501)
 WINBASEAPI VOID WINAPI InitializeSListHead(PSLIST_HEADER);
 #endif
 #ifndef __INTERLOCKED_DECLARED
@@ -1598,6 +1602,8 @@ PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER);
 PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY);
 #endif
 #endif /* __INTERLOCKED_DECLARED */
+#endif /*  __USE_NTOSKRNL__ */
+
 WINBASEAPI BOOL WINAPI IsBadCodePtr(FARPROC);
 WINBASEAPI BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT);
 WINBASEAPI BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT);
index 467f494130af7271ebe131ae74a327a365d5ae67..99e3280c13e79f411d129483be0d29e2388e5416 100644 (file)
@@ -71,10 +71,10 @@ ExCreateCallback@16
 ExDeleteNPagedLookasideList@4
 ExDeletePagedLookasideList@4
 ExDeleteResourceLite@4
-;ExDesktopObjectType DATA
+ExDesktopObjectType DATA
 ;ExDisableResourceBoostLite
 ;ExEnumHandleTable
-;ExEventObjectType DATA
+ExEventObjectType DATA
 ExExtendZone@12
 @Exfi386InterlockedDecrementLong@4
 @Exfi386InterlockedExchangeUlong@8
@@ -113,9 +113,9 @@ ExInterlockedExtendZone@16
 ExInterlockedInsertHeadList@12
 ExInterlockedInsertTailList@12
 ExInterlockedPopEntryList@8
-;ExInterlockedPopEntrySList
+@ExInterlockedPopEntrySList@8
 ExInterlockedPushEntryList@12
-;ExInterlockedPushEntrySList
+@ExInterlockedPushEntrySList@12
 ExInterlockedRemoveHeadList@8
 ExIsProcessorFeaturePresent@4
 ExIsResourceAcquiredExclusiveLite@4
@@ -137,7 +137,7 @@ ExReleaseResourceForThreadLite@8
 @ExReleaseResourceLite@4
 ;ExReleaseRundownProtection
 ;ExRundownCompleted
-;ExSemaphoreObjectType DATA
+ExSemaphoreObjectType DATA
 ExSetResourceOwnerPointer@8
 ExSetTimerResolution@8
 ;ExSystemExceptionFilter
@@ -146,7 +146,7 @@ ExUnregisterCallback@4
 ExUuidCreate@4
 ExVerifySuite@4
 ;ExWaitForRundownProtectionRelease
-;ExWindowStationObjectType DATA
+ExWindowStationObjectType DATA
 ;FsRtlAcquireFileExclusive
 ;FsRtlAddLargeMcbEntry
 ;FsRtlAddMcbEntry
@@ -280,7 +280,7 @@ FsRtlIsTotalDeviceFailure@4
 IoAcquireCancelSpinLock@4
 IoAcquireRemoveLockEx@20
 ;IoAcquireVpbSpinLock
-;IoAdapterObjectType DATA
+IoAdapterObjectType DATA
 IoAllocateAdapterChannel@20
 IoAllocateController@16
 IoAllocateDriverObjectExtension@16
@@ -332,15 +332,15 @@ IoDeleteDevice@4
 ;IoDeleteDriver
 IoDeleteSymbolicLink@4
 IoDetachDevice@4
-;IoDeviceHandlerObjectSize DATA
-;IoDeviceHandlerObjectType DATA
-;IoDeviceObjectType DATA
+IoDeviceHandlerObjectSize DATA
+IoDeviceHandlerObjectType DATA
+IoDeviceObjectType DATA
 IoDisconnectInterrupt@4
-;IoDriverObjectType DATA
+IoDriverObjectType DATA
 ;IoEnqueueIrp
 ;IoEnumerateDeviceObjectList
 ;IoFastQueryNetworkAttributes
-;IoFileObjectType DATA
+IoFileObjectType DATA
 ;IoForwardAndCatchIrp
 IoForwardIrpSynchronously@8
 IoFreeController@4
@@ -625,7 +625,7 @@ KeWaitForSingleObject@20
 ;LdrEnumResources
 ;LdrFindResourceDirectory_U
 ;LdrFindResource_U
-;LpcPortObjectType DATA
+LpcPortObjectType DATA
 ;LpcRequestPort
 ;LpcRequestWaitReplyPort
 ;LsaCallAuthenticationPackage
@@ -692,7 +692,7 @@ MmProtectMdlSystemAddress@8
 MmQuerySystemSize@0
 MmRemovePhysicalMemory@8
 MmResetDriverPaging@4
-;MmSectionObjectType DATA
+MmSectionObjectType DATA
 MmSecureVirtualMemory@12
 ;MmSetAddressRangeModified
 ;MmSetBankedSection
@@ -1226,7 +1226,7 @@ SeSinglePrivilegeCheck@8
 ;SeTokenImpersonationLevel
 ;SeTokenIsAdmin
 ;SeTokenIsRestricted
-;SeTokenObjectType DATA
+SeTokenObjectType DATA
 ;SeTokenType
 ;SeUnlockSubjectContext
 ;SeUnregisterLogonSessionTerminatedRoutine
This page took 0.050473 seconds and 5 git commands to generate.