storage driver and disk management applet

Hi,

I wrote a storage driver that uses a file as store, I have a bus driver
which creates a child PDO device representing the disk when the
application tells so.

I’m reporting my own ids for hardwareID, compatible id etc. Everything
is working fine: mountmgr mounts my device and then I can format and use
it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).

Two problems:

  1. I don’t see the device using Disk Management or Defragmenter…
    I was reading some postings and I found one saying that I should not
    name the PDO device (I’m doing so) and let the system create the name
    and then register for the right interfaces. I tried to do so but when I
    estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in IoCreateDevice
    then the mountmgr is not mounting anymore my device (I see read
    operation coming but then nothing else happends).

  2. I would like to let disk.sys attach to the device but I didn’t have
    luck… (If I report GenDisk for compatible id then I never receive any
    read and the device is removed IRP_MN_REMOVE_DEVICE).

So my questions are:

  1. Why I’m not seeing my device in the disk management mmc? and why is
    it not mounted if I don’t name the pdo?
  2. What are the requirements to interact with disk.sys.

Thanks in advance,

Dario

Resending…

Hi,

I wrote a storage driver that uses a file as store, I have a bus driver
which creates a child PDO device representing the disk when the
application tells so.

I’m reporting my own ids for hardwareID, compatible id etc. Everything
is working fine: mountmgr mounts my device and then I can format and use
it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).

Two problems:

  1. I don’t see the device using Disk Management or Defragmenter…
    I was reading some postings and I found one saying that I should not
    name the PDO device (I’m doing so) and let the system create the name
    and then register for the right interfaces. I tried to do so but when I
    estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in IoCreateDevice
    then the mountmgr is not mounting anymore my device (I see read
    operation coming but then nothing else happends).

  2. I would like to let disk.sys attach to the device but I didn’t have
    luck… (If I report GenDisk for compatible id then I never receive any
    read and the device is removed IRP_MN_REMOVE_DEVICE).

So my questions are:

  1. Why I’m not seeing my device in the disk management mmc? and why is
    it not mounted if I don’t name the pdo?
  2. What are the requirements to interact with disk.sys.

Thanks in advance,

Dario

  1. If you want your storage driver device objects to show up as a disk
    (in Disk Management, Defragmenter, whatever), they probably need to do
    an IoRegisterDeviceInterface with the disk GUID (DiskClassGuid) -
    otherwise how will it know that it is a disk?.

  2. For Disk.sys make sure you report GenDisk for the compatible ID and
    carefully debug the IOCTLs that your driver is sent. Use DeviceTree
    from OSR Online to make sure that your driver stack is built properly
    (what properly means will probably depends on your driver). You’ll
    probably just need to spend a bunch of time with the debugger, and
    adding logging messages to your driver to figure this one out.

Cliff

On 1-Feb-05, at 8:18 PM, Dario wrote:

Resending…

> Hi,
> I wrote a storage driver that uses a file as store, I have a bus
> driver which creates a child PDO device representing the disk when
> the application tells so.
> I’m reporting my own ids for hardwareID, compatible id etc.
> Everything is working fine: mountmgr mounts my device and then I can
> format and use it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).
> Two problems:
> 1) I don’t see the device using Disk Management or Defragmenter…
> I was reading some postings and I found one saying that I should not
> name the PDO device (I’m doing so) and let the system create the name
> and then register for the right interfaces. I tried to do so but when
> I estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in
> IoCreateDevice then the mountmgr is not mounting anymore my device (I
> see read operation coming but then nothing else happends).
> 2) I would like to let disk.sys attach to the device but I didn’t
> have luck… (If I report GenDisk for compatible id then I never
> receive any read and the device is removed IRP_MN_REMOVE_DEVICE).
> So my questions are:
> 1) Why I’m not seeing my device in the disk management mmc? and why
> is it not mounted if I don’t name the pdo?
> 2) What are the requirements to interact with disk.sys.
> Thanks in advance,
> Dario


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@telus.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

  1. Are you handling IRP_MJ_SCSI? Are you getting any IRPs from disk?

The source for disk is on the DDK so you could trace through it to see
what it expects. At a minimum you will need to handle a number of SCSI
commands - and do them correctly.

