New macros InitializeUnicodeString(), RtlInitUnicodeStringFromLiteral() and UNICODE_S...
authorKJK::Hyperion <hackbunny@reactos.org>
Tue, 20 Aug 2002 20:37:19 +0000 (20:37 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Tue, 20 Aug 2002 20:37:19 +0000 (20:37 +0000)
svn path=/trunk/; revision=3371

70 files changed:
reactos/apps/tests/apc/apc.c
reactos/apps/tests/lpc/lpcclt.c
reactos/apps/tests/lpc/lpcsrv.c
reactos/apps/tests/regtest/regtest.c
reactos/apps/utils/pice/module/patch.c
reactos/apps/utils/pice/module/privateice.c
reactos/drivers/dd/beep/beep.c
reactos/drivers/dd/blue/blue.c
reactos/drivers/dd/floppy/floppy.c
reactos/drivers/dd/null/null.c
reactos/drivers/dd/parallel/parallel.c
reactos/drivers/dd/ramdrv/ramdrv.c
reactos/drivers/dd/vga/miniport/initvga.c
reactos/drivers/fs/cdfs/cdfs.c
reactos/drivers/fs/ext2/super.c
reactos/drivers/fs/fs_rec/cdfs.c
reactos/drivers/fs/fs_rec/fat.c
reactos/drivers/fs/ntfs/ntfs.c
reactos/drivers/fs/template/template.c
reactos/drivers/fs/vfat/iface.c
reactos/drivers/input/keyboard/keyboard.c
reactos/drivers/input/mouclass/mouclass.c
reactos/drivers/input/psaux/psaux.c
reactos/drivers/input/sermouse/sermouse.c
reactos/drivers/net/afd/afd/afd.c
reactos/drivers/net/ndis/ndis/miniport.c
reactos/drivers/net/tcpip/tcpip/main.c
reactos/drivers/net/wshtcpip/wshtcpip.c
reactos/include/ddk/rtl.h
reactos/lib/advapi32/reg/reg.c
reactos/lib/kernel32/file/curdir.c
reactos/lib/kernel32/misc/dllmain.c
reactos/lib/msafd/misc/dllmain.c
reactos/lib/ntdll/csr/lpc.c
reactos/lib/ntdll/dbg/debug.c
reactos/lib/ntdll/rtl/registry.c
reactos/lib/ntdll/stubs/stubs.c
reactos/lib/secur32/lsa.c
reactos/ntoskrnl/cm/registry.c
reactos/ntoskrnl/cm/rtlfunc.c
reactos/ntoskrnl/dbg/kdb_stabs.c
reactos/ntoskrnl/ex/win32k.c
reactos/ntoskrnl/io/arcname.c
reactos/ntoskrnl/io/driver.c
reactos/ntoskrnl/io/iomgr.c
reactos/ntoskrnl/io/pnproot.c
reactos/ntoskrnl/io/resource.c
reactos/ntoskrnl/io/symlink.c
reactos/ntoskrnl/kd/dlog.c
reactos/ntoskrnl/ldr/init.c
reactos/ntoskrnl/ldr/sysdll.c
reactos/ntoskrnl/lpc/port.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/ob/namespc.c
reactos/ntoskrnl/ps/locale.c
reactos/ntoskrnl/ps/process.c
reactos/ntoskrnl/ps/thread.c
reactos/ntoskrnl/rtl/nls.c
reactos/services/eventlog/logport.c
reactos/subsys/csrss/api/conio.c
reactos/subsys/csrss/csrss.c
reactos/subsys/csrss/init.c
reactos/subsys/csrss/video.c
reactos/subsys/smss/init.c
reactos/subsys/smss/smapi.c
reactos/subsys/system/services/database.c
reactos/subsys/win32k/eng/mouse.c
reactos/subsys/win32k/misc/driver.c
reactos/subsys/win32k/ntuser/input.c
reactos/subsys/win32k/ntuser/winsta.c

index e705921..aac7fee 100644 (file)
@@ -20,7 +20,7 @@ int main(int argc, char* argv[])
    NTSTATUS Status;
    HANDLE FileHandle;
    OBJECT_ATTRIBUTES ObjectAttributes;
-   UNICODE_STRING FileName;
+   UNICODE_STRING FileName = UNICODE_STRING_INITIALIZER(L"\\C:\\a.txt");
    IO_STATUS_BLOCK IoStatus;
    CHAR Buffer[256];
    HANDLE EventHandle;
@@ -42,8 +42,6 @@ int main(int argc, char* argv[])
      }
    
    printf("Opening file\n");
