MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / win_pipe_instance_new

Function win_pipe_instance_new

src/daemon/ipc.c:5191–5209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5189}
5190
5191static HANDLE win_pipe_instance_new(const wchar_t *pipe_name, bool first_instance) {
5192 win_security_t security;
5193 if (!win_security_init(&security)) {
5194 return INVALID_HANDLE_VALUE;
5195 }
5196 DWORD open_mode = PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED;
5197 if (first_instance) {
5198 open_mode |= FILE_FLAG_FIRST_PIPE_INSTANCE;
5199 }
5200 HANDLE pipe = CreateNamedPipeW(
5201 pipe_name, open_mode,
5202 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS,
5203 PIPE_UNLIMITED_INSTANCES, 64U * 1024U, 64U * 1024U, 0, &security.attributes);
5204 win_security_destroy(&security);
5205 if (pipe != INVALID_HANDLE_VALUE) {
5206 (void)SetHandleInformation(pipe, HANDLE_FLAG_INHERIT, 0);
5207 }
5208 return pipe;
5209}
5210
5211/* This is a namespace reservation, never a protocol endpoint. Every current
5212 * participant owns one idle instance. The first uses

Callers 2

cbm_daemon_ipc_acceptFunction · 0.85

Calls 2

win_security_initFunction · 0.85
win_security_destroyFunction · 0.85

Tested by

no test coverage detected