| 6025 | } |
| 6026 | |
| 6027 | static HANDLE win_pipe_instance_new(const wchar_t *pipe_name, bool first_instance) { |
| 6028 | win_security_t security; |
| 6029 | if (!win_security_init(&security)) { |
| 6030 | return INVALID_HANDLE_VALUE; |
| 6031 | } |
| 6032 | DWORD open_mode = PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED; |
| 6033 | if (first_instance) { |
| 6034 | open_mode |= FILE_FLAG_FIRST_PIPE_INSTANCE; |
| 6035 | } |
| 6036 | HANDLE pipe = CreateNamedPipeW( |
| 6037 | pipe_name, open_mode, |
| 6038 | PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS, |
| 6039 | PIPE_UNLIMITED_INSTANCES, 64U * 1024U, 64U * 1024U, 0, &security.attributes); |
| 6040 | win_security_destroy(&security); |
| 6041 | if (pipe != INVALID_HANDLE_VALUE) { |
| 6042 | (void)SetHandleInformation(pipe, HANDLE_FLAG_INHERIT, 0); |
| 6043 | } |
| 6044 | return pipe; |
| 6045 | } |
| 6046 | |
| 6047 | /* This is a namespace reservation, never a protocol endpoint. Every current |
| 6048 | * participant owns one idle instance. The first uses |
no test coverage detected