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.

68 lines
2.1 KiB

  1. // ========================================================================
  2. //
  3. // X G U I D . H
  4. //
  5. // Header file for common GUID related data shared by DAVEX, EXOLEDB
  6. // and EXDAV.
  7. //
  8. // ========================================================================
  9. #ifndef _XGUID_H_
  10. #define _XGUID_H_
  11. #define USES_PS_MAPI
  12. #define USES_PS_PUBLIC_STRINGS
  13. #define USES_PS_INTERNET_HEADERS
  14. #include <mapiguid.h>
  15. // An enumeration of all the well-known GUIDs. Specifying a GUID by its
  16. // enumeration avoids marshalling and unmarshalling the entire GUID.
  17. //$REVIEW: If the number of well-known GUIDs ever gets greater than TWELVE
  18. //$REVIEW: we need to find another scheme to represent them. This is
  19. //$REVIEW: because, during marshalling, we lay out the GUIDs after the
  20. //$REVIEW: MAPINAMEID array in our buffer and convert their addresses
  21. //$REVIEW: into offsets. The minimum offset is 12(size of MAPINAMEID
  22. //$REVIEW: structure) when we have a single sized array. We don't want
  23. //$REVIEW: to confuse an offset with a well-known GUID and vice-versa.
  24. //$LATER: There is no point in having an enumeration of just one guid.
  25. // We should add some of the other well-known guids such as PS_MAPI,
  26. // PS_INTERNET_HEADERS and the outlook guids or remove this enumeration
  27. // altogether.
  28. //
  29. enum {
  30. FIRST_GUID,
  31. MAPI_PUBLIC = FIRST_GUID,
  32. LAST_GUID = MAPI_PUBLIC
  33. };
  34. // A table of well-known guids for quick access.
  35. //
  36. const LPGUID rgGuidTable[LAST_GUID - FIRST_GUID + 1] = {
  37. (LPGUID)&PS_PUBLIC_STRINGS,
  38. };
  39. /*
  40. * FWellKnownGUID
  41. *
  42. * Purpose:
  43. * Determines if a GUID is a well-known one. Well-known GUIDS are
  44. * enumerated above. If a GUID is well-known, its pointer is a
  45. * special value equal to its enumeration.
  46. * Arguments:
  47. * lpguid Pointer to the GUID
  48. * Returns:
  49. * TRUE if the GUID is well known
  50. * FALSE otherwise
  51. */
  52. __inline BOOL
  53. FWellKnownGUID(LPGUID lpguid)
  54. {
  55. // No need to compare lpguid with FIRST_GUID, as it's always greater
  56. // than FIRST_GUID. Acutally, such comparison may cause C4296 in build
  57. //
  58. if (LAST_GUID >= (DWORD_PTR)lpguid)
  59. return TRUE;
  60. else return FALSE;
  61. }
  62. #endif //!_XGUID_H_