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

Function win_pipe_instance_new

src/daemon/ipc.c:4849–4867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4847}
4848
4849static HANDLE win_pipe_instance_new(const wchar_t *pipe_name, bool first_instance) {
4850 win_security_t security;
4851 if (!win_security_init(&security)) {
4852 return INVALID_HANDLE_VALUE;
4853 }
4854 DWORD open_mode = PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED;
4855 if (first_instance) {
4856 open_mode |= FILE_FLAG_FIRST_PIPE_INSTANCE;
4857 }
4858 HANDLE pipe = CreateNamedPipeW(
4859 pipe_name, open_mode,
4860 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS,
4861 PIPE_UNLIMITED_INSTANCES, 64U * 1024U, 64U * 1024U, 0, &security.attributes);
4862 win_security_destroy(&security);
4863 if (pipe != INVALID_HANDLE_VALUE) {
4864 (void)SetHandleInformation(pipe, HANDLE_FLAG_INHERIT, 0);
4865 }
4866 return pipe;
4867}
4868
4869/* This is a namespace reservation, never a protocol endpoint. Every current
4870 * 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