Platform SDK: Group Policy

IGPEInformation::GetRegistryKey

Retrieves a handle to the root of the registry key for the specified section of the GPO.

HRESULT GetRegistryKey(
  DWORD dwSection,
  HKEY hKey
);

Parameters

dwSection
Specifies the GPO section. This parameter can be one of the following values.
Value Meaning
GPO_SECTION_USER User section
GPO_SECTION_MACHINE Computer section

hKey
Receives the handle to the registry key. This handle is opened with all access rights.

Return Values

If the function succeeds, the return value is S_OK. Otherwise, the function returns one of the COM error codes defined in the Platform SDK header file WinError.h.

Remarks

The registry handle is a handle to the root of the registry key. To get or set values in the Policies key, call the RegOpenKeyEx function to open the Policies key.

When you have finished using the registry handle, call the RegCloseKey function to close the handle.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Gpedit.h.

See Also

Group Policy Overview, Group Policy Interfaces, IGPEInformation