Turn %p format compliant with POSIX, add %P XTOS extension to print pointers uppercase
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 27s
Builds / ExectOS (i686) (push) Successful in 28s

This commit is contained in:
Rafal Kupiec 2024-02-16 22:36:48 +01:00
parent 98acc6f3d4
commit df627aeb42
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -857,7 +857,14 @@ RtlpFormatWideStringArgumentSpecifier(IN PRTL_PRINT_CONTEXT Context,
FormatProperties.Radix = 8; FormatProperties.Radix = 8;
break; break;
case L'p': case L'p':
/* Pointer argument as hexadecimal number (uppercase) */ /* Pointer argument as hexadecimal number (lowercase) */
FormatProperties.VariableType = Integer;
FormatProperties.IntegerSize = sizeof(UINT_PTR);
FormatProperties.Radix = 16;
FormatProperties.PrintRadix = TRUE;
break;
case L'P':
/* XTOS extension: Pointer argument as hexadecimal number (uppercase) */
FormatProperties.VariableType = Integer; FormatProperties.VariableType = Integer;
FormatProperties.IntegerSize = sizeof(UINT_PTR); FormatProperties.IntegerSize = sizeof(UINT_PTR);
FormatProperties.Radix = 16; FormatProperties.Radix = 16;
@ -1504,17 +1511,8 @@ RtlpWriteWideStringIntegerValue(IN PRTL_PRINT_CONTEXT Context,
Prefix[PrefixLength] = L'0'; Prefix[PrefixLength] = L'0';
PrefixLength += 1; PrefixLength += 1;
/* Check if uppercase is required */
if(FormatProperties->PrintUpperCase != 0)
{
/* Write uppercase 'X' character */
Prefix[PrefixLength] = L'X';
}
else
{
/* Write lowercase 'x' character */ /* Write lowercase 'x' character */
Prefix[PrefixLength] = L'x'; Prefix[PrefixLength] = L'x';
}
PrefixLength += 1; PrefixLength += 1;
} }