AssociateContextWithName function (filehc.h)

Inserts a name into the name cache to find a specified FIO_CONTEXT structure.

Syntax

FILEHC_EXPORT BOOL AssociateContextWithName(
  [in] PNAME_CACHE_CONTEXT  pNameCache,
  [in] LPBYTE               lpbName,
  [in] DWORD                cbName,
  [in] LPBYTE               lpbData,
  [in] DWORD                cbData,
  [in] PGENERIC_MAPPING     pGenericMapping,
  [in] PSECURITY_DESCRIPTOR pSecurityDescriptor,
  [in] FIO_CONTEXT          *pContext,
  [in] BOOL                 fKeepReference
);

Parameters

[in] pNameCache

A pointer to the name of the cache to be used.

[in] lpbName

User-specified bytes for the name of the cache item.

[in] cbName

The length of the name that is assigned to the cache item.

[in] lpbData

User-specified bytes for any arbitrary data to associate with the name of the cache item.

[in] cbData

The length, in bytes, of arbitrary data to associate with the name.

[in] pGenericMapping

A pointer to a GENERIC_MAPPING structure to associate with the name.

[in] pSecurityDescriptor

The self-relative security descriptor to be associated with the name. This descriptor is provided by the user.

[in] pContext

A pointer to an FIO_CONTEXT structure.

[in] fKeepReference

Specifies whether the reference on the FIO_CONTEXT structure should be kept. If set to TRUE, the reference is kept.

Return value

Returns TRUE if the function succeeds; otherwise, it returns FALSE.

Remarks

If the name is already present in the cache, this call fails and GetLastError returns ERROR_DUP_NAME.

Requirements

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

See also

FIO_CONTEXT

GENERIC_MAPPING