MCPcopy Create free account
hub / github.com/beefytech/Beef / visit_files_w

Function visit_files_w

IDEHelper/VSSupport.cpp:224–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222
223typedef void(*Visit_Proc_W)(wchar_t *short_name, wchar_t *full_name, Version_Data *data);
224bool visit_files_w(wchar_t *dir_name, Version_Data *data, Visit_Proc_W proc) {
225 // Visit everything in one folder (non-recursively). If it's a directory
226 // that doesn't start with ".", call the visit proc on it. The visit proc
227 // will see if the filename conforms to the expected versioning pattern.
228
229 auto wildcard_name = concat(dir_name, L"\\*");
230 defer{ free(wildcard_name); };
231
232 WIN32_FIND_DATAW find_data;
233 auto handle = FindFirstFileW(wildcard_name, &find_data);
234 if (handle == INVALID_HANDLE_VALUE) return false;
235
236 while (true) {
237 if ((find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && (find_data.cFileName[0] != '.')) {
238 auto full_name = concat(dir_name, L"\\", find_data.cFileName);
239 defer{ free(full_name); };
240
241 proc(find_data.cFileName, full_name, data);
242 }
243
244 auto success = FindNextFileW(handle, &find_data);
245 if (!success) break;
246 }
247
248 FindClose(handle);
249
250 return true;
251}
252
253wchar_t *find_windows_kit_root(HKEY key, wchar_t *version) {
254 // Given a key to an already opened registry entry,

Callers 1

find_windows_kit_rootFunction · 0.85

Calls 2

concatFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected