https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b0c931ac912657c84e891…
commit b0c931ac912657c84e89133232544c83c8d71b01
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sun Jan 10 04:43:44 2021 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Wed Jan 27 05:15:16 2021 +0300
[PARTMGR] Remove hacks as PnP manager should not send bogus IRPs anymore
---
drivers/storage/partmgr/partition.c | 23 -----------------------
drivers/storage/partmgr/partmgr.c | 11 -----------
drivers/storage/partmgr/partmgr.h | 1 -
3 files changed, 35 deletions(-)
diff --git a/drivers/storage/partmgr/partition.c b/drivers/storage/partmgr/partition.c
index 694836d3ae0..3ce6ab7873c 100644
--- a/drivers/storage/partmgr/partition.c
+++ b/drivers/storage/partmgr/partition.c
@@ -94,13 +94,6 @@ PartitionHandleStartDevice(
{
PAGED_CODE();
- // fix the damn kernel!
- if (PartExt->DeviceRemoved)
- {
- DPRINT1("IRP_MN_START_DEVICE after IRP_MN_REMOVE_DEVICE!\n");
- return STATUS_SUCCESS;
- }
-
// first, create a symbolic link for our device
WCHAR nameBuf[64];
UNICODE_STRING partitionSymlink, interfaceName;
@@ -235,15 +228,6 @@ PartitionHandleRemove(
if (FinalRemove)
{
- // fix the damn kernel!
- if (PartExt->DeviceRemoved)
- {
- DPRINT1("Double IRP_MN_REMOVE_DEVICE!\n");
- return STATUS_SUCCESS;
- }
-
- PartExt->DeviceRemoved = TRUE;
-
ASSERT(PartExt->DeviceName.Buffer);
if (PartExt->DeviceName.Buffer)
{
@@ -266,13 +250,6 @@ PartitionHandleDeviceRelations(
{
PAGED_CODE();
- // fix the damn kernel!
- if (PartExt->DeviceRemoved)
- {
- DPRINT1("QDR after device removal!\n");
- return STATUS_DEVICE_DOES_NOT_EXIST;
- }
-
PIO_STACK_LOCATION ioStack = IoGetCurrentIrpStackLocation(Irp);
DEVICE_RELATION_TYPE type = ioStack->Parameters.QueryDeviceRelations.Type;
diff --git a/drivers/storage/partmgr/partmgr.c b/drivers/storage/partmgr/partmgr.c
index 75ca8451137..36c09f26bea 100644
--- a/drivers/storage/partmgr/partmgr.c
+++ b/drivers/storage/partmgr/partmgr.c
@@ -1017,17 +1017,6 @@ FdoHandleRemoveDevice(
{
PAGED_CODE();
- for (PSINGLE_LIST_ENTRY curEntry = FdoExtension->PartitionList.Next;
- curEntry != NULL;
- curEntry = curEntry->Next)
- {
- PPARTITION_EXTENSION partExt = CONTAINING_RECORD(curEntry,
- PARTITION_EXTENSION,
- ListEntry);
-
- ASSERT(partExt->DeviceRemoved);
- }
-
if (FdoExtension->DiskInterfaceName.Buffer)
{
IoSetDeviceInterfaceState(&FdoExtension->DiskInterfaceName, FALSE);
diff --git a/drivers/storage/partmgr/partmgr.h b/drivers/storage/partmgr/partmgr.h
index 28d350c5363..2878942629a 100644
--- a/drivers/storage/partmgr/partmgr.h
+++ b/drivers/storage/partmgr/partmgr.h
@@ -77,7 +77,6 @@ typedef struct _PARTITION_EXTENSION
UINT32 OnDiskNumber; // partition number for issuing Io requests to the kernel
BOOLEAN IsEnumerated; // reported via IRP_MN_QUERY_DEVICE_RELATIONS
BOOLEAN SymlinkCreated;
- BOOLEAN DeviceRemoved; // !!!
BOOLEAN Attached; // attached to PartitionList of the FDO
union
{