HyperDbg Debugger
Loading...
Searching...
No Matches
platform-serial.h
Go to the documentation of this file.
1
17#pragma once
18
19#if defined(__linux__)
21#endif // defined(__linux__)
22
23//
24// Distinguishes the two I/O modes the transport uses. On Windows the debugger
25// side opens the port for overlapped (async) I/O while the debuggee side uses
26// blocking I/O; this enum lets the platform layer pick the right mechanism
27// without leaking OVERLAPPED into the protocol code.
28//
30{
31 PLATFORM_SERIAL_IO_DEBUGGER, // overlapped / async reads
32 PLATFORM_SERIAL_IO_DEBUGGEE, // blocking reads (with comm timeout)
33
35
36//
37// OPEN a serial COM port by name for the given role.
38// Returns a transport handle, or NULL on failure.
39//
40HANDLE
41PlatformSerialOpen(const char * PortName, PLATFORM_SERIAL_IO_ROLE Role);
42
43//
44// CONFIGURE baud rate and the fixed 8-N-1 framing the protocol expects.
45//
47PlatformSerialConfigure(HANDLE Handle, DWORD BaudRate);
48
49//
50// READ a single byte. *BytesRead is set to the number of bytes actually read.
51// The caller (protocol layer) owns the packet-assembly loop.
52//
55 CHAR * OutByte,
56 DWORD * BytesRead,
58
59//
60// WRITE a buffer. Synchronous selects blocking write (debuggee/handshaking)
61// versus overlapped write (debugger).
62//
64PlatformSerialWrite(HANDLE Handle, const void * Buffer, UINT32 Length, BOOLEAN Synchronous);
65
66//
67// CLOSE the transport handle and release any associated OS resources.
68//
70PlatformSerialClose(HANDLE Handle);
UCHAR BOOLEAN
Definition BasicTypes.h:35
unsigned long DWORD
Definition BasicTypes.h:38
unsigned int UINT32
Definition BasicTypes.h:54
char CHAR
Definition BasicTypes.h:33
_PLATFORM_SERIAL_IO_ROLE
Definition platform-serial.h:30
@ PLATFORM_SERIAL_IO_DEBUGGEE
Definition platform-serial.h:32
@ PLATFORM_SERIAL_IO_DEBUGGER
Definition platform-serial.h:31
BOOLEAN PlatformSerialClose(HANDLE Handle)
BOOLEAN PlatformSerialReadByte(HANDLE Handle, CHAR *OutByte, DWORD *BytesRead, PLATFORM_SERIAL_IO_ROLE Role)
BOOLEAN PlatformSerialConfigure(HANDLE Handle, DWORD BaudRate)
enum _PLATFORM_SERIAL_IO_ROLE PLATFORM_SERIAL_IO_ROLE
BOOLEAN PlatformSerialWrite(HANDLE Handle, const void *Buffer, UINT32 Length, BOOLEAN Synchronous)
HANDLE PlatformSerialOpen(const char *PortName, PLATFORM_SERIAL_IO_ROLE Role)