Skip to content

Commit

Permalink
handle status other than STATUS_PENDING from FsRtlCheckOplock()
Browse files Browse the repository at this point in the history
  • Loading branch information
bailey27 committed Jul 5, 2016
1 parent 9527353 commit 0c64b84
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
8 changes: 6 additions & 2 deletions sys/cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ Return Value:
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(eventContext);
}
__leave;
}

Expand Down
8 changes: 6 additions & 2 deletions sys/fileinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,12 @@ DokanDispatchSetInformation(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(eventContext);
}
__leave;
}

Expand Down
8 changes: 6 additions & 2 deletions sys/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ DokanDispatchFlush(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(eventContext);
}
__leave;
}

Expand Down
8 changes: 6 additions & 2 deletions sys/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ Return Value:
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(eventContext);
}
__leave;
}

Expand Down
18 changes: 14 additions & 4 deletions sys/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ DokanDispatchWrite(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(eventContext);
}
__leave;
}
}
Expand Down Expand Up @@ -248,8 +252,14 @@ DokanDispatchWrite(__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp) {
// if FsRtlCheckOplock returns STATUS_PENDING the IRP has been posted
// to service an oplock break and we need to leave now.
//
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
if (status != STATUS_SUCCESS) {
if (status == STATUS_PENDING) {
DDbgPrint(" FsRtlCheckOplock returned STATUS_PENDING\n");
} else {
DokanFreeEventContext(requestContext);
Irp->Tail.Overlay.DriverContext[DRIVER_CONTEXT_EVENT] = 0;
DokanFreeEventContext(eventContext);
}
__leave;
}
}
Expand Down

0 comments on commit 0c64b84

Please sign in to comment.