How to check a device existence in Kernel driver?

guliteb 41 Reputation points
2022-06-08T08:20:30.913+00:00

I am writing a kernel driver. In the driver, I want to check if another device exists. I know its Hardware ID and Instance ID. But that device (driver) does not register a device interface class. So I cannot use IoGetDeviceInterfaces to get a list of enabled device interface instances, because that device does not have interface class GUID.

Is there any other way to check the presence of the device?

Thanks.

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,659 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Doron Holan 1,801 Reputation points
    2022-06-08T18:19:54.88+00:00

    Device interface existence is the correct way to detect the second device is present. Can the secondary driver be updated to expose a device interface? If not, does the second driver support opening file handles and expose a fixed ("legacy") symbolic link name? If yes, you can try to open the fixed name during initialization and if that fails, maybe poll for it later.

    0 comments No comments

  2. guliteb 41 Reputation points
    2022-06-09T00:14:23.237+00:00

    Hi Doron,
    Thanks for your comments. Actually I have no ownership on the other device driver. It is inbox wmiacpi driver on which I don't find device interface. BIOS exposes various device under Pnp0c14, I want to check the existence of one device among them. I want to do the check in my driver. Any comments?

    Thanks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.