Prev: WHQL-USB Device FrameWork(CV) Test Fail in XP 32/64
Next: I need a Vista Driver for Usb Adapter
From: Alexanderfe on 15 Sep 2008 03:45 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 15 Sep 2008 14:33 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 16 Sep 2008 02:40 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 16 Sep 2008 17:32 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 19 Sep 2008 19:06 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, > Id 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 its 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 Ive found out that its also possible to query WMI and get the > needed info from Win32_TapeDrive and MSTapeSymbolicName. > > Im 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.
|
Pages: 1 Prev: WHQL-USB Device FrameWork(CV) Test Fail in XP 32/64 Next: I need a Vista Driver for Usb Adapter |