BUG: SCardGetAttrib() Returns ERROR_OUTOFMEMORY When SCARD_AUTOALLOCATE Is UsedID: Q229960
|
For Smart Card Resource Manager version 1.0, the SCardGetAttrib() API may fail with ERROR_OUTOFMEMORY if the SCARD_AUTOALLOCATE feature is used.
The problem is caused by an anomaly in this API.
To work around this problem, instead, allocate the memory yourself.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
The following code snippet reproduces the problem described above:
LPBYTE pbValue = NULL;
DWORD dwArrtId = SCARD_ATTR_VENDOR_NAME;
DWORD dwLength = SCARD_AUTOALLOCATE;
SCardGetAttrib(hCard, dwAttrId,(LPBYTE)&pbValue, &dwLength);
Please see the MSDN online help for more information on SCardGetAttrib(), SCARD_AUTO_ALLOCATE, and other SCard APIs.
Additional query words: Smart Card SCard APIs SCardGetAttrib SCARD_AUTOALLOCATE ERROR_OUTOFMEMORY.
Keywords : kbAPI kbKernBase kbSDKPlatform kbSDKWin32 kbSmartCard
Version : winnt:
Platform : winnt
Issue type : kbbug
Last Reviewed: May 26, 1999