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.

43 lines
951 B

  1. #ifndef _CRAWLER_H_
  2. #define _CRAWLER_H_
  3. #define CB_WNET_BUFFER 8*1024
  4. typedef enum tagCrawlerFlags
  5. {
  6. NC_FINISHED = 0x0001,
  7. NC_INIT_WORKGROUPS = 0x0002,
  8. } NCFLAGS;
  9. class CNetCrawler
  10. {
  11. public:
  12. CNetCrawler(void) : _dwStatus(0), _hdpaWorkGroups(NULL), _cRef(1), _cItems(0) {}
  13. ~CNetCrawler(void);
  14. void Init(DWORD dwFlags, int nItems);
  15. HRESULT GetWorkGroupName(LPTSTR pszWorkGroupName, int cb, BOOL fBlocking);
  16. inline void AddRef(void)
  17. {
  18. InterlockedIncrement(&_cRef);
  19. }
  20. inline void Release(void)
  21. {
  22. ASSERT( 0 != _cRef );
  23. if ( 0 == InterlockedDecrement(&_cRef) )
  24. {
  25. delete this;
  26. }
  27. }
  28. private:
  29. BOOL _dwStatus;
  30. HDPA _hdpaWorkGroups;
  31. int _iMaxItems;
  32. int _cItems;
  33. LONG _cRef;
  34. void _EnumNetResources(LPNETRESOURCE pnr);
  35. static DWORD WINAPI _EnumWorkGroups(LPVOID pv);
  36. };
  37. #endif // _CRAWLER_H_