确定 PCI 适配器的物理位置

发布于 2024-09-24 15:23:02 字数 696 浏览 11 评论 0原文

我们有一个可以使用多个 PCI 适配器的 Windows 应用程序。这些适配器都具有与其他硬件或电缆的外部物理连接。我们的软件配置为了解每张卡上的物理连接所连接的内容。想象一下支持多个声音输入和输出的音频软件。音频软件配置为知道适配器 1 上的麦克风是主唱,而适配器 2 上的麦克风是吉他。

事实上,该软件通常在带有 ExpressCard 和/或 PC 卡适配器的笔记本电脑上运行。因此,用户可以例行地移除适配器。此外,我们的客户可能拥有比一台笔记本电脑所能容纳的更多的适配器。因此,您可以想象有人在笔记本电脑中安装适配器 A(PC 卡)和 B(ExpressCard)并配置我们的软件。他们现在期望歌手的麦克风连接到 PC 卡适配器,而吉他麦克风连接到 ExpressCard 适配器。然后他们回到办公室,取出适配器并将其与所有其他适配器放在一堆。第二天,当他们去使用该软件时,他们拿起适配器 C(PC 卡)和 D(ExpressCard)。当他们将这些卡插入系统时,我们希望能够知道适配器 C 与适配器 A 位于同一位置,因此连接到歌手的麦克风,并且 D 与 B 位于同一位置因此连接到吉他上。

如果没有此功能,用户每次更换卡时都必须重新配置我们的软件,这对用户来说不是特别友好。

有什么方法可以确定 Windows 中硬件适配器在 PCI 链中的位置吗?还有其他方法可以实现这个目标吗?

我希望它能在 Windows XP 及更高版本上运行。请注意,我们确实控制硬件驱动程序,因此我们可以在必要时进行更改。

We have a Windows application that can use multiple PCI adapters. These adapters all have external physical connections to other hardware or cables. Our software is configured to know what the physical connection on each card is connected to. Imagine audio software that supports multiple sound inputs and outputs. The audio software is configured to know that the microphone on adapter 1 is the lead singer, while the microphone on adapter 2 is the guitar.

As it happens, this software is often run on laptops with ExpressCard and/or PC Card adapters. As such, the user may routinely remove the adapters. Additionally, our customers may have many more adapters than fit in one laptop. So, you can imagine that someone installs adapters A (PC Card) and B (ExpressCard) in the laptop and configures our software. They now expect that the singer's mic is attached to the PC card adapter and the guitar mic is attached to the ExpressCard adapter. They then go back to the office, take the adapters out and put them in the pile with all the other adapters. The next day when they go to use the software they grab adapters C (PC Card) and D (ExpressCard). When they plug these cards in to the system we'd like to be able to know that adapter C is in the same spot as adapter A was and therefore is hooked up to the singer's mic and that D is in the same spot as B was and is therefore hooked up to the guitar.

Without this feature the user will have to reconfigure our software every time they change cards, which is not especially user friendly.

Is there any way to determine the location in the PCI chain of a hardware adapter in Windows? Is there any other way to accomplish this goal?

I'd like this to work on Windows XP and later. Note that we do control the hardware drivers, so we can make changes there if necessary.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

假装爱人 2024-10-01 15:23:02

事实证明,PCI 位置信息位于

HKLM\SYSTEM\CurrentControlSet\Enum\<PnP ID>\LocationInformation

PCI 设备位置下,类似于 PCI\\

在 Windows XP 下,这将告诉您总线编号、设备编号和功能编号。这可能与 http://support.microsoft.com/kb/253232 中的信息相同史蒂夫提到过。使用此注册表位置的优点是不需要修改驱动程序(包括 API 更改)。

As it turns out, PCI location information is available under

HKLM\SYSTEM\CurrentControlSet\Enum\<PnP ID>\LocationInformation

Where for PCI Devices is something like PCI\\

Under Windows XP this will tell you the Bus Number, Device Number and Function Number. This is likely the same information from http://support.microsoft.com/kb/253232 as mentioned by Steve. The advantage of using this registry location is that driver modifications (including API changes) are not needed.

仄言 2024-10-01 15:23:02

我认为这篇知识库文章正是您所需要的。

本文介绍了如何获得
配置和位置
信息(例如巴士号码、
的设备编号和功能编号)
外围组件互连
(PCI) 驱动程序中的设备是其一部分
目标设备的驱动程序堆栈
作为函数或过滤器驱动程序。

I think this KB article is what you need.

This article describes how you can get
the configuration and location
information (such as BusNumber,
DeviceNumber, and Function Number) of
a Peripheral Component Interconnect
(PCI) device in a driver that is part
of the target device's driver stack
either as a function or filter driver.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文