CryptFreeOIDFunctionAddress function (wincrypt.h)

The CryptFreeOIDFunctionAddress function releases a handle returned by CryptGetOIDFunctionAddress or CryptGetDefaultOIDFunctionAddress by decrementing the reference count on the function handle. In some cases, the DLL file associated with the function is unloaded. For details, see Remarks.

Syntax

BOOL CryptFreeOIDFunctionAddress(
  [in] HCRYPTOIDFUNCADDR hFuncAddr,
  [in] DWORD             dwFlags
);

Parameters

[in] hFuncAddr

Handle of the function previously obtained from a call to CryptGetOIDFunctionAddress or CryptGetDefaultOIDFunctionAddress.

[in] dwFlags

Reserved for future use and must be zero.

Return value

If the function succeeds, the function returns nonzero (TRUE).

If the function fails, it returns zero (FALSE).

Remarks

If the reference count becomes zero and a DLL is loaded for the function being freed, the DLL might be unloaded. If the DLL exports the DLLCanUnloadNow function, that function is called and its return is checked. An S_FALSE return from this function cancels the unloading of the DLL at this time. If the function returns S_TRUE or if the DLL does not export the DLLCanUnloadNow function, an unloading process is started. In this case, actual unloading is deferred for 15 seconds. If another CryptFreeOIDFunctionAddress or CryptGetDefaultOIDFunctionAddress that requires the DLL occurs before the 15 seconds elapse, the deferred unload process is canceled.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also

CryptGetDefaultOIDFunctionAddress

CryptGetOIDFunctionAddress

DLLCanUnloadNow

OID Support Functions