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.

87 lines
2.1 KiB

  1. class CLogonNotification : public CSimpleExternalIUnknown<ISensLogon>
  2. {
  3. public:
  4. CLogonNotification();
  5. ~CLogonNotification() { Cleanup(); }
  6. private:
  7. IEventSubscription * m_EventSubscriptions[2];
  8. IEventSystem *m_EventSystem;
  9. ITypeLib *m_TypeLib;
  10. ITypeInfo *m_TypeInfo;
  11. void Cleanup();
  12. public:
  13. HRESULT SetEnableState( bool fEnable );
  14. void DeRegisterNotification();
  15. HRESULT STDMETHODCALLTYPE GetIDsOfNames(
  16. REFIID riid,
  17. OLECHAR FAR* FAR* rgszNames,
  18. unsigned int cNames,
  19. LCID lcid,
  20. DISPID FAR*
  21. rgDispId );
  22. HRESULT STDMETHODCALLTYPE GetTypeInfo(
  23. unsigned int iTInfo,
  24. LCID lcid,
  25. ITypeInfo FAR* FAR* ppTInfo );
  26. HRESULT STDMETHODCALLTYPE GetTypeInfoCount(
  27. unsigned int FAR* pctinfo );
  28. HRESULT STDMETHODCALLTYPE Invoke(
  29. DISPID dispIdMember,
  30. REFIID riid,
  31. LCID lcid,
  32. WORD wFlags,
  33. DISPPARAMS FAR* pDispParams,
  34. VARIANT FAR* pVarResult,
  35. EXCEPINFO FAR* pExcepInfo,
  36. unsigned int FAR* puArgErr );
  37. HRESULT STDMETHODCALLTYPE DisplayLock( BSTR UserName );
  38. HRESULT STDMETHODCALLTYPE DisplayUnlock( BSTR UserName );
  39. HRESULT STDMETHODCALLTYPE StartScreenSaver( BSTR UserName );
  40. HRESULT STDMETHODCALLTYPE StopScreenSaver( BSTR UserName );
  41. HRESULT STDMETHODCALLTYPE Logon( BSTR UserName );
  42. HRESULT STDMETHODCALLTYPE Logoff( BSTR UserName );
  43. HRESULT STDMETHODCALLTYPE StartShell( BSTR UserName );
  44. };
  45. class CTerminalServerLogonNotification : public CLogonNotification
  46. {
  47. public:
  48. CTerminalServerLogonNotification();
  49. ~CTerminalServerLogonNotification();
  50. protected:
  51. void ConsoleUserCheck();
  52. HRESULT QueueConsoleUserCheck();
  53. static DWORD WINAPI
  54. UserCheckThreadProc(
  55. LPVOID arg
  56. );
  57. // true if we believe that a user is logged in at the console.
  58. //
  59. bool m_fConsoleUser;
  60. // number of queued calls to ConsoleUserCheck()
  61. //
  62. LONG m_PendingUserChecks;
  63. public:
  64. HRESULT STDMETHODCALLTYPE Logon( BSTR UserName );
  65. HRESULT STDMETHODCALLTYPE Logoff( BSTR UserName );
  66. };