X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=drivers%2Ffilters%2Fmountmgr%2Fmountmgr.c;h=229a00a28deb976ce899ea1a06fb62055c83c3cf;hp=ac40c149199f1b8aee8e79cbf432aa672141d0c0;hb=f77f05cd9df0b7d4844d5879e5b1193c6b9e647c;hpb=35f0f5f497e91c98c296340b26591b34b6fe48e2 diff --git a/drivers/filters/mountmgr/mountmgr.c b/drivers/filters/mountmgr/mountmgr.c index ac40c149199..229a00a28de 100644 --- a/drivers/filters/mountmgr/mountmgr.c +++ b/drivers/filters/mountmgr/mountmgr.c @@ -34,14 +34,14 @@ /* FIXME */ GUID MountedDevicesGuid = {0x53F5630D, 0xB6BF, 0x11D0, {0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B}}; +PDEVICE_OBJECT gdeviceObject; KEVENT UnloadEvent; LONG Unloading; -PWSTR Cunc = L"\\??\\C:"; +static const WCHAR Cunc[] = L"\\??\\C:"; /* * TODO: - * - DeleteRemoteDatabaseEntry * - MountMgrQueryDosVolumePath * - MountMgrQueryDosVolumePaths * - MountMgrQueryVolumePaths @@ -132,7 +132,7 @@ CreateNewDriveLetterName(OUT PUNICODE_STRING DriveLetter, IN UCHAR Letter, IN PMOUNTDEV_UNIQUE_ID UniqueId OPTIONAL) { - NTSTATUS Status; + NTSTATUS Status = STATUS_UNSUCCESSFUL; /* Allocate a big enough buffer to contain the symbolic link */ DriveLetter->MaximumLength = sizeof(DosDevices.Buffer) + 3 * sizeof(WCHAR); @@ -241,7 +241,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; } @@ -276,12 +276,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); @@ -323,12 +323,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); @@ -362,12 +362,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); @@ -393,8 +393,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; } @@ -420,7 +420,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); @@ -438,8 +438,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName, Name = AllocatePool(Size); if (!Name) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -465,7 +465,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); @@ -525,15 +525,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); @@ -551,8 +551,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName, Id = AllocatePool(Size); if (!Id) { - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return STATUS_INSUFFICIENT_RESOURCES; } @@ -578,7 +578,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); @@ -623,15 +623,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); @@ -641,8 +641,8 @@ QueryDeviceInformation(IN PUNICODE_STRING SymbolicName, *HasGuid = NT_SUCCESS(Status); } - ObfDereferenceObject(DeviceObject); - ObfDereferenceObject(FileObject); + ObDereferenceObject(DeviceObject); + ObDereferenceObject(FileObject); return Status; } @@ -908,7 +908,7 @@ MountMgrUnload(IN struct _DRIVER_OBJECT *DriverObject) /* * @implemented */ -ULONG +BOOLEAN MountmgrReadNoAutoMount(IN PUNICODE_STRING RegistryPath) { NTSTATUS Status; @@ -932,10 +932,10 @@ MountmgrReadNoAutoMount(IN PUNICODE_STRING RegistryPath) NULL); if (!NT_SUCCESS(Status)) { - return Default; + return (Default != 0); } - return Result; + return (Result != 0); } /* @@ -1010,7 +1010,7 @@ MountMgrMountedDeviceArrival(IN PDEVICE_EXTENSION DeviceExtension, if (RtlEqualUnicodeString(&(DeviceInformation->SymbolicName), &(CurrentDevice->SymbolicName), TRUE)) { - break; + break; } } @@ -1055,7 +1055,7 @@ MountMgrMountedDeviceArrival(IN PDEVICE_EXTENSION DeviceExtension, /* If it's OK, set it and save its letter (if any) */ if (SuggestedLinkName.Buffer && IsDriveLetter(&SuggestedLinkName)) { - DeviceInformation->SuggestedDriveLetter = SuggestedLinkName.Buffer[LETTER_POSITION]; + DeviceInformation->SuggestedDriveLetter = (UCHAR)SuggestedLinkName.Buffer[LETTER_POSITION]; } /* Acquire driver exclusively */ @@ -1070,7 +1070,7 @@ MountMgrMountedDeviceArrival(IN PDEVICE_EXTENSION DeviceExtension, if (RtlEqualUnicodeString(&(DeviceInformation->DeviceName), &TargetDeviceName, TRUE)) { - break; + break; } } @@ -1684,6 +1684,7 @@ MountMgrCreateClose(IN PDEVICE_OBJECT DeviceObject, * @implemented */ VOID +NTAPI MountMgrCancel(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { @@ -1693,7 +1694,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); } /*