| 4923 | } |
| 4924 | |
| 4925 | static 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 |
no test coverage detected