Hi all,
I wrote a code to preinstall the driver and i encounter a problem. while i don’t plug in device (PNP device), and run the sample code as shown below . then the code works proper . but when i plug in the device ,OS pop up a dailog “New Hardware Found” and require me to install the driver manually .
code sample:
if(Windows OS = XP)
{
SetupCopyOEMInf(c:\xxx.inf, NULL,SPOST_NONE, 0,NULL,0,NULL,NULL);
ReinstallMarkDevice(PIDVID);
}
ReinstallMarkDevice(PIDVID)
{
DeviceInfoSet = SetupDiGetClassDevs();
SetupDiEnumDeviceInfo(DeviceInfoSet);
SetupDiGetDeviceRegistryProperty(pidvid)
if(pidvid == PIDVID)
{
Set registry flag |= CONFIGFLAG_REINSTALL;
}
SetupDiDestroyDeviceInfoList(DeviceInfoSet);
}
sorry ,i click “submit” button by accident.
My question is how can i install the driver successfully while there is no relevant device attached the PC . The INF didn’t pass WHQL ,for the reason that the driver still in test . I had experiment that the driver pass WHQL will resolved this problem , Is there any way to workaround the problem .My purpose is not to Pop up “New hardware Found”. any warning will be OK.
xxxxx@hotmail.com wrote:
I wrote a code to preinstall the driver and i encounter a problem. while i don’t plug in device (PNP device), and run the sample code as shown below . then the code works proper . but when i plug in the device ,OS pop up a dailog “New Hardware Found” and require me to install the driver manually .
…
My question is how can i install the driver successfully while there is no relevant device attached the PC . The INF didn’t pass WHQL ,for the reason that the driver still in test . I had experiment that the driver pass WHQL will resolved this problem , Is there any way to workaround the problem .My purpose is not to Pop up “New hardware Found”. any warning will be OK.
I’m not sure I exactly understand your situation. Your code was not
“pre-installing” the driver. All you were doing was shoving an INF file
into place, and that will break the CAT file signature. Did you intend
to use SPOST_PATH instead of SPOST_NONE?
Alternatively, you could use DPInst or “devcon dp_install” to copy the
whole driver package into the driver store. That way, the operating
system can find it automatically.
Even with that, XP is still going to put up the “new hardware found”
dialog, but you can say “search automatically” instead of a manual install.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
>I’m not sure I exactly understand your situation. Your code was not
“pre-installing” the driver. All you were doing was shoving an INF file
into place, and that will break the CAT file signature. Did you intend
to use SPOST_PATH instead of SPOST_NONE?
Alternatively, you could use DPInst or “devcon dp_install” to copy the
whole driver package into the driver store. That way, the operating
system can find it automatically.
I will try this ASAP.
Even with that, XP is still going to put up the “new hardware found”
dialog, but you can say “search automatically” instead of a manual install.
Is there any way to avoid this pop up ? I found there is a topic talking about test signed or i use Inf2cat to make a temp cat file ?
xxxxx@hotmail.com wrote:
> Even with that, XP is still going to put up the “new hardware found”
> dialog, but you can say “search automatically” instead of a manual install.
Is there any way to avoid this pop up ? I found there is a topic talking about test signed or i use Inf2cat to make a temp cat file ?
Not on an arbitrary computer. If you own the computer, you can sign the
catalog file and install your certificate as a “trusted publisher”. But
you can’t do that on a customer’s computer.
If there were an easy way to get around these dialogs, there wouldn’t be
much point in having a WHQL.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
>Not on an arbitrary computer. If you own the computer, you can sign the
catalog file and install your certificate as a “trusted publisher”. But
you can’t do that on a customer’s computer.
I just try on my computer ,and make sure can it can be achievable , and show it to the customer .
how to sign the catalog file , any document sample would be appreciate.
and how to install certificate as a “trusted publisher”. Is the certificate something like .cer and .pvk .spc ?
does signing the catalog file need to pass DTM and get the .cpk file ? i didn’t pass that yet.
xxxxx@hotmail.com wrote:
> Not on an arbitrary computer. If you own the computer, you can sign the
> catalog file and install your certificate as a “trusted publisher”. But
> you can’t do that on a customer’s computer.
I just try on my computer ,and make sure can it can be achievable , and show it to the customer .
how to sign the catalog file , any document sample would be appreciate.
Have you done any searching for this? There is lots of information
available.
There is a very good white paper from Microsoft on this topic called
“Kernel-Mode Code Signing Walkthrough” that not only describes the
process, but includes a step-by-step recipe to show you how it is done:
http://msdn.microsoft.com/en-us/windows/hardware/gg487328
Do you already have a code-signing certificate to use, from one of the
approved certificate authorities?
and how to install certificate as a “trusted publisher”. Is the certificate something like .cer and .pvk .spc ?
Yes. You use the certificate manager to install your code-signing
certificate in one of the stores. You can get to that from Control
Panel, or by typing “certmgr.msc” in the Start -> Run box.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
xxxxx@hotmail.com wrote:
does signing the catalog file need to pass DTM and get the .cpk file ? i didn’t pass that yet.
Sigh. This really isn’t that hard to understand, is it? For your own
testing, you sign the catalog file (and optionally the .sys file) with
YOUR certificate. You will need to do that in order to complete your
testing on 64-bit systems. Then, after you run the DTM tests and create
your .cpk file, you submit that to WHQL, and they will replace your
certificate in the catalog file with the WHQL certificate.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
>Sigh. This really isn’t that hard to understand, is it? For your own
testing, you sign the catalog file (and optionally the .sys file) with
YOUR certificate. You will need to do that in order to complete your
testing on 64-bit systems. Then, after you run the DTM tests and create
your .cpk file, you submit that to WHQL, and they will replace your
certificate in the catalog file with the WHQL certificate.
Got you ,I have started with kernel mode code sign walk through . and have make certificate ,inf2cat make cat and sign the cat, add the certificate to CA .
i have another question , how a test certificate (maybe is trusted) work and find the proper INF file to install the driver with i just shoving inf file into place ? Is there any documents talking about the procedure of OS loadi the INF (*.sys)?
xxxxx@hotmail.com wrote:
i have another question , how a test certificate (maybe is trusted) work and find the proper INF file to install the driver with i just shoving inf file into place ?
Your driver package has to be “pre-installed”, which copies all of the
file in the package to the driver store. That doesn’t install the
driver, but it makes it AVAILABLE for installing. When a new piece of
hardware appears, the system knows to look in the driver store before
asking for a manual installation. “Dpinst” and “devcon dp_add” can both
perform this function.
Is there any documents talking about the procedure of OS loadi the INF (*.sys)?
There are MANY such documents. Have you read the WDK pages about driver
installation?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Thanks Tim ,
Your driver package has to be “pre-installed”, which copies all of the
file in the package to the driver store. That doesn’t install the
driver, but it makes it AVAILABLE for installing. When a new piece of
hardware appears, the system knows to look in the driver store before
asking for a manual installation. “Dpinst” and “devcon dp_add” can both
perform this function.
So ,“Pre-install” the sign driver that use the trusted certificate can avoid manual installation.
i have try devcon dp_add and look into the code ,it works with SetupCopyOEMInf.
and it is strange not to copy the *.sys file ,i will go on checking this problem .
xxxxx@hotmail.com wrote:
So ,“Pre-install” the sign driver that use the trusted certificate can avoid manual installation.
i have try devcon dp_add and look into the code ,it works with SetupCopyOEMInf.
Yes, but it uses SPOST_PATH, which records the path to the original
files in the list of places to search. That’s how the system can find
the .sys file when it needs it. You used SPOST_NONE, which does not do
that. When you use SetupCopyOEMInf like that, you can’t move the files
somewhere else. The system remembers the path you passed.
and it is strange not to copy the *.sys file ,i will go on checking this problem .
Dpinst uses a different API – DriverPackagePreinstall – which copies
the package to the driver store, so you don’t have to keep the files in
their original location.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Thanks Tim, thanks for your patience and explicit statement.