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

Function win_pipe_instance_new

src/daemon/ipc.c:4925–4943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4923}
4924
4925static HANDLE win_pipe_instance_new(const wchar_t *pipe_name, bool first_instance) {
4926 win_security_t security;
4927 if (!win_security_init(&security)) {
4928 return INVALID_HANDLE_VALUE;
4929 }
4930 DWORD open_mode = PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED;
4931 if (first_instance) {
4932 open_mode |= FILE_FLAG_FIRST_PIPE_INSTANCE;
4933 }
4934 HANDLE pipe = CreateNamedPipeW(
4935 pipe_name, open_mode,
4936 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS,
4937 PIPE_UNLIMITED_INSTANCES, 64U * 1024U, 64U * 1024U, 0, &security.attributes);
4938 win_security_destroy(&security);
4939 if (pipe != INVALID_HANDLE_VALUE) {
4940 (void)SetHandleInformation(pipe, HANDLE_FLAG_INHERIT, 0);
4941 }
4942 return pipe;
4943}
4944
4945/* This is a namespace reservation, never a protocol endpoint. Every current
4946 * 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