Skip to content

Commit ef5eada

Browse files
committed
[NDK][RTL] Fix RtlTryEnterCriticalSection() return type
The Win32 TryEnterCriticalSection(), which returns a 32-bit BOOL, directly redirects to NTDLL!RtlTryEnterCriticalSection(). The latter should therefore return a 32-bit boolean as well: use the LOGICAL type for this purpose. This change has been validated with the System Informer phnt headers. This mismatch was caught by Marcin Jabłoński (TheNNX).
1 parent e250b3f commit ef5eada

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sdk/include/ndk/rtlfuncs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3214,7 +3214,7 @@ RtlLeaveCriticalSection(
32143214
);
32153215

32163216
NTSYSAPI
3217-
BOOLEAN
3217+
LOGICAL
32183218
NTAPI
32193219
RtlTryEnterCriticalSection(
32203220
_In_ PRTL_CRITICAL_SECTION CriticalSection

sdk/lib/rtl/critical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
819819
* RtlTryEnterCriticalSection
820820
* @implemented NT4
821821
*
822-
* Attemps to gain ownership of the critical section without waiting.
822+
* Attempts to gain ownership of the critical section without waiting.
823823
*
824824
* Params:
825825
* CriticalSection - Critical section to attempt acquiring.
@@ -831,7 +831,7 @@ RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
831831
* None
832832
*
833833
*--*/
834-
BOOLEAN
834+
LOGICAL
835835
NTAPI
836836
RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
837837
{

0 commit comments

Comments
 (0)