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.

220 lines
9.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1998.
  5. //
  6. // File: Reg.h
  7. //
  8. // Contents: Registration routines
  9. //
  10. // Classes:
  11. //
  12. // Notes:
  13. //
  14. // History: 05-Nov-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _CONESTOPREGISTER_
  18. #define _CONESTOPREGISTER_
  19. #include "rasui.h" // included so exe can inlude dll.reg.
  20. #define GUID_SIZE 128
  21. #define MAX_STRING_LENGTH 256
  22. typedef
  23. enum _tagSYNCTYPE
  24. {
  25. SYNCTYPE_MANUAL = 0x1,
  26. SYNCTYPE_AUTOSYNC = 0x2,
  27. SYNCTYPE_IDLE = 0x3,
  28. SYNCTYPE_SCHEDULED = 0x4,
  29. SYNCTYPE_PROGRESS = 0x5
  30. } SYNCTYPE;
  31. EXTERN_C void WINAPI RunDllRegister(HWND hwnd,
  32. HINSTANCE hAppInstance,
  33. LPSTR pszCmdLine,
  34. int nCmdShow);
  35. #define UL_DEFAULTIDLEWAITMINUTES 15
  36. #define UL_DEFAULTIDLERETRYMINUTES 60
  37. #define UL_DELAYIDLESHUTDOWNTIME 2*1000 // time in milliseconds
  38. #define UL_DEFAULTWAITMINUTES 15
  39. #define UL_DEFAULTREPEATSYNCHRONIZATION 1
  40. #define UL_DEFAULTFRUNONBATTERIES 0
  41. typedef struct _CONNECTIONSETTINGS {
  42. TCHAR pszConnectionName[RAS_MaxEntryName + 1]; //The connection
  43. DWORD dwConnType;
  44. // DWORD dwSyncFlags;
  45. // For optimization: these are currently all BOOL,
  46. //the first three are used exclusively for autosync,
  47. //and dwMakeConnection is used exclusively for sched sync.
  48. //Consider using bitfields and/or a union to consolidate space.
  49. // AutoSync settings
  50. DWORD dwLogon; //Autosync at logon
  51. DWORD dwLogoff; //Autosync at logoff
  52. DWORD dwPromptMeFirst; //Prompt the user first before autosyncing
  53. // Schedule settings.
  54. DWORD dwMakeConnection; //Automatically try to establish the connection
  55. // Idle Settings
  56. DWORD dwIdleEnabled; // Idle is enabled on this connection
  57. // Idle Settings that are really not per connection but read in for
  58. // convenience. These are currently never written.
  59. ULONG ulIdleWaitMinutes; // number of minutes to wait after idle to start idle processing.
  60. ULONG ulIdleRetryMinutes; // number of minutes for Idle before retry.
  61. ULONG ulDelayIdleShutDownTime; // time to delay shutdown of idle in milliseconds
  62. DWORD dwRepeatSynchronization; // indicates synchronization should be repeated
  63. DWORD dwRunOnBatteries; // indicates whether to run on batteries or not.
  64. DWORD dwHidden; //Hide the schedule from the user because this is a publishers sched.
  65. DWORD dwReadOnly; //Schedule info is readonly
  66. } CONNECTIONSETTINGS;
  67. typedef CONNECTIONSETTINGS *LPCONNECTIONSETTINGS;
  68. STDAPI_(BOOL) AddRegNamedValue(HKEY hkey,LPTSTR pszKey,LPTSTR pszSubkey,LPTSTR pszValueName,LPTSTR pszValue);
  69. STDAPI_(BOOL) RegLookupSettings(HKEY hKeyUser,
  70. CLSID clsidHandler,
  71. SYNCMGRITEMID ItemID,
  72. const TCHAR *pszConnectionName,
  73. DWORD *pdwCheckState);
  74. STDAPI_(BOOL) RegWriteOutSettings(HKEY hKeyUser,
  75. CLSID clsidHandler,
  76. SYNCMGRITEMID ItemID,
  77. const TCHAR *pszConnectionName,
  78. DWORD dwCheckState);
  79. STDAPI_(BOOL) RegGetSyncItemSettings(DWORD dwSyncType,
  80. CLSID clsidHandler,
  81. SYNCMGRITEMID ItemId,
  82. const TCHAR *pszConnectionName,
  83. DWORD *pdwCheckState,
  84. DWORD dwDefaultCheckState,
  85. TCHAR *pszSchedName);
  86. STDAPI_(BOOL) RegSetSyncItemSettings(DWORD dwSyncType,
  87. CLSID clsidHandler,
  88. SYNCMGRITEMID ItemId,
  89. const TCHAR *pszConnectionName,
  90. DWORD dwCheckState,
  91. TCHAR *pszSchedName);
  92. STDAPI_(BOOL) RegSetSyncHandlerSettings(DWORD syncType,
  93. const TCHAR *pszConnectionName,
  94. CLSID clsidHandler,
  95. BOOL fItemsChecked);
  96. STDAPI_(BOOL) RegQueryLoadHandlerOnEvent(TCHAR *pszClsid,DWORD dwSyncFlags,
  97. TCHAR *pConnectionName);
  98. //Progress dialog preference
  99. STDAPI_(BOOL) RegGetProgressDetailsState(REFCLSID clsidDlg,BOOL *pfPushPin, BOOL *pfExpanded);
  100. STDAPI_(BOOL) RegSetProgressDetailsState(REFCLSID clsidDlg,BOOL fPushPin, BOOL fExpanded);
  101. //Autosync reg functions
  102. STDAPI_(BOOL) RegGetAutoSyncSettings(LPCONNECTIONSETTINGS lpConnectionSettings);
  103. STDAPI_(BOOL) RegSetAutoSyncSettings(LPCONNECTIONSETTINGS lpConnectionSettings,
  104. int iNumConnections,
  105. CRasUI *pRas,
  106. BOOL fCleanReg,
  107. BOOL fSetMachineState,
  108. BOOL fPerUser);
  109. // Idle reg functions
  110. STDAPI_(BOOL) RegGetIdleSyncSettings(LPCONNECTIONSETTINGS lpConnectionSettings);
  111. STDAPI_(BOOL) RegSetIdleSyncSettings(LPCONNECTIONSETTINGS lpConnectionSettings,
  112. int iNumConnections,
  113. CRasUI *pRas,
  114. BOOL fCleanReg,
  115. BOOL fPerUser);
  116. STDAPI_(BOOL) RegRegisterForIdleTrigger(BOOL fRegister,ULONG ulWaitMinutes,BOOL fRunOnBatteries);
  117. // function for exporting settings for exe
  118. STDAPI_(BOOL) RegGetSyncSettings(DWORD dwSyncType,LPCONNECTIONSETTINGS lpConnectionSettings);
  119. //Scheduled Sync reg functions
  120. STDAPI_(BOOL) RegSchedHandlerItemsChecked(TCHAR *pszHandlerName,
  121. TCHAR *pszConnectionName,
  122. TCHAR *pszScheduleName);
  123. STDAPI_(BOOL) RegGetSchedSyncSettings( LPCONNECTIONSETTINGS lpConnectionSettings,TCHAR *pszSchedName);
  124. STDAPI_(BOOL) RegSetSchedSyncSettings( LPCONNECTIONSETTINGS lpConnectionSettings,TCHAR *pszSchedName);
  125. STDAPI_(BOOL) RegGetSchedFriendlyName(LPCTSTR ptszScheduleGUIDName,
  126. LPTSTR ptstrFriendlyName,
  127. UINT cchFriendlyName);
  128. STDAPI_(BOOL) RegSetSchedFriendlyName(LPCTSTR ptszScheduleGUIDName,
  129. LPCTSTR ptstrFriendlyName);
  130. STDAPI_(BOOL) RegGetSchedConnectionName(TCHAR *pszSchedName,
  131. TCHAR *pszConnectionName,
  132. DWORD cbConnectionName);
  133. STDAPI_(BOOL) RegSetSIDForSchedule(TCHAR *pszSchedName);
  134. STDAPI_(BOOL) RegGetSIDForSchedule(TCHAR *ptszTextualSidSched,
  135. DWORD cchTextualSidSched,
  136. TCHAR *pszSchedName);
  137. STDAPI_(BOOL) RegRemoveScheduledTask(TCHAR *pszTaskName);
  138. STDAPI_(BOOL) RemoveScheduledJobFile(TCHAR *pszTaskName);
  139. STDAPI_(BOOL) RegRegisterForScheduledTasks(BOOL fScheduled);
  140. STDAPI_(BOOL) RegUninstallSchedules();
  141. STDAPI_(BOOL) RegFixRunKey();
  142. STDAPI_(DWORD) RegDeleteKeyNT(HKEY hStartKey , LPCWSTR pKeyName);
  143. // Manual settings
  144. STDAPI_(BOOL) RegRemoveManualSyncSettings(TCHAR *pszConnectionName);
  145. // Handler Registration Functions.
  146. STDAPI_(BOOL) RegRegisterHandler(REFCLSID rclsidHandler,
  147. WCHAR const *pwszDescription,
  148. DWORD dwSyncMgrRegisterFlags,
  149. BOOL *pfFirstRegistration);
  150. STDAPI_(BOOL) RegRegRemoveHandler(REFCLSID rclsidHandler);
  151. STDAPI_(BOOL) RegGetHandlerRegistrationInfo(REFCLSID rclsidHandler,LPDWORD pdwSyncMgrRegisterFlags);
  152. STDAPI_(void) RegSetUserDefaults();
  153. STDAPI_(void) RegSetAutoSyncDefaults(BOOL fLogon,BOOL fLogoff);
  154. STDAPI_(void) RegSetIdleSyncDefaults(BOOL fIdle);
  155. STDAPI RegSetUserAutoSyncDefaults(DWORD dwSyncMgrRegisterMask,
  156. DWORD dwSyncMgrRegisterFlags);
  157. STDAPI RegSetUserIdleSyncDefaults(DWORD dwSyncMgrRegisterMask,
  158. DWORD dwSyncMgrRegisterFlags);
  159. STDAPI RegGetUserRegisterFlags(LPDWORD pdwSyncMgrRegisterFlags);
  160. STDAPI_(BOOL) RegWriteTimeStamp(HKEY hkey);
  161. STDAPI_(BOOL) RegGetTimeStamp(HKEY hKey, FILETIME *pft);
  162. STDAPI_(void) RegUpdateTopLevelKeys();
  163. // common registry functions.
  164. STDAPI_(HKEY) RegOpenUserKey(HKEY hkeyParent,REGSAM samDesired,BOOL fCreate,BOOL fCleanReg);
  165. STDAPI_(HKEY) RegGetSyncTypeKey(DWORD dwSyncType,REGSAM samDesired,BOOL fCreate);
  166. STDAPI_(HKEY) RegGetCurrentUserKey(DWORD dwSyncType,REGSAM samDesired,BOOL fCreate);
  167. STDAPI_(HKEY) RegGetHandlerTopLevelKey(REGSAM samDesired);
  168. STDAPI_(HKEY) RegGetHandlerKey(HKEY hkeyParent,LPCWSTR pszHandlerClsid,REGSAM samDesired,BOOL fCreate);
  169. STDAPI RegRegisterForEvents(BOOL fUninstall);
  170. #endif // _CONESTOPREGISTER_