advapi32 topic
Advanced Base API Library
Implements Windows API functions related to the Windows registry, services, user accounts and applications.
Functions
-
ChangeServiceConfig2(
SC_HANDLE hService, SERVICE_CONFIG dwInfoLevel, Pointer< advapi32NativeType> ? lpInfo) → Win32Result<bool> - Changes the optional configuration parameters of a service.
-
CloseServiceHandle(
SC_HANDLE hSCObject) → Win32Result< advapi32bool> - Closes a handle to a service control manager or service object.
-
CloseTrace(
PROCESSTRACE_HANDLE traceHandle) → WIN32_ERROR advapi32 - Closes a trace processing session that was created with OpenTrace.
-
ControlService(
SC_HANDLE hService, int dwControl, Pointer< advapi32SERVICE_STATUS> lpServiceStatus) → Win32Result<bool> - Sends a control code to a service.
-
ControlServiceEx(
SC_HANDLE hService, int dwControl, int dwInfoLevel, Pointer< advapi32NativeType> pControlParams) → Win32Result<bool> - Sends a control code to a service.
-
CredDelete(
PCWSTR targetName, CRED_TYPE type) → Win32Result< advapi32bool> - Deletes a credential from the user's credential set.
-
CredFree(
Pointer< advapi32NativeType> buffer) → void - Frees a buffer returned by any of the credentials management functions.
-
CredRead(
PCWSTR targetName, CRED_TYPE type, Pointer< advapi32Pointer< credential) → Win32Result<CREDENTIAL> >bool> - Reads a credential from the user's credential set.
-
CredWrite(
Pointer< advapi32CREDENTIAL> credential, int flags) → Win32Result<bool> - Creates a new credential or modifies an existing credential in the user's credential set.
-
DecryptFile(
PCWSTR lpFileName) → Win32Result< advapi32bool> - Decrypts an encrypted file or directory.
-
DeleteService(
SC_HANDLE hService) → Win32Result< advapi32bool> - Marks the specified service for deletion from the service control manager database.
-
EncryptFile(
PCWSTR lpFileName) → Win32Result< advapi32bool> - Encrypts a file or directory.
-
EnumDependentServices(
SC_HANDLE hService, ENUM_SERVICE_STATE dwServiceState, Pointer< advapi32ENUM_SERVICE_STATUS> ? lpServices, int cbBufSize, Pointer<Uint32> pcbBytesNeeded, Pointer<Uint32> lpServicesReturned) → Win32Result<bool> - Retrieves the name and status of each service that depends on the specified service.
-
EnumServicesStatus(
SC_HANDLE hSCManager, ENUM_SERVICE_TYPE dwServiceType, ENUM_SERVICE_STATE dwServiceState, Pointer< advapi32ENUM_SERVICE_STATUS> ? lpServices, int cbBufSize, Pointer<Uint32> pcbBytesNeeded, Pointer<Uint32> lpServicesReturned, Pointer<Uint32> ? lpResumeHandle) → Win32Result<bool> - Enumerates services in the specified service control manager database.
-
EnumServicesStatusEx(
SC_HANDLE hSCManager, SC_ENUM_TYPE infoLevel, ENUM_SERVICE_TYPE dwServiceType, ENUM_SERVICE_STATE dwServiceState, Pointer< advapi32Uint8> ? lpServices, int cbBufSize, Pointer<Uint32> pcbBytesNeeded, Pointer<Uint32> lpServicesReturned, Pointer<Uint32> ? lpResumeHandle, PCWSTR? pszGroupName) → Win32Result<bool> - Enumerates services in the specified service control manager database.
-
FileEncryptionStatus(
PCWSTR lpFileName, Pointer< advapi32Uint32> lpStatus) → Win32Result<bool> - Retrieves the encryption status of the specified file.
-
GetServiceDisplayName(
SC_HANDLE hSCManager, PCWSTR lpServiceName, PWSTR? lpDisplayName, Pointer< advapi32Uint32> lpcchBuffer) → Win32Result<bool> - Retrieves the display name of the specified service.
-
GetServiceKeyName(
SC_HANDLE hSCManager, PCWSTR lpDisplayName, PWSTR? lpServiceName, Pointer< advapi32Uint32> lpcchBuffer) → Win32Result<bool> - Retrieves the service name of the specified service.
-
GetTokenInformation(
HANDLE tokenHandle, TOKEN_INFORMATION_CLASS tokenInformationClass, Pointer< advapi32NativeType> ? tokenInformation, int tokenInformationLength, Pointer<Uint32> returnLength) → Win32Result<bool> - Retrieves a specified type of information about an access token.
-
GetUserName(
PWSTR? lpBuffer, Pointer< advapi32Uint32> pcbBuffer) → Win32Result<bool> - Retrieves the name of the user associated with the current thread.
-
InitiateShutdown(
PCWSTR? lpMachineName, PCWSTR? lpMessage, int dwGracePeriod, SHUTDOWN_FLAGS dwShutdownFlags, SHUTDOWN_REASON dwReason) → int advapi32 - Initiates a shutdown and restart of the specified computer, and restarts any applications that have been registered for restart.
-
NotifyBootConfigStatus(
bool bootAcceptable) → Win32Result< advapi32bool> - Reports the boot status to the service control manager.
-
NotifyServiceStatusChange(
SC_HANDLE hService, SERVICE_NOTIFY dwNotifyMask, Pointer< advapi32SERVICE_NOTIFY_2> pNotifyBuffer) → int - Enables an application to receive notification when the specified service is created or deleted or when its status changes.
-
OpenProcessToken(
HANDLE processHandle, TOKEN_ACCESS_MASK desiredAccess, Pointer< advapi32Pointer< tokenHandle) → Win32Result<NativeType> >bool> - Opens the access token associated with a process.
-
OpenSCManager(
PCWSTR? lpMachineName, PCWSTR? lpDatabaseName, int dwDesiredAccess) → Win32Result< advapi32SC_HANDLE> - Establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.
-
OpenService(
SC_HANDLE hSCManager, PCWSTR lpServiceName, int dwDesiredAccess) → Win32Result< advapi32SC_HANDLE> - Opens an existing service.
-
OpenThreadToken(
HANDLE threadHandle, TOKEN_ACCESS_MASK desiredAccess, bool openAsSelf, Pointer< advapi32Pointer< tokenHandle) → Win32Result<NativeType> >bool> - Opens the access token associated with a thread.
-
QueryServiceConfig(
SC_HANDLE hService, Pointer< advapi32QUERY_SERVICE_CONFIG> ? lpServiceConfig, int cbBufSize, Pointer<Uint32> pcbBytesNeeded) → Win32Result<bool> - Retrieves the configuration parameters of the specified service.
-
QueryServiceConfig2(
SC_HANDLE hService, SERVICE_CONFIG dwInfoLevel, Pointer< advapi32Uint8> ? lpBuffer, int cbBufSize, Pointer<Uint32> pcbBytesNeeded) → Win32Result<bool> - Retrieves the optional configuration parameters of the specified service.
-
QueryServiceDynamicInformation(
SERVICE_STATUS_HANDLE hServiceStatus, int dwInfoLevel, Pointer< advapi32Pointer< ppDynamicInfo) → Win32Result<NativeType> >bool> - Retrieves dynamic information related to the current service start.
-
QueryServiceObjectSecurity(
SC_HANDLE hService, int dwSecurityInformation, PSECURITY_DESCRIPTOR? lpSecurityDescriptor, int cbBufSize, Pointer< advapi32Uint32> pcbBytesNeeded) → Win32Result<bool> - Retrieves a copy of the security descriptor associated with a service object.
-
QueryServiceStatus(
SC_HANDLE hService, Pointer< advapi32SERVICE_STATUS> lpServiceStatus) → Win32Result<bool> - Retrieves the current status of the specified service.
-
QueryServiceStatusEx(
SC_HANDLE hService, SC_STATUS_TYPE infoLevel, Pointer< advapi32Uint8> ? lpBuffer, int cbBufSize, Pointer<Uint32> pcbBytesNeeded) → Win32Result<bool> - Retrieves the current status of the specified service based on the specified information level.
-
RegCloseKey(
HKEY hKey) → WIN32_ERROR advapi32 - Closes a handle to the specified registry key.
-
RegConnectRegistry(
PCWSTR? lpMachineName, HKEY hKey, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Establishes a connection to a predefined registry key on another computer.
-
RegCopyTree(
HKEY hKeySrc, PCWSTR? lpSubKey, HKEY hKeyDest) → WIN32_ERROR advapi32 - Copies the specified registry key, along with its values and subkeys, to the specified destination key.
-
RegCreateKey(
HKEY hKey, PCWSTR? lpSubKey, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Creates the specified registry key.
-
RegCreateKeyEx(
HKEY hKey, PCWSTR lpSubKey, PCWSTR? lpClass, REG_OPEN_CREATE_OPTIONS dwOptions, REG_SAM_FLAGS samDesired, Pointer< advapi32SECURITY_ATTRIBUTES> ? lpSecurityAttributes, Pointer<Pointer< phkResult, Pointer<NativeType> >Uint32> ? lpdwDisposition) → WIN32_ERROR - Creates the specified registry key.
-
RegCreateKeyTransacted(
HKEY hKey, PCWSTR lpSubKey, PCWSTR? lpClass, REG_OPEN_CREATE_OPTIONS dwOptions, REG_SAM_FLAGS samDesired, Pointer< advapi32SECURITY_ATTRIBUTES> ? lpSecurityAttributes, Pointer<Pointer< phkResult, Pointer<NativeType> >Uint32> ? lpdwDisposition, HANDLE hTransaction) → WIN32_ERROR - Creates the specified registry key and associates it with a transaction.
-
RegDeleteKey(
HKEY hKey, PCWSTR lpSubKey) → WIN32_ERROR advapi32 - Deletes a subkey and its values.
-
RegDeleteKeyEx(
HKEY hKey, PCWSTR lpSubKey, int samDesired) → WIN32_ERROR advapi32 - Deletes a subkey and its values from the specified platform-specific view of the registry.
-
RegDeleteKeyTransacted(
HKEY hKey, PCWSTR lpSubKey, int samDesired, HANDLE hTransaction) → WIN32_ERROR advapi32 - Deletes a subkey and its values from the specified platform-specific view of the registry as a transacted operation.
-
RegDeleteKeyValue(
HKEY hKey, PCWSTR? lpSubKey, PCWSTR? lpValueName) → WIN32_ERROR advapi32 - Removes the specified value from the specified registry key and subkey.
-
RegDeleteTree(
HKEY hKey, PCWSTR? lpSubKey) → WIN32_ERROR advapi32 - Deletes the subkeys and values of the specified key recursively.
-
RegDeleteValue(
HKEY hKey, PCWSTR? lpValueName) → WIN32_ERROR advapi32 - Removes a named value from the specified registry key.
-
RegDisablePredefinedCache(
) → WIN32_ERROR advapi32 - Disables handle caching of the predefined registry handle for HKEY_CURRENT_USER for the current process.
-
RegDisablePredefinedCacheEx(
) → WIN32_ERROR advapi32 - Disables handle caching for all predefined registry handles for the current process.
-
RegDisableReflectionKey(
HKEY hBase) → WIN32_ERROR advapi32 - Disables registry reflection for the specified key.
-
RegEnableReflectionKey(
HKEY hBase) → WIN32_ERROR advapi32 - Restores registry reflection for the specified disabled key.
-
RegEnumKey(
HKEY hKey, int dwIndex, PWSTR? lpName, int cchName) → WIN32_ERROR advapi32 - Enumerates the subkeys of the specified open registry key.
-
RegEnumKeyEx(
HKEY hKey, int dwIndex, PWSTR? lpName, Pointer< advapi32Uint32> lpcchName, PWSTR? lpClass, Pointer<Uint32> ? lpcchClass, Pointer<FILETIME> ? lpftLastWriteTime) → WIN32_ERROR - Enumerates the subkeys of the specified open registry key.
-
RegEnumValue(
HKEY hKey, int dwIndex, PWSTR? lpValueName, Pointer< advapi32Uint32> lpcchValueName, Pointer<Uint32> ? lpType, Pointer<Uint8> ? lpData, Pointer<Uint32> ? lpcbData) → WIN32_ERROR - Enumerates the values for the specified open registry key.
-
RegFlushKey(
HKEY hKey) → WIN32_ERROR advapi32 - Writes all the attributes of the specified open registry key into the registry.
-
RegGetValue(
HKEY hkey, PCWSTR? lpSubKey, PCWSTR? lpValue, REG_ROUTINE_FLAGS dwFlags, Pointer< advapi32Uint32> ? pdwType, Pointer<NativeType> ? pvData, Pointer<Uint32> ? pcbData) → WIN32_ERROR - Retrieves the type and data for the specified registry value.
-
RegisterServiceCtrlHandler(
PCWSTR lpServiceName, Pointer< advapi32NativeFunction< lpHandlerProc) → Win32Result<LPHANDLER_FUNCTION> >SERVICE_STATUS_HANDLE> - Registers a function to handle service control requests.
-
RegisterServiceCtrlHandlerEx(
PCWSTR lpServiceName, Pointer< advapi32NativeFunction< lpHandlerProc, Pointer<LPHANDLER_FUNCTION_EX> >NativeType> ? lpContext) → Win32Result<SERVICE_STATUS_HANDLE> - Registers a function to handle extended service control requests.
-
RegLoadAppKey(
PCWSTR lpFile, Pointer< advapi32Pointer< phkResult, int samDesired, int dwOptions) → WIN32_ERRORNativeType> > - Loads the specified registry hive as an application hive.
-
RegLoadKey(
HKEY hKey, PCWSTR? lpSubKey, PCWSTR lpFile) → WIN32_ERROR advapi32 - Creates a subkey under HKEY_USERS or HKEY_LOCAL_MACHINE and loads the data from the specified registry hive into that subkey.
-
RegLoadMUIString(
HKEY hKey, PCWSTR? pszValue, PWSTR? pszOutBuf, int cbOutBuf, Pointer< advapi32Uint32> ? pcbData, int flags, PCWSTR? pszDirectory) → WIN32_ERROR - Loads the specified string from the specified key and subkey.
-
RegNotifyChangeKeyValue(
HKEY hKey, bool bWatchSubtree, REG_NOTIFY_FILTER dwNotifyFilter, HANDLE? hEvent, bool fAsynchronous) → WIN32_ERROR advapi32 - Notifies the caller about changes to the attributes or contents of a specified registry key.
-
RegOpenCurrentUser(
int samDesired, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Retrieves a handle to the HKEY_CURRENT_USER key for the user the current thread is impersonating.
-
RegOpenKey(
HKEY hKey, PCWSTR? lpSubKey, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Opens the specified registry key.
-
RegOpenKeyEx(
HKEY hKey, PCWSTR? lpSubKey, int? ulOptions, REG_SAM_FLAGS samDesired, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Opens the specified registry key.
-
RegOpenKeyTransacted(
HKEY hKey, PCWSTR? lpSubKey, int? ulOptions, REG_SAM_FLAGS samDesired, Pointer< advapi32Pointer< phkResult, HANDLE hTransaction) → WIN32_ERRORNativeType> > - Opens the specified registry key and associates it with a transaction.
-
RegOpenUserClassesRoot(
HANDLE hToken, int samDesired, Pointer< advapi32Pointer< phkResult) → WIN32_ERRORNativeType> > - Retrieves a handle to the HKEY_CLASSES_ROOT key for a specified user.
-
RegOverridePredefKey(
HKEY hKey, HKEY? hNewHKey) → WIN32_ERROR advapi32 - Maps a predefined registry key to the specified registry key.
-
RegQueryInfoKey(
HKEY hKey, PWSTR? lpClass, Pointer< advapi32Uint32> ? lpcchClass, Pointer<Uint32> ? lpcSubKeys, Pointer<Uint32> ? lpcbMaxSubKeyLen, Pointer<Uint32> ? lpcbMaxClassLen, Pointer<Uint32> ? lpcValues, Pointer<Uint32> ? lpcbMaxValueNameLen, Pointer<Uint32> ? lpcbMaxValueLen, Pointer<Uint32> ? lpcbSecurityDescriptor, Pointer<FILETIME> ? lpftLastWriteTime) → WIN32_ERROR - Retrieves information about the specified registry key.
-
RegQueryMultipleValues(
HKEY hKey, Pointer< advapi32VALENT> val_list, int num_vals, PWSTR? lpValueBuf, Pointer<Uint32> ? ldwTotsize) → WIN32_ERROR - Retrieves the type and data for a list of value names associated with an open registry key.
-
RegQueryReflectionKey(
HKEY hBase, Pointer< advapi32Int32> bIsReflectionDisabled) → WIN32_ERROR - Determines whether reflection has been disabled or enabled for the specified key.
-
RegQueryValue(
HKEY hKey, PCWSTR? lpSubKey, PWSTR? lpData, Pointer< advapi32Int32> ? lpcbData) → WIN32_ERROR - Retrieves the data associated with the default or unnamed value of a specified registry key.
-
RegQueryValueEx(
HKEY hKey, PCWSTR? lpValueName, Pointer< advapi32Uint32> ? lpType, Pointer<Uint8> ? lpData, Pointer<Uint32> ? lpcbData) → WIN32_ERROR - Retrieves the type and data for the specified value name associated with an open registry key.
-
RegRenameKey(
HKEY hKey, PCWSTR? lpSubKeyName, PCWSTR lpNewKeyName) → WIN32_ERROR advapi32 - Changes the name of the specified registry key.
-
RegReplaceKey(
HKEY hKey, PCWSTR? lpSubKey, PCWSTR lpNewFile, PCWSTR lpOldFile) → WIN32_ERROR advapi32 - Replaces the file backing a registry key and all its subkeys with another file, so that when the system is next started, the key and subkeys will have the values stored in the new file.
-
RegRestoreKey(
HKEY hKey, PCWSTR lpFile, REG_RESTORE_KEY_FLAGS dwFlags) → WIN32_ERROR advapi32 - Reads the registry information in a specified file and copies it over the specified key.
-
RegSaveKey(
HKEY hKey, PCWSTR lpFile, Pointer< advapi32SECURITY_ATTRIBUTES> ? lpSecurityAttributes) → WIN32_ERROR - Saves the specified key and all of its subkeys and values to a new file, in the standard format.
-
RegSaveKeyEx(
HKEY hKey, PCWSTR lpFile, Pointer< advapi32SECURITY_ATTRIBUTES> ? lpSecurityAttributes, REG_SAVE_FORMAT flags) → WIN32_ERROR - Saves the specified key and all of its subkeys and values to a registry file, in the specified format.
-
RegSetKeyValue(
HKEY hKey, PCWSTR? lpSubKey, PCWSTR? lpValueName, int dwType, Pointer< advapi32NativeType> ? lpData, int cbData) → WIN32_ERROR - Sets the data for the specified value in the specified registry key and subkey.
-
RegSetValue(
HKEY hKey, PCWSTR? lpSubKey, REG_VALUE_TYPE dwType, PCWSTR? lpData, int cbData) → WIN32_ERROR advapi32 - Sets the data for the default or unnamed value of a specified registry key.
-
RegSetValueEx(
HKEY hKey, PCWSTR? lpValueName, REG_VALUE_TYPE dwType, Pointer< advapi32Uint8> ? lpData, int cbData) → WIN32_ERROR - Sets the data and type of a specified value under a registry key.
-
RegUnLoadKey(
HKEY hKey, PCWSTR? lpSubKey) → WIN32_ERROR advapi32 - Unloads the specified registry key and its subkeys from the registry.
-
SetServiceObjectSecurity(
SC_HANDLE hService, OBJECT_SECURITY_INFORMATION dwSecurityInformation, PSECURITY_DESCRIPTOR lpSecurityDescriptor) → Win32Result< advapi32bool> - Sets the security descriptor of a service object.
-
SetServiceStatus(
SERVICE_STATUS_HANDLE hServiceStatus, Pointer< advapi32SERVICE_STATUS> lpServiceStatus) → Win32Result<bool> - Updates the service control manager's status information for the calling service.
-
SetThreadToken(
Pointer< advapi32Pointer< ? thread, HANDLE? token) → Win32Result<NativeType> >bool> - Assigns an impersonation token to a thread.
-
StartService(
SC_HANDLE hService, int dwNumServiceArgs, Pointer< advapi32Pointer< ? lpServiceArgVectors) → Win32Result<Utf16> >bool> - Starts a service.
-
StartServiceCtrlDispatcher(
Pointer< advapi32SERVICE_TABLE_ENTRY> lpServiceStartTable) → Win32Result<bool> - Connects the main thread of a service process to the service control manager, which causes the thread to be the service control dispatcher thread for the calling process.