I thought about that, but since the only documented way to access it is from the current thread.
Derek Lesho <dereklesho52@gmail.com> wrote:
> void WINAPI KeEnterCriticalRegion(void)
> {
> - FIXME(": stub\n");
> + TRACE(": semi-stub\n");
> + KeGetCurrentThread()->critical_region_count++;
> }
...
> void WINAPI KeLeaveCriticalRegion(void)
> {
> - FIXME(": stub\n");
> + TRACE(": semi-stub\n");
> + KeGetCurrentThread()->critical_region_count--;
> }
...
> +BOOLEAN WINAPI KeAreApcsDisabled(void)
> +{
> + return !!KeGetCurrentThread()->critical_region_count;
> +}
Shouldn't these APIs use interlocked operations?
--
Dmitry.