public byte[] IOCTL(uint treeId, CTLCodeType ctlCodeType, Guid fileId, CTLType ctlType, byte[] buffer) { ulong mid = (ulong)Interlocked.Increment(ref MessageId); SMB2Header sMB2Header = new SMB2Header(ESMB2Command.IOCTL, SMB2HeaderFlags.None, mid, treeId, SessionId); SMB2Body sMB2Body = new IOCTLRequest(ctlCodeType, fileId, ctlType, buffer); SMB2Message sMB2Message = new SMB2Message(sMB2Header, sMB2Body); SMBTransport.SendDatas(sMB2Message.DumpBinary()); var sm = GetMessage(mid); if (sm.SMB2Header.Status == 0) { var s = sm.SMB2Body as IOCTLResponse; return(s.Buffer); } else { throw new Exception("IOCTL Status error:" + sm.SMB2Header.Status); } }
public static byte[] GetBytes(this CTLType t) { return(BitConverter.GetBytes((uint)t)); }
public byte[] IOCTL(CTLCodeType ctlCodeType, CTLType ctlType, byte[] buffer) { return(SMB2Worker.IOCTL(Tree.TreeId, ctlCodeType, FileId, ctlType, buffer)); }