Some functions of SetupAPI only work when invoked from a native process.
Registry and filesystem reflection makes them fail on WoW64. For WoW64
processes, a minimum set of rundll32 functions are provided.
Signed-off-by: Simon Rozman <simon@rozman.si>
GetDevInfoData: Some functions returned ERROR_OBJECT_NOT_FOUND, others
ERROR_FILE_NOT_FOUND when the needle was not found in the haystack.
GetTcpipInterfaceRegPath: When IpConfig is an empty REG_MULTI_SZ, it is
actually ERROR_INVALID_DATA - like other unexpected registry values -
rather than a misleading ERROR_NETWORK_NOT_AVAILABLE.
Failure in TakeNameMutex result in ERROR_INVALID_HANDLE rather than the
ERROR_GEN_FAILURE with a misleading message: "A device attached to the
system is not functioning."
Signed-off-by: Simon Rozman <simon@rozman.si>
Rather than setting the "quiet" flag to each and every device in the
process of iterating, set it when actually creating/deleting it.
Signed-off-by: Simon Rozman <simon@rozman.si>
This makes the code more readable and works around the clang-format.exe
issues with _Return_type_success_ source annotation.
Signed-off-by: Simon Rozman <simon@rozman.si>
Mind that this also fixes the order of adapter detection checks. A fast
test to eliminate non-Wintun adapters from iteration to speed things up
rendered the method incapable of detecting a non-Wintun adapter with the
name we are looking for.
ERROR_OBJECT_NOT_FOUND was replaced with ERROR_FILE_NOT_FOUND.
Signed-off-by: Simon Rozman <simon@rozman.si>