mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 07:41:51 +00:00
[RTL] Add internal RtlpUpcaseUnicodeChar function and use instead RtlUpcaseUnicodeChar internally in RTL
svn path=/trunk/; revision=72691
This commit is contained in:
parent
406bb0105f
commit
ce4186a1eb
6 changed files with 61 additions and 50 deletions
|
@ -113,7 +113,7 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
|
||||||
if (RtlpIsShortIllegal(Char))
|
if (RtlpIsShortIllegal(Char))
|
||||||
Char = L'_';
|
Char = L'_';
|
||||||
else if (Char >= L'a' && Char <= L'z')
|
else if (Char >= L'a' && Char <= L'z')
|
||||||
Char = RtlUpcaseUnicodeChar(Char);
|
Char = RtlpUpcaseUnicodeChar(Char);
|
||||||
|
|
||||||
Context->NameBuffer[Context->NameLength] = Char;
|
Context->NameBuffer[Context->NameLength] = Char;
|
||||||
++Context->NameLength;
|
++Context->NameLength;
|
||||||
|
@ -137,7 +137,7 @@ RtlGenerate8dot3Name(IN PUNICODE_STRING Name,
|
||||||
if (RtlpIsShortIllegal(Char))
|
if (RtlpIsShortIllegal(Char))
|
||||||
Char = L'_';
|
Char = L'_';
|
||||||
else if (Char >= L'a' && Char <= L'z')
|
else if (Char >= L'a' && Char <= L'z')
|
||||||
Char = RtlUpcaseUnicodeChar(Char);
|
Char = RtlpUpcaseUnicodeChar(Char);
|
||||||
|
|
||||||
Context->ExtensionBuffer[Context->ExtensionLength++] = Char;
|
Context->ExtensionBuffer[Context->ExtensionLength++] = Char;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ RtlCustomCPToUnicodeN(IN PCPTABLEINFO CustomCP,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (CustomCP->DBCSCodePage == 0)
|
if (!CustomCP->DBCSCodePage)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (CustomSize > (UnicodeSize / sizeof(WCHAR)))
|
if (CustomSize > (UnicodeSize / sizeof(WCHAR)))
|
||||||
|
@ -62,7 +62,7 @@ RtlCustomCPToUnicodeN(IN PCPTABLEINFO CustomCP,
|
||||||
else
|
else
|
||||||
Size = CustomSize;
|
Size = CustomSize;
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size * sizeof(WCHAR);
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
|
@ -206,7 +206,6 @@ RtlInitNlsTables(IN PUSHORT AnsiTableBase,
|
||||||
if (AnsiTableBase && OemTableBase && CaseTableBase)
|
if (AnsiTableBase && OemTableBase && CaseTableBase)
|
||||||
{
|
{
|
||||||
RtlInitCodePageTable(AnsiTableBase, &NlsTable->AnsiTableInfo);
|
RtlInitCodePageTable(AnsiTableBase, &NlsTable->AnsiTableInfo);
|
||||||
|
|
||||||
RtlInitCodePageTable(OemTableBase, &NlsTable->OemTableInfo);
|
RtlInitCodePageTable(OemTableBase, &NlsTable->OemTableInfo);
|
||||||
|
|
||||||
NlsTable->UpperCaseTable = (PUSHORT)CaseTableBase + 2;
|
NlsTable->UpperCaseTable = (PUSHORT)CaseTableBase + 2;
|
||||||
|
@ -229,7 +228,7 @@ RtlMultiByteToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (!NlsMbCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (MbSize > (UnicodeSize / sizeof(WCHAR)))
|
if (MbSize > (UnicodeSize / sizeof(WCHAR)))
|
||||||
|
@ -237,7 +236,7 @@ RtlMultiByteToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
else
|
else
|
||||||
Size = MbSize;
|
Size = MbSize;
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size * sizeof(WCHAR);
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
|
@ -274,7 +273,7 @@ RtlMultiByteToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
*UnicodeString++ = NlsLeadByteInfo[LeadByteInfo + *(PUCHAR)MbString++];
|
*UnicodeString++ = NlsLeadByteInfo[LeadByteInfo + *(PUCHAR)MbString++];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = i * sizeof(WCHAR);
|
*ResultSize = i * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +368,7 @@ RtlOemToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (NlsMbOemCodePageTag == FALSE)
|
if (!NlsMbOemCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (OemSize > (UnicodeSize / sizeof(WCHAR)))
|
if (OemSize > (UnicodeSize / sizeof(WCHAR)))
|
||||||
|
@ -377,7 +376,7 @@ RtlOemToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
else
|
else
|
||||||
Size = OemSize;
|
Size = OemSize;
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size * sizeof(WCHAR);
|
*ResultSize = Size * sizeof(WCHAR);
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
|
@ -419,7 +418,7 @@ RtlOemToUnicodeN(OUT PWCHAR UnicodeString,
|
||||||
NlsOemLeadByteInfo[OemLeadByteInfo + *(PUCHAR)OemString++];
|
NlsOemLeadByteInfo[OemLeadByteInfo + *(PUCHAR)OemString++];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = i * sizeof(WCHAR);
|
*ResultSize = i * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +478,7 @@ RtlUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (CustomCP->DBCSCodePage == 0)
|
if (!CustomCP->DBCSCodePage)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
|
||||||
|
@ -487,7 +486,7 @@ RtlUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP,
|
||||||
else
|
else
|
||||||
Size = UnicodeSize / sizeof(WCHAR);
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size;
|
*ResultSize = Size;
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
|
@ -522,16 +521,14 @@ RtlUnicodeToMultiByteN(OUT PCHAR MbString,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (!NlsMbCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
Size = (UnicodeSize > (MbSize * sizeof (WCHAR)))
|
Size = (UnicodeSize > (MbSize * sizeof (WCHAR)))
|
||||||
? MbSize : (UnicodeSize / sizeof (WCHAR));
|
? MbSize : (UnicodeSize / sizeof (WCHAR));
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
{
|
|
||||||
*ResultSize = Size;
|
*ResultSize = Size;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
|
@ -573,7 +570,7 @@ RtlUnicodeToMultiByteN(OUT PCHAR MbString,
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = MbSize - i;
|
*ResultSize = MbSize - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,7 +637,7 @@ RtlUnicodeToOemN(OUT PCHAR OemString,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (NlsMbOemCodePageTag == FALSE)
|
if (!NlsMbOemCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
|
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
|
||||||
|
@ -648,7 +645,7 @@ RtlUnicodeToOemN(OUT PCHAR OemString,
|
||||||
else
|
else
|
||||||
Size = UnicodeSize / sizeof(WCHAR);
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size;
|
*ResultSize = Size;
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
|
@ -693,7 +690,7 @@ RtlUnicodeToOemN(OUT PCHAR OemString,
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = OemSize - i;
|
*ResultSize = OemSize - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,12 +701,10 @@ RtlUnicodeToOemN(OUT PCHAR OemString,
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
WCHAR NTAPI
|
WCHAR NTAPI
|
||||||
RtlUpcaseUnicodeChar(IN WCHAR Source)
|
RtlpUpcaseUnicodeChar(IN WCHAR Source)
|
||||||
{
|
{
|
||||||
USHORT Offset;
|
USHORT Offset;
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
|
||||||
|
|
||||||
if (Source < 'a')
|
if (Source < 'a')
|
||||||
return Source;
|
return Source;
|
||||||
|
|
||||||
|
@ -728,6 +723,17 @@ RtlUpcaseUnicodeChar(IN WCHAR Source)
|
||||||
return Source + (SHORT)Offset;
|
return Source + (SHORT)Offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
WCHAR NTAPI
|
||||||
|
RtlUpcaseUnicodeChar(IN WCHAR Source)
|
||||||
|
{
|
||||||
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
|
return RtlpUpcaseUnicodeChar(Source);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -758,7 +764,7 @@ RtlUpcaseUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP,
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
UpcaseChar = RtlUpcaseUnicodeChar(*UnicodeString);
|
UpcaseChar = RtlpUpcaseUnicodeChar(*UnicodeString);
|
||||||
*CustomString = ((PCHAR)CustomCP->WideCharTable)[UpcaseChar];
|
*CustomString = ((PCHAR)CustomCP->WideCharTable)[UpcaseChar];
|
||||||
++CustomString;
|
++CustomString;
|
||||||
++UnicodeString;
|
++UnicodeString;
|
||||||
|
@ -790,7 +796,7 @@ RtlUpcaseUnicodeToMultiByteN(OUT PCHAR MbString,
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (!NlsMbCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
|
if (UnicodeSize > (MbSize * sizeof(WCHAR)))
|
||||||
|
@ -798,12 +804,12 @@ RtlUpcaseUnicodeToMultiByteN(OUT PCHAR MbString,
|
||||||
else
|
else
|
||||||
Size = UnicodeSize / sizeof(WCHAR);
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size;
|
*ResultSize = Size;
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
UpcaseChar = RtlUpcaseUnicodeChar(*UnicodeString);
|
UpcaseChar = RtlpUpcaseUnicodeChar(*UnicodeString);
|
||||||
*MbString = NlsUnicodeToAnsiTable[UpcaseChar];
|
*MbString = NlsUnicodeToAnsiTable[UpcaseChar];
|
||||||
MbString++;
|
MbString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
|
@ -837,7 +843,7 @@ RtlUpcaseUnicodeToOemN(OUT PCHAR OemString,
|
||||||
|
|
||||||
ASSERT(NlsUnicodeToOemTable != NULL);
|
ASSERT(NlsUnicodeToOemTable != NULL);
|
||||||
|
|
||||||
if (NlsMbOemCodePageTag == FALSE)
|
if (!NlsMbOemCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
|
if (UnicodeSize > (OemSize * sizeof(WCHAR)))
|
||||||
|
@ -845,12 +851,12 @@ RtlUpcaseUnicodeToOemN(OUT PCHAR OemString,
|
||||||
else
|
else
|
||||||
Size = UnicodeSize / sizeof(WCHAR);
|
Size = UnicodeSize / sizeof(WCHAR);
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = Size;
|
*ResultSize = Size;
|
||||||
|
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
UpcaseChar = RtlUpcaseUnicodeChar(*UnicodeString);
|
UpcaseChar = RtlpUpcaseUnicodeChar(*UnicodeString);
|
||||||
*OemString = NlsUnicodeToOemTable[UpcaseChar];
|
*OemString = NlsUnicodeToOemTable[UpcaseChar];
|
||||||
OemString++;
|
OemString++;
|
||||||
UnicodeString++;
|
UnicodeString++;
|
||||||
|
@ -866,7 +872,7 @@ RtlUpcaseUnicodeToOemN(OUT PCHAR OemString,
|
||||||
|
|
||||||
for (i = OemSize, Size = UnicodeSize / sizeof(WCHAR); i && Size; i--, Size--)
|
for (i = OemSize, Size = UnicodeSize / sizeof(WCHAR); i && Size; i--, Size--)
|
||||||
{
|
{
|
||||||
WideChar = RtlUpcaseUnicodeChar(*UnicodeString++);
|
WideChar = RtlpUpcaseUnicodeChar(*UnicodeString++);
|
||||||
|
|
||||||
if (WideChar < 0x80)
|
if (WideChar < 0x80)
|
||||||
{
|
{
|
||||||
|
@ -891,7 +897,7 @@ RtlUpcaseUnicodeToOemN(OUT PCHAR OemString,
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultSize != NULL)
|
if (ResultSize)
|
||||||
*ResultSize = OemSize - i;
|
*ResultSize = OemSize - i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -926,7 +932,7 @@ RtlUpperChar(IN CHAR Source)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (NlsMbCodePageTag == FALSE)
|
if (!NlsMbCodePageTag)
|
||||||
{
|
{
|
||||||
/* single-byte code page */
|
/* single-byte code page */
|
||||||
|
|
||||||
|
@ -934,7 +940,7 @@ RtlUpperChar(IN CHAR Source)
|
||||||
Unicode = NlsAnsiToUnicodeTable[(UCHAR)Source];
|
Unicode = NlsAnsiToUnicodeTable[(UCHAR)Source];
|
||||||
|
|
||||||
/* upcase conversion */
|
/* upcase conversion */
|
||||||
Unicode = RtlUpcaseUnicodeChar (Unicode);
|
Unicode = RtlpUpcaseUnicodeChar (Unicode);
|
||||||
|
|
||||||
/* unicode -> ansi */
|
/* unicode -> ansi */
|
||||||
Destination = NlsUnicodeToAnsiTable[(USHORT)Unicode];
|
Destination = NlsUnicodeToAnsiTable[(USHORT)Unicode];
|
||||||
|
|
|
@ -614,7 +614,7 @@ RtlGetFullPathName_Ustr(
|
||||||
ASSERT(FileNameBuffer[1] == L':');
|
ASSERT(FileNameBuffer[1] == L':');
|
||||||
ASSERT(IS_PATH_SEPARATOR(FileNameBuffer[2]));
|
ASSERT(IS_PATH_SEPARATOR(FileNameBuffer[2]));
|
||||||
|
|
||||||
// FileNameBuffer[0] = RtlUpcaseUnicodeChar(FileNameBuffer[0]);
|
// FileNameBuffer[0] = RtlpUpcaseUnicodeChar(FileNameBuffer[0]);
|
||||||
Prefix = FileNameBuffer;
|
Prefix = FileNameBuffer;
|
||||||
PrefixLength = 3 * sizeof(WCHAR);
|
PrefixLength = 3 * sizeof(WCHAR);
|
||||||
Source += 3;
|
Source += 3;
|
||||||
|
@ -631,8 +631,8 @@ RtlGetFullPathName_Ustr(
|
||||||
Source += 2;
|
Source += 2;
|
||||||
SourceLength -= 2 * sizeof(WCHAR);
|
SourceLength -= 2 * sizeof(WCHAR);
|
||||||
|
|
||||||
CurDrive = RtlUpcaseUnicodeChar(CurDirName->Buffer[0]);
|
CurDrive = RtlpUpcaseUnicodeChar(CurDirName->Buffer[0]);
|
||||||
NewDrive = RtlUpcaseUnicodeChar(FileNameBuffer[0]);
|
NewDrive = RtlpUpcaseUnicodeChar(FileNameBuffer[0]);
|
||||||
|
|
||||||
if ((NewDrive != CurDrive) || CurDirName->Buffer[1] != L':')
|
if ((NewDrive != CurDrive) || CurDirName->Buffer[1] != L':')
|
||||||
{
|
{
|
||||||
|
|
|
@ -230,4 +230,9 @@ typedef struct _RTL_BITMAP_RUN64
|
||||||
ULONG64 NumberOfBits;
|
ULONG64 NumberOfBits;
|
||||||
} RTL_BITMAP_RUN64, *PRTL_BITMAP_RUN64;
|
} RTL_BITMAP_RUN64, *PRTL_BITMAP_RUN64;
|
||||||
|
|
||||||
|
/* nls.c */
|
||||||
|
WCHAR
|
||||||
|
NTAPI
|
||||||
|
RtlpUpcaseUnicodeChar(IN WCHAR Source);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -528,7 +528,7 @@ RtlIsValidOemCharacter(IN PWCHAR Char)
|
||||||
Offset = NlsOemLeadByteInfo[HIBYTE(OemChar)];
|
Offset = NlsOemLeadByteInfo[HIBYTE(OemChar)];
|
||||||
|
|
||||||
/* Receive Unicode character from the table */
|
/* Receive Unicode character from the table */
|
||||||
UnicodeChar = RtlUpcaseUnicodeChar(NlsOemToUnicodeTable[LOBYTE(OemChar) + Offset]);
|
UnicodeChar = RtlpUpcaseUnicodeChar(NlsOemToUnicodeTable[LOBYTE(OemChar) + Offset]);
|
||||||
|
|
||||||
/* Receive OEM character from the table */
|
/* Receive OEM character from the table */
|
||||||
OemChar = NlsUnicodeToMbOemTable[UnicodeChar];
|
OemChar = NlsUnicodeToMbOemTable[UnicodeChar];
|
||||||
|
@ -536,7 +536,7 @@ RtlIsValidOemCharacter(IN PWCHAR Char)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Receive Unicode character from the table */
|
/* Receive Unicode character from the table */
|
||||||
UnicodeChar = RtlUpcaseUnicodeChar(NlsOemToUnicodeTable[(UCHAR)NlsUnicodeToOemTable[*Char]]);
|
UnicodeChar = RtlpUpcaseUnicodeChar(NlsOemToUnicodeTable[(UCHAR)NlsUnicodeToOemTable[*Char]]);
|
||||||
|
|
||||||
/* Receive OEM character from the table */
|
/* Receive OEM character from the table */
|
||||||
OemChar = NlsUnicodeToOemTable[UnicodeChar];
|
OemChar = NlsUnicodeToOemTable[UnicodeChar];
|
||||||
|
@ -742,11 +742,11 @@ NTSTATUS NTAPI RtlIntegerToChar(
|
||||||
}
|
}
|
||||||
else if (len == length)
|
else if (len == length)
|
||||||
{
|
{
|
||||||
memcpy(str, pos, len);
|
RtlCopyMemory(str, pos, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy(str, pos, len + 1);
|
RtlCopyMemory(str, pos, len + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -943,8 +943,8 @@ RtlPrefixUnicodeString(
|
||||||
{
|
{
|
||||||
while (NumChars--)
|
while (NumChars--)
|
||||||
{
|
{
|
||||||
if (RtlUpcaseUnicodeChar(*pc1++) !=
|
if (RtlpUpcaseUnicodeChar(*pc1++) !=
|
||||||
RtlUpcaseUnicodeChar(*pc2++))
|
RtlpUpcaseUnicodeChar(*pc2++))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1924,7 +1924,7 @@ RtlUpcaseUnicodeString(
|
||||||
|
|
||||||
for (i = 0; i < j; i++)
|
for (i = 0; i < j; i++)
|
||||||
{
|
{
|
||||||
UniDest->Buffer[i] = RtlUpcaseUnicodeChar(UniSource->Buffer[i]);
|
UniDest->Buffer[i] = RtlpUpcaseUnicodeChar(UniSource->Buffer[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
UniDest->Length = UniSource->Length;
|
UniDest->Length = UniSource->Length;
|
||||||
|
@ -2196,7 +2196,7 @@ RtlCompareUnicodeString(
|
||||||
|
|
||||||
if (CaseInsensitive)
|
if (CaseInsensitive)
|
||||||
{
|
{
|
||||||
while (!ret && len--) ret = RtlUpcaseUnicodeChar(*p1++) - RtlUpcaseUnicodeChar(*p2++);
|
while (!ret && len--) ret = RtlpUpcaseUnicodeChar(*p1++) - RtlpUpcaseUnicodeChar(*p2++);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2586,13 +2586,13 @@ RtlpIsCharInUnicodeString(
|
||||||
USHORT i;
|
USHORT i;
|
||||||
|
|
||||||
if (CaseInSensitive)
|
if (CaseInSensitive)
|
||||||
Char = RtlUpcaseUnicodeChar(Char);
|
Char = RtlpUpcaseUnicodeChar(Char);
|
||||||
|
|
||||||
for (i = 0; i < MatchString->Length / sizeof(WCHAR); i++)
|
for (i = 0; i < MatchString->Length / sizeof(WCHAR); i++)
|
||||||
{
|
{
|
||||||
WCHAR OtherChar = MatchString->Buffer[i];
|
WCHAR OtherChar = MatchString->Buffer[i];
|
||||||
if (CaseInSensitive)
|
if (CaseInSensitive)
|
||||||
OtherChar = RtlUpcaseUnicodeChar(OtherChar);
|
OtherChar = RtlpUpcaseUnicodeChar(OtherChar);
|
||||||
|
|
||||||
if (Char == OtherChar)
|
if (Char == OtherChar)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -96,8 +96,8 @@ CompareUnicodeStrings(IN PUNICODE_STRING Prefix,
|
||||||
if (FoundPrefix != FoundString)
|
if (FoundPrefix != FoundString)
|
||||||
{
|
{
|
||||||
/* Upcase the characters */
|
/* Upcase the characters */
|
||||||
FoundPrefix = RtlUpcaseUnicodeChar(FoundPrefix);
|
FoundPrefix = RtlpUpcaseUnicodeChar(FoundPrefix);
|
||||||
FoundString = RtlUpcaseUnicodeChar(FoundString);
|
FoundString = RtlpUpcaseUnicodeChar(FoundString);
|
||||||
|
|
||||||
/* Compare them again */
|
/* Compare them again */
|
||||||
if (FoundPrefix != FoundString) break;
|
if (FoundPrefix != FoundString) break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue