mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 16:14:40 +00:00
mountmgr: Avoid calling RtlInitUnicodeString on a static constant.
This commit is contained in:
parent
abc1f7dadb
commit
3549ae75dd
|
@ -618,7 +618,11 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
HKEY wow64_ports_key = NULL;
|
HKEY wow64_ports_key = NULL;
|
||||||
#endif
|
#endif
|
||||||
UNICODE_STRING nameW, linkW;
|
UNICODE_STRING device_mount_point_manager = RTL_CONSTANT_STRING( L"\\Device\\MountPointManager" );
|
||||||
|
UNICODE_STRING object_mount_point_manager = RTL_CONSTANT_STRING( L"\\??\\MountPointManager" );
|
||||||
|
UNICODE_STRING driver_harddisk = RTL_CONSTANT_STRING( L"\\Driver\\Harddisk" );
|
||||||
|
UNICODE_STRING driver_serial = RTL_CONSTANT_STRING( L"\\Driver\\Serial" );
|
||||||
|
UNICODE_STRING driver_parallel = RTL_CONSTANT_STRING( L"\\Driver\\Parallel" );
|
||||||
DEVICE_OBJECT *device;
|
DEVICE_OBJECT *device;
|
||||||
HKEY devicemap_key;
|
HKEY devicemap_key;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
@ -631,10 +635,8 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
|
||||||
|
|
||||||
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = mountmgr_ioctl;
|
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = mountmgr_ioctl;
|
||||||
|
|
||||||
RtlInitUnicodeString( &nameW, L"\\Device\\MountPointManager" );
|
if (!(status = IoCreateDevice( driver, 0, &device_mount_point_manager, 0, 0, FALSE, &device )))
|
||||||
RtlInitUnicodeString( &linkW, L"\\??\\MountPointManager" );
|
status = IoCreateSymbolicLink( &object_mount_point_manager, &device_mount_point_manager );
|
||||||
if (!(status = IoCreateDevice( driver, 0, &nameW, 0, 0, FALSE, &device )))
|
|
||||||
status = IoCreateSymbolicLink( &linkW, &nameW );
|
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
FIXME( "failed to create device error %lx\n", status );
|
FIXME( "failed to create device error %lx\n", status );
|
||||||
|
@ -648,8 +650,7 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
|
||||||
KEY_ALL_ACCESS, NULL, &devicemap_key, NULL ))
|
KEY_ALL_ACCESS, NULL, &devicemap_key, NULL ))
|
||||||
RegCloseKey( devicemap_key );
|
RegCloseKey( devicemap_key );
|
||||||
|
|
||||||
RtlInitUnicodeString( &nameW, L"\\Driver\\Harddisk" );
|
status = IoCreateDriver( &driver_harddisk, harddisk_driver_entry );
|
||||||
status = IoCreateDriver( &nameW, harddisk_driver_entry );
|
|
||||||
|
|
||||||
thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL );
|
thread = CreateThread( NULL, 0, device_op_thread, NULL, 0, NULL );
|
||||||
CloseHandle( CreateThread( NULL, 0, run_loop_thread, thread, 0, NULL ));
|
CloseHandle( CreateThread( NULL, 0, run_loop_thread, thread, 0, NULL ));
|
||||||
|
@ -664,11 +665,8 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
|
||||||
RegCloseKey( wow64_ports_key );
|
RegCloseKey( wow64_ports_key );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RtlInitUnicodeString( &nameW, L"\\Driver\\Serial" );
|
IoCreateDriver( &driver_serial, serial_driver_entry );
|
||||||
IoCreateDriver( &nameW, serial_driver_entry );
|
IoCreateDriver( &driver_parallel, parallel_driver_entry );
|
||||||
|
|
||||||
RtlInitUnicodeString( &nameW, L"\\Driver\\Parallel" );
|
|
||||||
IoCreateDriver( &nameW, parallel_driver_entry );
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue