使用注册表值而不是SetupApi.dll [英] Use Registry Values Instead Of SetupApi.dll

查看:71
本文介绍了使用注册表值而不是SetupApi.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个HID USB接口连接到我正在开发的USB设备。我知道我需要一个设备路径传递给CreateFile来获取句柄。一旦我有一个句柄,我就可以读取和写入设备。



作为一个说明点,我开发了一个应用程序,按描述和设备路径列出USB HID设备。它使用setupapi.dll。这在我开发的机器上非常出色:VS2005和64位Windows 7.



但是它不适用于装有VS2005的32位XP机器或安装了VS2005的64位Window 7机器。 DependencyWalker告诉我XP setupapi.dll没有SetupDiGetDevicePropertyW函数。



三个问题:

1.有没有直接的方法让应用程序在所有平台上运行?

2.为什么我不能使用注册表中的参数,因为我需要的所有内容似乎都在那里?

3。注册表参数SymbolicName是否与CreateFile所需的设备路径相同?

I am wanting a HID USB Interface to connect to a USB device I am developing. I understand that I need a device path to pass to CreateFile to get a handle. Once I have a handle I can read and write to the device.

As a stating point I have developed an app that lists USB HID devices by description and device path. It uses setupapi.dll. This works brilliantly on the machine I developed it on: VS2005 and 64bit Windows 7.

However it does not work on a 32 bit XP machine with VS2005 installed on it or a 64 bit Window 7 machine without VS2005 installed. DependencyWalker tells me that the XP setupapi.dll does not have the function SetupDiGetDevicePropertyW.

Three questions:
1. Is there a straightforward way of getting the app to work on all platforms?
2. Why can't I use parameters from the registry since everything I need seems to be in there?
3. Is the registry parameter SymbolicName the same as the device path needed by CreateFile?

推荐答案

1。请参阅 http://msdn.microsoft上的要求部分。 com / en-us / library / windows / hardware / ff551963(v = vs.85).aspx [ ^ ]。此功能适用于Windows Vista及更高版本。你还需要在系统上安装DLL,我不认为它是标准的,这就是为什么VS也是必需的。



2.你可能可以,但安装功能有时需要做的不仅仅是阅读注册表,所以通常建议你不要依赖它。



3.对不起,不要知道。
1. See the requirements section at http://msdn.microsoft.com/en-us/library/windows/hardware/ff551963(v=vs.85).aspx[^]. This function is available on Windows Vista and above. You will also need to have the DLL on the system, I don't think it comes as standard, which is why VS is also required.

2. You probably can, but the Setup functions sometimes need to do more than just reading the registry, so you are generally advised not to rely on it.

3. Sorry, don't know.


这篇关于使用注册表值而不是SetupApi.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