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;
}
printf("Opening file\n");
- RtlInitUnicodeString(&FileName,
- L"\\C:\\a.txt");
InitializeObjectAttributes(&ObjectAttributes,
&FileName,
0,
-/* $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
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;
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);
-/* $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
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;
LPC_MAX_MESSAGE ConnectMsg;
printf("%s: Lpc test server\n", MyName);
-
- RtlInitUnicodeString(&PortName, TEST_PORT_NAME_U);
+
InitializeObjectAttributes(&ObjectAttributes,
&PortName,
0,
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,
NtClose(hKey);
dprintf("NtOpenKey \\Registry\\Machine : ");
- RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine");
+ RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
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);
if(Status==0)
{
dprintf("NtQueryValueKey : ");
- RtlInitUnicodeString(&KeyName, L"CmdLine");
+ RtlInitUnicodeStringFromLiteral(&KeyName, L"CmdLine");
Status=NtQueryValueKey(hKey,&KeyName,KeyValueFullInformation
,&KeyValueInformation[0], sizeof(KeyValueInformation)
,&Length);
NtClose( hKey1 );
}
+
void test2(void)
{
HKEY hKey,hKey1;
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
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,
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,
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,
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,
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
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
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,
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,
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,
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,
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);
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
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))
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,
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))
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
dprintf("Query value\n");
dprintf(" Value: TestValue\n");
- RtlInitUnicodeString(&ValueName, L"TestValue");
+ RtlInitUnicodeStringFromLiteral(&ValueName, L"TestValue");
Status=NtQueryValueKey(hKey,
&ValueName,
KeyValueFullInformation,
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,
}
dprintf("Delete link value\n");
- RtlInitUnicodeString(&ValueName, L"SymbolicLinkValue");
+ RtlInitUnicodeStringFromLiteral(&ValueName, L"SymbolicLinkValue");
Status = NtDeleteValueKey(hKey,
&ValueName);
dprintf(" NtDeleteValueKey() called (Status %lx)\n",Status);
// 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);
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,
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);
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 ) ) )
//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,
&DeviceObject);
DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
- RtlInitUnicodeString(&SymlinkName, L"\\??\\Pice");
+ RtlInitUnicodeStringFromLiteral(&SymlinkName, L"\\??\\Pice");
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
return(STATUS_SUCCESS);
-/* $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
{
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");
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = BeepDeviceControl;
DriverObject->DriverUnload = BeepUnload;
- RtlInitUnicodeString(&DeviceName,
- L"\\Device\\Beep");
Status = IoCreateDevice(DriverObject,
sizeof(DEVICE_EXTENSION),
&DeviceName,
FALSE);
/* Create the dos device link */
- RtlInitUnicodeString(&SymlinkName,
- L"\\??\\Beep");
IoCreateSymbolicLink(&SymlinkName,
&DeviceName);
-/* $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
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");
DriverObject->MajorFunction[IRP_MJ_WRITE] = ScrWrite;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL ] = ScrIoControl;
- RtlInitUnicodeString (&DeviceName, L"\\Device\\BlueScreen");
IoCreateDevice (DriverObject,
sizeof(DEVICE_EXTENSION),
&DeviceName,
TRUE,
&DeviceObject);
- RtlInitUnicodeString (&SymlinkName, L"\\??\\BlueScreen");
IoCreateSymbolicLink (&SymlinkName, &DeviceName);
return (STATUS_SUCCESS);
#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,
-/* $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
DriverObject->DriverUnload = NullUnload;
/* create null device */
- RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Null");
+ RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Null");
nErrCode = IoCreateDevice
(
pdoNullDevice->DeviceExtension = (PVOID)&nxNull;
/* create zero device */
- RtlInitUnicodeString(&wstrDeviceName, L"\\Device\\Zero");
+ RtlInitUnicodeStringFromLiteral(&wstrDeviceName, L"\\Device\\Zero");
nErrCode = IoCreateDevice
(
-/* $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
*/
{
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,
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;
// create device and symbolic link
- RtlInitUnicodeString( &DeviceName, L"\\Device\\Ramdisk" );
Status = IoCreateDevice( DriverObject,
sizeof( RAMDRV_DEVICE_EXTENSION ),
&DeviceName,
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,
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;
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 ) )
* 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
{
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,
{
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,
* 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
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))
* 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
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))
* 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
{
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,
* 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
{
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,
* 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
*/
{
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,
*/
{
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");
DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = KbdInternalDeviceControl;
DriverObject->DriverStartIo = KbdStartIo;
-
- RtlInitUnicodeString(&DeviceName, L"\\Device\\Keyboard");
+
IoCreateDevice(DriverObject,
sizeof(DEVICE_EXTENSION),
&DeviceName,
DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
InitializeKeyboard( DeviceObject );
-
- RtlInitUnicodeString(&SymlinkName, L"\\??\\Keyboard");
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
return(STATUS_SUCCESS);
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;
// 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)
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;
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,
&DeviceObject);
DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
- RtlInitUnicodeString(&SymlinkName, L"\\??\\MouseClass");
IoCreateSymbolicLink(&SymlinkName, &DeviceName);
return ConnectMousePortDriver(DeviceObject);
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,
&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;
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,
&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;
{
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,
/* 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,
/* 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)) {
}
/* 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)) {
}
/* 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)) {
}
/* 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)) {
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:
-/* $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 $
*
*/
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 (
-/* $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
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,
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,
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,
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,
}
DPRINT("ParentKey %x\n", (ULONG)ParentKey);
-
RtlInitUnicodeString (&ClassString, lpClass);
RtlInitUnicodeString (&SubKeyString, lpSubKey);
-/* $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
Value.MaximumLength = (nBufferLength - 1) * sizeof(WCHAR);
Value.Buffer = lpBuffer;
- RtlInitUnicodeString (&Name,
+ RtlInitUnicodeStringFromLiteral (&Name,
L"TMP");
Status = RtlQueryEnvironmentVariable_U (NULL,
&Value);
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL)
{
- RtlInitUnicodeString (&Name,
+ RtlInitUnicodeStringFromLiteral (&Name,
L"TEMP");
Status = RtlQueryEnvironmentVariable_U (NULL,
-/* $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
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,
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,
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,
-/* $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
{
return(Status);
}
- RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
+ RtlInitUnicodeStringFromLiteral(&PortName, L"\\Windows\\ApiPort");
ConnectInfoLength = 0;
LpcWrite.Length = sizeof(LPC_SECTION_WRITE);
LpcWrite.SectionHandle = CsrSectionHandle;
-/* $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
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;
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;
-/* $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
OUT PHANDLE KeyHandle)
{
OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING KeyPath;
+ UNICODE_STRING KeyPath = UNICODE_STRING_INITIALIZER(L"\\Registry\\User\\.Default");
NTSTATUS Status;
Status = RtlFormatCurrentUserKeyPath(&KeyPath);
return(STATUS_SUCCESS);
}
- RtlInitUnicodeString(&KeyPath,
- L"\\Registry\\User\\.Default");
-
InitializeObjectAttributes(&ObjectAttributes,
&KeyPath,
OBJ_CASE_INSENSITIVE,
#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); }
-/* $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
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,
-/* $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
DPRINT("Link target '%S'\n", TargetNameBuffer);
- RtlInitUnicodeString(&LinkName,
+ RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet");
InitializeObjectAttributes(&ObjectAttributes,
&LinkName,
return(Status);
}
- RtlInitUnicodeString(&LinkValue,
+ RtlInitUnicodeStringFromLiteral(&LinkValue,
L"SymbolicLinkValue");
Status=NtSetValueKey(KeyHandle,
&LinkValue,
OUT PHANDLE KeyHandle)
{
OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING KeyPath;
+ UNICODE_STRING KeyPath = UNICODE_STRING_INITIALIZER(L"\\Registry\\User\\.Default");
NTSTATUS Status;
Status = RtlFormatCurrentUserKeyPath(&KeyPath);
return(STATUS_SUCCESS);
}
- RtlInitUnicodeString(&KeyPath,
- L"\\Registry\\User\\.Default");
-
InitializeObjectAttributes(&ObjectAttributes,
&KeyPath,
OBJ_CASE_INSENSITIVE,
* is created after their module entries
*/
- RtlInitUnicodeString(&ModuleName, KERNEL_MODULE_NAME);
+ RtlInitUnicodeStringFromLiteral(&ModuleName, KERNEL_MODULE_NAME);
ModuleObject = LdrGetModuleObject(&ModuleName);
if (ModuleObject != NULL)
{
&ModuleObject->TextSection->SymbolInfo);
}
- RtlInitUnicodeString(&ModuleName, HAL_MODULE_NAME);
+ RtlInitUnicodeStringFromLiteral(&ModuleName, HAL_MODULE_NAME);
ModuleObject = LdrGetModuleObject(&ModuleName);
if (ModuleObject != NULL)
{
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));
ExDesktopObjectType->OkayToClose = NULL;
ExDesktopObjectType->Create = ExpDesktopObjectCreate;
ExDesktopObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&ExDesktopObjectType->TypeName, L"Desktop");
+ RtlInitUnicodeStringFromLiteral(&ExDesktopObjectType->TypeName, L"Desktop");
}
/* EOF */
* 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
DPRINT("DeviceName: %wZ\n", &DeviceName);
/* create the '\SystemRoot' link */
- RtlInitUnicodeString(&LinkName,
+ RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\SystemRoot");
Status = IoCreateSymbolicLink(&LinkName,
-/* $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
IoDriverObjectType->OkayToClose = NULL;
IoDriverObjectType->Create = IopCreateDriver;
IoDriverObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&IoDriverObjectType->TypeName, L"Driver");
+ RtlInitUnicodeStringFromLiteral(&IoDriverObjectType->TypeName, L"Driver");
}
/**********************************************************************
return(Status);
/* Enumerate services and create the service list */
- RtlInitUnicodeString(&ServicesKeyName,
+ RtlInitUnicodeStringFromLiteral(&ServicesKeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
InitializeObjectAttributes(&ObjectAttributes,
-/* $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
IoDeviceObjectType->Create = IopCreateDevice;
IoDeviceObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeString (&IoDeviceObjectType->TypeName, L"Device");
+ RtlInitUnicodeStringFromLiteral(&IoDeviceObjectType->TypeName, L"Device");
/*
* Register iomgr types: FileObjectType
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,
/*
* Create the '\FileSystem' object directory
*/
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\FileSystem");
InitializeObjectAttributes(&ObjectAttributes,
&DirName,
/*
* Create the '\Device' directory
*/
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\Device");
InitializeObjectAttributes(&ObjectAttributes,
&DirName,
/*
* Create the '\??' directory
*/
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\??");
InitializeObjectAttributes(&ObjectAttributes,
&DirName,
/*
* Create the '\ArcName' directory
*/
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\ArcName");
InitializeObjectAttributes(&ObjectAttributes,
&DirName,
/*
* Create link from '\DosDevices' to '\??' directory
*/
- RtlInitUnicodeString(&LinkName,
+ RtlInitUnicodeStringFromLiteral(&LinkName,
L"\\DosDevices");
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\??");
IoCreateSymbolicLink(&LinkName,
&DirName);
-/* $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
return STATUS_INSUFFICIENT_RESOURCES;
}
- RtlInitUnicodeString(
+ RtlInitUnicodeStringFromLiteral(
&KeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\" \
ENUM_NAME_ROOT);
* 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
HANDLE DescriptionKey;
/* Open/Create 'RESOURCEMAP' key. */
- RtlInitUnicodeString(&Name,
+ RtlInitUnicodeStringFromLiteral(&Name,
L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
InitializeObjectAttributes(&ObjectAttributes,
&Name,
return(Status);
/* Open/Create 'Hardware Abstraction Layer' key */
- RtlInitUnicodeString(&Name,
+ RtlInitUnicodeStringFromLiteral(&Name,
L"Hardware Abstraction Layer");
InitializeObjectAttributes(&ObjectAttributes,
&Name,
return(Status);
/* Add '.Raw' value. */
- RtlInitUnicodeString(&Name,
+ RtlInitUnicodeStringFromLiteral(&Name,
L".Raw");
Status = NtSetValueKey(DescriptionKey,
&Name,
}
/* Add '.Translated' value. */
- RtlInitUnicodeString(&Name,
+ RtlInitUnicodeStringFromLiteral(&Name,
L".Translated");
Status = NtSetValueKey(DescriptionKey,
&Name,
-/* $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
IoSymbolicLinkType->Create = IopCreateSymbolicLink;
IoSymbolicLinkType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&IoSymbolicLinkType->TypeName,
+ RtlInitUnicodeStringFromLiteral(&IoSymbolicLinkType->TypeName,
L"SymbolicLink");
}
-/* $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
UNICODE_STRING FileName;
IO_STATUS_BLOCK Iosb;
- RtlInitUnicodeString(&FileName, L"\\SystemRoot\\debug.log");
+ RtlInitUnicodeStringFromLiteral(&FileName, L"\\SystemRoot\\debug.log");
InitializeObjectAttributes(&ObjectAttributes,
&FileName,
0,
* Get the absolute path to smss.exe using the
* SystemRoot link.
*/
- RtlInitUnicodeString(&ProcessName,
+ RtlInitUnicodeStringFromLiteral(&ProcessName,
L"\\SystemRoot\\system32\\smss.exe");
/*
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;
* Locate and open NTDLL to determine ImageBase
* and LdrStartup
*/
- RtlInitUnicodeString(&DllPathname,
- L"\\SystemRoot\\system32\\ntdll.dll");
InitializeObjectAttributes(&FileObjectAttributes,
&DllPathname,
0,
-/* $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
{
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;
* 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
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,
{
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;
-/* $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
ObDirectoryType->Create = ObpCreateDirectory;
ObDirectoryType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&ObDirectoryType->TypeName,
+ RtlInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
L"Directory");
/* create 'type' object type*/
ObTypeObjectType->Create = NULL;
ObTypeObjectType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&ObTypeObjectType->TypeName,
+ RtlInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
L"ObjectType");
/* create root directory */
(PVOID*)&NameSpaceRoot);
/* create '\ObjectTypes' directory */
- RtlInitUnicodeString(&Name,
+ RtlInitUnicodeStringFromLiteral(&Name,
L"\\ObjectTypes");
InitializeObjectAttributes(&ObjectAttributes,
&Name,
-/* $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
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,
}
/* read default thread locale */
- RtlInitUnicodeString(&KeyName,
+ RtlInitUnicodeStringFromLiteral(&KeyName,
L"\\Registry\\User\\.Default\\Control Panel\\International");
- RtlInitUnicodeString(&ValueName,
+ RtlInitUnicodeStringFromLiteral(&ValueName,
L"Locale");
InitializeObjectAttributes(&ObjectAttributes,
&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");
}
-/* $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
PsProcessType->Create = NULL;
PsProcessType->DuplicationNotify = NULL;
- RtlInitUnicodeString(&PsProcessType->TypeName, L"Process");
+ RtlInitUnicodeStringFromLiteral(&PsProcessType->TypeName, L"Process");
InitializeListHead(&PsProcessListHead);
KeInitializeSpinLock(&PsProcessListLock);
-/* $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
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;
-/* $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
DPRINT("Upcase section end: 0x%08lX\n", Mod3End);
/* Create the '\NLS' directory */
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\NLS");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
return(Status);
/* Create the 'NlsSectionUnicode' section */
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"NlsSectionUnicode");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
* 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
ConnectPortHandle = NULL;
MessagePortHandle = NULL;
- RtlInitUnicodeString(&PortName,
+ RtlInitUnicodeStringFromLiteral(&PortName,
L"\\ErrorLogPort");
InitializeObjectAttributes(&ObjectAttributes,
&PortName,
-/* $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
*
DPRINT("CSR: CsrInitConsoleSupport()\n");
- RtlInitUnicodeString(&DeviceName, L"\\??\\BlueScreen");
+ RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\BlueScreen");
InitializeObjectAttributes(&ObjectAttributes,
&DeviceName,
0,
DbgPrint("CSR: Failed to open console. Expect problems.\n");
}
- RtlInitUnicodeString(&DeviceName, L"\\??\\Keyboard");
+ RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\Keyboard");
InitializeObjectAttributes(&ObjectAttributes,
&DeviceName,
0,
-/* $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
*
argv[argc-1] = &(ArgBuffer[afterlastspace]);
}
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\CsrssInitDone");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
-/* $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
*
HANDLE VideoHandle;
NTSTATUS Status;
- RtlInitUnicodeString(&DeviceName, L"\\??\\DISPLAY1");
+ RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\DISPLAY1");
InitializeObjectAttributes(&ObjectAttributes,
&DeviceName,
0,
CsrInitVideo();
/* NEW NAMED PORT: \ApiPort */
- RtlInitUnicodeString(&PortName, L"\\Windows\\ApiPort");
+ RtlInitUnicodeStringFromLiteral(&PortName, L"\\Windows\\ApiPort");
InitializeObjectAttributes(&ObAttributes,
&PortName,
0,
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 ) )
-/* $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
*/
/*
* Open the physical memory section
*/
- RtlInitUnicodeString(&PhysMemName, L"\\Device\\PhysicalMemory");
+ RtlInitUnicodeStringFromLiteral(&PhysMemName, L"\\Device\\PhysicalMemory");
InitializeObjectAttributes(&ObjectAttributes,
&PhysMemName,
0,
-/* $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
*
SharedUserData->NtSystemRoot);
/* Cet SystemRoot = "C:\reactos" */
- RtlInitUnicodeString(&EnvVariable,
+ RtlInitUnicodeStringFromLiteral(&EnvVariable,
L"SystemRoot");
RtlInitUnicodeString(&EnvValue,
ValueBuffer);
ValueBuffer[2] = 0;
/* Set SystemDrive = "C:" */
- RtlInitUnicodeString(&EnvVariable,
+ RtlInitUnicodeStringFromLiteral(&EnvVariable,
L"SystemDrive");
RtlInitUnicodeString(&EnvValue,
ValueBuffer);
NTSTATUS Status;
/* Load kernel mode subsystem (aka win32k.sys) */
- RtlInitUnicodeString(&ImageInfo.ModuleName,
+ RtlInitUnicodeStringFromLiteral(&ImageInfo.ModuleName,
L"\\SystemRoot\\system32\\drivers\\win32k.sys");
Status = NtSetSystemInformation(SystemLoadAndCallImage,
}
/* Run csrss.exe */
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\CsrssInitDone");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
Children[CHILD_WINLOGON] = ProcessInfo.ProcessHandle;
/* Create the \DbgSsApiPort object (LPC) */
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\DbgSsApiPort");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
#endif
/* Create the \DbgUiApiPort object (LPC) */
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\DbgUiApiPort");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
-/* $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
*
UNICODE_STRING UnicodeString;
NTSTATUS Status;
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
L"\\SmApiPort");
InitializeObjectAttributes(&ObjectAttributes,
&UnicodeString,
-/* $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
*
if (!NT_SUCCESS(Status))
return(Status);
- RtlInitUnicodeString(&ServicesKeyName,
+ RtlInitUnicodeStringFromLiteral(&ServicesKeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
InitializeObjectAttributes(&ObjectAttributes,
if (Service->Type == SERVICE_KERNEL_DRIVER)
{
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\Driver");
}
else
{
- RtlInitUnicodeString(&DirName,
+ RtlInitUnicodeStringFromLiteral(&DirName,
L"\\FileSystem");
}
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)
-/* $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)
HANDLE DisplayHandle;
NTSTATUS Status;
- RtlInitUnicodeString(&DeviceName, L"\\??\\DISPLAY1");
+ RtlInitUnicodeStringFromLiteral(&DeviceName, L"\\??\\DISPLAY1");
InitializeObjectAttributes(&ObjectAttributes,
&DeviceName,
0,
-/* $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
IO_STATUS_BLOCK Iosb;
NTSTATUS Status;
- RtlInitUnicodeString(&KeyboardDeviceName, L"\\??\\Keyboard");
+ RtlInitUnicodeStringFromLiteral(&KeyboardDeviceName, L"\\??\\Keyboard");
InitializeObjectAttributes(&KeyboardObjectAttributes,
&KeyboardDeviceName,
0,
-/* $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
/*
* Create the '\Windows\WindowStations' directory
*/
- RtlInitUnicodeString(&UnicodeString,
+ RtlInitUnicodeStringFromLiteral(&UnicodeString,
WINSTA_ROOT_NAME);
InitializeObjectAttributes(&ObjectAttributes,