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
2.1 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: Compatibility.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Module to handle compatibility problems in general.
  7. //
  8. // History: 2000-08-03 vtan created
  9. // --------------------------------------------------------------------------
  10. #ifndef _Compatibility_
  11. #define _Compatibility_
  12. #include "DynamicArray.h"
  13. #include "KernelResources.h"
  14. // --------------------------------------------------------------------------
  15. // CCompatibility
  16. //
  17. // Purpose: This class implements compatibility and solutions to
  18. // compatibility problems.
  19. //
  20. // History: 2000-08-08 vtan created
  21. // --------------------------------------------------------------------------
  22. class CCompatibility
  23. {
  24. private:
  25. typedef bool (CALLBACK * PFNENUMSESSIONPROCESSESPROC) (DWORD dwProcessID, void *pV);
  26. public:
  27. static bool HasEnoughMemoryForNewSession (void);
  28. static void DropSessionProcessesWorkingSets (void);
  29. static NTSTATUS TerminateNonCompliantApplications (void);
  30. static void MinimizeWindowsOnDisconnect (void);
  31. static void RestoreWindowsOnReconnect (void);
  32. static NTSTATUS StaticInitialize (void);
  33. static NTSTATUS StaticTerminate (void);
  34. private:
  35. static NTSTATUS ConnectToServer (void);
  36. static NTSTATUS RequestSwitchUser (void);
  37. static bool CALLBACK CB_DropSessionProcessesWorkingSetsProc (DWORD dwProcessID, void *pV);
  38. static bool EnumSessionProcesses (DWORD dwSessionID, PFNENUMSESSIONPROCESSESPROC pfnCallback, void *pV);
  39. static DWORD WINAPI CB_MinimizeWindowsWorkItem (void *pV);
  40. static DWORD WINAPI CB_RestoreWindowsWorkItem (void *pV);
  41. private:
  42. static HANDLE s_hPort;
  43. };
  44. #endif /* _Compatibility_ */