Leaked source code of windows server 2003
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.

58 lines
1.9 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. #if _MSC_VER < 1200
  24. #undef IsEqualGUID // undo the #define in objbase.h
  25. extern "C" BOOL __stdcall IsEqualGUID(GUID &guid1, GUID &guid2)
  26. {
  27. return (
  28. ((PLONG) &guid1)[0] == ((PLONG) &guid2)[0] &&
  29. ((PLONG) &guid1)[1] == ((PLONG) &guid2)[1] &&
  30. ((PLONG) &guid1)[2] == ((PLONG) &guid2)[2] &&
  31. ((PLONG) &guid1)[3] == ((PLONG) &guid2)[3]);
  32. }
  33. #endif
  34. #if 0
  35. //+-------------------------------------------------------------------------
  36. //
  37. // Function: wIsEqualGUID (internal)
  38. //
  39. // Synopsis: compares two guids for equality
  40. //
  41. // Arguments: [guid1] - the first guid
  42. // [guid2] - the second guid to compare the first one with
  43. //
  44. // Returns: TRUE if equal, FALSE if not.
  45. //
  46. //--------------------------------------------------------------------------
  47. BOOL __fastcall wIsEqualGUID(REFGUID guid1, REFGUID guid2)
  48. {
  49. return (
  50. ((PLONG) &guid1)[0] == ((PLONG) &guid2)[0] &&
  51. ((PLONG) &guid1)[1] == ((PLONG) &guid2)[1] &&
  52. ((PLONG) &guid1)[2] == ((PLONG) &guid2)[2] &&
  53. ((PLONG) &guid1)[3] == ((PLONG) &guid2)[3]);
  54. }
  55. #endif