BoxedAppSDK_CreateVirtualRegKey

Description

The function creates a virtual registry key within the virtual registry managed by BoxedApp SDK. Its parameters are similar to those of the WinAPI function RegCreateKeyEx.

This function allows you to create registry keys that exist only in memory and are shared across all processes attached to the same virtual environment. It is particularly useful for emulating COM registration or other registry-based configurations without requiring administrative privileges or real registry modification.

Syntax

LONG __stdcall BoxedAppSDK_CreateVirtualRegKey(
  HKEY hKey,
  LPCTSTR lpSubKey,
  DWORD Reserved,
  LPCTSTR lpClass,
  DWORD dwOptions,
  REGSAM samDesired,
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  PHKEY phkResult,
  LPDWORD lpdwDisposition
);
function BoxedAppSDK_CreateVirtualRegKey(
  hKey: HKEY;
  lpSubKey: PAnsiChar;
  Reserved: DWORD;
  lpClass: PAnsiChar;
  dwOptions: DWORD;
  samDesired: REGSAM;
  lpSecurityAttributes: PSecurityAttributes;
  var phkResult: HKEY;
  lpdwDisposition: PDWORD
): Longint; stdcall;
 
function BoxedAppSDK_CreateVirtualRegKeyA(
  hKey: HKEY;
  lpSubKey: PAnsiChar;
  Reserved: DWORD;
  lpClass: PAnsiChar;
  dwOptions: DWORD;
  samDesired: REGSAM;
  lpSecurityAttributes: PSecurityAttributes;
  var phkResult: HKEY;
  lpdwDisposition: PDWORD
): Longint; stdcall;
 
function BoxedAppSDK_CreateVirtualRegKeyW(
  hKey: HKEY;
  lpSubKey: PWideChar;
  Reserved: DWORD;
  lpClass: PWideChar;
  dwOptions: DWORD;
  samDesired: REGSAM;
  lpSecurityAttributes: PSecurityAttributes;
  var phkResult: HKEY;
  lpdwDisposition: PDWORD
): Longint; stdcall;

Parameters

hKey
Handle to an open registry key, such as HKEY_CURRENT_USER or a previously created virtual key.

lpSubKey
Specifies the name of the subkey to be created or opened.

Reserved
Reserved; must be set to zero.

lpClass
Specifies the user-defined class type of this key. Can be NULL.

dwOptions
Defines special options for the key, such as volatility. Typically set to 0.

samDesired
Specifies the access rights for the key (e.g., KEY_READ, KEY_WRITE).

lpSecurityAttributes
Pointer to a SECURITY_ATTRIBUTES structure. This parameter is currently ignored by BoxedApp.

phkResult
Receives a handle to the newly created or opened virtual registry key.

lpdwDisposition
Receives a value that indicates whether a new key was created (REG_CREATED_NEW_KEY) or an existing one was opened (REG_OPENED_EXISTING_KEY).

See Also