[ros-dev] Public ddk headers vs ntoskrnl
Alex Ionescu
ionucu at videotron.ca
Tue Feb 10 17:21:49 CET 2009
The problem is that when compiling ReactOS, _NTDDK is set, when it
really shouldn't be.
So the inline version will actually never be used for ReactOS.
Since these headers are owned by ReactOS, you can simply hack the
header to force the inline to be used when _NTOSKRNL_ is set. Yes,
when compiling with MSVC, people will get the non-inlined version, but
that won't matter much.
Another option is to define
_ExQueryDepthSList as being inline.
Then in ntoskrnl.h, #define ExQueryDepthSList _ExQueryDepthSList. This
should work and also make ExFreeToNPagedLookasideList use the inline
version (if it doesn't, you can force it by using _ExQueryDepthSList
manually, but you shouldn't need to).
On 10-Feb-09, at 10:32 AM, Timo Kreuzer wrote:
> 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
>
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
Best regards,
Alex Ionescu
More information about the Ros-dev
mailing list