FindOrCreateNameCache function (filehc.h)

Finds or creates a name cache.

Syntax

FILEHC_EXPORT PNAME_CACHE_CONTEXT FindOrCreateNameCache(
  [in] LPSTR                  lpstrName,
  [in] CACHE_KEY_COMPARE      pfnKeyCompare,
  [in] CACHE_KEY_HASH         pfnKeyHash,
  [in] CACHE_DESTROY_CALLBACK pfnKeyDestroy,
  [in] CACHE_DESTROY_CALLBACK pfnDataDestroy
);

Parameters

[in] lpstrName

The name of the name cache to be created. This parameter is case sensitive and must not be set to NULL.

[in] pfnKeyCompare

A pointer to a function that is provided by a client to compare keys. This parameter cannot be NULL.

[in] pfnKeyHash

A pointer to a function that is provided by clients to compute a hash value on keys.

Note  The cache provides a hash function only if the user does not. However, the internally provided hash function is best only for items that appear to be regular strings.
 

[in] pfnKeyDestroy

A pointer to the CACHE_DESTROY_CALLBACK function. This parameter can be NULL.

[in] pfnDataDestroy

A pointer to the CACHE_DESTROY_CALLBACK function. This parameter can be NULL.

Return value

Returns a NAME_CACHE_CONTEXT structure that represents the name cache.

Remarks

Name caches are reference counted. If this function is called twice with the same name, a reference is added to an existing name cache.

The NAME_CACHE_CONTEXT structure does not contain any fields that are useful to a client, but it must be passed back into all of the name cache functions.

Requirements

Requirement Value
Target Platform Windows
Header filehc.h
Library Fcachdll.lib
DLL Fcachdll.dll

See also

CACHE_DESTROY_CALLBACK

NAME_CACHE_CONTEXT