Monday, September 24, 2007

Windows CE QFE's

Every month the Windows Embedded team is realizing Quick Fix Engineering (QFE) to fix some software issues for Windows CE 5.0 and Windows Embedded CE 6.0.
Those patches have to be installed on your development computer. So you have to regenerate your Windows CE binary image to integrate those new improvements in your device. Every year all the QFE's are grouped into one single MSI file to reduce the time spent to install those QFE's on a clean computer.
So do not forget to update your development computer every month :-)

All QFE are available from the Microsoft website
- Nicolas

Monday, September 17, 2007

How to fix an ordinal error

Most of the time if your are using an SDK to build your application that doesn't match with the current Windows CE binary image you are using to run this application, your application could not be launched and you have an ordinal error :
"Function @ Ordinal 1788 missing in Module 'coredll.dll'"
That's mean that your application is using a Win32 API that was available in the SDK but is definitively not available in your image. So a Component is missing in the OSDesign.

How could I find the missing function ?

To find the missing component you have to find where ordinals are defined for the coredll.dll (the Dll containing the most common Win32 APIs). When you are building a Dynamic Library (DLL) you always have to provide the entry points of the final binary file, as you can have private and public procedures in a DLL, the public functions are definied in a def file using by the linker to export those entry points.
For the Coredll.dll library each function is associated to an ordinal, so in the Coredll.def file you will find all the Win32 entry points.

Where to locate the coredll.def file ?

The Coredll.def file will be proceed during the sysgen phase of the build, so depending on the components you selected in the OSDesign some functions will be disabled by CESYSGEN filtering. That's the main goal of the sysgen. So instead of looking at the resultant file, you have to look at the original one.
This file is located in :
_WINCEROOT\PUBLIC\COMMON\OAK\LIB\_CPUDEPPATH
Depending on the processor family of your target device, you will not have the same content as some functions have aliases depending on the processor for which it is compiled for.

How could I identify the missing component ?

Open the coredll.def file corresponding to the processor family you are using and search for the missing ordinal. In our case we are looking for ordinal 1788.
....
; @CESYSGEN IF SHELLSDK_MODULES_AYGSHELL
; AYGSHELL thunks
SHDoneButtonI=xxx_SHDoneButton @1782
SHGetAppKeyAssocI=xxx_SHGetAppKeyAssoc @1783
SHSetAppKeyWndAssocI=xxx_SHSetAppKeyWndAssoc @1784
SHSetNavBarTextI=xxx_SHSetNavBarText @1785
SHSipPreferenceI=xxx_SHSipPreference @1786
NotSystemParametersInfoI=xxx_NotSystemParametersInfo @1787
SHCloseAppsI=xxx_SHCloseApps @1788
SHNotificationAddI=xxx_SHNotificationAdd @1806
SHNotificationUpdateI=xxx_SHNotificationUpdate @1807
SHNotificationRemoveI=xxx_SHNotificationRemove @1808
SHNotificationGetDataI=xxx_SHNotificationGetData @1809
; @CESYSGEN ENDIF
....

After locating the correct ordinal in the file scroll up to the previous @CESYSGEN IF statement. This one is used to include those APIs only in the case of the IF statement is evaluated to TRUE. In our case the SHELLSDK_MODULES_AYGSHELL variable must be set to have access to those APIs.

Most of the time the name of the variable is explicit enough to identify the component linked to it. In that case we identify the AYGSHELL component name. But some times it more complex to identify the module associated with.
So next time we will look more in details in the deptree mechanism to identify component and sysgen variables naming convention.

Stay connected ...

- Nicolas

Thursday, September 6, 2007

ESC East at Boston

Attending ESC East at Boston, MA from 9/18 to 9/21 ?
Come and visit us on Microsoft Booth, #401 !

For more details about this conference go to the ESC website

- Nicolas

Thursday, August 16, 2007

Windows CE CEDebugX

On his blog, Mike Hall introduces one of the cool new features available with the Windows CE SP1, the CEDebugX. This tool gives you the possibility to debug your platform applications and drivers, by detecting memory leak, memory corruption, deadlocks ....
Here's a link to the MSDN Channel 9 Video Page - and a link to the full screen video (WMV).

-Nicolas

Wednesday, August 15, 2007

Debugging technics for Windows CE (Part 2)

In Part1, we removed the driver or the application from the Windows CE image, but how to make sure that the file in my RAM file system is the last one I built !! Because if I modify my application and I did not re-download my Windows CE image, there is an instance of my driver or application already available in the RAM file system (downloaded by the OS on the previous launch of this module).There is an option in Platform Builder to force the system to always load the file from the desktop even if an instance is available on my RAM file system. You have to go in Target followed by Release Directory Modules then click on Add, and select the corresponding binary file in the list.
Now the OS will load it frmo your hard drive..


-Nicolas

Tuesday, August 14, 2007

Debugging technics for Windows CE (Part 1)

Everybody want to reduce the time used to debug developments, so I will share with you my tips to spend less time in debugging for your drivers, applications ...
First things that we can avoid is to download the Windows CE image to the device every time we made a modification of the driver or the application. So the idea is to exclude the driver or the application from the nk.bin. So in that case how my driver or application can be loaded ?
If KITL is enable in your Windows CE image you have by default an NFS (Network Filesystem) mounted in the RAM filesystem under Release folder. This NFS is the content of you _FLATRELEASEDIR on you desktop computer. By using this NFS you can access the content of your _FLATRELEASEDIR directly from Windows CE. When accessing a file for loading, the OS is using this NFS partition to find missing files in the current RAM filesystem. In our case the file is not available in the RAM filesystem but in the NFS partition, so the OS will copy it from this network path to the RAM filesystem.
In other words, if your binary file is not in the NK.bin but available on your harddrive in the _FLATRELEASEDIR, the system will be able to load it.

You can imagine now how to avoid the download of the Windows CE image every time you modify your source code.

-Nicolas

Tuesday, August 7, 2007

Windows CE 6.0 and SDKs

Every time you have to develop an application using VS2005 for Windows CE devices (smart devices) you have to generate the SDK associated to the OSDesign used to generate the current Windows CE binary image.
The SDK contains all the API enabled by selecting components in the OSDesign for the Common component and specific components (drivers, BSP applications, ...). Those APIs will be available in you VS2005 project, so the compiler will be able to build your application. This protect you on the usage of unsupported API by your Windows CE Image, in that case checking is done a build time and not at runtime.
Under VS2005 development environment they are some restrictions, that will be solved in the future by Microsoft (Hope so !). You must add the following components to your OSDesign, even if you do not need those functionalities :
  • AYGShell API Set
  • Windows Networking API/Redirector (SMB/CIFS)
Otherwise you will have that kind of error during the build :
fatal error C1083: Cannot open include file: 'winnetwk.h': No such file or directory

-Nicolas