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.

86 lines
1.8 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998
  5. //
  6. // File: guidlist.h
  7. //
  8. // Contents: Classes for marshalling, unmarshalling Guids
  9. //
  10. // History: 24-Oct-98 SitaramR Created
  11. //
  12. //---------------------------------------------------------------------------
  13. #pragma once
  14. typedef struct _GUIDELEM
  15. {
  16. GUID guid; // Extension guid
  17. struct _GUIDELEM * pSnapinGuids; // List of snapin guids
  18. struct _GUIDELEM * pNext; // Singly linked list ptr
  19. } GUIDELEM, *LPGUIDELEM;
  20. void FreeGuidList( LPGUIDELEM pGuidList );
  21. class CGuidList
  22. {
  23. public:
  24. CGuidList();
  25. ~CGuidList();
  26. HRESULT MarshallGuids( XPtrST<TCHAR> & xValueOut );
  27. HRESULT UnMarshallGuids( TCHAR *pszGuids );
  28. HRESULT Update( BOOL bAdd, GUID *pGuidExtension, GUID *pGuidSnapin );
  29. BOOL GuidsChanged() { return m_bGuidsChanged; }
  30. private:
  31. HRESULT UpdateSnapinGuid( BOOL bAdd, GUIDELEM *pCurPtr, GUID *pGuidSnapin );
  32. GUIDELEM * m_pExtGuidList;
  33. BOOL m_bGuidsChanged;
  34. };
  35. //*************************************************************
  36. //
  37. // XGuidElem
  38. //
  39. // Purpose: Smart pointer for GUIDELEM list
  40. //
  41. //*************************************************************
  42. class XGuidElem
  43. {
  44. public:
  45. XGuidElem()
  46. : m_pGuidList(0)
  47. {
  48. }
  49. ~XGuidElem()
  50. {
  51. FreeGuidList( m_pGuidList );
  52. }
  53. void Set( GUIDELEM *pGuidList )
  54. {
  55. m_pGuidList = pGuidList;
  56. }
  57. GUIDELEM *Acquire()
  58. {
  59. GUIDELEM *pTemp = m_pGuidList;
  60. m_pGuidList = 0;
  61. return pTemp;
  62. }
  63. private:
  64. GUIDELEM *m_pGuidList;
  65. };