示例#1
0
BOOL reghook_cache_add( REGISTRY_HOOK *hook )
{
	pstring key;
	
	if ( !hook )
		return False;
		
	pstrcpy( key, "\\");
	pstrcat( key, hook->keyname );	
	
	pstring_sub( key, "\\", "/" );

	DEBUG(10,("reghook_cache_add: Adding key [%s]\n", key));
		
	return pathtree_add( cache_tree, key, hook );
}
示例#2
0
WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops)
{
	WERROR werr;
	char *key = NULL;

	if ((keyname == NULL) || (ops == NULL)) {
		return WERR_INVALID_PARAM;
	}

	werr = keyname_to_path(talloc_tos(), keyname, &key);
	if (!W_ERROR_IS_OK(werr)) {
		goto done;
	}

	DEBUG(10, ("reghook_cache_add: Adding ops %p for key [%s]\n",
		   (void *)ops, key));

	werr = pathtree_add(cache_tree, key, ops);

done:
	TALLOC_FREE(key);
	return werr;
}