<div dir="ltr">*but since the only documented way to access it is from the current thread, I thought it was unnecessary.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 24, 2019 at 10:41 AM Derek Lesho <<a href="mailto:dereklesho52@gmail.com">dereklesho52@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I thought about that, but since the only documented way to access it is from the current thread.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 24, 2019 at 10:32 AM Dmitry Timoshkov <<a href="mailto:dmitry@baikal.ru" target="_blank">dmitry@baikal.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Derek Lesho <<a href="mailto:dereklesho52@gmail.com" target="_blank">dereklesho52@gmail.com</a>> wrote:<br>
<br>
>  void WINAPI KeEnterCriticalRegion(void)<br>
>  {<br>
> -    FIXME(": stub\n");<br>
> +    TRACE(": semi-stub\n");<br>
> +    KeGetCurrentThread()->critical_region_count++;<br>
>  }<br>
...<br>
>  void WINAPI KeLeaveCriticalRegion(void)<br>
>  {<br>
> -    FIXME(": stub\n");<br>
> +    TRACE(": semi-stub\n");<br>
> +    KeGetCurrentThread()->critical_region_count--;<br>
>  }<br>
...<br>
> +BOOLEAN WINAPI KeAreApcsDisabled(void)<br>
> +{<br>
> +    return !!KeGetCurrentThread()->critical_region_count;<br>
> +}<br>
<br>
Shouldn't these APIs use interlocked operations?<br>
<br>
-- <br>
Dmitry.<br>
</blockquote></div>
</blockquote></div>