Problem loading sample portio driver on WinXP

Hello,

I have been out of this driver thing for a while and now am trying to pick it up again. I am sure this is just some stupidism on my part and I could sure use a little head prying.

I am running a Dell laptop with Windows XP SP3.

I downloaded the WINDDK v7600 and built the portio sample kernel driver using the x86 checked build environment for WinXP.

C:\WINDDK\7600.16385.1\src\general\portio

The driver and exe’s built without errors or warnings. I installed the resulting KDMF driver and the installation reports success but the driver does not start. I follow the instructions in the portio readme buit I can not get the driver to run. It seems to install ok but it never even seems to call DriverEntry. I do not even get a debug message placed at the beginning of the DriverEntry funtion. The Device Manager shows the Sample Driver Device with the little yellow exclamation point and properties displays the message:

Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)

If I take the portio source code from the WINDDK v3790 package and compile it with the v7600 DDK (same build environment) and then install it, it works fine.

So whats up?? Whats the magic to getting this WDF stuff to run??

Thanks…

You are not providing the WDF coinstallers in your install directory is
the most likely cause.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@peoplepc.com” wrote in message
news:xxxxx@ntdev:

> Hello,
>
> I have been out of this driver thing for a while and now am trying to pick it up again. I am sure this is just some stupidism on my part and I could sure use a little head prying.
>
> I am running a Dell laptop with Windows XP SP3.
>
> I downloaded the WINDDK v7600 and built the portio sample kernel driver using the x86 checked build environment for WinXP.
>
> C:\WINDDK\7600.16385.1\src\general\portio
>
> The driver and exe’s built without errors or warnings. I installed the resulting KDMF driver and the installation reports success but the driver does not start. I follow the instructions in the portio readme buit I can not get the driver to run. It seems to install ok but it never even seems to call DriverEntry. I do not even get a debug message placed at the beginning of the DriverEntry funtion. The Device Manager shows the Sample Driver Device with the little yellow exclamation point and properties displays the message:
>
> Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)
>
>
> If I take the portio source code from the WINDDK v3790 package and compile it with the v7600 DDK (same build environment) and then install it, it works fine.
>
> So whats up?? Whats the magic to getting this WDF stuff to run??
>
> Thanks…

Which co-installers?
The only one mentioned in the ini file is WdfCoInstaller01009.dll and I am including that in the install folder. Are there others?

Thanks for your prompt reply.

> The only one mentioned in the ini file is WdfCoInstaller01009.dll and I am

including that in the install folder. Are there others?Yes, but 1009
should suffice for WinXP.

Check the setupapi.log in the Windows folder, for more details of you Error
Code 39 failure.

Phil

Thanks for the tip, the setupapi.log looks like a good source of info however in this case the only hint was

#I163 Device not started: Device has problem: 0x27: CM_PROB_DRIVER_FAILED_LOAD.

This seems pretty strange because I am just building the sample, copying the co-installer to the driver output directory and using the add hardware feature of the control panel.

I have tried many variations on this including updating the class guid to be sure the device is unique.
I am also not seeing any conflicts on the I/O ports this thing wants to use.
Like I said, it does not even look like DriverEntry is being called.

I am starting to wonder if maybe there is something wrong with my xp installation regardiing support of WDF stuff (??) or some corruption of the registry…although I can find nothing amiss in HKLM\LOCAL_MACHINE\CurrentControlSet\Services.

None of the WDF stuff seems to load but the WDM driver stuff works fine.

Go figure.

I have my IT dept working on getting me a Windows 7 box (which is the real target)…
Maybe I will have better luck with that…

open genport.inx

search and replace

PORTIO_Device? with ?PortIO_Inst

as posted here

http://msdn.microsoft.com/en-us/windows/hardware/gg487438.aspx

Port I/O sample driver: There is a syntax issue in the file
?\src\general\portio\sys\genport.inx that prevents the driver from
being successfully installed on pre-Windows 7 systems. The workaround
is to replace all occurrences of ?PORTIO_Device? with ?PortIO_Inst?.

do build -bcZ

copy redist\wdf…, genport.sys, genport.inf. gpdread, gpdwrite to media

do

C:\WinDDK\7600.16385.1\Tools\devcon\i386>DEVCON.EXE INSTALL y:\genport.inf “root
\portio”
Device node created. Install is complete when drivers are installed…
Updating drivers for root\portio from y:\genport.inf.
Drivers installed successfully.

C:\WinDDK\7600.16385.1\Tools\devcon\i386>y:\GpdRead -b 1
Read from port 1 returned ff

C:\WinDDK\7600.16385.1\Tools\devcon\i386>y:\Gpdwrite -b 2 1
Wrote data 1 to port 2

C:\WinDDK\7600.16385.1\Tools\devcon\i386>

On 8/2/12, xxxxx@peoplepc.com wrote:
> Thanks for the tip, the setupapi.log looks like a good source of info
> however in this case the only hint was
>
> #I163 Device not started: Device has problem: 0x27:
> CM_PROB_DRIVER_FAILED_LOAD.
>
> This seems pretty strange because I am just building the sample, copying the
> co-installer to the driver output directory and using the add hardware
> feature of the control panel.
>
> I have tried many variations on this including updating the class guid to be
> sure the device is unique.
> I am also not seeing any conflicts on the I/O ports this thing wants to
> use.
> Like I said, it does not even look like DriverEntry is being called.
>
> I am starting to wonder if maybe there is something wrong with my xp
> installation regardiing support of WDF stuff (??) or some corruption of the
> registry…although I can find nothing amiss in
> HKLM\LOCAL_MACHINE\CurrentControlSet\Services.
>
> None of the WDF stuff seems to load but the WDM driver stuff works fine.
>
> Go figure.
>
> I have my IT dept working on getting me a Windows 7 box (which is the real
> target)…
> Maybe I will have better luck with that…
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Thank you Raj.
That was it.