[Xboxkrnl] Use towupper in RtlUpcaseUnicodeChar for portability
std::ctype<char16_t> is a non-standard extension that's not available on all platforms. Neither this nor the original technically match the Windows kernel's fixed Unicode table approach and can produce different results based on system locale.
This commit is contained in:
@@ -229,8 +229,8 @@ void RtlInitAnsiString_entry(pointer_t<X_ANSI_STRING> destination,
|
||||
DECLARE_XBOXKRNL_EXPORT1(RtlInitAnsiString, kNone, kImplemented);
|
||||
// https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlupcaseunicodechar
|
||||
dword_result_t RtlUpcaseUnicodeChar_entry(dword_t SourceCharacter) {
|
||||
return std::use_facet<std::ctype<char16_t>>(std::locale())
|
||||
.toupper(SourceCharacter);
|
||||
return static_cast<uint32_t>(std::towupper(
|
||||
static_cast<wint_t>(static_cast<uint32_t>(SourceCharacter))));
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(RtlUpcaseUnicodeChar, kNone, kImplemented);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user