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.

1021 lines
36 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation.
  3. Component
  4. Unimodem TSP Public Header
  5. File
  6. UNIMODEM.H
  7. History
  8. 10/25/1997 JosephJ Created, taking stuff from nt50\tsp\public.h
  9. 01/29/1998 JosephJ Revised, allowing multiple diagnostics objects,
  10. as well as expanding the LINEDIAGNOSTICS_PARSEREC
  11. structure from 2 to 4 fields.
  12. --*/
  13. #ifndef _UNIMODEM_H_
  14. #define _UNIMODEM_H_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include <setupapi.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. //====================================================================
  23. // Supported TAPI Device Classes
  24. //
  25. //====================================================================
  26. #define szUMDEVCLASS_COMM TEXT("comm")
  27. #define szUMDEVCLASS_COMM_DATAMODEM TEXT("comm/datamodem")
  28. #define szUMDEVCLASS_COMM_DATAMODEM_PORTNAME TEXT("comm/datamodem/portname")
  29. #define szUMDEVCLASS_TAPI_LINE_DIAGNOSTICS TEXT("tapi/line/diagnostics")
  30. //=========================================================================
  31. //
  32. // "comm"
  33. //
  34. //
  35. // Supported APIS:
  36. // lineGet/SetDevConfig
  37. // lineConfigDialog
  38. // lineConfigDialogEdit
  39. //
  40. // The associated configuration object is UMDEVCFG defined below...
  41. //
  42. //=========================================================================
  43. // Device Setting Information
  44. //
  45. typedef struct // UMDEVCFGHDR
  46. {
  47. DWORD dwSize;
  48. DWORD dwVersion; // Set to MDMCFG_VERSION
  49. WORD fwOptions; // One or more of the flags below...
  50. #define UMTERMINAL_NONE 0x00000000
  51. #define UMTERMINAL_PRE 0x00000001
  52. #define UMTERMINAL_POST 0x00000002
  53. #define UMMANUAL_DIAL 0x00000004
  54. #define UMLAUNCH_LIGHTS 0x00000008 // Not supported on NT5.
  55. WORD wWaitBong; // seconds to wait for the BONG character
  56. // for modems that do not support detection
  57. // of the BONG tone.
  58. } UMDEVCFGHDR, *PUMDEVCFGHDR;
  59. typedef struct // UMDEVCFG
  60. {
  61. UMDEVCFGHDR dfgHdr;
  62. COMMCONFIG commconfig;
  63. } UMDEVCFG, *PUMDEVCFG;
  64. #define UMDEVCFG_VERSION 0x00010003 // Version number of structure
  65. // How much to wait for a credit-card-bong if modem doesn't support it.
  66. // (TODO: move this somewhere else!)
  67. //
  68. #define UMMIN_WAIT_BONG 0
  69. #define UMMAX_WAIT_BONG 60
  70. #define UMDEF_WAIT_BONG 8
  71. #define UMINC_WAIT_BONG 2
  72. //=========================================================================
  73. //
  74. // "comm/datamodem"
  75. //
  76. // Supported APIS:
  77. // lineGetID Returns the structure below.
  78. //
  79. //=========================================================================
  80. //=========================================================================
  81. //
  82. // "comm/datamodem/portname"
  83. //
  84. // Supported APIS:
  85. // lineGetID The Varstring is of type ASCII string and
  86. // contains the null-terminated name of the COMM port
  87. // attached to the device, if there is one.
  88. //
  89. //=========================================================================
  90. //=========================================================================
  91. //
  92. // "tapi/line/diagnostics"
  93. //
  94. // Supported APIS:
  95. // lineGet/SetDevConfig: LINEDIAGNOSTICSCONFIG is the associated
  96. // configuration object...
  97. // lineGetID: LINEDIAGNOSTICS is the returned object.
  98. //
  99. //
  100. //=========================================================================
  101. //
  102. // Many of the diagnostics-related structures and sub-structures defined
  103. // below have a 4-DWORD header defined below:
  104. //
  105. //
  106. typedef struct // LINEDIAGNOSTICSOBJECTHEADER
  107. {
  108. DWORD dwSig; // object-specific signature. All
  109. // signatures defined here have
  110. // prefix "LDSIG_", and are defined below:
  111. #define LDSIG_LINEDIAGNOSTICSCONFIG 0xb2f78d82 // LINEDIAGNOSTICSCONFIG sig
  112. #define LDSIG_LINEDIAGNOSTICS 0xf0c4d4e0 // LINEDIAGNOSTICS sig
  113. #define LDSIG_RAWDIAGNOSTICS 0xf78b949b // see LINEDIAGNOSTICS defn.
  114. #define LDSIG_PARSEDDIAGNOSTICS 0x16cf3208 // see LINEDIAGNOSTICS defn.
  115. DWORD dwNextObjectOffset; // Offset from the start of this header to
  116. // the next object if any (0 if none following).
  117. // Depending on the type of object, this
  118. // field may or may not be used.
  119. DWORD dwTotalSize; // Total size of this object
  120. DWORD dwFlags; // object-specific flags
  121. DWORD dwParam; // object-specific data
  122. } LINEDIAGNOSTICSOBJECTHEADER, *PLINEDIAGNOSTICSOBJECTHEADER;
  123. //
  124. // The following structure defines the diagnostics capabilities and
  125. // curent settings of the device. It is accessed via
  126. // lineGet/SetDevConfig("tapi/line/diagnostics");
  127. //
  128. typedef struct // LINEDIAGNOSTICSCONFIG
  129. {
  130. LINEDIAGNOSTICSOBJECTHEADER hdr;
  131. //
  132. // hdr.dwSig must be set to LDSIG_LINEDIAGNOSTICSCONFIG
  133. // hdr.dwNextObjectOffset will point to the next configuration object,
  134. // if any.
  135. // hdr.dwTotalSize must be set to the current size of this
  136. // structure.
  137. // hdr.dwFlags contains read only diagnostics capabilities --- one
  138. // of the constants defined below ...
  139. // This field is ignored when the structure is passed
  140. // in a call to lineSetDevConfig
  141. //
  142. #define fSTANDARD_CALL_DIAGNOSTICS 0x1
  143. // hdr.dwParam contains current diagnostics settings. One or more
  144. // constants defined above -- indicate that the
  145. // corresponding capability is enabled for
  146. // the device.
  147. } LINEDIAGNOSTICSCONFIG, *PLINEDIAGNOSTICSCONFIG;
  148. //
  149. // Diagnostic information is accessed by lineGetID("tapi/line/diagnostics"),
  150. // with CALLSELECT_CALL. On return, the supplied VARSTRING will be filled
  151. // in with one or more LINEDIAGNOSTICS structures defined below, and.
  152. // potentially other kinds of structures (all with header
  153. // LINEDIAGNOSTICSOBJECTHEADER).
  154. //
  155. // Note that this information can only be obtained if (a) diagnostics
  156. // have been enabled by a previous call to
  157. // lineSetDevConfig("tapi/line/diagnostics) and (b) a valid call handle
  158. // exists. Typically this information is obtained just before
  159. // deallocating the call.
  160. //
  161. // The LINEDIAGNOSTICS structure includes the raw
  162. // diagnostics information returned by the device as well as summary
  163. // information and variable-length arrays containing parsed information.
  164. //
  165. // All the diagnostic information in a particular LINEDIAGNOSTICS object
  166. // is "domain ID" specific. The dwDomainID field of the structure defines the
  167. // domain, or name space, from which any constants are taken. The
  168. // currently Domain IDs are defined below, and have prefix "DOMAINID":
  169. //
  170. #define DOMAINID_MODEM 0x522aa7e1
  171. #define DOMAINID_NULL 0x0
  172. typedef struct // LINEDIAGNOSTICS
  173. {
  174. //
  175. // The following 2 fields provide version and size informatio about
  176. // this structure, as well as identify the domain (name space) of the
  177. // diagnostics information applies to. All subsequent fields in the
  178. // structure are domainID-specific.
  179. //
  180. LINEDIAGNOSTICSOBJECTHEADER hdr;
  181. //
  182. // hdr.dwSig must be set to constant LDSIG_LINEDIAGNOSTICS
  183. // hdr.dwNextObjectOffset will point to the next diagnostic object,
  184. // if any.
  185. // hdr.dwTotalSize contains the total size of this structure,
  186. // including variable portion
  187. // hdr.dwFlags is reserved and must be ignored.
  188. // hdr.dwParam is set to the current sizeof(LINEDIAGNOSTICS) --
  189. // used for versioning of the LINEDIAGNOSICS structure.
  190. // Note that this does NOT include the size of the
  191. // variable length portion.
  192. DWORD dwDomainID; // Identifies the name space from which the
  193. // interpretation of any constants are taken.
  194. //
  195. // The following 5 DWORD fields provide summary diagnostic information,
  196. // obtained by analyzing all the diagnostic information.
  197. //
  198. DWORD dwResultCode; // dDomainID-specific LDRC_ constants defined below
  199. DWORD dwParam1; // Params1-4 are dwResultCode-specific data items.
  200. DWORD dwParam2;
  201. DWORD dwParam3;
  202. DWORD dwParam4;
  203. //
  204. // The remaining fields point to variable length objects containing
  205. // parsed and unparsed (raw) diagnostics information.
  206. //
  207. // Each variable length object starts with a
  208. // LINEDIAGNOSTICSOBJECTHEADER structure, referred to as "ohdr" in
  209. // the documentation below.
  210. //
  211. DWORD dwRawDiagnosticsOffset;
  212. //
  213. // Offset from the start of this structure
  214. // to the start of an object containing
  215. // the raw diagnostics output.
  216. //
  217. // ohdr.dwSig will be set to LDSIG_RAWDIAGNOSTICS
  218. // ohdr.dwNextObjectOffset UNUSED and will be set to 0.
  219. // ohdr.dwTotalSize is set to the total size of the
  220. // raw-diagnostics object.
  221. // ohdr.dwFlags is undefined and should be ignored.
  222. // ohdr.dwParam is set to the size, in bytes of raw
  223. // diagnostics data following ohdr.
  224. //
  225. // Note that ohdr.dwTotalSize will be equal to
  226. // ( sizeof(LINEDIAGNOSTICSOBJECTHEADER)
  227. // + ohdr.dwParam)
  228. //
  229. // The raw diagnostics bytes will be null terminated and
  230. // the ohdr.dwParam includes the size of the terminating null.
  231. // HOWEVER, the raw diagnostics may contain embedded nulls.
  232. // For DEVCLASSID_MODEM, the bytestring will contain
  233. // no embedded nulls and has the HTML-like tagged format
  234. // defined in the AT#UD diagnostics specification.
  235. //
  236. // The following macros help extract and validate raw diagnostics
  237. // information...
  238. //
  239. #define RAWDIAGNOSTICS_HDR(_plinediagnostics) \
  240. ((LINEDIAGNOSTICSOBJECTHEADER*) \
  241. ( (BYTE*)(_plinediagnostics) \
  242. + ((_plinediagnostics)->dwRawDiagnosticsOffset)))
  243. #define IS_VALID_RAWDIAGNOSTICS_HDR(_praw_diagnostics_hdr) \
  244. ((_praw_diagnostics_hdr)->dwSig==LDSIG_RAWDIAGNOSTICS)
  245. #define RAWDIAGNOSTICS_DATA(_plinediagnostics) \
  246. ( (BYTE*)(_plinediagnostics) \
  247. + ((_plinediagnostics)->dwRawDiagnosticsOffset) \
  248. + sizeof(LINEDIAGNOSTICSOBJECTHEADER))
  249. #define RAWDIAGNOSTICS_DATA_SIZE(_praw_diagnostics_hdr) \
  250. ((_praw_diagnostics_hdr)->dwParam)
  251. DWORD dwParsedDiagnosticsOffset;
  252. //
  253. // Offset from the start of this structure
  254. // to the start of an object containing
  255. // parsed diagnostics output.
  256. //
  257. // ohdr.dwSig will be set to LDSIG_PARSEDDIAGNOSTICS
  258. // ohdr.dwNextObjectOffset UNUSED and will be set to 0.
  259. // ohdr.dwTotalSize is set to the total size of the
  260. // parsed-diagnostics object.
  261. // ohdr.dwFlags is undefined and should be ignored.
  262. // ohdr.dwParam is set to the number of contiguous
  263. // LINEDIAGNOSTICS_PARSEREC structures (defined below)
  264. // following ohdr.
  265. // Note that ohdr.dwTotalSize will be equal to
  266. // ( sizeof(LINEDIAGNOSTICSOBJECTHEADER)
  267. // + ohdr.dwParam*sizeof(LINEDIAGNOSTICS_PARSEREC))
  268. //
  269. // The following macros help extract and validate parsed diagnostics
  270. // information...
  271. //
  272. #define PARSEDDIAGNOSTICS_HDR(_plinediagnostics) \
  273. ((LINEDIAGNOSTICSOBJECTHEADER*) \
  274. ( (BYTE*)(_plinediagnostics) \
  275. + ((_plinediagnostics)->dwParsedDiagnosticsOffset)))
  276. #define PARSEDDIAGNOSTICS_DATA(_plinediagnostics) \
  277. ((LINEDIAGNOSTICS_PARSEREC*) \
  278. ( (BYTE*)(_plinediagnostics) \
  279. + ((_plinediagnostics)->dwParsedDiagnosticsOffset)\
  280. + sizeof(LINEDIAGNOSTICSOBJECTHEADER)))
  281. #define PARSEDDIAGNOSTICS_NUM_ITEMS(_pparsed_diagnostics_hdr) \
  282. ((_pparsed_diagnostics_hdr)->dwParam)
  283. #define IS_VALID_PARSEDDIAGNOSTICS_HDR(_pparsed_diagnostics_hdr) \
  284. ((_pparsed_diagnostics_hdr)->dwSig==LDSIG_PARSEDDIAGNOSTICS)
  285. } LINEDIAGNOSTICS, *PLINEDIAGNOSTICS;
  286. //
  287. // The following structure defines a keyword-value pair of parsed-diagnostic
  288. // information.
  289. //
  290. typedef struct // LINEDIAGNOSTICS_PARSEREC
  291. {
  292. DWORD dwKeyType;
  293. //
  294. // "Super key" -- identifying the type of key
  295. //
  296. DWORD dwKey;
  297. //
  298. // This is domain-specific and key-type specific. For DEVCLASSID_MODEM,
  299. // This will be one of the MODEMDIAGKEY_* constants
  300. // defined below.
  301. DWORD dwFlags;
  302. //
  303. // Help to identify the meaning of dwValue
  304. // One or more of the following flags:
  305. // (1st 4 are mutually exclusive)
  306. //
  307. #define fPARSEKEYVALUE_INTEGER (0x1<<0)
  308. // value is an integer literal
  309. #define fPARSEKEYVALUE_LINEDIAGNOSTICSOBJECT (0x1<<1)
  310. // value is the offset in bytes to a LINEDIGAGNOSTICS
  311. // object which contains the information associated
  312. // with this entry. The byte offset is from the start
  313. // of the object containing the parsed information,
  314. // not from start of the containing LINEDIAGNOSTICS object.
  315. #define fPARSEKEYVALUE_ASCIIZ_STRING (0x1<<2)
  316. // value is the offset in bytes to an ASCII
  317. // null-terminated string. The byte offset is from the
  318. // start of the object containing the parsed information,
  319. // not from start of the containing LINEDIAGNOSTICS object.
  320. #define fPARSEKEYVALUE_UNICODEZ_STRING (0x1<<3)
  321. // value is the offset in bytes to a UNICODE
  322. // null-terminated string. The byte offset is from the
  323. // start of the object containing the parsed information,
  324. // not from start of the containing LINEDIAGNOSTICS object.
  325. DWORD dwValue;
  326. //
  327. // This is dwKey specific. The documentation
  328. // associated with each MODEMDIAGKEY_* constant definition
  329. // precicely describes the content of its corresponding dwValue.
  330. // See also dwFlags above.
  331. //
  332. } LINEDIAGNOSTICS_PARSEREC, *PLINEDIAGNOSTICS_PARSEREC;
  333. // -----------------------------------------------------------------------------
  334. // ANALOG MODEM SUMMARY DIAGNOSIC INFORMATION
  335. // -----------------------------------------------------------------------------
  336. //
  337. // Diagnostics Result Codes (LDRC_*) for modems
  338. //
  339. #define LDRC_UNKNOWN 0
  340. // The result code is unknown. Raw diagnostics information may be present,
  341. // if so dwRawDiagnosticsOffset and dwRawDiagnosticsSize will be nonzero.
  342. // dwParam1-4: unused and will be set to zero.
  343. // Other codes are TBD.
  344. // -----------------------------------------------------------------------------
  345. // LINEDIAGNOSTICS_PARSEREC KeyType,
  346. // key and value definitions for domainID DOMAINID_MODEM
  347. // -----------------------------------------------------------------------------
  348. //
  349. // KEYTYPE
  350. //
  351. #define MODEM_KEYTYPE_STANDARD_DIAGNOSTICS 0x2a4d3263
  352. // All the modem-domain-id key constants have prefix "MODEMDIAGKEY_". Both
  353. // keys and values are based on the AT#UD diagnostic specification.
  354. //
  355. // Most of the values corresponding to the keys defined below are DWORD-sized
  356. // bitfields or counters. A few of the values are offsets (from the start
  357. // of the LINEDIAGNOSTICS structure) to variable-sized values. The formats
  358. // of all values are documented directly after the corresponding key definition,
  359. // and have prefix "MODEMDIAG_". Where useful, macros are provided which
  360. // extract individual bits or bitfields out of the dwValue field. For example,
  361. // see the macros associated with the MODEMDIAGKEY_V34_INFO key, which contains
  362. // information extracted from the V.34 INFO structure.
  363. #define MODEMDIAGKEY_VERSION 0x0
  364. // Value: DWORD. HiWord represents major version;
  365. // LoWord represents minor version;
  366. // Following Macros may be used to extract the hi- and low- version numbers.
  367. // from the parserec's .dwValue field...
  368. //
  369. #define MODEMDIAG_MAJORVER(_ver) ((HIWORD) (_ver))
  370. #define MODEMDIAG_MINORVER(_ver) ((LOWORD) (_ver))
  371. #define MODEMDIAGKEY_CALL_SETUP_RESULT 0x1
  372. // Value: Call Setup Result codes based on on Table 2 of the
  373. // AT#UD specification....
  374. #define MODEMDIAG_CALLSETUPCODE_NO_PREVIOUS_CALL 0x0
  375. //
  376. // Modem log has be en cleared since any previous calls...
  377. //
  378. #define MODEMDIAG_CALLSETUPCODE_NO_DIAL_TONE 0x1
  379. //
  380. // No dial tone detected.
  381. //
  382. #define MODEMDIAG_CALLSETUPCODE_REORDER_SIGNAL 0x2
  383. //
  384. // Reorder signal detected, network busy.
  385. //
  386. #define MODEMDIAG_CALLSETUPCODE_BUSY_SIGNAL 0x3
  387. //
  388. // Busy signal detected
  389. //
  390. #define MODEMDIAG_CALLSETUPCODE_NO_SIGNAL 0x4
  391. //
  392. // No recognized signal detected.
  393. //
  394. #define MODEMDIAG_CALLSETUPCODE_VOICE 0x5
  395. //
  396. // Analog voice detected
  397. //
  398. #define MODEMDIAG_CALLSETUPCODE_TEXT_TELEPHONE_SIGNAL 0x6
  399. //
  400. // Text telephone signal detected (V.18)
  401. //
  402. #define MODEMDIAG_CALLSETUPCODE_DATA_ANSWERING_SIGNAL 0x7
  403. //
  404. // Data answering signal detected (e.g. V.25 ANS, V.8 ANSam)
  405. //
  406. #define MODEMDIAG_CALLSETUPCODE_DATA_CALLING_SIGNAL 0x8
  407. //
  408. // Data calling signal detected (e.g. V.25 CT, V.8 CI).
  409. //
  410. #define MODEMDIAG_CALLSETUPCODE_FAX_ANSWERING_SIGNAL 0x9
  411. //
  412. // Fax answering signal detected (e.g. T.30 CED, DIS).
  413. //
  414. #define MODEMDIAG_CALLSETUPCODE_FAX_CALLING_SIGNAL 0xa
  415. //
  416. // Fax calling signal detected (e.g. T.30 CNG)
  417. //
  418. #define MODEMDIAG_CALLSETUPCODE_V8BIS_SIGNAL 0xb
  419. //
  420. // V.8bis signal detected.
  421. //
  422. #define MODEMDIAGKEY_MULTIMEDIA_MODE 0x2
  423. // Value: Multimedia mode, based on Table 3 of the AT#UD specification...
  424. #define MODEMDIAG_MMMODE_DATA_ONLY 0x0
  425. #define MODEMDIAG_MMMODE_FAX_ONLY 0x1
  426. #define MODEMDIAG_MMMODE_VOICE_ONLY 0x2
  427. #define MODEMDIAG_MMMODE_VOICEVIEW 0x3
  428. #define MODEMDIAG_MMMODE_ASVD_V61 0x4
  429. #define MODEMDIAG_MMMODE_ASVD_V34Q 0x5
  430. #define MODEMDIAG_MMMODE_DSVD_MT 0x6
  431. #define MODEMDIAG_MMMODE_DSVD_1_2 0x7
  432. #define MODEMDIAG_MMMODE_DSVD_70 0x8
  433. #define MODEMDIAG_MMMODE_H324 0x9
  434. #define MODEMDIAG_MMMODE_OTHER_V80 0xa
  435. #define MODEMDIAGKEY_DTE_DCE_INTERFACE_MODE 0x3
  436. // Value: DTE-DCE interface mode, based on Table 4 of the AT#UD specication
  437. // ...
  438. #define MODEMDIAG_DCEDTEMODE_ASYNC_DATA 0x0
  439. #define MODEMDIAG_DCEDTEMODE_V80_TRANSPARENT_SYNC 0x1
  440. #define MODEMDIAG_DCEDTEMODE_V80_FRAMED_SYNC 0x2
  441. #define V8_CM_STRING 0x4
  442. // Value: offset from the start of the LINEDIAGNOSTICS structure to
  443. // the V.8 CM octet string, same format as V.25ter Annex A.
  444. // The offset points to a contiguous region of memory who
  445. // TODO: define parsed-versions of V.8 CM and V.8 JM octet strings, not
  446. // covered in the information returned in PARSEREC
  447. #define MODEMDIAGKEY_RECEIVED_SIGNAL_POWER 0x10
  448. // Value: Received signal power level, in -dBm.
  449. #define MODEMDIAGKEY_TRANSMIT_SIGNAL_POWER 0x11
  450. // Value: Transmit signal power level, in -dBm.
  451. #define MODEMDIAGKEY_NOISE_LEVEL 0x12
  452. // Value: Estimated noise level, in -dBM.
  453. #define MODEMDIAGKEY_NORMALIZED_MSE 0x13
  454. // Value: Normalized Mean Squared error. JosephJ: TODO: Of what?
  455. #define MODEMDIAGKEY_NEAR_ECHO_LOSS 0x14
  456. // Value: Near echo loss, in units of dB
  457. #define MODEMDIAGKEY_FAR_ECHO_LOSS 0x15
  458. // Value: Far echo loss, in units of dB
  459. #define MODEMDIAGKEY_FAR_ECHO_DELAY 0x16
  460. // Value: Far echo delay, in units of ms.
  461. #define MODEMDIAGKEY_ROUND_TRIP_DELAY 0x17
  462. // Value: Round trip delay, in units of ms.
  463. #define MODEMDIAGKEY_V34_INFO 0x18
  464. // Value: V.34 INFO bitmap, based on Table 5 of the AT#UD specifiction.
  465. // This DWORD value encodes 32 bits extracted from the V.34 INFO bitmap.
  466. // The following Macros extract specific V.34 INFO bit ranges out of
  467. // the 32-bit value:
  468. //
  469. // 10/30/1997 JosephJ: TODO what exactly are these? Also, what
  470. // does 20;0, 50;0 below mean?
  471. #define MODEMDIAG_V34_INFO0_20_0(_value) (((_value)>>30) & 0x3)
  472. //
  473. // INFO0 bit 20;0
  474. //
  475. #define MODEMDIAG_V34_INFOc_79_88(_value) (((_value)>>20) & 0x3ff)
  476. //
  477. // INFOc bit 79-88
  478. //
  479. #define MODEMDIAG_V34_INFOc_PRE_EMPHASIS(_value) (((_value)>>16) & 0xf)
  480. //
  481. // Pre-emphasis field, selected by the symbol rate chosen.
  482. // INFOc bits 26-29 or 35-38 or 44-47 or 53-56 or 62-65 or 71-74
  483. //
  484. #define MODEMDIAG_V34_INFOa_26_29(_value) (((_value)>>12) & 0xf)
  485. //
  486. // INFOa bits 26-29
  487. //
  488. #define MODEMDIAG_V34_INFO_MP_50_0(_value) (((_value)>>10) & 0x3)
  489. //
  490. // MP bit 50;0
  491. //
  492. #define MODEMDIAG_V34_INFOa_40_49(_value) (((_value)>>0) & 0x3ff)
  493. //
  494. // INFOa bits 40-49
  495. //
  496. #define MODEMDIAGKEY_TRANSMIT_CARRIER_NEGOTIATION_RESULT 0x20
  497. // Value: based on Table 6 of the AT#UD specification
  498. // TODO: fill out...
  499. #define MODEMDIAGKEY_RECEIVE_CARRIER_NEGOTIATION_RESULT 0x21
  500. // Value: based on Table 6 of the AT#UD specification
  501. // TODO: fill out...
  502. #define MODEMDIAGKEY_TRANSMIT_CARRIER_SYMBOL_RATE 0x22
  503. // Value: Transmit carrier symbol rate.
  504. #define MODEMDIAGKEY_RECEIVE_CARRIER_SYMBOL_RATE 0x23
  505. // Value: Receive carrier symbol rate.
  506. #define MODEMDIAGKEY_TRANSMIT_CARRIER_FREQUENCY 0x24
  507. // Value: Transmit carrier frequency TODO: units? Hz?
  508. #define MODEMDIAGKEY_RECEIVE_CARRIER_FREQUENCY 0x25
  509. // Value: Transmit carrier frequency TODO: units? Hz?
  510. #define MODEMDIAGKEY_INITIAL_TRANSMIT_CARRIER_DATA_RATE 0x26
  511. // Value: Initial transmit carrier data rate. TODO: units? /sec?
  512. #define MODEMDIAGKEY_INITIAL_RECEIVE_CARRIER_DATA_RATE 0x27
  513. // Value: Initial receive carrier data rate. TODO: units? /sec?
  514. #define MODEMDIAGKEY_TEMPORARY_CARRIER_LOSS_EVENT_COUNT 0x30
  515. // Value: Temporary carrier loss event count
  516. #define MODEMDIAGKEY_CARRIER_RATE_RENEGOTIATION_COUNT 0x31
  517. // Value: Carrier rate renegotiation event count
  518. #define MODEMDIAGKEY_CARRIER_RETRAINS_REQUESTED 0x32
  519. // Value: Carrier retrains requested
  520. #define MODEMDIAGKEY_CARRIER_RETRAINS_GRANTED 0x33
  521. // Value: Carrier retrains granted.
  522. #define MODEMDIAGKEY_FINAL_TRANSMIT_CARRIER_RATE 0x34
  523. // Value: final carrier transmit rate TODO: units? /sec?
  524. #define MODEMDIAGKEY_FINAL_RECEIVE_CARRIER_RATE 0x35
  525. // Value: final carrier receive rate TODO: units? /sec?
  526. #define MODEMDIAGKEY_PROTOCOL_NEGOTIATION_RESULT 0x40
  527. // Value: Protocol negotiation result code, based on
  528. // Table 7 of the AT#UD diagnostics specification...
  529. #define MODEMDKAGKEY_ERROR_CONTROL_FRAME_SIZE 0x41
  530. // Value: Error control frame size. TODO: units? bytes?
  531. #define MODEMDIAGKEY_ERROR_CONTROL_LINK_TIMEOUTS 0x42
  532. // Value: Error control link timeouts. TODO: time or count?
  533. #define MODMEDIAGKEY_ERROR_CONTROL_NAKs 0x43
  534. // Value: Error control NAKs
  535. #define MODEMDIAGKEY_COMPRESSION_NEGOTIATION_RESULT 0x44
  536. // Value: Compression negotiation result, based on
  537. // Table 8 of the AT#UD spec.
  538. //
  539. // TODO: add specific constant definitions here...
  540. #define MODEMDIAGKEY_COMPRESSION_DICTIONARY_SIZE 0x45
  541. // Value: compression dictionary size. TODO: size? bytes?
  542. #define MODEMDIAGKEY_TRANSMIT_FLOW_CONTROL 0x50
  543. // Value: Transmit flow control, defined by
  544. // one of the following constants:
  545. #define MODEMDIAG_FLOW_CONTROL_OFF 0x0
  546. //
  547. // No flow control
  548. //
  549. #define MODEMDIAG_FLOW_CONTROL_DC1_DC3 0x2
  550. //
  551. // DC1/DC3 (XON/XOFF) flow control
  552. //
  553. #define MODEMDIAG_FLOW_CONTROL_RTS_CTS 0x3
  554. //
  555. // RTS/CTS (V.24 ckt 106/133) flow control: TODO verify that latter
  556. // is the same as RTS/CTS.
  557. //
  558. #define MODEMDIAGKEY_RECEIVE_FLOW_CONTROL 0x51
  559. // Value: Receive flow control, defined by the above
  560. // (MODEMDiG_FLOW_CONTROL_*) constants.
  561. #define MODEMDIAGKEY_DTE_TRANSMIT_CHARACTERS 0x52
  562. // Value: Transmit characters obtained from DTE
  563. #define MODEMDIAGKEY_DTE_RECEIVED_CHARACTERS 0x53
  564. // Value: Received characters sent to DTE
  565. #define MODEMDIAGKEY_DTE_TRANSMIT_CHARACTERS_LOST 0x54
  566. // Value: Transmit characters lost (data overrun errors from DTE)
  567. #define MODEMDIAGKEY_DTE_RECEIVED_CHARACTERS_LOST 0x55
  568. // Value: Transmit characters lost (data overrun errors to DTE)
  569. #define MODEMDIAGKEY_EC_TRANSMIT_FRAME_COUNT 0x56
  570. // Value: Error control protocol transmit frame count
  571. #define MODEMDIAGKEY_EC_RECEIVED_FRAME_COUNT 0x57
  572. // Value: Error control protocol received frame count
  573. #define MODEMDIAGKEY_EC_TRANSMIT_FRAME_ERROR_COUNT 0x58
  574. // Value: Error control protocol transmit frame error count
  575. #define MODEMDIAGKEY_EC_RECEIVED_FRAME_ERROR_COUNT 0x59
  576. // Value: Error control protocol received frame error count
  577. #define MODEMDIAGKEY_TERMINATION_CAUSE 0x60
  578. // Value: Termination cause, based on Table 9-10 of the AT#UD
  579. // specification.
  580. #define MODEMDIAGKEY_CALL_WAINTING_EVENT_COUNT 0x61
  581. // Value: Call wainting event count.
  582. // TODO: Define specific constants.
  583. //
  584. // KEYTYPE
  585. //
  586. #define MODEM_KEYTYPE_AT_COMMAND_RESPONSE 0x5259091c
  587. //
  588. // The values are responses to specific AT commands. This type is relevant
  589. // only to AT ("Hayes(tm) compatible") modems.
  590. // The key (one of the MODEMDIAGKEY_ATRESP_* constants ) identifies the
  591. // command.
  592. //
  593. #define MODEMDIAGKEY_ATRESP_CONNECT 0x1
  594. // Value: Connect response string.
  595. // This will be a null-terminated ascii string.
  596. // ========================================================================
  597. // UNIMODEM DEVICE-SPECIFIC returned for lineGetDevCaps
  598. // The following structure is located at dwDevSpecificOffset into
  599. // the LINEDEVCAPS structure returned by lineGetDevCaps.
  600. //
  601. typedef struct // DEVCAPS_DEVSPECIFIC_UNIMODEM
  602. {
  603. DWORD dwSig;
  604. //
  605. // This will be set to 0x1;
  606. DWORD dwKeyOffset;
  607. //
  608. // This is the offset from the start of THIS structure, to
  609. // a null-terminated ASCI (not UNICODE) string giving
  610. // the device's driver key.
  611. //
  612. // WARNING: this is present for compatibility reasons. Applications
  613. // are STRONGLY discouraged to use this information, because the
  614. // location of the driver key could change on upgrade, so if
  615. // applications save away this key, the application could fail
  616. // on upgrade of the OS.
  617. //
  618. } DEVCAPS_DEVSPECIFIC_UNIMODEM, *PDEVCAPS_DEVSPECIFIC_UNIMODEM;
  619. // ========================================================================
  620. typedef struct // ISDN_STATIC_CONFIG
  621. {
  622. DWORD dwSig;
  623. //
  624. // Must be set to dwSIG_ISDN_STATIC_CONFIGURATION
  625. //
  626. #define dwSIG_ISDN_STATIC_CONFIGURATION 0x877bfc9f
  627. DWORD dwTotalSize;
  628. //
  629. // Total size of this structure, including variable portion, if any.
  630. //
  631. DWORD dwFlags; // reserved
  632. DWORD dwNextHeaderOffset; // reserved
  633. DWORD dwSwitchType;
  634. //
  635. // One of the dwISDN_SWITCH_* values below.
  636. //
  637. #define dwISDN_SWITCH_ATT1 0 // AT&T 5ESS Customm
  638. #define dwISDN_SWITCH_ATT_PTMP 1 // AT&T Point to Multipoint
  639. #define dwISDN_SWITCH_NI1 2 // National ISDN 1
  640. #define dwISDN_SWITCH_DMS100 3 // North3ern Telecom DMS-100 NT1
  641. #define dwISDN_SWITCH_INS64 4 // NTT INS64 - (Japan)
  642. #define dwISDN_SWITCH_DSS1 5 // DSS1 (Euro-ISDN)
  643. #define dwISDN_SWITCH_1TR6 6 // 1TR6 (Germany)
  644. #define dwISDN_SWITCH_VN3 7 // VN3 (France)
  645. #define dwISDN_SWITCH_BELGIUM1 8 // Belgian National
  646. #define dwISDN_SWITCH_AUS1 9 // Australian National TPH 1962
  647. #define dwISDN_SWITCH_UNKNOWN 10 // Unknown
  648. DWORD dwSwitchProperties;
  649. //
  650. // One or more fISDN_SWITCHPROP_* flags below
  651. //
  652. // Note the following three are exclusive, so only one can be
  653. // set at a time:
  654. #define fISDN_SWITCHPROP_US (0x1<<0) // Uses DN/SPID
  655. #define fISDN_SWITCHPROP_MSN (0x1<<1) // Uses MSN
  656. #define fISDN_SWITCHPROP_EAZ (0x1<<2) // Uses EAX
  657. #define fISDN_SWITCHPROP_1CH (0x1<<3) // Only one channel.
  658. DWORD dwNumEntries;
  659. //
  660. // The number of channels OR MSNs.
  661. // The numbers and possibly IDs are specified in the following
  662. // two offsets.
  663. //
  664. DWORD dwNumberListOffset;
  665. //
  666. // Offset in BYTES from the start of this structure to a
  667. // UNICODE multi-sz set of strings representing numbers.
  668. // There will dwNumChannels entries.
  669. //
  670. // The interpretation of these numbers is switch-property-specific,
  671. // and is as follows:
  672. // US: Directory Number.
  673. // MSN: MSN Number
  674. // EAZ: EAZ Number.
  675. DWORD dwIDListOffset;
  676. //
  677. // Offset in BYTES from the start of this structure to a
  678. // UNICODE multi-sz set of strings representing IDs.
  679. // There will dwNumChannels entries.
  680. //
  681. // The interpretation of these IDs is switch-property-specific and
  682. // is as follows:
  683. // US: SPID.
  684. // MSN: Not used and should be set to 0.
  685. // EAZ: EAZ
  686. //
  687. // variable length portion, if any, follows...
  688. //
  689. } ISDN_STATIC_CONFIG;
  690. typedef struct // ISDN_STATIC_CAPS
  691. {
  692. DWORD dwSig;
  693. //
  694. // Must be set to dwSIG_ISDN_STATIC_CAPS
  695. //
  696. #define dwSIG_ISDN_STATIC_CAPS 0xd11c5587
  697. DWORD dwTotalSize;
  698. //
  699. // Total size of this structure, including variable portion, if any.
  700. //
  701. DWORD dwFlags; // reserved
  702. DWORD dwNextHeaderOffset; // reserved
  703. DWORD dwNumSwitchTypes;
  704. DWORD dwSwitchTypeOffset;
  705. //
  706. // Offset to switch types, which is a DWORD array of types.
  707. //
  708. DWORD dwSwitchPropertiesOffset;
  709. //
  710. // Offset to a DWORD array of properties of the corresponding switch.
  711. //
  712. DWORD dwNumChannels;
  713. //
  714. // The number of channels supported.
  715. //
  716. DWORD dwNumMSNs;
  717. //
  718. // The number of MSNs supported.
  719. //
  720. DWORD dwNumEAZ;
  721. //
  722. // The number of EAZs supported.
  723. //
  724. //
  725. // variable length portion, if any, follows...
  726. //
  727. } ISDN_STATIC_CAPS;
  728. typedef struct // MODEM_CONFIG_HEADER
  729. {
  730. DWORD dwSig;
  731. DWORD dwTotalSize;
  732. DWORD dwNextHeaderOffset;
  733. DWORD dwFlags;
  734. } MODEM_CONFIG_HEADER;
  735. typedef struct // MODEM_PROTOCOL_CAPS
  736. {
  737. MODEM_CONFIG_HEADER hdr;
  738. //
  739. // hdr.dwSig must be set to dwSIG_MODEM_PROTOCOL_CAPS
  740. // hdr.dwFlags are reserved and should be ignored by app.
  741. //
  742. #define dwSIG_MODEM_PROTOCOL_CAPS 0x35ccd4b3
  743. DWORD dwNumProtocols;
  744. //
  745. // The number of protocols supported.
  746. //
  747. DWORD dwProtocolListOffset;
  748. //
  749. // Offset to a DWORD array of protocols supported.
  750. //
  751. //
  752. // variable length portion, if any, follows...
  753. //
  754. } MODEM_PROTOCOL_CAPS;
  755. typedef struct _PROTOCOL_ITEM {
  756. DWORD dwProtocol; // Protocol Supported
  757. DWORD dwProtocolNameOffset; // Offset from beggining of MODEM_PROTOCOL_CAPS structure
  758. // to NULL terminated friendly name of the protocol.
  759. } PROTOCOL_ITEM, *PPROTOCOL_ITEM;
  760. //=========================================================================
  761. //
  762. // Modem install wizard structures and flags
  763. //
  764. //=========================================================================
  765. #define UM_MAX_BUF_SHORT 32
  766. #define UM_LINE_LEN 256
  767. #define MIPF_NT4_UNATTEND 0x1
  768. // Take the information about what modem to install
  769. // from the unattended.txt file
  770. #define MIPF_DRIVER_SELECTED 0x2
  771. // The modem driver is selected, just register
  772. // and install it
  773. // Unattended install parameters
  774. typedef struct _tagUMInstallParams
  775. {
  776. DWORD Flags; // Flags that specify the unattended mode
  777. WCHAR szPort[UM_MAX_BUF_SHORT]; // Port on which to install the modem
  778. WCHAR szInfName[MAX_PATH]; // for NT4 method, inf name
  779. WCHAR szSection[UM_LINE_LEN]; // for NT4 method, section name
  780. } UM_INSTALLPARAMS, *PUM_INSTALLPARAMS, *LPUM_INSTALLPARAMS;
  781. // This structure is the private structure that may be
  782. // specified in the SP_INSTALLWIZARD_DATA's PrivateData field.
  783. typedef struct tagUM_INSTALL_WIZARD
  784. {
  785. DWORD cbSize; // set to the size of the structure
  786. DWORD Reserved1; // reserved, must be 0
  787. DWORD Reserved2; // reserved, must be 0
  788. LPARAM Reserved3; // reserved, must be 0
  789. UM_INSTALLPARAMS InstallParams; // parameters for the wizard
  790. } UM_INSTALL_WIZARD, *PUM_INSTALL_WIZARD, *LPUM_INSTALL_WIZARD;
  791. //=========================================================================
  792. //
  793. // Modem properties defines
  794. //
  795. //=========================================================================
  796. #define REGSTR_VAL_DEVICEEXTRAPAGES TEXT("DeviceExtraPages") // Property pages provided by the device manufacturer
  797. typedef BOOL (APIENTRY *PFNADDEXTRAPAGES)(HDEVINFO,PSP_DEVINFO_DATA,LPFNADDPROPSHEETPAGE,LPARAM);
  798. #ifdef __cplusplus
  799. }
  800. #endif
  801. #endif // _UNIMODEM_H_