WintrustGetDefaultForUsage function (wintrust.h)

The WintrustGetDefaultForUsage function retrieves the default usage identifier and callback information.

Syntax

BOOL WintrustGetDefaultForUsage(
  [in]      DWORD                   dwAction,
  [in]      const char              *pszUsageOID,
  [in, out] CRYPT_PROVIDER_DEFUSAGE *psUsage
);

Parameters

[in] dwAction

Action to perform. This can be one of the following values. For more information, see Remarks.

Value Meaning
DWACTION_ALLOCANDFILL
Allocate memory and fill the CRYPT_PROVIDER_DEFUSAGE structure pointed to by the psUsage parameter.
DWACTION_FREE
Free all memory allocated during a previous call to this function by specifying DWACTION_ALLOCANDFILL for this parameter.

[in] pszUsageOID

Pointer to a string that contains the identifier.

[in, out] psUsage

Pointer to a CRYPT_PROVIDER_DEFUSAGE structure that contains callback information to be retrieved.

Return value

The return value is TRUE if the function succeeds; FALSE if the function fails. If the function fails, call the GetLastError function to determine the reason for failure.

Remarks

Call this function once with the dwAction parameter set to DWACTION_ALLOCANDFILL to allocate memory and fill a CRYPT_PROVIDER_DEFUSAGE structure with information. Call this function again with the dwAction parameter set to DWACTION_FREE to free the allocated memory.

The default usage and callback information for a provider is registered by calling the WintrustAddDefaultForUsage function.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wintrust.h
Library Wintrust.lib
DLL Wintrust.dll

See also

CRYPT_PROVIDER_DEFUSAGE

CRYPT_PROVIDER_REGDEFUSAGE

WintrustAddDefaultForUsage