RE: Question on Exclusive access & Hiding a Special CD-RO M Drive...

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it
    anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from people
trying to PREVENT the normal operation of their computers, as there are from
people trying to BENEFIT their user base.


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

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


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

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

Just control your environment. Set up your ACLs so that only your one,
true app is allowed to run. No driver needed.

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@eppi.epson.com.ph
Sent: Wednesday, January 18, 2006 5:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-RO
M Drive…

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver
developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it
    anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from
people
trying to PREVENT the normal operation of their computers, as there are
from
people trying to BENEFIT their user base.


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

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


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

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


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

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

The problem is, the machine is to be plugged to any PC. And so other
applications
should be allowed to run as long as it does not access the CD-ROM drive.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Thursday, January 19, 2006 10:07 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Just control your environment. Set up your ACLs so that only your one,
true app is allowed to run. No driver needed.

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@eppi.epson.com.ph
Sent: Wednesday, January 18, 2006 5:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-RO
M Drive…

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver
developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it
    anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from
people
trying to PREVENT the normal operation of their computers, as there are
from
people trying to BENEFIT their user base.


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

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


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

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


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

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


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

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

Two super-simple options that avoid drivers altogether:

(1) Open two exclusive handles to the device(*), and disable MCN
(IOCTL_STORAGE_MCN_CONTROL) via the direct-device handle if you want to
disable the driver pinging the device to detect media changes.

(*) Two handles are required for reasons that are too long to describe
here.

The first handle should be opened using CreateFile() with the path
obtained from SetupDi functions. It will look similar to
“\?\ide#cdromvendor_dvd_rom__________________1.02_________#5&23ba5cf8&0
&1.0.0#{53f56308-b6bf-11d0-94f0-00a0c91efb8b}”. If necessary to filter
only your devices, you can open a non-exclusive handle first, and send
an INQUIRY to the device via IOCTL_SCSI_PASS_THROUGH_DIRECT.

The second handle should be opened using CreateFile() only if the device
has at least one volume mount point. Volume mount points include drive
letters, but drive can also be mounted in empty NTFS directories. (You
will need to investigate if you must open an exclusive access handle for
each mount point, or if one is sufficient for all mount points). To
getting the volume mount points, take the PNP ID above, add a trailing
slash '' character, and call GetVolumeNameForVolumeMountPoint(). Then
use that string for a call to GetVolumePathNamesForVolumeName().

(2) Set a strong ACL on the device (such as for a user/group you define
during your software install), and then run the “special” application
under that user/group. (Or, impersonate that user/group just long
enough to get a handle to the device.)

Hope that helps,
.

-----Original Message-----
From: Raneil Ensomo [mailto:xxxxx@eppi.epson.com.ph]
Sent: Wednesday, January 18, 2006 4:47 PM
Subject: RE: Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver
developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the
people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it

anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from
people
trying to PREVENT the normal operation of their computers, as there are
from
people trying to BENEFIT their user base.


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

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


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

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

Thanks so much:) I’ll try what you said.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Henry Gabryjelski
Sent: Friday, January 20, 2006 3:04 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Two super-simple options that avoid drivers altogether:

(1) Open two exclusive handles to the device(*), and disable MCN
(IOCTL_STORAGE_MCN_CONTROL) via the direct-device handle if you want to
disable the driver pinging the device to detect media changes.

(*) Two handles are required for reasons that are too long to describe
here.

The first handle should be opened using CreateFile() with the path
obtained from SetupDi functions. It will look similar to
“\?\ide#cdromvendor_dvd_rom__________________1.02_________#5&23ba5cf8&0
&1.0.0#{53f56308-b6bf-11d0-94f0-00a0c91efb8b}”. If necessary to filter
only your devices, you can open a non-exclusive handle first, and send
an INQUIRY to the device via IOCTL_SCSI_PASS_THROUGH_DIRECT.

The second handle should be opened using CreateFile() only if the device
has at least one volume mount point. Volume mount points include drive
letters, but drive can also be mounted in empty NTFS directories. (You
will need to investigate if you must open an exclusive access handle for
each mount point, or if one is sufficient for all mount points). To
getting the volume mount points, take the PNP ID above, add a trailing
slash '' character, and call GetVolumeNameForVolumeMountPoint(). Then
use that string for a call to GetVolumePathNamesForVolumeName().

(2) Set a strong ACL on the device (such as for a user/group you define
during your software install), and then run the “special” application
under that user/group. (Or, impersonate that user/group just long
enough to get a handle to the device.)

Hope that helps,
.

-----Original Message-----
From: Raneil Ensomo [mailto:xxxxx@eppi.epson.com.ph]
Sent: Wednesday, January 18, 2006 4:47 PM
Subject: RE: Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver
developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the
people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it

anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from
people
trying to PREVENT the normal operation of their computers, as there are
from
people trying to BENEFIT their user base.


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

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


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

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


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Our competitor did it, so I guess we have to be able to do it somehow so
that
we can compete:) It could be stupid in a sense but I think it’s logical to
not let
others use the drive primarily because it’s dedicated. In addition, I think
our company
is actually planning to let the drives be hidden from the user’s view
physically (i.e. it
is inside the machine), so it must also be hidden in GUI, musn’t it?^^

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Friday, January 20, 2006 3:41 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

Probably the same bad thing that happens if some one bitching about
someone bitching doesn’t keep quiet.

Tim’s point was it’s a CD … so let it be used as a CD until such time as
the need is for it to be a duplicator then require special access. Windows
bends over backwards to be sure that devices are presented for the user to
use; now here comes a request to have the device but not let anyone use
it. That is a bit of an oxymoronic query.

Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ivan Bublikov
Sent: Thursday, January 19, 2006 12:08 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

And what bad thing is going to happen if people who can’t answer the
question would just keep quiet?

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Raneil Ensomo wrote:
>
>>Our current project is developing a machine that copies DVD/CD in a mass
>>scale.
>>This machine includes a printer (for the CD label), DVD/CD drives, etc.
>>These are all connected
>>through a USB hub. And so other than our application that manages the
>>DVD/CD copying, we
>>don’t want any other applications to access our DVD/CD drive…
>>
>>Sorry if I’ve misled you with my question. just a newbie driver
>>developer…
>>could anyone help me with my prob? thanks a lot, i’d appreciate it…
>>
>>
>
> And what bad thing is going to happen if I try to play an ordinary CD
> through your duplicator? Answer: absolutely nothing at all. When it is
> time for me to make a duplication run, it isn’t going to take me very
> long to figure out that I’ll have to eject whatever CD I had in there.
> I’ve had a Primera Bravo CD duplicator/printer for years. When it is
> not being used for duplication, what I have there is just a standard
> 1394 CD/RW drive, and there is NO EARTHLY REASON why you should prevent
> me from using it as such.
>
> It is just idiotic for you to waste your company’s money to try to
> prevent this programmatically.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
>


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

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


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

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

Hi Raniel,

Please keep the discussion on the list. This ensures answers are
archived, and can be searched by others in the future.

(1) First parameter to CreateFile() for the first handle is
“\\?\USBSTOR#CdRom&Ven…”.

(2) For the second CreateFile(), I think you can use the
GetVolumeNameForVolumeMountPoint() result. However, you should verify
an exclusive handle there also blocks access via the mount points.

(3) “\?\E:” is ‘?\E:’. You need two whacks at the start, so try
“\\?\E:” instead.

Summary (psuedo-code) for using SetupDi functions:

// get a handle to CDROM device class using guid
deviceInfo = SetupDiGetClassDevs(&GUID_DEVINTERFACE_CDROM, NULL, NULL,
(DIGCF_PRESENT | DIGCF_INTERFACEDEVICE) );
// loop through all recorders
BOOL success = TRUE;
for (ULONG i = 0; success; i++)
// Get the device interface data
// loop until GetLastError() == ERROR_NO_MORE_ITEMS
success =
SetupDiEnumDeviceInterfaces(deviceInfo,0,&GUID_DEVINTERFACE_CDROM, I,
&diData);
// Get the device interface data details –
// Normally you call with NULL/0 and then allocate a buffer of
// size usedBuffer + sizeof(TCHAR) (the extra TCHAR ensures
null-terminated path)
success = SetupDiGetDeviceInterfaceDetail(
deviceInfo,&diData,
largeBuffer,largeBufferSize,
&usedBuffer,NULL
);
// The device interface string is part of the result, but may not be
NULL terminated?
((PSP_DEVICE_INTERFACE_DETAIL_DATA)largeBuffer)->DevicePath;
// Open the device, inquiry to detect if it’s one you need to deal
with,
// save in array/list/etc.

