{
PSTORAGE_DEVICE_DESCRIPTOR deviceDescriptor;
PUCHAR vendorId;
PUCHAR productId;
PUCHAR productRevision;
UCHAR nullString[] = "";
ULONG j;
PAGED_CODE();
ASSERT(DeviceList);
ASSERT(Function);
deviceDescriptor = FdoExtension->DeviceDescriptor;
if (DeviceList == NULL) {
return;
}
if (Function == NULL) {
return;
}
//// SCSI sets offsets to -1, ATAPI sets to 0. check for both.//if (deviceDescriptor->VendorIdOffset != 0 &&
deviceDescriptor->VendorIdOffset != -1) {
vendorId = ((PUCHAR)deviceDescriptor);
vendorId += deviceDescriptor->VendorIdOffset;
} else {
vendorId = nullString;
}
if (deviceDescriptor->ProductIdOffset != 0 &&
deviceDescriptor->ProductIdOffset != -1) {
productId = ((PUCHAR)deviceDescriptor);
productId += deviceDescriptor->ProductIdOffset;
} else {
productId = nullString;
}
if (deviceDescriptor->VendorIdOffset != 0 &&
deviceDescriptor->VendorIdOffset != -1) {
productRevision = ((PUCHAR)deviceDescriptor);
productRevision += deviceDescriptor->ProductRevisionOffset;
} else {
productRevision = nullString;
}
//// loop while the device list is valid (not null-filled)//for (;(DeviceList->VendorId != NULL ||
DeviceList->ProductId != NULL ||
DeviceList->ProductRevision != NULL);DeviceList++) {
if (ClasspMyStringMatches(DeviceList->VendorId, vendorId) &&
ClasspMyStringMatches(DeviceList->ProductId, productId) &&
ClasspMyStringMatches(DeviceList->ProductRevision, productRevision)
) {
DebugPrint((1, "ClasspScanForSpecialByInquiry: Found matching ""controller Ven: %s Prod: %s Rev: %s\n",
vendorId, productId, productRevision));
//// pass the context to the call back routine and exit//
(Function)(FdoExtension, DeviceList->Data);
//// for CHK builds, try to prevent wierd stacks by having a debug// print here. it's a hack, but i know of no other way to prevent// the stack from being wrong.//DebugPrint((16, "ClasspScanForSpecialByInquiry: ""completed callback\n"));
return;
} // else the strings did not match
} // none of the devices matched.DebugPrint((1, "ClasspScanForSpecialByInquiry: no match found for %p\n",
FdoExtension->DeviceObject));
return;
} // end ClasspScanForSpecialByInquiry()
Generated on Sun May 27 2012 05:04:29 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.