mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 20:34:59 +00:00
[COMPBATT] Use the allocated battery IRPs as tags when acquiring I/O remove lock
This commit is contained in:
parent
95f062bf0d
commit
c944116833
1 changed files with 6 additions and 6 deletions
|
@ -261,7 +261,7 @@ CompBattGetBatteryInformation(
|
||||||
{
|
{
|
||||||
/* Try to acquire the remove lock */
|
/* Try to acquire the remove lock */
|
||||||
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
|
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
|
||||||
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, 0)))
|
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp)))
|
||||||
{
|
{
|
||||||
/* Now release the device lock since the battery can't go away */
|
/* Now release the device lock since the battery can't go away */
|
||||||
ExReleaseFastMutex(&DeviceExtension->Lock);
|
ExReleaseFastMutex(&DeviceExtension->Lock);
|
||||||
|
@ -292,7 +292,7 @@ CompBattGetBatteryInformation(
|
||||||
/* Fail if the query had a problem */
|
/* Fail if the query had a problem */
|
||||||
if (Status == STATUS_DEVICE_REMOVED) Status = STATUS_NO_SUCH_DEVICE;
|
if (Status == STATUS_DEVICE_REMOVED) Status = STATUS_NO_SUCH_DEVICE;
|
||||||
ExAcquireFastMutex(&DeviceExtension->Lock);
|
ExAcquireFastMutex(&DeviceExtension->Lock);
|
||||||
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
|
IoReleaseRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ CompBattGetBatteryInformation(
|
||||||
|
|
||||||
/* Re-acquire the device extension lock and release the remove lock */
|
/* Re-acquire the device extension lock and release the remove lock */
|
||||||
ExAcquireFastMutex(&DeviceExtension->Lock);
|
ExAcquireFastMutex(&DeviceExtension->Lock);
|
||||||
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
|
IoReleaseRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Next entry */
|
/* Next entry */
|
||||||
|
@ -421,7 +421,7 @@ CompBattGetBatteryGranularity(
|
||||||
{
|
{
|
||||||
/* Try to acquire the remove lock */
|
/* Try to acquire the remove lock */
|
||||||
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
|
BatteryData = CONTAINING_RECORD(NextEntry, COMPBATT_BATTERY_DATA, BatteryLink);
|
||||||
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, 0)))
|
if (NT_SUCCESS(IoAcquireRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp)))
|
||||||
{
|
{
|
||||||
/* Now release the device lock since the battery can't go away */
|
/* Now release the device lock since the battery can't go away */
|
||||||
ExReleaseFastMutex(&DeviceExtension->Lock);
|
ExReleaseFastMutex(&DeviceExtension->Lock);
|
||||||
|
@ -447,7 +447,7 @@ CompBattGetBatteryGranularity(
|
||||||
{
|
{
|
||||||
/* Fail if the query had a problem */
|
/* Fail if the query had a problem */
|
||||||
ExAcquireFastMutex(&DeviceExtension->Lock);
|
ExAcquireFastMutex(&DeviceExtension->Lock);
|
||||||
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
|
IoReleaseRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ CompBattGetBatteryGranularity(
|
||||||
|
|
||||||
/* Re-acquire the device extension lock and release the remove lock */
|
/* Re-acquire the device extension lock and release the remove lock */
|
||||||
ExAcquireFastMutex(&DeviceExtension->Lock);
|
ExAcquireFastMutex(&DeviceExtension->Lock);
|
||||||
IoReleaseRemoveLock(&BatteryData->RemoveLock, 0);
|
IoReleaseRemoveLock(&BatteryData->RemoveLock, BatteryData->Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Next entry */
|
/* Next entry */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue