This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] w32api winddk.h interlocked lists


I reported this as a bug at the MinGW sf.net site, but it seems that w32api is maintained here.

winddk.h defines some functions inline (ExAllocateFromNPagedLookasideList, ExInterlockedPushEntrySList etc.).
The problem I have is that those inline functions use InterlockedPushEntrySList and InterlockedPopEntrySList which 
do not exist in Win2k ntoskrnl.exe.

So I created the attached patch which includes the following changes:

- Add #if that checks WINVER (I don't know a better approach) and uses the ExInterlockedPushEntrySList and 
ExInterlockedPopEntrySList exported by ntoskrnl.exe instead of inline versions (why are those defined as inline 
anyway?).

- Altered ExAllocateFromNPagedLookasideList and ExFreeToNPagedLookasideList to use ExInterlockedX #if WINVER <= 
0x0500.

- Since ExInterlockedX are now used in the inline functions, I moved the Ex..NPagedLookasideList definitions down so 
that ExInterlockedX is declared above them (otherwise the compiler won't call them as fastcall).


Another point I came across is that I had to put some functions in my .def file since those are not included in 
libntoskrnl.a:

- The device types are declared in winddk.h but not included:
   ExDesktopObjectType
   ExEventObjectType
   ExSemaphoreObjectType
   ExWindowStationObjectType
   IoAdapterObjectType
   IoDeviceHandlerObjectSize
   IoDeviceHandlerObjectType
   IoDeviceObjectType
   IoDriverObjectType
   IoFileObjectType
   LpcPortObjectType
   MmSectionObjectType
   SeTokenObjectType

- _snwprintf and related functions are not included

- KeSetTimerEx is not included

- ExInterlockedPushEntrySList and ExInterlockedPopEntrySList are not included


robert

Attachment: winddk.h.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]