-----Original Message-----
From: Dario [mailto:xxxxx@hotmail.com]
Sent: Tuesday, February 01, 2005 8:18 PM
Subject: storage driver and disk management applet

Resending…

Hi,

I wrote a storage driver that uses a file as store, I have a bus
driver
which creates a child PDO device representing the disk when the
application tells so.

I’m reporting my own ids for hardwareID, compatible id etc. Everything

is working fine: mountmgr mounts my device and then I can format and
use
it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).

Two problems:

  1. I don’t see the device using Disk Management or Defragmenter…
    I was reading some postings and I found one saying that I should not
    name the PDO device (I’m doing so) and let the system create the name
    and then register for the right interfaces. I tried to do so but when
    I
    estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in IoCreateDevice
    then the mountmgr is not mounting anymore my device (I see read
    operation coming but then nothing else happends).

  2. I would like to let disk.sys attach to the device but I didn’t have

luck… (If I report GenDisk for compatible id then I never receive
any
read and the device is removed IRP_MN_REMOVE_DEVICE).

So my questions are:

  1. Why I’m not seeing my device in the disk management mmc? and why is

it not mounted if I don’t name the pdo?
2) What are the requirements to interact with disk.sys.

Thanks in advance,

Dario

Hi,

I’m not getting any IRP_MJ_SCSI… :frowning:

This is the sequence I’m getting:


IOCTL => IOCTL_BUSENUM_PLUGIN_HARDWARE
Trying to plugIn in index: 1!!
Creating disk device PDO
DiskID: 1
HardwareId: NUEVO1\device
Length: 3333
fileName : [??\c:\dario\image.img] cryptoFunction : 0
cryptoKeyLen: 2 cryptoKey: [0]
C: 10000 0 H: 10 S: 10 Size: 0 0 Type: DISK READ/WRITE
Device name is \Device\DarioLoop1
Loop: setting device geometry and media type
fileName: [??\c:\dario\image.img]
opening file
success opening file!!
configuring as DISK
IOCTL => IRP_MN_QUERY_DEVICE_RELATIONS
BusRelations PDOs = 1
IOCTL => IRP_MN_QUERY_ID
BusQueryDeviceID=DarioBus\DarioLoop
IOCTL => IRP_MN_QUERY_CAPABILITIES
IOCTL => IRP_MN_QUERY_DEVICE_TEXT
IOCTL => IRP_MN_QUERY_DEVICE_TEXT
IOCTL => IRP_MN_QUERY_ID
BusQueryInstanceID=DarioLoop1
IOCTL => IRP_MN_QUERY_ID
BusQueryHardwareIDs=\Device\DarioLoop1
IOCTL => IRP_MN_QUERY_ID
BusQueryCompatibleIDs=GenDisk
IOCTL => IRP_MN_QUERY_RESOURCE_REQUIREMENTS
IOCTL => IRP_MN_QUERY_BUS_INFORMATION
IOCTL => IRP_MN_QUERY_RESOURCE_REQUIREMENTS
CUserModeDispacher: setUsermodeCallback: 004037C0
IOCTL => IRP_MN_REMOVE_DEVICE
Deleting device \Device\DarioLoop1

nothing else from here.

Thanks,

Dario

Jeffrey Goldner wrote:

  1. Are you handling IRP_MJ_SCSI? Are you getting any IRPs from disk?

The source for disk is on the DDK so you could trace through it to see
what it expects. At a minimum you will need to handle a number of SCSI
commands - and do them correctly.

-----Original Message-----
From: Dario [mailto:xxxxx@hotmail.com]
Sent: Tuesday, February 01, 2005 8:18 PM
Subject: storage driver and disk management applet

Resending…

>Hi,
>
>I wrote a storage driver that uses a file as store, I have a bus

driver

>which creates a child PDO device representing the disk when the
>application tells so.
>
>I’m reporting my own ids for hardwareID, compatible id etc. Everything

>is working fine: mountmgr mounts my device and then I can format and

use

>it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).
>
>Two problems:
>
>1) I don’t see the device using Disk Management or Defragmenter…
>I was reading some postings and I found one saying that I should not
>name the PDO device (I’m doing so) and let the system create the name
>and then register for the right interfaces. I tried to do so but when

I

>estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in IoCreateDevice
>then the mountmgr is not mounting anymore my device (I see read
>operation coming but then nothing else happends).
>
>2) I would like to let disk.sys attach to the device but I didn’t have

>luck… (If I report GenDisk for compatible id then I never receive

any

>read and the device is removed IRP_MN_REMOVE_DEVICE).
>
>So my questions are:
>
>1) Why I’m not seeing my device in the disk management mmc? and why is

>it not mounted if I don’t name the pdo?
>2) What are the requirements to interact with disk.sys.
>
>
>Thanks in advance,
>
>Dario
>

Hi,

I’m not getting any IRP_MJ_SCSI… :frowning:

This is the sequence I’m getting:


IOCTL => IOCTL_BUSENUM_PLUGIN_HARDWARE
Trying to plugIn in index: 1!!
Creating disk device PDO
DiskID: 1
HardwareId: NUEVO1\device
Length: 3333
fileName : [??\c:\dario\image.img] cryptoFunction : 0
cryptoKeyLen: 2 cryptoKey: [0]
C: 10000 0 H: 10 S: 10 Size: 0 0 Type: DISK READ/WRITE
Device name is \Device\DarioLoop1
Loop: setting device geometry and media type
fileName: [??\c:\dario\image.img]
opening file
success opening file!!
configuring as DISK
IOCTL => IRP_MN_QUERY_DEVICE_RELATIONS
BusRelations PDOs = 1
IOCTL => IRP_MN_QUERY_ID
BusQueryDeviceID=DarioBus\DarioLoop
IOCTL => IRP_MN_QUERY_CAPABILITIES
IOCTL => IRP_MN_QUERY_DEVICE_TEXT
IOCTL => IRP_MN_QUERY_DEVICE_TEXT
IOCTL => IRP_MN_QUERY_ID
BusQueryInstanceID=DarioLoop1
IOCTL => IRP_MN_QUERY_ID
BusQueryHardwareIDs=\Device\DarioLoop1
IOCTL => IRP_MN_QUERY_ID
BusQueryCompatibleIDs=GenDisk
IOCTL => IRP_MN_QUERY_RESOURCE_REQUIREMENTS
IOCTL => IRP_MN_QUERY_BUS_INFORMATION
IOCTL => IRP_MN_QUERY_RESOURCE_REQUIREMENTS
CUserModeDispacher: setUsermodeCallback: 004037C0
IOCTL => IRP_MN_REMOVE_DEVICE
Deleting device \Device\DarioLoop1

nothing else from here.

Thanks,

Dario

Jeffrey Goldner wrote:

  1. Are you handling IRP_MJ_SCSI? Are you getting any IRPs from disk?

The source for disk is on the DDK so you could trace through it to see
what it expects. At a minimum you will need to handle a number of SCSI
commands - and do them correctly.

-----Original Message-----
From: Dario [mailto:xxxxx@hotmail.com]
Sent: Tuesday, February 01, 2005 8:18 PM
Subject: storage driver and disk management applet

Resending…

>Hi,
>
>I wrote a storage driver that uses a file as store, I have a bus

driver

>which creates a child PDO device representing the disk when the
>application tells so.
>
>I’m reporting my own ids for hardwareID, compatible id etc. Everything

>is working fine: mountmgr mounts my device and then I can format and

use

>it (I register for MOUNTDEV_MOUNTED_DEVICE_GUID).
>
>Two problems:
>
>1) I don’t see the device using Disk Management or Defragmenter…
>I was reading some postings and I found one saying that I should not
>name the PDO device (I’m doing so) and let the system create the name
>and then register for the right interfaces. I tried to do so but when

I

>estar using the FILE_AUTOGENERATED_DEVICE_NAME flag in IoCreateDevice
>then the mountmgr is not mounting anymore my device (I see read
>operation coming but then nothing else happends).
>
>2) I would like to let disk.sys attach to the device but I didn’t have

>luck… (If I report GenDisk for compatible id then I never receive

any

>read and the device is removed IRP_MN_REMOVE_DEVICE).
>
>So my questions are:
>
>1) Why I’m not seeing my device in the disk management mmc? and why is

>it not mounted if I don’t name the pdo?
>2) What are the requirements to interact with disk.sys.
>
>
>Thanks in advance,
>
>Dario
>