{
UCHARstatus;
SCSIWMI_REQUEST_CONTEXT requestContext;
ULONG retSize;
BOOLEAN pending;
// Validate our assumptions.ASSERT(Srb->Function == SRB_FUNCTION_WMI);
ASSERT(Srb->Length == sizeof(SCSI_WMI_REQUEST_BLOCK));
ASSERT(Srb->DataTransferLength >= sizeof(ULONG));
ASSERT(Srb->DataBuffer);
// Check if the WMI SRB is targetted for the adapter or one of the disksif (!(Srb->WMIFlags & SRB_WMI_FLAGS_ADAPTER_REQUEST))
{
// This is targetted to one of the disks, since there are no per disk// wmi information we return an error. Note that if there was per// disk information, then you'd likely have a differen WmiLibContext// and a different set of guids.Srb->DataTransferLength = 0;
Srb->SrbStatus = SRB_STATUS_SUCCESS;
}
else
{
// Process the incoming WMI request.
pending = ScsiPortWmiDispatchFunction(&HwDeviceExtension->WmiLibContext,
Srb->WMISubFunction,
HwDeviceExtension,
&requestContext,
Srb->DataPath,
Srb->DataTransferLength,
Srb->DataBuffer);
// We assune that the wmi request will never pend so that we can// allocate the requestContext from stack. If the WMI request could// ever pend then we'd need to allocate the request context from// the SRB extension.//ASSERT(! pending);
retSize = ScsiPortWmiGetReturnSize(&requestContext);
status = ScsiPortWmiGetReturnStatus(&requestContext);
// We can do this since we assume it is done synchronouslySrb->DataTransferLength = retSize;
//// Adapter ready for next request.//Srb->SrbStatus = status;
}
ScsiPortNotification(RequestComplete, HwDeviceExtension, Srb);
ScsiPortNotification(NextRequest, HwDeviceExtension, NULL);
returnTRUE;
}
Generated on Sun May 27 2012 05:26:41 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.