// winsmcrd.h
// CTL_CODE(0x0031, 0x00f, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SMARTCARD_GET_LAST_ERROR 0x0031003C
View the official Windows Driver Kit DDI referenceNo description available.
The IOCTL_SMARTCARD_GET_LAST_ERROR request retrieves the error code of the most previous operation because there is no option to return an error code immediately after an overlapped operation is complete.
DiocParams->cbOutBuffer
Contains the size of the output buffer. Must be at least sizeof(ULONG).
DiocParams->lpvOutBuffer
Receives the error code.
DiocParams->lpcbBytesReturned
Must be set to sizeof(ULONG).
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful, and must be returned when using this IOCTL.
Be aware that when your driver uses the smart card driver library, you should store the result of the most previously overlapped operation in the smart card extension. ion. The library will use your stored value to answer this call automatically.