InsertTailList(&diskData->FlushContext.CurrList, listEntry);
}
+#ifndef __REACTOS__
+ // ReactOS hits this assert, because CurrIrp can already be freed at this point
+ // and it's possible that NextIrp has the same pointer value
NT_ASSERT(diskData->FlushContext.CurrIrp != diskData->FlushContext.NextIrp);
+#endif
diskData->FlushContext.CurrIrp = diskData->FlushContext.NextIrp;
diskData->FlushContext.NextIrp = NULL;
irpSp->MajorFunction = IRP_MJ_SCSI;
irpSp->Parameters.Scsi.Srb = srb;
- IoSetCompletionRoutine(FlushContext->CurrIrp, DiskFlushComplete, (PVOID)SyncCacheStatus, TRUE, TRUE, TRUE);
+ IoSetCompletionRoutine(FlushContext->CurrIrp, DiskFlushComplete, (PVOID)(ULONG_PTR)SyncCacheStatus, TRUE, TRUE, TRUE);
TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_SCSI, "DiskFlushDispatch: sending srb flush on irp %p\n", FlushContext->CurrIrp));
#ifdef _MSC_VER
#pragma warning(suppress:4311) // pointer truncation from 'PVOID' to 'NTSTATUS'
#endif
- NTSTATUS SyncCacheStatus = (NTSTATUS) Context;
+ NTSTATUS SyncCacheStatus = (NTSTATUS)(ULONG_PTR)Context;
TracePrint((TRACE_LEVEL_VERBOSE, TRACE_FLAG_GENERAL, "DiskFlushComplete: %p %p\n", Fdo, Irp));
queryTable[0].EntryContext = &(rootPartitionMountable);
queryTable[0].DefaultType = (REG_DWORD << RTL_QUERY_REGISTRY_TYPECHECK_SHIFT) | REG_NONE;
+#ifdef _MSC_VER
#pragma prefast(suppress:6309, "We don't have QueryRoutine so Context doesn't make any sense")
+#endif
status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
diskKey,
queryTable,