次の方法で共有


WriteRegistryToOEM

This function enables writing the registry file to persistent storage defined by the OEM.

  BOOL WriteRegistryToOEM (
DWORD dwFlags,
LPBYTE lpData,
DWORD cbData );

Parameters

  • dwFlags
    Read options specified by the system; currently, the only flag is REG_WRITE_BYTES_START, which indicates the start of the new registry file.
  • lpData
    Pointer to a buffer allocated by the OS and filled with registry bytes. Your WriteRegistryToOEM function retrieves the bytes and saves them in persistent storage.
  • cbData
    The number of bytes in the buffer lpData passed in by the OS. When set to 0, then end-of-file has been reached.

Return Values

TRUE indicates success; FALSE indicates failure.

Remarks

The OS exposes a global pointer named pWriteRegistryToOEM that is available in the OAL. To support persistent storage of the registry, you must implement the function WriteRegistryToOEM and assign the address of the function to pWriteRegistryToOEM. When the OS is instructed to flush the registry, the OS checks for a valid pWriteRegistryToOEM. If pWriteRegistryToOEM is valid, the OS continues to call this function to send bytes to the OEM implemented function until it returns FALSE (an error occurred) or the OS completes the flush.

The registry is notified that it needs to be flushed when RegFlushKey is called by an application.

Only a fully saved registry can be restored; attempting to restore a partial registry produces unpredictable results. If you try to save a partial registry, cbData is never set to 0. Then, when WriteRegistryToOEM is called, an error should be returned because the registry file is incomplete.

If you implement this function, you should document its support for your specific target device. Because the data format used by this function is different than the format used by RegCopyFile, the data can not be exchanged.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.10 and later Pkfuncs.h    

See Also

pWriteRegistryToOEM, ReadRegistryFromOEM,