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.

64 lines
1.3 KiB

  1. //____________________________________________________________________________
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1996.
  5. //
  6. // File: dll.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 1/24/1996 RaviR Created
  15. //
  16. //____________________________________________________________________________
  17. #ifndef _JOBFLDR_DLL_HXX_
  18. #define _JOBFLDR_DLL_HXX_
  19. class CDll
  20. {
  21. public:
  22. static ULONG AddRef() { return InterlockedIncrement((LONG*)&s_cObjs); }
  23. static ULONG Release() { return InterlockedDecrement((LONG*)&s_cObjs); }
  24. static void LockServer(BOOL fLock) {
  25. (fLock == TRUE) ? InterlockedIncrement((LONG*)&s_cLocks)
  26. : InterlockedDecrement((LONG*)&s_cLocks);
  27. }
  28. static HRESULT CanUnloadNow(void) {
  29. return (0L == s_cObjs && 0L == s_cLocks) ? S_OK : S_FALSE;
  30. }
  31. static ULONG s_cObjs;
  32. static ULONG s_cLocks;
  33. }; // class CDll
  34. class CDllRef
  35. {
  36. public:
  37. CDllRef(void) { CDll::AddRef(); }
  38. ~CDllRef(void) { CDll::Release(); }
  39. }; // class CDllRef
  40. class CWaitCursor
  41. {
  42. public:
  43. CWaitCursor() {m_cOld=SetCursor(LoadCursor(NULL, IDC_WAIT));}
  44. ~CWaitCursor() {SetCursor(m_cOld);}
  45. private:
  46. HCURSOR m_cOld;
  47. } ;
  48. #endif // _JOBFLDR_DLL_HXX_