FC WWPN from KM Driver IoWMIOpenBlock fails!

Hello,

I am trying to get WWPN for FC HBA from a storage filter driver. But I am getting failure in IoWMIOpenBlock call (with status = -1073741163) . Here is the partial code, any help will be highly appreciated. I have a user mode code where I use the ExecQuery for “SELECT * FROM MSFC_FibrePortHBAAttributes”, and everything works fine.

#define MSFC_FibrePortHBAAttributes_GUID \
{0x61b397fd,0xf5ae,0x4950,0x97,0x58,0x0e,0xe5,0x98,0xe3,0xc6,0xe6}

GUID fcWWPNGUID = MSFC_FibrePortHBAAttributes_GUID;

NTSTATUS QueryAllWWPN()
{
NTSTATUS status;
PVOID WmiDataBlock = NULL;
ULONG WmiBufferSize = 0;
PCUCHAR EndOfBuffer;

// Get the _MSFC_FibrePortHBAAttributes block
status = IoWMIOpenBlock((GUID *)&fcWWPNGUID, WMIGUID_QUERY, &WmiDataBlock);
if (STATUS_SUCCESS != status) {
WmiDataBlock = NULL;
goto ERROR;
}

TIA!

xxxxx@yahoo.com wrote:

Hello,

I am trying to get WWPN for FC HBA from a storage filter driver. But I am getting failure in IoWMIOpenBlock call (with status = -1073741163) .

Really? You look at a number like that, and you don’t automatically
think “I’ll bet that should be printed in hex?”

-1073741164 is 0xC0000295. That’s STATUS_WMI_GUID_NOT_FOUND. You’re
sure your function driver implements this class? Can you fetch it from
user mode?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim.

I should have typed the hex equivalent here, my bad.

Actually, my driver is class filter and that class is implemented by miniport driver. My test machine has QLogic FC HBA, and from user mode I have no problem querying the WWPN.

I am using COM APIs, and I generate query using ExecQuery for “SELECT * FROM MSFC_FibrePortHBAAttributes”, after which I enumerate all the instances of HBAs from the application.

Another point of interest is that I am calling IoWMIOpenBlock() from IRP_MN_START_DEVICE (after the IRP return back from lower drivers), could it be possible that WMI has not enumerated the class yet?

xxxxx@yahoo.com wrote:

I am using COM APIs, and I generate query using ExecQuery for “SELECT * FROM MSFC_FibrePortHBAAttributes”, after which I enumerate all the instances of HBAs from the application.

That’s pretty revealing.

Another point of interest is that I am calling IoWMIOpenBlock() from IRP_MN_START_DEVICE (after the IRP return back from lower drivers), could it be possible that WMI has not enumerated the class yet?

The WMI provider is usually initialized at AddDevice time, so you’re
ready to accept WMI requests right away. I don’t know whether this
particular WMI branch has to wait for child devices to arrive or not;
someone more involved with that specific driver would have to address that.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.