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.

449 lines
10 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxreg.h
  5. Abstract:
  6. This header defines all of the fax service
  7. registry data structures and access functions.
  8. Author:
  9. Wesley Witt (wesw) 9-June-1996
  10. Revision History:
  11. --*/
  12. #ifndef _FAXREG_
  13. #define _FAXREG_
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #include "..\faxroute\FaxRouteP.h"
  18. typedef struct _REG_DEVICE_PROVIDER {
  19. LPTSTR FriendlyName;
  20. LPTSTR ImageName;
  21. LPTSTR ProviderName;
  22. DWORD dwAPIVersion; // The FSPI API Version.
  23. LPTSTR lptstrGUID; // The GUID of the FSP, might be NULL.
  24. } REG_DEVICE_PROVIDER, *PREG_DEVICE_PROVIDER;
  25. typedef struct _REG_ROUTING_METHOD {
  26. LPTSTR FriendlyName;
  27. LPTSTR FunctionName;
  28. LPTSTR Guid;
  29. LPTSTR InternalName;
  30. DWORD Priority;
  31. } REG_ROUTING_METHOD, *PREG_ROUTING_METHOD;
  32. typedef struct _REG_ROUTING_EXTENSION {
  33. LPTSTR FriendlyName;
  34. LPTSTR ImageName;
  35. LPTSTR InternalName;
  36. DWORD RoutingMethodsCount;
  37. PREG_ROUTING_METHOD RoutingMethods;
  38. } REG_ROUTING_EXTENSION, *PREG_ROUTING_EXTENSION;
  39. typedef struct _REG_DEVICE {
  40. DWORD TapiPermanentLineID; // The TAPI permanent line id for TAPI Lines.
  41. // For legacy virtual lines this is the same as PermanentLineId.
  42. LPTSTR Name;
  43. DWORD Flags;
  44. DWORD Rings;
  45. LPTSTR Csid;
  46. LPTSTR Tsid;
  47. LPTSTR lptstrDeviceName; // Device name
  48. LPTSTR lptstrDescription; // Device free-text description
  49. BOOL DeviceInstalled; // this is not stored, but is used to validate currently
  50. // installed tapi devices with the devices in the registry
  51. BOOL bValidDevice; // this indicates that the registry entries are created by FAXSVC
  52. // (and not by some FSP that writes to the registry directly)
  53. DWORD PermanentLineId; // The Fax Service generated permanent line id for the device (virtual or TAPI).
  54. // This is NOT the TAPI permanent id.
  55. LPTSTR lptstrProviderGuid; // The GUID of the FSP for this line, might be NULL.
  56. DWORDLONG dwlLastDetected; // FILETIME when this device was last detected
  57. } REG_DEVICE, *PREG_DEVICE;
  58. typedef struct _REG_CATEGORY {
  59. LPTSTR CategoryName;
  60. DWORD Number;
  61. DWORD Level;
  62. } REG_CATEGORY, *PREG_CATEGORY;
  63. typedef struct _REG_SETUP {
  64. LPTSTR Csid;
  65. LPTSTR Tsid;
  66. LPTSTR lptstrDescription;
  67. DWORD Rings;
  68. DWORD Flags;
  69. } REG_SETUP, *PREG_SETUP;
  70. typedef struct _REG_FAX_SERVICE {
  71. DWORD Retries;
  72. DWORD RetryDelay;
  73. DWORD DirtyDays;
  74. BOOL NextJobNumber;
  75. BOOL Branding;
  76. BOOL UseDeviceTsid;
  77. BOOL ServerCp;
  78. FAX_TIME StartCheapTime;
  79. FAX_TIME StopCheapTime;
  80. PREG_DEVICE_PROVIDER DeviceProviders;
  81. DWORD DeviceProviderCount;
  82. PREG_ROUTING_EXTENSION RoutingExtensions;
  83. DWORD RoutingExtensionsCount;
  84. PREG_DEVICE Devices;
  85. DWORD DeviceCount;
  86. PREG_CATEGORY Logging;
  87. DWORD LoggingCount;
  88. DWORD dwLastUniqueLineId;
  89. DWORD dwQueueState;
  90. DWORDLONG dwlMissingDeviceRegistryLifetime;
  91. DWORD dwMaxLineCloseTime;
  92. LPTSTR lptstrQueueDir;
  93. DWORD dwRecipientsLimit;
  94. DWORD dwAllowRemote;
  95. } REG_FAX_SERVICE, *PREG_FAX_SERVICE;
  96. typedef struct _REG_FAX_DEVICES {
  97. DWORD DeviceCount;
  98. PREG_DEVICE Devices;
  99. } REG_FAX_DEVICES, *PREG_FAX_DEVICES;
  100. typedef struct _REG_FAX_LOGGING {
  101. DWORD LoggingCount;
  102. PREG_CATEGORY Logging;
  103. } REG_FAX_LOGGING, *PREG_FAX_LOGGING;
  104. typedef enum
  105. {
  106. FAX_NO_DATA,
  107. FAX_DATA_ENCRYPTED,
  108. FAX_DATA_NOT_ENCRYPTED,
  109. } FAX_ENUM_DATA_ENCRYPTION;
  110. //
  111. // function prototypes
  112. //
  113. DWORD
  114. GetFaxRegistry(
  115. PREG_FAX_SERVICE *ppFaxReg
  116. );
  117. VOID
  118. FreeFaxRegistry(
  119. PREG_FAX_SERVICE FaxReg
  120. );
  121. BOOL
  122. CreateFaxEventSource(
  123. PREG_FAX_SERVICE FaxReg,
  124. PFAX_LOG_CATEGORY DefaultCategories,
  125. int DefaultCategoryCount
  126. );
  127. PREG_FAX_DEVICES
  128. GetFaxDevicesRegistry(
  129. VOID
  130. );
  131. BOOL
  132. SetFaxRoutingInfo(
  133. LPTSTR ExtensionName,
  134. LPTSTR MethodName,
  135. LPTSTR Guid,
  136. DWORD Priority,
  137. LPTSTR FunctionName,
  138. LPTSTR FriendlyName
  139. ) ;
  140. VOID
  141. FreeFaxDevicesRegistry(
  142. PREG_FAX_DEVICES FaxReg
  143. );
  144. DWORD
  145. RegSetFaxDeviceFlags(
  146. DWORD PermanentLineID,
  147. DWORD Flags
  148. );
  149. BOOL
  150. DeleteFaxDevice(
  151. DWORD PermanentLineID,
  152. DWORD PermanentTapiID
  153. );
  154. BOOL
  155. UpdateLastDetectedTime(
  156. DWORD PermanentLineID,
  157. DWORDLONG TimeNow
  158. );
  159. BOOL
  160. GetInstallationInfo(
  161. LPDWORD Installed,
  162. LPDWORD InstallType,
  163. LPDWORD InstalledPlatforms,
  164. LPDWORD ProductType
  165. );
  166. BOOL
  167. IsModemClass1(
  168. LPSTR SubKey,
  169. LPBOOL Class1Fax
  170. );
  171. BOOL
  172. SaveModemClass(
  173. LPSTR SubKey,
  174. BOOL Class1Fax
  175. );
  176. DWORD
  177. RegAddNewFaxDevice(
  178. LPDWORD lpdwLastUniqueLineId,
  179. LPDWORD lpdwPermanentLineId,
  180. LPTSTR DeviceName,
  181. LPTSTR ProviderName,
  182. LPTSTR ProviderGuid,
  183. LPTSTR Csid,
  184. LPTSTR Tsid,
  185. DWORD TapiPermanentLineID,
  186. DWORD Flags,
  187. DWORD Rings
  188. );
  189. BOOL
  190. GetOrigSetupData(
  191. IN DWORD dwPermanentLineId,
  192. OUT PREG_SETUP RegSetup
  193. );
  194. VOID
  195. FreeOrigSetupData(
  196. PREG_SETUP RegSetup
  197. );
  198. BOOL
  199. SetFaxGlobalsRegistry(
  200. PFAX_CONFIGURATION FaxConfig,
  201. DWORD dwQueueState
  202. );
  203. BOOL
  204. GetLoggingCategoriesRegistry(
  205. PREG_FAX_LOGGING FaxRegLogging
  206. );
  207. BOOL
  208. SetLoggingCategoriesRegistry(
  209. PREG_FAX_LOGGING FaxRegLogging
  210. );
  211. BOOL
  212. SetFaxJobNumberRegistry(
  213. DWORD NextJobNumber
  214. );
  215. DWORD
  216. SaveQueueState (DWORD dwNewState);
  217. DWORD
  218. StoreReceiptsSettings (CONST PFAX_RECEIPTS_CONFIG);
  219. DWORD
  220. LoadReceiptsSettings (PFAX_SERVER_RECEIPTS_CONFIGW);
  221. DWORD
  222. StoreOutboxSettings (PFAX_OUTBOX_CONFIG);
  223. DWORD
  224. LoadArchiveSettings (FAX_ENUM_MESSAGE_FOLDER, PFAX_ARCHIVE_CONFIG);
  225. DWORD
  226. StoreArchiveSettings (FAX_ENUM_MESSAGE_FOLDER, PFAX_ARCHIVE_CONFIG);
  227. DWORD
  228. LoadActivityLoggingSettings (PFAX_SERVER_ACTIVITY_LOGGING_CONFIG);
  229. DWORD
  230. StoreActivityLoggingSettings (PFAX_ACTIVITY_LOGGING_CONFIG);
  231. DWORD
  232. StoreDeviceConfig (DWORD dwDeviceId, PFAX_PORT_INFO_EX, BOOL bVirtualDevice);
  233. DWORD
  234. ReadExtensionData (
  235. DWORD dwDeviceId,
  236. FAX_ENUM_DEVICE_ID_SOURCE DevIdSrc,
  237. LPCWSTR lpcwstrNameGUID,
  238. LPBYTE *ppData,
  239. LPDWORD lpdwDataSize
  240. );
  241. DWORD
  242. WriteExtensionData (
  243. DWORD dwDeviceId,
  244. FAX_ENUM_DEVICE_ID_SOURCE DevIdSrc,
  245. LPCWSTR lpcwstrNameGUID,
  246. LPBYTE pData,
  247. DWORD dwDataSize
  248. );
  249. HKEY
  250. OpenOutboundGroupKey (LPCWSTR lpcwstrGroupName, BOOL fNewKey, REGSAM SamDesired);
  251. HKEY
  252. OpenOutboundRuleKey (
  253. DWORD dwCountryCode,
  254. DWORD dwAreaCode,
  255. BOOL fNewKey,
  256. REGSAM SamDesired
  257. );
  258. DWORD DeleteOutboundRuleKey (DWORD dwCountryCode, DWORD dwAreaCode);
  259. DWORD
  260. AddNewProviderToRegistry (
  261. LPCWSTR lpcwstrGUID,
  262. LPCWSTR lpctstrFriendlyName,
  263. LPCWSTR lpctstrImageName,
  264. LPCWSTR lpctstrTspName,
  265. DWORD dwFSPIVersion
  266. );
  267. BOOL
  268. SetRegistrySecureString (
  269. HKEY hKey,
  270. LPCTSTR lpctstrValueName,
  271. LPCTSTR lpctstrValue,
  272. BOOL bOptionallyNonSecure
  273. );
  274. DWORD
  275. RemoveProviderFromRegistry (
  276. LPCWSTR lpctstrGUID
  277. );
  278. DWORD
  279. WriteManualAnswerDeviceId (
  280. DWORD dwDeviceId
  281. );
  282. DWORD
  283. ReadManualAnswerDeviceId (
  284. LPDWORD lpdwDeviceId
  285. );
  286. DWORD
  287. FindServiceDeviceByTapiPermanentLineID(
  288. DWORD dwTapiPermanentLineID,
  289. LPCTSTR strDeviceName,
  290. PREG_SETUP pRegSetup,
  291. const PREG_FAX_DEVICES pInputFaxReg
  292. );
  293. DWORD
  294. FindCacheEntryByTapiPermanentLineID(
  295. DWORD dwTapiPermanentLineID,
  296. LPCTSTR strDeviceName,
  297. const PREG_SETUP pRegSetup,
  298. LPDWORD lpdwLastUniqueLineId,
  299. BOOL* pfManualAnswer
  300. );
  301. DWORD
  302. GetNewServiceDeviceID(
  303. LPDWORD lpdwLastUniqueLineId,
  304. LPDWORD lpdwPermanentLineId
  305. );
  306. DWORD
  307. MoveDeviceRegIntoDeviceCache (
  308. DWORD dwServerPermanentID,
  309. DWORD dwTapiPermanentLineID,
  310. BOOL fManualAnswer
  311. );
  312. DWORD
  313. RestoreDeviceRegFromDeviceCache (
  314. DWORD dwServerPermanentID,
  315. DWORD dwTapiPermanentLineID
  316. );
  317. DWORD
  318. CleanOldDevicesFromDeviceCache (
  319. DWORDLONG dwlTimeNow
  320. );
  321. DWORD
  322. DeleteDeviceEntry(
  323. DWORD dwServerPermanentID
  324. );
  325. DWORD
  326. DeleteTapiEntry(
  327. DWORD dwTapiPermanentLineID
  328. );
  329. DWORD
  330. DeleteCacheEntry(
  331. DWORD dwTapiPermanentLineID
  332. );
  333. LPTSTR
  334. GetRegistrySecureString(
  335. HKEY hKey,
  336. LPCTSTR lpctstrValueName,
  337. LPCTSTR lpctstrDefaultValue,
  338. BOOL bOptionallyNonSecure,
  339. FAX_ENUM_DATA_ENCRYPTION* pDataEncrypted
  340. );
  341. #ifdef __cplusplus
  342. } //extern "C"
  343. #endif
  344. #endif