CryptGetDefaultOIDFunctionAddress function (wincrypt.h)

The CryptGetDefaultOIDFunctionAddress function loads the DLL that contains a default function address. It can also return the address of the first or next installed default object identifier (OID) function in an initialized function set and load the DLL that contains the address of that function.


BOOL CryptGetDefaultOIDFunctionAddress(
  [in]           HCRYPTOIDFUNCSET  hFuncSet,
  [in]           DWORD             dwEncodingType,
  [in, optional] LPCWSTR           pwszDll,
  [in]           DWORD             dwFlags,
  [out]          void              **ppvFuncAddr,
  [in, out]      HCRYPTOIDFUNCADDR *phFuncAddr


[in] hFuncSet

Function set handle previously obtained from a call to CryptInitOIDFunctionSet.

[in] dwEncodingType

Encoding type to be matched. Currently, only X509_ASN_ENCODING and PKCS_7_ASN_ENCODING are being used; however, additional encoding types may be added in the future. To match both current encoding types, use:


[in, optional] pwszDll

Name of the DLL to load. Normally, the DLL name is obtained from the list returned by CryptGetDefaultOIDDllList. If pwszDll is NULL, a search is performed on the list of installed default functions.

[in] dwFlags

Reserved for future use and must be zero.

[out] ppvFuncAddr

A pointer to the address of the return function. If the function fails, a NULL is returned in ppvFuncAddr.

[in, out] phFuncAddr

Used only if pwszDll is NULL. On the first call to the function, *phFuncAddr must be NULL to acquire the first installed function.

When this function is successful, *phFuncAddr is set to a function handle. The reference count for the function handle is incremented.

After the first call to the function, phFuncAddr is set to the pointer returned by the previous call. This input pointer is always freed within the function through a call to CryptFreeOIDFunctionAddress by this function. The call to free the pointer is always made even when the main function returns an error.

A non-NULLphFuncAddr must be released either through a call to CryptFreeOIDFunctionAddress or by being passed back as input to this function or as input to CryptGetOIDFunctionAddress.

If pwszDll is not NULL, the value of this parameter is ignored and a non-NULL pointer is not freed.

Return value

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

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


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

OID Support Functions