Digivation Hack Central

WinCE

Using WinCE5.0 drivers on WinCE4.2

by mark on Feb.09, 2010, under WinCE

Since wince 4.2 is quite old and not that well supported by OEM device manufacturers, it is often hard or impossible to get drivers for wince4.2 for these devices.

However the API into coredll and other parts of the wince system libraries is, if not identical, then almost identical.

I had an instance recently where I needed to make a USB wifi device work with wince4.2. After doing some research, I chose a ralink 2471W based device. However it came with a wince5 driver. Binary only of course.

Looking at the driver dll, all the imported functions were available except 1 in the ndis.dll, that being NdisQueryPacket. In wince4.2, this fucntion is provided by a #define, but in wince5 it is a instantiated function.

The solution is to compile the following code to an obj, and use the lib32 to add it to ndislib.lib in the private tree.


// local modded copy of ndis.h
#include "ndis.h"
#include <pkfuncs.h>

VOID
NdisQueryPacket(
IN PNDIS_PACKET _Packet,
OUT PUINT _PhysicalBufferCount OPTIONAL,
OUT PUINT _BufferCount OPTIONAL,
OUT PNDIS_BUFFER * _FirstBuffer OPTIONAL,
OUT PUINT _TotalPacketLength OPTIONAL
)
{
NdisQueryPacketDef(_Packet, _PhysicalBufferCount, _BufferCount, _FirstBuffer, _TotalPacketLength);
}

Also add the export definition to the end of ndis.def so that it becomes exported when ndis.dll is built with the system.

Finally, remember to put these 2 files back in the private tree where you got them from.

Now when the system is rebuilt with platform builder, the new ndis.dll will contain this extra function, thus allowing the USB wifi driver to function perfectly without modification.

Leave a Comment :, , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...