[ros-dev] Public ddk headers vs ntoskrnl

Timo Kreuzer timo.kreuzer at web.de
Tue Feb 10 16:32:01 CET 2009


Hi,

I am currently having a small problem on the x64 branch, maybe someone
can help me.

In wdm.h there's the following declarations:

#if defined (_WIN64)
#if defined(_NTDRIVER_) || defined(_NTDDK) || defined(_NTIFS_) || \
    defined(_NTHAL_) || defined(_NTOSP_)
NTKRNLAPI
USHORT
ExQueryDepthSList(IN PSLIST_HEADER Listhead);
#else
FORCEINLINE
USHORT
ExQueryDepthSList(IN PSLIST_HEADER Listhead)
{
    return (USHORT)(ListHead->Alignment & 0xffff);
}
#endif
#else
#define ExQueryDepthSList(listhead) (listhead)->Depth
#endif

So when compiling ntoskrnl, ExQueryDepthSList is not inlined. Later in
wdm.h (currently in our winddk.h, but to be moved to wdm.h)
ExQueryDepthSList is used in ExFreeToNPagedLookasideList inline function.

But I want ExQueryDepthSList to be inlined from within ntoskrnl. The
question is how can I achieve this?
If I #define it to be inline in ntoskrnl's private headers, it will not
affect ExFreeToNPagedLookasideList.
When I declare it as an inline function after the header is included, I
get a warning that it was declared inline after being used and that a
static declaration follows a non-static. (Does anyone know hoe to
disable these stupid warnings?)
Declaring it inline before including wdm.h doesn't work, as the needed
declaration for SLIST_HEADER is missing.

Anyone got any other idea? I'd like to avoid hacking our public headers,
to keep them as compatible to ms headers as possible.

Regards,
Timo



More information about the Ros-dev mailing list