g_assert(buffer==NULL);
buffer=Irp->UserBuffer;
}
- if (Irp->AssociatedIrp.SystemBuffer) {
+ /* Forbid both IRP_BUFFERED_IO and IRP_ASSOCIATED_IRP as it should be IMO invalid state. */
+ g_assert(!((Irp->Flags & IRP_BUFFERED_IO) && (Irp->Flags & IRP_ASSOCIATED_IRP)));
+ if (Irp->Flags & IRP_BUFFERED_IO && Irp->AssociatedIrp.SystemBuffer) {
g_assert(buffer==NULL);
buffer=Irp->AssociatedIrp.SystemBuffer;
}
/* See comment at ntoskrnl/io/buildirp.c/IoBuildSynchronousFsdRequestWithMdl()
* initialization of 'Irp->UserBuffer'.
*/
- g_assert(buffer==Irp->MdlAddress->StartVa);
+ g_assert(buffer==Irp->MdlAddress->StartVa || buffer==NULL);
g_assert(Parameters->Length<=MmGetMdlByteCount(Irp->MdlAddress));
buffer=MmGetSystemAddressForMdl(Irp->MdlAddress);
}