CryptInstallOIDFunctionAddress

The CryptInstallOIDFunctionAddress function installs a set of callable OID function addresses.

#include <wincrypt.h>
BOOL WINAPI CryptInstallOIDFunctionAddress(
  HDMODULE hModule,                    // in
  DWORD dwEncodingType,                // in
  LPCSTR pszFuncName,                  // in
  DWORD cFuncEntry,                    // in
  CRYPT_OID_FUNC_ENTRY rgFuncEntry[],  // in, constant
  DWORD dwFlags                        // in
);
 

Parameters

hModule
This parameter should be updated with the hModule passed to DllMain to prevent the Dll containing the function addresses from being unloaded by CryptGetOIDFunctionAddress/CryptFreeOIDFunctionAddress. This would be the case when the Dll has also registered OID functions via CryptRegisterOIDFunction.
dwEncodingType
The type of encoding specified. Note that either a certificate or message encoding type is required. If the low-order word containing the certificate encoding type is nonzero, then it is used. Otherwise, the high-order word containing the message encoding type is used. If both are specified, the certificate encoding type in the low-order word is used.

Currently defined encoding types are shown in the following table:
Encoding type Value
None 0x00000000
CRYPT_ASN_ENCODING 0x00000001
X509_ASN_ENCODING 0x00000001
PKCS_7_ASN_ENCODING 0x00010000

pszFuncName
The name of the function being installed.
cFuncEntry
A count of the number of array elements in rgFuncEntry[].
rgFuncEntry[]
Specifies an array of CRYPT_OID_FUNC_ENTRY. These entries contain an OID and the starting address of the routine that it correlates to.

DEFAULT functions are installed by setting rgFuncEntry[].pszOID equal to CRYPT_DEFAULT_OID.

dwFlags
The flag values. By default, the functions are installed at the end of the list. To install the functions at the beginning of the list, set the CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG.

Return Values

TRUE if the function succeeded. FALSE if the function failed.

Call GetLastError to see the reason for any failures.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Requires Windows 98 (or Windows 95 with IE 3.02 or later).
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CRYPT_OID_FUNC_ENTRY