// scsiwmi.h
PWCHAR ScsiPortWmiGetInstanceName(
[in] PSCSIWMI_REQUEST_CONTEXT RequestContext
);
View the official Windows Driver Kit DDI referenceNo description available.
The ScsiPortWmiGetInstanceName routine returns a pointer to the instance name associated with the indicated the Windows Management Instrumentation (WMI) SCSI Request Block (SRB).
Note The SCSI port driver and SCSI miniport driver models may be altered or unavailable in the future. Instead, we recommend using the Storport driver and Storport miniport driver models.
RequestContext [in]Pointer to a structure of type SCSIWMI_REQUEST_CONTEXT that contains the request context for a WMI SRB.
Pointer to a counted string containing the instance name associated with the indicated SRB. If the SRB type is one that does not use an instance name, ScsiPortWmiGetInstanceName returns NULL.
The parameter RequestContext points to a request context structure, SCSIWMI_REQUEST_CONTEXT, that contains information associated with a Windows Management Instrumentation (WMI) SCSI request block (SRB). The request context structure, in turn, contains one of the WMI WNODE_XXX Structures that is used by the WMI system to pass data between user-mode data consumers and kernel-mode data providers such as drivers.
The WNODE_XXX structure contained in the request context holds an instance name associated with the WMI SRB. The miniport driver calls ScsiPortWmiGetInstanceName to extract this instance name from the request context.
The memory allocated for the request context must remain valid until after the miniport driver calls ScsiPortWmiPostProcess, and ScsiPortWmiPostProcess returns the final SRB status and buffer size. If the SRB can pend, the memory for the request context should be allocated from the SRB extension. If the SRB cannot pend, the memory can be allocated from a stack frame that does not go out of scope.