Implement RtlInitAnsiStringEx.

This commit is contained in:
Ivan Leo Puoti 2005-11-07 11:14:45 +00:00 committed by Alexandre Julliard
parent c62e978d54
commit a1cd3ab653
3 changed files with 35 additions and 0 deletions

View File

@ -650,6 +650,7 @@
@ stdcall RtlImageRvaToVa(ptr long long ptr)
@ stdcall RtlImpersonateSelf(long)
@ stdcall RtlInitAnsiString(ptr str)
@ stdcall RtlInitAnsiStringEx(ptr str)
@ stub RtlInitCodePageTable
# @ stub RtlInitMemoryStream
@ stub RtlInitNlsTables

View File

@ -102,6 +102,39 @@ void WINAPI RtlInitAnsiString(
else target->Length = target->MaximumLength = 0;
}
/**************************************************************************
* RtlInitAnsiStringEx (NTDLL.@)
*
* Initializes a buffered ansi string.
*
* RETURNS
* An appropriate NTSTATUS value.
*
* 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 RtlInitAnsiStringEx(PANSI_STRING target, PCSZ source)
{
if (source)
{
unsigned int len = strlen(source);
if (len+1 > 0xffff)
return STATUS_NAME_TOO_LONG;
target->Buffer = (PCHAR) source;
target->Length = len;
target->MaximumLength = len + 1;
}
else
{
target->Buffer = NULL;
target->Length = 0;
target->MaximumLength = 0;
}
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlInitString (NTDLL.@)

View File

@ -2070,6 +2070,7 @@ PVOID WINAPI RtlImageRvaToVa(const IMAGE_NT_HEADERS *,HMODULE,DWORD,IMAGE_SE
NTSTATUS WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
void WINAPI RtlInitString(PSTRING,PCSZ);
void WINAPI RtlInitAnsiString(PANSI_STRING,PCSZ);
NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING,PCSZ);
void WINAPI RtlInitUnicodeString(PUNICODE_STRING,PCWSTR);
NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING,PCWSTR);
NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *);