Platform SDK: Group Policy

IGroupPolicyObject::GetRegistryKey

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

HRESULT GetFileSysPath(
  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 a 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. If the registry information is not loaded, GetRegistryKey returns E_FAIL.

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 RegOpenKey function to open the Software\Policies key first.

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, IGroupPolicyObject