Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.6 KB

nf-winsvc-getserviceregistrystatekey.md

File metadata and controls

82 lines (61 loc) · 2.6 KB
UID title description tech.root ms.date ms.keywords targetos req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_type api_location api_name f1_keywords
NF:winsvc.GetServiceRegistryStateKey
GetServiceRegistryStateKey
Returns a handle for a registry key for a service to read and/or write state to.
security
4/26/2019
GetServiceRegistryStateKey
Windows
function
winsvc.h
Onecore.lib
Windows 10, version 2004 (10.0; Build 19041)
Windows Server, version 2004 (10.0; Build 19041)
apiref
DllExport
sechost.dll
GetServiceRegistryStateKey
GetServiceRegistryStateKey
winsvc/GetServiceRegistryStateKey

-description

Returns a handle for a registry key for a service to read and/or write state to.

-parameters

-param ServiceStatusHandle

A handle to the status information structure for the current service. This handle is returned by the RegisterServiceCtrlHandler function.

-param StateType

A member of the SERVICE_REGISTRY_STATE_TYPE specifying the state type for which the service registry key is retreived.

-param AccessMask

The access mask with which to attempt to open the state key. For more information, see Registry Key Security and Access Rights.

-param ServiceStateKey

Receives the output registry key handle.

-returns

ERROR_SUCCESS when all operations complete successfully; otherwise, a Win32 error code.

-remarks

For ServiceRegistryStatePersistent, the security of the directory is set to only provide write access to the local system account and the service SID. Ensure service SIDs are enabled for any service that calls this API. For more information, see SERVICE_SID_INFO.

For a similar API that provides service state that can be shared with associated programs, see GetSharedServiceRegistryStateKey.

All service state registry keys are deleted by the service control manager once the service is uninstalled.

-see-also

RegisterServiceCtrlHandler

GetSharedServiceRegistryStateKey

SERVICE_SID_INFO