Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/14/2010

Windows Mobile 6.5 has a flexible security model that allows access to be restricted to parts of the file system and registry. Because devices from different manufacturers or mobile operators may have different security configurations, make sure that you follow these guidelines when you write files or registry settings to help make sure that the application will run on all devices.

Compatibility and File Paths

User files should be saved in the My Documents folder. This is both for security considerations and to create a consistent user experience for all applications. You should not hard code the path of the My Documents folder, as this can potentially change with new OS versions. Instead, in native code, you should discover the path dynamically using the SHGetSpecialFolderPathfunction. In managed code, use the System.Environment.GetFolderPath method.

Do not hard code paths to folders on storage cards. Instead, use the FindFirstFlashCardand FindNextFlashCardfunctions to enumerate the available flash cards. Then, after mounting the appropriate card, call SHGetDocumentsFolderto obtain the My Documents folder on the card.

Compatibility and Registry Key Locations

Applications should only write to registry keys under the HKEY_CURRENT_USER key. Attempts to write to other locations in the registry may fail on some devices.