How can I use \\Device\\MountPointManager?

Hello people,

I’ve recently finished to develop an application in order to create a virtual CDDA from BIn and CUE files. It works fine with WMPlayer but there is no sound with Winamp.

I debugged Winamp and discover that this program sends IOCTLs to PxHelperDevice0 (PxHelp20.sys), I suppose, in order to read RAW SECTORS. The problem is that PxHelperDevice0 doesn’t sent IOCTL_CDROM_RAW_READ to my driver and that is why I think there is no sound.

But why doesn’t PxHelperDevice0 send IOCTL_CDROM_RAW_READ to my driver? I suppose that it is by the same reason that the new drive is not considered a CDROM at all. For example, if after creating the virtual drive I open Cdrwin, I only see the physical drive (D:) in my computer:

[0:0:0] HL-DT-ST DVD-ROM GDR8163B OL23 (D:)

But when I create other virtual drive using MasicDISC, that new drive appears in Cdrwin’s combobox:

[0:0:0] HL-DT-ST DVD-ROM GDR8163B OL23 (D:)
[2:0:0] MagicISO Virtual DVD-ROM 1.0A (E:) -> New Drive

I know that MagicDISC add something in the registry. Something like:

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2]
“Driver”=“mcdbus”

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0]

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Initiator Id 255]

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Target Id 0]

[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Target Id 0\Logical Unit Id 0]
“Type”=“CdRomPeripheral”
“DeviceType”=“CdRomPeripheral”
“Identifier”=“MagicISOVirtual DVD-ROM 1.0A”
“InquiryData”=hex:05,80,02,02,20,00,00,10,4d,61,67,69,63,49,53,4f,56,69,72,74,\
75,61,6c,20,44,56,44,2d,52,4f,4d,20,31,2e,30,41
“DeviceName”=“CdRom2”

and I suppose that is why the drive created by MagicDISC is considered as a real CDROM and listed in Cdrwin. But when I try to create a new entry in Scsi Port 0 I can’t write there and a message appears saying “Error writing the registry” (I don’t know if it is exactly the translation).

By debugging MagicDISC I discovered that it use “\Device\MountPointManager” in order to do something, but I’m not sure if the Mount Manager is which creates that entries. I looked for some help on the Internet and I got the source in

http://msdn2.microsoft.com/en-us/library/ms804526.aspx

I modifieded it a bit because wsprintf fucntion doesn’t exist in Kernel Mode, but it doesn’t create anything. It fails by calling IoCallDriver.

I create the new drive by IoCreateDevice, but in this way it is not registered at all as a CDROM.

Does anyone have any idea how exactly use the Mount Manager or how to add a virutal drive in the system in order it is listed as a real CDROM?

Does anyone have any idea what is exactly PxHelp20.sys? It was developed by www.veritas.com (if you enter there, you will be redirected to symantec website), and if you rename or delete such file from %SYSTEMROOT%\Drivers and reboot your computer, there will be no CDROMs next time, even physical CDROMs.

Thanks in advance.

Christian D’Orazio

Quoting xxxxx@yahoo.com.ar:

Hello people,

I’ve recently finished to develop an application in order to create a virtual
CDDA from BIn and CUE files. It works fine with WMPlayer but there is no
sound with Winamp.

I debugged Winamp and discover that this program sends IOCTLs to
PxHelperDevice0 (PxHelp20.sys), I suppose, in order to read RAW SECTORS. The
problem is that PxHelperDevice0 doesn’t sent IOCTL_CDROM_RAW_READ to my
driver and that is why I think there is no sound.

But why doesn’t PxHelperDevice0 send IOCTL_CDROM_RAW_READ to my driver? I
suppose that it is by the same reason that the new drive is not considered a
CDROM at all. For example, if after creating the virtual drive I open Cdrwin,

I create the new drive by IoCreateDevice, but in this way it is not
registered at all as a CDROM.

Does anyone have any idea how exactly use the Mount Manager or how to add a
virutal drive in the system in order it is listed as a real CDROM?

Mount Manager does not make real cdroms.

To make a “real” virtual cdroms there are basically two approachs.

  1. Make a scsi miniport so port driver will make the cdrom.
  2. Make your own bus driver. You create a device for the bus in add device.
    When you handle IRP_MJ_PNP IRP_MN_QUERY_DEVICE_RELATIONS (BusRelations) make a second device of type cd-rom and
    return this device object in reply. After handling lots of other stuff a “real” cd-rom appears.

Most people prefer method 1.

Does anyone have any idea what is exactly PxHelp20.sys? It was developed by
www.veritas.com (if you enter there, you will be redirected to symantec
website), and if you rename or delete such file from %SYSTEMROOT%\Drivers and
reboot your computer, there will be no CDROMs next time, even physical
CDROMs.

It is a lower filter for the CDROM class. If you remove the reference to the renamed/deleted pxhelp20 from the
lower filters from HKLM.…\Class{4D36E965-E325-11CE-BFC1-08002BE10318} LowerFilters then the cdstack will work.

It is likely that PxHelp20 translates privately defined IOCTLs to IRP_MJ_INTERNAL_DEVICE_CONTROL and forwards the
scsi request blocks down to the port driver (and maybe mini port). IOCTL_CDROM_RAW_READ does not exist at this
level, only scsi.

