Share via


CardDeleteFile function

This topic is not current. For the most current information about the Smart Card API, see Smart Card Minidriver Specification.

The CardDeleteFile function, defined by a smart card module, deletes a file from a smart card.

Syntax

DWORD WINAPI CardDeleteFile(
  _In_ PCARD_DATA pCardData,
  _In_ LPSTR      pszDirectoryName,
  _In_ LPSTR      pszFileName,
  _In_ DWORD      dwFlags
);

Parameters

pCardData [in]

A pointer to a CARD_DATA structure received from a call to the CardAcquireContext function.

pszDirectoryName [in]

A pointer to a null-terminated string that contains the name of the directory that contains the file to delete.

pszFileName [in]

A pointer to a null-terminated string that contains the name of the file to delete. If the specified file does not exist, the return value of this function should indicate that the file does not exist.

dwFlags [in]

Reserved. This parameter must be set to zero.

Return value

If the function succeeds, the function returns zero.

If the function fails, it returns a nonzero error value or one of the following possible error values.

Return code/value Description
SCARD_E_FILE_NOT_FOUND
2148532260 (0x80100024)
The file specified by the pszDirectoryName and pszFileName parameters does not exist.
SCARD_E_INVALID_PARAMETER
2148532228 (0x80100004)
The dwFlags parameter contains a value that is not valid.
SCARD_W_SECURITY_VIOLATION
2148532330 (0x8010006A)
The caller did not authenticate to the smart card before calling this function.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Cardmod.h

See also

Microsoft Base Smart Card Cryptographic Service Provider

CARD_DATA

CardAcquireContext

CardCreateFile