Skip to content

Instantly share code, notes, and snippets.

@noqisofon
Created December 21, 2010 06:28
Show Gist options
  • Save noqisofon/749577 to your computer and use it in GitHub Desktop.
Save noqisofon/749577 to your computer and use it in GitHub Desktop.
パイプとフレームバッファ。
struct pipe_t {
handle_t output;
handle_t input;
};
int pipe_init(pipe_t* pipe, security_attributes_t* attributes)
{
boolean ret;
if ( !pipe )
return -1;
ret = CreatePipe( &pipe->output, &pipe->input, attributes, 0 );
return ret != 0;
}
struct frame_buffer_t {
int header;
int size;
BYTE buffer[FRAME_BUFFER_MAXLENGTH];
};
int frame_buffer_init(frame_buffer_t* frame) {
if ( !frame )
return -1;
frame->header = 0;
frame->size = 0;
ZeroMemory( frame->buffer, FRAME_BUFFER_MAXLENGTH );
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment