1 /*
2  *
3  * Copyright (c) 2014-2021 The Khronos Group Inc.
4  * Copyright (c) 2014-2021 Valve Corporation
5  * Copyright (c) 2014-2021 LunarG, Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Author: Jon Ashburn <jon@lunarg.com>
20  * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
21  * Author: Chia-I Wu <olvaffe@gmail.com>
22  * Author: Chia-I Wu <olv@lunarg.com>
23  * Author: Mark Lobodzinski <mark@LunarG.com>
24  * Author: Lenny Komow <lenny@lunarg.com>
25  * Author: Charles Giessen <charles@lunarg.com>
26  *
27  */
28 
29 #pragma once
30 
31 #include "loader_common.h"
32 
33 // Common functionality for accessing environemnt variables and whether the process is running in priviledged mode
34 
35 char *loader_getenv(const char *name, const struct loader_instance *inst);
36 void loader_free_getenv(char *val, const struct loader_instance *inst);
37 
38 #if defined(WIN32) || COMMON_UNIX_PLATFORMS
39 
40 bool is_high_integrity();
41 
42 char *loader_secure_getenv(const char *name, const struct loader_instance *inst);
43 
44 #endif
45 
46 VkResult parse_generic_filter_environment_var(const struct loader_instance *inst, const char *env_var_name,
47                                               struct loader_envvar_filter *filter_struct);
48 VkResult parse_layers_disable_filter_environment_var(const struct loader_instance *inst,
49                                                      struct loader_envvar_disable_layers_filter *disable_struct);
50 VkResult parse_layer_environment_var_filters(const struct loader_instance *inst, struct loader_envvar_all_filters *layer_filters);
51 bool check_name_matches_filter_environment_var(const char *name, const struct loader_envvar_filter *filter_struct);
52 VkResult loader_add_environment_layers(struct loader_instance *inst, const enum layer_type_flags type_flags,
53                                        const struct loader_envvar_all_filters *filters,
54                                        struct loader_pointer_layer_list *target_list,
55                                        struct loader_pointer_layer_list *expanded_target_list,
56                                        const struct loader_layer_list *source_list);
57