Alexandre Julliard : mountmgr: Reuse create_disk_device to create the initial harddisk0 device.

Alexandre Julliard julliard at winehq.org
Wed Oct 22 07:59:53 CDT 2008


Module: wine
Branch: master
Commit: b4b49a7d75424a272f30c8b8e76b77df02167c6c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b4b49a7d75424a272f30c8b8e76b77df02167c6c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct 21 16:11:51 2008 +0200

mountmgr: Reuse create_disk_device to create the initial harddisk0 device.

---

 dlls/mountmgr.sys/device.c |   29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 4a1a795..dd98c16 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -579,38 +579,15 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
 /* driver entry point for the harddisk driver */
 NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
 {
-    static const WCHAR harddisk0W[] = {'\\','D','e','v','i','c','e',
-                                       '\\','H','a','r','d','d','i','s','k','0',0};
-    static const WCHAR physdrive0W[] = {'\\','?','?','\\','P','h','y','s','i','c','a','l','D','r','i','v','e','0',0};
-
-    UNICODE_STRING nameW, linkW;
-    DEVICE_OBJECT *device;
-    NTSTATUS status;
     struct dos_drive *drive;
 
     harddisk_driver = driver;
     driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = harddisk_ioctl;
 
-    RtlInitUnicodeString( &nameW, harddisk0W );
-    RtlInitUnicodeString( &linkW, physdrive0W );
-    if (!(status = IoCreateDevice( driver, sizeof(*drive), &nameW, 0, 0, FALSE, &device )))
-        status = IoCreateSymbolicLink( &linkW, &nameW );
-    if (status)
-    {
-        FIXME( "failed to create device error %x\n", status );
-        return status;
-    }
-    drive = device->DeviceExtension;
-    drive->drive  = -1;
-    drive->udi    = NULL;
-    drive->type   = DRIVE_FIXED;
-    drive->name   = nameW;
-    drive->device = device;
-    drive->devnum.DeviceType = FILE_DEVICE_DISK;
-    drive->devnum.DeviceNumber = 0;
-    drive->devnum.PartitionNumber = 0;
+    /* create a harddisk0 device that isn't assigned to any drive */
+    create_disk_device( "harddisk0 placeholder", DRIVE_FIXED, &drive );
 
     create_drive_devices();
 
-    return status;
+    return STATUS_SUCCESS;
 }




More information about the wine-cvs mailing list