Devcon.exe DDK sample has strange behavior with XP Embedded.

M

Michael Jones

(1) I am using the devcon.exe sample which ultimately uses
UpdateDriverForPlugandPlayDevices(). I am using devcon install to install a
non-plug-n-play device. Now what is interesting is that the first time I
boot into the XP Embedded image and I have Device manager and Software
Plug-n-Play components as well as the Explorer shell devcon works ok. I
install 2 of these non plug-n-play devices. The first one returns indeed a
0 from devcon install ... and the second one indeed returns 1 from devcon
install as it should. Works fine. Now if I go into device manager and
delete both of these all get deleted and if I look at the registry
everything "appears" to be gone. I reboot. Now if I do the same thing with
install 2 devices. The first time I run devcon install I get the following:
first run
(1) devcon install ... I get a return code of 2 meaning failure form
UpdateDriver... WHY ????
run it again
(2) devcon install .. I get a return code of 2 meaning failure from
UpdateDriver WHY ????
run it again
(3) devcon install.. I get a return code of 0x00000080 from the
CreaterProcess() that is running devcon install. BIG WHY ?????
run it again
(4) devcon install... I get a return code of 1 from Update Driver and the
device installs

So the first Device gets installed BUT why the convolutions...

Now on installing the second device
(1) decon install... I get a return code of 1 from UpdateDriver and the
device installs. Works
as expected...

The following is what I see with the other OSs.

I am using the devcon sample to manual install a non plug-n-plug bus driver
we have. Now I get the following different behaviors in 2k, 2k3, xp and now
xp embedded. I can make all to work consistently except for xp embedded.
Let me describe the 2k, 2k3 and xp behavior.

Question is really number 4 below as that is the environment I need for this
to work.

(1) 2k works ok and i can install multiple times ok with devcon.exe. The
reason is that 2k was not removing all our device objects correctly and
hence I can use devcon.exe multiple times to install multiple devices.
(2) 2k3 still had the 2k behaviour.
(3) Now xp would indeed unload our driver and sense our coinstaller is not
handling update driver we would unload and devcon was causing me to fail.
As a simple fix I have an IOCTL I call before I do the devcon.exe in a
process and this then causes our driver to fail the QUERY_REMOVE and hence
the driver does not unload and then I can use devcon to install multiple
devices. Nice


So all the above have "work arounds". I do not have alot of time to get
this to work hence I am using devcon.exe and I am using CreateProcess() from
within and exe that I have that allows the installation of multiple devices
we support and I can set them up from a text file that my exe using. The
important thing here is I am using devcon.exe to do the installation.

(4) Now XP Embedded is giving me a completely different behavior. I have
selected enough components to give me the Device Manager and also Software
Plug n Play devices.
Now it may be that I need a component but I do not know which and I am
pretty sure I have what I need. Now when I run devcon.exe from with with
XP Embedded even at the command I sometimes get an devcon failed. I am
using

devcon install myinf.inf my_hard_id

Now if I repeat the command above it will work sometimes I have to run it
couple of times.

Help
Mike Jones
 
S

Slobodan Brcin \(eMVP\)

Hi Michael,

I really can't tell you what problem is, we could guess it blinded, but it probably would take time.

If you want to install software driver on XPe then just make component that will populate same registry entries that are changed
when you install it. Use regmon to track changed registry entries and add them to component that you will make.

No programs or API calls are required.

Best regards,
Slobodan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top