Summary for converting SetupDi CDROM paths to volume name and mount
points:

===
Volume name is useful programmatically. Mount points are much more
user-friendly, and most often include the drive letter.

(1) Append a trailing slash character to the SetupDi path.
(2) Call GetVolumeNameForVolumeMountPoint() with large buffer.

  • This is the volume name. Easy, eh?
    (3) Call GetVolumePathNamesForVolumeName() with large buffer.
  • The result is a MULTI_SZ of all path names. The MULTI_SZ could
    be empty (‘\0\0’) if no drive letters/mount points, have only
    one string (‘F:\\0\0’) or (‘C:\CDDrives\First\\0\0’), or it
    could have multiple strings:
    (‘F:\\0C:\CDDrives\First\\0\0’) or even
    (‘C:\CDDrives\First\\0F:\\0\0’)

Look through MSDN for details on each function. When stuck, guess and
try a few things – there is nothing like experimentation to help flesh
out the details of how stuff works.

.

-----Original Message-----
From: Raneil Ensomo [mailto:xxxxx@eppi.epson.com.ph]
Sent: Friday, January 20, 2006 2:54 AM
To: Henry Gabryjelski
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-RO M Drive…

It’s me again. I tried your suggestion the entire day but couldn’t seem
to
make it work. I did the following as you suggested:

During the first CreateFile, I used:
\\?\USBSTOR#CdRom&Ven_PLEXTOR&Prod_DVDR___PX-716A&Rev_1.09#004420350A
&0#{
1186654d-47b8-48b9-beb9-7df113ae3c67} (i manually searched the registry
for
this one)

During the second CreateFile, I used the value I got from
GetVolumeNameForVolumeMountPoint (minus the trailing backslash).

And then I called DeviceIoControl using the handle from the first
CreateFile. Actually, DeviceIoControl succeeded.

I’ve also tried other things like using “\?\E:” for the 2nd CreateFile
and
so forth, but to no avail.

What could I have done wrong?

Thanks a lot, Sir. I really appreciate it.

Best Regards,

Raneil

-----Original Message-----
From: Raneil Ensomo
Sent: Friday, January 20, 2006 2:02 PM
To: ‘Henry Gabryjelski’
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-RO M
Drive…

I would like to ask for some clarifications, if you don’t mind…

Regarding #1, what do I use as parameter to CreateFile on the second
call?

On the first, I used the path obtained from SetupDi functions.
On the second, should I use the one returned by
GetVolumeNameForVolumeMountPoint?
And should I send IOCTL_STORAGE_MCN_CONTROL after the second CreateFile?

Thanks a lot. And sorry for the trouble:)

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Henry Gabryjelski
Sent: Friday, January 20, 2006 3:04 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Question on Exclusive access & Hiding a Special
CD-RO M
Drive…

Two super-simple options that avoid drivers altogether:

(1) Open two exclusive handles to the device(*), and disable MCN
(IOCTL_STORAGE_MCN_CONTROL) via the direct-device handle if you want to
disable the driver pinging the device to detect media changes.

(*) Two handles are required for reasons that are too long to describe
here.

The first handle should be opened using CreateFile() with the path
obtained from SetupDi functions. It will look similar to
“\?\ide#cdromvendor_dvd_rom__________________1.02_________#5&23ba5cf8&0
&1.0.0#{53f56308-b6bf-11d0-94f0-00a0c91efb8b}”. If necessary to filter
only your devices, you can open a non-exclusive handle first, and send
an INQUIRY to the device via IOCTL_SCSI_PASS_THROUGH_DIRECT.

The second handle should be opened using CreateFile() only if the device
has at least one volume mount point. Volume mount points include drive
letters, but drive can also be mounted in empty NTFS directories. (You
will need to investigate if you must open an exclusive access handle for
each mount point, or if one is sufficient for all mount points). To
getting the volume mount points, take the PNP ID above, add a trailing
slash '' character, and call GetVolumeNameForVolumeMountPoint(). Then
use that string for a call to GetVolumePathNamesForVolumeName().

(2) Set a strong ACL on the device (such as for a user/group you define
during your software install), and then run the “special” application
under that user/group. (Or, impersonate that user/group just long
enough to get a handle to the device.)

Hope that helps,
.

-----Original Message-----
From: Raneil Ensomo [mailto:xxxxx@eppi.epson.com.ph]
Sent: Wednesday, January 18, 2006 4:47 PM
Subject: RE: Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Our current project is developing a machine that copies DVD/CD in a mass
scale.
This machine includes a printer (for the CD label), DVD/CD drives, etc.
These are all connected
through a USB hub. And so other than our application that manages the
DVD/CD copying, we
don’t want any other applications to access our DVD/CD drive…

Sorry if I’ve misled you with my question. just a newbie driver
developer…
could anyone
help me with my prob? thanks a lot, i’d appreciate it…

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Arlie Davis
Sent: Thursday, January 19, 2006 6:11 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Oh, they ARE trying to benefit their user base. It’s just that the
people
in their user base are not the owners of the computers who will run this
software. They’re the people who will distribute the software.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@probo.com
Sent: Wednesday, January 18, 2006 3:57 PM
To: Windows System Software Devs Interest List
Cc: Tim Roberts
Subject: Re: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

On Wed, Jan 18, 2006 at 08:49:55AM +0800, Raneil Ensomo wrote:

I have this problem on how to support the following on a special
dedicated CD-ROM drive:

  1. Only our user-mode application can access the drive.
    Other applications should not be able to access it.

  2. The CD-ROM drive should not be displayed through Windows Explorer
    under any circumstances (the best case is actually never to display it

anywhere, not even in Device Manager).

What is the POINT of this?

Honestly, there are approximately as many postings on this list from
people
trying to PREVENT the normal operation of their computers, as there are
from
people trying to BENEFIT their user base.


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

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


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

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


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

Your competitor succeeded in sabotaging their own product?

Why not just put a bullet point on your box that says “It’s also a fully
functional CD-ROM driver, unlike Brand X!”?

What value is there in preventing normal use of the CD-ROM drive?

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Raneil Ensomo
Sent: Thursday, January 19, 2006 7:55 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-RO M
Drive…

Our competitor did it, so I guess we have to be able to do it somehow so
that we can compete:) It could be stupid in a sense but I think it’s
logical to not let others use the drive primarily because it’s dedicated.
In addition, I think our company is actually planning to let the drives be
hidden from the user’s view physically (i.e. it is inside the machine), so
it must also be hidden in GUI, musn’t it?^^

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Friday, January 20, 2006 3:41 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

Probably the same bad thing that happens if some one bitching about someone
bitching doesn’t keep quiet.

Tim’s point was it’s a CD … so let it be used as a CD until such time as
the need is for it to be a duplicator then require special access. Windows
bends over backwards to be sure that devices are presented for the user to
use; now here comes a request to have the device but not let anyone use it.
That is a bit of an oxymoronic query.

Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ivan Bublikov
Sent: Thursday, January 19, 2006 12:08 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

And what bad thing is going to happen if people who can’t answer the
question would just keep quiet?

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Raneil Ensomo wrote:
>
>>Our current project is developing a machine that copies DVD/CD in a
>>mass scale.
>>This machine includes a printer (for the CD label), DVD/CD drives, etc.
>>These are all connected
>>through a USB hub. And so other than our application that manages the
>>DVD/CD copying, we don’t want any other applications to access our
>>DVD/CD drive…
>>
>>Sorry if I’ve misled you with my question. just a newbie driver
>>developer…
>>could anyone help me with my prob? thanks a lot, i’d appreciate it…
>>
>>
>
> And what bad thing is going to happen if I try to play an ordinary CD
> through your duplicator? Answer: absolutely nothing at all. When it
> is time for me to make a duplication run, it isn’t going to take me
> very long to figure out that I’ll have to eject whatever CD I had in
there.
> I’ve had a Primera Bravo CD duplicator/printer for years. When it is
> not being used for duplication, what I have there is just a standard
> 1394 CD/RW drive, and there is NO EARTHLY REASON why you should
> prevent me from using it as such.
>
> It is just idiotic for you to waste your company’s money to try to
> prevent this programmatically.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
>


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

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


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

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


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

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

How is the user supposed to load a CD into the CD-ROM drive if it’s
“hidden inside the machine”?

Phil

Philip D. Barila
Seagate Technology LLC
(720) 684-1842

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@eppi.epson.com.ph
Sent: Thursday, January 19, 2006 5:55 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special CD-RO
M Drive…

Our competitor did it, so I guess we have to be able to do it somehow so
that
we can compete:) It could be stupid in a sense but I think it’s logical
to
not let
others use the drive primarily because it’s dedicated. In addition, I
think
our company
is actually planning to let the drives be hidden from the user’s view
physically (i.e. it
is inside the machine), so it must also be hidden in GUI, musn’t it?^^

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@seagate.com
Sent: Friday, January 20, 2006 3:41 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question on Exclusive access & Hiding a Special
CD-ROM
Drive…

Probably the same bad thing that happens if some one bitching about
someone bitching doesn’t keep quiet.

Tim’s point was it’s a CD … so let it be used as a CD until such time as
the need is for it to be a duplicator then require special access. Windows
bends over backwards to be sure that devices are presented for the user to
use; now here comes a request to have the device but not let anyone use
it. That is a bit of an oxymoronic query.

Gary G. Little

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ivan Bublikov
Sent: Thursday, January 19, 2006 12:08 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question on Exclusive access & Hiding a Special CD-ROM
Drive…

And what bad thing is going to happen if people who can’t answer the
question would just keep quiet?

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> Raneil Ensomo wrote:
>
>>Our current project is developing a machine that copies DVD/CD in a mass
>>scale.
>>This machine includes a printer (for the CD label), DVD/CD drives, etc.
>>These are all connected
>>through a USB hub. And so other than our application that manages the
>>DVD/CD copying, we
>>don’t want any other applications to access our DVD/CD drive…
>>
>>Sorry if I’ve misled you with my question. just a newbie driver
>>developer…
>>could anyone help me with my prob? thanks a lot, i’d appreciate it…
>>
>>
>
> And what bad thing is going to happen if I try to play an ordinary CD
> through your duplicator? Answer: absolutely nothing at all. When it is
> time for me to make a duplication run, it isn’t going to take me very
> long to figure out that I’ll have to eject whatever CD I had in there.
> I’ve had a Primera Bravo CD duplicator/printer for years. When it is
> not being used for duplication, what I have there is just a standard
> 1394 CD/RW drive, and there is NO EARTHLY REASON why you should prevent
> me from using it as such.
>
> It is just idiotic for you to waste your company’s money to try to
> prevent this programmatically.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
>


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

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


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

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


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

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

xxxxx@seagate.com wrote:

How is the user supposed to load a CD into the CD-ROM drive if it’s
“hidden inside the machine”?

Right. I go back to the example I quoted yesterday, the Primara Bravo
duplicator I’ve had for a number of years. This was clearly designed as
a dedicated CD duplicator/printer. It’s a single, self-contained unit,
with a robotic arm to move CDs between stations (mounted to the inkjet
print carriage – a very clever design, in my opinion). Their dedicated
app coordinates the various pieces quite nicely, so that a CD is picked,
burned, printed, and ejected in proper order.

However, when I’m not running their app, it is quite possible to use it
as a standalone USB CD printer, or as a standalone 1394 CD
reader/writer. It’s not terribly convenient to do so, since it is a
separate unit on the other side of the desk, but there have been times
when it was handy to have that extra drive available, and I’ve used the
printer by itself a number of time.

The key, to me, is that there is no downside to Primera in allowing me
to use their device in this way. They already made their sale, and the
fact that I can use it sensibly means I’m likely to go BACK to them when
I need a fancier device later on. Few things irritate me as much as
senseless restrictions.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.