The CmSetCallbackObjectContext routine associates specified context information with a specified registry object.
NTKERNELAPI NTSTATUS CmSetCallbackObjectContext( PVOID Object, PLARGE_INTEGER Cookie, PVOID NewContext, PVOID *OldContext );
A pointer to the registry key object that the driver is providing context information for. The driver obtains this pointer from the ResultObject member of one of the following structures:
A pointer to a LARGE_INTEGER value that identifies the callback routine to associate the context with. The CmRegisterCallbackEx routine provided this value when you registered the callback routine.
A pointer to driver-defined context information.
A pointer to a location that receives a pointer to context information that the driver previously associated with the specified object and cookie. This parameter is optional and can be NULL.
CmSetCallbackObjectContext returns STATUS_SUCCESS or another appropriate NTSTATUS-typed value.
The CmSetCallbackObjectContext routine is available starting with Windows Vista.
A driver's RegistryCallback routine can call CmSetCallbackObjectContext for any registry key object after the object has been created or opened (that is, during a post-notification for a create operation, an open operation, or any subsequent notification up to the pre-notification of handle closure).
If a driver calls CmSetCallbackObjectContext, the driver's RegistryCallback routine will receive a RegNtCallbackObjectContextCleanup notification after the key object's handle has been closed or after the driver calls CmUnRegisterCallback to unregister the RegistryCallback routine. When the RegistryCallback routine receives this notification, the routine should release any resources that it allocated for the object's context.
For more information about CmSetCallbackObjectContext and filtering registry operations, see Filtering Registry Calls.
|Windows version||Available starting with Windows Vista.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|