Alex Henrie (@alexhenrie) commented about dlls/setupapi/tests/query.c:
- WCHAR buffer[500];
- DWORD len;
- HRESULT (WINAPI *pDriverStoreFindDriverPackageW)(const WCHAR*, void*, void*, DWORD, void*, WCHAR*, DWORD*);
- library = LoadLibraryA("setupapi.dll");
- ok(library != NULL, "Failed to load setupapi.dll\n");
- if (!library) return;
- pDriverStoreFindDriverPackageW = (void *)GetProcAddress(library, "DriverStoreFindDriverPackageW");
- if (!pDriverStoreFindDriverPackageW)
- {
win_skip("Can't find DriverStoreFindDriverPackageW\n");
return;
- }
- len = 500;
Rather than initializing len with a magic number here, it would be more clear declare the variable as `DWORD len = ARRAY_SIZE(buffer)` to begin with.