Tape drive enumeration

Hello people,

I am trying to enumerate the tape drives on my machine, I have tried
CreateFile("\\.\Tape%s) and got them working, but I am sure there
should be a better way of doing this.

I should be using DeviceIoControl to get the type of the media but I
couldn’t not link with tape0 / tape1 etc…

Any help is appreciated and thanks in advanced

Daher

Create the instance of SystemDeviceEnum and query for the ICreateDeviceEnum and then enumerate for the VideoInputDeviceCategory. have look at the following sample code…
ICreateDevEnum *pCreateDevEnum = NULL;
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void**)&pCreateDevEnum);
IEnumMoniker *pEm = NULL;
hr = pCreateDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEm, 0);
pCreateDevEnum->Release();

regards
srinivas
Daher wrote:
Hello people,

I am trying to enumerate the tape drives on my machine, I have tried
CreateFile("\\.\Tape%s) and got them working, but I am sure there
should be a better way of doing this.

I should be using DeviceIoControl to get the type of the media but I
couldn’t not link with tape0 / tape1 etc…

Any help is appreciated and thanks in advanced

Daher


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

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

---------------------------------
Do you Yahoo!?
Check out the new Yahoo! Front Page. www.yahoo.com

You can use setupdi to enumerate every device in the tape setup class
(I’m assuming there is one). This will let you get information about
them like their “friendly name” (for display purposes) as well as the
device interfaces they support so you can open them up.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daher
Sent: Wednesday, November 10, 2004 4:19 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Tape drive enumeration

Hello people,

I am trying to enumerate the tape drives on my machine, I have tried
CreateFile("\\.\Tape%s) and got them working, but I am sure there
should be a better way of doing this.

I should be using DeviceIoControl to get the type of the media but I
couldn’t not link with tape0 / tape1 etc…

Any help is appreciated and thanks in advanced

Daher


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

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

Hey thanks peter,

I have found this example on SetupDi
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q259695

which doesn’t seem to recognize my SCSI tape… It did recognize my IDE
tape though…

  • Daher

Peter Wieland wrote:

You can use setupdi to enumerate every device in the tape setup class
(I’m assuming there is one). This will let you get information about
them like their “friendly name” (for display purposes) as well as the
device interfaces they support so you can open them up.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daher
Sent: Wednesday, November 10, 2004 4:19 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Tape drive enumeration

Hello people,

I am trying to enumerate the tape drives on my machine, I have tried
CreateFile("\\.\Tape%s) and got them working, but I am sure there
should be a better way of doing this.

I should be using DeviceIoControl to get the type of the media but I
couldn’t not link with tape0 / tape1 etc…

Any help is appreciated and thanks in advanced

Daher


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

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com