BUG: IsEqualGUIDBase(...) Always Returns TRUE Under C++

Last reviewed: December 17, 1996
Article ID: Q156798
The information in this article applies to:
  • Microsoft OLE Database, version 1.0
BUG #: 2725 (OLEDBSDK)

SYMPTOMS

In the Oledb.h header file, the IsEqualGUIBase(...) function is defined by the following lines:

   #ifdef __cplusplus
   inline BOOL IsEqualGUIDBase(const GUID &rguid1, const GUID  &rguid2)
   { return !memcmp(&(rguid1.Data2), &(rguid1.Data2),    sizeof(GUID) -
   sizeof(rguid1.Data1)); }

This function will always return TRUE, because it is comparing rguid1.Data2 to itself (rguid1.Data2).

WORKAROUND

To work around this problem, change the second parameter in the memcmp function from rguid1.Data2 to rguid2.Data2. The following is the correct function definition:

   #ifdef __cplusplus
   inline BOOL IsEqualGUIDBase(const GUID &rguid1, const GUID  &rguid2)
   { return !memcmp(&(rguid1.Data2), &(rguid2.Data2),    sizeof(GUID) -
   sizeof(rguid1.Data1)); }

STATUS

Microsoft has confirmed this to be a problem in the OLE Database SDK version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: OLE DB 1.00
KBCategory: kbusage kbbug1.00
KBSubcategory: ODBC SDK


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 17, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.