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.

117 lines
2.6 KiB

  1. //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
  2. //
  3. // chanenum.h
  4. //
  5. // The definition of the channel enumerator.
  6. //
  7. // History:
  8. //
  9. // 8/6/97 edwardp Created.
  10. //
  11. ////////////////////////////////////////////////////////////////////////////////
  12. //
  13. // Check for previous includes of this file.
  14. //
  15. #ifndef _CHANENUM_H_
  16. #define _CHANENUM_H_
  17. /*
  18. //
  19. // Defines
  20. //
  21. #define TSTR_CHANNEL_KEY TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Channels")
  22. //
  23. // Helper functions.
  24. //
  25. HKEY Reg_GetChannelKey(void);
  26. HRESULT Reg_WriteChannel(LPCTSTR pszPath,LPCTSTR pszURL);
  27. HRESULT Reg_RemoveChannel(LPCTSTR pszPath);
  28. */
  29. //
  30. // Structures.
  31. //
  32. typedef struct _tagSTACKENTRY
  33. {
  34. LPTSTR pszPath;
  35. _tagSTACKENTRY* pNext;
  36. } STACKENTRY;
  37. typedef enum _tagINIVALUE
  38. {
  39. INI_GUID = 0,
  40. INI_URL = 1
  41. } INIVALUE;
  42. //
  43. // Class definition for the channel enumerator class.
  44. //
  45. class CChannelEnum : public IEnumChannels
  46. {
  47. //
  48. // Methods
  49. //
  50. public:
  51. // Constructor
  52. CChannelEnum(DWORD dwEnumFlags, LPCWSTR pszURL);
  53. // IUnknown
  54. STDMETHODIMP QueryInterface(REFIID, void **);
  55. STDMETHODIMP_(ULONG) AddRef(void);
  56. STDMETHODIMP_(ULONG) Release(void);
  57. // IEnumIDList
  58. STDMETHODIMP Next(ULONG celt, CHANNELENUMINFO* rgInfo, ULONG *pceltFetched);
  59. STDMETHODIMP Skip(ULONG celt);
  60. STDMETHODIMP Reset(void);
  61. STDMETHODIMP Clone(IEnumChannels **ppenum);
  62. private:
  63. // Destructor
  64. ~CChannelEnum(void);
  65. // Helper methods
  66. inline BOOL DirectoryStack_IsEmpty(void);
  67. void DirectoryStack_FreeEntry(STACKENTRY* pse);
  68. void DirectoryStack_FreeStack(void);
  69. STACKENTRY* DirectoryStack_Pop(void);
  70. BOOL DirectoryStack_Push(LPCTSTR pszPath);
  71. BOOL DirectoryStack_InitFromFlags(DWORD dwEnumFlags);
  72. BOOL DirectoryStack_PushSubdirectories(LPCTSTR pszPath);
  73. BOOL FindNextChannel(CHANNELENUMINFO* pInfo);
  74. BOOL ReadChannelInfo(LPCTSTR pszPath, CHANNELENUMINFO* pInfo);
  75. BOOL ContainsChannelDesktopIni(LPCTSTR pszPath);
  76. BOOL URLMatchesIni(LPCTSTR pszPath, LPCTSTR pszURL);
  77. BOOL ReadFromIni(LPCTSTR pszPath, LPTSTR pszOut, int cch, INIVALUE iv);
  78. LPOLESTR OleAllocString(LPCTSTR psz);
  79. SUBSCRIPTIONSTATE GetSubscriptionState(LPCTSTR pszURL);
  80. //
  81. // Member variables.
  82. //
  83. private:
  84. ULONG m_cRef;
  85. STACKENTRY* m_pseDirectoryStack;
  86. LPTSTR m_pszURL;
  87. DWORD m_dwEnumFlags;
  88. };
  89. #endif // _CHANENUM_H_