OpenRegStream function

[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(
  HKEY   hkey,
  PCWSTR pszSubkey,
  PCWSTR pszValue,
  DWORD  grfMode
);

Parameters

hkey

Type: HKEY

A handle to the key that is currently open.

pszSubkey

Type: PCWSTR

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

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

   
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)