FreeRDP
registry.c File Reference
#include <winpr/config.h>
#include <winpr/registry.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include "registry_reg.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("registry")
 

Functions

static Reg * RegGetInstance (void)
 
LONG RegCloseKey (HKEY hKey)
 
LONG RegCopyTreeW (HKEY hKeySrc, LPCWSTR lpSubKey, HKEY hKeyDest)
 
LONG RegCopyTreeA (HKEY hKeySrc, LPCSTR lpSubKey, HKEY hKeyDest)
 
LONG RegCreateKeyExW (HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition)
 
LONG RegCreateKeyExA (HKEY hKey, LPCSTR lpSubKey, DWORD Reserved, LPSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition)
 
LONG RegDeleteKeyExW (HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved)
 
LONG RegDeleteKeyExA (HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, DWORD Reserved)
 
LONG RegDeleteTreeW (HKEY hKey, LPCWSTR lpSubKey)
 
LONG RegDeleteTreeA (HKEY hKey, LPCSTR lpSubKey)
 
LONG RegDeleteValueW (HKEY hKey, LPCWSTR lpValueName)
 
LONG RegDeleteValueA (HKEY hKey, LPCSTR lpValueName)
 
LONG RegDisablePredefinedCacheEx (void)
 
LONG RegEnumKeyExW (HKEY hKey, DWORD dwIndex, LPWSTR lpName, LPDWORD lpcName, LPDWORD lpReserved, LPWSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime)
 
LONG RegEnumKeyExA (HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcName, LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcClass, PFILETIME lpftLastWriteTime)
 
