This function creates a subdirectory from the root in the file system of the card, and applies the provided access condition.
Directories are generally created for segregating the files that belong to a single application on the card. As an example, the files that belong to the Microsoft cryptographic application are in the “mscp” directory.
DWORD WINAPI CardCreateDirectory( _In_ PCARD_DATA pCardData, _In_ LPSTR pszDirectory, _In_ CARD_DIRECTORY_ACCESS_CONDITION AccessCondition );
- pCardData [in]
Context information for the call. For more information, see CardAcquireContext.
- pszDirectory [in]
Name of the directory.
- AccessCondition [in]
Access control permissions to be applied to the directory.
Zero on success; otherwise, nonzero.
Directory names must be 8 or fewer ANSI characters.
Currently-defined directory access control permissions are taken from the CARD_DIRECTORY_ACCESS_CONDITION from Cardmod.h. These access control permissions are:
For more information about these access control permission values, see File System Requirements.
The function fails if the subdirectory already exists (ERROR_FILE_EXISTS) or insufficient space exists to create the new directory on the card (SCARD_E_NO_MEMORY).
If calling CardCreateDirectory with a NULL pszDirectoryName, SCARD_E_INVALID_PARAMETER should be returned.
If the pszDirectoryName directory already exists or if there is no such directory but there is a file that is named the same, ERROR_FILE_EXISTS should be returned.
If calling CardCreateDirectory without a previous card authentication, the function is expected to fail with an SCARD_W_SECURITY_VIOLATION error.
If calling CardCreateDirectory with invalid access conditions, the function is expected to fail with an SCARD_E_INVALID_PARAMETER error.
If the name that was specified by pszDirectoryName is longer than the maximum length that is defined for file/directory names, SCARD_E_INVALID_PARAMETER must be returned.