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.

51 lines
906 B

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. refb.hxx
  5. Abstract:
  6. Reference counting blob class
  7. Author:
  8. Philippe Choquier (phillich) 11-sep-1996
  9. --*/
  10. #if !defined(_REFB_INCLUDE)
  11. #define _REFB_INCLUDE
  12. # if !defined( dllexp)
  13. # define dllexp __declspec( dllexport)
  14. # endif // !defined( dllexp)
  15. typedef VOID
  16. (WINAPI * PFN_FREE_BLOB)
  17. (
  18. LPVOID
  19. );
  20. class RefBlob {
  21. public:
  22. dllexp RefBlob();
  23. dllexp ~RefBlob();
  24. dllexp BOOL Init( LPVOID pv, DWORD sz, PFN_FREE_BLOB pFn = NULL );
  25. dllexp VOID AddRef();
  26. dllexp VOID Release();
  27. dllexp LPVOID QueryPtr();
  28. dllexp DWORD QuerySize();
  29. dllexp LONG* QueryRefCount() { return &m_lRef; }
  30. private:
  31. LPVOID m_pvBlob;
  32. DWORD m_dwSize;
  33. LONG m_lRef;
  34. PFN_FREE_BLOB m_pfnFree;
  35. } ;
  36. #endif