/// <summary> /// Constructor /// </summary> /// <param name="code">Raw IO control code to convert.</param> public NtIoControlCode(int code) { DeviceType = (FileDeviceType)(code >> 16); Access = (FileControlAccess)((code >> 14) & 3); Function = (code >> 2) & 0xFFF; Method = (FileControlMethod)(code & 3); }
/// <summary> /// Constructor /// </summary> /// <param name="device_type">Type of device</param> /// <param name="function">Function number</param> /// <param name="method">Buffering method</param> /// <param name="access">Access of file handle</param> public NtIoControlCode(FileDeviceType device_type, int function, FileControlMethod method, FileControlAccess access) { DeviceType = device_type; Function = function; Method = method; Access = access; }
/// <summary> /// Constructor /// </summary> /// <param name="device_type">Type of device</param> /// <param name="function">Function number</param> /// <param name="method">Buffering method</param> /// <param name="access">Access of file handle</param> public NtIoControlCode(FileDeviceType device_type, int function, FileControlMethod method, FileControlAccess access) { _control_code = (((int)device_type) << 16) | (((int)access) << 14) | (function << 2) | ((int)method); }