[libbus/pnp] Add check for NULL QueryDevText member
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 07:44:01 +0000 (02:44 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sat, 8 Jan 2011 07:44:01 +0000 (02:44 -0500)
src/winvblock/libbus/pnp.c

index 9b74b6d..4b04e7f 100644 (file)
@@ -323,7 +323,9 @@ WVL_M_LIB NTSTATUS STDCALL WvlBusPnp(
     switch (code) {
         case IRP_MN_QUERY_DEVICE_TEXT:
           DBG("IRP_MN_QUERY_DEVICE_TEXT\n");
-          return Bus->QueryDevText(Bus, Irp);
+          if (Bus->QueryDevText)
+            return Bus->QueryDevText(Bus, Irp);
+          return WvlIrpComplete(Irp, 0, STATUS_NOT_SUPPORTED);
 
         case IRP_MN_QUERY_BUS_INFORMATION:
           DBG("IRP_MN_QUERY_BUS_INFORMATION\n");