LONG RegEnumValueW (HKEY hKey, DWORD dwIndex, LPWSTR lpValueName, LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
LONG RegEnumValueA (HKEY hKey, DWORD dwIndex, LPSTR lpValueName, LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
LONG RegFlushKey (HKEY hKey)
 
LONG RegGetKeySecurity (HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor)
 
LONG RegGetValueW (HKEY hkey, LPCWSTR lpSubKey, LPCWSTR lpValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
 
LONG RegGetValueA (HKEY hkey, LPCSTR lpSubKey, LPCSTR lpValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
 
LONG RegLoadAppKeyW (LPCWSTR lpFile, PHKEY phkResult, REGSAM samDesired, DWORD dwOptions, DWORD Reserved)
 
LONG RegLoadAppKeyA (LPCSTR lpFile, PHKEY phkResult, REGSAM samDesired, DWORD dwOptions, DWORD Reserved)
 
LONG RegLoadKeyW (HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile)
 
LONG RegLoadKeyA (HKEY hKey, LPCSTR lpSubKey, LPCSTR lpFile)
 
LONG RegLoadMUIStringW (HKEY hKey, LPCWSTR pszValue, LPWSTR pszOutBuf, DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCWSTR pszDirectory)
 
LONG RegLoadMUIStringA (HKEY hKey, LPCSTR pszValue, LPSTR pszOutBuf, DWORD cbOutBuf, LPDWORD pcbData, DWORD Flags, LPCSTR pszDirectory)
 
LONG RegNotifyChangeKeyValue (HKEY hKey, BOOL bWatchSubtree, DWORD dwNotifyFilter, HANDLE hEvent, BOOL fAsynchronous)
 
LONG RegOpenCurrentUser (REGSAM samDesired, PHKEY phkResult)
 
LONG RegOpenKeyExW (HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
 
LONG RegOpenKeyExA (HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
 
LONG RegOpenUserClassesRoot (HANDLE hToken, DWORD dwOptions, REGSAM samDesired, PHKEY phkResult)
 
LONG RegQueryInfoKeyW (HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
 
LONG RegQueryInfoKeyA (HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
 
static LONG reg_read_int (const RegVal *pValue, LPBYTE lpData, LPDWORD lpcbData)
 
LONG RegQueryValueExW (HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
LONG RegQueryValueExA (HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
 
LONG RegRestoreKeyW (HKEY hKey, LPCWSTR lpFile, DWORD dwFlags)
 
LONG RegRestoreKeyA (HKEY hKey, LPCSTR lpFile, DWORD dwFlags)
 
LONG RegSaveKeyExW (HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags)
 
LONG RegSaveKeyExA (HKEY hKey, LPCSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags)
 
LONG RegSetKeySecurity (HKEY hKey, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
 
LONG RegSetValueExW (HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE *lpData, DWORD cbData)
 
LONG RegSetValueExA (HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE *lpData, DWORD cbData)
 
LONG RegUnLoadKeyW (HKEY hKey, LPCWSTR lpSubKey)
 
LONG RegUnLoadKeyA (HKEY hKey, LPCSTR lpSubKey)
 

Variables

static Reg * instance = NULL
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("registry")

WinPR: Windows Portable Runtime Windows Registry

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ reg_read_int()

static LONG reg_read_int ( const RegVal *  pValue,
LPBYTE  lpData,
LPDWORD  lpcbData 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegCloseKey()

LONG RegCloseKey ( HKEY  hKey)
Here is the caller graph for this function:

◆ RegCopyTreeA()

LONG RegCopyTreeA ( HKEY  hKeySrc,
LPCSTR  lpSubKey,
HKEY  hKeyDest 
)

◆ RegCopyTreeW()

LONG RegCopyTreeW ( HKEY  hKeySrc,
LPCWSTR  lpSubKey,
HKEY  hKeyDest 
)

◆ RegCreateKeyExA()

LONG RegCreateKeyExA ( HKEY  hKey,
LPCSTR  lpSubKey,
DWORD  Reserved,
LPSTR  lpClass,
DWORD  dwOptions,
REGSAM  samDesired,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
PHKEY  phkResult,
LPDWORD  lpdwDisposition 
)

◆ RegCreateKeyExW()

LONG RegCreateKeyExW ( HKEY  hKey,
LPCWSTR  lpSubKey,
DWORD  Reserved,
LPWSTR  lpClass,
DWORD  dwOptions,
REGSAM  samDesired,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
PHKEY  phkResult,
LPDWORD  lpdwDisposition 
)

◆ RegDeleteKeyExA()

LONG RegDeleteKeyExA ( HKEY  hKey,
LPCSTR  lpSubKey,
REGSAM  samDesired,
DWORD  Reserved 
)

◆ RegDeleteKeyExW()

LONG RegDeleteKeyExW ( HKEY  hKey,
LPCWSTR  lpSubKey,
REGSAM  samDesired,
DWORD  Reserved 
)

◆ RegDeleteTreeA()

LONG RegDeleteTreeA ( HKEY  hKey,
LPCSTR  lpSubKey 
)

◆ RegDeleteTreeW()

LONG RegDeleteTreeW ( HKEY  hKey,
LPCWSTR  lpSubKey 
)

◆ RegDeleteValueA()

LONG RegDeleteValueA ( HKEY  hKey,
LPCSTR  lpValueName 
)

◆ RegDeleteValueW()

LONG RegDeleteValueW ( HKEY  hKey,
LPCWSTR  lpValueName 
)

◆ RegDisablePredefinedCacheEx()

LONG RegDisablePredefinedCacheEx ( void  )

◆ RegEnumKeyExA()

LONG RegEnumKeyExA ( HKEY  hKey,
DWORD  dwIndex,
LPSTR  lpName,
LPDWORD  lpcName,
LPDWORD  lpReserved,
LPSTR  lpClass,
LPDWORD  lpcClass,
PFILETIME  lpftLastWriteTime 
)

◆ RegEnumKeyExW()

LONG RegEnumKeyExW ( HKEY  hKey,
DWORD  dwIndex,
LPWSTR  lpName,
LPDWORD  lpcName,
LPDWORD  lpReserved,
LPWSTR  lpClass,
LPDWORD  lpcClass,
PFILETIME  lpftLastWriteTime 
)

◆ RegEnumValueA()

LONG RegEnumValueA ( HKEY  hKey,
DWORD  dwIndex,
LPSTR  lpValueName,
LPDWORD  lpcchValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)

◆ RegEnumValueW()

LONG RegEnumValueW ( HKEY  hKey,
DWORD  dwIndex,
LPWSTR  lpValueName,
LPDWORD  lpcchValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)

◆ RegFlushKey()

LONG RegFlushKey ( HKEY  hKey)

◆ RegGetInstance()

static Reg* RegGetInstance ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegGetKeySecurity()

LONG RegGetKeySecurity ( HKEY  hKey,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor,
LPDWORD  lpcbSecurityDescriptor 
)

◆ RegGetValueA()

LONG RegGetValueA ( HKEY  hkey,
LPCSTR  lpSubKey,
LPCSTR  lpValue,
DWORD  dwFlags,
LPDWORD  pdwType,
PVOID  pvData,
LPDWORD  pcbData 
)

◆ RegGetValueW()

LONG RegGetValueW ( HKEY  hkey,
LPCWSTR  lpSubKey,
LPCWSTR  lpValue,
DWORD  dwFlags,
LPDWORD  pdwType,
PVOID  pvData,
LPDWORD  pcbData 
)

◆ RegLoadAppKeyA()

LONG RegLoadAppKeyA ( LPCSTR  lpFile,
PHKEY  phkResult,
REGSAM  samDesired,
DWORD  dwOptions,
DWORD  Reserved 
)

◆ RegLoadAppKeyW()

LONG RegLoadAppKeyW ( LPCWSTR  lpFile,
PHKEY  phkResult,
REGSAM  samDesired,
DWORD  dwOptions,
DWORD  Reserved 
)

◆ RegLoadKeyA()

LONG RegLoadKeyA ( HKEY  hKey,
LPCSTR  lpSubKey,
LPCSTR  lpFile 
)

◆ RegLoadKeyW()

LONG RegLoadKeyW ( HKEY  hKey,
LPCWSTR  lpSubKey,
LPCWSTR  lpFile 
)

◆ RegLoadMUIStringA()

LONG RegLoadMUIStringA ( HKEY  hKey,
LPCSTR  pszValue,
LPSTR  pszOutBuf,
DWORD  cbOutBuf,
LPDWORD  pcbData,
DWORD  Flags,
LPCSTR  pszDirectory 
)

◆ RegLoadMUIStringW()

LONG RegLoadMUIStringW ( HKEY  hKey,
LPCWSTR  pszValue,
LPWSTR  pszOutBuf,
DWORD  cbOutBuf,
LPDWORD  pcbData,
DWORD  Flags,
LPCWSTR  pszDirectory 
)

◆ RegNotifyChangeKeyValue()

LONG RegNotifyChangeKeyValue ( HKEY  hKey,
BOOL  bWatchSubtree,
DWORD  dwNotifyFilter,
HANDLE  hEvent,
BOOL  fAsynchronous 
)

◆ RegOpenCurrentUser()

LONG RegOpenCurrentUser ( REGSAM  samDesired,
PHKEY  phkResult 
)

◆ RegOpenKeyExA()

LONG RegOpenKeyExA ( HKEY  hKey,
LPCSTR  lpSubKey,
DWORD  ulOptions,
REGSAM  samDesired,
PHKEY  phkResult 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegOpenKeyExW()

LONG RegOpenKeyExW ( HKEY  hKey,
LPCWSTR  lpSubKey,
DWORD  ulOptions,
REGSAM  samDesired,
PHKEY  phkResult 
)
Here is the call graph for this function:

◆ RegOpenUserClassesRoot()

LONG RegOpenUserClassesRoot ( HANDLE  hToken,
DWORD  dwOptions,
REGSAM  samDesired,
PHKEY  phkResult 
)

◆ RegQueryInfoKeyA()

LONG RegQueryInfoKeyA ( HKEY  hKey,
LPSTR  lpClass,
LPDWORD  lpcClass,
LPDWORD  lpReserved,
LPDWORD  lpcSubKeys,
LPDWORD  lpcMaxSubKeyLen,
LPDWORD  lpcMaxClassLen,
LPDWORD  lpcValues,
LPDWORD  lpcMaxValueNameLen,
LPDWORD  lpcMaxValueLen,
LPDWORD  lpcbSecurityDescriptor,
PFILETIME  lpftLastWriteTime 
)

◆ RegQueryInfoKeyW()

LONG RegQueryInfoKeyW ( HKEY  hKey,
LPWSTR  lpClass,
LPDWORD  lpcClass,
LPDWORD  lpReserved,
LPDWORD  lpcSubKeys,
LPDWORD  lpcMaxSubKeyLen,
LPDWORD  lpcMaxClassLen,
LPDWORD  lpcValues,
LPDWORD  lpcMaxValueNameLen,
LPDWORD  lpcMaxValueLen,
LPDWORD  lpcbSecurityDescriptor,
PFILETIME  lpftLastWriteTime 
)

◆ RegQueryValueExA()

LONG RegQueryValueExA ( HKEY  hKey,
LPCSTR  lpValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegQueryValueExW()

LONG RegQueryValueExW ( HKEY  hKey,
LPCWSTR  lpValueName,
LPDWORD  lpReserved,
LPDWORD  lpType,
LPBYTE  lpData,
LPDWORD  lpcbData 
)
Here is the call graph for this function:

◆ RegRestoreKeyA()

LONG RegRestoreKeyA ( HKEY  hKey,
LPCSTR  lpFile,
DWORD  dwFlags 
)

◆ RegRestoreKeyW()

LONG RegRestoreKeyW ( HKEY  hKey,
LPCWSTR  lpFile,
DWORD  dwFlags 
)

◆ RegSaveKeyExA()

LONG RegSaveKeyExA ( HKEY  hKey,
LPCSTR  lpFile,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
DWORD  Flags 
)

◆ RegSaveKeyExW()

LONG RegSaveKeyExW ( HKEY  hKey,
LPCWSTR  lpFile,
LPSECURITY_ATTRIBUTES  lpSecurityAttributes,
DWORD  Flags 
)

◆ RegSetKeySecurity()

LONG RegSetKeySecurity ( HKEY  hKey,
SECURITY_INFORMATION  SecurityInformation,
PSECURITY_DESCRIPTOR  pSecurityDescriptor 
)

◆ RegSetValueExA()

LONG RegSetValueExA ( HKEY  hKey,
LPCSTR  lpValueName,
DWORD  Reserved,
DWORD  dwType,
const BYTE lpData,
DWORD  cbData 
)

◆ RegSetValueExW()

LONG RegSetValueExW ( HKEY  hKey,
LPCWSTR  lpValueName,
DWORD  Reserved,
DWORD  dwType,
const BYTE lpData,
DWORD  cbData 
)

◆ RegUnLoadKeyA()

LONG RegUnLoadKeyA ( HKEY  hKey,
LPCSTR  lpSubKey 
)

◆ RegUnLoadKeyW()

LONG RegUnLoadKeyW ( HKEY  hKey,
LPCWSTR  lpSubKey 
)

Variable Documentation

◆ instance

Reg* instance = NULL
static