mirror of
https://gitea.tendokyu.moe/TeamTofuShop/capnhook.git
synced 2026-09-30 19:08:00 +03:00
hooklib/uart.c: Add emulated UART
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <ntdef.h>
|
||||
#include <ntddser.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "hook/iobuf.h"
|
||||
#include "hook/iohook.h"
|
||||
|
||||
struct uart {
|
||||
HANDLE fd;
|
||||
unsigned int port_no;
|
||||
SERIAL_BAUD_RATE baud;
|
||||
SERIAL_STATUS status;
|
||||
SERIAL_CHARS chars;
|
||||
SERIAL_HANDFLOW handflow;
|
||||
SERIAL_LINE_CONTROL line;
|
||||
SERIAL_TIMEOUTS timeouts;
|
||||
DWORD mask;
|
||||
struct iobuf written;
|
||||
struct iobuf readable;
|
||||
};
|
||||
|
||||
void uart_init(struct uart *uart, unsigned int port_no);
|
||||
void uart_fini(struct uart *uart);
|
||||
bool uart_match_irp(const struct uart *uart, const struct irp *irp);
|
||||
HRESULT uart_handle_irp(struct uart *uart, struct irp *irp);
|
||||
Reference in New Issue
Block a user