public unsafe static void SetCommunicationsState(SafeFileHandle fileHandle, ref DeviceControlBlock dcb) { dcb.DCBlength = (uint)sizeof(DeviceControlBlock); Error.ThrowLastErrorIfFalse( Imports.GetCommState(fileHandle, ref dcb)); }
public unsafe static void SetCommunicationsState(SafeFileHandle fileHandle, ref DeviceControlBlock dcb) { dcb.DCBlength = (uint)sizeof(DeviceControlBlock); if (!Imports.GetCommState(fileHandle, ref dcb)) { throw Error.GetExceptionForLastError(); } }
public unsafe static DeviceControlBlock GetCommunicationsState(SafeFileHandle fileHandle) { DeviceControlBlock dcb = new DeviceControlBlock() { DCBlength = (uint)sizeof(DeviceControlBlock) }; Error.ThrowLastErrorIfFalse( Imports.GetCommState(fileHandle, ref dcb)); return(dcb); }
public unsafe static DeviceControlBlock GetCommunicationsState(SafeFileHandle fileHandle) { DeviceControlBlock dcb = new DeviceControlBlock() { DCBlength = (uint)sizeof(DeviceControlBlock) }; if (!Imports.GetCommState(fileHandle, ref dcb)) { throw Error.GetExceptionForLastError(); } return(dcb); }