SCardAudit function (winscard.h)

The SCardAudit function writes event messages to the Windows application log Microsoft-Windows-SmartCard-Audit/Authentication.

Syntax

LONG SCardAudit(
  [in] SCARDCONTEXT hContext,
  [in] DWORD        dwEvent
);

Parameters

[in] hContext

Handle that identifies the resource manager context. The resource manager context can be set by a previous call to the SCardEstablishContext function. This parameter cannot be NULL.

[in] dwEvent

The event to log.

Value Meaning
SCARD_AUDIT_CHV_FAILURE
0x0
A smart card holder verification (CHV) attempt failed.
SCARD_AUDIT_CHV_SUCCESS
0x1
A smart card holder verification (CHV) attempt succeeded.

Return value

This function returns different values depending on whether it succeeds or fails.

Return code Description
Success
SCARD_S_SUCCESS.
Failure
An error code. For more information, see Smart Card Return Values.

Remarks

This function is not redirected. An application calling the SCardAudit function from within a Remote Desktop session will log the event on the remote system.

Examples

// hContext was set by a previous call to SCardEstablishContext.
lReturn = SCardAudit (hContext,
                      SCARD_AUDIT_CHV_SUCCESS);

if ( SCARD_S_SUCCESS != lReturn )
{
    printf("Failed SCardAudit - %x\n", lReturn);
    // Take appropriate action
}

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header winscard.h
Library Winscard.lib
DLL Winscard.dll