Remote API Functions

Send Feedback

Before you can invoke any RAPI functions, you must initialize the underlying communications layer between the host computer and the mobile device, which must be connected to the host computer through a cable or a cradle. There are two versions of the RAPI initialization function you can use: CeRapiInit and CeRapiInitEx. CeRapiInit does not return until the connection is made, an error occurs, or another thread calls CeRapiUninit.

CeRapiInitEx works slightly differently. Instead of blocking the calling thread, it returns an event handle to indicate when initialization is complete. Use CeRapiInitEx to avoid blocking a thread inside a call to CeRapiInit. CeRapiInitEx returns immediately and continues initialization until the connection is made, until an error occurs, or until there is a call to CeRapiUninit. When CeRapiInitEx is complete, it sets the event specified in the heRapiInit member of the RAPIINIT structure. After calling CeRapiInitEx, check the return value to determine whether an error occurred. If the call was initially successful, call the MsgWaitForMultipleObjects function to wait for the event handle passed back in the heRapiInit member of the RAPIINIT structure. When the event is set, check the hrRapiInit member of the RAPIINIT structure to determine whether the connection was successful. To shut down or to stop the connection process, call the CeRapiUnInit function.

The following table shows the complete set of Remote API (RAPI) functions.

Function PPC SP Description
CeCheckPassword X X Compares a specified string to the system password.
CeCloseHandle X X Closes an open object handle.
CeCopyFile X X Copies an existing file to a new file.
CeCreateDatabase X X Creates a new database.
CeCreateDatabaseEx X X Creates a new database in the object store or in a mounted volume.
CeCreateDirectory X X Creates a new directory.
CeCreateFile X X Creates, opens, or truncates a file, pipe, communications resource, disk device, or console. Returns a handle that can be used to access the object. Opens and returns a handle to a directory.
CeCreateProcess X X Runs a new program. Creates a new process and its primary thread. The new process executes the specified executable file.
CeDeleteDatabase X X Removes a database from the object store.
CeDeleteDatabaseEx X X Removes a database from the object store or a mounted database volume.
CeDeleteFile X X Deletes an existing file from the object store.
CeDeleteRecord X X Deletes a record from a database.
CeEnumDBVolumes X X Enumerates all mounted database volumes and returns the name for each.
CeFindAllDatabases X X Retrieves information about all databases of a given type residing on the Microsoft® Windows® CE device. Also, copies information to an array of CEDB_FIND_DATA structures.
CeFindAllFiles X X Retrieves information about all files and directories in the given directory of the Windows CE object store. Also, copies information to an array of CE_FIND_DATA structures.
CeFindClose X X Closes the specified search handle. The CeFindFirstFile and CeFindNextFile functions use the search handle to locate files with names that match a specified name.
CeFindFirstDatabase X X Opens an enumeration context to enable an application to enumerate all databases in the object store.
CeFindFirstDatabaseEx X X Opens an enumeration context for all databases in a database volume.
CeFindFirstFile X X Searches a directory for a file whose name matches the specified file name. CeFindFirstFile examines subdirectory names in addition to file names.
CeFindNextDatabase X X Retrieves the next database in an enumeration context.
CeFindNextDatabaseEx X X Retrieves the next database in an enumeration context.
CeFindNextFile X X Continues a file search from a previous call to the CeFindFirstFile function.
CeFlushDBVol X X Flushes information from a database volume to permanent storage.
CeGetClassName X X Retrieves the name of the class to which the specified window belongs.
CeGetDesktopDeviceCaps X X Retrieves device-specific information about a specified device.
CeGetDiskFreeSpace X X Retrieves the amount of space on a disk volume on a remote Microsoft® Windows® CE–based device.
CeGetFileAttributes X X Returns attributes for a specified file or directory.
CeGetFileSize X X Retrieves the size, in bytes, of the specified file.
CeGetFileTime X X Retrieves the date and time that a file was created, last accessed, and last modified.
CeGetLastError X X Returns the calling thread's last-error code value.
CeGetSpecialFolderPath X X Gets the path to a special shell folder.
CeGetStoreInformation X X Fills in a STORE_INFORMATION structure with the size of the object store and the amount of free space currently in the object store.
CeGetSystemInfo X X Returns information about the current system.
CeGetSystemMetrics X X Retrieves the dimensions, widths, and heights of Windows display elements and system configuration settings.
CeGetSystemPowerStatusEx X X Retrieves the power status of the system.
CeGetTempPath X X Gets the path to the directory designated for temporary files.
CeGetVersionEx X X Obtains extended information about the version of the operating system that is currently running.
CeGetWindow X X Retrieves the handle to a window that has the specified relationship to the specified window.
CeGetWindowLong X X Retrieves information about the specified window. Also retrieves the 32-bit (long) value at the specified offset into the extra window memory of a window.
CeGetWindowText X X Copies the text of the specified window's title bar — if it has one — into a buffer. If the specified window is a control, the text of the control is copied.
CeGlobalMemoryStatus X X Gets information on the physical and virtual memory of the system.
CeMountDBVol X X Issues a mount request for a database volume that contains both data and an integrity log. Also, returns a CEGUID that is the globally unique identifier (GUID) of a mounted database.
CeMoveFile X X Renames an existing file or a directory, including all its children.
CeOidGetInfo X X Retrieves information about an object in the object store.
CeOidGetInfoEx X X Retrieves information about an object in the object store or a mounted database volume.
CeOpenDatabase X X Opens an existing database.
CeOpenDatabaseEx X X Opens an existing database on any database volume, including mounted databases.
CeQueryInstructionSet X X This function queries a Windows CE-based device to determine whether it supports the specified processor-specific instruction set.
CeRapiFreeBuffer X X Frees the memory on the desktop computer allocated by a call to CeFindAllDatabases, CeFindAllFiles, or CeReadRecordProps.
CeRapiGetError X X Reports remote API related failures, and can be used to determine whether a call failed due to a failure in the remote API.
CeRapiInit X X Attempts to initialize the Windows CE remote application-programming interface.
CeRapiInitEx X X Attempts to initialize the Windows CE remote application-programming interface and initially returns an event handle.
CeRapiInvoke X X Can be used as a general-purpose mechanism to remotely execute a routine.
CeRapiUninit X X Uninitializes the Windows CE remote application-programming interface.
CeReadFile X X Reads data from a file, starting at the position indicated by the file pointer.
CeReadRecordProps X X Reads properties from the current record.
CeReadRecordPropsEx X X Reads properties from the current record.
CeRegCloseKey X X Releases the handle of the specified key.
CeRegCreateKeyEx X X Creates the specified key. If the key already exists in the registry, the function opens it.
CeRegDeleteKey X X Deletes a named subkey from the specified registry key. The subkey to be deleted cannot have any subkeys.
CeRegDeleteValue X X Removes a named value from the specified registry key.
CeRegEnumKeyEx X X Enumerates subkeys of the specified open registry key.
CeRegEnumValue X X Enumerates the values for the specified open registry key. Also, copies one indexed value name and data block for the key each time it is called.
CeRegOpenKeyEx X X Opens the specified key.
CeRegQueryInfoKey X X Retrieves information about a specified registry key.
CeRegQueryValueEx X X Retrieves the type and data for a specified value name that is associated with an open registry key.
CeRegSetValueEx X X Stores data in the value field of an open registry key. It can also set additional value and type information for the specified key.
CeRemoveDirectory X X Deletes an existing empty directory.
CeSeekDatabase X X Seeks the specified record in an open database.
CeSetDatabaseInfo X X Sets various database parameters, including the name, type, and sort-order descriptions.
CeSetDatabaseInfoEx X X Sets various database parameters, including the name, type, sort-order descriptions, and compression of the database.
CeSetEndOfFile X X Moves the end-of-file position for the specified file to the current position of the file pointer.
CeSetFileAttributes X X Sets a file's attributes.
CeSetFilePointer X X Moves the file pointer of an open file.
CeSetFileTime X X Sets the date and time that a file was created, last accessed, or last modified.
CeSHCreateShortcut X X Creates a shortcut.
CeSHGetShortcutTarget X X Retrieves the shortcut's target path.
CeSyncStart X X Begins synchronization between a desktop and a remote Microsoft® Windows® CE–based device.
CeSyncStop X X Stops synchronization between a desktop and a remote Microsoft® Windows® CE–based device.
CeUnmountDBVol X X Unmounts a database volume.
CeWriteFile X X Writes data to a file. It starts writing data to the file at the position indicated by the file pointer.
CeWriteRecordProps X X Writes a set of properties to a single record, creating the record if necessary.
RAPIEXT X X Used to create a RAPI extension on a Windows CE function.

See Also

Remote API (RAPI) Reference

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.