/// <summary>
 /// Constructor for a DCB, using the DCB provided by another object.
 /// </summary>
 /// <param name="handle">Valid handle to a serial port object.</param>
 /// <param name="state">A CommState object for which the DCB settings should be
 /// taken. Note, the handle managed by the state object is ignored. If this
 /// parameter is null, then a default DCB is created.</param>
 internal CommState(SafeFileHandle handle, CommState state)
 {
     m_ComPortHandle = handle;
     if (state == null) {
         m_Dcb.DCBLength = Marshal.SizeOf(m_Dcb);
         GetCommState();
     } else {
         m_Dcb = state.m_Dcb;
     }
 }
Esempio n. 2
0
 public static extern bool GetCommState(SafeFileHandle hFile, ref NativeMethods.DCB lpDCB);