mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: fix issues found by static analyzer
This commit is contained in:
parent
7f084787e3
commit
8fa337ae54
@ -70,7 +70,7 @@ FSP_FSEXT_PROVIDER *FspFsextProvider(UINT32 FsextControlCode, PNTSTATUS PLoadRes
|
|||||||
|
|
||||||
RtlInitEmptyUnicodeString(&Path, Buf, sizeof Buf);
|
RtlInitEmptyUnicodeString(&Path, Buf, sizeof Buf);
|
||||||
Result = RtlUnicodeStringPrintf(&Path,
|
Result = RtlUnicodeStringPrintf(&Path,
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%s", Value.V.Data);
|
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%s", (PWSTR)Value.V.Data);
|
||||||
ASSERT(NT_SUCCESS(Result));
|
ASSERT(NT_SUCCESS(Result));
|
||||||
|
|
||||||
Result = ZwLoadDriver(&Path);
|
Result = ZwLoadDriver(&Path);
|
||||||
|
@ -275,6 +275,7 @@ NTSTATUS FspMupHandleIrp(
|
|||||||
if (FspFileNodeIsValid(FileObject->FsContext))
|
if (FspFileNodeIsValid(FileObject->FsContext))
|
||||||
FsvolDeviceObject = ((FSP_FILE_NODE *)FileObject->FsContext)->FsvolDeviceObject;
|
FsvolDeviceObject = ((FSP_FILE_NODE *)FileObject->FsContext)->FsvolDeviceObject;
|
||||||
else if (0 != FileObject->FsContext2 &&
|
else if (0 != FileObject->FsContext2 &&
|
||||||
|
#pragma prefast(disable:28175, "We are a filesystem: ok to access DeviceObject->Type")
|
||||||
3 == ((PDEVICE_OBJECT)FileObject->FsContext2)->Type &&
|
3 == ((PDEVICE_OBJECT)FileObject->FsContext2)->Type &&
|
||||||
0 != ((PDEVICE_OBJECT)FileObject->FsContext2)->DeviceExtension &&
|
0 != ((PDEVICE_OBJECT)FileObject->FsContext2)->DeviceExtension &&
|
||||||
FspFsvolDeviceExtensionKind == FspDeviceExtension((PDEVICE_OBJECT)FileObject->FsContext2)->Kind)
|
FspFsvolDeviceExtensionKind == FspDeviceExtension((PDEVICE_OBJECT)FileObject->FsContext2)->Kind)
|
||||||
|
@ -350,9 +350,9 @@ NTSTATUS FspSendSetInformationIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT File
|
|||||||
IrpSp->Parameters.SetFile.FileInformationClass = FileInformationClass;
|
IrpSp->Parameters.SetFile.FileInformationClass = FileInformationClass;
|
||||||
IrpSp->Parameters.SetFile.Length = Length;
|
IrpSp->Parameters.SetFile.Length = Length;
|
||||||
|
|
||||||
|
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
||||||
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
||||||
|
|
||||||
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
|
||||||
Result = IoCallDriver(DeviceObject, Irp);
|
Result = IoCallDriver(DeviceObject, Irp);
|
||||||
if (STATUS_PENDING == Result)
|
if (STATUS_PENDING == Result)
|
||||||
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
||||||
@ -391,9 +391,9 @@ NTSTATUS FspSendQuerySecurityIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileO
|
|||||||
IrpSp->Parameters.QuerySecurity.SecurityInformation = SecurityInformation;
|
IrpSp->Parameters.QuerySecurity.SecurityInformation = SecurityInformation;
|
||||||
IrpSp->Parameters.QuerySecurity.Length = Length;
|
IrpSp->Parameters.QuerySecurity.Length = Length;
|
||||||
|
|
||||||
|
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
||||||
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
||||||
|
|
||||||
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
|
||||||
Result = IoCallDriver(DeviceObject, Irp);
|
Result = IoCallDriver(DeviceObject, Irp);
|
||||||
if (STATUS_PENDING == Result)
|
if (STATUS_PENDING == Result)
|
||||||
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
||||||
@ -433,9 +433,9 @@ NTSTATUS FspSendQueryEaIrp(PDEVICE_OBJECT DeviceObject, PFILE_OBJECT FileObject,
|
|||||||
IrpSp->Parameters.QueryEa.EaList = GetEa;
|
IrpSp->Parameters.QueryEa.EaList = GetEa;
|
||||||
IrpSp->Parameters.QueryEa.EaListLength = GetEaLength;
|
IrpSp->Parameters.QueryEa.EaListLength = GetEaLength;
|
||||||
|
|
||||||
|
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
||||||
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
IoSetCompletionRoutine(Irp, FspSendIrpCompletion, &Context, TRUE, TRUE, TRUE);
|
||||||
|
|
||||||
KeInitializeEvent(&Context.Event, NotificationEvent, FALSE);
|
|
||||||
Result = IoCallDriver(DeviceObject, Irp);
|
Result = IoCallDriver(DeviceObject, Irp);
|
||||||
if (STATUS_PENDING == Result)
|
if (STATUS_PENDING == Result)
|
||||||
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
KeWaitForSingleObject(&Context.Event, Executive, KernelMode, FALSE, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user