in communication.c [144:166]
void comm_send_data(HANDLE pipe, const uint8_t* buffer, uint32_t buffer_size)
{
assert(INVALID_HANDLE_VALUE != pipe);
assert(buffer);
assert(buffer_size);
uint32_t block_size = BLOCK_SIZE;
uint32_t n_bytes = 0;
uint32_t total_size_sent = 0;
while (total_size_sent < buffer_size)
{
n_bytes = 0;
if (!WriteFile(pipe, &buffer[total_size_sent],
block_size < (buffer_size - total_size_sent)
? block_size
: buffer_size - total_size_sent,
(DWORD*)&n_bytes, NULL))
h_error("Failed to write data to pipe\n");
total_size_sent += n_bytes;
}
}