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.

70 lines
3.4 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: RestoreApplication.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class to implement holding information required to restore an application
  7. // and to actually restore it.
  8. //
  9. // History: 2000-10-26 vtan created
  10. // 2000-11-04 vtan split into separate file
  11. // --------------------------------------------------------------------------
  12. #ifndef _RestoreApplication_
  13. #define _RestoreApplication_
  14. #include "CountedObject.h"
  15. // --------------------------------------------------------------------------
  16. // CRestoreApplication
  17. //
  18. // Purpose: Class to manage information required to restore an application
  19. // that was terminated because of a different user switch.
  20. //
  21. // History: 2000-10-26 vtan created
  22. // 2000-11-04 vtan split into separate file
  23. // --------------------------------------------------------------------------
  24. class CRestoreApplication : public CCountedObject
  25. {
  26. public:
  27. CRestoreApplication (void);
  28. ~CRestoreApplication (void);
  29. NTSTATUS GetInformation (HANDLE hProcess);
  30. bool IsEqualSessionID (DWORD dwSessionID) const;
  31. const WCHAR* GetCommandLine (void) const;
  32. NTSTATUS Restore (HANDLE *phProcess) const;
  33. private:
  34. NTSTATUS GetProcessParameters (HANDLE hProcess, RTL_USER_PROCESS_PARAMETERS *pProcessParameters);
  35. NTSTATUS GetUnicodeString (HANDLE hProcess, const UNICODE_STRING& string, WCHAR** ppsz);
  36. NTSTATUS GetToken (HANDLE hProcess);
  37. NTSTATUS GetSessionID (HANDLE hProcess);
  38. NTSTATUS GetCommandLine (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  39. NTSTATUS GetEnvironment (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  40. NTSTATUS GetCurrentDirectory (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  41. NTSTATUS GetDesktop (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  42. NTSTATUS GetTitle (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  43. NTSTATUS GetFlags (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  44. NTSTATUS GetStdHandles (HANDLE hProcess, const RTL_USER_PROCESS_PARAMETERS& processParameters);
  45. private:
  46. HANDLE _hToken;
  47. DWORD _dwSessionID;
  48. WCHAR *_pszCommandLine;
  49. void *_pEnvironment;
  50. WCHAR *_pszCurrentDirectory;
  51. WCHAR *_pszDesktop;
  52. WCHAR *_pszTitle;
  53. DWORD _dwFlags;
  54. WORD _wShowWindow;
  55. HANDLE _hStdInput;
  56. HANDLE _hStdOutput;
  57. HANDLE _hStdError;
  58. static const WCHAR s_szDefaultDesktop[];
  59. };
  60. #endif /* _RestoreApplication_ */