Objects and Object Identifiers (Windows Embedded CE 6.0)
1/6/2010
An object is defined as one of the following:
- A registry key.
- A registry value.
- A file.
- A 4-KB chunk of file data. For example, a 12-KB file has one file object and three 4-KB chunks of data, 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 Embedded CE assigns each object in the object store a unique Windows Embedded 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 Embedded CE also gives each database volume a predefined Windows Embedded 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 Embedded CE assigned object identifiers to objects in other file systems, such as the FAT file system. Effective with Windows CE 2.10, 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 Embedded 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 the 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 (CEDB) or the CeFindNextDatabaseEx (CEDB) function. |
Database record |
In the return value of the CeSeekDatabaseEx (CEDB), the CeReadRecordPropsEx (CEDB), or the CeWriteRecordProps (CEDB) function. |
Mounted database volume |
In the return value of the CeMountDBVol (CEDB) and the CeEnumDBVolumes (CEDB) functions. |
Use the CeOidGetInfoEx (CEDB) function to return object data that is associated with the Windows Embedded CE object identifier. This function returns object data in a CEOIDINFOEX (EDB) 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, calling CeOidGetInfoEx on a database in 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. Do 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 2 to the 22nd power, or more than four million, effective with Windows CE 3.0. Windows Embedded CE may reassign freed object identifiers to new objects. However, an object identifier is reused for at least 16 object allocations.