-   RtlInitUnicodeString(&FileName,
-                             L"\\C:\\a.txt");                        
    InitializeObjectAttributes(&ObjectAttributes,
                              &FileName,
                              0,
index 0df32a0..66c402c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lpcclt.c,v 1.8 2002/02/24 17:44:22 ea Exp $
+/* $Id: lpcclt.c,v 1.9 2002/08/20 20:37:03 hyperion Exp $
  *
  * DESCRIPTION: Simple LPC Client
  * PROGRAMMER:  David Welch
@@ -31,7 +31,7 @@ void debug_printf(char* fmt, ...)
 
 int main(int argc, char* argv[])
 {
-   UNICODE_STRING PortName;
+   UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(TEST_PORT_NAME_U);
    NTSTATUS Status;
    HANDLE PortHandle;
    LPC_MAX_MESSAGE Request;
@@ -41,8 +41,6 @@ int main(int argc, char* argv[])
    
    printf("%s: Lpc test client\n", MyName);
    
-   RtlInitUnicodeString(&PortName, TEST_PORT_NAME_U);
-   
    printf("%s: Connecting to port \"%s\"...\n", MyName, TEST_PORT_NAME);
    ConnectInfoLength = 0;
    ZeroMemory (& Sqos, sizeof Sqos);
index b816ced..4fe9ebf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lpcsrv.c,v 1.8 2002/02/24 17:44:22 ea Exp $
+/* $Id: lpcsrv.c,v 1.9 2002/08/20 20:37:04 hyperion Exp $
  *
  * DESCRIPTION: Simple LPC Server
  * PROGRAMMER:  David Welch
@@ -32,7 +32,7 @@ void debug_printf(char* fmt, ...)
 
 int main(int argc, char* argv[])
 {
-   UNICODE_STRING PortName;
+   UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(TEST_PORT_NAME_U);
    OBJECT_ATTRIBUTES ObjectAttributes;
    NTSTATUS Status;
    HANDLE NamedPortHandle;
@@ -40,8 +40,7 @@ int main(int argc, char* argv[])
    LPC_MAX_MESSAGE ConnectMsg;
    
    printf("%s: Lpc test server\n", MyName);
-   
-   RtlInitUnicodeString(&PortName, TEST_PORT_NAME_U);
+
    InitializeObjectAttributes(&ObjectAttributes,
                              &PortName,
                              0,
index 84901f6..88e11b2 100644 (file)
@@ -54,13 +54,12 @@ void test1(void)
  HKEY hKey = NULL,hKey1;
  OBJECT_ATTRIBUTES ObjectAttributes; 
  NTSTATUS Status; 
- UNICODE_STRING KeyName;
+ UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry");
  ULONG Index,Length,i;
  KEY_BASIC_INFORMATION KeyInformation[5];
  KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
 
   dprintf("NtOpenKey \\Registry : ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -104,7 +103,7 @@ void test1(void)
   NtClose(hKey);
 
   dprintf("NtOpenKey \\Registry\\Machine : ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -114,7 +113,7 @@ void test1(void)
   dprintf("\t\t\tStatus =%x\n",Status);
 
   dprintf("NtOpenKey System\\Setup : ");
-  RtlInitUnicodeString(&KeyName, L"System\\Setup");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"System\\Setup");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , hKey1 , NULL);
   Status = NtOpenKey ( &hKey, KEY_READ , &ObjectAttributes);
@@ -122,7 +121,7 @@ void test1(void)
   if(Status==0)
   {
     dprintf("NtQueryValueKey : ");
-    RtlInitUnicodeString(&KeyName, L"CmdLine");
+    RtlInitUnicodeStringFromLiteral(&KeyName, L"CmdLine");
     Status=NtQueryValueKey(hKey,&KeyName,KeyValueFullInformation
                ,&KeyValueInformation[0], sizeof(KeyValueInformation)
                ,&Length);
@@ -169,6 +168,7 @@ void test1(void)
   NtClose( hKey1 );
 }
 
+
 void test2(void)
 {
  HKEY hKey,hKey1;
@@ -181,7 +181,7 @@ void test2(void)
  DWORD Result;
   dprintf("NtCreateKey volatile: \n");
   dprintf("  \\Registry\\Machine\\Software\\test2reactos: ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
@@ -190,31 +190,31 @@ void test2(void)
   NtClose(hKey);
   do_enumeratekey(L"\\Registry\\Machine\\Software");
   dprintf("  ...\\test2 :");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtCreateKey ( &hKey1, KEY_ALL_ACCESS , &ObjectAttributes
                ,0,NULL,REG_OPTION_VOLATILE,NULL);
   dprintf("\t\t\t\t\tStatus=%x\n",Status);
   dprintf("  ...\\TestVolatile :");
-  RtlInitUnicodeString(&KeyName, L"TestVolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"TestVolatile");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , hKey1, NULL);
   Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
                ,0,NULL,REG_OPTION_VOLATILE,NULL);
   dprintf("\t\t\t\tStatus=%x\n",Status);
   NtClose(hKey1);
-  RtlInitUnicodeString(&ValueName, L"TestREG_SZ");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestREG_SZ");
   dprintf("NtSetValueKey reg_sz: ");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"Test Reg_sz",24);
   dprintf("\t\t\t\tStatus=%x\n",Status);
-  RtlInitUnicodeString(&ValueName, L"TestDWORD");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestDWORD");
   dprintf("NtSetValueKey reg_dword: ");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_DWORD,(PVOID)"reac",4);
   dprintf("\t\t\tStatus=%x\n",Status);
   NtClose(hKey);
   dprintf("NtOpenKey \\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile : ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -250,7 +250,7 @@ void test2(void)
   dprintf("delete \\Registry\\Machine\\software\\test2reactos ?");
   ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
   if (Buffer[0] != 'y' && Buffer[0] != 'Y') return;
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -263,7 +263,7 @@ void test2(void)
   Status=NtDeleteKey(hKey);
   dprintf("\t\t\t\tStatus =%x\n",Status);
   NtClose(hKey);
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -276,7 +276,7 @@ void test2(void)
   Status=NtDeleteKey(hKey);
   dprintf("\t\t\t\tStatus =%x\n",Status);
   NtClose(hKey);
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -303,7 +303,7 @@ void test3(void)
  DWORD Result;
   dprintf("NtCreateKey non volatile: \n");
   dprintf("  \\Registry\\Machine\\Software\\test3reactos: ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
@@ -316,7 +316,7 @@ void test3(void)
   dprintf("\t\tStatus=%x\n",Status);
   NtClose(hKey);
   dprintf("  ...\\test3 :");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
@@ -327,24 +327,24 @@ void test3(void)
   dprintf("\t\tStatus=%x\n",Status);
   NtClose(hKey);
   dprintf("  ...\\testNonVolatile :");
-  RtlInitUnicodeString(&KeyName, L"TestNonVolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"TestNonVolatile");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , hKey1, NULL);
   Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
                ,0,NULL,REG_OPTION_NON_VOLATILE,NULL);
   dprintf("\t\t\t\tStatus=%x\n",Status);
   NtClose(hKey1);
-  RtlInitUnicodeString(&ValueName, L"TestREG_SZ");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestREG_SZ");
   dprintf("NtSetValueKey reg_sz: ");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"Test Reg_sz",24);
   dprintf("\t\t\t\tStatus=%x\n",Status);
-  RtlInitUnicodeString(&ValueName, L"TestDWORD");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestDWORD");
   dprintf("NtSetValueKey reg_dword: ");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_DWORD,(PVOID)"reac",4);
   dprintf("\t\t\tStatus=%x\n",Status);
   NtClose(hKey);
   dprintf("NtOpenKey \\Registry\\Machine\\Software\\test3reactos\\test3\\testNonVolatile : ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonVolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonVolatile");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -380,7 +380,7 @@ void test3(void)
   dprintf("delete \\Registry\\Machine\\software\\test3reactos ?");
   ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
   if (Buffer[0] != 'y' && Buffer[0] != 'Y') return;
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonvolatile");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonvolatile");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -392,7 +392,7 @@ void test3(void)
   dprintf("NtDeleteKey : ");
   Status=NtDeleteKey(hKey);
   dprintf("\t\t\t\tStatus =%x\n",Status);
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -405,7 +405,7 @@ void test3(void)
   Status=NtDeleteKey(hKey);
   dprintf("\t\t\t\tStatus =%x\n",Status);
   NtClose(hKey);
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -595,7 +595,7 @@ void test5(void)
 
   dprintf("NtOpenKey : \n");
   dprintf("  \\Registry\\Machine\\Software\\reactos : ");
-  RtlInitUnicodeString(&KeyName,L"\\Registry\\Machine\\Software\\reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName,L"\\Registry\\Machine\\Software\\reactos");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
@@ -622,7 +622,7 @@ void test6(void)
 
   dprintf("Create target key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Reactos\n");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Reactos");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Reactos");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtCreateKey(&hKey, KEY_ALL_ACCESS , &ObjectAttributes
@@ -633,7 +633,7 @@ void test6(void)
 
   dprintf("Create target value\n");
   dprintf("  Value: TestValue = 'Test String'\n");
-  RtlInitUnicodeString(&ValueName, L"TestValue");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestValue");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"TestString",22);
   dprintf("  NtSetValueKey() called (Status %lx)\n",Status);
   if (!NT_SUCCESS(Status))
@@ -645,7 +645,7 @@ void test6(void)
 
   dprintf("Create link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE | OBJ_OPENLINK,
@@ -664,7 +664,7 @@ void test6(void)
 
   dprintf("Create link value\n");
   dprintf("  Value: SymbolicLinkValue = '\\Registry\\Machine\\SOFTWARE\\Reactos'\n");
-  RtlInitUnicodeString(&ValueName, L"SymbolicLinkValue");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"SymbolicLinkValue");
   Status=NtSetValueKey(hKey,&ValueName,0,REG_LINK,(PVOID)L"\\Registry\\Machine\\SOFTWARE\\Reactos",68);
   dprintf("  NtSetValueKey() called (Status %lx)\n",Status);
   if (!NT_SUCCESS(Status))
@@ -679,7 +679,7 @@ void test6(void)
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_OPENIF
                                , NULL, NULL);
   Status = NtCreateKey(&hKey, KEY_ALL_ACCESS , &ObjectAttributes
@@ -690,7 +690,7 @@ void test6(void)
 
   dprintf("Query value\n");
   dprintf("  Value: TestValue\n");
-  RtlInitUnicodeString(&ValueName, L"TestValue");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"TestValue");
   Status=NtQueryValueKey(hKey,
                         &ValueName,
                         KeyValueFullInformation,
@@ -729,7 +729,7 @@ void test7(void)
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_OPENLINK,
@@ -750,7 +750,7 @@ void test7(void)
     }
 
   dprintf("Delete link value\n");
-  RtlInitUnicodeString(&ValueName, L"SymbolicLinkValue");
+  RtlInitUnicodeStringFromLiteral(&ValueName, L"SymbolicLinkValue");
   Status = NtDeleteValueKey(hKey,
                            &ValueName);
   dprintf("  NtDeleteValueKey() called (Status %lx)\n",Status);
@@ -801,7 +801,7 @@ void test8(void)
 //  dprintf("\t\t\t\tStatus =%x\n",Status);
 
 
-  RtlInitUnicodeString(&KeyName,L"test5");
+  RtlInitUnicodeStringFromLiteral(&KeyName,L"test5");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtLoadKey(HKEY_LOCAL_MACHINE,&ObjectAttributes);
@@ -811,7 +811,7 @@ void test8(void)
   dprintf("\t\t\t\tdwError =%x\n",dwError);
 
   dprintf("NtOpenKey \\Registry\\Machine : ");
-  RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine");
+  RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine");
   InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
                                OBJ_CASE_INSENSITIVE,
@@ -819,7 +819,7 @@ void test8(void)
                                NULL);
   Status=NtOpenKey( &hKey, MAXIMUM_ALLOWED, &ObjectAttributes);
   dprintf("\t\t\tStatus =%x\n",Status);
-  RtlInitUnicodeString(&KeyName,L"test5");
+  RtlInitUnicodeStringFromLiteral(&KeyName,L"test5");
   InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
                                , NULL, NULL);
   Status = NtLoadKey(hKey,&ObjectAttributes);
index b136fd0..5d51f33 100644 (file)
@@ -192,14 +192,13 @@ NTSTATUS PiceSendIoctl(PDEVICE_OBJECT Target, ULONG Ioctl,
 BOOLEAN PatchKeyboardDriver(void)
 {
        PINTERNAL_I8042_HOOK_KEYBOARD phkData;
-    UNICODE_STRING DevName;
+       //When we have i8042 driver this should be changed!!!!!!!
+    UNICODE_STRING DevName = UNICODE_STRING_INITIALIZER(L"\\Device\\Keyboard");
        PDEVICE_OBJECT kbdDevice = NULL;
        PFILE_OBJECT FO = NULL;
        NTSTATUS status;
 
        ENTER_FUNC();
-       //When we have i8042 driver this should be changed!!!!!!!
-       RtlInitUnicodeString(&DevName, L"\\Device\\Keyboard");
 
        //Get pointer to keyboard device
     if( !NT_SUCCESS( status = IoGetDeviceObjectPointer( &DevName, FILE_READ_ACCESS, &FO, &kbdDevice ) ) )
index 79005d2..2ea94f0 100644 (file)
@@ -183,7 +183,7 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
                //ei unimplemented DriverObject->MajorFunction[IRP_MJ_CLOSE] = pice_close;
                DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = pice_ioctl;
 
-               RtlInitUnicodeString(&DeviceName, L"\\Device\\Pice");
+               RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\Device\\Pice");
                IoCreateDevice(DriverObject,
                                0,
                                &DeviceName,
@@ -193,7 +193,7 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
                                &DeviceObject);
                DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
 
-               RtlInitUnicodeString(&SymlinkName, L"\\??\\Pice");
+               RtlInitUnicodeStringFromLiteral(&SymlinkName, L"\\??\\Pice");
                IoCreateSymbolicLink(&SymlinkName, &DeviceName);
 
                return(STATUS_SUCCESS);
index a26a49a..d564bf8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: beep.c,v 1.11 2002/07/18 00:29:19 ekohl Exp $
+/* $Id: beep.c,v 1.12 2002/08/20 20:37:04 hyperion Exp $
  *
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
@@ -240,8 +240,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
 {
   PDEVICE_EXTENSION DeviceExtension;
   PDEVICE_OBJECT DeviceObject;
-  UNICODE_STRING DeviceName;
-  UNICODE_STRING SymlinkName;
+  UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Beep");
+  UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\Beep");
   NTSTATUS Status;
 
   DPRINT("Beep Device Driver 0.0.3\n");
@@ -253,8 +253,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
   DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = BeepDeviceControl;
   DriverObject->DriverUnload = BeepUnload;
 
-  RtlInitUnicodeString(&DeviceName,
-                      L"\\Device\\Beep");
   Status = IoCreateDevice(DriverObject,
                          sizeof(DEVICE_EXTENSION),
                          &DeviceName,
@@ -278,8 +276,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
                    FALSE);
 
   /* Create the dos device link */
-  RtlInitUnicodeString(&SymlinkName,
-                      L"\\??\\Beep");
   IoCreateSymbolicLink(&SymlinkName,
                       &DeviceName);
 
index 390c09a..233aa9b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: blue.c,v 1.32 2002/02/08 02:57:07 chorns Exp $
+/* $Id: blue.c,v 1.33 2002/08/20 20:37:05 hyperion Exp $
  *
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
@@ -607,8 +607,8 @@ NTSTATUS STDCALL
 DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 {
     PDEVICE_OBJECT DeviceObject;
-    UNICODE_STRING DeviceName;
-    UNICODE_STRING SymlinkName;
+    UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\BlueScreen");
+    UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\BlueScreen");
 
     DPRINT ("Screen Driver 0.0.6\n");
 
@@ -618,7 +618,6 @@ DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
     DriverObject->MajorFunction[IRP_MJ_WRITE]  = ScrWrite;
     DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL ] = ScrIoControl;
 
-    RtlInitUnicodeString (&DeviceName, L"\\Device\\BlueScreen");
     IoCreateDevice (DriverObject,
                     sizeof(DEVICE_EXTENSION),
                     &DeviceName,
@@ -627,7 +626,6 @@ DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
                     TRUE,
                     &DeviceObject);
 
-    RtlInitUnicodeString (&SymlinkName, L"\\??\\BlueScreen");
     IoCreateSymbolicLink (&SymlinkName, &DeviceName);
 
     return (STATUS_SUCCESS);
index 27c26ec..573a058 100644 (file)
@@ -122,7 +122,7 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
 #endif
     
    /* FIXME: Let's assume one drive and one controller for the moment */
-   RtlInitUnicodeString(&DeviceName, L"\\Device\\Floppy0");
+   RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\Device\\Floppy0");
    Status = IoCreateDevice(DriverObject,
                           sizeof(FLOPPY_DEVICE_EXTENSION),
                           &DeviceName,
index 6eb2f78..42d4d90 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: null.c,v 1.7 2002/04/29 23:06:42 hyperion Exp $
+/* $Id: null.c,v 1.8 2002/08/20 20:37:05 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -113,7 +113,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
  DriverObject->DriverUnload = NullUnload;
 
  /* create null device */
- RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Null");
+ RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Null");
 
  nErrCode = IoCreateDevice
  (
@@ -135,7 +135,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
  pdoNullDevice->DeviceExtension = (PVOID)&nxNull;
 
  /* create zero device */
- RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Zero");
+ RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Zero");
 
  nErrCode = IoCreateDevice
  (
index dfc48be..e9a4935 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: parallel.c,v 1.7 2002/02/08 02:57:08 chorns Exp $
+/* $Id: parallel.c,v 1.8 2002/08/20 20:37:05 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -127,13 +127,11 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
  */
 {
    PDEVICE_OBJECT DeviceObject;
-   UNICODE_STRING DeviceName;
+   UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Parallel");
    NTSTATUS Status;
    
    DPRINT("Parallel Port Driver 0.0.1\n");
    
-   RtlInitUnicodeString (&DeviceName,
-                        L"\\Device\\Parallel");
    Status = IoCreateDevice(DriverObject,
                           0,
                           &DeviceName,
index 855d71e..1219ae3 100644 (file)
@@ -83,7 +83,7 @@ NTSTATUS STDCALL RamdrvDispatchOpenClose(PDEVICE_OBJECT DeviceObject,
 NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject,
                             IN PUNICODE_STRING RegistryPath)
 {
-  UNICODE_STRING DeviceName;
+  UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Ramdisk");
   NTSTATUS Status;
   PDEVICE_OBJECT DeviceObject;
   PRAMDRV_DEVICE_EXTENSION devext;
@@ -109,7 +109,6 @@ NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject,
   
   
   // create device and symbolic link
-  RtlInitUnicodeString( &DeviceName, L"\\Device\\Ramdisk" );
   Status = IoCreateDevice( DriverObject,
                           sizeof( RAMDRV_DEVICE_EXTENSION ),
                           &DeviceName,
@@ -128,10 +127,10 @@ NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject,
       Status = STATUS_INSUFFICIENT_RESOURCES;
       goto cleandevice;
     }
-  RtlInitUnicodeString( &LinkName, L"\\??\\Z:" );
+  RtlInitUnicodeStringFromLiteral( &LinkName, L"\\??\\Z:" );
   IoCreateSymbolicLink( &LinkName, &DeviceName );
 
-  RtlInitUnicodeString( &LinkName, L"\\Device\\Floppy0\\ramdisk.bz2" );
+  RtlInitUnicodeStringFromLiteral( &LinkName, L"\\Device\\Floppy0\\ramdisk.bz2" );
   InitializeObjectAttributes( &objattr,
                              &LinkName,
                              0,
index 1b85be6..212efcc 100644 (file)
@@ -99,7 +99,7 @@ VOID  VGAResetDevice(OUT PSTATUS_BLOCK  StatusBlock)
   char *vidmem;
   HANDLE Event;
   OBJECT_ATTRIBUTES Attr;
-  UNICODE_STRING Name;
+  UNICODE_STRING Name = UNICODE_STRING_INITIALIZER(L"\\TextConsoleRefreshEvent");
   NTSTATUS Status;
   VIDEO_X86_BIOS_ARGUMENTS vxba;
   VP_STATUS vps;
@@ -114,7 +114,6 @@ VOID  VGAResetDevice(OUT PSTATUS_BLOCK  StatusBlock)
   memset(&vxba, 0, sizeof(vxba));
   vxba.Eax = 0x1112;
   vps = VideoPortInt10(NULL, &vxba);
-  RtlInitUnicodeString( &Name, L"\\TextConsoleRefreshEvent" );
   InitializeObjectAttributes( &Attr, &Name, 0, 0, 0 );
   Status = ZwOpenEvent( &Event, STANDARD_RIGHTS_ALL, &Attr );
   if( !NT_SUCCESS( Status ) )
index 494eb39..b4ce786 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: cdfs.c,v 1.5 2002/05/15 18:01:30 ekohl Exp $
+/* $Id: cdfs.c,v 1.6 2002/08/20 20:37:06 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -56,12 +56,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
 {
   PDEVICE_OBJECT DeviceObject;
   NTSTATUS Status;
-  UNICODE_STRING DeviceName;
+  UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Cdfs");
 
   DPRINT("CDFS 0.0.2\n");
 
-  RtlInitUnicodeString(&DeviceName,
-                      L"\\Cdfs");
   Status = IoCreateDevice(DriverObject,
                          sizeof(CDFS_GLOBAL_DATA),
                          &DeviceName,
index 3805948..46a47e7 100644 (file)
@@ -154,14 +154,12 @@ DriverEntry(PDRIVER_OBJECT _DriverObject,
 {
    PDEVICE_OBJECT DeviceObject;
    NTSTATUS ret;
-   UNICODE_STRING DeviceName;
+   UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Ext2Fsd");
    
    DbgPrint("Ext2 FSD 0.0.1\n");
    
    DriverObject = _DriverObject;
    
-   RtlInitUnicodeString(&DeviceName,
-                       L"\\Device\\Ext2Fsd");
    ret = IoCreateDevice(DriverObject,
                        0,
                        &DeviceName,
index b25df5d..f76dfbb 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: cdfs.c,v 1.4 2002/06/12 23:35:55 ekohl Exp $
+/* $Id: cdfs.c,v 1.5 2002/08/20 20:37:06 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -119,7 +119,7 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
 
       case IRP_MN_LOAD_FILE_SYSTEM:
        DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n");
-       RtlInitUnicodeString(&RegistryPath,
+       RtlInitUnicodeStringFromLiteral(&RegistryPath,
                             L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs");
        Status = ZwLoadDriver(&RegistryPath);
        if (!NT_SUCCESS(Status))
index 6d94eff..5f1e810 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: fat.c,v 1.3 2002/06/12 23:35:55 ekohl Exp $
+/* $Id: fat.c,v 1.4 2002/08/20 20:37:06 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -117,7 +117,7 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
 
       case IRP_MN_LOAD_FILE_SYSTEM:
        DPRINT("FAT: IRP_MN_LOAD_FILE_SYSTEM\n");
-       RtlInitUnicodeString(&RegistryPath,
+       RtlInitUnicodeStringFromLiteral(&RegistryPath,
                             L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs");
        Status = ZwLoadDriver(&RegistryPath);
        if (!NT_SUCCESS(Status))
index 6c2cb33..6e9d5fa 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: ntfs.c,v 1.1 2002/06/25 22:23:06 ekohl Exp $
+/* $Id: ntfs.c,v 1.2 2002/08/20 20:37:06 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -55,12 +55,10 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
 {
   PDEVICE_OBJECT DeviceObject;
   NTSTATUS Status;
-  UNICODE_STRING DeviceName;
+  UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Ntfs");
 
   DPRINT("NTFS 0.0.1\n");
 
-  RtlInitUnicodeString(&DeviceName,
-                      L"\\Ntfs");
   Status = IoCreateDevice(DriverObject,
                          sizeof(NTFS_GLOBAL_DATA),
                          &DeviceName,
index 93676cb..dbffa14 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: template.c,v 1.3 2002/05/23 09:52:56 ekohl Exp $
+/* $Id: template.c,v 1.4 2002/08/20 20:37:07 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -249,14 +249,12 @@ DriverEntry(PDRIVER_OBJECT _DriverObject,
 {
   PDEVICE_OBJECT DeviceObject;
   NTSTATUS Status;
-  UNICODE_STRING DeviceName;
+  UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\BareFsd");
 
   DbgPrint("Bare FSD Template 0.0.1\n");
 
   DriverObject = _DriverObject;
 
-  RtlInitUnicodeString(&DeviceName,
-                      L"\\Device\\BareFsd");
   Status = IoCreateDevice(DriverObject,
                          0,
                          &DeviceName,
index 3fca950..f39f0a5 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: iface.c,v 1.64 2002/08/14 20:58:31 dwelch Exp $
+/* $Id: iface.c,v 1.65 2002/08/20 20:37:07 hyperion Exp $
  *
  * PROJECT:          ReactOS kernel
  * FILE:             services/fs/vfat/iface.c
@@ -51,10 +51,9 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
  */
 {
    PDEVICE_OBJECT DeviceObject;
-   UNICODE_STRING DeviceName;
+   UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Fat");
    NTSTATUS Status;
 
-   RtlInitUnicodeString(&DeviceName, L"\\Fat");
    Status = IoCreateDevice(DriverObject,
                           sizeof(VFAT_GLOBAL_DATA),
                           &DeviceName,
index 4898172..4848bd4 100644 (file)
@@ -831,8 +831,8 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
  */
 {
    PDEVICE_OBJECT DeviceObject;
-   UNICODE_STRING DeviceName;
-   UNICODE_STRING SymlinkName;
+   UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Keyboard");
+   UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\Keyboard");
    
    DPRINT("Keyboard Driver 0.0.4\n");
 
@@ -842,8 +842,7 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
    DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = KbdInternalDeviceControl;  
 
    DriverObject->DriverStartIo = KbdStartIo;
-   
-   RtlInitUnicodeString(&DeviceName, L"\\Device\\Keyboard");
+
    IoCreateDevice(DriverObject,
                  sizeof(DEVICE_EXTENSION),
                  &DeviceName,
@@ -857,8 +856,6 @@ NTSTATUS STDCALL DriverEntry(PDRIVER_OBJECT DriverObject,
    DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
    InitializeKeyboard( DeviceObject );
    
-   
-   RtlInitUnicodeString(&SymlinkName, L"\\??\\Keyboard");
    IoCreateSymbolicLink(&SymlinkName, &DeviceName);
    
    return(STATUS_SUCCESS);
index 9caf629..a4e65d0 100644 (file)
@@ -90,7 +90,7 @@ NTSTATUS ConnectMousePortDriver(PDEVICE_OBJECT ClassDeviceObject)
    PDEVICE_OBJECT PortDeviceObject = NULL;
    PFILE_OBJECT FileObject = NULL;
    NTSTATUS status;
-   UNICODE_STRING PortName;
+   UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\Device\\Mouse");
    IO_STATUS_BLOCK ioStatus;
    KEVENT event;
    PIRP irp;
@@ -102,7 +102,6 @@ NTSTATUS ConnectMousePortDriver(PDEVICE_OBJECT ClassDeviceObject)
    // Get the port driver's DeviceObject
    // FIXME: The name might change.. find a way to be more dynamic?
 
-   RtlInitUnicodeString(&PortName, L"\\Device\\Mouse");
    status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject, &PortDeviceObject);
 
    if(status != STATUS_SUCCESS)
@@ -263,8 +262,8 @@ NTSTATUS STDCALL
 DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 {
    PDEVICE_OBJECT DeviceObject;
-   UNICODE_STRING DeviceName;
-   UNICODE_STRING SymlinkName;
+   UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\MouseClass");
+   UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\MouseClass");
 
    DriverObject->MajorFunction[IRP_MJ_CREATE] = MouseClassDispatch;
 //   DriverObject->MajorFunction[IRP_MJ_CLOSE]  = MouseClassDispatch;
@@ -272,7 +271,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = MouseClassInternalDeviceControl; // to get GDI callback
 //   DriverObject->DriverStartIo                = MouseClassStartIo;
 
-   RtlInitUnicodeString(&DeviceName, L"\\Device\\MouseClass");
    IoCreateDevice(DriverObject,
                  sizeof(DEVICE_EXTENSION),
                  &DeviceName,
@@ -282,7 +280,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
                  &DeviceObject);
    DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
 
-   RtlInitUnicodeString(&SymlinkName, L"\\??\\MouseClass");
    IoCreateSymbolicLink(&SymlinkName, &DeviceName);
 
    return ConnectMousePortDriver(DeviceObject);
index 1386de4..e8bd4b0 100644 (file)
@@ -171,7 +171,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = PS2MouseInternalDeviceControl;
    DriverObject->DriverStartIo                = PS2MouseStartIo;
 
-   RtlInitUnicodeString(&DeviceName, L"\\Device\\Mouse"); // FIXME: find correct device name
+   RtlInitUnicodeStringFromLiteral(&DeviceName,
+                                   L"\\Device\\Mouse"); // FIXME: find correct device name
    IoCreateDevice(DriverObject,
                  sizeof(DEVICE_EXTENSION),
                  &DeviceName,
@@ -181,7 +182,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
                  &DeviceObject);
    DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
 
-   RtlInitUnicodeString(&SymlinkName, L"\\??\\Mouse"); // FIXME: find correct device name
+   RtlInitUnicodeStringFromLiteral(&SymlinkName,
+                                   L"\\??\\Mouse"); // FIXME: find correct device name
    IoCreateSymbolicLink(&SymlinkName, &DeviceName);
 
    DeviceExtension = DeviceObject->DeviceExtension;
index 3dcb6c5..d625924 100644 (file)
@@ -350,7 +350,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
   DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = SerialMouseInternalDeviceControl;
   DriverObject->DriverStartIo                = SerialMouseStartIo;
 
-  RtlInitUnicodeString(&DeviceName, L"\\Device\\Mouse"); // FIXME: find correct device name
+  RtlInitUnicodeStringFromLiteral(&DeviceName,
+                                  L"\\Device\\Mouse"); // FIXME: find correct device name
   IoCreateDevice(DriverObject,
          sizeof(DEVICE_EXTENSION),
          &DeviceName,
@@ -360,7 +361,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
          &DeviceObject);
   DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
 
-  RtlInitUnicodeString(&SymlinkName, L"\\??\\Mouse"); // FIXME: find correct device name
+  RtlInitUnicodeStringFromLiteral(&SymlinkName,
+                                  L"\\??\\Mouse"); // FIXME: find correct device name
   IoCreateSymbolicLink(&SymlinkName, &DeviceName);
 
   DeviceExtension = DeviceObject->DeviceExtension;
index 8fbe35d..845272b 100644 (file)
@@ -146,10 +146,9 @@ DriverEntry(
 {
     PDEVICE_EXTENSION DeviceExt;
     PDEVICE_OBJECT DeviceObject;
-    UNICODE_STRING DeviceName;
+    UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\Afd");
     NTSTATUS Status;
 
-    RtlInitUnicodeString(&DeviceName, L"\\Device\\Afd");
     Status = IoCreateDevice(DriverObject,
                             sizeof(DEVICE_EXTENSION),
                             &DeviceName,
index 23cbcac..3b1a69d 100644 (file)
@@ -1030,7 +1030,7 @@ NdisMRegisterMiniport(
 
     /* Create the device object for this adapter */
     /* FIXME: Use GUIDs */
-    RtlInitUnicodeString(&Adapter->DeviceName, L"\\Device\\ne2000");
+    RtlInitUnicodeStringFromLiteral(&Adapter->DeviceName, L"\\Device\\ne2000");
     Status = IoCreateDevice(Miniport->DriverObject,
                             0,
                             &Adapter->DeviceName,
index b588cd1..20cadbe 100644 (file)
@@ -717,7 +717,7 @@ DriverEntry(
   /* FIXME: Create symbolic links in Win32 namespace */
 
   /* Create IP device object */
-  RtlInitUnicodeString(&strDeviceName, DD_IP_DEVICE_NAME);
+  RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_IP_DEVICE_NAME);
   Status = IoCreateDevice(DriverObject, 0, &strDeviceName,
     FILE_DEVICE_NETWORK, 0, FALSE, &IPDeviceObject);
   if (!NT_SUCCESS(Status)) {
@@ -726,7 +726,7 @@ DriverEntry(
   }
 
   /* Create RawIP device object */
-  RtlInitUnicodeString(&strDeviceName, DD_RAWIP_DEVICE_NAME);
+  RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_RAWIP_DEVICE_NAME);
   Status = IoCreateDevice(DriverObject, 0, &strDeviceName,
     FILE_DEVICE_NETWORK, 0, FALSE, &RawIPDeviceObject);
   if (!NT_SUCCESS(Status)) {
@@ -736,7 +736,7 @@ DriverEntry(
   }
 
   /* Create UDP device object */
-  RtlInitUnicodeString(&strDeviceName, DD_UDP_DEVICE_NAME);
+  RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_UDP_DEVICE_NAME);
   Status = IoCreateDevice(DriverObject, 0, &strDeviceName,
     FILE_DEVICE_NETWORK, 0, FALSE, &UDPDeviceObject);
   if (!NT_SUCCESS(Status)) {
@@ -746,7 +746,7 @@ DriverEntry(
   }
 
   /* Create TCP device object */
-  RtlInitUnicodeString(&strDeviceName, DD_TCP_DEVICE_NAME);
+  RtlInitUnicodeStringFromLiteral(&strDeviceName, DD_TCP_DEVICE_NAME);
   Status = IoCreateDevice(DriverObject, 0, &strDeviceName,
     FILE_DEVICE_NETWORK, 0, FALSE, &TCPDeviceObject);
   if (!NT_SUCCESS(Status)) {
index 5cdc7b8..84d316d 100644 (file)
@@ -292,18 +292,18 @@ WSHOpenSocket2(
 
     switch (*SocketType) {
     case SOCK_STREAM:
-        RtlInitUnicodeString(&String, DD_TCP_DEVICE_NAME);
+        RtlInitUnicodeStringFromLiteral(&String, DD_TCP_DEVICE_NAME);
         break;
 
     case SOCK_DGRAM:
-        RtlInitUnicodeString(&String, DD_UDP_DEVICE_NAME);
+        RtlInitUnicodeStringFromLiteral(&String, DD_UDP_DEVICE_NAME);
         break;
 
     case SOCK_RAW:
         if ((*Protocol < 0) || (*Protocol > 255))
           return WSAEINVAL;
 
-        RtlInitUnicodeString(&String, DD_RAW_IP_DEVICE_NAME);
+        RtlInitUnicodeStringFromLiteral(&String, DD_RAW_IP_DEVICE_NAME);
         break;
 
     default:
index 1a93bbd..2b82d7e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.64 2002/08/18 18:50:25 hyperion Exp $
+/* $Id: rtl.h,v 1.65 2002/08/20 20:37:08 hyperion Exp $
  * 
  */
 
@@ -1066,6 +1066,70 @@ RtlInitUnicodeString (
        PCWSTR          SourceString
        );
 
+/*
+VOID
+InitializeUnicodeString (
+       PUNICODE_STRING DestinationString,
+        USHORT          Lenght,
+        USHORT          MaximumLength,
+       PCWSTR          Buffer
+       );
+
+ Initialize an UNICODE_STRING from its fields. Use when you know the values of
+ all the fields in advance
+
+ */
+
+#define InitializeUnicodeString(__PDEST_STRING__,__LENGTH__,__MAXLENGTH__,__BUFFER__) \
+{ \
+ (__PDEST_STRING__)->Length = (__LENGTH__); \
+ (__PDEST_STRING__)->MaximumLength = (__MAXLENGTH__); \
+ (__PDEST_STRING__)->Buffer = (__BUFFER__); \
+}
+
+/*
+VOID
+RtlInitUnicodeStringFromLiteral (
+       PUNICODE_STRING DestinationString,
+       PCWSTR          SourceString
+       );
+
+ Initialize an UNICODE_STRING from a wide string literal. WARNING: use only with
+ string literals and statically initialized arrays, it will calculate the wrong
+ length otherwise
+
+ */
+
+#define RtlInitUnicodeStringFromLiteral(__PDEST_STRING__,__SOURCE_STRING__) \
+ InitializeUnicodeString( \
+  (__PDEST_STRING__), \
+  sizeof(__SOURCE_STRING__) - sizeof(WCHAR), \
+  sizeof(__SOURCE_STRING__), \
+  (__SOURCE_STRING__) \
+ )
+
+/*
+ Static initializer for UNICODE_STRING variables. Usage:
+
+ UNICODE_STRING wstr = UNICODE_STRING_INITIALIZER(L"string");
+
+*/
+
+#define UNICODE_STRING_INITIALIZER(__SOURCE_STRING__) \
+{ \
+ sizeof((__SOURCE_STRING__)) - sizeof(WCHAR), \
+ sizeof((__SOURCE_STRING__)), \
+ (__SOURCE_STRING__) \
+}
+
+/*
+ Initializer for empty UNICODE_STRING variables. Usage:
+
+ UNICODE_STRING wstr = EMPTY_UNICODE_STRING;
+
+*/
+#define EMPTY_UNICODE_STRING {0, 0, NULL}
+
 VOID
 STDCALL
 RtlInitializeBitMap (
index 3d45391..a5f6b82 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: reg.c,v 1.14 2001/09/03 23:11:59 ekohl Exp $
+/* $Id: reg.c,v 1.15 2002/08/20 20:37:09 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -181,13 +181,10 @@ static NTSTATUS
 OpenClassesRootKey(PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES Attributes;
-  UNICODE_STRING KeyName;
+  UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry\\Machine\\Software\\CLASSES");
 
   DPRINT("OpenClassesRootKey()\n");
 
-  RtlInitUnicodeString(&KeyName,
-                      L"\\Registry\\Machine\\Software\\CLASSES");
-
   InitializeObjectAttributes(&Attributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
@@ -204,13 +201,10 @@ static NTSTATUS
 OpenLocalMachineKey(PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES Attributes;
-  UNICODE_STRING KeyName;
+  UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry\\Machine");
 
   DPRINT("OpenLocalMachineKey()\n");
 
-  RtlInitUnicodeString(&KeyName,
-                      L"\\Registry\\Machine");
-
   InitializeObjectAttributes(&Attributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
@@ -227,13 +221,10 @@ static NTSTATUS
 OpenUsersKey(PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES Attributes;
-  UNICODE_STRING KeyName;
+  UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry\\User");
 
   DPRINT("OpenUsersKey()\n");
 
-  RtlInitUnicodeString(&KeyName,
-                      L"\\Registry\\User");
-
   InitializeObjectAttributes(&Attributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
@@ -250,13 +241,11 @@ static NTSTATUS
 OpenCurrentConfigKey(PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES Attributes;
-  UNICODE_STRING KeyName;
+  UNICODE_STRING KeyName =
+   UNICODE_STRING_INITIALIZER(L"\\Registry\\Machine\\System\\CurrentControlSet\\Hardware Profiles\\Current");
 
   DPRINT("OpenCurrentConfigKey()\n");
 
-  RtlInitUnicodeString(&KeyName,
-                      L"\\Registry\\Machine\\System\\CurrentControlSet\\Hardware Profiles\\Current");
-
   InitializeObjectAttributes(&Attributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
@@ -464,7 +453,6 @@ RegCreateKeyExW(HKEY                        hKey,
        }
 
        DPRINT("ParentKey %x\n", (ULONG)ParentKey);
-
        RtlInitUnicodeString (&ClassString, lpClass);
        RtlInitUnicodeString (&SubKeyString, lpSubKey);
 
index 8615952..2c9d89b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: curdir.c,v 1.28 2002/04/27 19:14:30 hbirr Exp $
+/* $Id: curdir.c,v 1.29 2002/08/20 20:37:09 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -209,7 +209,7 @@ GetTempPathW (
        Value.MaximumLength = (nBufferLength - 1) * sizeof(WCHAR);
        Value.Buffer = lpBuffer;
 
-       RtlInitUnicodeString (&Name,
+       RtlInitUnicodeStringFromLiteral (&Name,
                              L"TMP");
 
        Status = RtlQueryEnvironmentVariable_U (NULL,
@@ -217,7 +217,7 @@ GetTempPathW (
                                                &Value);
        if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL)
        {
-               RtlInitUnicodeString (&Name,
+               RtlInitUnicodeStringFromLiteral (&Name,
                                      L"TEMP");
 
                Status = RtlQueryEnvironmentVariable_U (NULL,
index 7b7aa15..462eda6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dllmain.c,v 1.20 2002/04/26 13:07:03 ekohl Exp $
+/* $Id: dllmain.c,v 1.21 2002/08/20 20:37:10 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -43,12 +43,9 @@ static NTSTATUS
 OpenBaseDirectory(PHANDLE DirHandle)
 {
    OBJECT_ATTRIBUTES ObjectAttributes;
-   UNICODE_STRING Name;
+   UNICODE_STRING Name = UNICODE_STRING_INITIALIZER(L"\\BaseNamedObjects");
    NTSTATUS Status;
 
-   RtlInitUnicodeString(&Name,
-                       L"\\BaseNamedObjects");
-
    InitializeObjectAttributes(&ObjectAttributes,
                              &Name,
                              OBJ_PERMANENT,
index 5ca6a0a..47f25c9 100644 (file)
@@ -103,7 +103,7 @@ NTSTATUS OpenSocket(
 
   AFD_DbgPrint(MAX_TRACE, ("EaInfo at (0x%X)  EaLength is (%d).\n", (UINT)EaInfo, (INT)EaLength));
 
-  RtlInitUnicodeString(&DeviceName, L"\\Device\\Afd");
+  RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\Device\\Afd");
        InitializeObjectAttributes(
     &ObjectAttributes,
     &DeviceName,
@@ -658,7 +658,7 @@ NTSTATUS OpenCommandChannel(
   SocketInfo = (PAFD_SOCKET_INFORMATION)((ULONG_PTR)EaInfo->EaName + AFD_SOCKET_LENGTH);
   SocketInfo->CommandChannel = TRUE;
 
-  RtlInitUnicodeString(&DeviceName, L"\\Device\\Afd");
+  RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\Device\\Afd");
        InitializeObjectAttributes(
     &ObjectAttributes,
     &DeviceName,
index 9e4463d..49f1c6e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lpc.c,v 1.5 2002/02/02 17:15:22 phreak Exp $
+/* $Id: lpc.c,v 1.6 2002/08/20 20:37:10 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -131,7 +131,7 @@ CsrClientConnectToServer(VOID)
      {
        return(Status);
      }
-   RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
+   RtlInitUnicodeStringFromLiteral(&PortName, L"\\Windows\\ApiPort");
    ConnectInfoLength = 0;
    LpcWrite.Length = sizeof(LPC_SECTION_WRITE);
    LpcWrite.SectionHandle = CsrSectionHandle;
index 225ecf6..ae61506 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: debug.c,v 1.3 2001/08/03 17:17:16 ekohl Exp $
+/* $Id: debug.c,v 1.4 2002/08/20 20:37:10 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -77,12 +77,9 @@ DbgSsInitialize(HANDLE ReplyPort,
                ULONG Unknown3)
 {
        SECURITY_QUALITY_OF_SERVICE Qos;
-       UNICODE_STRING PortName;
+       UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\DbgSsApiPort");
        NTSTATUS Status;
 
-       RtlInitUnicodeString (&PortName,
-                             L"\\DbgSsApiPort");
-
        Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
        Qos.ImpersonationLevel = SecurityIdentification;
        Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
@@ -123,16 +120,13 @@ NTSTATUS STDCALL
 DbgUiConnectToDbg(VOID)
 {
        SECURITY_QUALITY_OF_SERVICE Qos;
-       UNICODE_STRING PortName;
+       UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(L"\\DbgUiApiPort");
        NTSTATUS Status;
        PTEB Teb;
        ULONG InfoSize;
 
        Teb = NtCurrentTeb ();
 
-       RtlInitUnicodeString (&PortName,
-                             L"\\DbgUiApiPort");
-
        Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
        Qos.ImpersonationLevel = SecurityIdentification;
        Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
index 48f77b2..ee62db5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: registry.c,v 1.15 2002/06/17 15:42:30 ekohl Exp $
+/* $Id: registry.c,v 1.16 2002/08/20 20:37:10 hyperion Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -113,7 +113,7 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess,
                   OUT PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING KeyPath;
+  UNICODE_STRING KeyPath = UNICODE_STRING_INITIALIZER(L"\\Registry\\User\\.Default");
   NTSTATUS Status;
 
   Status = RtlFormatCurrentUserKeyPath(&KeyPath);
@@ -132,9 +132,6 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess,
        return(STATUS_SUCCESS);
     }
 
-  RtlInitUnicodeString(&KeyPath,
-                      L"\\Registry\\User\\.Default");
-
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyPath,
                             OBJ_CASE_INSENSITIVE,
index 8c2998c..ade64b3 100644 (file)
@@ -1,9 +1,10 @@
 #include <ddk/ntddk.h>
 
 #define STUB(x) void x(void) { \
-                               UNICODE_STRING UnicodeString; \
-                                RtlInitUnicodeString(&UnicodeString,\
-                                L"NTDLL: Stub for "#x"\n"); \
+                               UNICODE_STRING UnicodeString = \
+                                  UNICODE_STRING_INITIALIZER( \
+                                    L"NTDLL: Stub for "#x"\n" \
+                                  ); \
                                 NtDisplayString(&UnicodeString); }
 
 
index 3c59510..076a8e1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lsa.c,v 1.2 2001/06/25 12:32:56 ekohl Exp $
+/* $Id: lsa.c,v 1.3 2002/08/20 20:37:11 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -256,13 +256,12 @@ LsaRegisterLogonProcess(PLSA_STRING LsaLogonProcessName,
                        PHANDLE Handle,
                        PLSA_OPERATIONAL_MODE OperationalMode)
 {
-   UNICODE_STRING Portname;
+   UNICODE_STRING Portname = UNICODE_STRING_INITIALIZER(L"\\SeLsaCommandPort");
    ULONG ConnectInfoLength;
    NTSTATUS Status;
    LSASS_REQUEST Request;
    LSASS_REPLY Reply;
-   
-   RtlInitUnicodeString(&Portname, L"\\SeLsaCommandPort");
+
    ConnectInfoLength = 0;
    Status = NtConnectPort(Handle,
                          &Portname,
index 344001f..42b2e42 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: registry.c,v 1.73 2002/06/19 22:31:33 ekohl Exp $
+/* $Id: registry.c,v 1.74 2002/08/20 20:37:11 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -566,7 +566,7 @@ CmiCreateCurrentControlSetLink(VOID)
 
   DPRINT("Link target '%S'\n", TargetNameBuffer);
 
-  RtlInitUnicodeString(&LinkName,
+  RtlInitUnicodeStringFromLiteral(&LinkName,
                       L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet");
   InitializeObjectAttributes(&ObjectAttributes,
                             &LinkName,
@@ -586,7 +586,7 @@ CmiCreateCurrentControlSetLink(VOID)
       return(Status);
     }
 
-  RtlInitUnicodeString(&LinkValue,
+  RtlInitUnicodeStringFromLiteral(&LinkValue,
                       L"SymbolicLinkValue");
   Status=NtSetValueKey(KeyHandle,
                       &LinkValue,
index e51cfd4..52fa4de 100644 (file)
@@ -92,7 +92,7 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess,
                   OUT PHANDLE KeyHandle)
 {
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING KeyPath;
+  UNICODE_STRING KeyPath = UNICODE_STRING_INITIALIZER(L"\\Registry\\User\\.Default");
   NTSTATUS Status;
 
   Status = RtlFormatCurrentUserKeyPath(&KeyPath);
@@ -111,9 +111,6 @@ RtlOpenCurrentUser(IN ACCESS_MASK DesiredAccess,
        return(STATUS_SUCCESS);
     }
 
-  RtlInitUnicodeString(&KeyPath,
-                      L"\\Registry\\User\\.Default");
-
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyPath,
                             OBJ_CASE_INSENSITIVE,
index 6fa6359..88b5bab 100644 (file)
@@ -867,7 +867,7 @@ KdbLdrLoadAutoConfigDrivers(VOID)
    * is created after their module entries
    */
 
-  RtlInitUnicodeString(&ModuleName, KERNEL_MODULE_NAME);
+  RtlInitUnicodeStringFromLiteral(&ModuleName, KERNEL_MODULE_NAME);
   ModuleObject = LdrGetModuleObject(&ModuleName);
   if (ModuleObject != NULL)
     {
@@ -875,7 +875,7 @@ KdbLdrLoadAutoConfigDrivers(VOID)
                            &ModuleObject->TextSection->SymbolInfo);
     }
 
-  RtlInitUnicodeString(&ModuleName, HAL_MODULE_NAME);
+  RtlInitUnicodeStringFromLiteral(&ModuleName, HAL_MODULE_NAME);
   ModuleObject = LdrGetModuleObject(&ModuleName);
   if (ModuleObject != NULL)
     {
index 7ecda32..d8461e7 100644 (file)
@@ -284,7 +284,7 @@ ExpWin32kInit(VOID)
   ExWindowStationObjectType->OkayToClose = NULL;
   ExWindowStationObjectType->Create = ExpWinStaObjectCreate;
   ExWindowStationObjectType->DuplicationNotify = NULL;
-  RtlInitUnicodeString(&ExWindowStationObjectType->TypeName, L"WindowStation");
+  RtlInitUnicodeStringFromLiteral(&ExWindowStationObjectType->TypeName, L"WindowStation");
 
   /* Create desktop object type */
   ExDesktopObjectType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
@@ -312,7 +312,7 @@ ExpWin32kInit(VOID)
   ExDesktopObjectType->OkayToClose = NULL;
   ExDesktopObjectType->Create = ExpDesktopObjectCreate;
   ExDesktopObjectType->DuplicationNotify = NULL;
-  RtlInitUnicodeString(&ExDesktopObjectType->TypeName, L"Desktop");
+  RtlInitUnicodeStringFromLiteral(&ExDesktopObjectType->TypeName, L"Desktop");
 }
 
 /* EOF */
index 2fd1e71..c8eabc1 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: arcname.c,v 1.5 2002/06/27 17:45:45 ekohl Exp $
+/* $Id: arcname.c,v 1.6 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -274,7 +274,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
   DPRINT("DeviceName: %wZ\n", &DeviceName);
 
   /* create the '\SystemRoot' link */
-  RtlInitUnicodeString(&LinkName,
+  RtlInitUnicodeStringFromLiteral(&LinkName,
                       L"\\SystemRoot");
 
   Status = IoCreateSymbolicLink(&LinkName,
index 98ccba0..4b55880 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: driver.c,v 1.9 2002/07/18 00:25:30 dwelch Exp $
+/* $Id: driver.c,v 1.10 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -108,7 +108,7 @@ IopInitDriverImplementation(VOID)
   IoDriverObjectType->OkayToClose = NULL;
   IoDriverObjectType->Create = IopCreateDriver;
   IoDriverObjectType->DuplicationNotify = NULL;
-  RtlInitUnicodeString(&IoDriverObjectType->TypeName, L"Driver");
+  RtlInitUnicodeStringFromLiteral(&IoDriverObjectType->TypeName, L"Driver");
 }
 
 /**********************************************************************
@@ -408,7 +408,7 @@ IoCreateDriverList(VOID)
     return(Status);
 
   /* Enumerate services and create the service list */
-  RtlInitUnicodeString(&ServicesKeyName,
+  RtlInitUnicodeStringFromLiteral(&ServicesKeyName,
                       L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
 
   InitializeObjectAttributes(&ObjectAttributes,
index 066ad64..2625587 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: iomgr.c,v 1.23 2002/08/14 20:58:34 dwelch Exp $
+/* $Id: iomgr.c,v 1.24 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:            See COPYING in the top level directory
  * PROJECT:              ReactOS kernel
@@ -146,7 +146,7 @@ VOID IoInit (VOID)
   IoDeviceObjectType->Create = IopCreateDevice;
   IoDeviceObjectType->DuplicationNotify = NULL;
   
-  RtlInitUnicodeString (&IoDeviceObjectType->TypeName, L"Device");
+  RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName, L"Device");
 
   /*
    * Register iomgr types: FileObjectType
@@ -173,12 +173,12 @@ VOID IoInit (VOID)
   IoFileObjectType->Create = IopCreateFile;
   IoFileObjectType->DuplicationNotify = NULL;
   
-  RtlInitUnicodeString (&IoFileObjectType->TypeName, L"File");
+  RtlInitUnicodeStringFromLiteral(&IoFileObjectType->TypeName, L"File");
 
   /*
    * Create the '\Driver' object directory
    */
-  RtlInitUnicodeString(&DirName, L"\\Driver");
+  RtlInitUnicodeStringFromLiteral(&DirName, L"\\Driver");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
                             0,
@@ -191,7 +191,7 @@ VOID IoInit (VOID)
   /*
    * Create the '\FileSystem' object directory
    */
-  RtlInitUnicodeString(&DirName,
+  RtlInitUnicodeStringFromLiteral(&DirName,
                       L"\\FileSystem");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -205,7 +205,7 @@ VOID IoInit (VOID)
   /*
    * Create the '\Device' directory
    */
-  RtlInitUnicodeString(&DirName,
+  RtlInitUnicodeStringFromLiteral(&DirName,
                       L"\\Device");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -219,7 +219,7 @@ VOID IoInit (VOID)
   /*
    * Create the '\??' directory
    */
-  RtlInitUnicodeString(&DirName,
+  RtlInitUnicodeStringFromLiteral(&DirName,
                       L"\\??");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -233,7 +233,7 @@ VOID IoInit (VOID)
   /*
    * Create the '\ArcName' directory
    */
-  RtlInitUnicodeString(&DirName,
+  RtlInitUnicodeStringFromLiteral(&DirName,
                       L"\\ArcName");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -256,9 +256,9 @@ VOID IoInit (VOID)
   /*
    * Create link from '\DosDevices' to '\??' directory
    */
-  RtlInitUnicodeString(&LinkName,
+  RtlInitUnicodeStringFromLiteral(&LinkName,
                       L"\\DosDevices");
-  RtlInitUnicodeString(&DirName,
+  RtlInitUnicodeStringFromLiteral(&DirName,
                       L"\\??");
   IoCreateSymbolicLink(&LinkName,
                       &DirName);
index 8c9f554..cdd46ca 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pnproot.c,v 1.7 2002/05/05 14:57:43 chorns Exp $
+/* $Id: pnproot.c,v 1.8 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -467,7 +467,7 @@ PnpRootFdoEnumerateDevices(
     return STATUS_INSUFFICIENT_RESOURCES;
   }
 
-  RtlInitUnicodeString(
+  RtlInitUnicodeStringFromLiteral(
     &KeyName,
     L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\" \
     ENUM_NAME_ROOT);
index f31a2c7..a189486 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: resource.c,v 1.8 2001/09/27 02:14:34 dwelch Exp $
+/* $Id: resource.c,v 1.9 2002/08/20 20:37:12 hyperion Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/io/resource.c
@@ -180,7 +180,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
   HANDLE DescriptionKey;
 
   /* Open/Create 'RESOURCEMAP' key. */
-  RtlInitUnicodeString(&Name,
+  RtlInitUnicodeStringFromLiteral(&Name,
                       L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
   InitializeObjectAttributes(&ObjectAttributes,
                             &Name,
@@ -198,7 +198,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     return(Status);
 
   /* Open/Create 'Hardware Abstraction Layer' key */
-  RtlInitUnicodeString(&Name,
+  RtlInitUnicodeStringFromLiteral(&Name,
                       L"Hardware Abstraction Layer");
   InitializeObjectAttributes(&ObjectAttributes,
                             &Name,
@@ -234,7 +234,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     return(Status);
 
   /* Add '.Raw' value. */
-  RtlInitUnicodeString(&Name,
+  RtlInitUnicodeStringFromLiteral(&Name,
                       L".Raw");
   Status = NtSetValueKey(DescriptionKey,
                         &Name,
@@ -249,7 +249,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     }
 
   /* Add '.Translated' value. */
-  RtlInitUnicodeString(&Name,
+  RtlInitUnicodeStringFromLiteral(&Name,
                       L".Translated");
   Status = NtSetValueKey(DescriptionKey,
                         &Name,
index 4001a12..c09eedd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: symlink.c,v 1.28 2002/06/27 17:46:53 ekohl Exp $
+/* $Id: symlink.c,v 1.29 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -166,7 +166,7 @@ VOID IoInitSymbolicLinkImplementation (VOID)
    IoSymbolicLinkType->Create = IopCreateSymbolicLink;
    IoSymbolicLinkType->DuplicationNotify = NULL;
    
-   RtlInitUnicodeString(&IoSymbolicLinkType->TypeName,
+   RtlInitUnicodeStringFromLiteral(&IoSymbolicLinkType->TypeName,
                        L"SymbolicLink");
 }
 
index 9e0b0a7..69ee9a1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dlog.c,v 1.4 2001/08/30 20:38:19 dwelch Exp $
+/* $Id: dlog.c,v 1.5 2002/08/20 20:37:12 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -119,7 +119,7 @@ DebugLogInit2(VOID)
   UNICODE_STRING FileName;
   IO_STATUS_BLOCK Iosb;
 
-  RtlInitUnicodeString(&FileName, L"\\SystemRoot\\debug.log");
+  RtlInitUnicodeStringFromLiteral(&FileName, L"\\SystemRoot\\debug.log");
   InitializeObjectAttributes(&ObjectAttributes,
                             &FileName,
                             0,
index 9b504e9..a4b4f61 100644 (file)
@@ -76,7 +76,7 @@ NTSTATUS LdrLoadInitialProcess (VOID)
     * Get the absolute path to smss.exe using the
     * SystemRoot link.
     */
-   RtlInitUnicodeString(&ProcessName,
+   RtlInitUnicodeStringFromLiteral(&ProcessName,
                        L"\\SystemRoot\\system32\\smss.exe");
    
    /*
index 6b26f1d..11a8fa6 100644 (file)
@@ -73,7 +73,7 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle,
    OBJECT_ATTRIBUTES   FileObjectAttributes;
    HANDLE                      FileHandle;
    HANDLE                      NTDllSectionHandle;
-   UNICODE_STRING              DllPathname;
+   UNICODE_STRING DllPathname = UNICODE_STRING_INITIALIZER(L"\\SystemRoot\\system32\\ntdll.dll");
    PIMAGE_DOS_HEADER   DosHeader;
    PIMAGE_NT_HEADERS   NTHeaders;
    PEPROCESS Process;
@@ -85,8 +85,6 @@ NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle,
     * Locate and open NTDLL to determine ImageBase
     * and LdrStartup
     */
-   RtlInitUnicodeString(&DllPathname,
-                       L"\\SystemRoot\\system32\\ntdll.dll");
    InitializeObjectAttributes(&FileObjectAttributes,
                              &DllPathname,
                              0,
index 45b2993..18c9d58 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: port.c,v 1.8 2001/12/05 01:40:24 dwelch Exp $
+/* $Id: port.c,v 1.9 2002/08/20 20:37:13 hyperion Exp $
  * 
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -44,7 +44,7 @@ NTSTATUS NiInitPort (VOID)
 {
    ExPortType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
    
-   RtlInitUnicodeString(&ExPortType->TypeName,L"Port");
+   RtlInitUnicodeStringFromLiteral(&ExPortType->TypeName,L"Port");
    
    ExPortType->Tag = TAG('L', 'P', 'R', 'T');
    ExPortType->MaxObjects = ULONG_MAX;
index 6748d22..3e0c8a7 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: section.c,v 1.91 2002/08/17 15:12:49 hbirr Exp $
+/* $Id: section.c,v 1.92 2002/08/20 20:37:13 hyperion Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/mm/section.c
@@ -1842,14 +1842,13 @@ MmCreatePhysicalMemorySection(VOID)
   PSECTION_OBJECT PhysSection;
   NTSTATUS Status;
   OBJECT_ATTRIBUTES Obj;
-  UNICODE_STRING Name;
+  UNICODE_STRING Name = UNICODE_STRING_INITIALIZER(L"\\Device\\PhysicalMemory");
   LARGE_INTEGER SectionSize;
    
   /*
    * Create the section mapping physical memory 
    */
   SectionSize.QuadPart = 0xFFFFFFFF;
-  RtlInitUnicodeString(&Name, L"\\Device\\PhysicalMemory");
   InitializeObjectAttributes(&Obj,
                             &Name,
                             0,
@@ -1889,7 +1888,7 @@ MmInitSectionImplementation(VOID)
 {
    MmSectionObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
    
-   RtlInitUnicodeString(&MmSectionObjectType->TypeName, L"Section");
+   RtlInitUnicodeStringFromLiteral(&MmSectionObjectType->TypeName, L"Section");
    
    MmSectionObjectType->Tag = TAG('S', 'E', 'C', 'T');
    MmSectionObjectType->TotalObjects = 0;
index 65b3299..8852ed8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: namespc.c,v 1.31 2002/06/20 21:31:39 ekohl Exp $
+/* $Id: namespc.c,v 1.32 2002/08/20 20:37:14 hyperion Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -354,7 +354,7 @@ ObInit(VOID)
   ObDirectoryType->Create = ObpCreateDirectory;
   ObDirectoryType->DuplicationNotify = NULL;
   
-  RtlInitUnicodeString(&ObDirectoryType->TypeName,
+  RtlInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
                       L"Directory");
 
   /* create 'type' object type*/
@@ -379,7 +379,7 @@ ObInit(VOID)
   ObTypeObjectType->Create = NULL;
   ObTypeObjectType->DuplicationNotify = NULL;
   
-  RtlInitUnicodeString(&ObTypeObjectType->TypeName,
+  RtlInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
                       L"ObjectType");
 
   /* create root directory */
@@ -390,7 +390,7 @@ ObInit(VOID)
                 (PVOID*)&NameSpaceRoot);
 
   /* create '\ObjectTypes' directory */
-  RtlInitUnicodeString(&Name,
+  RtlInitUnicodeStringFromLiteral(&Name,
                       L"\\ObjectTypes");
   InitializeObjectAttributes(&ObjectAttributes,
                             &Name,
index d98dc0d..171d1fa 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: locale.c,v 1.1 2001/07/12 17:21:06 ekohl Exp $
+/* $Id: locale.c,v 1.2 2002/08/20 20:37:14 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -57,9 +57,9 @@ PiInitDefaultLocale(VOID)
    ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
 
    /* read system locale */
-   RtlInitUnicodeString(&KeyName,
+   RtlInitUnicodeStringFromLiteral(&KeyName,
                        L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
-   RtlInitUnicodeString(&ValueName,
+   RtlInitUnicodeStringFromLiteral(&ValueName,
                        L"Default");
 
    InitializeObjectAttributes(&ObjectAttributes,
@@ -97,9 +97,9 @@ PiInitDefaultLocale(VOID)
      }
 
    /* read default thread locale */
-   RtlInitUnicodeString(&KeyName,
+   RtlInitUnicodeStringFromLiteral(&KeyName,
                        L"\\Registry\\User\\.Default\\Control Panel\\International");
-   RtlInitUnicodeString(&ValueName,
+   RtlInitUnicodeStringFromLiteral(&ValueName,
                        L"Locale");
 
    InitializeObjectAttributes(&ObjectAttributes,
@@ -199,17 +199,17 @@ NtSetDefaultLocale(IN BOOLEAN ThreadOrSystem,
                                    &UserKey);
        if (!NT_SUCCESS(Status))
          return(Status);
-       RtlInitUnicodeString(&KeyName,
+       RtlInitUnicodeStringFromLiteral(&KeyName,
                             L"Control Panel\\International");
-       RtlInitUnicodeString(&ValueName,
+       RtlInitUnicodeStringFromLiteral(&ValueName,
                             L"Locale");
      }
    else
      {
        /* system locale */
-       RtlInitUnicodeString(&KeyName,
+       RtlInitUnicodeStringFromLiteral(&KeyName,
                             L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
-       RtlInitUnicodeString(&ValueName,
+       RtlInitUnicodeStringFromLiteral(&ValueName,
                             L"Default");
      }
 
index 52e6486..2a9da2c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.88 2002/07/18 00:25:31 dwelch Exp $
+/* $Id: process.c,v 1.89 2002/08/20 20:37:14 hyperion Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -224,7 +224,7 @@ PsInitProcessManagment(VOID)
    PsProcessType->Create = NULL;
    PsProcessType->DuplicationNotify = NULL;
    
-   RtlInitUnicodeString(&PsProcessType->TypeName, L"Process");
+   RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName, L"Process");
    
    InitializeListHead(&PsProcessListHead);
    KeInitializeSpinLock(&PsProcessListLock);
index 8d2cbdb..dcd50fd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.103 2002/08/17 01:42:03 dwelch Exp $
+/* $Id: thread.c,v 1.104 2002/08/20 20:37:14 hyperion Exp $
  *
  * COPYRIGHT:              See COPYING in the top level directory
  * PROJECT:                ReactOS kernel
@@ -414,7 +414,7 @@ PsInitThreadManagment(VOID)
    
    PsThreadType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
    
-   RtlInitUnicodeString(&PsThreadType->TypeName, L"Thread");
+   RtlInitUnicodeStringFromLiteral(&PsThreadType->TypeName, L"Thread");
    
    PsThreadType->Tag = TAG('T', 'H', 'R', 'T');
    PsThreadType->TotalObjects = 0;
index 61a4515..6dfa24b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nls.c,v 1.6 2001/11/02 09:10:49 ekohl Exp $
+/* $Id: nls.c,v 1.7 2002/08/20 20:37:16 hyperion Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -166,7 +166,7 @@ RtlpInitNlsSections(ULONG Mod1Start,
   DPRINT("Upcase section end: 0x%08lX\n", Mod3End);
 
   /* Create the '\NLS' directory */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"\\NLS");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
@@ -180,7 +180,7 @@ RtlpInitNlsSections(ULONG Mod1Start,
     return(Status);
 
   /* Create the 'NlsSectionUnicode' section */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"NlsSectionUnicode");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
index d23712d..2078587 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: logport.c,v 1.1 2002/06/25 21:10:14 ekohl Exp $
+/* $Id: logport.c,v 1.2 2002/08/20 20:37:16 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -60,7 +60,7 @@ InitLogPort(VOID)
   ConnectPortHandle = NULL;
   MessagePortHandle = NULL;
 
-  RtlInitUnicodeString(&PortName,
+  RtlInitUnicodeStringFromLiteral(&PortName,
                       L"\\ErrorLogPort");
   InitializeObjectAttributes(&ObjectAttributes,
                             &PortName,
index e6e583c..6241bfe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: conio.c,v 1.30 2002/05/07 22:44:23 hbirr Exp $
+/* $Id: conio.c,v 1.31 2002/08/20 20:37:16 hyperion Exp $
  *
  * reactos/subsys/csrss/api/conio.c
  *
@@ -786,7 +786,7 @@ VOID STDCALL CsrInitConsoleSupport(VOID)
    
    DPRINT("CSR: CsrInitConsoleSupport()\n");
    
-   RtlInitUnicodeString(&DeviceName, L"\\??\\BlueScreen");
+   RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\BlueScreen");
    InitializeObjectAttributes(&ObjectAttributes,
                              &DeviceName,
                              0,
@@ -803,7 +803,7 @@ VOID STDCALL CsrInitConsoleSupport(VOID)
        DbgPrint("CSR: Failed to open console. Expect problems.\n");
      }
 
-   RtlInitUnicodeString(&DeviceName, L"\\??\\Keyboard");
+   RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\Keyboard");
    InitializeObjectAttributes(&ObjectAttributes,
                              &DeviceName,
                              0,
index c821f84..9ee9526 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: csrss.c,v 1.10 2002/02/08 02:57:10 chorns Exp $
+/* $Id: csrss.c,v 1.11 2002/08/20 20:37:17 hyperion Exp $
  *
  * csrss.c - Client/Server Runtime subsystem
  * 
@@ -88,7 +88,7 @@ VOID NtProcessStartup(PPEB Peb)
        argv[argc-1] = &(ArgBuffer[afterlastspace]);
      }
    
-   RtlInitUnicodeString(&UnicodeString,
+   RtlInitUnicodeStringFromLiteral(&UnicodeString,
                        L"\\CsrssInitDone");
    InitializeObjectAttributes(&ObjectAttributes,
                              &UnicodeString,
index 18cd43c..edd1524 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.13 2002/06/14 14:23:14 ekohl Exp $
+/* $Id: init.c,v 1.14 2002/08/20 20:37:17 hyperion Exp $
  * 
  * reactos/subsys/csrss/init.c
  *
@@ -84,7 +84,7 @@ CsrInitVideo(VOID)
   HANDLE VideoHandle;
   NTSTATUS Status;
 
-  RtlInitUnicodeString(&DeviceName, L"\\??\\DISPLAY1");
+  RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\DISPLAY1");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DeviceName,
                             0,
@@ -140,7 +140,7 @@ CsrServerInitialization (
    CsrInitVideo();
 
    /* NEW NAMED PORT: \ApiPort */
-   RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
+   RtlInitUnicodeStringFromLiteral(&PortName, L"\\Windows\\ApiPort");
    InitializeObjectAttributes(&ObAttributes,
                              &PortName,
                              0,
@@ -186,7 +186,7 @@ CsrServerInitialization (
        NtClose(ApiPortHandle);
        return FALSE;
      }
-   RtlInitUnicodeString( &RefreshEventName, L"\\TextConsoleRefreshEvent" );
+   RtlInitUnicodeStringFromLiteral( &RefreshEventName, L"\\TextConsoleRefreshEvent" );
    InitializeObjectAttributes( &RefreshEventAttr, &RefreshEventName, 0, NULL, NULL );
    Status = NtCreateEvent( &RefreshEventHandle, STANDARD_RIGHTS_ALL, &RefreshEventAttr, FALSE, FALSE );
    if( !NT_SUCCESS( Status ) )
index 5b48055..80196be 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: video.c,v 1.3 2001/08/14 12:57:16 ea Exp $
+/* $Id: video.c,v 1.4 2002/08/20 20:37:17 hyperion Exp $
  *
  * ReactOS Project
  */
@@ -21,7 +21,7 @@ InitializeVideoAddressSpace(VOID)
    /*
     * Open the physical memory section
     */
-   RtlInitUnicodeString(&PhysMemName, L"\\Device\\PhysicalMemory");
+   RtlInitUnicodeStringFromLiteral(&PhysMemName, L"\\Device\\PhysicalMemory");
    InitializeObjectAttributes(&ObjectAttributes,
                              &PhysMemName,
                              0,
index 7b96ee8..1068a19 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.41 2002/08/17 15:31:03 hbirr Exp $
+/* $Id: init.c,v 1.42 2002/08/20 20:37:17 hyperion Exp $
  *
  * init.c - Session Manager initialization
  * 
@@ -517,7 +517,7 @@ SmSetEnvironmentVariables(VOID)
         SharedUserData->NtSystemRoot);
 
   /* Cet SystemRoot = "C:\reactos" */
-  RtlInitUnicodeString(&EnvVariable,
+  RtlInitUnicodeStringFromLiteral(&EnvVariable,
                       L"SystemRoot");
   RtlInitUnicodeString(&EnvValue,
                       ValueBuffer);
@@ -529,7 +529,7 @@ SmSetEnvironmentVariables(VOID)
   ValueBuffer[2] = 0;
 
   /* Set SystemDrive = "C:" */
-  RtlInitUnicodeString(&EnvVariable,
+  RtlInitUnicodeStringFromLiteral(&EnvVariable,
                       L"SystemDrive");
   RtlInitUnicodeString(&EnvValue,
                       ValueBuffer);
@@ -560,7 +560,7 @@ SmLoadSubsystems(VOID)
   NTSTATUS Status;
 
   /* Load kernel mode subsystem (aka win32k.sys) */
-  RtlInitUnicodeString(&ImageInfo.ModuleName,
+  RtlInitUnicodeStringFromLiteral(&ImageInfo.ModuleName,
                       L"\\SystemRoot\\system32\\drivers\\win32k.sys");
 
   Status = NtSetSystemInformation(SystemLoadAndCallImage,
@@ -678,7 +678,7 @@ InitSessionManager(HANDLE Children[])
     }
 
   /* Run csrss.exe */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"\\CsrssInitDone");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
@@ -787,7 +787,7 @@ InitSessionManager(HANDLE Children[])
   Children[CHILD_WINLOGON] = ProcessInfo.ProcessHandle;
 
   /* Create the \DbgSsApiPort object (LPC) */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"\\DbgSsApiPort");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
@@ -810,7 +810,7 @@ InitSessionManager(HANDLE Children[])
 #endif
 
   /* Create the \DbgUiApiPort object (LPC) */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"\\DbgUiApiPort");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
index e275240..47f7ffd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: smapi.c,v 1.6 2002/05/24 07:49:41 ekohl Exp $
+/* $Id: smapi.c,v 1.7 2002/08/20 20:37:17 hyperion Exp $
  *
  * Reactos Session Manager
  *
@@ -78,7 +78,7 @@ SmCreateApiPort(VOID)
   UNICODE_STRING UnicodeString;
   NTSTATUS Status;
 
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       L"\\SmApiPort");
   InitializeObjectAttributes(&ObjectAttributes,
                             &UnicodeString,
index fdd4cfa..aa65b49 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: database.c,v 1.4 2002/07/20 13:34:10 ekohl Exp $
+/* $Id: database.c,v 1.5 2002/08/20 20:37:18 hyperion Exp $
  *
  * service control manager
  * 
@@ -247,7 +247,7 @@ ScmCreateServiceDataBase(VOID)
   if (!NT_SUCCESS(Status))
     return(Status);
 
-  RtlInitUnicodeString(&ServicesKeyName,
+  RtlInitUnicodeStringFromLiteral(&ServicesKeyName,
                       L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
 
   InitializeObjectAttributes(&ObjectAttributes,
@@ -329,12 +329,12 @@ ScmCheckDriver(PSERVICE Service)
 
   if (Service->Type == SERVICE_KERNEL_DRIVER)
     {
-      RtlInitUnicodeString(&DirName,
+      RtlInitUnicodeStringFromLiteral(&DirName,
                           L"\\Driver");
     }
   else
     {
-      RtlInitUnicodeString(&DirName,
+      RtlInitUnicodeStringFromLiteral(&DirName,
                           L"\\FileSystem");
     }
 
index b59cfc7..661096a 100644 (file)
@@ -96,14 +96,12 @@ NTSTATUS ConnectMouseClassDriver()
    PDEVICE_OBJECT ClassDeviceObject = NULL;
    PFILE_OBJECT FileObject = NULL;
    NTSTATUS status;
-   UNICODE_STRING ClassName;
+   UNICODE_STRING ClassName = UNICODE_STRING_INITIALIZER(L"\\Device\\MouseClass");
    IO_STATUS_BLOCK ioStatus;
    KEVENT event;
    PIRP irp;
    GDI_INFORMATION GDIInformation;
 
-   RtlInitUnicodeString(&ClassName, L"\\Device\\MouseClass");
-
    status = IoGetDeviceObjectPointer(&ClassName, FILE_READ_ATTRIBUTES, &FileObject, &ClassDeviceObject);
 
    if(status != STATUS_SUCCESS)
index 3c5803a..d6383a3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: driver.c,v 1.19 2002/06/14 07:48:19 ekohl Exp $
+/* $Id: driver.c,v 1.20 2002/08/20 20:37:18 hyperion Exp $
  * 
  * GDI Driver support routines
  * (mostly swiped from Wine)
@@ -169,7 +169,7 @@ HANDLE DRIVER_FindMPDriver(LPCWSTR  Name)
   HANDLE DisplayHandle;
   NTSTATUS Status;
 
-  RtlInitUnicodeString(&DeviceName, L"\\??\\DISPLAY1");
+  RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\DISPLAY1");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DeviceName,
                             0,
index e317d5b..37ffa63 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.1 2002/01/14 01:11:58 dwelch Exp $
+/* $Id: input.c,v 1.2 2002/08/20 20:37:19 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -40,7 +40,7 @@ KeyboardThreadMain(PVOID StartContext)
   IO_STATUS_BLOCK Iosb;
   NTSTATUS Status;
 
-  RtlInitUnicodeString(&KeyboardDeviceName, L"\\??\\Keyboard");
+  RtlInitUnicodeStringFromLiteral(&KeyboardDeviceName, L"\\??\\Keyboard");
   InitializeObjectAttributes(&KeyboardObjectAttributes,
                             &KeyboardDeviceName,
                             0,
index da02635..f26a648 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: winsta.c,v 1.6 2002/08/16 01:39:17 dwelch Exp $
+/* $Id: winsta.c,v 1.7 2002/08/20 20:37:19 hyperion Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -63,7 +63,7 @@ InitWindowStationImpl(VOID)
   /*
    * Create the '\Windows\WindowStations' directory
    */
-  RtlInitUnicodeString(&UnicodeString,
+  RtlInitUnicodeStringFromLiteral(&UnicodeString,
                       WINSTA_ROOT_NAME);
 
   InitializeObjectAttributes(&ObjectAttributes,