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.

106 lines
2.9 KiB

  1. //
  2. // Copyright 1997 - Microsoft
  3. //
  4. //
  5. // CENUMSIF.H - Handles enumerating OSes and Tools SIFs from DS
  6. //
  7. #ifndef _CENUMSIF_H_
  8. #define _CENUMSIF_H_
  9. // Flag Definitions
  10. #define ENUM_READ 0x00000000
  11. #define ENUM_WRITE 0x00000001
  12. // QI Table
  13. BEGIN_QITABLE( CEnumIMSIFs )
  14. DEFINE_QI( IID_IEnumIMSIFs, IEnumIMSIFs, 4 )
  15. END_QITABLE
  16. // Definitions
  17. LPVOID
  18. CEnumIMSIFs_CreateInstance(
  19. LPWSTR pszEnumPath,
  20. LPWSTR pszAttribute,
  21. DWORD dwFlags,
  22. IADs * pads );
  23. // Private Interface Definition
  24. interface
  25. IEnumIMSIFs:
  26. public IUnknown
  27. {
  28. public:
  29. STDMETHOD(Next)( ULONG celt, LPWSTR * rgelt, ULONG * pceltFetched ) PURE;
  30. STDMETHOD(Skip)( ULONG celt ) PURE;
  31. STDMETHOD(Reset)(void) PURE;
  32. STDMETHOD(Clone)( LPUNKNOWN * ppenum ) PURE;
  33. };
  34. typedef IEnumIMSIFs * LPENUMIMSIFS;
  35. // CEnumIMSIFs
  36. class
  37. CEnumIMSIFs:
  38. public IEnumIMSIFs
  39. {
  40. private:
  41. // IUnknown
  42. ULONG _cRef;
  43. DECLARE_QITABLE( CEnumIMSIFs );
  44. // IIntelliMirror
  45. IADs * _pads; // ADS Object
  46. LPWSTR _pszAttribute; // Attribute to enumerate
  47. int _iIndex; // Index
  48. LPWSTR _pszServerName; // DNS name of server
  49. HANDLE _hLanguage; // FindFile handle for Languages
  50. LPWSTR _pszLanguage; // last language found
  51. LPWSTR _pszEnumPath; // \\Server\IMIRROR\Setup\<language>\<_pszEnumPath>\*
  52. HANDLE _hOS; // FindFile handle for OSes
  53. LPWSTR _pszOS; // last OS found
  54. HANDLE _hArchitecture; // FindFile handle for Architectures
  55. LPWSTR _pszArchitecture; // last Architecture found
  56. HANDLE _hSIF; // FindFile handle for SIF files
  57. LPWSTR _pszSIF; // last SIF found
  58. // Flags for enumeration -- currently this only supports "read"
  59. union {
  60. DWORD _dwFlags;
  61. struct {
  62. BOOL _fWrite:1;
  63. };
  64. };
  65. private: // Methods
  66. CEnumIMSIFs();
  67. ~CEnumIMSIFs();
  68. STDMETHOD(Init)( LPWSTR pszEnumPath, LPWSTR pszAttribute, DWORD dwFlags, IADs * pads );
  69. HRESULT _FindNextItem( LPWSTR * pszFilePath );
  70. HRESULT _NextLanguage( );
  71. HRESULT _NextOS( );
  72. HRESULT _NextArchitecture( );
  73. HRESULT _NextSIF( );
  74. public: // Methods
  75. friend LPVOID
  76. CEnumIMSIFs_CreateInstance( LPWSTR pszEnumPath, LPWSTR pszAttribute,
  77. DWORD dwFlags, IADs * pads );
  78. // IUnknown
  79. STDMETHOD(QueryInterface)( REFIID riid, LPVOID *ppv );
  80. STDMETHOD_(ULONG, AddRef)(void);
  81. STDMETHOD_(ULONG, Release)(void);
  82. // IEnumIMThings
  83. STDMETHOD(Next)( ULONG celt, LPWSTR * rgelt, ULONG * pceltFetched );
  84. STDMETHOD(Skip)( ULONG celt );
  85. STDMETHOD(Reset)(void);
  86. STDMETHOD(Clone)( LPUNKNOWN * ppenum );
  87. };
  88. typedef CEnumIMSIFs* LPENUMSIFS;
  89. #endif // _CENUMSIF_H_