Advapi32 Library
The Advapi32.dll library provides access to advanced Windows API functions, including those for registry operations, user and group management, security, and service control.
Overview
This library is fundamental for many system-level operations in Windows. It allows developers to interact with the Windows registry, manage user accounts and permissions, query system security information, and control Windows services.
Key Features
- Registry manipulation (reading, writing, deleting keys and values).
- Security descriptor manipulation and access control lists (ACLs).
- User and group management.
- Service control manager operations.
- Cryptographic services (though often supplemented by Crypt32.dll).
Core Functionality Categories
Registry Functions
These functions enable programmatic access to the Windows Registry, a hierarchical database that stores low-level settings for the operating system and for applications that opt to use the registry to store information.
| Function Name | Description |
|---|---|
RegOpenKeyEx |
Opens an existing registry key. |
RegQueryValueEx |
Retrieves the data and type of a specified registry value. |
RegSetValueEx |
Sets the data and extended attributes of a specified registry value. |
RegCreateKeyEx |
Creates or opens a specified registry key. |
RegDeleteKey |
Deletes a specified registry key. |
RegCloseKey |
Closes an open handle to a registry key. |
For a complete list, refer to the Registry Function Reference.
Security Functions
These functions deal with Windows security, including access tokens, security descriptors, and auditing.
| Function Name | Description |
|---|---|
CreateWellKnownSid |
Creates a security identifier (SID) for a well-known group. |
GetAce |
Retrieves a pointer to an access control entry (ACE) in an access control list (ACL). |
AddAccessAllowedAce |
Adds an access-allowed Access Control Entry (ACE) to an Access Control List (ACL). |
SetSecurityInfo |
Sets the security descriptor of a specified securable object. |
Explore detailed security concepts in the Security Concepts Section.
Service Control Manager Functions
These functions allow you to interact with the Windows Service Control Manager (SCM), enabling you to install, start, stop, and query Windows services.
| Function Name | Description |
|---|---|
OpenSCManager |
Opens a connection to the service control manager on the specified computer. |
CreateService |
Creates a service entry in the specified service control manager database and adds it to the specified array of dependencies. |
StartService |
Starts a service that is already installed. |
ControlService |
Sends a control code to a specified service. |
CloseServiceHandle |
Closes a handle to a service or to the service control manager. |
User and Group Functions
This category includes functions for querying information about users and groups on the system.
| Function Name | Description |
|---|---|
LookupAccountName |
With the account name, retrieves the account's SID and the domain name for the account. |
LookupAccountSid |
With the SID, retrieves the account name and the domain name for the account. |