1 /*
2 * Copyright (c) 2019 The Khronos Group Inc.
3 * Copyright (c) 2019 Valve Corporation
4 * Copyright (c) 2019 LunarG, Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * Author: Lenny Komow <lenny@lunarg.com>
19 */
20 
21 typedef struct LoaderEnumAdapters2 {
22     ULONG adapter_count;
23     struct {
24         UINT handle;
25         LUID luid;
26         ULONG source_count;
27         BOOL present_move_regions_preferred;
28     } * adapters;
29 } LoaderEnumAdapters2;
30 
31 typedef _Check_return_ NTSTATUS(APIENTRY *PFN_LoaderEnumAdapters2)(const LoaderEnumAdapters2 *);
32 
33 typedef enum AdapterInfoType {
34     LOADER_QUERY_TYPE_REGISTRY = 48,
35 } AdapterInfoType;
36 
37 typedef struct LoaderQueryAdapterInfo {
38     UINT handle;
39     AdapterInfoType type;
40     VOID *private_data;
41     UINT private_data_size;
42 } LoaderQueryAdapterInfo;
43 
44 typedef _Check_return_ NTSTATUS(APIENTRY *PFN_LoaderQueryAdapterInfo)(const LoaderQueryAdapterInfo *);
45 
46 typedef enum LoaderQueryRegistryType {
47     LOADER_QUERY_REGISTRY_ADAPTER_KEY = 1,
48 } LoaderQueryRegistryType;
49 
50 typedef enum LoaderQueryRegistryStatus {
51     LOADER_QUERY_REGISTRY_STATUS_SUCCESS = 0,
52     LOADER_QUERY_REGISTRY_STATUS_BUFFER_OVERFLOW = 1,
53 } LoaderQueryRegistryStatus;
54 
55 typedef struct LoaderQueryRegistryFlags {
56     union {
57         struct {
58             UINT translate_path : 1;
59             UINT mutable_value : 1;
60             UINT reserved : 30;
61         };
62         UINT value;
63     };
64 } LoaderQueryRegistryFlags;
65 
66 typedef struct LoaderQueryRegistryInfo {
67     LoaderQueryRegistryType query_type;
68     LoaderQueryRegistryFlags query_flags;
69     WCHAR value_name[MAX_PATH];
70     ULONG value_type;
71     ULONG physical_adapter_index;
72     ULONG output_value_size;
73     LoaderQueryRegistryStatus status;
74     union {
75         DWORD output_dword;
76         UINT64 output_qword;
77         WCHAR output_string[1];
78         BYTE output_binary[1];
79     };
80 } LoaderQueryRegistryInfo;
81