Commit in reactos/lib/rtl on MAIN
unicode.c+11-51.10 -> 1.11
- Fix RtlInitUnicodeStringEx for NULL case (spotted by Herv� Poussineau).

reactos/lib/rtl
unicode.c 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- unicode.c	5 Dec 2004 21:16:01 -0000	1.10
+++ unicode.c	5 Dec 2004 21:42:54 -0000	1.11
@@ -504,18 +504,24 @@
 RtlInitUnicodeStringEx(OUT PUNICODE_STRING DestinationString,
                        IN PCWSTR SourceString)
 {
-   ULONG Length = 0;
+   ULONG Length;
 
    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;
+      DestinationString->Length = Length;
+      DestinationString->MaximumLength = Length + sizeof(WCHAR);
+      DestinationString->Buffer = (PWSTR)SourceString;
+   }
+   else
+   {
+      DestinationString->Length = 0;
+      DestinationString->MaximumLength = 0;
+      DestinationString->Buffer = NULL;
+   }
 
    return STATUS_SUCCESS;
 }
CVSspam 0.2.8