mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-23 14:53:18 +00:00
winws: save win32 error in windivert send
This commit is contained in:
parent
1e8e46c14f
commit
8a09df7097
@ -959,7 +959,7 @@ void tcp_rewrite_winsize(struct tcphdr *tcp, uint16_t winsize, uint8_t scale_fac
|
||||
|
||||
static HANDLE w_filter = NULL;
|
||||
static OVERLAPPED ovl = { .hEvent = NULL };
|
||||
DWORD w_win32_error=0;
|
||||
uint32_t w_win32_error=0;
|
||||
|
||||
static HANDLE windivert_init_filter(const char *filter, UINT64 flags)
|
||||
{
|
||||
@ -1082,7 +1082,9 @@ bool windivert_recv(uint8_t *packet, size_t *len, WINDIVERT_ADDRESS *wa)
|
||||
|
||||
static bool windivert_send_filter(HANDLE hFilter, const uint8_t *packet, size_t len, const WINDIVERT_ADDRESS *wa)
|
||||
{
|
||||
return WinDivertSend(hFilter,packet,(UINT)len,NULL,wa);
|
||||
bool b = WinDivertSend(hFilter,packet,(UINT)len,NULL,wa);
|
||||
w_win32_error = GetLastError();
|
||||
return b;
|
||||
}
|
||||
bool windivert_send(const uint8_t *packet, size_t len, const WINDIVERT_ADDRESS *wa)
|
||||
{
|
||||
|
@ -149,7 +149,7 @@ uint8_t tcp_find_scale_factor(const struct tcphdr *tcp);
|
||||
bool tcp_has_fastopen(const struct tcphdr *tcp);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
extern DWORD w_win32_error;
|
||||
extern uint32_t w_win32_error;
|
||||
|
||||
bool windivert_init(const char *filter);
|
||||
bool windivert_recv(uint8_t *packet, size_t *len, WINDIVERT_ADDRESS *wa);
|
||||
|
Loading…
Reference in New Issue
Block a user