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.

74 lines
2.0 KiB

  1. #ifndef __GLOBALS_H
  2. #define __GLOBALS_H
  3. #include "marsthrd.h"
  4. #include <atlext.h>
  5. typedef CMarsSimpleValArray<DWORD> CDwordArray;
  6. extern DWORD g_dwPerfFlags;
  7. /////////////////////////////////////////////////
  8. //
  9. // This object manages all global data which must
  10. // be protected by the Mars Critical Section. Examples
  11. // are per-process Singleton objects like the
  12. // Notify Spooler.
  13. //
  14. class CMarsGlobalsManager
  15. {
  16. // This class only has static methods and members -- you can't construct one of these.
  17. private:
  18. CMarsGlobalsManager();
  19. ~CMarsGlobalsManager();
  20. public:
  21. static HRESULT Passivate();
  22. static void Initialize(void);
  23. static void Teardown(void);
  24. /////////////////////////////////////////////
  25. // Global Storage Accessor Methods
  26. //
  27. // These methods follow the semi-standard
  28. // convention that a ref-counted pointer
  29. // return as the return value is NOT AddRef()'d
  30. // for the caller, and one that's returned
  31. // as an out-param IS. So...
  32. //
  33. // DO NOT RELEASE A POINTER RETURNED FROM THESE ACCESSOR METHODS!!!
  34. //
  35. static IGlobalInterfaceTable *GIT(void);
  36. private:
  37. // NOTE: We can't use CComClassPtr<>'s here because these members are static,
  38. // and that means we'd need to use the CRT to get the ctors to run
  39. // at startup. we could use pointers to CComClassPtr<>'s but that would
  40. // be really awkward.
  41. //
  42. static IGlobalInterfaceTable *ms_pGIT;
  43. static CMarsGlobalCritSect *m_pCS;
  44. };
  45. EXTERN_C HINSTANCE g_hinst;
  46. EXTERN_C HINSTANCE g_hinstBorg;
  47. extern HPALETTE g_hpalHalftone;
  48. extern HANDLE g_hScriptEvents; // see CMarsDebugOM::logScriptEvent
  49. // Use ProcessAddRef to keep InternetActivityCenter in a GetMessage loop
  50. // until all references are removed by ProcessRelease
  51. LONG ProcessAddRef();
  52. LONG ProcessRelease();
  53. LONG GetProcessRefCount();
  54. void SetParkingThreadId(DWORD dwThreadId);
  55. #endif // __GLOBALS_H