Implement RtlDuplicateUnicodeString, RtlFindCharInUnicodeString,
RtlInitUnicodeStringEx. Documentation updates for RtlInitAnsiString, RtlInitString, RtlInitUnicodeString, RtlAnsiStringToUnicodeString and RtlOemStringToUnicodeString.
This commit is contained in:
parent
dac51c005a
commit
d628d125ab
@ -354,6 +354,7 @@
|
|||||||
@ stdcall RtlDowncaseUnicodeChar(long)
|
@ stdcall RtlDowncaseUnicodeChar(long)
|
||||||
@ stdcall RtlDowncaseUnicodeString(ptr ptr long)
|
@ stdcall RtlDowncaseUnicodeString(ptr ptr long)
|
||||||
@ stdcall RtlDumpResource(ptr)
|
@ stdcall RtlDumpResource(ptr)
|
||||||
|
@ stdcall RtlDuplicateUnicodeString(long ptr ptr)
|
||||||
@ stdcall -ret64 RtlEnlargedIntegerMultiply(long long)
|
@ stdcall -ret64 RtlEnlargedIntegerMultiply(long long)
|
||||||
@ stdcall RtlEnlargedUnsignedDivide(long long long ptr)
|
@ stdcall RtlEnlargedUnsignedDivide(long long long ptr)
|
||||||
@ stdcall -ret64 RtlEnlargedUnsignedMultiply(long long)
|
@ stdcall -ret64 RtlEnlargedUnsignedMultiply(long long)
|
||||||
@ -376,6 +377,7 @@
|
|||||||
@ stdcall -ret64 RtlExtendedMagicDivide(long long long long long)
|
@ stdcall -ret64 RtlExtendedMagicDivide(long long long long long)
|
||||||
@ stdcall RtlFillMemory(ptr long long)
|
@ stdcall RtlFillMemory(ptr long long)
|
||||||
@ stdcall RtlFillMemoryUlong(ptr long long)
|
@ stdcall RtlFillMemoryUlong(ptr long long)
|
||||||
|
@ stdcall RtlFindCharInUnicodeString(long ptr ptr ptr)
|
||||||
@ stdcall RtlFindClearBits(ptr long long)
|
@ stdcall RtlFindClearBits(ptr long long)
|
||||||
@ stdcall RtlFindClearBitsAndSet(ptr long long)
|
@ stdcall RtlFindClearBitsAndSet(ptr long long)
|
||||||
@ stdcall RtlFindClearRuns(ptr ptr long long)
|
@ stdcall RtlFindClearRuns(ptr ptr long long)
|
||||||
@ -429,6 +431,7 @@
|
|||||||
@ stub RtlInitNlsTables
|
@ stub RtlInitNlsTables
|
||||||
@ stdcall RtlInitString(ptr str)
|
@ stdcall RtlInitString(ptr str)
|
||||||
@ stdcall RtlInitUnicodeString(ptr wstr)
|
@ stdcall RtlInitUnicodeString(ptr wstr)
|
||||||
|
@ stdcall RtlInitUnicodeStringEx(ptr wstr)
|
||||||
@ stdcall RtlInitializeBitMap(ptr long long)
|
@ stdcall RtlInitializeBitMap(ptr long long)
|
||||||
@ stub RtlInitializeContext
|
@ stub RtlInitializeContext
|
||||||
@ stdcall RtlInitializeCriticalSection(ptr)
|
@ stdcall RtlInitializeCriticalSection(ptr)
|
||||||
|
@ -69,10 +69,22 @@ void __wine_init_codepages( const union cptable *ansi, const union cptable *oem
|
|||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlInitAnsiString (NTDLL.@)
|
* RtlInitAnsiString (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Initializes a buffered ansi string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Assigns source to target->Buffer. The length of source is assigned to
|
||||||
|
* target->Length and target->MaximumLength. If source is NULL the length
|
||||||
|
* of source is assumed to be 0.
|
||||||
*/
|
*/
|
||||||
void WINAPI RtlInitAnsiString( PSTRING target, LPCSTR source)
|
void WINAPI RtlInitAnsiString(
|
||||||
|
PANSI_STRING target, /* [I/O] Buffered ansi string to be initialized */
|
||||||
|
PCSZ source) /* [I] '\0' terminated string used to initialize target */
|
||||||
{
|
{
|
||||||
if ((target->Buffer = (LPSTR)source))
|
if ((target->Buffer = (PCHAR) source))
|
||||||
{
|
{
|
||||||
target->Length = strlen(source);
|
target->Length = strlen(source);
|
||||||
target->MaximumLength = target->Length + 1;
|
target->MaximumLength = target->Length + 1;
|
||||||
@ -83,8 +95,20 @@ void WINAPI RtlInitAnsiString( PSTRING target, LPCSTR source)
|
|||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlInitString (NTDLL.@)
|
* RtlInitString (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Initializes a buffered string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Assigns source to target->Buffer. The length of source is assigned to
|
||||||
|
* target->Length and target->MaximumLength. If source is NULL the length
|
||||||
|
* of source is assumed to be 0.
|
||||||
*/
|
*/
|
||||||
void WINAPI RtlInitString( PSTRING target, LPCSTR source )
|
void WINAPI RtlInitString(
|
||||||
|
PSTRING target, /* [I/O] Buffered string to be initialized */
|
||||||
|
PCSZ source) /* [I] '\0' terminated string used to initialize target */
|
||||||
{
|
{
|
||||||
RtlInitAnsiString( target, source );
|
RtlInitAnsiString( target, source );
|
||||||
}
|
}
|
||||||
@ -125,10 +149,22 @@ void WINAPI RtlCopyString( STRING *dst, const STRING *src )
|
|||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlInitUnicodeString (NTDLL.@)
|
* RtlInitUnicodeString (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Initializes a buffered unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Nothing.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Assigns source to target->Buffer. The length of source is assigned to
|
||||||
|
* target->Length and target->MaximumLength. If source is NULL the length
|
||||||
|
* of source is assumed to be 0.
|
||||||
*/
|
*/
|
||||||
void WINAPI RtlInitUnicodeString( PUNICODE_STRING target, LPCWSTR source )
|
void WINAPI RtlInitUnicodeString(
|
||||||
|
PUNICODE_STRING target, /* [I/O] Buffered unicode string to be initialized */
|
||||||
|
PCWSTR source) /* [I] '\0' terminated unicode string used to initialize target */
|
||||||
{
|
{
|
||||||
if ((target->Buffer = (LPWSTR)source))
|
if ((target->Buffer = (PWSTR) source))
|
||||||
{
|
{
|
||||||
target->Length = strlenW(source) * sizeof(WCHAR);
|
target->Length = strlenW(source) * sizeof(WCHAR);
|
||||||
target->MaximumLength = target->Length + sizeof(WCHAR);
|
target->MaximumLength = target->Length + sizeof(WCHAR);
|
||||||
@ -137,6 +173,43 @@ void WINAPI RtlInitUnicodeString( PUNICODE_STRING target, LPCWSTR source )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* RtlInitUnicodeStringEx (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Initializes a buffered unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS. target is initialized.
|
||||||
|
* Failure: STATUS_NAME_TOO_LONG, if the source string is larger than 65532 bytes.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* Assigns source to target->Buffer. The length of source is assigned to
|
||||||
|
* target->Length and target->MaximumLength. If source is NULL the length
|
||||||
|
* of source is assumed to be 0.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlInitUnicodeStringEx(
|
||||||
|
PUNICODE_STRING target, /* [I/O] Buffered unicode string to be initialized */
|
||||||
|
PCWSTR source) /* [I] '\0' terminated unicode string used to initialize target */
|
||||||
|
{
|
||||||
|
if (source != NULL) {
|
||||||
|
unsigned int len = strlenW(source) * sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (len > 0xFFFC) {
|
||||||
|
return STATUS_NAME_TOO_LONG;
|
||||||
|
} else {
|
||||||
|
target->Length = len;
|
||||||
|
target->MaximumLength = len + sizeof(WCHAR);
|
||||||
|
target->Buffer = (PWSTR) source;
|
||||||
|
} /* if */
|
||||||
|
} else {
|
||||||
|
target->Length = 0;
|
||||||
|
target->MaximumLength = 0;
|
||||||
|
target->Buffer = NULL;
|
||||||
|
} /* if */
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlCreateUnicodeString (NTDLL.@)
|
* RtlCreateUnicodeString (NTDLL.@)
|
||||||
*/
|
*/
|
||||||
@ -181,13 +254,71 @@ void WINAPI RtlCopyUnicodeString( UNICODE_STRING *dst, const UNICODE_STRING *src
|
|||||||
unsigned int len = min( src->Length, dst->MaximumLength );
|
unsigned int len = min( src->Length, dst->MaximumLength );
|
||||||
memcpy( dst->Buffer, src->Buffer, len );
|
memcpy( dst->Buffer, src->Buffer, len );
|
||||||
dst->Length = len;
|
dst->Length = len;
|
||||||
/* append terminating NULL if enough space */
|
/* append terminating '\0' if enough space */
|
||||||
if (len < dst->MaximumLength) dst->Buffer[len / sizeof(WCHAR)] = 0;
|
if (len < dst->MaximumLength) dst->Buffer[len / sizeof(WCHAR)] = 0;
|
||||||
}
|
}
|
||||||
else dst->Length = 0;
|
else dst->Length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* RtlDuplicateUnicodeString (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Duplicates an unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS. destination contains the duplicated unicode string.
|
||||||
|
* Failure: STATUS_INVALID_PARAMETER, if one of the parameters is illegal.
|
||||||
|
* STATUS_NO_MEMORY, if the allocation fails.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* For add_nul there are several possible values:
|
||||||
|
* 0 = destination will not be '\0' terminated,
|
||||||
|
* 1 = destination will be '\0' terminated,
|
||||||
|
* 3 = like 1 but for an empty source string produce '\0' terminated empty
|
||||||
|
* Buffer instead of assigning NULL to the Buffer.
|
||||||
|
* Other add_nul values are invalid.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlDuplicateUnicodeString(
|
||||||
|
int add_nul, /* [I] flag */
|
||||||
|
const UNICODE_STRING *source, /* [I] Unicode string to be duplicated */
|
||||||
|
UNICODE_STRING *destination) /* [O] destination for the duplicated unicode string */
|
||||||
|
{
|
||||||
|
if (source == NULL || destination == NULL ||
|
||||||
|
source->Length > source->MaximumLength ||
|
||||||
|
(source->Length == 0 && source->MaximumLength > 0 && source->Buffer == NULL) ||
|
||||||
|
add_nul == 2 || add_nul >= 4 || add_nul < 0) {
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
} else {
|
||||||
|
if (source->Length == 0 && add_nul != 3) {
|
||||||
|
destination->Length = 0;
|
||||||
|
destination->MaximumLength = 0;
|
||||||
|
destination->Buffer = NULL;
|
||||||
|
} else {
|
||||||
|
unsigned int destination_max_len = source->Length;
|
||||||
|
|
||||||
|
if (add_nul) {
|
||||||
|
destination_max_len += sizeof(WCHAR);
|
||||||
|
} /* if */
|
||||||
|
destination->Buffer = RtlAllocateHeap(ntdll_get_process_heap(), 0, destination_max_len);
|
||||||
|
if (destination->Buffer == NULL) {
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
} else {
|
||||||
|
memcpy(destination->Buffer, source->Buffer, source->Length);
|
||||||
|
destination->Length = source->Length;
|
||||||
|
destination->MaximumLength = source->Length;
|
||||||
|
/* append terminating '\0' if enough space */
|
||||||
|
if (add_nul) {
|
||||||
|
destination->MaximumLength = destination_max_len;
|
||||||
|
destination->Buffer[destination->Length / sizeof(WCHAR)] = 0;
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlEraseUnicodeString (NTDLL.@)
|
* RtlEraseUnicodeString (NTDLL.@)
|
||||||
*/
|
*/
|
||||||
@ -415,12 +546,21 @@ NTSTATUS WINAPI RtlEqualDomainName(const UNICODE_STRING *left,
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlAnsiStringToUnicodeString (NTDLL.@)
|
* RtlAnsiStringToUnicodeString (NTDLL.@)
|
||||||
*
|
*
|
||||||
|
* Converts an ansi string to an unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS. uni contains the converted string
|
||||||
|
* Failure: STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and ansi is too small.
|
||||||
|
* STATUS_NO_MEMORY, if doalloc is TRUE and the allocation fails.
|
||||||
|
* STATUS_INVALID_PARAMETER_2, if the unicode string would be larger than 65535.
|
||||||
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This function always writes a terminating NUL.
|
* This function always writes a terminating '\0'.
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlAnsiStringToUnicodeString( PUNICODE_STRING uni,
|
NTSTATUS WINAPI RtlAnsiStringToUnicodeString(
|
||||||
PCANSI_STRING ansi,
|
PUNICODE_STRING uni, /* [I/O] Destination for the unicode string */
|
||||||
BOOLEAN doalloc )
|
PCANSI_STRING ansi, /* [I] Ansi string to be converted */
|
||||||
|
BOOLEAN doalloc) /* [I] TRUE=Allocate new buffer for uni, FALSE=Use existing buffer */
|
||||||
{
|
{
|
||||||
DWORD total = RtlAnsiStringToUnicodeSize( ansi );
|
DWORD total = RtlAnsiStringToUnicodeSize( ansi );
|
||||||
|
|
||||||
@ -443,13 +583,21 @@ NTSTATUS WINAPI RtlAnsiStringToUnicodeString( PUNICODE_STRING uni,
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlOemStringToUnicodeString (NTDLL.@)
|
* RtlOemStringToUnicodeString (NTDLL.@)
|
||||||
*
|
*
|
||||||
|
* Converts an oem string to an unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS. uni contains the converted string
|
||||||
|
* Failure: STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and oem is too small.
|
||||||
|
* STATUS_NO_MEMORY, if doalloc is TRUE and the allocation fails.
|
||||||
|
* STATUS_INVALID_PARAMETER_2, if the unicode string would be larger than 65535.
|
||||||
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This function always writes a terminating NUL.
|
* This function always writes a terminating '\0'.
|
||||||
* If the resulting length > 0xffff it returns STATUS_INVALID_PARAMETER_2
|
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlOemStringToUnicodeString( UNICODE_STRING *uni,
|
NTSTATUS WINAPI RtlOemStringToUnicodeString(
|
||||||
const STRING *oem,
|
UNICODE_STRING *uni, /* [I/O] Destination for the unicode string */
|
||||||
BOOLEAN doalloc )
|
const STRING *oem, /* [I] Oem string to be converted */
|
||||||
|
BOOLEAN doalloc) /* [I] TRUE=Allocate new buffer for uni, FALSE=Use existing buffer */
|
||||||
{
|
{
|
||||||
DWORD total = RtlOemStringToUnicodeSize( oem );
|
DWORD total = RtlOemStringToUnicodeSize( oem );
|
||||||
|
|
||||||
@ -472,19 +620,19 @@ NTSTATUS WINAPI RtlOemStringToUnicodeString( UNICODE_STRING *uni,
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* RtlUnicodeStringToAnsiString (NTDLL.@)
|
* RtlUnicodeStringToAnsiString (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Converts an Unicode string to an Ansi string.
|
* Converts an unicode string to an ansi string.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: STATUS_SUCCESS. ansi contains the converted string
|
* Success: STATUS_SUCCESS. ansi contains the converted string
|
||||||
* Failure: STATUS_BUFFER_OVERFLOW if doalloc is FALSE and ansi is too small.
|
* Failure: STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and ansi is too small.
|
||||||
* STATUS_NO_MEMORY if doalloc is TRUE and the allocation fails.
|
* STATUS_NO_MEMORY, if doalloc is TRUE and the allocation fails.
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This function always writes a terminating '\0'.
|
* This function always writes a terminating '\0'.
|
||||||
* It performs a partial copy if ansi is too small.
|
* It performs a partial copy if ansi is too small.
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlUnicodeStringToAnsiString(
|
NTSTATUS WINAPI RtlUnicodeStringToAnsiString(
|
||||||
STRING *ansi, /* [I/O] Destination for the Ansi string */
|
STRING *ansi, /* [I/O] Destination for the ansi string */
|
||||||
const UNICODE_STRING *uni, /* [I] Unicode string to be converted */
|
const UNICODE_STRING *uni, /* [I] Unicode string to be converted */
|
||||||
BOOLEAN doalloc) /* [I] TRUE=Allocate new buffer for ansi, FALSE=Use existing buffer */
|
BOOLEAN doalloc) /* [I] TRUE=Allocate new buffer for ansi, FALSE=Use existing buffer */
|
||||||
{
|
{
|
||||||
@ -528,7 +676,7 @@ NTSTATUS WINAPI RtlUnicodeStringToAnsiString(
|
|||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* If doalloc is TRUE, the length allocated is uni->Length + 1.
|
* If doalloc is TRUE, the length allocated is uni->Length + 1.
|
||||||
* This function always NUL terminates the string returned.
|
* This function always '\0' terminates the string returned.
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlUnicodeStringToOemString( STRING *oem,
|
NTSTATUS WINAPI RtlUnicodeStringToOemString( STRING *oem,
|
||||||
const UNICODE_STRING *uni,
|
const UNICODE_STRING *uni,
|
||||||
@ -724,8 +872,8 @@ WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR wch)
|
|||||||
* STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and dest is too small.
|
* STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and dest is too small.
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* dest is never NUL terminated because it may be equal to src, and src
|
* dest is never '\0' terminated because it may be equal to src, and src
|
||||||
* might not be NUL terminated. dest->Length is only set upon success.
|
* might not be '\0' terminated. dest->Length is only set upon success.
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlUpcaseUnicodeString( UNICODE_STRING *dest,
|
NTSTATUS WINAPI RtlUpcaseUnicodeString( UNICODE_STRING *dest,
|
||||||
const UNICODE_STRING *src,
|
const UNICODE_STRING *src,
|
||||||
@ -763,8 +911,8 @@ NTSTATUS WINAPI RtlUpcaseUnicodeString( UNICODE_STRING *dest,
|
|||||||
* STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and dest is too small.
|
* STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and dest is too small.
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* dest is never NUL terminated because it may be equal to src, and src
|
* dest is never '\0' terminated because it may be equal to src, and src
|
||||||
* might not be NUL terminated. dest->Length is only set upon success.
|
* might not be '\0' terminated. dest->Length is only set upon success.
|
||||||
*/
|
*/
|
||||||
NTSTATUS WINAPI RtlDowncaseUnicodeString(
|
NTSTATUS WINAPI RtlDowncaseUnicodeString(
|
||||||
UNICODE_STRING *dest,
|
UNICODE_STRING *dest,
|
||||||
@ -921,7 +1069,7 @@ NTSTATUS WINAPI RtlUpcaseUnicodeToOemN( LPSTR dst, DWORD dstlen, LPDWORD reslen,
|
|||||||
* RtlxOemStringToUnicodeSize (NTDLL.@)
|
* RtlxOemStringToUnicodeSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Calculate the size in bytes necessary for the Unicode conversion of str,
|
* Calculate the size in bytes necessary for the Unicode conversion of str,
|
||||||
* including the terminating NUL.
|
* including the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* str [I] String to calculate the size of
|
* str [I] String to calculate the size of
|
||||||
@ -941,7 +1089,7 @@ UINT WINAPI RtlOemStringToUnicodeSize( const STRING *str )
|
|||||||
* RtlxAnsiStringToUnicodeSize (NTDLL.@)
|
* RtlxAnsiStringToUnicodeSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Calculate the size in bytes necessary for the Unicode conversion of str,
|
* Calculate the size in bytes necessary for the Unicode conversion of str,
|
||||||
* including the terminating NUL.
|
* including the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* str [I] String to calculate the size of
|
* str [I] String to calculate the size of
|
||||||
@ -961,7 +1109,7 @@ DWORD WINAPI RtlAnsiStringToUnicodeSize( const STRING *str )
|
|||||||
* RtlMultiByteToUnicodeSize (NTDLL.@)
|
* RtlMultiByteToUnicodeSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Compute the size in bytes necessary for the Unicode conversion of str,
|
* Compute the size in bytes necessary for the Unicode conversion of str,
|
||||||
* without the terminating NUL.
|
* without the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* size [O] Destination for size
|
* size [O] Destination for size
|
||||||
@ -982,7 +1130,7 @@ NTSTATUS WINAPI RtlMultiByteToUnicodeSize( DWORD *size, LPCSTR str, UINT len )
|
|||||||
* RtlUnicodeToMultiByteSize (NTDLL.@)
|
* RtlUnicodeToMultiByteSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Calculate the size in bytes necessary for the multibyte conversion of str,
|
* Calculate the size in bytes necessary for the multibyte conversion of str,
|
||||||
* without the terminating NULL.
|
* without the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* size [O] Destination for size
|
* size [O] Destination for size
|
||||||
@ -1004,7 +1152,7 @@ NTSTATUS WINAPI RtlUnicodeToMultiByteSize( PULONG size, LPCWSTR str, ULONG len )
|
|||||||
* RtlxUnicodeStringToAnsiSize (NTDLL.@)
|
* RtlxUnicodeStringToAnsiSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Calculate the size in bytes necessary for the Ansi conversion of str,
|
* Calculate the size in bytes necessary for the Ansi conversion of str,
|
||||||
* including the terminating NUL.
|
* including the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* str [I] String to calculate the size of
|
* str [I] String to calculate the size of
|
||||||
@ -1025,7 +1173,7 @@ DWORD WINAPI RtlUnicodeStringToAnsiSize( const UNICODE_STRING *str )
|
|||||||
* RtlxUnicodeStringToOemSize (NTDLL.@)
|
* RtlxUnicodeStringToOemSize (NTDLL.@)
|
||||||
*
|
*
|
||||||
* Calculate the size in bytes necessary for the OEM conversion of str,
|
* Calculate the size in bytes necessary for the OEM conversion of str,
|
||||||
* including the terminating NUL.
|
* including the terminating '\0'.
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* str [I] String to calculate the size of
|
* str [I] String to calculate the size of
|
||||||
@ -1131,7 +1279,7 @@ NTSTATUS WINAPI RtlAppendUnicodeToString(
|
|||||||
if (dest_len > dest->MaximumLength) return STATUS_BUFFER_TOO_SMALL;
|
if (dest_len > dest->MaximumLength) return STATUS_BUFFER_TOO_SMALL;
|
||||||
memcpy(dest->Buffer + dest->Length/sizeof(WCHAR), src, src_len);
|
memcpy(dest->Buffer + dest->Length/sizeof(WCHAR), src, src_len);
|
||||||
dest->Length = dest_len;
|
dest->Length = dest_len;
|
||||||
/* append terminating NULL if enough space */
|
/* append terminating '\0' if enough space */
|
||||||
if (dest_len + sizeof(WCHAR) <= dest->MaximumLength) {
|
if (dest_len + sizeof(WCHAR) <= dest->MaximumLength) {
|
||||||
dest->Buffer[dest_len / sizeof(WCHAR)] = 0;
|
dest->Buffer[dest_len / sizeof(WCHAR)] = 0;
|
||||||
} /* if */
|
} /* if */
|
||||||
@ -1169,7 +1317,7 @@ NTSTATUS WINAPI RtlAppendUnicodeStringToString(
|
|||||||
if (dest_len > dest->MaximumLength) return STATUS_BUFFER_TOO_SMALL;
|
if (dest_len > dest->MaximumLength) return STATUS_BUFFER_TOO_SMALL;
|
||||||
memcpy(dest->Buffer + dest->Length/sizeof(WCHAR), src->Buffer, src->Length);
|
memcpy(dest->Buffer + dest->Length/sizeof(WCHAR), src->Buffer, src->Length);
|
||||||
dest->Length = dest_len;
|
dest->Length = dest_len;
|
||||||
/* append terminating NULL if enough space */
|
/* append terminating '\0' if enough space */
|
||||||
if (dest_len + sizeof(WCHAR) <= dest->MaximumLength) {
|
if (dest_len + sizeof(WCHAR) <= dest->MaximumLength) {
|
||||||
dest->Buffer[dest_len / sizeof(WCHAR)] = 0;
|
dest->Buffer[dest_len / sizeof(WCHAR)] = 0;
|
||||||
} /* if */
|
} /* if */
|
||||||
@ -1178,6 +1326,80 @@ NTSTATUS WINAPI RtlAppendUnicodeStringToString(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* RtlFindCharInUnicodeString (NTDLL.@)
|
||||||
|
*
|
||||||
|
* Searches for one of several unicode characters in an unicode string.
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
* Success: STATUS_SUCCESS. pos contains the position after the character found.
|
||||||
|
* Failure: STATUS_NOT_FOUND, if none of the search_chars are in main_str.
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI RtlFindCharInUnicodeString(
|
||||||
|
int flags, /* [I] Flags */
|
||||||
|
const UNICODE_STRING *main_str, /* [I] Unicode string in which one or more characters are searched */
|
||||||
|
const UNICODE_STRING *search_chars, /* [I] Unicode string which contains the characters to search for */
|
||||||
|
USHORT *pos) /* [O] Position of the first character found + 2 */
|
||||||
|
{
|
||||||
|
int main_idx;
|
||||||
|
unsigned int search_idx;
|
||||||
|
|
||||||
|
switch (flags) {
|
||||||
|
case 0:
|
||||||
|
for (main_idx = 0; main_idx < main_str->Length / sizeof(WCHAR); main_idx++) {
|
||||||
|
for (search_idx = 0; search_idx < search_chars->Length / sizeof(WCHAR); search_idx++) {
|
||||||
|
if (main_str->Buffer[main_idx] == search_chars->Buffer[search_idx]) {
|
||||||
|
*pos = (main_idx + 1) * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pos = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
case 1:
|
||||||
|
for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) {
|
||||||
|
for (search_idx = 0; search_idx < search_chars->Length / sizeof(WCHAR); search_idx++) {
|
||||||
|
if (main_str->Buffer[main_idx] == search_chars->Buffer[search_idx]) {
|
||||||
|
*pos = main_idx * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pos = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
case 2:
|
||||||
|
for (main_idx = 0; main_idx < main_str->Length / sizeof(WCHAR); main_idx++) {
|
||||||
|
search_idx = 0;
|
||||||
|
while (search_idx < search_chars->Length / sizeof(WCHAR) &&
|
||||||
|
main_str->Buffer[main_idx] != search_chars->Buffer[search_idx]) {
|
||||||
|
search_idx++;
|
||||||
|
}
|
||||||
|
if (search_idx >= search_chars->Length / sizeof(WCHAR)) {
|
||||||
|
*pos = (main_idx + 1) * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pos = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
case 3:
|
||||||
|
for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) {
|
||||||
|
search_idx = 0;
|
||||||
|
while (search_idx < search_chars->Length / sizeof(WCHAR) &&
|
||||||
|
main_str->Buffer[main_idx] != search_chars->Buffer[search_idx]) {
|
||||||
|
search_idx++;
|
||||||
|
}
|
||||||
|
if (search_idx >= search_chars->Length / sizeof(WCHAR)) {
|
||||||
|
*pos = main_idx * sizeof(WCHAR);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pos = 0;
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
} /* switch */
|
||||||
|
return STATUS_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MISC
|
MISC
|
||||||
*/
|
*/
|
||||||
|
@ -967,6 +967,7 @@ BOOLEAN WINAPI RtlDosPathNameToNtPathName_U(LPWSTR,PUNICODE_STRING,DWORD,DWORD
|
|||||||
WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
|
WCHAR WINAPI RtlDowncaseUnicodeChar(WCHAR);
|
||||||
NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
|
NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
|
||||||
void WINAPI RtlDumpResource(LPRTL_RWLOCK);
|
void WINAPI RtlDumpResource(LPRTL_RWLOCK);
|
||||||
|
NTSTATUS WINAPI RtlDuplicateUnicodeString(int,const UNICODE_STRING*,UNICODE_STRING*);
|
||||||
|
|
||||||
LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
|
LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT,INT);
|
||||||
ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
|
ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT,UINT);
|
||||||
@ -984,6 +985,7 @@ LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT);
|
|||||||
LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
|
LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT);
|
||||||
LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
|
LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG,INT,INT *);
|
||||||
|
|
||||||
|
NTSTATUS WINAPI RtlFindCharInUnicodeString(int,const UNICODE_STRING*,const UNICODE_STRING*,USHORT*);
|
||||||
ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
|
ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP,ULONG,ULONG);
|
||||||
ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
|
ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP,ULONG,ULONG);
|
||||||
ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
|
ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOLEAN);
|
||||||
@ -1026,6 +1028,7 @@ BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
|
|||||||
void WINAPI RtlInitString(PSTRING,PCSZ);
|
void WINAPI RtlInitString(PSTRING,PCSZ);
|
||||||
void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
|
void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
|
||||||
void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
|
void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
|
||||||
|
NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
|
||||||
NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
|
NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);
|
||||||
NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
|
NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *,DWORD);
|
||||||
void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
|
void WINAPI RtlInitializeBitMap(PRTL_BITMAP,LPBYTE,ULONG);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user