CardDeleteFile function

The CardDeleteFile function deletes the specified file. If the file does not exist, the returned Status value should indicate that the file did not exist.

Syntax


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

Parameters

pCardData [in]

Context information for the call. For more information, see CardAcquireContext.

pszDirectoryName [in]

Name of the directory that contains the file. Set to NULL for root.

pszFileName [in]

Logical File Name for the file to be deleted.

dwFlags [in]

Set to 0.

Return value

Zero on success; otherwise, nonzero.

Remarks

CardDeleteFile should check the flags parameter and return an SCARD_E_INVALID_PARAMETER error code if incorrect flags are passed into dwFlags.

If authentication has not been done correctly before calling CardDeleteFile, an SCARD_W_SECURITY_VIOLATION error code must be returned.

If CardDeleteFile is called on a nonexistent file, it should fail and return an SCARD_E_FILE_NOT_FOUND error.

If CardDeleteFile is called on an existing file that was created in a directory in which the caller has no permission to delete, an SCARD_W_SECURITY_VIOLATION error code must be returned.

If CardDeleteFile is called on a nonexistent directory, an SCARD_E_DIR_NOT_FOUND error code must be returned.

If the name that pszFileName or pszDirectoryName specified is longer than the maximum length for file/directory names, SCARD_E_INVALID_PARAMETER must be returned.

Requirements

Target platform

Header

Cardmod.h (include Cardmod.h)

 

 

Send comments about this topic to Microsoft

Show: