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.

203 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. RACPLSettings.h
  5. Abstract:
  6. Author:
  7. Rajesh Soy 10/00
  8. Revision History:
  9. Rajesh Soy - created 10/26/2000
  10. --*/
  11. #include <regapi.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. //
  16. // Registry locations where the remote assistance control panel settings go
  17. //
  18. #define REG_KEY_REMOTEASSISTANCE REG_CONTROL_GETHELP
  19. //
  20. // Remote Assistance Mode
  21. //
  22. #define REG_VALUE_MODE POLICY_TS_REMDSK_ALLOWTOGETHELP
  23. #define REG_DWORD_RA_DISABLED 0 // No Help
  24. #define REG_DWORD_RA_NORC 1 // No Remote Control
  25. #define REG_DWORD_RA_SHADOWONLY 2 // View only
  26. #define REG_DWORD_RA_ENABLED 3 // Full control
  27. #define REG_DWORD_RA_DEFAULTMODE REG_DWORD_RA_ENABLED
  28. //
  29. // Allow Unsolicited Remote Assistance
  30. //
  31. #define REG_VALUE_UNSOLICITED _T("UnSolicited")
  32. #define REG_DWORD_RA_ALLOW 1
  33. #define REG_DWORD_RA_DISALLOW 0
  34. #define REG_DWORD_RA_UNSOLICITED_DEFAULT REG_DWORD_RA_DISALLOW
  35. //
  36. // Maximum Ticket Timeout
  37. //
  38. #define REG_VALUE_MAX_TICKET _T("TicketTimeout")
  39. #define REG_DWORD_RA_TIMEOUT_MIN 1
  40. #define REG_DWORD_RA_TIMEOUT_MAX (30 * 24 * REG_DWORD_RA_TIMEOUT_MIN)
  41. #define REG_DWORD_RA_DEFAULT_TIMEOUT REG_DWORD_RA_TIMEOUT_MIN
  42. #ifdef RACPLSETTINGS_EXPORTS
  43. #define RACPLSETTINGS_API __declspec(dllexport)
  44. #else
  45. #define RACPLSETTINGS_API __declspec(dllimport)
  46. #endif
  47. //
  48. // RACPLSettings: Current Remote Assistance Settings
  49. //
  50. typedef struct {
  51. //
  52. // Remote Assistance Mode
  53. //
  54. DWORD dwMode;
  55. //
  56. // Allow Unsolicited Remote Assistance
  57. //
  58. DWORD dwUnsolicited;
  59. //
  60. // Maximum Ticket Timeout
  61. //
  62. DWORD dwMaxTimeout;
  63. } RACPLSETTINGS, *PRACPLSETTINGS;
  64. //
  65. // CRACPLSettingsDialog: UI for changing the remote assistance settings
  66. //
  67. class CRACPLSettingsDialog: public CDialog
  68. {
  69. private:
  70. RACPLSETTINGS m_RACPLSettings; // The RA Settings
  71. public:
  72. //
  73. // Constructor
  74. //
  75. CRACPLSettingsDialog()
  76. {
  77. //
  78. // Nothing special
  79. //
  80. }
  81. //
  82. // Overrides
  83. //
  84. BOOL OnInitDialog();
  85. };
  86. //
  87. // CRACPLSettings: This class implements the registry access routines that
  88. // provide the functionality for setting and querying the Remote Access Settings
  89. //
  90. class CRACPLSettings
  91. {
  92. private:
  93. //
  94. // Registy Access Class
  95. //
  96. CRegKey *m_pcRegKey;
  97. //
  98. // Remote Assistance Control Panel Settings
  99. //
  100. RACPLSETTINGS m_RACPLSettings;
  101. public:
  102. //
  103. // Constructor
  104. //
  105. CRACPLSettings(void);
  106. //
  107. // Destructor
  108. //
  109. ~CRACPLSettings()
  110. {
  111. if( NULL != m_pcRegKey )
  112. {
  113. m_pcRegKey->Close();
  114. m_pcRegKey = NULL;
  115. }
  116. }
  117. //
  118. // Initializes the RACPLSettings API
  119. //
  120. DWORD OpenRACPLSettings();
  121. //
  122. // Closes the RACPLSettings
  123. //
  124. DWORD CloseRACPLSettings();
  125. //
  126. // Get the Remote Assistance Settings
  127. //
  128. DWORD GetRACPLSettings(
  129. PRACPLSETTINGS pRACPLSettings // pointer to RACPLSETTINGS
  130. );
  131. //
  132. // Set the Remote Assistance Settings
  133. //
  134. DWORD SetRACPLSettings(
  135. PRACPLSETTINGS pRACPLSettings // pointer to RACPLSETTINGS
  136. );
  137. };
  138. //
  139. // Functions exposed by the RACPLSettings API
  140. //
  141. RACPLSETTINGS_API DWORD OpenRACPLSettings(void);
  142. RACPLSETTINGS_API DWORD CloseRACPLSettings(void);
  143. RACPLSETTINGS_API DWORD GetRACPLSettings(PRACPLSETTINGS pRACPLSettings);
  144. RACPLSETTINGS_API DWORD SetRACPLSettings(PRACPLSETTINGS pRACPLSettings);
  145. //
  146. // Function pointers for RACPLSettings API
  147. //
  148. typedef DWORD (*pfnOpenRACPLSettings)(void);
  149. typedef DWORD (*pfnCloseRACPLSettings)(void);
  150. typedef DWORD (*pfnGetRACPLSettings)(PRACPLSETTINGS pRACPLSettings);
  151. typedef DWORD (*pfnSetRACPLSettings)(PRACPLSETTINGS pRACPLSettings);
  152. #ifdef __cplusplus
  153. }
  154. #endif