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.

95 lines
2.3 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. winsdb.h
  7. Wins database enumerator
  8. FILE HISTORY:
  9. Oct 13 1997 EricDav Modified
  10. */
  11. #ifndef _WINDDB_H
  12. #define _WINSDB_H
  13. #include "wins.h"
  14. #ifndef _MEMMNGR_H
  15. #include "memmngr.h"
  16. #endif
  17. #ifndef _HARRAY_H
  18. #include "harray.h"
  19. #endif
  20. class CWinsDatabase : public IWinsDatabase
  21. {
  22. public:
  23. CWinsDatabase();
  24. ~CWinsDatabase();
  25. DeclareIUnknownMembers(IMPL)
  26. DeclareIWinsDatabaseMembers(IMPL)
  27. // helper to set the current state
  28. HRESULT SetCurrentState(WINSDB_STATE winsdbState);
  29. // for background threading
  30. DWORD Execute();
  31. DWORD ReadRecords(handle_t hBinding);
  32. DWORD ReadRecordsByOwner(handle_t hBinding);
  33. // ??
  34. int GetIndex(HROW hrow);
  35. HROW GetHRow(WinsRecord wRecord, BYTE bLast, BOOL fAllRecords);
  36. protected:
  37. // Holds all of the sorted and filtered indicies
  38. CIndexMgr m_IndexMgr;
  39. // handles memory allocation
  40. CMemoryManager m_cMemMan;
  41. // total number of records scanned
  42. DWORD m_dwRecsCount;
  43. LONG m_cRef;
  44. BOOL m_fFiltered;
  45. BOOL m_fInitialized;
  46. BOOL m_bShutdown;
  47. CString m_strName;
  48. CString m_strIp;
  49. HANDLE m_hThread;
  50. HANDLE m_hStart;
  51. HANDLE m_hAbort;
  52. HRESULT m_hrLastError;
  53. WINSDB_STATE m_DBState;
  54. handle_t m_hBinding;
  55. CCriticalSection m_csState;
  56. // CDWordArray m_dwaOwnerFilter;
  57. BOOL m_bEnableCache;
  58. DWORD m_dwOwner;
  59. LPSTR m_strPrefix;
  60. };
  61. typedef ComSmartPointer<IWinsDatabase, &IID_IWinsDatabase> SPIWinsDatabase;
  62. // thread proc the background thread initially is called on
  63. DWORD WINAPI ThreadProc(LPVOID lParam);
  64. // converts records from the server to WinsRecords
  65. void WinsIntfToWinsRecord(PWINSINTF_RECORD_ACTION_T pRecord, WinsRecord & wRecord);
  66. // helper to create and initialize the WinsDatabase
  67. extern HRESULT CreateWinsDatabase(CString& strName, CString& strIP, IWinsDatabase **ppWinsDB);
  68. #endif // _WINSDB_H