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.

41 lines
867 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. InterlockedDecrement(&_cRef);
  23. if (!_cRef)
  24. delete this;
  25. }
  26. private:
  27. BOOL _dwStatus;
  28. HDPA _hdpaWorkGroups;
  29. int _iMaxItems;
  30. int _cItems;
  31. LONG _cRef;
  32. void _EnumNetResources(LPNETRESOURCE pnr);
  33. static DWORD WINAPI _EnumWorkGroups(LPVOID pv);
  34. };
  35. #endif // _CRAWLER_H_