https://git.reactos.org/?p=reactos.git;a=commitdiff;h=42ce8519b6c46bc5143c6…
commit 42ce8519b6c46bc5143c6ff23603fdf2650b649f
Author: Bișoc George <fraizeraust99(a)gmail.com>
AuthorDate: Sat Jun 22 16:20:58 2019 +0200
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Jun 22 16:20:58 2019 +0200
[FASTFAT][FLTMGR][NTOS] Do not explicitly call ObfDereferenceObject() (#1636)
"Most code should not directly call the platform-specific ObfDereferenceObject()
function but use the ObDereferenceObject() macro instead."
CORE-16081
---
drivers/filesystems/fastfat/misc.c | 2 +-
drivers/filters/fltmgr/Interface.c | 8 ++++----
drivers/filters/fltmgr/Messaging.c | 10 +++++-----
ntoskrnl/fsrtl/oplock.c | 2 +-
ntoskrnl/io/iomgr/rawfs.c | 2 +-
ntoskrnl/ob/devicemap.c | 4 ++--
ntoskrnl/po/poshtdwn.c | 2 +-
ntoskrnl/ps/job.c | 2 +-
ntoskrnl/wmi/guidobj.c | 2 +-
9 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/filesystems/fastfat/misc.c b/drivers/filesystems/fastfat/misc.c
index f3054633c58..4f7bf5b7d4b 100644
--- a/drivers/filesystems/fastfat/misc.c
+++ b/drivers/filesystems/fastfat/misc.c
@@ -582,7 +582,7 @@ VfatCheckForDismount(
ExDeleteResourceLite(&DeviceExt->FatResource);
/* Dismount our device if possible */
- ObfDereferenceObject(DeviceExt->StorageDevice);
+ ObDereferenceObject(DeviceExt->StorageDevice);
IoDeleteDevice(DeviceExt->VolumeDevice);
}
diff --git a/drivers/filters/fltmgr/Interface.c b/drivers/filters/fltmgr/Interface.c
index 1ed7e7986e4..b412adec1f0 100644
--- a/drivers/filters/fltmgr/Interface.c
+++ b/drivers/filters/fltmgr/Interface.c
@@ -2005,7 +2005,7 @@ FltpDetachFromFileSystemDevice(_In_ PDEVICE_OBJECT DeviceObject)
NextDevice = IoGetLowerDeviceObject(AttachedDevice);
/* Remove the reference we added */
- Count = ObfDereferenceObject(AttachedDevice);
+ Count = ObDereferenceObject(AttachedDevice);
/* Bail if this is the last one */
if (NextDevice == NULL) return Count;
@@ -2028,7 +2028,7 @@ FltpDetachFromFileSystemDevice(_In_ PDEVICE_OBJECT DeviceObject)
IoDeleteDevice(AttachedDevice);
/* Remove the reference we added so the delete can complete */
- return ObfDereferenceObject(AttachedDevice);
+ return ObDereferenceObject(AttachedDevice);
}
DRIVER_FS_NOTIFICATION FltpFsNotification;
@@ -2143,7 +2143,7 @@ DriverEntry(_In_ PDRIVER_OBJECT DriverObject,
if (NT_SUCCESS(Status))
{
FltpFsNotification(RawDeviceObject, TRUE);
- ObfDereferenceObject(RawFileObject);
+ ObDereferenceObject(RawFileObject);
}
RtlInitUnicodeString(&ObjectName, L"\\Device\\RawCdRom");
@@ -2154,7 +2154,7 @@ DriverEntry(_In_ PDRIVER_OBJECT DriverObject,
if (NT_SUCCESS(Status))
{
FltpFsNotification(RawDeviceObject, TRUE);
- ObfDereferenceObject(RawFileObject);
+ ObDereferenceObject(RawFileObject);
}
/* We're done, clear the initializing flag */
diff --git a/drivers/filters/fltmgr/Messaging.c b/drivers/filters/fltmgr/Messaging.c
index d30292a5a3e..f4ed276eb4d 100644
--- a/drivers/filters/fltmgr/Messaging.c
+++ b/drivers/filters/fltmgr/Messaging.c
@@ -369,7 +369,7 @@ NTAPI
FltpClientPortDelete(PVOID Object)
{
PFLT_PORT_OBJECT PortObject = (PFLT_PORT_OBJECT)Object;
- ObfDereferenceObject(PortObject->ServerPort);
+ ObDereferenceObject(PortObject->ServerPort);
}
@@ -447,14 +447,14 @@ Quit:
if (ClientPortObjectType)
{
ObMakeTemporaryObject(ClientPortObjectType);
- ObfDereferenceObject(ClientPortObjectType);
+ ObDereferenceObject(ClientPortObjectType);
ClientPortObjectType = NULL;
}
if (ServerPortObjectType)
{
ObMakeTemporaryObject(ServerPortObjectType);
- ObfDereferenceObject(ServerPortObjectType);
+ ObDereferenceObject(ServerPortObjectType);
ServerPortObjectType = NULL;
}
}
@@ -737,7 +737,7 @@ Quit:
{
if (ClientPortObject)
{
- ObfDereferenceObject(ClientPortObject);
+ ObDereferenceObject(ClientPortObject);
}
if (PortHandle)
@@ -747,7 +747,7 @@ Quit:
else if (ServerPortObject)
{
InterlockedDecrement(&ServerPortObject->NumberOfConnections);
- ObfDereferenceObject(ServerPortObject);
+ ObDereferenceObject(ServerPortObject);
}
if (PortCCB)
diff --git a/ntoskrnl/fsrtl/oplock.c b/ntoskrnl/fsrtl/oplock.c
index f89adc465cd..f4c38d37d2c 100644
--- a/ntoskrnl/fsrtl/oplock.c
+++ b/ntoskrnl/fsrtl/oplock.c
@@ -454,7 +454,7 @@ FsRtlAcknowledgeOplockBreak(IN PINTERNAL_OPLOCK Oplock,
/* If we dropped oplock, remove our extra ref */
if (Deref)
{
- ObfDereferenceObject(Oplock->FileObject);
+ ObDereferenceObject(Oplock->FileObject);
}
/* And unset FO: no oplock left or shared */
Oplock->FileObject = NULL;
diff --git a/ntoskrnl/io/iomgr/rawfs.c b/ntoskrnl/io/iomgr/rawfs.c
index de3a90f1b81..e653131f5a2 100644
--- a/ntoskrnl/io/iomgr/rawfs.c
+++ b/ntoskrnl/io/iomgr/rawfs.c
@@ -148,7 +148,7 @@ RawCheckForDismount(IN PVCB Vcb,
}
/* Dismount our device if possible */
- ObfDereferenceObject(Vcb->TargetDeviceObject);
+ ObDereferenceObject(Vcb->TargetDeviceObject);
IoDeleteDevice((PDEVICE_OBJECT)CONTAINING_RECORD(Vcb,
VOLUME_DEVICE_OBJECT,
Vcb));
diff --git a/ntoskrnl/ob/devicemap.c b/ntoskrnl/ob/devicemap.c
index 5d583e9388b..0c54f6995b8 100644
--- a/ntoskrnl/ob/devicemap.c
+++ b/ntoskrnl/ob/devicemap.c
@@ -130,7 +130,7 @@ ObSetDeviceMap(IN PEPROCESS Process,
/* Release useless device map if required */
if (NewDeviceMap != NULL)
{
- ObfDereferenceObject(DirectoryObject);
+ ObDereferenceObject(DirectoryObject);
ExFreePoolWithTag(NewDeviceMap, 'mDbO');
}
@@ -235,7 +235,7 @@ ObSetDirectoryDeviceMap(OUT PDEVICE_MAP * DeviceMap,
/* Release useless device map if required */
if (NewDeviceMap != NULL)
{
- ObfDereferenceObject(DirectoryObject);
+ ObDereferenceObject(DirectoryObject);
ExFreePoolWithTag(NewDeviceMap, 'mDbO');
}
diff --git a/ntoskrnl/po/poshtdwn.c b/ntoskrnl/po/poshtdwn.c
index 8a33157fd0d..dd9bcc2dbb4 100644
--- a/ntoskrnl/po/poshtdwn.c
+++ b/ntoskrnl/po/poshtdwn.c
@@ -135,7 +135,7 @@ PopProcessShutDownLists(VOID)
/* Wait for the thread to finish and dereference it */
KeWaitForSingleObject(ShutDownWaitEntry->Thread, 0, 0, 0, 0);
- ObfDereferenceObject(ShutDownWaitEntry->Thread);
+ ObDereferenceObject(ShutDownWaitEntry->Thread);
/* Finally free the entry */
ExFreePoolWithTag(ShutDownWaitEntry, 'LSoP');
diff --git a/ntoskrnl/ps/job.c b/ntoskrnl/ps/job.c
index f37de8bbb07..cb7de5115d9 100644
--- a/ntoskrnl/ps/job.c
+++ b/ntoskrnl/ps/job.c
@@ -836,7 +836,7 @@ NtSetInformationJobObject (
}
KeLeaveGuardedRegionThread(CurrentThread);
- ObfDereferenceObject(Job);
+ ObDereferenceObject(Job);
return Status;
}
diff --git a/ntoskrnl/wmi/guidobj.c b/ntoskrnl/wmi/guidobj.c
index 06f350ab797..1a13d36a03c 100644
--- a/ntoskrnl/wmi/guidobj.c
+++ b/ntoskrnl/wmi/guidobj.c
@@ -247,7 +247,7 @@ WmipOpenGuidObject(
if (!NT_SUCCESS(Status))
{
DPRINT1("ObOpenObjectByPointer failed: 0x%lx\n", Status);
- ObfDereferenceObject(GuidObject);
+ ObDereferenceObject(GuidObject);
GuidObject = NULL;
}