I'm working with drivers and recently I ran to this problem. Before performing some operations, our software checks if specific driver is preinstalled using this function
SetupCopyOEMInf(sourceInf, NULL, SPOST_NONE,
SP_COPY_REPLACEONLY | SP_COPY_NOOVERWRITE,
NULL, 0, NULL, NULL);
It was copying the inf and if we got ERROR_FILE_EXISTS
error, we assumed that driver was preinstalled.
For some reason this function doesn't work on recent windows 10, Even if inf file already exist in Windows/inf
, it returns true every time.
I'm curious if there is some other way of checking if driver is preinstalled using winapi? Thanks.
P.S
I've checked this question and it didn't help me because, I don't have a device to plug in, my driver creates virtual network adapters.