共用方式為


CardCreateFile function

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

The CardCreateFile function, defined by a smart card module, creates a file in the specified directory of a smart card.

Syntax

DWORD WINAPI CardCreateFile(
  _In_ PCARD_DATA                 pCardData,
  _In_ LPSTR                      pszDirectoryName,
  _In_ LPSTR                      pszFileName,
  _In_ DWORD                      cbInitialCreationSize,
  _In_ CARD_FILE_ACCESS_CONDITION AccessCondition
);

Parameters

pCardData [in]

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

pszDirectoryName [in]

A pointer to a null-terminated string that contains a directory name. The CardCreateFile function creates the new file in this directory. The function fails if the specified directory does not exist.

pszFileName [in]

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

cbInitialCreationSize [in]

The size, in bytes, of the new file.

AccessCondition [in]

A member of the CARD_FILE_ACCESS_CONDITION enumeration that specifies access control permissions for the new file.

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
ERROR_FILE_EXISTS
128 (0x80)
A file with the same name as the value of the pszFileName parameter already exists.

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