I am calling SetupDiGetDeviceRegistryProperty() with the SPDRP_DEVICEDESC property and it returns TRUE.
Calling this on my "Intel(R) HD Graphics 530" takes about 50ms while the same call on my "NVIDIA GeForce GTX 960M" (same laptop) takes 750ms !
This call is only returning a short string, there is no good reason I can see for it to take that long to execute. Since this is a Win API call, is there any way for me to identify what is taking that long ?
Using the Windows symbol information as suggested by @IInspectable and tracing in disassembly helps point to the slow functions, but it doesn't provide a solution to the issue as the code cannot be modified. Also using Process Monitor helps in finding the reason of the slow benchmark.
For now, the only workaround found to make the call faster is to run the process as admin.