Skip to content

Commit

Permalink
Kernel - Add information about GET_IRP_BUFFER_OR_RETURN usage for Dok…
Browse files Browse the repository at this point in the history
…anCompleteIrp
  • Loading branch information
Liryna committed Apr 27, 2020
1 parent 0970f58 commit 5530a69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ DokanCompleteIrp(__in PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp) {
PDokanVCB vcb;
PEVENT_INFORMATION eventInfo;

// Dokan 1.x.x Library can send buffer under EVENT_INFO struct size:
// - IRP_MJ_QUERY_SECURITY sending STATUS_BUFFER_OVERFLOW
// - IRP_MJ_READ with negative read size
// The behavior was fixed since but adding the next line would break
// backward compatiblity.
// TODO 2.x.x - use GET_IRP_BUFFER_OR_RETURN(Irp, eventInfo);
eventInfo = (PEVENT_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
ASSERT(eventInfo != NULL);

Expand Down

0 comments on commit 5530a69

Please sign in to comment.