> 1. Make a scsi miniport so port driver will make the cdrom.

  1. Make your own bus driver. You create a device for the bus in add device.
    When you handle IRP_MJ_PNP IRP_MN_QUERY_DEVICE_RELATIONS
    (BusRelations) make a second device of type cd-rom and
    return this device object in reply. After handling lots of other stuff a
    “real” cd-rom
    appears.

Most people prefer method 1.

SCSIPORT’s and STORPORT’s miniports have major context limitations on what can
be called from the StartIo and other miniport routines.

This is because the routines are called from under the interrupt spinlock
acquired by SCSIPORT
, to guarantee that one miniport path cannot preempt
another miniport path, thus making all miniport code “single-threaded”.

Some other MS’s port/miniport architectures like the old STREAM.SYS (developed
with the primary purpose of supporting hardware DVD decoder chips in Win98/w2k
as part of the oldest KS framework, also used for 1394-based DV driver) - have
the “TurnOffSynchronization” miniport attribute to turn this off, SCSIPORT and
STORPORT have none.

So, full storage port (maybe simple and not having 100% of features) is the
answer.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

To support drive letter assignments from MountMgr:

a) your virtual CD must be a PnP driver, with a PDO
b) it must register MOUNTDEV_MOUNTED_DEVICE_GUID interface on it
c) it must support IOCTL_MOUNTDEV_xxx family of IOCTLs. You can use the
device interface string for MOUNTDEV_MOUNTED_DEVICE_GUID as “mountdev unique
ID”.

This is if you’re writing your own class driver and do not use CdRom.sys

If you’re writing at the port level, and reusing CdRom.sys - then no need
in this, CdRom.sys contains all of the above. You just need to provide a PDO to
which CdRom.sys will be attached as a functional driver, and will send the
IRP_MJ_SCSI requests to your PDO.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hello people,
>
> I’ve recently finished to develop an application in order to create a virtual
CDDA from BIn and CUE files. It works fine with WMPlayer but there is no sound
with Winamp.
>
> I debugged Winamp and discover that this program sends IOCTLs to
PxHelperDevice0 (PxHelp20.sys), I suppose, in order to read RAW SECTORS. The
problem is that PxHelperDevice0 doesn’t sent IOCTL_CDROM_RAW_READ to my driver
and that is why I think there is no sound.
>
> But why doesn’t PxHelperDevice0 send IOCTL_CDROM_RAW_READ to my driver? I
suppose that it is by the same reason that the new drive is not considered a
CDROM at all. For example, if after creating the virtual drive I open Cdrwin, I
only see the physical drive (D:) in my computer:
>
> [0:0:0] HL-DT-ST DVD-ROM GDR8163B OL23 (D:)
>
> But when I create other virtual drive using MasicDISC, that new drive appears
in Cdrwin’s combobox:
>
> [0:0:0] HL-DT-ST DVD-ROM GDR8163B OL23 (D:)
> [2:0:0] MagicISO Virtual DVD-ROM 1.0A (E:) -> New Drive
>
> I know that MagicDISC add something in the registry. Something like:
>
> [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2]
> “Driver”=“mcdbus”
>
> [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0]
>
> [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Initiator
Id 255]
>
> [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Target Id
0]
>
> [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\SCSI Bus 0\Target Id
0\Logical Unit Id 0]
> “Type”=“CdRomPeripheral”
> “DeviceType”=“CdRomPeripheral”
> “Identifier”=“MagicISOVirtual DVD-ROM 1.0A”
>
“InquiryData”=hex:05,80,02,02,20,00,00,10,4d,61,67,69,63,49,53,4f,56,69,72,74,<br>> 75,61,6c,20,44,56,44,2d,52,4f,4d,20,31,2e,30,41
> “DeviceName”=“CdRom2”
>
> and I suppose that is why the drive created by MagicDISC is considered as a
real CDROM and listed in Cdrwin. But when I try to create a new entry in Scsi
Port 0 I can’t write there and a message appears saying “Error writing the
registry” (I don’t know if it is exactly the translation).
>
> By debugging MagicDISC I discovered that it use “\Device\MountPointManager”
in order to do something, but I’m not sure if the Mount Manager is which
creates that entries. I looked for some help on the Internet and I got the
source in
>
> http://msdn2.microsoft.com/en-us/library/ms804526.aspx
>
> I modifieded it a bit because wsprintf fucntion doesn’t exist in Kernel Mode,
but it doesn’t create anything. It fails by calling IoCallDriver.
>
> I create the new drive by IoCreateDevice, but in this way it is not
registered at all as a CDROM.
>
> Does anyone have any idea how exactly use the Mount Manager or how to add a
virutal drive in the system in order it is listed as a real CDROM?
>
> Does anyone have any idea what is exactly PxHelp20.sys? It was developed by
www.veritas.com (if you enter there, you will be redirected to symantec
website), and if you rename or delete such file from %SYSTEMROOT%\Drivers and
reboot your computer, there will be no CDROMs next time, even physical CDROMs.
>
> Thanks in advance.
>
> Christian D’Orazio
>
>
>
>