ntdll: Implement RtlIsEcCode().

This commit is contained in:
Alexandre Julliard 2023-05-09 12:43:53 +02:00
parent c722353c87
commit f2623cca38
3 changed files with 16 additions and 0 deletions

View file

@ -836,6 +836,7 @@
@ stdcall RtlIsCriticalSectionLocked(ptr)
@ stdcall RtlIsCriticalSectionLockedByThread(ptr)
@ stdcall RtlIsDosDeviceName_U(wstr)
@ stdcall -arch=x86_64 -norelay RtlIsEcCode(ptr)
@ stub RtlIsGenericTableEmpty
# @ stub RtlIsGenericTableEmptyAvl
@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr)

View file

@ -680,6 +680,18 @@ void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len )
}
/**************************************************************************
* RtlIsEcCode (NTDLL.@)
*/
BOOLEAN WINAPI RtlIsEcCode( const void *ptr )
{
const UINT64 *map = (const UINT64 *)NtCurrentTeb()->Peb->EcCodeBitMap;
ULONG_PTR page = (ULONG_PTR)ptr / page_size;
if (!map) return FALSE;
return (map[page / 64] >> (page & 63)) & 1;
}
static ULONG64 get_int_reg( CONTEXT *context, int reg )
{
return *(&context->Rax + reg);

View file

@ -4615,6 +4615,9 @@ NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE);
NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *);
NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *);
NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR);
#ifdef __x86_64__
NTSYSAPI BOOLEAN WINAPI RtlIsEcCode(const void*);
#endif
NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN);
NTSYSAPI NTSTATUS WINAPI RtlIsNormalizedString(ULONG,const WCHAR*,INT,BOOLEAN*);
NTSYSAPI BOOLEAN WINAPI RtlIsProcessorFeaturePresent(UINT);