Windows Dev Center

IGPEInformation::GetRegistryKey method

The GetRegistryKey method retrieves a handle to the root of the registry key for the specified section of the GPO.

Syntax


HRESULT GetRegistryKey(
  [in]  DWORD dwSection,
  [out] HKEY  *hKey
);

Parameters

dwSection [in]

Specifies the GPO section. This parameter can be one of the following values.

ValueMeaning
GPO_SECTION_USER

User section

GPO_SECTION_MACHINE

Computer section

 

hKey [out]

Receives the handle to the registry key. This handle is opened with all access rights. For more information, see Registry Key Security and Access Rights.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in the Platform SDK header file WinError.h. If registry information is not loaded, the method 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, first call the RegOpenKeyEx function to open the Software\Policies key.

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

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Gpedit.h

DLL

Gpedit.dll

IID

IID_IGPEInformation is defined as 8FC0B735-A0E1-11d1-A7D3-0000F87571E3

See also

Group Policy Overview
Group Policy Interfaces
IGPEInformation

 

 

Show:
© 2015 Microsoft