mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 18:46:29 +00:00
adapted RtlIntegerToUnicode() from RtlIntegerToChar()
svn path=/trunk/; revision=10843
This commit is contained in:
parent
7347219eb4
commit
30c43d3c95
1 changed files with 60 additions and 17 deletions
|
@ -541,7 +541,9 @@ RtlIntegerToChar(
|
|||
|
||||
if ((Radix != 2) && (Radix != 8) &&
|
||||
(Radix != 10) && (Radix != 16))
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
tp = temp;
|
||||
while (v || tp == temp)
|
||||
|
@ -556,7 +558,64 @@ RtlIntegerToChar(
|
|||
}
|
||||
|
||||
if (tp - temp >= Length)
|
||||
{
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
sp = String;
|
||||
while (tp > temp)
|
||||
*sp++ = *--tp;
|
||||
*sp = 0;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
RtlIntegerToUnicode(
|
||||
IN ULONG Value,
|
||||
IN ULONG Base OPTIONAL,
|
||||
IN ULONG Length OPTIONAL,
|
||||
IN OUT LPWSTR String
|
||||
)
|
||||
{
|
||||
ULONG Radix;
|
||||
WCHAR temp[33];
|
||||
ULONG v = Value;
|
||||
ULONG i;
|
||||
PWCHAR tp;
|
||||
PWCHAR sp;
|
||||
|
||||
Radix = Base;
|
||||
if (Radix == 0)
|
||||
Radix = 10;
|
||||
|
||||
if ((Radix != 2) && (Radix != 8) &&
|
||||
(Radix != 10) && (Radix != 16))
|
||||
{
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
tp = temp;
|
||||
while (v || tp == temp)
|
||||
{
|
||||
i = v % Radix;
|
||||
v = v / Radix;
|
||||
if (i < 10)
|
||||
*tp = i + L'0';
|
||||
else
|
||||
*tp = i + L'a' - 10;
|
||||
tp++;
|
||||
}
|
||||
|
||||
if (tp - temp >= Length)
|
||||
{
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
sp = String;
|
||||
while (tp > temp)
|
||||
|
@ -600,22 +659,6 @@ RtlIntegerToUnicodeString(
|
|||
return Status;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
RtlIntegerToUnicode(
|
||||
IN ULONG Value,
|
||||
IN ULONG Base OPTIONAL,
|
||||
IN ULONG Length OPTIONAL,
|
||||
IN OUT LPWSTR String
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
|
Loading…
Reference in a new issue