Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

  1. #define _SYS_GUID_OPERATORS_
  2. #include <windows.h>
  3. #include <ole2.h>
  4. #include <stdlib.h>
  5. //+-------------------------------------------------------------------------
  6. //
  7. // Function: IsEqualGUID (public)
  8. //
  9. // Synopsis: compares two guids for equality
  10. //
  11. // Arguments: [guid1] - the first guid
  12. // [guid2] - the second guid to compare the first one with
  13. //
  14. // Returns: TRUE if equal, FALSE if not.
  15. //
  16. // Note:
  17. // Only reason we have this function is because we exported it originally
  18. // from OLE32.DLL and forgot to take it out when we made it an inline
  19. // function in objbase.h. Somebody out there may be relying on it being
  20. // available. Internally we must use wIsEqualGUID.
  21. //
  22. //--------------------------------------------------------------------------
  23. #undef IsEqualGUID // undo the #define in objbase.h
  24. extern "C" BOOL __stdcall IsEqualGUID(GUID &guid1, GUID &guid2)
  25. {
  26. return (
  27. ((PLONG) &guid1)[0] == ((PLONG) &guid2)[0] &&
  28. ((PLONG) &guid1)[1] == ((PLONG) &guid2)[1] &&
  29. ((PLONG) &guid1)[2] == ((PLONG) &guid2)[2] &&
  30. ((PLONG) &guid1)[3] == ((PLONG) &guid2)[3]);
  31. }
  32. //+-------------------------------------------------------------------------
  33. //
  34. // Function: wIsEqualGUID (internal)
  35. //
  36. // Synopsis: compares two guids for equality
  37. //
  38. // Arguments: [guid1] - the first guid
  39. // [guid2] - the second guid to compare the first one with
  40. //
  41. // Returns: TRUE if equal, FALSE if not.
  42. //
  43. //--------------------------------------------------------------------------
  44. BOOL __fastcall wIsEqualGUID(REFGUID guid1, REFGUID guid2)
  45. {
  46. return (
  47. ((PLONG) &guid1)[0] == ((PLONG) &guid2)[0] &&
  48. ((PLONG) &guid1)[1] == ((PLONG) &guid2)[1] &&
  49. ((PLONG) &guid1)[2] == ((PLONG) &guid2)[2] &&
  50. ((PLONG) &guid1)[3] == ((PLONG) &guid2)[3]);
  51. }
  52.