From d25c13466afbbb6f6a48d098302a3f6e9592ca60 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Thu, 30 Apr 2020 01:01:40 +0300 Subject: [PATCH 1/2] Break code style --- drivers/usb/usbstor/usbstor.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbstor/usbstor.c b/drivers/usb/usbstor/usbstor.c index 75dee31605..1497df6470 100644 --- a/drivers/usb/usbstor/usbstor.c +++ b/drivers/usb/usbstor/usbstor.c @@ -192,11 +192,8 @@ DriverEntry( DPRINT("********* USB Storage *********\n"); - DriverObject->DriverUnload = USBSTOR_Unload; - DriverObject->DriverExtension->AddDevice = USBSTOR_AddDevice; - DriverObject->DriverStartIo = USBSTOR_StartIo; - DriverObject->MajorFunction[IRP_MJ_CREATE] = USBSTOR_DispatchClose; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBSTOR_DispatchClose; + if(1) + DriverObject->DriverUnload = USBSTOR_Unload; DriverObject->DriverExtension->AddDevice = USBSTOR_AddDevice; DriverObject->DriverStartIo = USBSTOR_StartIo; DriverObject->MajorFunction[IRP_MJ_CREATE] = USBSTOR_DispatchClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = USBSTOR_DispatchClose; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = USBSTOR_DispatchDeviceControl; // scsi pass through requests DriverObject->MajorFunction[IRP_MJ_READ] = USBSTOR_DispatchReadWrite; DriverObject->MajorFunction[IRP_MJ_WRITE] = USBSTOR_DispatchReadWrite; From bf25ee436455941e84f7d9380b01151bba5447d9 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Thu, 30 Apr 2020 01:51:23 +0300 Subject: [PATCH 2/2] Update usbstor.c --- drivers/usb/usbstor/usbstor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/usbstor/usbstor.c b/drivers/usb/usbstor/usbstor.c index 1497df6470..4276d81ad5 100644 --- a/drivers/usb/usbstor/usbstor.c +++ b/drivers/usb/usbstor/usbstor.c @@ -197,10 +197,7 @@ DriverEntry( DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = USBSTOR_DispatchDeviceControl; // scsi pass through requests DriverObject->MajorFunction[IRP_MJ_READ] = USBSTOR_DispatchReadWrite; DriverObject->MajorFunction[IRP_MJ_WRITE] = USBSTOR_DispatchReadWrite; - DriverObject->MajorFunction[IRP_MJ_SCSI] = USBSTOR_DispatchScsi; - DriverObject->MajorFunction[IRP_MJ_PNP] = USBSTOR_DispatchPnp; - DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBSTOR_DispatchSystemControl; - DriverObject->MajorFunction[IRP_MJ_POWER] = USBSTOR_DispatchPower; + DriverObject->MajorFunction[IRP_MJ_SCSI] = USBSTOR_DispatchScsi; DriverObject->MajorFunction[IRP_MJ_PNP] = USBSTOR_DispatchPnp; DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = USBSTOR_DispatchSystemControl; DriverObject->MajorFunction[IRP_MJ_POWER] = USBSTOR_DispatchPower; return STATUS_SUCCESS; }