<DllImport("kernel32.dll")> Private Shared Function SetCommState(ByVal hCommDev As Int32, ByRef lpDCB As DCB) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function GetCommState(ByVal hCommDev As Int32, ByRef lpDCB As DCB) As Int32 End Function <DllImport("kernel32.dll", CharSet:=CharSet.Auto)> Private Shared Function BuildCommDCB(<MarshalAs(UnmanagedType.LPStr)> ByVal lpDef As String, ByRef lpDCB As DCB) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function SetupComm(ByVal hFile As Int32, ByVal dwInQueue As Int32, ByVal dwOutQueue As Int32) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function SetCommTimeouts(ByVal hFile As Int32, ByRef lpCommTimeouts As COMMTIMEOUTS) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function GetCommTimeouts(ByVal hFile As Int32, ByRef lpCommTimeouts As COMMTIMEOUTS) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function ClearCommError(ByVal hFile As Int32, ByVal lpErrors As Int32, ByVal l As Int32) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function PurgeComm(ByVal hFile As Int32, ByVal dwFlags As Int32) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function EscapeCommFunction(ByVal hFile As Integer, ByVal ifunc As Long) As Boolean End Function <DllImport("kernel32.dll")> Private Shared Function WaitCommEvent(ByVal hFile As Integer, ByRef Mask As Integer, ByRef lpOverlap As OVERLAPPED) As Int32 End Function <DllImport("kernel32.dll")> Private Shared Function WriteFile(ByVal hFile As Integer, ByVal Buffer As Byte(), ByVal nNumberOfBytesToWrite As Integer, ByRef lpNumberOfBytesWritten As Integer, ByVal lpOverlapped As Integer) As Integer End Function <DllImport("kernel32.dll")> Private Shared Function ReadFile(ByVal hFile As Integer, ByVal Buffer As Byte(), ByVal nNumberOfBytesToRead As Integer, ByRef lpNumberOfBytesRead As Integer, ByVal lpOverlapped As Integer) As Integer End Function <DllImport("kernel32.dll")> Private Shared Function CreateFile(<MarshalAs(UnmanagedType.LPStr)> ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode As Integer, ByVal lpSecurityAttributes As Integer, ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile As Integer) As Integer End Function <DllImport("kernel32.dll")> Private Shared Function CloseHandle(ByVal hObject As Integer) As Integer End Function <DllImport("kernel32.dll")> Private Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As Integer, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, <MarshalAs UnmanagedType.LPStr)> ByVal lpBuffer As String, ByVal nSize As Integer, ByVal Arguments As Integer) As Integer End Function |