Exemplo n.º 1
0
 internal IRP(IoFlowRuntime ioFlow, SafeFileHandle hPort)
 {
     this.runtime       = ioFlow;
     this.hPort         = hPort;
     Data               = new byte[SIZEOF_IRP_USER_IO_BUFFER];
     gcDataBuffer       = GCHandle.Alloc(Data, GCHandleType.Pinned);
     pDataBuffer        = (ulong)gcDataBuffer.AddrOfPinnedObject().ToInt64();
     lpMessageBuffer    = gcDataBuffer.AddrOfPinnedObject();
     hEvent             = CreateEvent(IntPtr.Zero, false, false, IntPtr.Zero);
     overlapped         = new OVERLAPPED();
     gcOVERLAPPED       = GCHandle.Alloc(overlapped, GCHandleType.Pinned);
     addrOverlapped     = gcOVERLAPPED.AddrOfPinnedObject();
     overlapped.hEvent  = hEvent;
     BackupHeaderBuffer = new byte[IOFLOW_HEADER.SIZEOF_IOFLOW_HEADER];
     ioFlowHeader       = new IOFLOW_HEADER(BackupHeaderBuffer);
 }
Exemplo n.º 2
0
 internal IRP(IoFlowRuntime ioFlow, SafeFileHandle hPort)
 {
     this.runtime = ioFlow;
     this.hPort = hPort;
     Data = new byte[SIZEOF_IRP_USER_IO_BUFFER];
     gcDataBuffer = GCHandle.Alloc(Data, GCHandleType.Pinned);
     pDataBuffer = (ulong)gcDataBuffer.AddrOfPinnedObject().ToInt64();
     lpMessageBuffer = gcDataBuffer.AddrOfPinnedObject();
     hEvent = CreateEvent(IntPtr.Zero, false, false, IntPtr.Zero);
     overlapped = new OVERLAPPED();
     gcOVERLAPPED = GCHandle.Alloc(overlapped, GCHandleType.Pinned);
     addrOverlapped = gcOVERLAPPED.AddrOfPinnedObject();
     overlapped.hEvent = hEvent;
     BackupHeaderBuffer = new byte[IOFLOW_HEADER.SIZEOF_IOFLOW_HEADER];
     ioFlowHeader = new IOFLOW_HEADER(BackupHeaderBuffer);
 }