Microsoft KB Archive/322223

= How To Load Dynamic-Link Libraries Into Process Slot 1 =

Article ID: 322223

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Windows CE .NET 4.2

-



This article was previously published under Q322223



SUMMARY
The Windows CE .NET operating system introduces a new feature to reduce the burden of execute in place (XIP) dynamic-link libraries (DLLs) on the 32-MB virtual address space.

In earlier versions, all XIP DLLs have address regions permanently reserved in every process address space (slot). These reserved regions cannot be used for OS managed heap memory or for other DLLs. Because processes never use all ROM DLLs, this unnecessarily consumes valuable address space in every process slot.

With Windows CE .NET, you can load XIP DLLs into process slot 1 and access them from any other process slot. The result is that each process has an additional 32-MB XIP region, and the standard 32 MB process space is free for use by heap and RAM-loaded modules.



MORE INFORMATION
The ROMimage tool determines during build time whether a particular module is placed in the slot 1 address space.

To be placed in slot 1, a module must meet two criteria:


 * The module is an XIP module (that is, the module is in the MODULES section of its respective .bib file, and no compression has been specified.)
 * The module has a valid .rel file of the same name in the same folder during the ROM image build.

The .rel file is generated when the /savebaserelocations linker switch is used during a build of the module. By default, this switch is turned on for modules that are built by using the OS build process (Build.exe), but it is not included for modules that are built by using the Platform Builder IDE. To enable this switch in the IDE so that a .rel file is generated (and therefore meets the qualifications to be placed into process slot 1), follow these steps:


 * 1) Open the Linker Settings dialog box for the DLL project.
 * 2) In the Project Options window, locate the /incremental switch, and then verify that it is set to /incremental:no. You must do this because a .rel file is not generated for an incremental link.
 * 3) Add the switch /savebaserelocations: .rel in the Project Options window, where   is the path and base filename that matches the project output file name.

Before you build the ROM image, verify that the .rel file is in the same folder that is specified by the .bib statement that includes the module.

Keywords: kbhowto KB322223

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.