BUG: SCardGetAttrib() Returns ERROR_OUTOFMEMORY When SCARD_AUTOALLOCATE Is Used

ID: Q229960


The information in this article applies to:


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

Last Reviewed: May 26, 1999