|
|
1.1.1.6 ! root 1: /* Legal Notice: The source code contained in this file has been derived from ! 2: the source code of Encryption for the Masses 2.02a, which is Copyright (c) ! 3: 1998-99 Paul Le Roux and which is covered by the 'License Agreement for ! 4: Encryption for the Masses'. Modifications and additions to that source code ! 5: contained in this file are Copyright (c) 2004-2005 TrueCrypt Foundation and ! 6: Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.0 ! 7: the full text of which is contained in the file License.txt included in ! 8: TrueCrypt binary and source code distribution archives. */ 1.1 root 9: 10: #include "TCdefs.h" 1.1.1.6 ! root 11: #include "Crypto.h" ! 12: #include "Fat.h" ! 13: #include "Volumes.h" ! 14: ! 15: #include "Apidrvr.h" ! 16: #include "Ntdriver.h" ! 17: #include "Ntvol.h" ! 18: #include "Ntrawdv.h" 1.1 root 19: 20: #pragma warning( disable : 4127 ) 21: 22: NTSTATUS 23: TCSendIRP_RawDevice (PDEVICE_OBJECT DeviceObject, 24: PEXTENSION Extension, 25: PVOID pUserBuffer, 26: ULONG uFlags, 27: UCHAR uMajorFunction, 28: PIRP Irp) 29: { 30: PIO_STACK_LOCATION irpSp; 31: PIO_STACK_LOCATION irpNextSp; 32: NTSTATUS ntStatus; 33: 34: if (uFlags); /* Remove compiler warning */ 35: 36: // Dump ("Sending IRP...\n"); 37: 38: irpSp = IoGetCurrentIrpStackLocation (Irp); 39: irpNextSp = IoGetNextIrpStackLocation (Irp); 40: 41: irpSp->MajorFunction = uMajorFunction; 42: irpSp->DeviceObject = DeviceObject; 43: irpSp->FileObject = Extension->pfoDeviceFile; 44: 45: /* Copy our flags down one level, this is to get the proper 46: removable-media handling */ 47: irpNextSp->Flags = irpSp->Flags; 48: 49: /* Setup the lower drivers stack location */ 50: irpNextSp->MajorFunction = irpSp->MajorFunction; 51: irpNextSp->MinorFunction = irpSp->MinorFunction; 52: irpNextSp->DeviceObject = irpSp->DeviceObject; 53: irpNextSp->FileObject = irpSp->FileObject; 54: /* Copy over io parameters, this is a union, so it handles 55: deviceiocontrol & read/write */ 56: irpNextSp->Parameters.Read.Length = irpSp->Parameters.Read.Length; 57: irpNextSp->Parameters.Read.ByteOffset = irpSp->Parameters.Read.ByteOffset; 58: irpNextSp->Parameters.Read.Key = irpSp->Parameters.Read.Key; 59: 60: IoSetCompletionRoutine (Irp, TCCompletion, pUserBuffer, TRUE, TRUE, TRUE); 61: ntStatus = IoCallDriver (Extension->pFsdDevice, Irp); 62: 63: // Dump ("IRP Sent!\n"); 64: return ntStatus; 65: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.