- Stop using ObfXXX and IofXXX in C code. This is bad style. Always use the non-f versions in C code.

- Fix the way we undefined IoCallDriver and IoCompleteRequest so existing and future code in irp.c will use the correct function when using the Io* versions.
Part 1 of 2.

svn path=/trunk/; revision=56060
This commit is contained in:
Stefan Ginsberg 2012-03-05 20:43:47 +00:00
parent 44ea840535
commit 5001cb2608
17 changed files with 108 additions and 106 deletions

View file

@ -258,7 +258,7 @@ CmBattUnload(IN PDRIVER_OBJECT DriverObject)
{
/* Get rid of it */
ExUnregisterCallback(CmBattPowerCallBackRegistration);
ObfDereferenceObject(CmBattPowerCallBackObject);
ObDereferenceObject(CmBattPowerCallBackObject);
}
/* Free the registry buffer if it exists */
@ -339,7 +339,7 @@ Complete:
/* Release lock and complete request */
ExReleaseFastMutex(&DeviceExtension->FastMutex);
Irp->IoStatus.Status = Status;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
@ -361,7 +361,7 @@ CmBattIoctl(IN PDEVICE_OBJECT DeviceObject,
{
/* It's too late, fail */
Irp->IoStatus.Status = STATUS_DEVICE_REMOVED;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_DEVICE_REMOVED;
}
@ -514,7 +514,7 @@ CmBattIoctl(IN PDEVICE_OBJECT DeviceObject,
{
/* Complete the request */
Irp->IoStatus.Status = Status;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
else
{
@ -1312,7 +1312,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
}
else
{
ObfDereferenceObject(CmBattPowerCallBackObject);
ObDereferenceObject(CmBattPowerCallBackObject);
if (CmBattDebug & CMBATT_GENERIC_WARNING)
DbgPrint("CmBattRegisterPowerCallBack: ExRegisterCallback failed.\n");
}

View file

@ -250,7 +250,7 @@ CmBattPowerDispatch(IN PDEVICE_OBJECT DeviceObject,
{
/* Complete the request here */
Status = Irp->IoStatus.Status;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* Return status */
@ -281,7 +281,7 @@ CmBattPnpDispatch(IN PDEVICE_OBJECT DeviceObject,
{
/* Complete the request */
Irp->IoStatus.Status = STATUS_DEVICE_REMOVED;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_DEVICE_REMOVED;
}
@ -485,7 +485,7 @@ CmBattPnpDispatch(IN PDEVICE_OBJECT DeviceObject,
}
/* Release the remove lock and complete the request */
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp);
return Status;
@ -514,7 +514,7 @@ CmBattPnpDispatch(IN PDEVICE_OBJECT DeviceObject,
{
/* Complete the request */
Status = Irp->IoStatus.Status;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* Release the remove lock and return status */

View file

@ -161,7 +161,7 @@ CmBattSystemControl(IN PDEVICE_OBJECT DeviceObject,
{
/* It's too late, fail */
Irp->IoStatus.Status = STATUS_DEVICE_REMOVED;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_DEVICE_REMOVED;
}
@ -192,7 +192,7 @@ CmBattSystemControl(IN PDEVICE_OBJECT DeviceObject,
/* Complete it here */
if (CmBattDebug & 2) DbgPrint("CmBatt: SystemControl: Irp Not Completed.\n");
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
break;
case IrpForward:

View file

@ -43,7 +43,7 @@ BatteryIoctl(IN ULONG IoControlCode,
if (Irp)
{
/* Call the class driver miniport */
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
/* Wait for result */

View file

@ -145,8 +145,8 @@ CompBattAddNewBattery(IN PUNICODE_STRING BatteryName,
if (NT_SUCCESS(Status))
{
/* Reference the DO and drop the FO */
ObfReferenceObject(BatteryData->DeviceObject);
ObfDereferenceObject(FileObject);
ObReferenceObject(BatteryData->DeviceObject);
ObDereferenceObject(FileObject);
/* Allocate the battery IRP */
Irp = IoAllocateIrp(BatteryData->DeviceObject->StackSize + 1, 0);
@ -187,7 +187,7 @@ CompBattAddNewBattery(IN PUNICODE_STRING BatteryName,
if (CompBattDebug & 8)
DbgPrint("CompBatt: Couldn't allocate new battery Irp\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
ObfDereferenceObject(BatteryData->DeviceObject);
ObDereferenceObject(BatteryData->DeviceObject);
}
}
else if (CompBattDebug & 8)
@ -227,7 +227,7 @@ CompBattRemoveBattery(IN PCUNICODE_STRING BatteryName,
if (BatteryData)
{
/* Dereference and free it */
ObfDereferenceObject(BatteryData->DeviceObject);
ObDereferenceObject(BatteryData->DeviceObject);
ExFreePool(BatteryData);
/* Notify class driver */

View file

@ -49,7 +49,7 @@ PciCallDownIrpStack(IN PPCI_FDO_EXTENSION DeviceExtension,
IoSetCompletionRoutine(Irp, PciSetEventCompletion, &Event, TRUE, TRUE, TRUE);
/* Call the attached device */
Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
if (Status == STATUS_PENDING)
{
/* Wait for it to complete the request, and get its status */
@ -83,7 +83,7 @@ PciPassIrpFromFdoToPdo(IN PPCI_FDO_EXTENSION DeviceExtension,
{
/* For a normal IRP, just call the next driver in the stack */
IoSkipCurrentIrpStackLocation(Irp);
Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
}
/* Return the status back to the caller */
@ -245,7 +245,7 @@ PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject,
if (IoStackLocation->MajorFunction == IRP_MJ_POWER) PoStartNextPowerIrp(Irp);
/* And now this IRP can be completed */
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* And the status returned back to the caller */

View file

@ -2130,7 +2130,7 @@ PciQueryDeviceRelations(IN PPCI_FDO_EXTENSION DeviceExtension,
{
/* Reference it and add it to the array */
DeviceObject = PdoExtension->PhysicalDeviceObject;
ObfReferenceObject(DeviceObject);
ObReferenceObject(DeviceObject);
*ObjectArray++ = DeviceObject;
}

View file

@ -205,12 +205,12 @@ PciQueryForPciBusInterface(IN PPCI_FDO_EXTENSION FdoExtension)
}
/* Dereference the device object because we took a reference earlier */
ObfDereferenceObject(AttachedDevice);
ObDereferenceObject(AttachedDevice);
}
else
{
/* Failure path, dereference the device object and set failure code */
if (AttachedDevice) ObfDereferenceObject(AttachedDevice);
if (AttachedDevice) ObDereferenceObject(AttachedDevice);
ExFreePoolWithTag(PciInterface, 0);
Status = STATUS_INSUFFICIENT_RESOURCES;
}

View file

@ -353,12 +353,12 @@ IsFtVolume(IN PUNICODE_STRING SymbolicName)
/* FT volume can't be removable */
if (FileDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return FALSE;
}
ObfDereferenceObject(FileObject);
ObDereferenceObject(FileObject);
/* Get partition information */
KeInitializeEvent(&Event, NotificationEvent, FALSE);
@ -373,18 +373,18 @@ IsFtVolume(IN PUNICODE_STRING SymbolicName)
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
return FALSE;
}
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = IoStatusBlock.Status;
}
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
if (!NT_SUCCESS(Status))
{
return FALSE;
@ -1449,7 +1449,7 @@ Cleanup:
if (FOReferenced)
{
ObfDereferenceObject(FileObject);
ObDereferenceObject(FileObject);
}
return Status;
@ -1596,7 +1596,7 @@ MountMgrDeviceControl(IN PDEVICE_OBJECT DeviceObject,
Complete:
Irp->IoStatus.Status = Status;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}

View file

@ -240,7 +240,7 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
/* The associate FO can't have a file name */
if (FileObject->FileName.Length)
{
ObfDereferenceObject(FileObject);
ObDereferenceObject(FileObject);
return STATUS_OBJECT_NAME_NOT_FOUND;
}
@ -275,12 +275,12 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -322,12 +322,12 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -361,12 +361,12 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -392,8 +392,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Name = AllocatePool(sizeof(MOUNTDEV_NAME));
if (!Name)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -419,7 +419,7 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -437,8 +437,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Name = AllocatePool(Size);
if (!Name)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -464,7 +464,7 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -524,15 +524,15 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
if (!Irp)
{
FreePool(Id);
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -550,8 +550,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Id = AllocatePool(Size);
if (!Id)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
@ -577,7 +577,7 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -622,15 +622,15 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -640,8 +640,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName,
*HasGuid = NT_SUCCESS(Status);
}
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return Status;
}
@ -1693,7 +1693,7 @@ MountMgrCancel(IN PDEVICE_OBJECT DeviceObject,
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_CANCELLED;
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/*

View file

@ -75,15 +75,15 @@ SendOnlineNotification(IN PUNICODE_STRING SymbolicName)
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
}
Cleanup:
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return;
}
@ -301,7 +301,7 @@ RegisterForTargetDeviceNotification(IN PDEVICE_EXTENSION DeviceExtension,
DeviceInformation->TargetDeviceNotificationEntry = NULL;
}
ObfDereferenceObject(FileObject);
ObDereferenceObject(FileObject);
return;
}
@ -341,7 +341,7 @@ MountMgrNotify(IN PDEVICE_EXTENSION DeviceExtension)
*((PULONG)Irp->AssociatedIrp.SystemBuffer) = DeviceExtension->EpicNumber;
Irp->IoStatus.Information = sizeof(DeviceExtension->EpicNumber);
IofCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
}
@ -412,8 +412,8 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension,
&IoStatusBlock);
if (!Irp)
{
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
}
Stack = IoGetNextIrpStackLocation(Irp);
@ -428,15 +428,15 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension,
Stack->FileObject = FileObject;
/* And call driver */
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = IoStatusBlock.Status;
}
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
if (!NT_SUCCESS(Status))
{
@ -466,7 +466,7 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension,
&DeviceNotification,
NULL, NULL);
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
return;
}
@ -609,8 +609,8 @@ IssueUniqueIdChangeNotifyWorker(IN PUNIQUE_ID_WORK_ITEM WorkItem,
if (InterlockedExchange((PLONG)&(WorkItem->Event), 0) != 0)
{
ObfDereferenceObject(FileObject);
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
RemoveWorkItem(WorkItem);
return;
}
@ -634,16 +634,16 @@ IssueUniqueIdChangeNotifyWorker(IN PUNIQUE_ID_WORK_ITEM WorkItem,
TRUE, TRUE, TRUE);
if (!NT_SUCCESS(Status))
{
ObfDereferenceObject(FileObject);
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
RemoveWorkItem(WorkItem);
return;
}
/* Call the driver */
IofCallDriver(DeviceObject, Irp);
ObfDereferenceObject(FileObject);
ObfDereferenceObject(DeviceObject);
IoCallDriver(DeviceObject, Irp);
ObDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
}
/*
@ -673,13 +673,13 @@ IssueUniqueIdChangeNotify(IN PDEVICE_EXTENSION DeviceExtension,
/* And then, get attached device */
DeviceObject = IoGetAttachedDeviceReference(FileObject->DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(FileObject);
/* Allocate a work item */
WorkItem = AllocatePool(sizeof(UNIQUE_ID_WORK_ITEM));
if (!WorkItem)
{
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
return;
}
@ -687,7 +687,7 @@ IssueUniqueIdChangeNotify(IN PDEVICE_EXTENSION DeviceExtension,
WorkItem->WorkItem = IoAllocateWorkItem(DeviceExtension->DeviceObject);
if (!WorkItem->WorkItem)
{
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
goto Cleanup;
}
@ -696,7 +696,7 @@ IssueUniqueIdChangeNotify(IN PDEVICE_EXTENSION DeviceExtension,
/* Already provide the IRP */
WorkItem->Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
if (!WorkItem->Irp)
{

View file

@ -218,7 +218,7 @@ SendLinkCreated(IN PUNICODE_STRING SymbolicName)
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -245,7 +245,7 @@ SendLinkCreated(IN PUNICODE_STRING SymbolicName)
Stack->FileObject = FileObject;
/* Really notify */
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -257,8 +257,8 @@ Cleanup:
FreePool(Name);
}
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return;
}
@ -322,7 +322,7 @@ SendLinkDeleted(IN PUNICODE_STRING DeviceName,
Stack = IoGetNextIrpStackLocation(Irp);
Stack->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -349,7 +349,7 @@ SendLinkDeleted(IN PUNICODE_STRING DeviceName,
Stack->FileObject = FileObject;
/* Really notify */
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
@ -361,8 +361,8 @@ Cleanup:
FreePool(Name);
}
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return;
}
@ -740,7 +740,7 @@ QuerySuggestedLinkName(IN PUNICODE_STRING SymbolicName,
IoStackLocation->FileObject = FileObject;
/* And ask */
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode,
@ -782,7 +782,7 @@ QuerySuggestedLinkName(IN PUNICODE_STRING SymbolicName,
IoStackLocation = IoGetNextIrpStackLocation(Irp);
IoStackLocation->FileObject = FileObject;
Status = IofCallDriver(DeviceObject, Irp);
Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING)
{
KeWaitForSingleObject(&Event, Executive, KernelMode,
@ -817,8 +817,8 @@ Release:
FreePool(IoCtlSuggested);
Dereference:
ObfDereferenceObject(DeviceObject);
ObfDereferenceObject(FileObject);
ObDereferenceObject(DeviceObject);
ObDereferenceObject(FileObject);
return Status;
}

View file

@ -253,7 +253,7 @@ HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject,
{
/* Save our own PDO and reference it */
*ObjectEntry++ = PdoExtension->PhysicalDeviceObject;
ObfReferenceObject(PdoExtension->PhysicalDeviceObject);
ObReferenceObject(PdoExtension->PhysicalDeviceObject);
/* Go to our next PDO */
PdoExtension = PdoExtension->Next;
@ -281,7 +281,7 @@ HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject,
/* Fill it out and reference us */
PdoRelations->Count = 1;
PdoRelations->Objects[0] = DeviceObject;
ObfReferenceObject(DeviceObject);
ObReferenceObject(DeviceObject);
/* Return it */
*DeviceRelations = PdoRelations;

View file

@ -245,7 +245,7 @@ HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject,
{
/* Save our own PDO and reference it */
*ObjectEntry++ = PdoExtension->PhysicalDeviceObject;
ObfReferenceObject(PdoExtension->PhysicalDeviceObject);
ObReferenceObject(PdoExtension->PhysicalDeviceObject);
/* Go to our next PDO */
PdoExtension = PdoExtension->Next;
@ -273,7 +273,7 @@ HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject,
/* Fill it out and reference us */
PdoRelations->Count = 1;
PdoRelations->Objects[0] = DeviceObject;
ObfReferenceObject(DeviceObject);
ObReferenceObject(DeviceObject);
/* Return it */
*DeviceRelations = PdoRelations;

View file

@ -200,7 +200,7 @@ ReleaseAndComplete:
Completion:
IoMarkIrpPending(Irp);
Irp->IoStatus.Status = Status;
IofCompleteRequest(Irp, EVENT_INCREMENT);
IoCompleteRequest(Irp, EVENT_INCREMENT);
}
/*
@ -537,7 +537,7 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync,
{
IoMarkIrpPending(NotifyIrp);
NotifyIrp->IoStatus.Status = STATUS_NOTIFY_CLEANUP;
IofCompleteRequest(NotifyIrp, EVENT_INCREMENT);
IoCompleteRequest(NotifyIrp, EVENT_INCREMENT);
_SEH2_LEAVE;
}
@ -550,14 +550,14 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync,
{
IoMarkIrpPending(NotifyIrp);
NotifyIrp->IoStatus.Status = STATUS_NOTIFY_CLEANUP;
IofCompleteRequest(NotifyIrp, EVENT_INCREMENT);
IoCompleteRequest(NotifyIrp, EVENT_INCREMENT);
}
/* Or if it's about to be deleted, complete */
else if (NotifyChange->Flags & DELETE_IN_PROCESS)
{
IoMarkIrpPending(NotifyIrp);
NotifyIrp->IoStatus.Status = STATUS_DELETE_PENDING;
IofCompleteRequest(NotifyIrp, EVENT_INCREMENT);
IoCompleteRequest(NotifyIrp, EVENT_INCREMENT);
}
/* Complete if there is directory enumeration and no buffer available any more */
if ((NotifyChange->Flags & INVALIDATE_BUFFERS) && (NotifyChange->Flags & ENUMERATE_DIR))
@ -565,7 +565,7 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync,
NotifyChange->Flags &= ~INVALIDATE_BUFFERS;
IoMarkIrpPending(NotifyIrp);
NotifyIrp->IoStatus.Status = STATUS_NOTIFY_ENUM_DIR;
IofCompleteRequest(NotifyIrp, EVENT_INCREMENT);
IoCompleteRequest(NotifyIrp, EVENT_INCREMENT);
}
/* If no data yet, or directory enumeration, handle */
else if (NotifyChange->DataLength == 0 || (NotifyChange->Flags & ENUMERATE_DIR))

View file

@ -111,7 +111,7 @@ FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject,
Status = STATUS_SUCCESS;
}
ObfDereferenceObject(DeviceObject);
ObDereferenceObject(DeviceObject);
return Status;
}

View file

@ -14,10 +14,6 @@
#define NDEBUG
#include <debug.h>
/* Undefine some macros we implement here */
#undef IoCallDriver
#undef IoCompleteRequest
PIRP IopDeadIrp;
/* PRIVATE FUNCTIONS ********************************************************/
@ -1099,6 +1095,7 @@ IoCancelThreadIo(IN PETHREAD Thread)
/*
* @implemented
*/
#undef IoCallDriver
NTSTATUS
NTAPI
IoCallDriver(IN PDEVICE_OBJECT DeviceObject,
@ -1108,9 +1105,12 @@ IoCallDriver(IN PDEVICE_OBJECT DeviceObject,
return IofCallDriver(DeviceObject, Irp);
}
#define IoCallDriver IofCallDriver
/*
* @implemented
*/
#undef IoCompleteRequest
VOID
NTAPI
IoCompleteRequest(IN PIRP Irp,
@ -1120,6 +1120,8 @@ IoCompleteRequest(IN PIRP Irp,
IofCompleteRequest(Irp, PriorityBoost);
}
#define IoCompleteRequest IofCompleteRequest
/*
* @implemented
*/