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.

106 lines
3.4 KiB

  1. /****************************************************************************/
  2. // tssdsql.h
  3. //
  4. // Terminal Server Session Directory Interface SQL provider header.
  5. //
  6. // Copyright (C) 2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef __TSSDSQL_H
  9. #define __TSSDSQL_H
  10. #include <tchar.h>
  11. #include "tssd.h"
  12. #include "srvsetex.h"
  13. /****************************************************************************/
  14. // Defines
  15. /****************************************************************************/
  16. /****************************************************************************/
  17. // Types
  18. /****************************************************************************/
  19. // CTSSessionDirectory
  20. //
  21. // C++ class instantiation of ITSSessionDirectory.
  22. class CTSSessionDirectory : public ITSSessionDirectory , public IExtendServerSettings
  23. {
  24. long m_RefCount;
  25. BSTR m_DBConnectStr;
  26. BSTR m_DBPwdStr;
  27. BSTR m_DBUserStr;
  28. ADOConnection *m_pConnection;
  29. DWORD m_ServerID;
  30. DWORD m_ClusterID;
  31. WCHAR m_LocalServerAddress[64];
  32. WCHAR m_ClusterName[64];
  33. // Private data for UI menus
  34. // WCHAR m_szDisableEnable[ 64 ];
  35. BOOL m_fEnabled;
  36. // Private utility functions.
  37. HRESULT AddADOInputDWORDParam(DWORD, PWSTR, ADOCommand *, ADOParameters *);
  38. HRESULT AddADOInputStringParam(PWSTR, PWSTR, ADOCommand *,
  39. ADOParameters *, BOOL = TRUE);
  40. HRESULT CreateADOStoredProcCommand(PWSTR, ADOCommand **, ADOParameters **);
  41. HRESULT ExecServerOnline();
  42. HRESULT ExecServerOffline();
  43. HRESULT OpenConnection();
  44. public:
  45. CTSSessionDirectory();
  46. ~CTSSessionDirectory();
  47. // Standard COM methods
  48. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void **);
  49. ULONG STDMETHODCALLTYPE AddRef();
  50. ULONG STDMETHODCALLTYPE Release();
  51. // ITSSessionDirectory COM interface
  52. HRESULT STDMETHODCALLTYPE Initialize(LPWSTR, LPWSTR, LPWSTR, LPWSTR,
  53. DWORD, DWORD (*)());
  54. HRESULT STDMETHODCALLTYPE Update(LPWSTR, LPWSTR, LPWSTR, LPWSTR, DWORD);
  55. HRESULT STDMETHODCALLTYPE GetUserDisconnectedSessions(LPWSTR, LPWSTR,
  56. DWORD __RPC_FAR *, TSSD_DisconnectedSessionInfo __RPC_FAR
  57. [TSSD_MaxDisconnectedSessions]);
  58. HRESULT STDMETHODCALLTYPE NotifyCreateLocalSession(
  59. TSSD_CreateSessionInfo __RPC_FAR *);
  60. HRESULT STDMETHODCALLTYPE NotifyDestroyLocalSession(DWORD);
  61. HRESULT STDMETHODCALLTYPE NotifyDisconnectLocalSession(DWORD, FILETIME);
  62. HRESULT STDMETHODCALLTYPE NotifyReconnectLocalSession(
  63. TSSD_ReconnectSessionInfo __RPC_FAR *);
  64. HRESULT STDMETHODCALLTYPE NotifyReconnectPending(WCHAR *);
  65. HRESULT STDMETHODCALLTYPE Repopulate(DWORD, TSSD_RepopulateSessionInfo *);
  66. // IExtendServerSettings COM interface
  67. STDMETHOD( GetAttributeName )( /* out */ WCHAR * pwszAttribName );
  68. STDMETHOD( GetDisplayableValueName )( /* out */WCHAR * pwszAttribValueName );
  69. STDMETHOD( InvokeUI )( /* in */ HWND hParent , /* out */ PDWORD pdwStatus );
  70. STDMETHOD( GetMenuItems )( /* out */ int * pcbItems , /* out */ PMENUEXTENSION *pMex );
  71. STDMETHOD( ExecMenuCmd )( /* in */ UINT cmd , /* in */ HWND hParent , /* out */ PDWORD pdwStatus );
  72. STDMETHOD( OnHelp )( /* out */ int *piRet );
  73. BOOL IsSessionDirectoryEnabled( );
  74. DWORD SetSessionDirectoryState( BOOL );
  75. void ErrorMessage( HWND hwnd , UINT res , DWORD );
  76. public:
  77. LPTSTR m_pszOpaqueString;
  78. };
  79. #endif // __TSSDSQL_H