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.

55 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. cachehndl.cxx
  5. Abstract:
  6. Handle manager for creating, deleting, reference counting,
  7. and dispatching HINTERNET objects to HTTPCACHE_REQUEST objects
  8. Author:
  9. Revision History:
  10. --*/
  11. #ifndef __CACHEHNDL_HXX__
  12. #define __CACHEHNDL_HXX__
  13. class CACHE_HANDLE_MANAGER
  14. {
  15. private:
  16. // just a simple linked list. Nothing fancy going on here
  17. struct CACHE_REQUEST_LIST{
  18. HTTPCACHE_REQUEST * CacheRequestObj;
  19. CACHE_REQUEST_LIST * next;
  20. CACHE_REQUEST_LIST(HINTERNET hRequest) {
  21. CacheRequestObj = new HTTPCACHE_REQUEST(hRequest);
  22. next = NULL;
  23. }
  24. ~CACHE_REQUEST_LIST() {
  25. delete CacheRequestObj;
  26. next = NULL;
  27. }
  28. };
  29. CACHE_REQUEST_LIST * HeadCacheRequestList;
  30. DWORD dwRefCount;
  31. CCritSec HndlMgrCritSec;
  32. public:
  33. CACHE_HANDLE_MANAGER();
  34. ~CACHE_HANDLE_MANAGER();
  35. BOOL AddCacheRequestObject(HINTERNET hRequest);
  36. HTTPCACHE_REQUEST * GetCacheRequestObject(HINTERNET hRequest);
  37. BOOL RemoveCacheRequestObject(HINTERNET hRequest);
  38. DWORD RefCount() { return dwRefCount; }
  39. };
  40. #endif // __CACHE_HNDL_HXX__