Partager via


Erasing the Object Store

The object store for Windows CE is persistent across warm boots as long as the boot process does not cause other code that changes the contents of RAM, such as hardware initialization code, to get executed. On occasion, you may want to completely erase the object store by triggering a cold reboot. For example, you may create a prototype that tests the cold system boot process. While an application can call the SetCleanRebootFlag function to perform a cold boot, you can also implement the following procedure in the boot process.

To erase the object store during the boot process

  1. Include the Romldr.h file in your OAL code.

  2. Declare the following variable in your OAL.

    extern ROMHDR *const volatile pTOC;
    

    The ulRAMFree member of the ROMHDR structure identifies the start of free memory. The UlRAMFree location also identifies the start of the object store information.

  3. Signal a cold boot in OEMInit by setting the first three DWORD variables starting at pTOC->ulRAMFree, to 0.

    The following code example shows how to set the first three DWORD variables to 0.

    memset(pTOC->ulRAMFree,0,sizeof(DWORD)*3)
    

Setting the first three DWORD values to 0 during OEMInit ensures that a cold boot of the object store occurs during the boot process.

See Also

Completing an OAL

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.