OpenRegStream function (shlobj_core.h)

[OpenRegStream is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use SHOpenRegStream2 or SHOpenRegStream.]

Opens a registry value and supplies an IStream interface that can be used to read from or write to the value.

Syntax

IStream * OpenRegStream(
  [in]           HKEY   hkey,
  [in, optional] PCWSTR pszSubkey,
  [in, optional] PCWSTR pszValue,
                 DWORD  grfMode
);

Parameters

[in] hkey

Type: HKEY

A handle to the key that is currently open.

[in, optional] pszSubkey

Type: PCWSTR

A null-terminated Unicode string that specifies the name of the subkey.

[in, optional] pszValue

Type: PCWSTR

A null-terminated Unicode string that specifies the value to be accessed.

grfMode

Type: DWORD

The type of access for the stream. This can be one of the following values.

STGM_READ

Open the stream for reading.

STGM_WRITE

Open the stream for writing.

STGM_READWRITE

Open the stream for reading and writing.

Return value

Type: IStream*

Returns the address of an IStream interface if successful, or NULL otherwise.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)