CardQueryFreeSpace Function

The CardQueryFreeSpace function, defined by a smart card module, gets the amount of available memory on a smart card.


DWORD WINAPI CardQueryFreeSpace(
  __in     PCARD_DATA pCardData,
  __in     DWORD dwFlags,
  __inout  PCARD_FREE_SPACE_INFO pCardFreeSpaceInfo


  • pCardData [in]
    A pointer to a CARD_DATA structure received from a call to the CardAcquireContext function.

  • dwFlags [in]
    Reserved. This parameter must be set to zero.

  • pCardFreeSpaceInfo [in, out]
    A pointer to a CARD_FREE_SPACE_INFO structure that, on output, contains information about the available memory on a smart card.

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_INVALID_PARAMETER 21485322280x80100004

The dwFlags parameter contains a value other than zero.


Minimum supported client Windows XP, Windows 2000 Professional with SP4
Minimum supported server Windows Server 2003, Windows 2000 Server with SP4
Header Cardmod.h

See Also

Microsoft Base Smart Card Cryptographic Service Provider



Send comments about this topic to Microsoft

Build date: 3/5/2009