Пример #1
0
void init(DWORD netbase, DWORD recv, DWORD send)
{
	if (recv)
	{
		pfn_ws2_recv = reinterpret_cast<void*>(*reinterpret_cast<DWORD*>(recv));
		*reinterpret_cast<DWORD*>(recv) = reinterpret_cast<DWORD>(ws2_recv);

		rbuf_clear();
	}

	if (send)
	{
		pfn_ws2_send = reinterpret_cast<void*>(*reinterpret_cast<DWORD*>(send));
		*reinterpret_cast<DWORD*>(send) = reinterpret_cast<DWORD>(ws2_send);

		sbuf_clear();
	}

	{
		DWORD address = config::get_n("packet", "plt_address");
		bool as = false;
		
		if (address == 0)
		{
			address = netbase;
			as = true;
		}

		packet = new CPacket;
		packet->initialize(address, as);
	}

	dbgprintf(0, "recv_a=%08X recv_o=%08X recv_m=%08X send_a=%08X send_o=%08X send_m=%08X\n", recv, pfn_ws2_recv, ws2_recv, send, pfn_ws2_send, ws2_send);
}
Пример #2
0
void fin()
{
	if (packet)
	{
		delete packet;
		packet = NULL;
	}

	rbuf_clear();
	sbuf_clear();
}
Пример #3
0
void serialcon_setup()
{
    rbuf_clear(&serialcon_rxbuf);
    rbuf_clear(&serialcon_txbuf);
    serialcon_has_input = false;
}