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.

59 lines
1.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: guidtbl.cxx
  7. //
  8. // Contents:
  9. //
  10. //--------------------------------------------------------------------------
  11. #include "act.hxx"
  12. CGuidTable::CGuidTable( OUT LONG& Status ) :
  13. CHashTable( Status )
  14. {
  15. }
  16. CGuidTable::~CGuidTable()
  17. {
  18. }
  19. CGuidTableEntry *
  20. CGuidTable::Lookup(
  21. IN CLSID * pClsid )
  22. {
  23. //
  24. // GUID structures are not 8-byte aligned. Therefore the UNALIGNED
  25. // modifier is required when referencing the contents of a GUID via
  26. // a pointer to an 8-byte type.
  27. //
  28. CId2Key Key( ((ID UNALIGNED *)pClsid)[0], ((ID UNALIGNED *)pClsid)[1] );
  29. return (CGuidTableEntry *) CHashTable::Lookup( Key );
  30. }
  31. CGuidTableEntry::CGuidTableEntry(
  32. IN CLSID * pClsid
  33. ) :
  34. CId2TableElement( ((ID UNALIGNED *)pClsid)[0], ((ID UNALIGNED *)pClsid)[1] )
  35. {
  36. }
  37. CGuidTableEntry::~CGuidTableEntry()
  38. {
  39. }
  40. GUID
  41. CGuidTableEntry::Guid()
  42. {
  43. GUID Guid;
  44. ((ID UNALIGNED *)&Guid)[0] = Id();
  45. ((ID UNALIGNED *)&Guid)[1] = Id2();
  46. return Guid;
  47. }