Hi all,
I seem to being having comprehension issues with the help for SetupCopyOEMInf. I have a signed driver, so I have a sys, cat, and .inf file. To complete the installation, I copy the .sys to c:\windows\system32\drivers, and then I call SetupCopyOEMInf twice, the first time with SP_COPY_OEMINF_CATALOG_ONLY CopyStyle, and the second time with the CopyStyle set to zero. In both cases, I am passing the full path to the driver’s .inf file as the first parameter, then NULL, SPOST_PATH, CopyStyle, char *, MAX_PATH, &Size, NULL).
From the documentation, it looks like I should do this because it says:
SP_COPY_OEMINF_CATALOG_ONLY The specified .inf file’s corresponding catalog files is copied to %windir%\Inf. If this flag is specified, the destination filename information is entered upon successful return if the specified .inf file already exists in the Inf directory.
And then it says:
If the specified .inf file already exists a further check is performed to determine if the specified .inf file contains a CatalogFile= entry in its [Version] section. If it does, the .inf files’s %windir%\Inf primary filename with a “.cat” extension is used to determine if the catalog is already installed. If there is a catalog installed, but it is not the same as the catalog associated with the source .inf, this is not considered to be a match and enumerations continue. It is possible to have multiple identical .inf files with unique catalogs contained in %windir%\Inf directory. If an existing match is not found, the .inf and .cat files are installed under a new and unique name.
Which looks like the cat file must be installed before the .inf file, I think.
The bad behavior I am seeing is that on a clean Vista install, the installation seems to fail (not sure why). When the PDO gets created, Vista seems to be unable to find a driver, and yet doesn’t pop the “Found New Hardware” dialog. It’s almost like it’s confused. On a system where this driver has been previously installed, it seems to work fine.
Both calls to SetupCopyOEMInf return SUCCESS, and the .inf file, .cat and .sys can be seen in the appropriate folders.
Anyone know what the correct ordering is for the .cat and .inf? I’ve tried a few different permutations, and been unable to succeed.