CryptGetDefaultOIDFunctionAddress function

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 WINAPI CryptGetDefaultOIDFunctionAddress(
  _In_     HCRYPTOIDFUNCSET  hFuncSet,
  _In_     DWORD             dwEncodingType,
  _In_opt_ LPCWSTR           pwszDll,
  _In_     DWORD             dwFlags,
  _Out_    void              **ppvFuncAddr,
  _Inout_  HCRYPTOIDFUNCADDR *phFuncAddr


hFuncSet [in]

Function set handle previously obtained from a call to CryptInitOIDFunctionSet.

dwEncodingType [in]

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:


pwszDll [in, optional]

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.

dwFlags [in]

Reserved for future use and must be zero.

ppvFuncAddr [out]

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

phFuncAddr [in, out]

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]







See also

OID Support Functions