diff --git a/reactos/apps/tests/apc/apc.c b/reactos/apps/tests/apc/apc.c index e7059216018..aac7fee331b 100644 --- a/reactos/apps/tests/apc/apc.c +++ b/reactos/apps/tests/apc/apc.c @@ -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, diff --git a/reactos/apps/tests/lpc/lpcclt.c b/reactos/apps/tests/lpc/lpcclt.c index 0df32a0b3fe..66c402ca3d5 100644 --- a/reactos/apps/tests/lpc/lpcclt.c +++ b/reactos/apps/tests/lpc/lpcclt.c @@ -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); diff --git a/reactos/apps/tests/lpc/lpcsrv.c b/reactos/apps/tests/lpc/lpcsrv.c index b816ceddc3a..4fe9ebfcefd 100644 --- a/reactos/apps/tests/lpc/lpcsrv.c +++ b/reactos/apps/tests/lpc/lpcsrv.c @@ -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, diff --git a/reactos/apps/tests/regtest/regtest.c b/reactos/apps/tests/regtest/regtest.c index 84901f60fa2..88e11b2c654 100644 --- a/reactos/apps/tests/regtest/regtest.c +++ b/reactos/apps/tests/regtest/regtest.c @@ -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); diff --git a/reactos/apps/utils/pice/module/patch.c b/reactos/apps/utils/pice/module/patch.c index b136fd07ff0..5d51f337ad0 100644 --- a/reactos/apps/utils/pice/module/patch.c +++ b/reactos/apps/utils/pice/module/patch.c @@ -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 ) ) ) diff --git a/reactos/apps/utils/pice/module/privateice.c b/reactos/apps/utils/pice/module/privateice.c index 79005d29de7..2ea94f0a7b9 100644 --- a/reactos/apps/utils/pice/module/privateice.c +++ b/reactos/apps/utils/pice/module/privateice.c @@ -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); diff --git a/reactos/drivers/dd/beep/beep.c b/reactos/drivers/dd/beep/beep.c index a26a49a5254..d564bf8ccdb 100644 --- a/reactos/drivers/dd/beep/beep.c +++ b/reactos/drivers/dd/beep/beep.c @@ -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); diff --git a/reactos/drivers/dd/blue/blue.c b/reactos/drivers/dd/blue/blue.c index 390c09a6f36..233aa9bdca9 100644 --- a/reactos/drivers/dd/blue/blue.c +++ b/reactos/drivers/dd/blue/blue.c @@ -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); diff --git a/reactos/drivers/dd/floppy/floppy.c b/reactos/drivers/dd/floppy/floppy.c index 27c26ecdbc7..573a058d5fe 100644 --- a/reactos/drivers/dd/floppy/floppy.c +++ b/reactos/drivers/dd/floppy/floppy.c @@ -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, diff --git a/reactos/drivers/dd/null/null.c b/reactos/drivers/dd/null/null.c index 6eb2f78f0be..42d4d90d624 100644 --- a/reactos/drivers/dd/null/null.c +++ b/reactos/drivers/dd/null/null.c @@ -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 ( diff --git a/reactos/drivers/dd/parallel/parallel.c b/reactos/drivers/dd/parallel/parallel.c index dfc48be08ee..e9a4935acbb 100644 --- a/reactos/drivers/dd/parallel/parallel.c +++ b/reactos/drivers/dd/parallel/parallel.c @@ -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, diff --git a/reactos/drivers/dd/ramdrv/ramdrv.c b/reactos/drivers/dd/ramdrv/ramdrv.c index 855d71e21d4..1219ae3585c 100644 --- a/reactos/drivers/dd/ramdrv/ramdrv.c +++ b/reactos/drivers/dd/ramdrv/ramdrv.c @@ -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, diff --git a/reactos/drivers/dd/vga/miniport/initvga.c b/reactos/drivers/dd/vga/miniport/initvga.c index 1b85be61a6d..212efcc7490 100644 --- a/reactos/drivers/dd/vga/miniport/initvga.c +++ b/reactos/drivers/dd/vga/miniport/initvga.c @@ -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 ) ) diff --git a/reactos/drivers/fs/cdfs/cdfs.c b/reactos/drivers/fs/cdfs/cdfs.c index 494eb396071..b4ce78694dd 100644 --- a/reactos/drivers/fs/cdfs/cdfs.c +++ b/reactos/drivers/fs/cdfs/cdfs.c @@ -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, diff --git a/reactos/drivers/fs/ext2/super.c b/reactos/drivers/fs/ext2/super.c index 38059489fed..46a47e796b4 100644 --- a/reactos/drivers/fs/ext2/super.c +++ b/reactos/drivers/fs/ext2/super.c @@ -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, diff --git a/reactos/drivers/fs/fs_rec/cdfs.c b/reactos/drivers/fs/fs_rec/cdfs.c index b25df5dc246..f76dfbbce21 100644 --- a/reactos/drivers/fs/fs_rec/cdfs.c +++ b/reactos/drivers/fs/fs_rec/cdfs.c @@ -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)) diff --git a/reactos/drivers/fs/fs_rec/fat.c b/reactos/drivers/fs/fs_rec/fat.c index 6d94effbab5..5f1e81086ad 100644 --- a/reactos/drivers/fs/fs_rec/fat.c +++ b/reactos/drivers/fs/fs_rec/fat.c @@ -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)) diff --git a/reactos/drivers/fs/ntfs/ntfs.c b/reactos/drivers/fs/ntfs/ntfs.c index 6c2cb331f5f..6e9d5fab05d 100644 --- a/reactos/drivers/fs/ntfs/ntfs.c +++ b/reactos/drivers/fs/ntfs/ntfs.c @@ -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, diff --git a/reactos/drivers/fs/template/template.c b/reactos/drivers/fs/template/template.c index 93676cb085c..dbffa14154e 100644 --- a/reactos/drivers/fs/template/template.c +++ b/reactos/drivers/fs/template/template.c @@ -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, diff --git a/reactos/drivers/fs/vfat/iface.c b/reactos/drivers/fs/vfat/iface.c index 3fca950294b..f39f0a50ac5 100644 --- a/reactos/drivers/fs/vfat/iface.c +++ b/reactos/drivers/fs/vfat/iface.c @@ -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, diff --git a/reactos/drivers/input/keyboard/keyboard.c b/reactos/drivers/input/keyboard/keyboard.c index 48981729f6a..4848bd4eb09 100644 --- a/reactos/drivers/input/keyboard/keyboard.c +++ b/reactos/drivers/input/keyboard/keyboard.c @@ -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); diff --git a/reactos/drivers/input/mouclass/mouclass.c b/reactos/drivers/input/mouclass/mouclass.c index 9caf6290019..a4e65d0a8c4 100644 --- a/reactos/drivers/input/mouclass/mouclass.c +++ b/reactos/drivers/input/mouclass/mouclass.c @@ -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); diff --git a/reactos/drivers/input/psaux/psaux.c b/reactos/drivers/input/psaux/psaux.c index 1386de4322e..e8bd4b035fe 100644 --- a/reactos/drivers/input/psaux/psaux.c +++ b/reactos/drivers/input/psaux/psaux.c @@ -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; diff --git a/reactos/drivers/input/sermouse/sermouse.c b/reactos/drivers/input/sermouse/sermouse.c index 3dcb6c5a427..d625924bb86 100644 --- a/reactos/drivers/input/sermouse/sermouse.c +++ b/reactos/drivers/input/sermouse/sermouse.c @@ -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; diff --git a/reactos/drivers/net/afd/afd/afd.c b/reactos/drivers/net/afd/afd/afd.c index 8fbe35dcf1e..845272b5212 100644 --- a/reactos/drivers/net/afd/afd/afd.c +++ b/reactos/drivers/net/afd/afd/afd.c @@ -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, diff --git a/reactos/drivers/net/ndis/ndis/miniport.c b/reactos/drivers/net/ndis/ndis/miniport.c index 23cbcac5fd7..3b1a69d0a0b 100644 --- a/reactos/drivers/net/ndis/ndis/miniport.c +++ b/reactos/drivers/net/ndis/ndis/miniport.c @@ -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, diff --git a/reactos/drivers/net/tcpip/tcpip/main.c b/reactos/drivers/net/tcpip/tcpip/main.c index b588cd1626b..20cadbe3301 100644 --- a/reactos/drivers/net/tcpip/tcpip/main.c +++ b/reactos/drivers/net/tcpip/tcpip/main.c @@ -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)) { diff --git a/reactos/drivers/net/wshtcpip/wshtcpip.c b/reactos/drivers/net/wshtcpip/wshtcpip.c index 5cdc7b8bf55..84d316d4c86 100644 --- a/reactos/drivers/net/wshtcpip/wshtcpip.c +++ b/reactos/drivers/net/wshtcpip/wshtcpip.c @@ -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: diff --git a/reactos/include/ddk/rtl.h b/reactos/include/ddk/rtl.h index 1a93bbd5a46..2b82d7e9b28 100644 --- a/reactos/include/ddk/rtl.h +++ b/reactos/include/ddk/rtl.h @@ -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 ( diff --git a/reactos/lib/advapi32/reg/reg.c b/reactos/lib/advapi32/reg/reg.c index 3d4539122b1..a5f6b8217a8 100644 --- a/reactos/lib/advapi32/reg/reg.c +++ b/reactos/lib/advapi32/reg/reg.c @@ -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); diff --git a/reactos/lib/kernel32/file/curdir.c b/reactos/lib/kernel32/file/curdir.c index 86159526e0a..2c9d89b144a 100644 --- a/reactos/lib/kernel32/file/curdir.c +++ b/reactos/lib/kernel32/file/curdir.c @@ -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, diff --git a/reactos/lib/kernel32/misc/dllmain.c b/reactos/lib/kernel32/misc/dllmain.c index 7b7aa158f86..462eda62621 100644 --- a/reactos/lib/kernel32/misc/dllmain.c +++ b/reactos/lib/kernel32/misc/dllmain.c @@ -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, diff --git a/reactos/lib/msafd/misc/dllmain.c b/reactos/lib/msafd/misc/dllmain.c index 5ca6a0a656f..47f25c9bec5 100644 --- a/reactos/lib/msafd/misc/dllmain.c +++ b/reactos/lib/msafd/misc/dllmain.c @@ -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, diff --git a/reactos/lib/ntdll/csr/lpc.c b/reactos/lib/ntdll/csr/lpc.c index 9e4463d3d0f..49f1c6e6fee 100644 --- a/reactos/lib/ntdll/csr/lpc.c +++ b/reactos/lib/ntdll/csr/lpc.c @@ -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; diff --git a/reactos/lib/ntdll/dbg/debug.c b/reactos/lib/ntdll/dbg/debug.c index 225ecf65f7e..ae61506510a 100644 --- a/reactos/lib/ntdll/dbg/debug.c +++ b/reactos/lib/ntdll/dbg/debug.c @@ -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; diff --git a/reactos/lib/ntdll/rtl/registry.c b/reactos/lib/ntdll/rtl/registry.c index 48f77b2995b..ee62db5e7ee 100644 --- a/reactos/lib/ntdll/rtl/registry.c +++ b/reactos/lib/ntdll/rtl/registry.c @@ -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, diff --git a/reactos/lib/ntdll/stubs/stubs.c b/reactos/lib/ntdll/stubs/stubs.c index 8c2998cc051..ade64b3464f 100644 --- a/reactos/lib/ntdll/stubs/stubs.c +++ b/reactos/lib/ntdll/stubs/stubs.c @@ -1,9 +1,10 @@ #include #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); } diff --git a/reactos/lib/secur32/lsa.c b/reactos/lib/secur32/lsa.c index 3c59510687c..076a8e1a0e0 100644 --- a/reactos/lib/secur32/lsa.c +++ b/reactos/lib/secur32/lsa.c @@ -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, diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 344001f450b..42b2e42af5d 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -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, diff --git a/reactos/ntoskrnl/cm/rtlfunc.c b/reactos/ntoskrnl/cm/rtlfunc.c index e51cfd4a828..52fa4de109c 100644 --- a/reactos/ntoskrnl/cm/rtlfunc.c +++ b/reactos/ntoskrnl/cm/rtlfunc.c @@ -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, diff --git a/reactos/ntoskrnl/dbg/kdb_stabs.c b/reactos/ntoskrnl/dbg/kdb_stabs.c index 6fa63595ac5..88b5bab15c1 100644 --- a/reactos/ntoskrnl/dbg/kdb_stabs.c +++ b/reactos/ntoskrnl/dbg/kdb_stabs.c @@ -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) { diff --git a/reactos/ntoskrnl/ex/win32k.c b/reactos/ntoskrnl/ex/win32k.c index 7ecda320bf3..d8461e74edd 100644 --- a/reactos/ntoskrnl/ex/win32k.c +++ b/reactos/ntoskrnl/ex/win32k.c @@ -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 */ diff --git a/reactos/ntoskrnl/io/arcname.c b/reactos/ntoskrnl/io/arcname.c index 2fd1e711f6b..c8eabc168c1 100644 --- a/reactos/ntoskrnl/io/arcname.c +++ b/reactos/ntoskrnl/io/arcname.c @@ -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, diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index 98ccba0634b..4b55880af66 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -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, diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index 066ad647879..262558748c1 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -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); diff --git a/reactos/ntoskrnl/io/pnproot.c b/reactos/ntoskrnl/io/pnproot.c index 8c9f5541c51..cdd46cada19 100644 --- a/reactos/ntoskrnl/io/pnproot.c +++ b/reactos/ntoskrnl/io/pnproot.c @@ -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); diff --git a/reactos/ntoskrnl/io/resource.c b/reactos/ntoskrnl/io/resource.c index f31a2c7957c..a189486c112 100644 --- a/reactos/ntoskrnl/io/resource.c +++ b/reactos/ntoskrnl/io/resource.c @@ -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, diff --git a/reactos/ntoskrnl/io/symlink.c b/reactos/ntoskrnl/io/symlink.c index 4001a121ccc..c09eeddc495 100644 --- a/reactos/ntoskrnl/io/symlink.c +++ b/reactos/ntoskrnl/io/symlink.c @@ -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"); } diff --git a/reactos/ntoskrnl/kd/dlog.c b/reactos/ntoskrnl/kd/dlog.c index 9e0b0a70238..69ee9a1bf6e 100644 --- a/reactos/ntoskrnl/kd/dlog.c +++ b/reactos/ntoskrnl/kd/dlog.c @@ -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, diff --git a/reactos/ntoskrnl/ldr/init.c b/reactos/ntoskrnl/ldr/init.c index 9b504e9d535..a4b4f614b6e 100644 --- a/reactos/ntoskrnl/ldr/init.c +++ b/reactos/ntoskrnl/ldr/init.c @@ -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"); /* diff --git a/reactos/ntoskrnl/ldr/sysdll.c b/reactos/ntoskrnl/ldr/sysdll.c index 6b26f1d94f2..11a8fa65b8a 100644 --- a/reactos/ntoskrnl/ldr/sysdll.c +++ b/reactos/ntoskrnl/ldr/sysdll.c @@ -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, diff --git a/reactos/ntoskrnl/lpc/port.c b/reactos/ntoskrnl/lpc/port.c index 45b299343ba..18c9d585296 100644 --- a/reactos/ntoskrnl/lpc/port.c +++ b/reactos/ntoskrnl/lpc/port.c @@ -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; diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 6748d220efe..3e0c8a73bf2 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -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; diff --git a/reactos/ntoskrnl/ob/namespc.c b/reactos/ntoskrnl/ob/namespc.c index 65b3299a39d..8852ed82f59 100644 --- a/reactos/ntoskrnl/ob/namespc.c +++ b/reactos/ntoskrnl/ob/namespc.c @@ -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, diff --git a/reactos/ntoskrnl/ps/locale.c b/reactos/ntoskrnl/ps/locale.c index d98dc0d7a26..171d1fa1766 100644 --- a/reactos/ntoskrnl/ps/locale.c +++ b/reactos/ntoskrnl/ps/locale.c @@ -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"); } diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 52e64862f16..2a9da2c8d8d 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -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); diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 8d2cbdb303d..dcd50fd7d47 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -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; diff --git a/reactos/ntoskrnl/rtl/nls.c b/reactos/ntoskrnl/rtl/nls.c index 61a45150631..6dfa24b67f1 100644 --- a/reactos/ntoskrnl/rtl/nls.c +++ b/reactos/ntoskrnl/rtl/nls.c @@ -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, diff --git a/reactos/services/eventlog/logport.c b/reactos/services/eventlog/logport.c index d23712d85c7..2078587c6ac 100644 --- a/reactos/services/eventlog/logport.c +++ b/reactos/services/eventlog/logport.c @@ -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, diff --git a/reactos/subsys/csrss/api/conio.c b/reactos/subsys/csrss/api/conio.c index e6e583cb571..6241bfe9371 100644 --- a/reactos/subsys/csrss/api/conio.c +++ b/reactos/subsys/csrss/api/conio.c @@ -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, diff --git a/reactos/subsys/csrss/csrss.c b/reactos/subsys/csrss/csrss.c index c821f84a323..9ee9526a317 100644 --- a/reactos/subsys/csrss/csrss.c +++ b/reactos/subsys/csrss/csrss.c @@ -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, diff --git a/reactos/subsys/csrss/init.c b/reactos/subsys/csrss/init.c index 18cd43c1345..edd1524fd84 100644 --- a/reactos/subsys/csrss/init.c +++ b/reactos/subsys/csrss/init.c @@ -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 ) ) diff --git a/reactos/subsys/csrss/video.c b/reactos/subsys/csrss/video.c index 5b48055d2e8..80196be775d 100644 --- a/reactos/subsys/csrss/video.c +++ b/reactos/subsys/csrss/video.c @@ -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, diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index 7b96ee893da..1068a19e02b 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -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, diff --git a/reactos/subsys/smss/smapi.c b/reactos/subsys/smss/smapi.c index e27524033be..47f7ffd7e07 100644 --- a/reactos/subsys/smss/smapi.c +++ b/reactos/subsys/smss/smapi.c @@ -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, diff --git a/reactos/subsys/system/services/database.c b/reactos/subsys/system/services/database.c index fdd4cfa9f72..aa65b491d10 100644 --- a/reactos/subsys/system/services/database.c +++ b/reactos/subsys/system/services/database.c @@ -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"); } diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index b59cfc70462..661096a85cf 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -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) diff --git a/reactos/subsys/win32k/misc/driver.c b/reactos/subsys/win32k/misc/driver.c index 3c5803a4bc4..d6383a3b952 100644 --- a/reactos/subsys/win32k/misc/driver.c +++ b/reactos/subsys/win32k/misc/driver.c @@ -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, diff --git a/reactos/subsys/win32k/ntuser/input.c b/reactos/subsys/win32k/ntuser/input.c index e317d5be5ca..37ffa632402 100644 --- a/reactos/subsys/win32k/ntuser/input.c +++ b/reactos/subsys/win32k/ntuser/input.c @@ -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, diff --git a/reactos/subsys/win32k/ntuser/winsta.c b/reactos/subsys/win32k/ntuser/winsta.c index da02635d161..f26a6480560 100644 --- a/reactos/subsys/win32k/ntuser/winsta.c +++ b/reactos/subsys/win32k/ntuser/winsta.c @@ -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,