Share via


Objects and Object Identifiers (Windows CE 5.0)

Send Feedback

An object is defined as one of the following:

  • A registry key
  • A registry value
  • A file
  • A 4-KB chunk of file data (that is, a 12-KB file will have one file object and three 4-KB chunks, which are also objects)
  • A database record, which can hold up to 4 KB of data
  • An extension of a database record, which can be an additional 4 KB of data
  • A database
  • A database volume

Windows CE assigns each object in the object store a unique Windows CE object identifier (CEOID). The most common use for a CEOID is to access object data, such as a database record, and to obtain object data.

Because a CEOID is guaranteed to be unique within a volume, but not across multiple volumes, Windows CE also gives each database volume a predefined Windows CE globally unique identifier (CEGUID). Use the CEGUID in conjunction with the CEOID as a unique reference for each object in the object store and in the database volumes.

Note   Earlier versions of Windows CE assigned object identifiers to objects in other file systems, such as the FAT file system. Effective with version 2.1, only objects in the object store and database volumes have valid, unique object identifiers.

Obtaining the object identifier of an object is the first step in accessing or manipulating any information about that object. The following table shows where to obtain the Windows CE object identifier for the various types of objects in the object store.

Object type Location
Directory or file In the dwOID member of the WIN32_FIND_DATA structure, which is returned by the FindFirstFile and FindNextFile functions. Also, in the dwOID member of the BY_HANDLE_FILE_INFORMATION structure, which is returned by the GetFileInformationByHandle function.
Database In the return value of the CeCreateDatabaseEx2 or CeFindNextDatabaseEx function.
Database record In the return value of the CeSeekDatabaseEx, CeReadRecordPropsEx, or CeWriteRecordProps function.
Mounted database volume In the return value of the CeMountDBVol and CeEnumDBVolumes functions.

Use the CeOidGetInfoEx function to return object data that is associated with the Windows CE object identifier. This function returns object data in a CEOIDINFO structure. The wObjType member of CEOIDINFO contains a flag that indicates the object type, such as OBJTYPE_DATABASE for a database object, and identifies the object structure to use to access the data. CEOIDINFO also contains a member that returns data on a file, directory, database, or database record. These values correspond to the type of object that is indicated by the wObjType member. For example, using CeOidGetInfoEx on a database of a mounted database volume returns the database name, type identifier, number of records, database size, and sort order in a CEDBASEINFO structure, as well as the OBJTYPE_DATABASE value.

Note   If an object in the object store or a record in a database volume is saved to persistent storage and is then restored, the restored object or record is not guaranteed to have the same OID as the original. An application should not expect OIDs to be immutable during save and restore operations.

The number of objects that can exist in the object store has been increased to 222, or more than four million, effective with version 3.0. Windows CE may reassign freed object identifiers to new objects. However, an object identifier will not be reused for at least 16 object allocations.

See Also

Object Store

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.