Partager via


OEMReadRegistry (Compact 2013)

10/16/2014

This function reads a registry file into RAM from persistent storage as defined by the OEM.

Syntax

DWORD OEMReadRegistry  (
  DWORD dwFlags, 
  LPBYTE lpBuf, 
  DWORD len
);

Parameters

  • dwFlags
    [in] Read options specified by the OS.

    REG_READ_BYTES_START indicates that reading must start from the beginning of the registry file.

  • lpBuf
    [in] Pointer to a buffer allocated by the OS.

    You must load the buffer with registry bytes up to a maximum of len.

  • len
    [in] Size, in bytes, of the buffer to which lpBuf points.

    This value is passed in by the OS.

Return Value

Returns the number of bytes added to lpBuf. Returns 0 (zero) if the end of file (EOF) has been reached. Returns -1 if your function's read functionality has failed and the OS must load the default registry.

Remarks

You can only call this function from kernel mode.

You implement this function to restore the registry from persistent storage. If you implement OEMReadRegistry, set the pfnReadRegistry member of OEMGLOBAL to point to this function.

During registry initialization, the OS checks for a valid pfnReadRegistry member. If it is valid, the OS continues to retrieve bytes by calling the function that pfnReadRegistry points to until that function returns 0 (zero), for end of file, or -1.

If severe problems occur or conditions exist under which the initialization cannot continue, you can implement this function so it does not return. For example, you can inform the user of the problem and possible solutions.

Because the OS is running a single thread at this stage of initialization, no other OS activity occurs unless this function returns.

This function and the OEMWriteRegistry function are supported only by the object store-based registry. To save and restore data in the hive-based registry, use the RegSaveKey and the RegReplaceKey functions.

This function cannot directly import the data file saved by the RegCopyFile function. Use RegCopyFile to save the data to be restored by the RegRestoreFile function, or use OEMWriteRegistry to save the data that this function imports.

Requirements

Header

pkfuncs.h

Library

OEMMain.lib or OEMMain_StaticKITL.lib

See Also

Reference

Optional OAL Functions