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.

65 lines
2.8 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: ReturnToWelcome.h
  3. //
  4. // Copyright (c) 2001, Microsoft Corporation
  5. //
  6. // File to handle return to welcome.
  7. //
  8. // History: 2001-01-11 vtan created
  9. // --------------------------------------------------------------------------
  10. #ifndef _ReturnToWelcome_
  11. #define _ReturnToWelcome_
  12. #include <ginaipc.h>
  13. // --------------------------------------------------------------------------
  14. // CReturnToWelcome
  15. //
  16. // Purpose: Class that handles return to welcome with switching desktops.
  17. //
  18. // History: 2001-01-11 vtan created
  19. // --------------------------------------------------------------------------
  20. class CReturnToWelcome
  21. {
  22. public:
  23. CReturnToWelcome (void);
  24. ~CReturnToWelcome (void);
  25. INT_PTR Show (bool fUnlock);
  26. static const WCHAR* GetEventName (void);
  27. static NTSTATUS StaticInitialize (void *pWlxContext);
  28. static NTSTATUS StaticTerminate (void);
  29. private:
  30. bool IsSameUser (PSID pSIDUser, HANDLE hToken) const;
  31. bool UserIsDisconnected (PSID pSIDUser, DWORD *pdwSessionID) const;
  32. void GetSessionUserName (DWORD dwSessionID, WCHAR *pszBuffer);
  33. void ShowReconnectFailure (DWORD dwSessionID);
  34. void EndDialog (HWND hwnd, INT_PTR iResult);
  35. void Handle_WM_INITDIALOG (HWND hwndDialog);
  36. void Handle_WM_DESTROY (void);
  37. bool Handle_WM_COMMAND (HWND hwndDialog, WPARAM wParam, LPARAM lParam);
  38. static INT_PTR CALLBACK CB_DialogProc (HWND hwndDialog, UINT uMsg, WPARAM wParam, LPARAM lParam);
  39. static NTSTATUS RegisterWaitForRequest (void);
  40. static void CALLBACK CB_Request (void *pParameter, BOOLEAN TimerOrWaitFired);
  41. private:
  42. HANDLE _hToken;
  43. LOGONIPC_CREDENTIALS* _pLogonIPCCredentials;
  44. bool _fUnlock;
  45. bool _fDialogEnded;
  46. static void* s_pWlxContext;
  47. static HANDLE s_hEventRequest;
  48. static HANDLE s_hEventShown;
  49. static HANDLE s_hWait;
  50. static const TCHAR s_szEventName[];
  51. static DWORD s_dwSessionID;
  52. };
  53. #endif /* _ReturnToWelcome_ */