Agreed..
When the assignment and assert are separated by a call
of X distance, the assert is certainly warranted.
Just not as it stands in ke_x.h
Perhaps you could factorize as suggested, Dmitri?
Best regards
L.
On 2016-09-26 10.28, ros-dev-request(a)reactos.org wrote:
Rationale is simple:
The real headers contain a KeEnterCriticalRegionThread function, which
has this assert, and a KeEnterCriticalRegion function, which calls
that function with KeGetCurrentThread() at input. This is an
optimization such that if you already have the current thread of
interest somewhere, you can call KeEnterCriticalRegionThread and avoid
reading from FS or GS again. ReactOS combines these two functions in
one, and as such the ASSERT appears pointless. Factoring the functions
would've been the correct approach -- not removing the ASSERT.
Best regards,
Alex Ionescu
--
There is one thing stronger than all the armies in the world,
and that's an idea whose time has come. [Victor Hugo]