CBRegistry Component
Properties Methods Events Config Settings Errors
The CBRegistry class allows applications to intercept and control registry requests.
Syntax
cbfsfilter.CBRegistry
Remarks
The CBRegistry struct gives applications the ability to intercept and registry requests, allowing them to be altered, handled, and blocked. Applications use standard filter rules to specify which requests they are interested in intercepting; and special filter rules to enforce access restrictions.
To learn more about the struct's capabilities, please refer to the product's General Information topics.
Getting Started
- If the struct's system driver has not been installed yet, call the Install method to do so. This needs to be done only once.
- In production, the driver can be installed (or updated) ahead of time by the application's installation script using the Installer DLL. Please refer to the Driver Installation topic for more information.
- Call the Initialize method to initialize the CBRegistry struct. This must be done each time the application starts.
- Add one or more filter rules using methods like AddFilterRule. (Rules also can be added or removed after the filter is started.)
- Call the StartFilter method to start filtering filesystem requests.
- When finished, call the StopFilter method to stop filtering filesystem requests.
- To uninstall the struct's system driver, call the Uninstall method. This should not be done as part of the driver upgrade process.
- In production, the driver can be uninstalled by the application's uninstallation script using the Installer DLL. Please refer to the Driver Installation topic for more information.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
Active | This property notes whether the class is active and processing requests. |
Altitude | This property specifies the altitude the class's system driver should use. |
DefaultRuleCount | The number of records in the DefaultRule arrays. |
DefaultRuleAccessFlags | This property indicates the access restrictions enforced by the rule. |
DefaultRuleMask | This property reflects a registry key mask that determines which registry keys match the rule. |
FilterRuleCount | The number of records in the FilterRule arrays. |
FilterRuleAccessFlags | This property indicates the access restrictions enforced by the rule. |
FilterRuleControlFlags | This property indicates which control events the rule causes the class to fire. |
FilterRuleMask | This property reflects a registry key mask that determines which registry keys match the rule. |
PassthroughRuleCount | The number of records in the PassthroughRule arrays. |
PassthroughRuleAccessFlags | This property indicates the access restrictions lifted by the rule. |
PassthroughRuleControlFlags | This property indicates which control events the rule prevents the class from firing. |
PassthroughRuleMask | This property reflects a registry key mask that determines which registry keys match the rule. |
SerializeEvents | Whether events should be fired on a single worker thread, or many. |
Tag | This property stores application-defined data specific to a particular instance of the class. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
AddDefaultRule | This method adds a default rule. |
AddFilteredProcessById | This method adds a process, by process ID (PID), to the list of filtered processes. |
AddFilteredProcessByName | This method adds a process, by name, to the list of filtered processes. |
AddFilterRule | This method adds a standard filter rule or access rule. |
AddIgnoredProcessById | This method adds a process, by process Id (PID), to the list of ignored processes. |
AddIgnoredProcessByName | This method adds a process, by name, to the list of ignored processes. |
AddPassthroughRule | This method adds a passthrough rule. |
CloseDefaultRulesSnapshot | This method closes the previously created default rules snapshot. |
Config | Sets or retrieves a configuration setting. |
CreateDefaultRulesSnapshot | This method creates a snapshot of information about the default rules that have been added. |
DeleteAllFilterRules | This method deletes all standard filter rules. |
DeleteAllPassthroughRules | This method deletes all passthrough rules. |
DeleteDefaultRule | This method deletes a particular default rule. |
DeleteFilterRule | This method deletes a particular standard filter rule or access rule. |
DeletePassthroughRule | This method deletes a particular passthrough rule. |
GetDriverStatus | This method retrieves the status of the class's system driver. |
GetDriverVersion | This method retrieves the version of the class's system driver. |
GetOriginatorProcessId | This method retrieves the process Id (PID) that initiated the operation. |
GetOriginatorProcessName | This method retrieves the name of the process that initiated the operation. |
GetOriginatorThreadId | This method retrieves the thread Id that initiated the operation. |
GetOriginatorToken | This method retrieves the security token associated with the process that initiated the operation. |
Initialize | This method initializes the class. |
Install | This method installs (or upgrades) the class's system driver. |
RemoveFilteredProcessById | This method removes a process, by process Id (PID), from the list of filtered processes. |
RemoveFilteredProcessByName | This method removes a process, by name, from the list of filtered processes. |
RemoveIgnoredProcessById | This method removes a process, by process Id (PID), from the list of ignored processes. |
RemoveIgnoredProcessByName | This method removes a process, by name, from the list of ignored processes. |
ResetTimeout | This method resets the timeout duration for the current event handler. |
ShutdownSystem | Shuts down or reboots the operating system. |
StartFilter | This method starts filtering registry operations. |
StopFilter | This method stops filtering registry operations. |
SuspendDefaultRules | This method suspends all default rules until the application exits. |
ToggleProcessProtection | This method enables or disables termination protection for the application. |
Uninstall | This method uninstalls the class's system driver. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
AfterCloseKey | This event fires after a registry key is closed. |
AfterCreateKey | This event fires after a registry key is created. |
AfterDeleteKey | This event fires after a registry key is deleted. |
AfterDeleteValue | This event fires after a registry value is deleted. |
AfterEnumerateKey | This event fires after a subkey's information is retrieved during key enumeration. |
AfterEnumerateValue | This event fires after a registry value's information is retrieved during key value enumeration. |
AfterGetKeySecurity | This event fires after a registry key's security attributes are changed. |
AfterOpenKey | This event fires after a registry key is opened. |
AfterQueryKey | This event fires after a registry key's information is retrieved. |
AfterQueryValue | This event fires after a registry value's information is retrieved. |
AfterRenameKey | This event fires after a registry key is renamed. |
AfterSetKey | This event fires after a registry key's information is updated. |
AfterSetKeySecurity | This event fires after a registry key's security attributes are changed. |
AfterSetValue | This event fires after a registry value is set or updated. |
BeforeCloseKey | This event fires before a registry key is closed. |
BeforeCreateKey | This event fires before a registry key is created. |
BeforeDeleteKey | This event fires before a registry key is deleted. |
BeforeDeleteValue | This event fires before a registry value is deleted. |
BeforeEnumerateKey | This event fires before a subkey's information is retrieved during key enumeration. |
BeforeEnumerateValue | This event fires before a registry value's information is retrieved during key value enumeration. |
BeforeGetKeySecurity | This event fires before a registry key's security attributes are retrieved. |
BeforeOpenKey | This event fires before a registry key is opened. |
BeforeQueryKey | This event fires before a registry key's information is retrieved. |
BeforeQueryValue | This event fires before a registry value's information is retrieved. |
BeforeRenameKey | This event fires before a registry key is renamed. |
BeforeSetKey | This event fires before a registry key's information is updated. |
BeforeSetKeySecurity | This event fires before a registry key's security attributes are changed. |
BeforeSetValue | This event fires before a registry value is set or updated. |
CleanupKeyContext | This event fires when the application-defined data stored in a registry key context need to be cleaned up. |
CloseKeyHandle | This event fires when an application-provided registry key handle should be closed. |
Error | This event fires if an unhandled error occurs during an event. |
WorkerThreadCreation | Fires just after a new worker thread is created. |
WorkerThreadTermination | Fires just before a worker thread is terminated. |
Config Settings
The following is a list of config settings for the component with short descriptions. Click on the links for further details.
FilterOwnRequests | Whether the class's system driver should filter requests made by the application itself. |
ForceAdminRightsForDefaultRules | Specifies whether default rules can be added or deleted only by administrators. |
ForceAppPermissionCheck | Whether the driver should require the controller process to have elevated or system privileges. |
ForceSecurityChecks | Whether the driver should prevent the controller process from filtering files that it would not normally have access to. |
LoggingEnabled | Whether extended logging is enabled. |
MaxWorkerThreadCount | The maximum number of worker threads to use to fire events. |
MinWorkerThreadCount | The minimum number of worker threads to use to fire events. |
ResolveNtNameToWin32Name | Whether key names in NT native format are translated to common Win32 format. |
WorkerInitialStackSize | The initial stack size to create worker threads with. |
BuildInfo | Information about the product's build. |
LicenseInfo | Information about the current license. |
Active Property (CBRegistry Component)
This property notes whether the class is active and processing requests.
Syntax
func (obj *CBRegistry) Active() (bool, error)
Default Value
false
Remarks
This property reflects whether the struct is active and currently processing requests. It will be true after the filter has been attached successfully via a call to StartFilter.
This property is read-only.
Data Type
bool
Altitude Property (CBRegistry Component)
This property specifies the altitude the class's system driver should use.
Syntax
func (obj *CBRegistry) Altitude() (string, error)
func (obj *CBRegistry) SetAltitude(value string) error
Default Value
"400055"
Remarks
This property specifies the altitude that the struct's system driver should use. A driver's altitude determines its absolute position in the stack of filter drivers; drivers with higher altitudes are attached toward the top of the stack, closer to the user mode, which allows them to process requests earlier.
Registry filter drivers are not required to specify an altitude; and this property's default empty value is interpreted as "no altitude". However, registry filter drivers that do not specify an altitude will always be attached near the top of the filter driver stack, which may not be desirable. Please refer to the Driver Altitudes topic for more information.
Data Type
string
DefaultRuleCount Property (CBRegistry Component)
The number of records in the DefaultRule arrays.
Syntax
func (obj *CBRegistry) DefaultRuleCount() (int32, error)
Default Value
0
Remarks
This property controls the size of the following arrays:
The array indices start at 0 and end at DefaultRuleCount - 1.This property is read-only.
Data Type
int32
DefaultRuleAccessFlags Property (CBRegistry Component)
This property indicates the access restrictions enforced by the rule.
Syntax
func (obj *CBRegistry) DefaultRuleAccessFlags(DefaultRuleIndex int32) (int32, error)
Default Value
0
Remarks
This property indicates the access restrictions enforced by the rule.
This property indicates which access restrictions are enforced by the rule. Please refer to the Default Rules topic for more information. The value of this property is a combination of zero or more of the following:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The DefaultRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the DefaultRuleCount property.
This property is read-only.
Data Type
int32
DefaultRuleMask Property (CBRegistry Component)
This property reflects a registry key mask that determines which registry keys match the rule.
Syntax
func (obj *CBRegistry) DefaultRuleMask(DefaultRuleIndex int32) (string, error)
Default Value
""
Remarks
This property reflects a registry key mask that determines which registry keys match the rule.
This property reflects the registry key mask used to determine whether a registry key matches the rule. In addition to being its primary match qualifier, a rule's mask also serves as its identifier; every rule in a ruleset must have a unique mask.
The DefaultRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the DefaultRuleCount property.
This property is read-only.
Data Type
string
FilterRuleCount Property (CBRegistry Component)
The number of records in the FilterRule arrays.
Syntax
func (obj *CBRegistry) FilterRuleCount() (int32, error)
Default Value
0
Remarks
This property controls the size of the following arrays:
The array indices start at 0 and end at FilterRuleCount - 1.This property is read-only.
Data Type
int32
FilterRuleAccessFlags Property (CBRegistry Component)
This property indicates the access restrictions enforced by the rule.
Syntax
func (obj *CBRegistry) FilterRuleAccessFlags(FilterRuleIndex int32) (int32, error)
Default Value
0
Remarks
This property indicates the access restrictions enforced by the rule.
This property indicates which access restrictions are enforced by the rule. Please refer to the Access Rules topic for more information. The value of this property is a combination of zero or more of the following:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The FilterRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the FilterRuleCount property.
This property is read-only.
Data Type
int32
FilterRuleControlFlags Property (CBRegistry Component)
This property indicates which control events the rule causes the class to fire.
Syntax
func (obj *CBRegistry) FilterRuleControlFlags(FilterRuleIndex int32) (int64, error)
Default Value
0
Remarks
This property indicates which control events the rule causes the struct to fire.
This property indicates which registry operations, of those performed on matching registry keys, the struct should fire Control Events for. The value of this property is a combination of zero or more of the following:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
The FilterRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the FilterRuleCount property.
This property is read-only.
Data Type
int64
FilterRuleMask Property (CBRegistry Component)
This property reflects a registry key mask that determines which registry keys match the rule.
Syntax
func (obj *CBRegistry) FilterRuleMask(FilterRuleIndex int32) (string, error)
Default Value
""
Remarks
This property reflects a registry key mask that determines which registry keys match the rule.
This property reflects the registry key mask used to determine whether a registry key matches the rule. In addition to being its primary match qualifier, a rule's mask also serves as its identifier; every rule in a ruleset must have a unique mask.
The FilterRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the FilterRuleCount property.
This property is read-only.
Data Type
string
PassthroughRuleCount Property (CBRegistry Component)
The number of records in the PassthroughRule arrays.
Syntax
func (obj *CBRegistry) PassthroughRuleCount() (int32, error)
Default Value
0
Remarks
This property controls the size of the following arrays:
The array indices start at 0 and end at PassthroughRuleCount - 1.This property is read-only.
Data Type
int32
PassthroughRuleAccessFlags Property (CBRegistry Component)
This property indicates the access restrictions lifted by the rule.
Syntax
func (obj *CBRegistry) PassthroughRuleAccessFlags(PassthroughRuleIndex int32) (int32, error)
Default Value
0
Remarks
This property indicates the access restrictions lifted by the rule.
This property indicates which access restrictions are lifted by the rule. Please refer to the Passthrough Rules topic for more information. The value of this property is a combination of zero or more of the following:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The PassthroughRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PassthroughRuleCount property.
This property is read-only.
Data Type
int32
PassthroughRuleControlFlags Property (CBRegistry Component)
This property indicates which control events the rule prevents the class from firing.
Syntax
func (obj *CBRegistry) PassthroughRuleControlFlags(PassthroughRuleIndex int32) (int64, error)
Default Value
0
Remarks
This property indicates which control events the rule prevents the struct from firing.
This property indicates which registry operations, of those performed on matching registry keys, the struct should not fire Control Events for. Please refer to the Passthrough Rules topic for more information. The value of this property is a combination of zero or more of the following:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
The PassthroughRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PassthroughRuleCount property.
This property is read-only.
Data Type
int64
PassthroughRuleMask Property (CBRegistry Component)
This property reflects a registry key mask that determines which registry keys match the rule.
Syntax
func (obj *CBRegistry) PassthroughRuleMask(PassthroughRuleIndex int32) (string, error)
Default Value
""
Remarks
This property reflects a registry key mask that determines which registry keys match the rule.
This property reflects the registry key mask used to determine whether a registry key matches the rule. In addition to being its primary match qualifier, a rule's mask also serves as its identifier; every rule in a ruleset must have a unique mask.
The PassthroughRuleIndex parameter specifies the index of the item in the array. The size of the array is controlled by the PassthroughRuleCount property.
This property is read-only.
Data Type
string
SerializeEvents Property (CBRegistry Component)
Whether events should be fired on a single worker thread, or many.
Syntax
func (obj *CBRegistry) SerializeEvents() (int32, error)
func (obj *CBRegistry) SetSerializeEvents(value int32) error
Default Value
0
Remarks
This property specifies whether the struct should fire all events serially on a single worker thread, or concurrently on multiple worker threads. The possible values are:
0 (seOnMultipleThreads) | The struct fires events in the context of multiple worker threads. The MinWorkerThreadCount and MaxWorkerThreadCount configuration settings control how many worker threads are used for this. |
1 (seOnOneWorkerThread) | The struct fires events in the context of one background worker thread. |
Please refer to the Threading and Concurrency topic for more information.
Note: This property cannot be changed when Active is true, and it cannot be changed within events.
Data Type
int32
Tag Property (CBRegistry Component)
This property stores application-defined data specific to a particular instance of the class.
Syntax
func (obj *CBRegistry) Tag() (int64, error)
func (obj *CBRegistry) SetTag(value int64) error
Default Value
0
Remarks
This property can be used to store data specific to a particular instance of the struct.
Data Type
int64
AddDefaultRule Method (CBRegistry Component)
This method adds a default rule.
Syntax
func (obj *CBRegistry) AddDefaultRule(Mask string, AccessFlags int32, ProductGUID string) (bool, error)
Remarks
This method adds a default rule for the registry keys that matches the specified Mask. Each rule in a ruleset is uniquely identified by its mask; if a rule with the specified mask already exists, the new rule's parameters are merged into it.
If the rule is added successfully, this method returns true; otherwise, it returns false.
Default rules, like access rules, instruct the struct's system driver to apply certain access restrictions to matching registry keys. However, unlike access rules, default rules are managed by the driver directly; they are activated as soon as the driver loads at boot time, and then continue to be enforced at all times, regardless of whether or not the application that added them is open.
The Mask parameter must be a valid registry key mask according to the Registry Key Masks topic. Only the registry keys that match the specified mask will be covered by the rule.
The AccessFlags parameter specifies which access restrictions the struct's system driver should apply to matching registry keys. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The ProductGUID parameter identifies the application that the rule should be associated with in the registry. In most cases, the value passed for this parameter should be the same one that was used to call the Initialize method.
This method requires administrative rights to execute successfully. If the user account of the process that calls this method doesn't have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error. Please refer to the Default Rules topic for more information.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
AddFilteredProcessById Method (CBRegistry Component)
This method adds a process, by process ID (PID), to the list of filtered processes.
Syntax
func (obj *CBRegistry) AddFilteredProcessById(ProcessId int32, IncludeChildren bool) error
Remarks
This method adds the process with the specified ProcessId (PID) to the list of processes whose requests should be filtered (i.e., that the struct should fire events for).
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The ProcessId parameter specifies the PID of the process whose requests should be filtered. The value passed for this parameter must either be the PID of an existing process; or -1, which means "all processes". When adding a PID-based rule, you need to be aware of the PID Reuse behavior of Windows.
The IncludeChildren parameter specifies whether requests made by the specified process's children should also be filtered.
Note: This method can be called only when Active is true.
AddFilteredProcessByName Method (CBRegistry Component)
This method adds a process, by name, to the list of filtered processes.
Syntax
func (obj *CBRegistry) AddFilteredProcessByName(ProcessName string, IncludeChildren bool) error
Remarks
This method adds the process with the specified ProcessName to the list of processes whose requests should be filtered (i.e., that the struct should fire events for).
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The ProcessName parameter must be a valid process executable name. It may optionally begin with a path, and both the name and the path (if present) may include wildcards (* and ?). A process with a matching executable name does not actually need to exist when this method is called.
The IncludeChildren parameter specifies whether requests made by the specified process's children should also be filtered.
Note: This method can be called only when Active is true.
AddFilterRule Method (CBRegistry Component)
This method adds a standard filter rule or access rule.
Syntax
func (obj *CBRegistry) AddFilterRule(Mask string, AccessFlags int32, ControlFlags int64) (bool, error)
Remarks
This method adds a standard filter rule or access rule for the registry keys that matches the specified Mask. Each rule in a ruleset is uniquely identified by its mask; if a rule with the specified mask already exists, the new rule's parameters are merged into it. If the rule is added successfully, this method returns true; otherwise, it returns false.
Standard filter rules determine which registry operations, of those performed on matching registry keys, the struct should fire its events for. Access rules instruct the struct's system driver to apply certain access restrictions to matching registry keys.
The Mask parameter must be a valid registry key mask according to the Registry Key Masks topic. Only the registry keys that match the specified mask will be covered by the rule.
The AccessFlags parameter specifies which access restrictions the struct's system driver should apply to matching registry keys. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The ControlFlags parameter specifies which registry operations the struct should fire Control Events for. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
AddIgnoredProcessById Method (CBRegistry Component)
This method adds a process, by process Id (PID), to the list of ignored processes.
Syntax
func (obj *CBRegistry) AddIgnoredProcessById(ProcessId int32, IncludeChildren bool) error
Remarks
This method adds the process with the specified ProcessId (PID) to the list of processes whose requests should be ignored (i.e., that the struct should not fire events for).
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The ProcessId parameter specifies the PID of the process whose requests should be ignored. The value passed for this parameter must be the PID of an existing process. When adding a PID-based rule, you need to be aware of the PID Reuse behavior of Windows.
The IncludeChildren parameter specifies whether requests made by the specified process's children should also be ignored.
Note: The struct's system driver ignores all processes' requests by default; applications should use this method only to explicitly exclude a process that would otherwise be filtered because of a process filtering rule added with AddFilteredProcessById or AddFilteredProcessByName.
Note: This method can be called only when Active is true.
AddIgnoredProcessByName Method (CBRegistry Component)
This method adds a process, by name, to the list of ignored processes.
Syntax
func (obj *CBRegistry) AddIgnoredProcessByName(ProcessName string, IncludeChildren bool) error
Remarks
This method adds the process with the specified ProcessName to the list of processes whose requests should be ignored (i.e., that the struct should not fire events for).
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The ProcessName parameter must be a valid process executable name. It may optionally begin with a path, and both the name and the path (if present) may include wildcards (* and ?). A process with a matching executable name does not actually need to exist when this method is called.
The IncludeChildren parameter specifies whether requests made by the specified process's children should also be ignored.
Note: The struct's system driver ignores all processes' requests by default; applications should use this method only to explicitly exclude a process that would otherwise be filtered because of a process filtering rule added with AddFilteredProcessById or AddFilteredProcessByName.
Note: This method can be called only when Active is true.
AddPassthroughRule Method (CBRegistry Component)
This method adds a passthrough rule.
Syntax
func (obj *CBRegistry) AddPassthroughRule(Mask string, AccessFlags int32, ControlFlags int64) (bool, error)
Remarks
This method adds a passthrough rule for the registry keys that matches the specified Mask. Each rule in a ruleset is uniquely identified by its mask; if a rule with the specified mask already exists, the new rule's parameters are merged into it.
If the rule is added successfully, this method returns true; otherwise, it returns false.
Passthrough rules exclude matching registry keys from being processed by other filter rules.
The Mask parameter must be a valid registry key mask according to the Registry Key Masks topic. Only the registry keys that match the specified mask will be covered by the rule.
The AccessFlags parameter specifies which access restrictions the struct's system driver should lift from matching registry keys. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The ControlFlags parameter specifies which registry operations the struct should not fire Control Events for. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
CloseDefaultRulesSnapshot Method (CBRegistry Component)
This method closes the previously created default rules snapshot.
Syntax
func (obj *CBRegistry) CloseDefaultRulesSnapshot() error
Remarks
This method closes the default rules snapshot previously created by CreateDefaultRulesSnapshot, releasing the memory associated with it. Please refer to that method's documentation for more information.
Note: This method cannot be called within events.
The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads (e.g., during the AfterFilterAttachToVolume and AfterFilterDetachFromVolume events) are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists both occur in a thread-safe manner.
Config Method (CBRegistry Component)
Sets or retrieves a configuration setting.
Syntax
func (obj *CBRegistry) Config(ConfigurationString string) (string, error)
Remarks
Config is a generic method available in every struct. It is used to set and retrieve configuration settings for the struct.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the struct, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
CreateDefaultRulesSnapshot Method (CBRegistry Component)
This method creates a snapshot of information about the default rules that have been added.
Syntax
func (obj *CBRegistry) CreateDefaultRulesSnapshot(ProductGUID string) error
Remarks
This method creates a snapshot of information about all default rules that have been added by the application identified by ProductGUID. This information is then used to populate the DefaultRule* properties.
When the application is finished working with the default rules snapshot, it must close it by calling the CloseDefaultRulesSnapshot method to release the associated memory. If this method is called again before an existing snapshot is closed, the struct will attempt to close it before creating a new one.
Note: This method cannot be called within events.
The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads (e.g., during the AfterFilterAttachToVolume and AfterFilterDetachFromVolume events) are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists both occur in a thread-safe manner.
DeleteAllFilterRules Method (CBRegistry Component)
This method deletes all standard filter rules.
Syntax
func (obj *CBRegistry) DeleteAllFilterRules() (bool, error)
Remarks
This method deletes all standard filter rules that are currently present.
If the rules are deleted successfully, this method returns true; otherwise, it returns false.
To delete standard filter rules individually, use the DeleteFilterRule method instead.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
DeleteAllPassthroughRules Method (CBRegistry Component)
This method deletes all passthrough rules.
Syntax
func (obj *CBRegistry) DeleteAllPassthroughRules() (bool, error)
Remarks
This method deletes all passthrough rules that are currently present.
If the rules are deleted successfully, this method returns true; otherwise, it returns false.
To delete passthrough rules individually, use the DeletePassthroughRule method instead.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
DeleteDefaultRule Method (CBRegistry Component)
This method deletes a particular default rule.
Syntax
func (obj *CBRegistry) DeleteDefaultRule(Mask string, AccessFlags int32, ProductGUID string) (bool, error)
Remarks
This method deletes the specified AccessFlags from the default rule identified by Mask and associated with the application identified by ProductGUID. If AccessFlags includes all flags currently present in the rule, then the entire rule is deleted; otherwise, the flags specified by AccessFlags are simply removed from the rule.
If the flags or this rule are deleted successfully, this method returns true; otherwise, it returns false.
The Mask parameter must be the registry key mask of an existing rule. If a rule with the specified mask cannot be found, this method will fail.
The AccessFlags parameter specifies which access restrictions should be removed from the rule. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
In most cases, the value passed for the ProductGUID parameter should be the same one that was used to call the Initialize method. Please refer to the AddDefaultRule method's documentation for more information.
This method requires administrative rights to execute successfully. If the user account of the process that calls this method doesn't have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error. Please refer to the Default Rules topic for more information.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
DeleteFilterRule Method (CBRegistry Component)
This method deletes a particular standard filter rule or access rule.
Syntax
func (obj *CBRegistry) DeleteFilterRule(Mask string, AccessFlags int32, ControlFlags int64) (bool, error)
Remarks
This method deletes the specified AccessFlags or ControlFlags from the standard filter rule or access rule identified by Mask. If the aforementioned parameters include all flags currently present in the rule, then the entire rule is deleted; otherwise, the specified flags are simply removed from the rule.
If the flags or this rule are deleted successfully, this method returns true; otherwise, it returns false.
The Mask parameter must be the registry key mask of an existing rule. If a rule with the specified mask cannot be found, this method will fail.
The AccessFlags parameter specifies which access restrictions should be removed from the rule. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The ControlFlags parameter specifies which Control Event flags should be removed from the rule. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
To delete all standard filter rules and access rules, use the DeleteAllFilterRules method instead.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
DeletePassthroughRule Method (CBRegistry Component)
This method deletes a particular passthrough rule.
Syntax
func (obj *CBRegistry) DeletePassthroughRule(Mask string, AccessFlags int32, ControlFlags int64) (bool, error)
Remarks
This method deletes the specified AccessFlags or ControlFlags from the passthrough rule identified by Mask. If the aforementioned parameters include all flags currently present in the rule, then the entire rule is deleted; otherwise, the specified flags are simply removed from the rule.
If the flags or this rule are deleted successfully, this method returns true; otherwise, it returns false.
The Mask parameter must be the registry key mask of an existing rule. If a rule with the specified mask cannot be found, this method will fail.
The AccessFlags parameter specifies which access restrictions should be removed from the rule. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
ACCESS_NONE | 0x00 | No access restrictions. |
ACCESS_READ_ONLY | 0x01 | Read-only access; writing and deleting are prohibited. |
ACCESS_WRITE_ONLY | 0x02 | Write-only access; reading and deleting are prohibited. |
ACCESS_DELETE_PROTECT | 0x04 | Deleting and renaming are prohibited. |
ACCESS_EXECUTE_PROTECT | 0x08 | Execution is prohibited. |
ACCESS_NO_CHANGE_DAC | 0x10 | Change of security attributes is prohibited. |
ACCESS_NO_CHANGE_OWNER | 0x20 | Change of owner is prohibited. |
ACCESS_RENAME_PROTECT | 0x40 | Renaming is prohibited. |
ACCESS_DELETE_ONLY_PROTECT | 0x80 | Deleting is prohibited (renaming is not affected). |
ACCESS_REMOTE_ACCESS_PROTECT | 0x100 | Access from other systems is prohibited. |
ACCESS_DENY_ALL | 0x200 | All access is denied. |
ACCESS_ALL_FLAGS | -1 | Used to denote all currently set access restriction flags. |
The ControlFlags parameter specifies which Control Event flags should be removed from the rule. The value passed for this parameter should be constructed by ORing together zero or more of the following flags:
REG_CE_NONE | 0 | Don't fire for any registry operations.
Control Events will not fire for any registry operations. |
REG_CE_BEFORE_CREATE_KEY | 0x00000001L | Fire before registry key creation operations.
The BeforeCreateKey event will fire anytime the OS attempts to create a registry key. |
REG_CE_AFTER_CREATE_KEY | 0x00000002L | Fire after registry key creation operations.
The AfterCreateKey event will fire after a registry key creation request has been processed, before the response is returned. |
REG_CE_BEFORE_OPEN_KEY | 0x00000004L | Fire before registry key open operations.
The BeforeOpenKey event will fire anytime the OS attempts to open a registry key. |
REG_CE_AFTER_OPEN_KEY | 0x00000008L | Fire after registry key open operations.
The AfterOpenKey event will fire after a registry key open request has been processed, before the response is returned. |
REG_CE_BEFORE_CLOSE_KEY | 0x00000010L | Fire before registry key close operations.
The BeforeCloseKey event will fire anytime the OS closes a registry key. |
REG_CE_AFTER_CLOSE_KEY | 0x00000020L | Fire after registry key close operations.
The AfterCloseKey event will fire after a registry key close request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_KEY | 0x00000040L | Fire before registry key delete operations.
The BeforeDeleteKey event will fire anytime the OS attempts to delete a registry key. |
REG_CE_AFTER_DELETE_KEY | 0x00000080L | Fire after registry key delete operations.
The AfterDeleteKey event will fire after a registry key delete request has been processed, before the response is returned. |
REG_CE_BEFORE_RENAME_KEY | 0x00000100L | Fire before registry key rename operations.
The BeforeRenameKey event will fire anytime the OS attempts to rename a registry key. |
REG_CE_AFTER_RENAME_KEY | 0x00000200L | Fire after registry key rename operations.
The AfterRenameKey event will fire after a registry key rename request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_KEY | 0x00000400L | Fire before subkey enumeration operations.
The BeforeEnumerateKey event will fire anytime the OS attempts to enumerate a registry key's subkeys. |
REG_CE_AFTER_ENUM_KEY | 0x00000800L | Fire after subkey enumeration operations.
The AfterEnumerateKey event will fire after a subkey enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_KEY | 0x00001000L | Fire before registry key metadata retrieval operations.
The BeforeQueryKey event will fire anytime the OS attempts to retrieve a registry key's metadata. |
REG_CE_AFTER_QUERY_KEY | 0x00002000L | Fire after registry key metadata retrieval operations.
The AfterQueryKey event will fire after a registry key metadata retrieval request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY | 0x00004000L | Fire before registry key metadata update operations.
The BeforeSetKey event will fire anytime the OS attempts to update a registry key's metadata. |
REG_CE_AFTER_SET_KEY | 0x00008000L | Fire after registry key metadata update operations.
The AfterSetKey event will fire after a registry key metadata update request has been processed, before the response is returned. |
REG_CE_BEFORE_DELETE_VALUE | 0x00010000L | Fire before registry value delete operations.
The BeforeDeleteValue event will fire anytime the OS attempts to delete a registry value. |
REG_CE_AFTER_DELETE_VALUE | 0x00020000L | Fire after registry value delete operations.
The AfterDeleteValue event will fire after a registry value delete request has been processed, before the response is returned. |
REG_CE_BEFORE_ENUM_VALUE | 0x00040000L | Fire before value enumeration operations.
The BeforeEnumerateValue event will fire anytime the OS attempts to enumerate a registry key's values. |
REG_CE_AFTER_ENUM_VALUE | 0x00080000L | Fire after value enumeration operations.
The AfterEnumerateValue event will fire after a value enumeration request has been processed, before the response is returned. |
REG_CE_BEFORE_QUERY_VALUE | 0x00100000L | Fire before registry value query operations.
The BeforeQueryValue event will fire anytime the OS attempts to query a registry value. |
REG_CE_AFTER_QUERY_VALUE | 0x00200000L | Fire after registry value query operations.
The AfterQueryValue event will fire after a registry value query request has been processed, before the response is returned. |
REG_CE_BEFORE_SET_VALUE | 0x00400000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS attempts to set or update a registry value. |
REG_CE_AFTER_SET_VALUE | 0x00800000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a registry value set or update request has been processed, before the response is returned. |
REG_CE_BEFORE_GET_KEY_SECURITY | 0x001000000L | Fire before get registry key security operations.
The BeforeGetKeySecurity event will fire before the OS queries the security attributes of a registry key. |
REG_CE_AFTER_GET_KEY_SECURITY | 0x002000000L | Fire after registry value query operations.
The AfterGetKeySecurity event will fire after a get security operation has been processed, before the response is returned. |
REG_CE_BEFORE_SET_KEY_SECURITY | 0x004000000L | Fire before registry value set/update operations.
The BeforeSetValue event will fire anytime the OS needs to change the security attributes of a registry key. |
REG_CE_AFTER_SET_KEY_SECURITY | 0x008000000L | Fire after registry value set/update operations.
The AfterSetValue event will fire after a security attributes change request has been processed, before the response is returned. |
REG_CE_ALL | -1 | Fire for all registry operations.
Control Events will fire for all registry operations. |
To delete all passthrough rules, use the DeleteAllPassthroughRules method instead.
Note: The methods and properties related to rule management are not intended to be used from multiple threads at once. Applications that wish to use said methods and properties from multiple threads are responsible for employing proper thread synchronization techniques to ensure that manipulation and enumeration of the rule lists occurs in a thread-safe manner.
GetDriverStatus Method (CBRegistry Component)
This method retrieves the status of the class's system driver.
Syntax
func (obj *CBRegistry) GetDriverStatus(ProductGUID string) (int32, error)
Remarks
This method retrieves the status of the struct's system driver. This status can then be used to verify whether it has been properly installed and is ready for use.
The value returned by the method corresponds to the dwCurrentState field of the SERVICE_STATUS structure from the Windows API. It will be one of the following:
MODULE_STATUS_NOT_PRESENT | 0x00000000 | The specified module is not present on the system.
Note: This functionality is only available in Windows. |
MODULE_STATUS_STOPPED | 0x00000001 | The specified module is in the Stopped state.
Note: This functionality is only available in Windows. |
MODULE_STATUS_RUNNING | 0x00000004 | The specified module is loaded and running.
Note: This functionality is only available in Windows. |
ProductGUID is used to distinguish among driver installations performed by different applications. Such information is necessary to guard against unexpected situations, such as the driver being uninstalled by one application despite other applications still needing it.
Therefore, to ensure proper operation, it is critical that each individual application have its own unique ProductGUID value, and that applications (and their installation scripts) use that value when calling any of the following methods:
- Install
- Uninstall
- GetDriverStatus
- GetDriverVersion
- Initialize
This method is available in both the struct API and the Installer DLL included with the product; please refer to the Driver Installation topic for more information about the latter.
Note: This method cannot be called within events.
GetDriverVersion Method (CBRegistry Component)
This method retrieves the version of the class's system driver.
Syntax
func (obj *CBRegistry) GetDriverVersion(ProductGUID string) (int64, error)
Remarks
This method retrieves the version of the struct's system driver. The value is returned as a 64-bit integer composed of four 16-bit words that each correspond to a piece of the overall module version. For example, a version of 2.32.6.28 would cause the value 0x000200200006001C to be returned.
If the struct's system driver is not installed, this method returns 0.
ProductGUID is used to distinguish among driver installations performed by different applications. Such information is necessary to guard against unexpected situations, such as the driver being uninstalled by one application despite other applications still needing it.
Therefore, to ensure proper operation, it is critical that each individual application have its own unique ProductGUID value, and that applications (and their installation scripts) use that value when calling any of the following methods:
- Install
- Uninstall
- GetDriverStatus
- GetDriverVersion
- Initialize
This method is available in both the struct API and the Installer DLL included with the product; please refer to the Driver Installation topic for more information about the latter.
Note: This method cannot be called within events.
GetOriginatorProcessId Method (CBRegistry Component)
This method retrieves the process Id (PID) that initiated the operation.
Syntax
func (obj *CBRegistry) GetOriginatorProcessId() (int32, error)
Remarks
This method can be called within events fired for registry operations to retrieve the process Id (PID) that initiated the operation. If the query fails, this method returns 0.
Note: PIDs are not unique and may be reused by different processes over time (although in practice, this is uncommon).
Note: This method can be called only within events.
GetOriginatorProcessName Method (CBRegistry Component)
This method retrieves the name of the process that initiated the operation.
Syntax
func (obj *CBRegistry) GetOriginatorProcessName() (string, error)
Remarks
This method can be called within events fired for registry operations to retrieve the name of the process that initiated the operation. If the query fails, this method returns empty string.
Note: This method can be called only within events.
GetOriginatorThreadId Method (CBRegistry Component)
This method retrieves the thread Id that initiated the operation.
Syntax
func (obj *CBRegistry) GetOriginatorThreadId() (int32, error)
Remarks
This method can be called within events fired for registry operations to retrieve the thread Id that initiated the operation. If the query fails, this method returns 0.
Note: Thread Ids are not unique and may be reused by different threads over time.
Note: This method can be called only within events.
GetOriginatorToken Method (CBRegistry Component)
This method retrieves the security token associated with the process that initiated the operation.
Syntax
func (obj *CBRegistry) GetOriginatorToken() (int64, error)
Remarks
This method can be called within events fired for registry operations to retrieve the security token associated with the process that initiated the operation. If the query fails, this method returns INVALID_HANDLE_VALUE.
The security token returned by this method can be passed to the Windows API's GetTokenInformation function to obtain more information about the process.
Note: When applications are finished using the returned security token, they must close it using the Windows API's CloseHandle function.
Note: This method can be called only within events.
Initialize Method (CBRegistry Component)
This method initializes the class.
Syntax
func (obj *CBRegistry) Initialize(ProductGUID string) error
Remarks
This method initializes the struct and must be called each time the application starts before attempting to call any of the struct's other methods with the exception of installation-related methods.
ProductGUID is used to distinguish among driver installations performed by different applications. Such information is necessary to guard against unexpected situations, such as the driver being uninstalled by one application despite other applications still needing it.
Therefore, to ensure proper operation, it is critical that each individual application have its own unique ProductGUID value, and that applications (and their installation scripts) use that value when calling any of the following methods:
If the required driver was not installed using the Install method with the same value of ProductGUID, Initialize will return a ERROR_FILE_NOT_FOUND error (Win32 error code 2).
If the loaded kernel-mode driver is older than the user-mode API, Initialize will return a ERROR_INVALID_KERNEL_INFO_VERSION error (Win32 error code 340). In this situation, an update of the driver using the Install method is required before the struct can be used.
Install Method (CBRegistry Component)
This method installs (or upgrades) the class's system driver.
Syntax
func (obj *CBRegistry) Install(CabFileName string, ProductGUID string, PathToInstall string, Flags int32, AllowedControllers string) (bool, error)
Remarks
This method is used to install or upgrade the struct's system driver. If the system must be rebooted to complete the installation process, this method returns true; otherwise, it returns false.
Important: To upgrade the struct's driver, use only the Install method. Previously installed versions of the driver should not be uninstalled first. Calling the Install method will upgrade the previously installed version.
Please refer to the Driver Installation topic for more information.
CabFileName must be the path of the .cab file containing the struct's system driver.
Note: This .cab file must remain on the target system (or be available in some other way) after installation, because it is required to uninstall the driver from the system.
ProductGUID is used to distinguish among driver installations performed by different applications. Such information is necessary to guard against unexpected situations, such as the driver being uninstalled by one application despite other applications still needing it.
Therefore, to ensure proper operation, it is critical that each individual application have its own unique ProductGUID value, and that applications (and their installation scripts) use that value when calling any of the following methods:
PathToInstall controls where the driver is installed. Pass empty string (highly recommended) to automatically install the driver to the appropriate Windows system directory.
Flags specifies various installation options and should contain zero or more of the following flags, ORed together:
INSTALL_REMOVE_OLD_VERSIONS | 0x00000001 | Uninstall drivers from previous struct versions (e.g., 2017). |
INSTALL_KEEP_START_TYPE | 0x00000002 | Keep the driver's current start type setting in the registry.
If this flag is not set (default), the installation logic will reset the driver's start type setting in the Windows registry to the default value. Setting this flag causes the installation logic to preserve the current value, which may be necessary if the user (or the application) set it previously. |
INSTALL_OVERWRITE_SAME_VERSION | 0x00000004 | Install the driver file when its version and build number is the same as the version of the already installed driver. |
INSTALL_REQUESTS_VIA_DRIVER_STACK | 0x00001000 | Whether internal requests to the filesystem are sent directly to the filesystem driver or through the stack of filesystem filter drivers.
This flag is applicable only for CBFilter and CBMonitor. After installation, the effects of this flag can be changed using the SendRequestsViaDriverStack configuration setting. |
INSTALL_ALWAYS_PREPARE_FILES | 0x00010000 | Whether the driver should keep track of information for files that are already open when (i.e., were opened before) the struct is initialized.
This flag is applicable only for CBFilter and CBMonitor. If this flag is set, the driver will prepare information about each file as it is opened, regardless of whether a CBFilter/CBMonitor-based application is actually running at the time. This information then allows applications to receive events for any files that are already open when the CBFilter/CBMonitor struct is initialized. Note: These preparations will slow down all file open operations; do not enable this feature unless it is actually necessary. After installation, the effects of this flag can be changed using the AlwaysPrepareFiles configuration setting. |
INSTALL_FORCE_APP_PERMISSION_CHECK | 0x00020000 | Whether the driver should require the controller process to have elevated or system privileges.
This flag is not applicable for CBProcess. If this flag is set, the driver will verify that the controller process is a system service (or is executing with elevated privileges) anytime a file is opened. If the controller process does not meet these requirements, the file will be skipped (i.e., not filtered in any way). Note: This additional verification will slow down all file open operations. After installation, the effects of this flag can be changed using the ForceAppPermissionCheck configuration setting. |
INSTALL_FORCE_SECURITY_CHECKS | 0x00040000 | Whether the driver should prevent the controller process from filtering files that it would not normally have access to.
This flag is not applicable for CBProcess. If this flag is set, the driver will check the security permissions of the controller process anytime a file is opened to verify that the process has access to the file. If the controller process does not have access to the file, the file will be skipped (i.e., not filtered in any way). For example, if this flag is set and the controller process is running with limited privileges, then the driver will not allow it to filter files that require greater privileges to access. Note: This additional verification will slow down all file open operations. After installation, the effects of this flag can be changed using the ForceSecurityChecks configuration setting. |
AllowedControllers is the optional parameter that makes it possible to limit communication with the driver to just the predefined set of processes. When the caller specifies one or more names of the executable files, filtering can be started with the specified ProductGUID only when filtering is initiated by the process created from one of the listed executable files. If the name of the caller process does not match any of the allowed names, the call to StartFilter will fail with an error.
The parameter may be either empty or contain one or more EXE file names with complete paths. Separate names/paths should be separated by the LF character (numeric code 10).
This method is available in both the struct API and the Installer DLL included with the product; please refer to the Driver Installation topic for more information about the latter.
This method requires administrative rights to execute successfully. If the user account of the process that calls this method doesn't have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error.
Note: This method cannot be called within events.
RemoveFilteredProcessById Method (CBRegistry Component)
This method removes a process, by process Id (PID), from the list of filtered processes.
Syntax
func (obj *CBRegistry) RemoveFilteredProcessById(ProcessId int32) error
Remarks
This method removes the process with the specified ProcessId (PID) from the list of processes whose requests should be filtered.
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The value passed for ProcessId must be one that was previously used to call AddFilteredProcessById; please refer to its documentation for more information.
Note: This method can be called only when Active is true.
RemoveFilteredProcessByName Method (CBRegistry Component)
This method removes a process, by name, from the list of filtered processes.
Syntax
func (obj *CBRegistry) RemoveFilteredProcessByName(ProcessName string) error
Remarks
This method removes the process with the specified ProcessName from the list of processes whose requests should be filtered.
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The value passed for ProcessName must be one that was previously used to call AddFilteredProcessByName; please refer to its documentation for more information.
Note: This method can be called only when Active is true.
RemoveIgnoredProcessById Method (CBRegistry Component)
This method removes a process, by process Id (PID), from the list of ignored processes.
Syntax
func (obj *CBRegistry) RemoveIgnoredProcessById(ProcessId int32) error
Remarks
This method removes the process with the specified ProcessId (PID) from the list of processes whose requests should be ignored.
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The value passed for ProcessId must be one that was previously used to call AddIgnoredProcessById; please refer to its documentation for more information.
Note: This method can be called only when Active is true.
RemoveIgnoredProcessByName Method (CBRegistry Component)
This method removes a process, by name, from the list of ignored processes.
Syntax
func (obj *CBRegistry) RemoveIgnoredProcessByName(ProcessName string) error
Remarks
This method removes the process with the specified ProcessName from the list of processes whose requests should be ignored.
This method is provided for compatibility with CBFS Registry 2017. Use of the new AddFilterRule, DeleteFilterRule, and related methods is recommended instead.
The value passed for ProcessName must be one that was previously used to call AddIgnoredProcessByName; please refer to its documentation for more information.
Note: This method can be called only when Active is true.
ResetTimeout Method (CBRegistry Component)
This method resets the timeout duration for the current event handler.
Syntax
func (obj *CBRegistry) ResetTimeout(Timeout int32) (bool, error)
Remarks
When event timeouts are being enforced, this method can be called within an event handler to inform the struct that request processing is taking longer than expected.
If called successfully, this method returns true, and the current event handler's timeout timer is immediately reset to 0; when it reaches the number of milliseconds specified by Timeout, the driver will either "release" the underlying request and pass it onwards, or cancel it by reporting an error; whichever is most appropriate for the event in question. Please refer to the Timeouts topic for more information.
Passing 0 for Timeout disables the timeout timer for the current event handler, allowing it to take as long as it needs to complete.
Note: This method can be called only within events.
ShutdownSystem Method (CBRegistry Component)
Shuts down or reboots the operating system.
Syntax
func (obj *CBRegistry) ShutdownSystem(ShutdownPrompt string, Timeout int32, ForceCloseApps bool, Reboot bool) (bool, error)
Remarks
This method shuts down or (if Reboot is true) reboots the operating system. If the appropriate privileges cannot be obtained, or if the InitiateSystemShutdown system call returns false, then this method will return false; otherwise, it returns true. This method can be used if the installation or uninstallation function requires the system to be rebooted in order to complete.
ShutdownPrompt, if non-empty, specifies a message that the OS should display to the user for Timeout seconds. If empty string is passed for ShutdownPrompt, no message is displayed and the Timeout parameter's value is ignored.
ForceCloseApps specifies whether the OS should forcefully close all applications. Please keep in mind that forceful closing of applications with unsaved data can lead to data loss.
Reboot specifies whether the OS should reboot (true) or just shut down (false).
This method is available in both the struct API and the Installer DLL included with the product; please refer to the Driver Installation topic for more information about the latter.
Note: This method cannot be called within events.
StartFilter Method (CBRegistry Component)
This method starts filtering registry operations.
Syntax
func (obj *CBRegistry) StartFilter(Timeout int32) error
Remarks
This method attaches the filter, causing the struct's driver to start filtering registry operations according to the filter rules currently present. Rules can be added and removed both before and after this method is called, so long as the Initialize method is called before doing anything else.
This method can fail for a number of reasons, including (but not limited to) the following:
- If the struct's system driver has not been properly installed, or is awaiting a system reboot (as indicated by the return value of Install), this method fails with an ERROR_FILE_NOT_FOUND (2) error code.
- If the Initialize method has not been called yet, this method fails with an ERROR_NOT_READY (21) error code.
- If the filter is already Active, this method fails with an ERROR_CONNECTION_ACTIVE (1230) error code.
- If an invalid value is passed for Timeout, this method fails with an ERROR_IMPLEMENTATION_LIMIT (1292) error code.
Timeout
Timeout specifies how many milliseconds the driver should wait for events to execute before releasing or cancelling the underlying OS requests; please refer to the Timeouts topic for more information. Valid values are 0, which disables event timeouts, and values greater than or equal to 3000. When event timeouts are in effect, event handlers can call ResetTimeout to reset the timer if they require additional time to complete.
StopFilter Method (CBRegistry Component)
This method stops filtering registry operations.
Syntax
func (obj *CBRegistry) StopFilter() error
Remarks
This method detaches the filter, causing the struct's driver to stop filtering registry operations. This method will block until all pending requests have completed and the filter has been detached.
SuspendDefaultRules Method (CBRegistry Component)
This method suspends all default rules until the application exits.
Syntax
func (obj *CBRegistry) SuspendDefaultRules(ProductGUID string) (bool, error)
Remarks
This method suspends (i.e., deactivates) all default rules associated with the application identified by ProductGUID until the application exits. If the rules are suspended successfully, this method returns true; otherwise, it returns false.
In most cases, the value passed for the ProductGUID parameter should be the same one that was used to call the Initialize method.
When the application exits, the struct's system driver will reactivate the suspended rules and start enforcing them once again.
ToggleProcessProtection Method (CBRegistry Component)
This method enables or disables termination protection for the application.
Syntax
func (obj *CBRegistry) ToggleProcessProtection(Enabled bool) (bool, error)
Remarks
This method controls the termination protection mechanism, which applications can enable to prevent their process and threads from being terminated. If successful, this method returns true; otherwise, it returns false.
The Enabled parameter specifies whether termination protection should be enabled (true) or disabled (false); it is disabled by default. If termination protection is enabled, an application must disable it before attempting to exit.
Note: When developing a GUI-based application, please keep in mind that the termination protection mechanism does not intercept Windows' notifications like WM_CLOSE or WM_QUIT; applications must intercept and handle such messages themselves if they wish to protect their UI. Please refer to Microsoft's Window Notifications articles for more information.
Uninstall Method (CBRegistry Component)
This method uninstalls the class's system driver.
Syntax
func (obj *CBRegistry) Uninstall(CabFileName string, ProductGUID string, InstalledPath string, Flags int32) (bool, error)
Remarks
This method is used to uninstall the struct's system driver. If the system must be rebooted to complete the uninstallation process, this method returns true; otherwise, it returns false.
Important: To upgrade the struct's driver, use only the Install method. Previously installed versions of the driver should not be uninstalled first. Calling the Install method will upgrade the previously installed version.
Please refer to the Driver Installation topic for more information.
The same values must be passed for the CabFileName, ProductGUID, and InstalledPath parameters as were passed when Install was called; please refer to its documentation for more information.
Flags specifies which versions of the struct's system driver should be uninstalled and which should be set by ORing together one or more of the following values:
UNINSTALL_VERSION_PREVIOUS | 0x00000001 | Uninstall modules from previous product versions.
Note: This functionality is only available in Windows. |
UNINSTALL_VERSION_CURRENT | 0x00000002 | Uninstall modules from the current product version.
Note: This functionality is only available in Windows. |
UNINSTALL_VERSION_ALL | 0x00000003 | Uninstall modules from all product versions.
Note: This functionality is only available in Windows. |
This method is available in both the struct API and the Installer DLL included with the product; please refer to the Driver Installation topic for more information about the latter.
This method requires administrative rights to execute successfully. If the user account of the process that calls this method doesn't have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error.
Note: This method cannot be called within events.
AfterCloseKey Event (CBRegistry Component)
This event fires after a registry key is closed.
Syntax
// CBRegistryAfterCloseKeyEventArgs carries the CBRegistry AfterCloseKey event's parameters. type CBRegistryAfterCloseKeyEventArgs struct {...} func (args *CBRegistryAfterCloseKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterCloseKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterCloseKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterCloseKeyEvent defines the signature of the CBRegistry AfterCloseKey event's handler function. type CBRegistryAfterCloseKeyEvent func(sender *CBRegistry, args *CBRegistryAfterCloseKeyEventArgs) func (obj *CBRegistry) GetOnAfterCloseKeyHandler() CBRegistryAfterCloseKeyEvent func (obj *CBRegistry) SetOnAfterCloseKeyHandler(handlerFunc CBRegistryAfterCloseKeyEvent)
Remarks
This event fires after a registry key is closed.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_CLOSE_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterCreateKey Event (CBRegistry Component)
This event fires after a registry key is created.
Syntax
// CBRegistryAfterCreateKeyEventArgs carries the CBRegistry AfterCreateKey event's parameters. type CBRegistryAfterCreateKeyEventArgs struct {...} func (args *CBRegistryAfterCreateKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterCreateKeyEventArgs) Status() int32 func (args *CBRegistryAfterCreateKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterCreateKeyEventArgs) KeyHandle() int64 func (args *CBRegistryAfterCreateKeyEventArgs) SetKeyHandle(value int64) func (args *CBRegistryAfterCreateKeyEventArgs) KeyHandleContext() int64 func (args *CBRegistryAfterCreateKeyEventArgs) SetKeyHandleContext(value int64) func (args *CBRegistryAfterCreateKeyEventArgs) GrantedAccess() int32 func (args *CBRegistryAfterCreateKeyEventArgs) SetGrantedAccess(value int32) func (args *CBRegistryAfterCreateKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterCreateKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterCreateKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterCreateKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterCreateKeyEvent defines the signature of the CBRegistry AfterCreateKey event's handler function. type CBRegistryAfterCreateKeyEvent func(sender *CBRegistry, args *CBRegistryAfterCreateKeyEventArgs) func (obj *CBRegistry) GetOnAfterCreateKeyHandler() CBRegistryAfterCreateKeyEvent func (obj *CBRegistry) SetOnAfterCreateKeyHandler(handlerFunc CBRegistryAfterCreateKeyEvent)
Remarks
This event fires after a registry key is created.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_CREATE_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The KeyHandle parameter specifies a handle to a registry key that should be opened instead of the one this event fired for. Applications can set this parameter to redirect access to the registry key associated with the specified handle.
The KeyHandleContext parameter is a placeholder for application-defined data associated with the application-provided registry key handle. Please refer to the Contexts topic for more information.
The GrantedAccess parameter specifies the granted access rights for an application-provided registry key handle. Applications that set KeyHandle must also set this parameter. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterDeleteKey Event (CBRegistry Component)
This event fires after a registry key is deleted.
Syntax
// CBRegistryAfterDeleteKeyEventArgs carries the CBRegistry AfterDeleteKey event's parameters. type CBRegistryAfterDeleteKeyEventArgs struct {...} func (args *CBRegistryAfterDeleteKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterDeleteKeyEventArgs) Status() int32 func (args *CBRegistryAfterDeleteKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterDeleteKeyEventArgs) Processed() bool func (args *CBRegistryAfterDeleteKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterDeleteKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterDeleteKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterDeleteKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterDeleteKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterDeleteKeyEvent defines the signature of the CBRegistry AfterDeleteKey event's handler function. type CBRegistryAfterDeleteKeyEvent func(sender *CBRegistry, args *CBRegistryAfterDeleteKeyEventArgs) func (obj *CBRegistry) GetOnAfterDeleteKeyHandler() CBRegistryAfterDeleteKeyEvent func (obj *CBRegistry) SetOnAfterDeleteKeyHandler(handlerFunc CBRegistryAfterDeleteKeyEvent)
Remarks
This event fires after a registry key is deleted.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_DELETE_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterDeleteValue Event (CBRegistry Component)
This event fires after a registry value is deleted.
Syntax
// CBRegistryAfterDeleteValueEventArgs carries the CBRegistry AfterDeleteValue event's parameters. type CBRegistryAfterDeleteValueEventArgs struct {...} func (args *CBRegistryAfterDeleteValueEventArgs) KeyContext() int64 func (args *CBRegistryAfterDeleteValueEventArgs) Status() int32 func (args *CBRegistryAfterDeleteValueEventArgs) SetStatus(value int32) func (args *CBRegistryAfterDeleteValueEventArgs) Processed() bool func (args *CBRegistryAfterDeleteValueEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterDeleteValueEventArgs) StopFiltering() bool func (args *CBRegistryAfterDeleteValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterDeleteValueEventArgs) ResultCode() int32 func (args *CBRegistryAfterDeleteValueEventArgs) SetResultCode(value int32) // CBRegistryAfterDeleteValueEvent defines the signature of the CBRegistry AfterDeleteValue event's handler function. type CBRegistryAfterDeleteValueEvent func(sender *CBRegistry, args *CBRegistryAfterDeleteValueEventArgs) func (obj *CBRegistry) GetOnAfterDeleteValueHandler() CBRegistryAfterDeleteValueEvent func (obj *CBRegistry) SetOnAfterDeleteValueHandler(handlerFunc CBRegistryAfterDeleteValueEvent)
Remarks
This event fires after a registry value is deleted.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_DELETE_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires. A similar strategy can be applied if the application needs the registry value's name, which can be stored in KeyContext during the corresponding Before* event.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterEnumerateKey Event (CBRegistry Component)
This event fires after a subkey's information is retrieved during key enumeration.
Syntax
// CBRegistryAfterEnumerateKeyEventArgs carries the CBRegistry AfterEnumerateKey event's parameters. type CBRegistryAfterEnumerateKeyEventArgs struct {...} func (args *CBRegistryAfterEnumerateKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterEnumerateKeyEventArgs) Status() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) Index() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) ValidFields() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) LastWriteTime() time.Time func (args *CBRegistryAfterEnumerateKeyEventArgs) SetLastWriteTime(value time.Time) func (args *CBRegistryAfterEnumerateKeyEventArgs) Name() string func (args *CBRegistryAfterEnumerateKeyEventArgs) SetName(value string) func (args *CBRegistryAfterEnumerateKeyEventArgs) ClassName() string func (args *CBRegistryAfterEnumerateKeyEventArgs) SetClassName(value string) func (args *CBRegistryAfterEnumerateKeyEventArgs) SubKeys() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetSubKeys(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) MaxNameLength() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetMaxNameLength(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) MaxClassNameLength() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetMaxClassNameLength(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) Values() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetValues(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) MaxValueNameLength() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetMaxValueNameLength(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) MaxValueDataSize() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetMaxValueDataSize(value int32) func (args *CBRegistryAfterEnumerateKeyEventArgs) VirtualizationCandidate() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetVirtualizationCandidate(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) VirtualizationEnabled() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetVirtualizationEnabled(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) VirtualTarget() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetVirtualTarget(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) VirtualStore() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetVirtualStore(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) VirtualSource() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetVirtualSource(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) Processed() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterEnumerateKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterEnumerateKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterEnumerateKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterEnumerateKeyEvent defines the signature of the CBRegistry AfterEnumerateKey event's handler function. type CBRegistryAfterEnumerateKeyEvent func(sender *CBRegistry, args *CBRegistryAfterEnumerateKeyEventArgs) func (obj *CBRegistry) GetOnAfterEnumerateKeyHandler() CBRegistryAfterEnumerateKeyEvent func (obj *CBRegistry) SetOnAfterEnumerateKeyHandler(handlerFunc CBRegistryAfterEnumerateKeyEvent)
Remarks
This event fires after a subkey's information is retrieved during enumeration of a registry key's subkeys.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_ENUM_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Index parameter reflects the zero-based index of the key (within the registry key being enumerated).
The ValidFields parameter indicates which pieces of information about the key were retrieved. The value of this parameter is a combination of one or more of the following:
REG_KEYFIELD_LASTWRITETIME | 1 | A registry key's last write time. |
REG_KEYFIELD_NAME | 2 | A registry key's name. |
REG_KEYFIELD_MAXNAMELENGTH | 4 | A registry key's longest subkey name. |
REG_KEYFIELD_CLASSNAME | 8 | A registry key's class name. |
REG_KEYFIELD_MAXCLASSNAMELENGTH | 16 | A registry key's longest subkey class name. |
REG_KEYFIELD_SUBKEYS | 32 | The number of subkeys a registry key has. |
REG_KEYFIELD_VALUES | 64 | The number of values a registry key has. |
REG_KEYFIELD_MAXVALUENAMELENGTH | 128 | A registry key's longest value name. |
REG_KEYFIELD_MAXVALUEDATASIZE | 256 | A registry key's largest value data size. |
REG_KEYFIELD_VIRTUALIZATIONINFO | 512 | A registry key's virtualization information. |
The LastWriteTime parameter specifies when the key was last changed, specified in UTC.
The Name parameter specifies the key's name. The maximum length of a registry key name is 255 characters.
The ClassName parameter specifies the key's class name. The maximum length of a registry key class name is 255 characters.
The SubKeys parameter specifies the number of subkeys that the key has.
The MaxNameLength parameter specifies the length, in bytes, of the key's longest subkey name.
The MaxClassNameLength parameter specifies the length, in bytes, of the key's longest subkey class name.
The Values parameter specifies the number of values the key has.
The MaxValueNameLength parameter specifies the length, in bytes, of the key's longest value name.
The MaxValueDataSize parameter specifies the length, in bytes, of the subkey's largest value data size.
The VirtualizationCandidate parameter specifies whether the key is part of the virtualization namespace scope.
The VirtualizationEnabled parameter specifies whether virtualization is enabled on the key. This parameter can only be true if VirtualizationCandidate is true.
The VirtualTarget parameter specifies whether the key is a virtual key. This parameter can only be true if both VirtualizationCandidate and VirtualizationEnabled are both false. Its value is only valid on virtual store key handles.
The VirtualStore parameter specifies whether the key is part of the virtual store path.
The VirtualSource parameter specifies whether the key has ever been virtualized. This parameter can only be true if VirtualizationCandidate is true.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterEnumerateValue Event (CBRegistry Component)
This event fires after a registry value's information is retrieved during key value enumeration.
Syntax
// CBRegistryAfterEnumerateValueEventArgs carries the CBRegistry AfterEnumerateValue event's parameters. type CBRegistryAfterEnumerateValueEventArgs struct {...} func (args *CBRegistryAfterEnumerateValueEventArgs) KeyContext() int64 func (args *CBRegistryAfterEnumerateValueEventArgs) Status() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) SetStatus(value int32) func (args *CBRegistryAfterEnumerateValueEventArgs) Index() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) ValidFields() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) ValueName() string func (args *CBRegistryAfterEnumerateValueEventArgs) SetValueName(value string) func (args *CBRegistryAfterEnumerateValueEventArgs) ValueType() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) SetValueType(value int32) func (args *CBRegistryAfterEnumerateValueEventArgs) IntegerValue() int64 func (args *CBRegistryAfterEnumerateValueEventArgs) SetIntegerValue(value int64) func (args *CBRegistryAfterEnumerateValueEventArgs) StringValue() string func (args *CBRegistryAfterEnumerateValueEventArgs) SetStringValue(value string) func (args *CBRegistryAfterEnumerateValueEventArgs) BinaryValue() []byte func (args *CBRegistryAfterEnumerateValueEventArgs) SetBinaryValue(value []byte) func (args *CBRegistryAfterEnumerateValueEventArgs) MaxBinaryValueSize() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) BinaryValueSize() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) SetBinaryValueSize(value int32) func (args *CBRegistryAfterEnumerateValueEventArgs) Processed() bool func (args *CBRegistryAfterEnumerateValueEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterEnumerateValueEventArgs) StopFiltering() bool func (args *CBRegistryAfterEnumerateValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterEnumerateValueEventArgs) ResultCode() int32 func (args *CBRegistryAfterEnumerateValueEventArgs) SetResultCode(value int32) // CBRegistryAfterEnumerateValueEvent defines the signature of the CBRegistry AfterEnumerateValue event's handler function. type CBRegistryAfterEnumerateValueEvent func(sender *CBRegistry, args *CBRegistryAfterEnumerateValueEventArgs) func (obj *CBRegistry) GetOnAfterEnumerateValueHandler() CBRegistryAfterEnumerateValueEvent func (obj *CBRegistry) SetOnAfterEnumerateValueHandler(handlerFunc CBRegistryAfterEnumerateValueEvent)
Remarks
This event fires after a registry value's information is retrieved during enumeration of a registry key's values.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_ENUM_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Index parameter reflects the zero-based index of the registry value (within the registry key being enumerated).
The ValidFields parameter indicates which pieces of information about the registry value were retrieved. The value of this parameter is a combination of one or more of the following:
REG_VALUEFIELD_TYPE | 1 | A registry value's type. |
REG_VALUEFIELD_NAME | 2 | A registry value's name. |
REG_VALUEFIELD_DATA | 4 | A registry value's data. |
The ValueName parameter specifies the registry value's name.
The ValueType parameter specifies the registry value's type and determines which of the other parameters holds the registry value's data (please refer to their descriptions for more information). Possible values are as follows:
REG_VALUETYPE_SZ | 1 | A unicode string. |
REG_VALUETYPE_EXPAND_SZ | 2 | A unicode string that contains environmental variable references. |
REG_VALUETYPE_BINARY | 3 | Binary data. |
REG_VALUETYPE_DWORD | 4 | A 32-bit number. |
REG_VALUETYPE_MULTI_SZ | 7 | Multiple unicode strings. |
REG_VALUETYPE_QWORD | 11 | A 64-bit number. |
The IntegerValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_DWORD or REG_VALUETYPE_QWORD.
The StringValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_SZ, REG_VALUETYPE_EXPAND_SZ, or REG_VALUETYPE_MULTI_SZ.
For REG_VALUETYPE_MULTI_SZ, data are formatted as multiple individual ETB-terminated strings concatenated together into a single null-terminated string (where ETB is the End-of-Transmission-Block character; 23/0x17). For example, the strings This is, a multistring, and value. would be encoded as This is[ETB]a multistring[ETB]value.[ETB][NUL].
Note: As Microsoft's Registry Value Types article describes, the native multistring data format uses null terminators for the individual strings (e.g., This is[NUL]a multistring[NUL]value.[NUL][NUL]); CBRegistry converts the individual null terminators to/from ETB characters internally for applications' convenience.
The BinaryValue parameter points to a memory buffer that holds the registry value's data if ValueType is REG_VALUETYPE_BINARY. The MaxBinaryValueSize and BinaryValueSize parameter specify the capacity of the BinaryValue buffer and the length of the data it contains, respectively, in bytes.
Always check MaxBinaryValueSize before copying any data into the BinaryValue buffer. If the buffer is large enough to hold all of the data, copy the data into it, and then update BinaryValueSize accordingly. If the buffer is not large enough, do not copy any data into it; instead, set BinaryValueSize to the required buffer size (i.e., the size of the data) and return the ERROR_MORE_DATA (234) error code via ResultCode.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterGetKeySecurity Event (CBRegistry Component)
This event fires after a registry key's security attributes are changed.
Syntax
// CBRegistryAfterGetKeySecurityEventArgs carries the CBRegistry AfterGetKeySecurity event's parameters. type CBRegistryAfterGetKeySecurityEventArgs struct {...} func (args *CBRegistryAfterGetKeySecurityEventArgs) KeyContext() int64 func (args *CBRegistryAfterGetKeySecurityEventArgs) Status() int32 func (args *CBRegistryAfterGetKeySecurityEventArgs) SetStatus(value int32) func (args *CBRegistryAfterGetKeySecurityEventArgs) SecurityInformation() int32 func (args *CBRegistryAfterGetKeySecurityEventArgs) SecurityDescriptor() []byte func (args *CBRegistryAfterGetKeySecurityEventArgs) SetSecurityDescriptor(value []byte) func (args *CBRegistryAfterGetKeySecurityEventArgs) Length() int32 func (args *CBRegistryAfterGetKeySecurityEventArgs) LengthNeeded() int32 func (args *CBRegistryAfterGetKeySecurityEventArgs) SetLengthNeeded(value int32) func (args *CBRegistryAfterGetKeySecurityEventArgs) Processed() bool func (args *CBRegistryAfterGetKeySecurityEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterGetKeySecurityEventArgs) StopFiltering() bool func (args *CBRegistryAfterGetKeySecurityEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterGetKeySecurityEventArgs) ResultCode() int32 func (args *CBRegistryAfterGetKeySecurityEventArgs) SetResultCode(value int32) // CBRegistryAfterGetKeySecurityEvent defines the signature of the CBRegistry AfterGetKeySecurity event's handler function. type CBRegistryAfterGetKeySecurityEvent func(sender *CBRegistry, args *CBRegistryAfterGetKeySecurityEventArgs) func (obj *CBRegistry) GetOnAfterGetKeySecurityHandler() CBRegistryAfterGetKeySecurityEvent func (obj *CBRegistry) SetOnAfterGetKeySecurityHandler(handlerFunc CBRegistryAfterGetKeySecurityEvent)
Remarks
This event fires after security attributes are changed for the registry key specified by KeyContext.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_GET_KEY_SECURITY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The SecurityInformation parameter indicates which pieces of security information were requested. Please refer to Microsoft's SECURITY_INFORMATION data type documentation for more information about possible values.
The SecurityDescriptor parameter points to a memory buffer that, if the request was successful, contains the requested security information. The Length parameter reflects the length of the data, in bytes. Please see the Buffer Parameters topic for more information on how to work with memory buffer event parameters.
The data are formatted as a SECURITY_DESCRIPTOR structure in self-relative format; please refer to the Microsoft's documentation for more information.
Applications that wish to modify the security information may do so by replacing the data in the SecurityDescriptor buffer. If the current Length is too small to accommodate the new security information, set LengthNeeded to the number of bytes necessary to hold the data, and return the ERROR_INSUFFICIENT_BUFFER error code via ResultCode.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterOpenKey Event (CBRegistry Component)
This event fires after a registry key is opened.
Syntax
// CBRegistryAfterOpenKeyEventArgs carries the CBRegistry AfterOpenKey event's parameters. type CBRegistryAfterOpenKeyEventArgs struct {...} func (args *CBRegistryAfterOpenKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterOpenKeyEventArgs) Status() int32 func (args *CBRegistryAfterOpenKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterOpenKeyEventArgs) KeyHandle() int64 func (args *CBRegistryAfterOpenKeyEventArgs) SetKeyHandle(value int64) func (args *CBRegistryAfterOpenKeyEventArgs) KeyHandleContext() int64 func (args *CBRegistryAfterOpenKeyEventArgs) SetKeyHandleContext(value int64) func (args *CBRegistryAfterOpenKeyEventArgs) GrantedAccess() int32 func (args *CBRegistryAfterOpenKeyEventArgs) SetGrantedAccess(value int32) func (args *CBRegistryAfterOpenKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterOpenKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterOpenKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterOpenKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterOpenKeyEvent defines the signature of the CBRegistry AfterOpenKey event's handler function. type CBRegistryAfterOpenKeyEvent func(sender *CBRegistry, args *CBRegistryAfterOpenKeyEventArgs) func (obj *CBRegistry) GetOnAfterOpenKeyHandler() CBRegistryAfterOpenKeyEvent func (obj *CBRegistry) SetOnAfterOpenKeyHandler(handlerFunc CBRegistryAfterOpenKeyEvent)
Remarks
This event fires after a registry key is opened.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_OPEN_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The KeyHandle parameter specifies a handle to a registry key that should be opened instead of the one this event fired for. Applications can set this parameter to redirect access to the registry key associated with the specified handle.
The KeyHandleContext parameter is a placeholder for application-defined data associated with the application-provided registry key handle. Please refer to the Contexts topic for more information.
The GrantedAccess parameter specifies the granted access rights for an application-provided registry key handle. Applications that set KeyHandle must also set this parameter. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterQueryKey Event (CBRegistry Component)
This event fires after a registry key's information is retrieved.
Syntax
// CBRegistryAfterQueryKeyEventArgs carries the CBRegistry AfterQueryKey event's parameters. type CBRegistryAfterQueryKeyEventArgs struct {...} func (args *CBRegistryAfterQueryKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterQueryKeyEventArgs) Status() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) ValidFields() int32 func (args *CBRegistryAfterQueryKeyEventArgs) LastWriteTime() time.Time func (args *CBRegistryAfterQueryKeyEventArgs) SetLastWriteTime(value time.Time) func (args *CBRegistryAfterQueryKeyEventArgs) Name() string func (args *CBRegistryAfterQueryKeyEventArgs) SetName(value string) func (args *CBRegistryAfterQueryKeyEventArgs) ClassName() string func (args *CBRegistryAfterQueryKeyEventArgs) SetClassName(value string) func (args *CBRegistryAfterQueryKeyEventArgs) SubKeys() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetSubKeys(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) MaxNameLength() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetMaxNameLength(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) MaxClassNameLength() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetMaxClassNameLength(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) Values() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetValues(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) MaxValueNameLength() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetMaxValueNameLength(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) MaxValueDataSize() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetMaxValueDataSize(value int32) func (args *CBRegistryAfterQueryKeyEventArgs) VirtualizationCandidate() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetVirtualizationCandidate(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) VirtualizationEnabled() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetVirtualizationEnabled(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) VirtualTarget() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetVirtualTarget(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) VirtualStore() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetVirtualStore(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) VirtualSource() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetVirtualSource(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) Processed() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterQueryKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterQueryKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterQueryKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterQueryKeyEvent defines the signature of the CBRegistry AfterQueryKey event's handler function. type CBRegistryAfterQueryKeyEvent func(sender *CBRegistry, args *CBRegistryAfterQueryKeyEventArgs) func (obj *CBRegistry) GetOnAfterQueryKeyHandler() CBRegistryAfterQueryKeyEvent func (obj *CBRegistry) SetOnAfterQueryKeyHandler(handlerFunc CBRegistryAfterQueryKeyEvent)
Remarks
This event fires after a registry key's information is retrieved.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_QUERY_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The ValidFields parameter indicates which pieces of information about the key were retrieved. The value of this parameter is a combination of one or more of the following:
REG_KEYFIELD_LASTWRITETIME | 1 | A registry key's last write time. |
REG_KEYFIELD_NAME | 2 | A registry key's name. |
REG_KEYFIELD_MAXNAMELENGTH | 4 | A registry key's longest subkey name. |
REG_KEYFIELD_CLASSNAME | 8 | A registry key's class name. |
REG_KEYFIELD_MAXCLASSNAMELENGTH | 16 | A registry key's longest subkey class name. |
REG_KEYFIELD_SUBKEYS | 32 | The number of subkeys a registry key has. |
REG_KEYFIELD_VALUES | 64 | The number of values a registry key has. |
REG_KEYFIELD_MAXVALUENAMELENGTH | 128 | A registry key's longest value name. |
REG_KEYFIELD_MAXVALUEDATASIZE | 256 | A registry key's largest value data size. |
REG_KEYFIELD_VIRTUALIZATIONINFO | 512 | A registry key's virtualization information. |
The LastWriteTime parameter specifies when the key was last changed, specified in UTC.
The Name parameter specifies the key's name. The maximum length of a registry key name is 255 characters.
The ClassName parameter specifies the key's class name. The maximum length of a registry key class name is 255 characters.
The SubKeys parameter specifies the number of subkeys that the key has.
The MaxNameLength parameter specifies the length, in bytes, of the key's longest subkey name.
The MaxClassNameLength parameter specifies the length, in bytes, of the key's longest subkey class name.
The Values parameter specifies the number of values the key has.
The MaxValueNameLength parameter specifies the length, in bytes, of the key's longest value name.
The MaxValueDataSize parameter specifies the length, in bytes, of the subkey's largest value data size.
The VirtualizationCandidate parameter specifies whether the key is part of the virtualization namespace scope.
The VirtualizationEnabled parameter specifies whether virtualization is enabled on the key. This parameter can only be true if VirtualizationCandidate is true.
The VirtualTarget parameter specifies whether the key is a virtual key. This parameter can only be true if both VirtualizationCandidate and VirtualizationEnabled are both false. Its value is only valid on virtual store key handles.
The VirtualStore parameter specifies whether the key is part of the virtual store path.
The VirtualSource parameter specifies whether the key has ever been virtualized. This parameter can only be true if VirtualizationCandidate is true.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterQueryValue Event (CBRegistry Component)
This event fires after a registry value's information is retrieved.
Syntax
// CBRegistryAfterQueryValueEventArgs carries the CBRegistry AfterQueryValue event's parameters. type CBRegistryAfterQueryValueEventArgs struct {...} func (args *CBRegistryAfterQueryValueEventArgs) KeyContext() int64 func (args *CBRegistryAfterQueryValueEventArgs) Status() int32 func (args *CBRegistryAfterQueryValueEventArgs) SetStatus(value int32) func (args *CBRegistryAfterQueryValueEventArgs) ValueName() string func (args *CBRegistryAfterQueryValueEventArgs) ValidFields() int32 func (args *CBRegistryAfterQueryValueEventArgs) ValueType() int32 func (args *CBRegistryAfterQueryValueEventArgs) SetValueType(value int32) func (args *CBRegistryAfterQueryValueEventArgs) IntegerValue() int64 func (args *CBRegistryAfterQueryValueEventArgs) SetIntegerValue(value int64) func (args *CBRegistryAfterQueryValueEventArgs) StringValue() string func (args *CBRegistryAfterQueryValueEventArgs) SetStringValue(value string) func (args *CBRegistryAfterQueryValueEventArgs) BinaryValue() []byte func (args *CBRegistryAfterQueryValueEventArgs) SetBinaryValue(value []byte) func (args *CBRegistryAfterQueryValueEventArgs) MaxBinaryValueSize() int32 func (args *CBRegistryAfterQueryValueEventArgs) BinaryValueSize() int32 func (args *CBRegistryAfterQueryValueEventArgs) SetBinaryValueSize(value int32) func (args *CBRegistryAfterQueryValueEventArgs) Processed() bool func (args *CBRegistryAfterQueryValueEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterQueryValueEventArgs) StopFiltering() bool func (args *CBRegistryAfterQueryValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterQueryValueEventArgs) ResultCode() int32 func (args *CBRegistryAfterQueryValueEventArgs) SetResultCode(value int32) // CBRegistryAfterQueryValueEvent defines the signature of the CBRegistry AfterQueryValue event's handler function. type CBRegistryAfterQueryValueEvent func(sender *CBRegistry, args *CBRegistryAfterQueryValueEventArgs) func (obj *CBRegistry) GetOnAfterQueryValueHandler() CBRegistryAfterQueryValueEvent func (obj *CBRegistry) SetOnAfterQueryValueHandler(handlerFunc CBRegistryAfterQueryValueEvent)
Remarks
This event fires after a registry value's information is retrieved.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_QUERY_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The ValueName parameter reflects the name of the registry value.
The ValidFields parameter indicates which pieces of information about the registry value were retrieved. The value of this parameter is a combination of one or more of the following:
REG_VALUEFIELD_TYPE | 1 | A registry value's type. |
REG_VALUEFIELD_NAME | 2 | A registry value's name. |
REG_VALUEFIELD_DATA | 4 | A registry value's data. |
The ValueType parameter specifies the registry value's type and determines which of the other parameters holds the registry value's data (please refer to their descriptions for more information). Possible values are as follows:
REG_VALUETYPE_SZ | 1 | A unicode string. |
REG_VALUETYPE_EXPAND_SZ | 2 | A unicode string that contains environmental variable references. |
REG_VALUETYPE_BINARY | 3 | Binary data. |
REG_VALUETYPE_DWORD | 4 | A 32-bit number. |
REG_VALUETYPE_MULTI_SZ | 7 | Multiple unicode strings. |
REG_VALUETYPE_QWORD | 11 | A 64-bit number. |
The IntegerValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_DWORD or REG_VALUETYPE_QWORD.
The StringValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_SZ, REG_VALUETYPE_EXPAND_SZ, or REG_VALUETYPE_MULTI_SZ.
For REG_VALUETYPE_MULTI_SZ, data are formatted as multiple individual ETB-terminated strings concatenated together into a single null-terminated string (where ETB is the End-of-Transmission-Block character; 23/0x17). For example, the strings This is, a multistring, and value. would be encoded as This is[ETB]a multistring[ETB]value.[ETB][NUL].
Note: As Microsoft's Registry Value Types article describes, the native multistring data format uses null terminators for the individual strings (e.g., This is[NUL]a multistring[NUL]value.[NUL][NUL]); CBRegistry converts the individual null terminators to/from ETB characters internally for applications' convenience.
The BinaryValue parameter points to a memory buffer that holds the registry value's data if ValueType is REG_VALUETYPE_BINARY. The MaxBinaryValueSize and BinaryValueSize parameter specify the capacity of the BinaryValue buffer and the length of the data it contains, respectively, in bytes.
Always check MaxBinaryValueSize before copying any data into the BinaryValue buffer. If the buffer is large enough to hold all of the data, copy the data into it, and then update BinaryValueSize accordingly. If the buffer is not large enough, do not copy any data into it; instead, set BinaryValueSize to the required buffer size (i.e., the size of the data) and return the ERROR_MORE_DATA (234) error code via ResultCode.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterRenameKey Event (CBRegistry Component)
This event fires after a registry key is renamed.
Syntax
// CBRegistryAfterRenameKeyEventArgs carries the CBRegistry AfterRenameKey event's parameters. type CBRegistryAfterRenameKeyEventArgs struct {...} func (args *CBRegistryAfterRenameKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterRenameKeyEventArgs) Status() int32 func (args *CBRegistryAfterRenameKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterRenameKeyEventArgs) Processed() bool func (args *CBRegistryAfterRenameKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterRenameKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterRenameKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterRenameKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterRenameKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterRenameKeyEvent defines the signature of the CBRegistry AfterRenameKey event's handler function. type CBRegistryAfterRenameKeyEvent func(sender *CBRegistry, args *CBRegistryAfterRenameKeyEventArgs) func (obj *CBRegistry) GetOnAfterRenameKeyHandler() CBRegistryAfterRenameKeyEvent func (obj *CBRegistry) SetOnAfterRenameKeyHandler(handlerFunc CBRegistryAfterRenameKeyEvent)
Remarks
This event fires after a registry key is renamed.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_RENAME_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's old or new names for performance reasons; applications that need them should store them in KeyContext during the BeforeCreateKey/BeforeOpenKey and BeforeRenameKey events so that they can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterSetKey Event (CBRegistry Component)
This event fires after a registry key's information is updated.
Syntax
// CBRegistryAfterSetKeyEventArgs carries the CBRegistry AfterSetKey event's parameters. type CBRegistryAfterSetKeyEventArgs struct {...} func (args *CBRegistryAfterSetKeyEventArgs) KeyContext() int64 func (args *CBRegistryAfterSetKeyEventArgs) Status() int32 func (args *CBRegistryAfterSetKeyEventArgs) SetStatus(value int32) func (args *CBRegistryAfterSetKeyEventArgs) Processed() bool func (args *CBRegistryAfterSetKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterSetKeyEventArgs) StopFiltering() bool func (args *CBRegistryAfterSetKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterSetKeyEventArgs) ResultCode() int32 func (args *CBRegistryAfterSetKeyEventArgs) SetResultCode(value int32) // CBRegistryAfterSetKeyEvent defines the signature of the CBRegistry AfterSetKey event's handler function. type CBRegistryAfterSetKeyEvent func(sender *CBRegistry, args *CBRegistryAfterSetKeyEventArgs) func (obj *CBRegistry) GetOnAfterSetKeyHandler() CBRegistryAfterSetKeyEvent func (obj *CBRegistry) SetOnAfterSetKeyHandler(handlerFunc CBRegistryAfterSetKeyEvent)
Remarks
This event fires after a registry key's information is updated.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_SET_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterSetKeySecurity Event (CBRegistry Component)
This event fires after a registry key's security attributes are changed.
Syntax
// CBRegistryAfterSetKeySecurityEventArgs carries the CBRegistry AfterSetKeySecurity event's parameters. type CBRegistryAfterSetKeySecurityEventArgs struct {...} func (args *CBRegistryAfterSetKeySecurityEventArgs) KeyContext() int64 func (args *CBRegistryAfterSetKeySecurityEventArgs) Status() int32 func (args *CBRegistryAfterSetKeySecurityEventArgs) SetStatus(value int32) func (args *CBRegistryAfterSetKeySecurityEventArgs) SecurityInformation() int32 func (args *CBRegistryAfterSetKeySecurityEventArgs) SecurityDescriptor() []byte func (args *CBRegistryAfterSetKeySecurityEventArgs) Length() int32 func (args *CBRegistryAfterSetKeySecurityEventArgs) Processed() bool func (args *CBRegistryAfterSetKeySecurityEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterSetKeySecurityEventArgs) StopFiltering() bool func (args *CBRegistryAfterSetKeySecurityEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterSetKeySecurityEventArgs) ResultCode() int32 func (args *CBRegistryAfterSetKeySecurityEventArgs) SetResultCode(value int32) // CBRegistryAfterSetKeySecurityEvent defines the signature of the CBRegistry AfterSetKeySecurity event's handler function. type CBRegistryAfterSetKeySecurityEvent func(sender *CBRegistry, args *CBRegistryAfterSetKeySecurityEventArgs) func (obj *CBRegistry) GetOnAfterSetKeySecurityHandler() CBRegistryAfterSetKeySecurityEvent func (obj *CBRegistry) SetOnAfterSetKeySecurityHandler(handlerFunc CBRegistryAfterSetKeySecurityEvent)
Remarks
This event fires after security attributes are changed for the registry key specified by KeyContext.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_SET_KEY_SECURITY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The SecurityInformation parameter reflects which pieces of security information, of those present in SecurityDescriptor, were to be set. Please refer to Microsoft's SECURITY_INFORMATION data type documentation for more information about possible values.
The SecurityDescriptor parameter points to a memory buffer that contains the new security information. The Length parameter reflects the length of this data, in bytes. Please see the Buffer Parameters topic for more information on how to work with memory buffer event parameters.
The data are formatted as a SECURITY_DESCRIPTOR structure in self-relative format; please refer to the Microsoft's documentation for more information.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
AfterSetValue Event (CBRegistry Component)
This event fires after a registry value is set or updated.
Syntax
// CBRegistryAfterSetValueEventArgs carries the CBRegistry AfterSetValue event's parameters. type CBRegistryAfterSetValueEventArgs struct {...} func (args *CBRegistryAfterSetValueEventArgs) KeyContext() int64 func (args *CBRegistryAfterSetValueEventArgs) Status() int32 func (args *CBRegistryAfterSetValueEventArgs) SetStatus(value int32) func (args *CBRegistryAfterSetValueEventArgs) Processed() bool func (args *CBRegistryAfterSetValueEventArgs) SetProcessed(value bool) func (args *CBRegistryAfterSetValueEventArgs) StopFiltering() bool func (args *CBRegistryAfterSetValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryAfterSetValueEventArgs) ResultCode() int32 func (args *CBRegistryAfterSetValueEventArgs) SetResultCode(value int32) // CBRegistryAfterSetValueEvent defines the signature of the CBRegistry AfterSetValue event's handler function. type CBRegistryAfterSetValueEvent func(sender *CBRegistry, args *CBRegistryAfterSetValueEventArgs) func (obj *CBRegistry) GetOnAfterSetValueHandler() CBRegistryAfterSetValueEvent func (obj *CBRegistry) SetOnAfterSetValueHandler(handlerFunc CBRegistryAfterSetValueEvent)
Remarks
This event fires after a registry value is set or updated.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_AFTER_SET_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires. A similar strategy can be applied if the application needs the registry value's name, which can be stored in KeyContext during the corresponding Before* event.
The Status parameter contains a Win32 error code that indicates the outcome of the operation; 0 indicates success. This value is returned to the request originator if no other status is returned from this event. Applications may change this parameter's value if they want a different Win32 error code to be returned.
The Processed parameter indicates whether the response values have been modified. Applications must set this parameter to true if they have altered any of the parameters related to the response values.
Note: This parameter's value is ignored if an error is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeCloseKey Event (CBRegistry Component)
This event fires before a registry key is closed.
Syntax
// CBRegistryBeforeCloseKeyEventArgs carries the CBRegistry BeforeCloseKey event's parameters. type CBRegistryBeforeCloseKeyEventArgs struct {...} func (args *CBRegistryBeforeCloseKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeCloseKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeCloseKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeCloseKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeCloseKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeCloseKeyEvent defines the signature of the CBRegistry BeforeCloseKey event's handler function. type CBRegistryBeforeCloseKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeCloseKeyEventArgs) func (obj *CBRegistry) GetOnBeforeCloseKeyHandler() CBRegistryBeforeCloseKeyEvent func (obj *CBRegistry) SetOnBeforeCloseKeyHandler(handlerFunc CBRegistryBeforeCloseKeyEvent)
Remarks
This event fires before a registry key is closed.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_CLOSE_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeCreateKey Event (CBRegistry Component)
This event fires before a registry key is created.
Syntax
// CBRegistryBeforeCreateKeyEventArgs carries the CBRegistry BeforeCreateKey event's parameters. type CBRegistryBeforeCreateKeyEventArgs struct {...} func (args *CBRegistryBeforeCreateKeyEventArgs) FullName() string func (args *CBRegistryBeforeCreateKeyEventArgs) DesiredAccess() int32 func (args *CBRegistryBeforeCreateKeyEventArgs) KeyHandle() int64 func (args *CBRegistryBeforeCreateKeyEventArgs) SetKeyHandle(value int64) func (args *CBRegistryBeforeCreateKeyEventArgs) KeyHandleContext() int64 func (args *CBRegistryBeforeCreateKeyEventArgs) SetKeyHandleContext(value int64) func (args *CBRegistryBeforeCreateKeyEventArgs) GrantedAccess() int64 func (args *CBRegistryBeforeCreateKeyEventArgs) SetGrantedAccess(value int64) func (args *CBRegistryBeforeCreateKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeCreateKeyEventArgs) SetKeyContext(value int64) func (args *CBRegistryBeforeCreateKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeCreateKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeCreateKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeCreateKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeCreateKeyEvent defines the signature of the CBRegistry BeforeCreateKey event's handler function. type CBRegistryBeforeCreateKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeCreateKeyEventArgs) func (obj *CBRegistry) GetOnBeforeCreateKeyHandler() CBRegistryBeforeCreateKeyEvent func (obj *CBRegistry) SetOnBeforeCreateKeyHandler(handlerFunc CBRegistryBeforeCreateKeyEvent)
Remarks
This event fires before a registry key is created.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_CREATE_KEY flag.
The FullName parameter reflects the "full" name of the registry key being created, specified, by default, in system format (e.g., HKEY_LOCAL_MACHINE\System\... will be \Registry\Machine\System\...). If the ResolveNtNameToWin32Name configuration setting is enabled, the name will be converted to the more common Win32 format. Applications that intend to use the registry key's name during later events should store it in KeyContext during this event. Please refer to the Contexts topic for more information.
The DesiredAccess parameter reflects the access rights specified by the requestor. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The KeyHandle parameter specifies a handle to a registry key that should be opened instead of the one this event fired for. Applications can set this parameter to redirect access to the registry key associated with the specified handle.
The KeyHandleContext parameter is a placeholder for application-defined data associated with the application-provided registry key handle. Please refer to the Contexts topic for more information.
The GrantedAccess parameter specifies the granted access rights for an application-provided registry key handle. Applications that set KeyHandle must also set this parameter. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeDeleteKey Event (CBRegistry Component)
This event fires before a registry key is deleted.
Syntax
// CBRegistryBeforeDeleteKeyEventArgs carries the CBRegistry BeforeDeleteKey event's parameters. type CBRegistryBeforeDeleteKeyEventArgs struct {...} func (args *CBRegistryBeforeDeleteKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeDeleteKeyEventArgs) Processed() bool func (args *CBRegistryBeforeDeleteKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeDeleteKeyEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeDeleteKeyEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeDeleteKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeDeleteKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeDeleteKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeDeleteKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeDeleteKeyEvent defines the signature of the CBRegistry BeforeDeleteKey event's handler function. type CBRegistryBeforeDeleteKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeDeleteKeyEventArgs) func (obj *CBRegistry) GetOnBeforeDeleteKeyHandler() CBRegistryBeforeDeleteKeyEvent func (obj *CBRegistry) SetOnBeforeDeleteKeyHandler(handlerFunc CBRegistryBeforeDeleteKeyEvent)
Remarks
This event fires before a registry key is deleted.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_DELETE_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeDeleteValue Event (CBRegistry Component)
This event fires before a registry value is deleted.
Syntax
// CBRegistryBeforeDeleteValueEventArgs carries the CBRegistry BeforeDeleteValue event's parameters. type CBRegistryBeforeDeleteValueEventArgs struct {...} func (args *CBRegistryBeforeDeleteValueEventArgs) KeyContext() int64 func (args *CBRegistryBeforeDeleteValueEventArgs) ValueName() string func (args *CBRegistryBeforeDeleteValueEventArgs) Processed() bool func (args *CBRegistryBeforeDeleteValueEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeDeleteValueEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeDeleteValueEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeDeleteValueEventArgs) StopFiltering() bool func (args *CBRegistryBeforeDeleteValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeDeleteValueEventArgs) ResultCode() int32 func (args *CBRegistryBeforeDeleteValueEventArgs) SetResultCode(value int32) // CBRegistryBeforeDeleteValueEvent defines the signature of the CBRegistry BeforeDeleteValue event's handler function. type CBRegistryBeforeDeleteValueEvent func(sender *CBRegistry, args *CBRegistryBeforeDeleteValueEventArgs) func (obj *CBRegistry) GetOnBeforeDeleteValueHandler() CBRegistryBeforeDeleteValueEvent func (obj *CBRegistry) SetOnBeforeDeleteValueHandler(handlerFunc CBRegistryBeforeDeleteValueEvent)
Remarks
This event fires before a registry value is deleted.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_DELETE_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The ValueName parameter reflects the name of the registry value. Applications that intend to use the registry value's name during later events should store it in KeyContext during this event. Please refer to the Contexts topic for more information.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeEnumerateKey Event (CBRegistry Component)
This event fires before a subkey's information is retrieved during key enumeration.
Syntax
// CBRegistryBeforeEnumerateKeyEventArgs carries the CBRegistry BeforeEnumerateKey event's parameters. type CBRegistryBeforeEnumerateKeyEventArgs struct {...} func (args *CBRegistryBeforeEnumerateKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeEnumerateKeyEventArgs) Index() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) RequestedFields() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) LastWriteTime() time.Time func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetLastWriteTime(value time.Time) func (args *CBRegistryBeforeEnumerateKeyEventArgs) Name() string func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetName(value string) func (args *CBRegistryBeforeEnumerateKeyEventArgs) ClassName() string func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetClassName(value string) func (args *CBRegistryBeforeEnumerateKeyEventArgs) SubKeys() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetSubKeys(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) MaxNameLength() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetMaxNameLength(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) MaxClassNameLength() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetMaxClassNameLength(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) Values() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetValues(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) MaxValueNameLength() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetMaxValueNameLength(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) MaxValueDataSize() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetMaxValueDataSize(value int32) func (args *CBRegistryBeforeEnumerateKeyEventArgs) VirtualizationCandidate() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetVirtualizationCandidate(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) VirtualizationEnabled() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetVirtualizationEnabled(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) VirtualTarget() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetVirtualTarget(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) VirtualStore() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetVirtualStore(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) VirtualSource() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetVirtualSource(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) Processed() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeEnumerateKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeEnumerateKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeEnumerateKeyEvent defines the signature of the CBRegistry BeforeEnumerateKey event's handler function. type CBRegistryBeforeEnumerateKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeEnumerateKeyEventArgs) func (obj *CBRegistry) GetOnBeforeEnumerateKeyHandler() CBRegistryBeforeEnumerateKeyEvent func (obj *CBRegistry) SetOnBeforeEnumerateKeyHandler(handlerFunc CBRegistryBeforeEnumerateKeyEvent)
Remarks
This event fires before a subkey's information is retrieved during enumeration of a registry key's subkeys.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_ENUM_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Index parameter reflects the zero-based index of the key (within the registry key being enumerated).
The RequestedFields parameter indicates which pieces of information about the key were requested. The value of this parameter is a combination of one or more of the following:
REG_KEYFIELD_LASTWRITETIME | 1 | A registry key's last write time. |
REG_KEYFIELD_NAME | 2 | A registry key's name. |
REG_KEYFIELD_MAXNAMELENGTH | 4 | A registry key's longest subkey name. |
REG_KEYFIELD_CLASSNAME | 8 | A registry key's class name. |
REG_KEYFIELD_MAXCLASSNAMELENGTH | 16 | A registry key's longest subkey class name. |
REG_KEYFIELD_SUBKEYS | 32 | The number of subkeys a registry key has. |
REG_KEYFIELD_VALUES | 64 | The number of values a registry key has. |
REG_KEYFIELD_MAXVALUENAMELENGTH | 128 | A registry key's longest value name. |
REG_KEYFIELD_MAXVALUEDATASIZE | 256 | A registry key's largest value data size. |
REG_KEYFIELD_VIRTUALIZATIONINFO | 512 | A registry key's virtualization information. |
The LastWriteTime parameter specifies when the key was last changed, specified in UTC.
The Name parameter specifies the key's name. The maximum length of a registry key name is 255 characters.
The ClassName parameter specifies the key's class name. The maximum length of a registry key class name is 255 characters.
The SubKeys parameter specifies the number of subkeys that the key has.
The MaxNameLength parameter specifies the length, in bytes, of the key's longest subkey name.
The MaxClassNameLength parameter specifies the length, in bytes, of the key's longest subkey class name.
The Values parameter specifies the number of values the key has.
The MaxValueNameLength parameter specifies the length, in bytes, of the key's longest value name.
The MaxValueDataSize parameter specifies the length, in bytes, of the subkey's largest value data size.
The VirtualizationCandidate parameter specifies whether the key is part of the virtualization namespace scope.
The VirtualizationEnabled parameter specifies whether virtualization is enabled on the key. This parameter can only be true if VirtualizationCandidate is true.
The VirtualTarget parameter specifies whether the key is a virtual key. This parameter can only be true if both VirtualizationCandidate and VirtualizationEnabled are both false. Its value is only valid on virtual store key handles.
The VirtualStore parameter specifies whether the key is part of the virtual store path.
The VirtualSource parameter specifies whether the key has ever been virtualized. This parameter can only be true if VirtualizationCandidate is true.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeEnumerateValue Event (CBRegistry Component)
This event fires before a registry value's information is retrieved during key value enumeration.
Syntax
// CBRegistryBeforeEnumerateValueEventArgs carries the CBRegistry BeforeEnumerateValue event's parameters. type CBRegistryBeforeEnumerateValueEventArgs struct {...} func (args *CBRegistryBeforeEnumerateValueEventArgs) KeyContext() int64 func (args *CBRegistryBeforeEnumerateValueEventArgs) Index() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) RequestedFields() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) ValueName() string func (args *CBRegistryBeforeEnumerateValueEventArgs) SetValueName(value string) func (args *CBRegistryBeforeEnumerateValueEventArgs) ValueType() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) SetValueType(value int32) func (args *CBRegistryBeforeEnumerateValueEventArgs) IntegerValue() int64 func (args *CBRegistryBeforeEnumerateValueEventArgs) SetIntegerValue(value int64) func (args *CBRegistryBeforeEnumerateValueEventArgs) StringValue() string func (args *CBRegistryBeforeEnumerateValueEventArgs) SetStringValue(value string) func (args *CBRegistryBeforeEnumerateValueEventArgs) BinaryValue() []byte func (args *CBRegistryBeforeEnumerateValueEventArgs) SetBinaryValue(value []byte) func (args *CBRegistryBeforeEnumerateValueEventArgs) MaxBinaryValueSize() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) BinaryValueSize() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) SetBinaryValueSize(value int32) func (args *CBRegistryBeforeEnumerateValueEventArgs) Processed() bool func (args *CBRegistryBeforeEnumerateValueEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeEnumerateValueEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeEnumerateValueEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeEnumerateValueEventArgs) StopFiltering() bool func (args *CBRegistryBeforeEnumerateValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeEnumerateValueEventArgs) ResultCode() int32 func (args *CBRegistryBeforeEnumerateValueEventArgs) SetResultCode(value int32) // CBRegistryBeforeEnumerateValueEvent defines the signature of the CBRegistry BeforeEnumerateValue event's handler function. type CBRegistryBeforeEnumerateValueEvent func(sender *CBRegistry, args *CBRegistryBeforeEnumerateValueEventArgs) func (obj *CBRegistry) GetOnBeforeEnumerateValueHandler() CBRegistryBeforeEnumerateValueEvent func (obj *CBRegistry) SetOnBeforeEnumerateValueHandler(handlerFunc CBRegistryBeforeEnumerateValueEvent)
Remarks
This event fires before a registry value's information is retrieved during enumeration of a registry key's values.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_ENUM_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The Index parameter reflects the zero-based index of the registry value (within the registry key being enumerated).
The RequestedFields parameter indicates which pieces of information about the registry value were requested. The value of this parameter is a combination of one or more of the following:
REG_VALUEFIELD_TYPE | 1 | A registry value's type. |
REG_VALUEFIELD_NAME | 2 | A registry value's name. |
REG_VALUEFIELD_DATA | 4 | A registry value's data. |
The ValueName parameter specifies the registry value's name.
The ValueType parameter specifies the registry value's type and determines which of the other parameters holds the registry value's data (please refer to their descriptions for more information). Possible values are as follows:
REG_VALUETYPE_SZ | 1 | A unicode string. |
REG_VALUETYPE_EXPAND_SZ | 2 | A unicode string that contains environmental variable references. |
REG_VALUETYPE_BINARY | 3 | Binary data. |
REG_VALUETYPE_DWORD | 4 | A 32-bit number. |
REG_VALUETYPE_MULTI_SZ | 7 | Multiple unicode strings. |
REG_VALUETYPE_QWORD | 11 | A 64-bit number. |
The IntegerValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_DWORD or REG_VALUETYPE_QWORD.
The StringValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_SZ, REG_VALUETYPE_EXPAND_SZ, or REG_VALUETYPE_MULTI_SZ.
For REG_VALUETYPE_MULTI_SZ, data are formatted as multiple individual ETB-terminated strings concatenated together into a single null-terminated string (where ETB is the End-of-Transmission-Block character; 23/0x17). For example, the strings This is, a multistring, and value. would be encoded as This is[ETB]a multistring[ETB]value.[ETB][NUL].
Note: As Microsoft's Registry Value Types article describes, the native multistring data format uses null terminators for the individual strings (e.g., This is[NUL]a multistring[NUL]value.[NUL][NUL]); CBRegistry converts the individual null terminators to/from ETB characters internally for applications' convenience.
The BinaryValue parameter points to a memory buffer that holds the registry value's data if ValueType is REG_VALUETYPE_BINARY. The MaxBinaryValueSize and BinaryValueSize parameter specify the capacity of the BinaryValue buffer and the length of the data it contains, respectively, in bytes.
Always check MaxBinaryValueSize before copying any data into the BinaryValue buffer. If the buffer is large enough to hold all of the data, copy the data into it, and then update BinaryValueSize accordingly. If the buffer is not large enough, do not copy any data into it; instead, set BinaryValueSize to the required buffer size (i.e., the size of the data) and return the ERROR_MORE_DATA (234) error code via ResultCode.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeGetKeySecurity Event (CBRegistry Component)
This event fires before a registry key's security attributes are retrieved.
Syntax
// CBRegistryBeforeGetKeySecurityEventArgs carries the CBRegistry BeforeGetKeySecurity event's parameters. type CBRegistryBeforeGetKeySecurityEventArgs struct {...} func (args *CBRegistryBeforeGetKeySecurityEventArgs) KeyContext() int64 func (args *CBRegistryBeforeGetKeySecurityEventArgs) SecurityInformation() int32 func (args *CBRegistryBeforeGetKeySecurityEventArgs) SecurityDescriptor() []byte func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetSecurityDescriptor(value []byte) func (args *CBRegistryBeforeGetKeySecurityEventArgs) Length() int32 func (args *CBRegistryBeforeGetKeySecurityEventArgs) LengthNeeded() int32 func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetLengthNeeded(value int32) func (args *CBRegistryBeforeGetKeySecurityEventArgs) Processed() bool func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeGetKeySecurityEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeGetKeySecurityEventArgs) StopFiltering() bool func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeGetKeySecurityEventArgs) ResultCode() int32 func (args *CBRegistryBeforeGetKeySecurityEventArgs) SetResultCode(value int32) // CBRegistryBeforeGetKeySecurityEvent defines the signature of the CBRegistry BeforeGetKeySecurity event's handler function. type CBRegistryBeforeGetKeySecurityEvent func(sender *CBRegistry, args *CBRegistryBeforeGetKeySecurityEventArgs) func (obj *CBRegistry) GetOnBeforeGetKeySecurityHandler() CBRegistryBeforeGetKeySecurityEvent func (obj *CBRegistry) SetOnBeforeGetKeySecurityHandler(handlerFunc CBRegistryBeforeGetKeySecurityEvent)
Remarks
This event fires before security attributes are retrieved for the registry key specified by KeyContext.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_GET_KEY_SECURITY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The SecurityInformation parameter indicates which pieces of security information are requested. Please refer to Microsoft's SECURITY_INFORMATION data type documentation for more information about possible values.
The SecurityDescriptor parameter points to a memory buffer that receives the requested security information. The buffer referenced by the SecurityDescriptor parameter may be modified by the event handler if the operation is completed without passing it further to other filters and the filesystem driver. The Length parameter reflects the capacity of the SecurityDescriptor buffer, in bytes.
If the capacity reflected by the Length parameter is not sufficient to accommodate the security information, set LengthNeeded to the number of bytes necessary to hold the data, and return the ERROR_INSUFFICIENT_BUFFER error code via ResultCode.
Please see the Buffer Parameters topic for more information on how to work with memory buffer event parameters.
The returned data will be formatted as a SECURITY_DESCRIPTOR structure in self-relative format; please refer to the Microsoft's documentation for more information.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeOpenKey Event (CBRegistry Component)
This event fires before a registry key is opened.
Syntax
// CBRegistryBeforeOpenKeyEventArgs carries the CBRegistry BeforeOpenKey event's parameters. type CBRegistryBeforeOpenKeyEventArgs struct {...} func (args *CBRegistryBeforeOpenKeyEventArgs) FullName() string func (args *CBRegistryBeforeOpenKeyEventArgs) DesiredAccess() int32 func (args *CBRegistryBeforeOpenKeyEventArgs) KeyHandle() int64 func (args *CBRegistryBeforeOpenKeyEventArgs) SetKeyHandle(value int64) func (args *CBRegistryBeforeOpenKeyEventArgs) KeyHandleContext() int64 func (args *CBRegistryBeforeOpenKeyEventArgs) SetKeyHandleContext(value int64) func (args *CBRegistryBeforeOpenKeyEventArgs) GrantedAccess() int32 func (args *CBRegistryBeforeOpenKeyEventArgs) SetGrantedAccess(value int32) func (args *CBRegistryBeforeOpenKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeOpenKeyEventArgs) SetKeyContext(value int64) func (args *CBRegistryBeforeOpenKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeOpenKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeOpenKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeOpenKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeOpenKeyEvent defines the signature of the CBRegistry BeforeOpenKey event's handler function. type CBRegistryBeforeOpenKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeOpenKeyEventArgs) func (obj *CBRegistry) GetOnBeforeOpenKeyHandler() CBRegistryBeforeOpenKeyEvent func (obj *CBRegistry) SetOnBeforeOpenKeyHandler(handlerFunc CBRegistryBeforeOpenKeyEvent)
Remarks
This event fires before a registry key is opened.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_OPEN_KEY flag.
The FullName parameter reflects the "full" name of the registry key being opened, specified, by default, in system format (e.g., HKEY_LOCAL_MACHINE\System\... will be \Registry\Machine\System\...). If the ResolveNtNameToWin32Name configuration setting is enabled, the name will be converted to the more common Win32 format. Applications that intend to use the registry key's name during later events should store it in KeyContext during this event. Please refer to the Contexts topic for more information.
The DesiredAccess parameter reflects the access rights specified by the requestor. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The KeyHandle parameter specifies a handle to a registry key that should be opened instead of the one this event fired for. Applications can set this parameter to redirect access to the registry key associated with the specified handle.
The KeyHandleContext parameter is a placeholder for application-defined data associated with the application-provided registry key handle. Please refer to the Contexts topic for more information.
The GrantedAccess parameter specifies the granted access rights for an application-provided registry key handle. Applications that set KeyHandle must also set this parameter. Please refer to Microsoft's Registry Key Security and Access Rights article for more information about possible values.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeQueryKey Event (CBRegistry Component)
This event fires before a registry key's information is retrieved.
Syntax
// CBRegistryBeforeQueryKeyEventArgs carries the CBRegistry BeforeQueryKey event's parameters. type CBRegistryBeforeQueryKeyEventArgs struct {...} func (args *CBRegistryBeforeQueryKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeQueryKeyEventArgs) RequestedFields() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) LastWriteTime() time.Time func (args *CBRegistryBeforeQueryKeyEventArgs) SetLastWriteTime(value time.Time) func (args *CBRegistryBeforeQueryKeyEventArgs) Name() string func (args *CBRegistryBeforeQueryKeyEventArgs) SetName(value string) func (args *CBRegistryBeforeQueryKeyEventArgs) ClassName() string func (args *CBRegistryBeforeQueryKeyEventArgs) SetClassName(value string) func (args *CBRegistryBeforeQueryKeyEventArgs) SubKeys() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetSubKeys(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) MaxNameLength() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetMaxNameLength(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) MaxClassNameLength() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetMaxClassNameLength(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) Values() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetValues(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) MaxValueNameLength() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetMaxValueNameLength(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) MaxValueDataSize() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetMaxValueDataSize(value int32) func (args *CBRegistryBeforeQueryKeyEventArgs) VirtualizationCandidate() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetVirtualizationCandidate(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) VirtualizationEnabled() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetVirtualizationEnabled(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) VirtualTarget() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetVirtualTarget(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) VirtualStore() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetVirtualStore(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) VirtualSource() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetVirtualSource(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) Processed() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeQueryKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeQueryKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeQueryKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeQueryKeyEvent defines the signature of the CBRegistry BeforeQueryKey event's handler function. type CBRegistryBeforeQueryKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeQueryKeyEventArgs) func (obj *CBRegistry) GetOnBeforeQueryKeyHandler() CBRegistryBeforeQueryKeyEvent func (obj *CBRegistry) SetOnBeforeQueryKeyHandler(handlerFunc CBRegistryBeforeQueryKeyEvent)
Remarks
This event fires before a registry key's information is retrieved.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_QUERY_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The RequestedFields parameter indicates which pieces of information about the key were requested. The value of this parameter is a combination of one or more of the following:
REG_KEYFIELD_LASTWRITETIME | 1 | A registry key's last write time. |
REG_KEYFIELD_NAME | 2 | A registry key's name. |
REG_KEYFIELD_MAXNAMELENGTH | 4 | A registry key's longest subkey name. |
REG_KEYFIELD_CLASSNAME | 8 | A registry key's class name. |
REG_KEYFIELD_MAXCLASSNAMELENGTH | 16 | A registry key's longest subkey class name. |
REG_KEYFIELD_SUBKEYS | 32 | The number of subkeys a registry key has. |
REG_KEYFIELD_VALUES | 64 | The number of values a registry key has. |
REG_KEYFIELD_MAXVALUENAMELENGTH | 128 | A registry key's longest value name. |
REG_KEYFIELD_MAXVALUEDATASIZE | 256 | A registry key's largest value data size. |
REG_KEYFIELD_VIRTUALIZATIONINFO | 512 | A registry key's virtualization information. |
The LastWriteTime parameter specifies when the key was last changed, specified in UTC.
The Name parameter specifies the key's name. The maximum length of a registry key name is 255 characters.
The ClassName parameter specifies the key's class name. The maximum length of a registry key class name is 255 characters.
The SubKeys parameter specifies the number of subkeys that the key has.
The MaxNameLength parameter specifies the length, in bytes, of the key's longest subkey name.
The MaxClassNameLength parameter specifies the length, in bytes, of the key's longest subkey class name.
The Values parameter specifies the number of values the key has.
The MaxValueNameLength parameter specifies the length, in bytes, of the key's longest value name.
The MaxValueDataSize parameter specifies the length, in bytes, of the subkey's largest value data size.
The VirtualizationCandidate parameter specifies whether the key is part of the virtualization namespace scope.
The VirtualizationEnabled parameter specifies whether virtualization is enabled on the key. This parameter can only be true if VirtualizationCandidate is true.
The VirtualTarget parameter specifies whether the key is a virtual key. This parameter can only be true if both VirtualizationCandidate and VirtualizationEnabled are both false. Its value is only valid on virtual store key handles.
The VirtualStore parameter specifies whether the key is part of the virtual store path.
The VirtualSource parameter specifies whether the key has ever been virtualized. This parameter can only be true if VirtualizationCandidate is true.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeQueryValue Event (CBRegistry Component)
This event fires before a registry value's information is retrieved.
Syntax
// CBRegistryBeforeQueryValueEventArgs carries the CBRegistry BeforeQueryValue event's parameters. type CBRegistryBeforeQueryValueEventArgs struct {...} func (args *CBRegistryBeforeQueryValueEventArgs) KeyContext() int64 func (args *CBRegistryBeforeQueryValueEventArgs) ValueName() string func (args *CBRegistryBeforeQueryValueEventArgs) RequestedFields() int32 func (args *CBRegistryBeforeQueryValueEventArgs) ValueType() int32 func (args *CBRegistryBeforeQueryValueEventArgs) SetValueType(value int32) func (args *CBRegistryBeforeQueryValueEventArgs) IntegerValue() int64 func (args *CBRegistryBeforeQueryValueEventArgs) SetIntegerValue(value int64) func (args *CBRegistryBeforeQueryValueEventArgs) StringValue() string func (args *CBRegistryBeforeQueryValueEventArgs) SetStringValue(value string) func (args *CBRegistryBeforeQueryValueEventArgs) BinaryValue() []byte func (args *CBRegistryBeforeQueryValueEventArgs) SetBinaryValue(value []byte) func (args *CBRegistryBeforeQueryValueEventArgs) MaxBinaryValueSize() int32 func (args *CBRegistryBeforeQueryValueEventArgs) BinaryValueSize() int32 func (args *CBRegistryBeforeQueryValueEventArgs) SetBinaryValueSize(value int32) func (args *CBRegistryBeforeQueryValueEventArgs) Processed() bool func (args *CBRegistryBeforeQueryValueEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeQueryValueEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeQueryValueEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeQueryValueEventArgs) StopFiltering() bool func (args *CBRegistryBeforeQueryValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeQueryValueEventArgs) ResultCode() int32 func (args *CBRegistryBeforeQueryValueEventArgs) SetResultCode(value int32) // CBRegistryBeforeQueryValueEvent defines the signature of the CBRegistry BeforeQueryValue event's handler function. type CBRegistryBeforeQueryValueEvent func(sender *CBRegistry, args *CBRegistryBeforeQueryValueEventArgs) func (obj *CBRegistry) GetOnBeforeQueryValueHandler() CBRegistryBeforeQueryValueEvent func (obj *CBRegistry) SetOnBeforeQueryValueHandler(handlerFunc CBRegistryBeforeQueryValueEvent)
Remarks
This event fires before a registry value's information is retrieved.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_QUERY_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The ValueName parameter reflects the name of the registry value.
The RequestedFields parameter indicates which pieces of information about the registry value were requested. The value of this parameter is a combination of one or more of the following:
REG_VALUEFIELD_TYPE | 1 | A registry value's type. |
REG_VALUEFIELD_NAME | 2 | A registry value's name. |
REG_VALUEFIELD_DATA | 4 | A registry value's data. |
The ValueType parameter specifies the registry value's type and determines which of the other parameters holds the registry value's data (please refer to their descriptions for more information). Possible values are as follows:
REG_VALUETYPE_SZ | 1 | A unicode string. |
REG_VALUETYPE_EXPAND_SZ | 2 | A unicode string that contains environmental variable references. |
REG_VALUETYPE_BINARY | 3 | Binary data. |
REG_VALUETYPE_DWORD | 4 | A 32-bit number. |
REG_VALUETYPE_MULTI_SZ | 7 | Multiple unicode strings. |
REG_VALUETYPE_QWORD | 11 | A 64-bit number. |
The IntegerValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_DWORD or REG_VALUETYPE_QWORD.
The StringValue parameter specifies the registry value's data if ValueType is REG_VALUETYPE_SZ, REG_VALUETYPE_EXPAND_SZ, or REG_VALUETYPE_MULTI_SZ.
For REG_VALUETYPE_MULTI_SZ, data are formatted as multiple individual ETB-terminated strings concatenated together into a single null-terminated string (where ETB is the End-of-Transmission-Block character; 23/0x17). For example, the strings This is, a multistring, and value. would be encoded as This is[ETB]a multistring[ETB]value.[ETB][NUL].
Note: As Microsoft's Registry Value Types article describes, the native multistring data format uses null terminators for the individual strings (e.g., This is[NUL]a multistring[NUL]value.[NUL][NUL]); CBRegistry converts the individual null terminators to/from ETB characters internally for applications' convenience.
The BinaryValue parameter points to a memory buffer that holds the registry value's data if ValueType is REG_VALUETYPE_BINARY. The MaxBinaryValueSize and BinaryValueSize parameter specify the capacity of the BinaryValue buffer and the length of the data it contains, respectively, in bytes.
Always check MaxBinaryValueSize before copying any data into the BinaryValue buffer. If the buffer is large enough to hold all of the data, copy the data into it, and then update BinaryValueSize accordingly. If the buffer is not large enough, do not copy any data into it; instead, set BinaryValueSize to the required buffer size (i.e., the size of the data) and return the ERROR_MORE_DATA (234) error code via ResultCode.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeRenameKey Event (CBRegistry Component)
This event fires before a registry key is renamed.
Syntax
// CBRegistryBeforeRenameKeyEventArgs carries the CBRegistry BeforeRenameKey event's parameters. type CBRegistryBeforeRenameKeyEventArgs struct {...} func (args *CBRegistryBeforeRenameKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeRenameKeyEventArgs) NewName() string func (args *CBRegistryBeforeRenameKeyEventArgs) Processed() bool func (args *CBRegistryBeforeRenameKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeRenameKeyEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeRenameKeyEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeRenameKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeRenameKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeRenameKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeRenameKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeRenameKeyEvent defines the signature of the CBRegistry BeforeRenameKey event's handler function. type CBRegistryBeforeRenameKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeRenameKeyEventArgs) func (obj *CBRegistry) GetOnBeforeRenameKeyHandler() CBRegistryBeforeRenameKeyEvent func (obj *CBRegistry) SetOnBeforeRenameKeyHandler(handlerFunc CBRegistryBeforeRenameKeyEvent)
Remarks
This event fires before a registry key is renamed.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_RENAME_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The NewName parameter reflects the new name of the registry key. Applications that intend to use the new name during later events should store it in KeyContext during this event; please refer to the Contexts topic for more information.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeSetKey Event (CBRegistry Component)
This event fires before a registry key's information is updated.
Syntax
// CBRegistryBeforeSetKeyEventArgs carries the CBRegistry BeforeSetKey event's parameters. type CBRegistryBeforeSetKeyEventArgs struct {...} func (args *CBRegistryBeforeSetKeyEventArgs) KeyContext() int64 func (args *CBRegistryBeforeSetKeyEventArgs) LastWriteTime() time.Time func (args *CBRegistryBeforeSetKeyEventArgs) Processed() bool func (args *CBRegistryBeforeSetKeyEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeSetKeyEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeSetKeyEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeSetKeyEventArgs) StopFiltering() bool func (args *CBRegistryBeforeSetKeyEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeSetKeyEventArgs) ResultCode() int32 func (args *CBRegistryBeforeSetKeyEventArgs) SetResultCode(value int32) // CBRegistryBeforeSetKeyEvent defines the signature of the CBRegistry BeforeSetKey event's handler function. type CBRegistryBeforeSetKeyEvent func(sender *CBRegistry, args *CBRegistryBeforeSetKeyEventArgs) func (obj *CBRegistry) GetOnBeforeSetKeyHandler() CBRegistryBeforeSetKeyEvent func (obj *CBRegistry) SetOnBeforeSetKeyHandler(handlerFunc CBRegistryBeforeSetKeyEvent)
Remarks
This event fires before a registry key's information is updated.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_SET_KEY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The LastWriteTime parameter reflects when the key was last changed, specified in UTC.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeSetKeySecurity Event (CBRegistry Component)
This event fires before a registry key's security attributes are changed.
Syntax
// CBRegistryBeforeSetKeySecurityEventArgs carries the CBRegistry BeforeSetKeySecurity event's parameters. type CBRegistryBeforeSetKeySecurityEventArgs struct {...} func (args *CBRegistryBeforeSetKeySecurityEventArgs) KeyContext() int64 func (args *CBRegistryBeforeSetKeySecurityEventArgs) SecurityInformation() int32 func (args *CBRegistryBeforeSetKeySecurityEventArgs) SecurityDescriptor() []byte func (args *CBRegistryBeforeSetKeySecurityEventArgs) SetSecurityDescriptor(value []byte) func (args *CBRegistryBeforeSetKeySecurityEventArgs) Length() int32 func (args *CBRegistryBeforeSetKeySecurityEventArgs) Processed() bool func (args *CBRegistryBeforeSetKeySecurityEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeSetKeySecurityEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeSetKeySecurityEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeSetKeySecurityEventArgs) StopFiltering() bool func (args *CBRegistryBeforeSetKeySecurityEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeSetKeySecurityEventArgs) ResultCode() int32 func (args *CBRegistryBeforeSetKeySecurityEventArgs) SetResultCode(value int32) // CBRegistryBeforeSetKeySecurityEvent defines the signature of the CBRegistry BeforeSetKeySecurity event's handler function. type CBRegistryBeforeSetKeySecurityEvent func(sender *CBRegistry, args *CBRegistryBeforeSetKeySecurityEventArgs) func (obj *CBRegistry) GetOnBeforeSetKeySecurityHandler() CBRegistryBeforeSetKeySecurityEvent func (obj *CBRegistry) SetOnBeforeSetKeySecurityHandler(handlerFunc CBRegistryBeforeSetKeySecurityEvent)
Remarks
This event fires before security attributes are changed for the registry key specified by KeyContext.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_SET_KEY_SECURITY flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The SecurityInformation parameter reflects which pieces of security information, of those present in SecurityDescriptor, will be set. Please refer to Microsoft's SECURITY_INFORMATION data type documentation for more information about possible values.
The SecurityDescriptor parameter points to a memory buffer that specifies the new security information. The buffer referenced by the SecurityDescriptor parameter may be modified when needed if the request is to be passed further to other filters and the filesystem driver. The Length parameter reflects the length of the data, in bytes. Please see the Buffer Parameters topic for more information on how to work with memory buffer event parameters.
The data are formatted as a SECURITY_DESCRIPTOR structure in self-relative format; please refer to the Microsoft's documentation for more information.
Please see the Buffer Parameters topic for more information on how to work with memory buffer event parameters.
The returned data will be formatted as a SECURITY_DESCRIPTOR structure in self-relative format; please refer to the Microsoft's documentation for more information.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
BeforeSetValue Event (CBRegistry Component)
This event fires before a registry value is set or updated.
Syntax
// CBRegistryBeforeSetValueEventArgs carries the CBRegistry BeforeSetValue event's parameters. type CBRegistryBeforeSetValueEventArgs struct {...} func (args *CBRegistryBeforeSetValueEventArgs) KeyContext() int64 func (args *CBRegistryBeforeSetValueEventArgs) ValueName() string func (args *CBRegistryBeforeSetValueEventArgs) ValueType() int32 func (args *CBRegistryBeforeSetValueEventArgs) IntegerValue() int64 func (args *CBRegistryBeforeSetValueEventArgs) StringValue() string func (args *CBRegistryBeforeSetValueEventArgs) BinaryValue() []byte func (args *CBRegistryBeforeSetValueEventArgs) SetBinaryValue(value []byte) func (args *CBRegistryBeforeSetValueEventArgs) BinaryValueSize() int32 func (args *CBRegistryBeforeSetValueEventArgs) Processed() bool func (args *CBRegistryBeforeSetValueEventArgs) SetProcessed(value bool) func (args *CBRegistryBeforeSetValueEventArgs) FireAfterEvent() bool func (args *CBRegistryBeforeSetValueEventArgs) SetFireAfterEvent(value bool) func (args *CBRegistryBeforeSetValueEventArgs) StopFiltering() bool func (args *CBRegistryBeforeSetValueEventArgs) SetStopFiltering(value bool) func (args *CBRegistryBeforeSetValueEventArgs) ResultCode() int32 func (args *CBRegistryBeforeSetValueEventArgs) SetResultCode(value int32) // CBRegistryBeforeSetValueEvent defines the signature of the CBRegistry BeforeSetValue event's handler function. type CBRegistryBeforeSetValueEvent func(sender *CBRegistry, args *CBRegistryBeforeSetValueEventArgs) func (obj *CBRegistry) GetOnBeforeSetValueHandler() CBRegistryBeforeSetValueEvent func (obj *CBRegistry) SetOnBeforeSetValueHandler(handlerFunc CBRegistryBeforeSetValueEvent)
Remarks
This event fires before a registry value is set or updated.
Applications need to handle this event only if they have added a standard filter rule that includes the REG_CE_BEFORE_SET_VALUE flag.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
Note: This event does not expose the registry key's name for performance reasons; applications that need it should store it in KeyContext during the BeforeCreateKey/BeforeOpenKey event so that it can be retrieved when this event fires.
The ValueName parameter reflects the name of the registry value. Applications that intend to use the registry value's name during later events should store it in KeyContext during this event. Please refer to the Contexts topic for more information.
The ValueType parameter reflects the registry value's type and determines which of the other parameters holds the registry value's data; please refer to their descriptions for more information. Possible values are as follows:
REG_VALUETYPE_SZ | 1 | A unicode string. |
REG_VALUETYPE_EXPAND_SZ | 2 | A unicode string that contains environmental variable references. |
REG_VALUETYPE_BINARY | 3 | Binary data. |
REG_VALUETYPE_DWORD | 4 | A 32-bit number. |
REG_VALUETYPE_MULTI_SZ | 7 | Multiple unicode strings. |
REG_VALUETYPE_QWORD | 11 | A 64-bit number. |
The IntegerValue parameter reflects the registry value's data if ValueType is REG_VALUETYPE_DWORD or REG_VALUETYPE_QWORD.
The StringValue parameter reflects the registry value's data if ValueType is REG_VALUETYPE_SZ, REG_VALUETYPE_EXPAND_SZ, or REG_VALUETYPE_MULTI_SZ.
For REG_VALUETYPE_MULTI_SZ, data are formatted as multiple individual ETB-terminated strings concatenated together into a single null-terminated string (where ETB is the End-of-Transmission-Block character; 23/0x17). For example, the strings This is, a multistring, and value. would be encoded as This is[ETB]a multistring[ETB]value.[ETB][NUL].
Note: As Microsoft's Registry Value Types article describes, the native multistring data format uses null terminators for the individual strings (e.g., This is[NUL]a multistring[NUL]value.[NUL][NUL]); CBRegistry converts the individual null terminators to/from ETB characters internally for applications' convenience.
The BinaryValue parameter points to a memory buffer that holds the registry value's data if ValueType is REG_VALUETYPE_BINARY. The BinaryValueSize parameter reflects the length of the data, in bytes.
The Processed parameter indicates whether the underlying request has been handled successfully. Applications should set this parameter to true if they have handled the request themselves (this will prevent the corresponding After* event from being called).
Note: This parameter's value is ignored if an error is returned via ResultCode.
The FireAfterEvent parameter specifies whether the corresponding After* event should be fired; it is true by default.
Note: Regardless of how this parameter is set, the corresponding After* event will not fire if Processed is true, or if an error code is returned via ResultCode.
The StopFiltering parameter specifies whether the struct's system driver should ignore all further operations for the registry key; it is false by default. Applications may set this parameter to true to prevent any further events from firing for the registry key.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
CleanupKeyContext Event (CBRegistry Component)
This event fires when the application-defined data stored in a registry key context need to be cleaned up.
Syntax
// CBRegistryCleanupKeyContextEventArgs carries the CBRegistry CleanupKeyContext event's parameters. type CBRegistryCleanupKeyContextEventArgs struct {...} func (args *CBRegistryCleanupKeyContextEventArgs) KeyContext() int64 func (args *CBRegistryCleanupKeyContextEventArgs) ResultCode() int32 func (args *CBRegistryCleanupKeyContextEventArgs) SetResultCode(value int32) // CBRegistryCleanupKeyContextEvent defines the signature of the CBRegistry CleanupKeyContext event's handler function. type CBRegistryCleanupKeyContextEvent func(sender *CBRegistry, args *CBRegistryCleanupKeyContextEventArgs) func (obj *CBRegistry) GetOnCleanupKeyContextHandler() CBRegistryCleanupKeyContextEvent func (obj *CBRegistry) SetOnCleanupKeyContextHandler(handlerFunc CBRegistryCleanupKeyContextEvent)
Remarks
This event fires when the specified KeyContext is about to be discarded, giving applications a chance to clean up any information stored in it. Please refer to the Contexts topic for more information.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
CloseKeyHandle Event (CBRegistry Component)
This event fires when an application-provided registry key handle should be closed.
Syntax
// CBRegistryCloseKeyHandleEventArgs carries the CBRegistry CloseKeyHandle event's parameters. type CBRegistryCloseKeyHandleEventArgs struct {...} func (args *CBRegistryCloseKeyHandleEventArgs) KeyContext() int64 func (args *CBRegistryCloseKeyHandleEventArgs) KeyHandle() int64 func (args *CBRegistryCloseKeyHandleEventArgs) KeyHandleContext() int64 func (args *CBRegistryCloseKeyHandleEventArgs) Error() int32 func (args *CBRegistryCloseKeyHandleEventArgs) Processed() bool func (args *CBRegistryCloseKeyHandleEventArgs) SetProcessed(value bool) func (args *CBRegistryCloseKeyHandleEventArgs) ResultCode() int32 func (args *CBRegistryCloseKeyHandleEventArgs) SetResultCode(value int32) // CBRegistryCloseKeyHandleEvent defines the signature of the CBRegistry CloseKeyHandle event's handler function. type CBRegistryCloseKeyHandleEvent func(sender *CBRegistry, args *CBRegistryCloseKeyHandleEventArgs) func (obj *CBRegistry) GetOnCloseKeyHandleHandler() CBRegistryCloseKeyHandleEvent func (obj *CBRegistry) SetOnCloseKeyHandleHandler(handlerFunc CBRegistryCloseKeyHandleEvent)
Remarks
This event fires when the application-provided registry key handle, specified by KeyHandle, should be closed and the associated KeyHandleContext should be cleaned up.
The KeyContext parameter is a placeholder for application-defined data associated with the registry key. Please refer to the Contexts topic for more information.
The Error parameter reflects the error code of any error that occurred while using the application-provided key handle.
The Processed parameter indicates whether the application has processed the event and closed the key handle; it is false by default. If the application does not set this parameter to true, then the struct will close the KeyHandle with the Windows API's RegCloseKey function when the event handler returns (unless an error code is returned via ResultCode).
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
Error Event (CBRegistry Component)
This event fires if an unhandled error occurs during an event.
Syntax
// CBRegistryErrorEventArgs carries the CBRegistry Error event's parameters. type CBRegistryErrorEventArgs struct {...} func (args *CBRegistryErrorEventArgs) ErrorCode() int32 func (args *CBRegistryErrorEventArgs) Description() string // CBRegistryErrorEvent defines the signature of the CBRegistry Error event's handler function. type CBRegistryErrorEvent func(sender *CBRegistry, args *CBRegistryErrorEventArgs) func (obj *CBRegistry) GetOnErrorHandler() CBRegistryErrorEvent func (obj *CBRegistry) SetOnErrorHandler(handlerFunc CBRegistryErrorEvent)
Remarks
This event fires if an unhandled error occurs during another event. Developers can use this information to track down unhandled errors in an application's event handlers.
Note: Not everything is possible or allowed in the event handlers. For details, see the Recursive Calls topic.
WorkerThreadCreation Event (CBRegistry Component)
Fires just after a new worker thread is created.
Syntax
// CBRegistryWorkerThreadCreationEventArgs carries the CBRegistry WorkerThreadCreation event's parameters. type CBRegistryWorkerThreadCreationEventArgs struct {...} func (args *CBRegistryWorkerThreadCreationEventArgs) ResultCode() int32 func (args *CBRegistryWorkerThreadCreationEventArgs) SetResultCode(value int32) // CBRegistryWorkerThreadCreationEvent defines the signature of the CBRegistry WorkerThreadCreation event's handler function. type CBRegistryWorkerThreadCreationEvent func(sender *CBRegistry, args *CBRegistryWorkerThreadCreationEventArgs) func (obj *CBRegistry) GetOnWorkerThreadCreationHandler() CBRegistryWorkerThreadCreationEvent func (obj *CBRegistry) SetOnWorkerThreadCreationHandler(handlerFunc CBRegistryWorkerThreadCreationEvent)
Remarks
This event fires just after a worker thread is created, in the context of that worker thread.
This event is optional; it is provided to give applications a chance to perform additional processing when a new worker thread is created, such as allocating per-thread objects.
The struct maintains a pool of worker threads and uses them to fire events; please refer to the Threading and Concurrency topic for more information.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource is not available or security checks failed), set it to a nonzero value to report an appropriate error. Please see the Error Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.
WorkerThreadTermination Event (CBRegistry Component)
Fires just before a worker thread is terminated.
Syntax
// CBRegistryWorkerThreadTerminationEventArgs carries the CBRegistry WorkerThreadTermination event's parameters. type CBRegistryWorkerThreadTerminationEventArgs struct {...} // CBRegistryWorkerThreadTerminationEvent defines the signature of the CBRegistry WorkerThreadTermination event's handler function. type CBRegistryWorkerThreadTerminationEvent func(sender *CBRegistry, args *CBRegistryWorkerThreadTerminationEventArgs) func (obj *CBRegistry) GetOnWorkerThreadTerminationHandler() CBRegistryWorkerThreadTerminationEvent func (obj *CBRegistry) SetOnWorkerThreadTerminationHandler(handlerFunc CBRegistryWorkerThreadTerminationEvent)
Remarks
This event fires just before a worker thread is terminated, in the context of that worker thread.
This event is optional; it is provided to give applications a chance to perform additional processing before a worker thread is terminated, such as deallocating per-thread objects.
The struct maintains a pool of worker threads and uses them to fire events; please refer to the Threading and Concurrency topic for more information.
Any errors that occur during this event are ignored.
This event is fired synchronously; please refer to the Event Types topic for more information.
Config Settings (CBRegistry Component)
The struct accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the struct, access to these internal properties is provided through the Config method.CBRegistry Config Settings
Normally, this setting should remain disabled (especially in production) to reduce the possibility of system deadlocks occurring. Certain situations, however, do require it to be enabled, such as for testing purposes (so that event handlers can be tested with single-process tests).
By default, the setting is enabled and rules may be added and deleted only by administrators. If, however, an application uses default rules not for security-related purposes, and the risk of a limited user trying to add or remove the rules is low, such application may disable the setting.
Administrative rights are required to change this configuration setting after Initialize is called. If the user account of the process that calls Config does not have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error.
Administrative rights are required to change this configuration setting after Initialize is called. If the user account of the process that calls Config does not have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error.
Administrative rights are required to change this configuration setting after Initialize is called. If the user account of the process that calls Config does not have such rights, the call will fail with an ERROR_PRIVILEGE_NOT_HELD (0x0522) error.
This setting's value is stored in the registry and is persistent; it requires administrative rights to be changed.
By default, this setting is set to 0, and the driver automatically chooses an optimal number of threads using this equation: 4 * number_of_processors.
By default, this setting is set to 0, and the driver automatically chooses an optimal number of threads using this equation: max(number_of_processors, 4). If this setting's value exceeds the MaxWorkerThreadCount value, the latter is used instead.
Note: Such translation is not always possible.
This setting is disabled by default.
Note: This setting cannot be changed when Active is true, and it cannot be changed within events.
By default, this setting is set to 0, and the driver uses a default stack size (currently, 1 MB).
Note: This setting cannot be changed when Active is true, and it cannot be changed within events.
Base Config Settings
- Product: The product the license is for.
- Product Key: The key the license was generated from.
- License Source: Where the license was found (e.g., RuntimeLicense, License File).
- License Type: The type of license installed (e.g., Royalty Free, Single Server).
Trappable Errors (CBRegistry Component)
The struct uses Windows error codes during operation as necessary. Please refer to the Error Handling topic for more information.Special Use Errors
21 | ERROR_NOT_READY: Reported by the methods of the struct if Initialize has not been called or did not succeed. |
191 | ERROR_INVALID_EXE_SIGNATURE: Reported by the Install method when the CAB file signature cannot be validated. |
575 | ERROR_APP_INIT_FAILURE: Reported by the methods of the struct if Initialize has not been called or did not succeed. Differs from ERROR_NOT_READY (21) in that it indicates a specific situation in the internal code. |
588 | ERROR_FS_DRIVER_REQUIRED: Reported if the required system module was not correctly installed for the given ProductGUID. |
614 | ERROR_NO_CALLBACK_ACTIVE: Reported by any method that can only be called within event handlers if it is called outside an event handler. |
1292 | ERROR_IMPLEMENTATION_LIMIT: Reported when the timeout value provided is less than 3 seconds. |
1314 | ERROR_PRIVILEGE_NOT_HELD: Reported by any method that requires elevated permissions if it is called without such permissions. |