From: Alexanderfe on
Hi,
I'd like to enumerate and find all tape devices on the system and their info
(like device id, device type and tape symbolic name).

I know that it's possible to use SetupDI API to perform this task, but this
requires me to get the source code from the WDK and wrap it up to a DLL,
while periodically checking for updates and updating my dll accordingly.

Recently I've found out that it's also possible to query WMI and get the
needed info from Win32_TapeDrive and MSTapeSymbolicName.

I'm using C# and the second method is much cleaner and simpler to code and
understand (using System.Management).

My question Is whether the latter method is considered robust to possible
changes by the devices manufacturers? Is it recommended at least as SetupDI,
and will it be supported in future Windows versions?
Thanks for any help,
Alex.

From: Doron Holan [MSFT] on
setupdi is going to be the lighter weight solution and yes it will be
supported in future versions of the OS. setupdi will easily let you
enumerate instances (which gives you sym link names). from there you can
get device IDs as well. not sure what you mean by device type

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alexanderfe" <Alexanderfe(a)discussions.microsoft.com> wrote in message
news:A568C95B-9689-4CA1-8525-29F95A1D0BF2(a)microsoft.com...
> Hi,
> I'd like to enumerate and find all tape devices on the system and their
> info
> (like device id, device type and tape symbolic name).
>
> I know that it's possible to use SetupDI API to perform this task, but
> this
> requires me to get the source code from the WDK and wrap it up to a DLL,
> while periodically checking for updates and updating my dll accordingly.
>
> Recently I've found out that it's also possible to query WMI and get the
> needed info from Win32_TapeDrive and MSTapeSymbolicName.
>
> I'm using C# and the second method is much cleaner and simpler to code and
> understand (using System.Management).
>
> My question Is whether the latter method is considered robust to possible
> changes by the devices manufacturers? Is it recommended at least as
> SetupDI,
> and will it be supported in future Windows versions?
> Thanks for any help,
> Alex.
>

From: Alexanderfe on
Doron, hi.
Thank you very much for you answer, but I was actually interested in info
about the second method , the method which queries WMI and not the setupdi
medhod, because it's much easier to code and understand and also doesn't mix
managed and unmanaged code.

So my questions remain :
1) Is querying WMI considered robust to possible changes by the devices
manufacturers ?
2) Is querying WMI recommended at least as using SetupDI?
3) Will querying WMI be supported in future Windows versions?

Thanks for any help,
Alex.

"Doron Holan [MSFT]" wrote:

> setupdi is going to be the lighter weight solution and yes it will be
> supported in future versions of the OS. setupdi will easily let you
> enumerate instances (which gives you sym link names). from there you can
> get device IDs as well. not sure what you mean by device type
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Alexanderfe" <Alexanderfe(a)discussions.microsoft.com> wrote in message
> news:A568C95B-9689-4CA1-8525-29F95A1D0BF2(a)microsoft.com...
> > Hi,
> > I'd like to enumerate and find all tape devices on the system and their
> > info
> > (like device id, device type and tape symbolic name).
> >
> > I know that it's possible to use SetupDI API to perform this task, but
> > this
> > requires me to get the source code from the WDK and wrap it up to a DLL,
> > while periodically checking for updates and updating my dll accordingly.
> >
> > Recently I've found out that it's also possible to query WMI and get the
> > needed info from Win32_TapeDrive and MSTapeSymbolicName.
> >
> > I'm using C# and the second method is much cleaner and simpler to code and
> > understand (using System.Management).
> >
> > My question Is whether the latter method is considered robust to possible
> > changes by the devices manufacturers? Is it recommended at least as
> > SetupDI,
> > and will it be supported in future Windows versions?
> > Thanks for any help,
> > Alex.
> >
>
>
From: Doron Holan [MSFT] on
1) it should
2) i can't answer that, it is relative to the problem you are trying to
solve. certainly using setupapi is giong to be a lower resource consuming
choice, wmi is rather heavy weight
3) it should be

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Alexanderfe" <Alexanderfe(a)discussions.microsoft.com> wrote in message
news:3340B6AA-6877-4DB0-BD30-A9F75A57C395(a)microsoft.com...
> Doron, hi.
> Thank you very much for you answer, but I was actually interested in info
> about the second method , the method which queries WMI and not the setupdi
> medhod, because it's much easier to code and understand and also doesn't
> mix
> managed and unmanaged code.
>
> So my questions remain :
> 1) Is querying WMI considered robust to possible changes by the devices
> manufacturers ?
> 2) Is querying WMI recommended at least as using SetupDI?
> 3) Will querying WMI be supported in future Windows versions?
>
> Thanks for any help,
> Alex.
>
> "Doron Holan [MSFT]" wrote:
>
>> setupdi is going to be the lighter weight solution and yes it will be
>> supported in future versions of the OS. setupdi will easily let you
>> enumerate instances (which gives you sym link names). from there you can
>> get device IDs as well. not sure what you mean by device type
>>
>> d
>>
>> --
>> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>> "Alexanderfe" <Alexanderfe(a)discussions.microsoft.com> wrote in message
>> news:A568C95B-9689-4CA1-8525-29F95A1D0BF2(a)microsoft.com...
>> > Hi,
>> > I'd like to enumerate and find all tape devices on the system and their
>> > info
>> > (like device id, device type and tape symbolic name).
>> >
>> > I know that it's possible to use SetupDI API to perform this task, but
>> > this
>> > requires me to get the source code from the WDK and wrap it up to a
>> > DLL,
>> > while periodically checking for updates and updating my dll
>> > accordingly.
>> >
>> > Recently I've found out that it's also possible to query WMI and get
>> > the
>> > needed info from Win32_TapeDrive and MSTapeSymbolicName.
>> >
>> > I'm using C# and the second method is much cleaner and simpler to code
>> > and
>> > understand (using System.Management).
>> >
>> > My question Is whether the latter method is considered robust to
>> > possible
>> > changes by the devices manufacturers? Is it recommended at least as
>> > SetupDI,
>> > and will it be supported in future Windows versions?
>> > Thanks for any help,
>> > Alex.
>> >
>>
>>

From: Anand Choubey on
Hi,

I developed like your application. But I had bad experience with WMI
at client side.
Reason is with WMI functionality,, WMI service must be run on client
machine.
This creates dependency and sometime hard to debug such issue.

So i suggest do using Setupdi spis.

Regards,
Anand Choubey

On Sep 15, 12:45 pm, Alexanderfe
<Alexande...(a)discussions.microsoft.com> wrote:
> Hi,
> I’d like to enumerate and find all tape devices on the system and their info
> (like device id, device type and tape symbolic name).
>
> I know that it’s possible to use SetupDI API to perform this task, but this
> requires me to get the source code from the WDK and wrap it up to a DLL,
> while periodically checking for updates and updating my dll accordingly.
>
> Recently I’ve found out that it’s also possible to query WMI and get the
> needed info from  Win32_TapeDrive and MSTapeSymbolicName.
>
> I’m using C# and the second method is much cleaner and simpler to code and
> understand (using System.Management).
>
> My question Is whether the latter method is considered robust to possible
> changes by the devices manufacturers? Is it recommended at least as SetupDI,
> and will it be supported in future Windows versions?
> Thanks for any help,
> Alex.