diff --git a/reactos/lib/ntdll/def/ntdll.def b/reactos/lib/ntdll/def/ntdll.def index 885dbe27963..9a4b99fe1d7 100644 --- a/reactos/lib/ntdll/def/ntdll.def +++ b/reactos/lib/ntdll/def/ntdll.def @@ -1,4 +1,4 @@ -; $Id: ntdll.def,v 1.134 2004/11/12 12:06:54 ekohl Exp $ +; $Id: ntdll.def,v 1.135 2004/12/05 21:16:01 navaraf Exp $ ; ; ReactOS Operating System ; @@ -487,6 +487,7 @@ RtlInitCodePageTable@8 RtlInitNlsTables@16 RtlInitString@8 RtlInitUnicodeString@8 +RtlInitUnicodeStringEx@8 ;RtlInitializeAtomPackage RtlInitializeBitMap@12 RtlInitializeContext@20 diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index 1d113030b52..77cad08b586 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -497,6 +497,29 @@ RtlInitUnicodeString(IN OUT PUNICODE_STRING DestinationString, DestinationString->Buffer = (PWSTR)SourceString; } +/* + * @implemented + */ +NTSTATUS STDCALL +RtlInitUnicodeStringEx(OUT PUNICODE_STRING DestinationString, + IN PCWSTR SourceString) +{ + ULONG Length = 0; + + if (SourceString != NULL) + { + Length = wcslen(SourceString) * sizeof(WCHAR); + if (Length > 0xFFFC) + return STATUS_NAME_TOO_LONG; + } + + DestinationString->Length = Length; + DestinationString->MaximumLength = Length + sizeof(WCHAR); + DestinationString->Buffer = (PWSTR)SourceString; + + return STATUS_SUCCESS; +} + /* * @implemented *