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.

200 lines
4.2 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2000.
  5. //
  6. // File: cadsxml.hxx
  7. //
  8. // Contents: Header file for CADsXML
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __CADSXML_H__
  12. #define __CADSXML_H__
  13. #include "..\include\procs.hxx"
  14. #include "iadsxml.h"
  15. #include "indunk.hxx"
  16. #include "iprops.hxx"
  17. #include ".\cdispmgr.hxx"
  18. #include "macro.h"
  19. #include "adxmlerr.hxx"
  20. #include "adxmlstr.hxx"
  21. #include "base64.hxx"
  22. #include <string.h>
  23. #define SCHEMA_PAGE_SIZE 1024
  24. #define LINE_LENGTH 60
  25. typedef struct searchprefinfo_tag {
  26. ADS_SEARCHPREF Pref;
  27. VARTYPE vtType;
  28. LPWSTR pszName;
  29. } SEARCHPREFINFO;
  30. class CADsXML: INHERIT_TRACKING,
  31. public IADsXML,
  32. public IADsExtension,
  33. public INonDelegatingUnknown
  34. {
  35. friend class CADsXMLCF;
  36. public:
  37. CADsXML(void);
  38. ~CADsXML(void);
  39. STDMETHODIMP QueryInterface(
  40. REFIID iid,
  41. LPVOID *ppInterface
  42. );
  43. DECLARE_DELEGATING_REFCOUNTING
  44. STDMETHOD(NonDelegatingQueryInterface)(THIS_
  45. const IID&,
  46. void **
  47. );
  48. DECLARE_NON_DELEGATING_REFCOUNTING
  49. DECLARE_IDispatch_METHODS
  50. STDMETHOD(Operate)(
  51. THIS_
  52. DWORD dwCode,
  53. VARIANT varUserName,
  54. VARIANT varPassword,
  55. VARIANT varReserved
  56. );
  57. STDMETHOD(PrivateGetIDsOfNames)(
  58. THIS_
  59. REFIID riid,
  60. OLECHAR FAR* FAR* rgszNames,
  61. unsigned int cNames,
  62. LCID lcid,
  63. DISPID FAR* rgdispid) ;
  64. STDMETHOD(PrivateInvoke)(
  65. THIS_
  66. DISPID dispidMember,
  67. REFIID riid,
  68. LCID lcid,
  69. WORD wFlags,
  70. DISPPARAMS FAR* pdispparams,
  71. VARIANT FAR* pvarResult,
  72. EXCEPINFO FAR* pexcepinfo,
  73. unsigned int FAR* puArgErr
  74. ) ;
  75. STDMETHODIMP SaveXML(
  76. VARIANT vDest,
  77. BSTR szFilter,
  78. BSTR szAttrs,
  79. long lScope,
  80. BSTR xslRef,
  81. long lFlag,
  82. BSTR szOptions,
  83. VARIANT *pDirSyncCookie
  84. );
  85. private:
  86. HRESULT ValidateArgs(
  87. VARIANT vDest,
  88. long lScope,
  89. long lFlag,
  90. VARIANT *pDirSyncCookie
  91. );
  92. HRESULT OpenOutputStream(
  93. VARIANT vDest
  94. );
  95. HRESULT WriteXMLHeader(
  96. BSTR xslRef
  97. );
  98. HRESULT OutputSchema(void);
  99. HRESULT OutputData(
  100. BSTR szFilter,
  101. BSTR szAttrs,
  102. long lScope,
  103. BSTR szOptions
  104. );
  105. HRESULT WriteXMLFooter(void);
  106. LPWSTR RemoveWhiteSpace(BSTR pszStr);
  107. LPWSTR ReduceWhiteSpace(BSTR pszStr);
  108. void CloseOutputStream(void);
  109. HRESULT WriteLine(LPWSTR szStr, BOOL fEscape = FALSE);
  110. HRESULT Write(LPWSTR szStr, BOOL fEscape = FALSE);
  111. HRESULT OutputSchemaHeader(void);
  112. HRESULT OutputClassHeader(ADS_SEARCH_HANDLE hSearch, IDirectorySearch *pSearch);
  113. HRESULT OutputClassAttrs(ADS_SEARCH_HANDLE hSearch, IDirectorySearch *pSearch);
  114. HRESULT OutputAttrs(
  115. ADS_SEARCH_HANDLE hSearch,
  116. IDirectorySearch *pSearch,
  117. LPWSTR pszAttrName,
  118. BOOL fMandatory
  119. );
  120. HRESULT OutputClassFooter(void);
  121. HRESULT OutputSchemaFooter(void);
  122. HRESULT ParseAttrList(
  123. BSTR szAttrs,
  124. LPWSTR **ppAttrs,
  125. DWORD *pdwNumAttrs
  126. );
  127. HRESULT OutputDataHeader(void);
  128. HRESULT OutputEntryHeader(
  129. ADS_SEARCH_HANDLE hSearch,
  130. IDirectorySearch *pSearch
  131. );
  132. HRESULT OutputEntryAttrs(
  133. ADS_SEARCH_HANDLE hSearch,
  134. IDirectorySearch *pSearch
  135. );
  136. HRESULT OutputValue(ADS_SEARCH_COLUMN *pColumn);
  137. HRESULT OutputEntryFooter(void);
  138. HRESULT OutputDataFooter(void);
  139. void FreeSearchPrefInfo(
  140. ADS_SEARCHPREF_INFO *pSearchPrefInfo,
  141. DWORD dwNumPrefs
  142. );
  143. HRESULT GetSearchPreferences(
  144. ADS_SEARCHPREF_INFO** ppSearchPrefInfo,
  145. DWORD *pdwNumPrefs,
  146. LONG lScope,
  147. LPWSTR szOptions
  148. );
  149. IADs * _pADs;
  150. CAggregateeDispMgr FAR * _pDispMgr;
  151. CCredentials *m_pCredentials;
  152. HANDLE m_hFile;
  153. DWORD m_dwAuthFlags;
  154. };
  155. extern long glnObjCnt;
  156. extern const GUID IID_IADsXML;
  157. extern const GUID LIBID_ADsXML;
  158. #endif // __CADSXML_H__