BUG: SCardGetAttrib() Returns ERROR_OUTOFMEMORY When SCARD_AUTOALLOCATE Is Used

ID: Q229960


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows versions 95, 98
    • Microsoft Windows NT


SYMPTOMS

For Smart Card Resource Manager version 1.0, the SCardGetAttrib() API may fail with ERROR_OUTOFMEMORY if the SCARD_AUTOALLOCATE feature is used.


CAUSE

The problem is caused by an anomaly in this API.


RESOLUTION

To work around this problem, instead, allocate the memory yourself.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

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); 


REFERENCES

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 kbDSupport kbGrpKernBase kbSmartCard
Version : winnt:
Platform : winnt
Issue type : kbbug


Last Reviewed: December 29, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.