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.

84 lines
1.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1999
  5. //
  6. // File: DSQuery.h
  7. //
  8. // Contents: Query object for DS snapin
  9. //
  10. //--------------------------------------------------------------------------
  11. #ifndef __QUERY_H__
  12. #define __QUERY_H__
  13. #define QUERY_PAGESIZE 50
  14. //
  15. // CDSSearch
  16. //
  17. class CDSSearch
  18. {
  19. public:
  20. CDSSearch(CComPtr<IDirectorySearch>& refspSearchObject);
  21. ~CDSSearch();
  22. // INTERFACES
  23. public:
  24. HRESULT
  25. DoQuery(BOOL bAttrOnly = FALSE);
  26. HRESULT
  27. GetNextRow();
  28. HRESULT
  29. GetColumn(LPWSTR Attribute,
  30. PADS_SEARCH_COLUMN pColumnData);
  31. HRESULT
  32. FreeColumn(PADS_SEARCH_COLUMN pColumnData)
  33. {
  34. return m_pObj->FreeColumn(pColumnData);
  35. };
  36. HRESULT
  37. SetAttributeList (LPTSTR *pszAttribs, INT cAttrs);
  38. HRESULT
  39. SetSearchScope(ADS_SCOPEENUM scope);
  40. HRESULT
  41. SetFilterString (LPWSTR pszFilter)
  42. {
  43. m_strFilter = pszFilter;
  44. return S_OK;
  45. };
  46. HRESULT
  47. GetNextColumnName(LPWSTR *ppszColumnName);
  48. VOID
  49. FreeColumnName(LPWSTR pszColumnName)
  50. {
  51. FreeADsMem(pszColumnName);
  52. }
  53. //Attributes
  54. public:
  55. CComPtr<IDirectorySearch>& m_pObj;
  56. ADS_SEARCH_HANDLE m_SearchHandle;
  57. protected:
  58. CString m_strFilter;
  59. LPWSTR * m_ppszAttr;
  60. DWORD m_CountAttr;
  61. ADS_SCOPEENUM m_scope;
  62. private:
  63. void _Reset();
  64. };
  65. #endif //__DSQUERY_H__