MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / LoadDeviceRegistry

Function LoadDeviceRegistry

vkconfig_core/registry.cpp:85–115  ·  view source on GitHub ↗

Look for device specific layers

Source from the content-addressed store, hash-verified

83
84/// Look for device specific layers
85static void LoadDeviceRegistry(DEVINST id, const QString &entry, std::vector<Path> &layers_paths) {
86 HKEY key;
87 if (CM_Open_DevNode_Key(id, KEY_QUERY_VALUE, 0, RegDisposition_OpenExisting, &key, CM_REGISTRY_SOFTWARE) != CR_SUCCESS) return;
88
89 DWORD path_size;
90 if (RegQueryValueExW(key, (LPCWSTR)entry.utf16(), nullptr, nullptr, nullptr, &path_size) != ERROR_SUCCESS) {
91 RegCloseKey(key);
92 return;
93 }
94
95 DWORD data_type;
96 wchar_t *path = new wchar_t[path_size];
97 if (RegQueryValueExW(key, (LPCWSTR)entry.utf16(), nullptr, &data_type, (LPBYTE)path, &path_size) != ERROR_SUCCESS) {
98 delete[] path;
99 RegCloseKey(key);
100 return;
101 }
102
103 if (data_type == REG_SZ || data_type == REG_MULTI_SZ) {
104 for (wchar_t *curr_filename = path; curr_filename[0] != '\0'; curr_filename += wcslen(curr_filename) + 1) {
105 layers_paths.push_back(QString::fromWCharArray(curr_filename).toStdString());
106
107 if (data_type == REG_SZ) {
108 break;
109 }
110 }
111 }
112
113 delete[] path;
114 RegCloseKey(key);
115}
116
117/// This is for Windows only. It looks for device specific layers in the Windows registry.
118std::vector<Path> LoadRegistrySystemLayers(const char *input_path) {

Callers 1

LoadRegistrySystemLayersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected