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.

157 lines
3.8 KiB

  1. /*
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. */
  4. #ifndef __PTUTIL__
  5. #define __PTUTIL__
  6. ///////////////////////////////////////////
  7. // Constants
  8. //
  9. #define PTKEY_TERMINALS TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Terminal Manager")
  10. #define PTKEY_NAME TEXT("Name")
  11. #define PTKEY_COMPANY TEXT("Company")
  12. #define PTKEY_VERSION TEXT("Version")
  13. #define PTKEY_DIRECTIONS TEXT("Directions")
  14. #define PTKEY_MEDIATYPES TEXT("MediaTypes")
  15. #define PTKEY_CLSIDCREATE TEXT("CLSID")
  16. #define PTKEY_MAXSIZE 256
  17. ///////////////////////////////////////////
  18. // CPTUtil
  19. //
  20. class CPTTerminal;
  21. class CPTUtil
  22. {
  23. public:
  24. private:
  25. static HRESULT RecursiveDeleteKey(
  26. IN HKEY hKey,
  27. IN BSTR bstrKeyChild
  28. );
  29. static HRESULT ListTerminalSuperclasses(
  30. OUT CLSID** ppCLSIDs,
  31. OUT DWORD* pdwCount
  32. );
  33. static HRESULT SearchForTerminal(
  34. IN IID iidTerminal,
  35. IN DWORD dwMediaType,
  36. IN TERMINAL_DIRECTION Direction,
  37. OUT CPTTerminal* pTerminal
  38. );
  39. static HRESULT FindTerminal(
  40. IN CLSID clsidSuperclass,
  41. IN CLSID clsidTerminal,
  42. IN DWORD dwMediaType,
  43. IN TERMINAL_DIRECTION Direction,
  44. IN BOOL bExact,
  45. OUT CPTTerminal* pTerminal
  46. );
  47. static HRESULT ListTerminalClasses(
  48. IN DWORD dwMediaTypes,
  49. OUT CLSID** ppTerminalsClasses,
  50. OUT DWORD* pdwCount
  51. );
  52. friend class CPTSuperclass;
  53. friend class CPTTerminal;
  54. friend class CPTRegControl;
  55. friend class CTerminalManager;
  56. };
  57. ///////////////////////////////////////////
  58. // CPTTerminal
  59. //
  60. class CPTTerminal
  61. {
  62. public:
  63. // Constructor/destructor
  64. CPTTerminal();
  65. ~CPTTerminal();
  66. public:
  67. // Attributes
  68. BSTR m_bstrName; // Terminal name
  69. BSTR m_bstrCompany; // Company name
  70. BSTR m_bstrVersion; // Terminal version
  71. CLSID m_clsidTerminalClass; // Public terminal CLSID
  72. CLSID m_clsidCOM; // Terminal CLSID used by CoCreate
  73. DWORD m_dwDirections; // Terminal directions
  74. DWORD m_dwMediaTypes; // Media types supported
  75. public:
  76. // Methods
  77. HRESULT Add(
  78. IN CLSID clsidSuperclass
  79. );
  80. HRESULT Delete(
  81. IN CLSID clsidSuperclass
  82. );
  83. HRESULT Get(
  84. IN CLSID clsidSuperclass
  85. );
  86. CPTTerminal& operator=(const CPTTerminal& term)
  87. {
  88. m_dwDirections = term.m_dwDirections;
  89. m_dwMediaTypes = term.m_dwMediaTypes;
  90. m_bstrName = SysAllocString( term.m_bstrName);
  91. m_bstrCompany = SysAllocString( term.m_bstrCompany);
  92. m_bstrVersion = SysAllocString( term.m_bstrVersion);
  93. m_clsidTerminalClass = term.m_clsidTerminalClass;
  94. m_clsidCOM = term.m_clsidCOM;
  95. return *this;
  96. }
  97. };
  98. ///////////////////////////////////////////
  99. // CPTTerminalClass
  100. //
  101. class CPTSuperclass
  102. {
  103. public:
  104. // Constructor/Destructor
  105. CPTSuperclass();
  106. ~CPTSuperclass();
  107. public:
  108. // Attributes
  109. BSTR m_bstrName; // Terminal superclass name
  110. CLSID m_clsidSuperclass; // Teminal superclass CLSID
  111. public:
  112. // Methods
  113. HRESULT Add(); // Add/edit a terminal class
  114. HRESULT Delete(); // Delete a terminal class
  115. HRESULT Get(); // Get all the information
  116. // Lists all child terminals
  117. HRESULT ListTerminalClasses(
  118. IN DWORD dwMediaTypes,
  119. OUT CLSID** ppTerminals,
  120. OUT DWORD* pdwCount
  121. );
  122. };
  123. #endif
  124. // eof