The CmCallbackGetKeyObjectID routine retrieves the unique identifier and object name that are associated with a specified registry key object.
NTKERNELAPI NTSTATUS CmCallbackGetKeyObjectID( PLARGE_INTEGER Cookie, PVOID Object, PULONG_PTR ObjectID, PCUNICODE_STRING *ObjectName );
The pointer value that the driver's RegistryCallback callback routine received in the Object member of one of the REG_XXX_KEY_INFORMATION structures.
A pointer to a location that receives a pointer to the unique identifier that represents the registry key that Object specifies. This parameter is optional and can be NULL.
A pointer to a location that receives a pointer to a UNICODE_STRING structure. This structure contains the object name of the registry key object that Object specifies. The object name is actually the full path name of the registry key that the object represents. The caller must not write to this UNICODE_STRING structure or free it. This parameter is optional and can be NULL.
CmCallbackGetKeyObjectID returns STATUS_SUCCESS if the operation succeeds. Possible error return values include the following status code.
||The Cookie or Object parameter is invalid.|
The CmCallbackGetKeyObjectID routine is available starting with Windows Vista. An improved version of this routine, CmCallbackGetKeyObjectIDEx, is available starting with Windows 8. Drivers that run only in Windows 8 and later versions of Windows should call CmCallbackGetKeyObjectIDEx instead of CmCallbackGetKeyObjectID.
Drivers can use CmCallbackGetKeyObjectID to obtain the registry key identifier, the object name, or both, by supplying non-NULL values for the ObjectID or ObjectName parameters.
After the driver has obtained the identifier or name, the identifier or name is valid until the driver's RegistryCallback routine receives pre-notification of handle closure.
The driver must not modify the object name.
If two registry key objects represent the same registry key, the key identifiers for both objects are identical.
For more information about CmCallbackGetKeyObjectID and registry filtering operations, see Filtering Registry Calls.
|Windows version||Available starting with Windows Vista.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|