1 /* Copyright (c) 2018, 2020, Oracle and/or its affiliates.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License, version 2.0,
5    as published by the Free Software Foundation.
6 
7    This program is also distributed with certain software (including
8    but not limited to OpenSSL) that is licensed under separate terms,
9    as designated in a particular file or component or in included license
10    documentation.  The authors of MySQL hereby grant you an additional
11    permission to link the program and your derivative works with the
12    separately licensed software that they have included with MySQL.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License, version 2.0, for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
22 
23 #ifndef NAMED_PIPE_INCLUDED
24 #define NAMED_PIPE_INCLUDED
25 
26 #include <windows.h>
27 
28 const DWORD NAMED_PIPE_OWNER_PERMISSIONS= GENERIC_READ | GENERIC_WRITE;
29 const DWORD NAMED_PIPE_EVERYONE_PERMISSIONS=
30     FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_WRITE_ATTRIBUTES |
31     FILE_WRITE_DATA | SYNCHRONIZE | READ_CONTROL;
32 const DWORD NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS=
33     GENERIC_READ | GENERIC_WRITE;
34 
35 HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr,
36                                 DWORD buffer_size, const char *name,
37                                 char *name_buf, size_t buflen,
38                                 const char *full_access_group_name = NULL);
39 
40 bool is_valid_named_pipe_full_access_group(const char *group_name);
41 bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa,
42                                           const char *group_name,
43                                           DWORD group_rights);
44 #define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP "*everyone*"
45 #endif /* NAMED_PIPE_INCLUDED */
46