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.

826 lines
26 KiB

  1. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  3. //from headers\AWNSFINT.H
  4. WORD EXPORTBC NSxtoBC(PThrdGlbl pTG, IFR ifr, LPLPFR rglpfr, WORD wNumFrame,
  5. LPBC lpbcOut, WORD wBCSize);
  6. WORD EXPORTBC BCtoNSx(PThrdGlbl pTG, IFR ifr, LPBC lpbcIn,
  7. LPBYTE lpbOut, WORD wMaxOut, LPWORD lpwNumFrame);
  8. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  9. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10. //from protocol\timeouts.h
  11. #ifdef MDDI // timeouts
  12. /****************** begin prototypes from timeouts.c *****************/
  13. void TstartTimeOut(PThrdGlbl pTG, TO * npto, ULONG ulTimeOut);
  14. BOOL TcheckTimeOut(PThrdGlbl pTG, TO * npto);
  15. /****************** end prototypes from timeouts.c *****************/
  16. #else //MDDI
  17. #define TstartTimeOut(pTG, lpto, ulTime) startTimeOut(pTG, lpto, ulTime)
  18. #define TcheckTimeOut(pTG, lpto) checkTimeOut(pTG, lpto)
  19. #endif //MDDI
  20. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  21. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  22. //from headers\timeouts.h
  23. /****************** begin prototypes from timeouts.c *****************/
  24. extern void startTimeOut( PThrdGlbl pTG, TO *lpto, ULONG ulTimeOut);
  25. extern BOOL checkTimeOut( PThrdGlbl pTG, TO *lpto);
  26. extern ULONG leftTimeOut( PThrdGlbl pTG, TO *lpto);
  27. /****************** begin prototypes from timeouts.c *****************/
  28. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  30. //from headers\protapi.h
  31. #define ProtGetSendMod(pTG) ((USHORT)ProtExtFunction(pTG, GET_SEND_MOD))
  32. #define ProtGetRecvMod(pTG) ((USHORT)ProtExtFunction(pTG, GET_RECV_MOD))
  33. #define ProtGetRetransmitMask(pTG) ((LPBYTE)ProtExtFunction(pTG, GET_PPR_FIF))
  34. #define ProtGetECMFrameSize(pTG) ((USHORT)ProtExtFunction(pTG, GET_ECM_FRAMESIZE))
  35. #define ProtGetRecvECMFrameSize(pTG) ((USHORT)ProtExtFunction(pTG, GET_RECV_ECM_FRAMESIZE))
  36. #define ProtReceivingECM(pTG) ((BOOL)ProtExtFunction(pTG, RECEIVING_ECM))
  37. #define ProtGetWhatNext(pTG) ((LPWHATNEXTPROC)ProtExtFunction(pTG, GET_WHATNEXT))
  38. #define ProtGetPPS(pTG) ((ULONG)ProtExtFunction(pTG, GET_PPS))
  39. // have to use this in SendPhaseC
  40. #define ProtGetMinBytesPerLine(pTG) ((USHORT)ProtExtFunction(pTG, GET_MINBYTESPERLINE))
  41. #define ProtGetRecvECMFrameCount(pTG) ((USHORT)ProtExtFunction(pTG, GET_RECVECMFRAMECOUNT))
  42. #define ProtResetRecvECMFrameCount(pTG) ((USHORT)ProtExtFunction(pTG, RESET_RECVECMFRAMECOUNT))
  43. #define ProtResetRecvPageAck(pTG) ((USHORT)ProtExtFunction(pTG, RESET_RECVPAGEACK))
  44. #define ProtGetSendEncoding(pTG) ((USHORT)ProtExtFunction(pTG, GET_SEND_ENCODING))
  45. #define ProtGetRecvEncoding(pTG) ((USHORT)ProtExtFunction(pTG, GET_RECV_ENCODING))
  46. /****************** begin prototypes from protapi.c *****************/
  47. BOOL ProtGetBC(PThrdGlbl pTG, BCTYPE bctype, BOOL fSleep);
  48. DWORD_PTR ProtExtFunction(PThrdGlbl pTG, USHORT uFunction);
  49. BOOL WINAPI ET30ProtSetProtParams(PThrdGlbl pTG, LPPROTPARAMS lp, USHORT uRecvSpeeds, USHORT uSendSpeeds);
  50. typedef BOOL (WINAPI *LPFN_ET30PROTSETPROTPARAMS)(PThrdGlbl pTG, LPPROTPARAMS lp, USHORT uRecvSpeeds, USHORT uSendSpeeds);
  51. BOOL WINAPI ET30ProtClose(PThrdGlbl pTG);
  52. typedef BOOL (WINAPI *LPFN_ET30PROTCLOSE)(PThrdGlbl pTG);
  53. BOOL WINAPI iET30ProtSetBC(PThrdGlbl pTG, LPBC lpBC, BCTYPE bctype);
  54. typedef BOOL (WINAPI *LPFN_IET30PROTSETBC)(PThrdGlbl pTG, LPBC lpBC, BCTYPE bctype);
  55. void WINAPI ET30ProtRecvPageAck(PThrdGlbl pTG, BOOL fAck);
  56. typedef void (WINAPI *LPFN_ET30PROTRECVPAGEACK)(PThrdGlbl pTG, BOOL fAck);
  57. void WINAPI ET30ProtAbort(PThrdGlbl pTG, BOOL fEnable);
  58. typedef void (WINAPI *LPFN_ET30PROTABORT)(PThrdGlbl pTG, BOOL fEnable);
  59. BOOL WINAPI ET30ProtOpen(PThrdGlbl pTG, BOOL fCaller);
  60. typedef BOOL (WINAPI *LPFN_ET30PROTOPEN)(PThrdGlbl pTG, BOOL fCaller);
  61. #ifdef OEMNSF
  62. // Ricoh IFS66 only
  63. void LoadOEMNSFDll(PThrdGlbl pTG, HINSTANCE hinstModem);
  64. void UnloadOEMNSFDll(PThrdGlbl pTG, BOOL fNormal);
  65. #endif
  66. #ifdef RICOHAI
  67. BOOL RicohAIInit(PThrdGlbl pTG);
  68. void RicohAIEnd(PThrdGlbl pTG);
  69. void RicohAIInitRecv(PThrdGlbl pTG);
  70. #endif
  71. /***************** end of prototypes from protapi.c *****************/
  72. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  73. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  74. //from headers\comapi.h
  75. #define FComFilterAsyncWrite(pTG, lpb,cb,fl) (FComFilterWrite(pTG, lpb, cb, fl) == cb)
  76. // #define FComFilterSyncWrite(lpb,cb) ((FComFilterWrite(lpb, cb)==cb) && FComDrain(TRUE,TRUE))
  77. #define FComDirectAsyncWrite(pTG, lpb,cb) (FComDirectWrite(pTG, lpb, cb) == cb)
  78. #define FComDirectSyncWriteFast(pTG, lpb,cb) ((FComDirectWrite(pTG, lpb, cb)==cb) && FComDrain(pTG, FALSE,TRUE))
  79. #define FComFlush(pTG) { FComFlushQueue(pTG, 0); FComFlushQueue(pTG, 1); }
  80. #define FComFlushInput(pTG) { FComFlushQueue(pTG, 1); }
  81. #define FComFlushOutput(pTG) { FComFlushQueue(pTG, 0); }
  82. extern BOOL FComInit(PThrdGlbl pTG, DWORD dwLineID, DWORD dwLineIDType);
  83. extern BOOL FComClose(PThrdGlbl pTG);
  84. extern BOOL FComSetBaudRate(PThrdGlbl pTG, UWORD uwBaudRate);
  85. extern void FComFlushQueue(PThrdGlbl pTG, int queue);
  86. extern BOOL FComXon(PThrdGlbl pTG, BOOL fEnable);
  87. extern BOOL FComDTR(PThrdGlbl pTG, BOOL fEnable);
  88. extern UWORD FComDirectWrite(PThrdGlbl pTG, LPB lpb, UWORD cb);
  89. extern UWORD FComFilterWrite(PThrdGlbl pTG, LPB lpb, UWORD cb, USHORT flags);
  90. extern BOOL FComDrain(PThrdGlbl pTG, BOOL fLongTimeout, BOOL fDrainComm);
  91. extern UWORD FComFilterReadBuf(PThrdGlbl pTG, LPB lpb, UWORD cbSize, LPTO lpto, BOOL fClass2, LPSWORD lpswEOF);
  92. // *lpswEOF is 1 on Class1 EOF, 0 on non-EOF, -1 on Class2 EOF, -2 on error -3 on timeout
  93. extern SWORD FComFilterReadLine(PThrdGlbl pTG, LPB lpb, UWORD cbSize, LPTO lptoRead);
  94. extern void FComInFilterInit(PThrdGlbl pTG);
  95. extern void FComOutFilterInit(PThrdGlbl pTG);
  96. extern void FComOutFilterClose(PThrdGlbl pTG);
  97. extern void FComAbort(PThrdGlbl pTG, BOOL f);
  98. extern void FComCritical(PThrdGlbl pTG, BOOL);
  99. extern void FComSetStuffZERO(PThrdGlbl pTG, USHORT cbLineMin);
  100. #if !defined(WFW) && !defined(WFWBG)
  101. extern BOOL FComCheckRing(PThrdGlbl pTG);
  102. typedef BOOL (WINAPI *LPFN_FCOMCHECKRING)(PThrdGlbl pTG);
  103. #endif
  104. #ifndef MDRV
  105. BOOL FComGetOneChar(PThrdGlbl pTG, UWORD ch);
  106. #endif //!MDRV
  107. extern void WINAPI FComOverlappedIO(PThrdGlbl pTG, BOOL fStart);
  108. /****************** begin DEBUG prototypes *****************/
  109. extern void far D_FComPrint(PThrdGlbl pTG, LONG_PTR nCid);
  110. extern void far D_HexPrint(LPB b1, UWORD incnt);
  111. extern void far D_GotError(PThrdGlbl pTG, LONG_PTR nCid, int err, COMSTAT far* lpcs);
  112. typedef void (far *LPFN_D_GOTERROR)(PThrdGlbl pTG, int nCid, int err, COMSTAT far* lpcs);
  113. #ifdef WFWBG
  114. extern void far FComSetBG(PThrdGlbl pTG, BOOL);
  115. typedef void (far *LPFN_FCOMSETBG)(PThrdGlbl pTG, BOOL);
  116. #endif
  117. /***************** end of prototypes *****************/
  118. /****************** begin prototypes from modem.c *****************/
  119. extern USHORT iModemInit(PThrdGlbl pTG, DWORD dwLineID, DWORD dwLineIDType,
  120. DWORD dwProfileID,
  121. LPSTR lpszKey,
  122. BOOL fInstall);
  123. typedef USHORT (WINAPI *LPFN_IMODEMINIT)(PThrdGlbl pTG, DWORD dwLineID, DWORD dwLineIDType,
  124. DWORD dwProfileID,
  125. LPSTR lpszKey,
  126. BOOL fInstall);
  127. extern BOOL iModemClose(PThrdGlbl pTG);
  128. typedef BOOL (WINAPI *LPFN_IMODEMCLOSE)(PThrdGlbl pTG);
  129. extern BOOL iModemSetNCUParams(PThrdGlbl pTG, int comma, int speaker, int volume, int fBlind, int fRingAloud);
  130. extern BOOL iModemHangup(PThrdGlbl pTG);
  131. extern USHORT iModemDial(PThrdGlbl pTG, LPSTR lpszDial, USHORT uClass);
  132. extern USHORT iModemAnswer(PThrdGlbl pTG, BOOL fImmediate, USHORT uClass);
  133. extern LPCMDTAB iModemGetCmdTabPtr(PThrdGlbl pTG);
  134. // 6 fixed args, then variable number of CBPSTRs, but there
  135. // must be at leat 2. One real one and one NULL terminator
  136. extern UWORD far iiModemDialog(PThrdGlbl pTG, LPSTR szSend, UWORD uwLen, ULONG ulTimeout,
  137. BOOL fMultiLine, UWORD uwRepeatCount, BOOL fPause,
  138. CBPSTR w1, CBPSTR w2, ...);
  139. /***************** end of prototypes from modem.c *****************/
  140. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  141. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  142. //from headers\filet30.h
  143. ULONG_PTR ProfileOpen(DWORD dwProfileID, LPSTR lpszSection, DWORD dwFlags);
  144. // dwProfileID should be one of DEF_BASEKEY or OEM_BASEKEY.
  145. // lpszSection should be (for example) "COM2" or "TAPI02345a04"
  146. // If dwProfileID == DEF_BASEKEY, the value is set to be a
  147. // sub key of:
  148. // HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\At Work Fax\
  149. // Local Modems\<lpszSection>.
  150. // Else if it is DEF_OEMKEY, it is assumed to be a fully-
  151. // qualified Key name, like "SOFTWARE\MICROSOFT.."
  152. //
  153. // Currently both are based of HKEY_LOCAL_MACHINE.
  154. //
  155. // When you're finished with this key, call ProfileClose.
  156. //
  157. // dwFlags is a combination of one of the fREG keys above..
  158. //
  159. // WIN32 ONLY: if lpszSection is NULL, it will open the base key,
  160. // and return its handle, which can be used in the Reg* functions.
  161. // Following are emulations of Get/WritePrivateProfileInt/String...
  162. BOOL
  163. ProfileWriteString(
  164. ULONG_PTR dwKey,
  165. LPSTR lpszValueName,
  166. LPSTR lpszBuf,
  167. BOOL fRemoveCR
  168. );
  169. DWORD ProfileGetString(ULONG_PTR dwKey, LPSTR lpszValueName, LPSTR lpszDefault, LPSTR lpszBuf , DWORD dwcbMax);
  170. UINT ProfileGetInt(ULONG_PTR dwKey, LPSTR szValueName, UINT uDefault, BOOL *fExist);
  171. UINT
  172. ProfileListGetInt(
  173. ULONG_PTR KeyList[10],
  174. LPSTR lpszValueName,
  175. UINT uDefault
  176. );
  177. // Following read/write binary data (type REG_BINARY). Available
  178. // on Win32 only....
  179. // Returns size of data read
  180. DWORD ProfileGetData(ULONG_PTR dwKey, LPSTR lpszValueName,
  181. LPBYTE lpbBuf , DWORD dwcbMax);
  182. // Returns true on success. Deletes Value if lpbBuf is NULL.
  183. BOOL ProfileWriteData(ULONG_PTR dwKey, LPSTR lpszValueName,
  184. LPBYTE lpbBuf , DWORD dwcb);
  185. void ProfileClose(ULONG_PTR dwKey);
  186. BOOL ProfileDeleteSection(DWORD dwProfileID, LPSTR lpszSection);
  187. BOOL
  188. ProfileCopySection(
  189. DWORD dwProfileIDTo,
  190. LPSTR lpszSectionTo,
  191. DWORD dwProfileIDFr,
  192. LPSTR lpszSectionFr,
  193. BOOL fCreateAlways
  194. );
  195. BOOL ProfileCopyTree(DWORD dwProfileIDTo,
  196. LPSTR lpszSectionTo, DWORD dwProfileIDFrom, LPSTR lpszSectionFrom);
  197. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  198. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  199. // from headers\modemddi.h
  200. /****************** begin prototypes from ddi.c *****************/
  201. USHORT NCUModemInit(PThrdGlbl pTG, DWORD lInitParam);
  202. void NCUModemDeInit(PThrdGlbl pTG);
  203. #ifdef UNUSED
  204. void NCUGetConfig(PThrdGlbl pTG, LPNCUCONFIG lpNCUConfig);
  205. #endif // UNUSED
  206. USHORT NCUCheckRing(PThrdGlbl pTG, USHORT uLine);
  207. USHORT NCUCheckHandset(PThrdGlbl pTG, USHORT uHandset);
  208. BOOL NCUSetParams(PThrdGlbl pTG, USHORT uLine, LPNCUPARAMS lpNCUParams);
  209. typedef BOOL (WINAPI *LPFN_NCUSETPARAMS)(PThrdGlbl pTG, USHORT uLine, LPNCUPARAMS lpNCUParams);
  210. HLINE NCUGetLine(PThrdGlbl pTG, USHORT uLine);
  211. BOOL NCUReleaseLine(PThrdGlbl pTG, HLINE hLine);
  212. USHORT NCULink(PThrdGlbl pTG, HLINE hLine, HMODEM hModem, USHORT uHandset, USHORT uFlags);
  213. USHORT NCUDial(PThrdGlbl pTG, HLINE hLine, LPSTR szPhoneNum);
  214. USHORT NCUTxDigit(PThrdGlbl pTG, HLINE hLine, char chDigit);
  215. void NCUAbort(PThrdGlbl pTG, USHORT uLine, BOOL fEnable);
  216. typedef void (WINAPI *LPFN_NCUABORT)(PThrdGlbl pTG, USHORT uLine, BOOL fEnable);
  217. HMODEM ModemOpen(PThrdGlbl pTG, USHORT uModemType, USHORT uModem);
  218. BOOL ModemClose(PThrdGlbl pTG, HMODEM hModem);
  219. BOOL ModemGetCaps(PThrdGlbl pTG, USHORT uModem, LPMODEMCAPS lpModemCaps);
  220. typedef BOOL (WINAPI *LPFN_MODEMGETCAPS)(PThrdGlbl pTG, USHORT uModem, LPMODEMCAPS lpModemCaps);
  221. BOOL ModemSync(PThrdGlbl pTG, HMODEM hModem, ULONG ulTimeout);
  222. #ifndef MDDI
  223. // 4/12/95 JosephJ. +++ Hack to prevent ModemSync from issuing AT
  224. // on sending DCN.
  225. BOOL ModemSyncEx(PThrdGlbl pTG, HMODEM hModem, ULONG ulTimeout, DWORD dwFlags);
  226. // dwFlags -- one of...
  227. # define fMDMSYNC_DCN 0x1L
  228. #endif // !MDDI
  229. BOOL ModemFlush(PThrdGlbl pTG, HMODEM);
  230. USHORT ModemConnectTx(PThrdGlbl pTG, HMODEM, ULONG ulTimeout, WORD wFlags);
  231. USHORT ModemConnectRx(PThrdGlbl pTG, HMODEM, WORD wFlags);
  232. BOOL ModemSendMode(PThrdGlbl pTG, HMODEM, USHORT uMod, BOOL fHDLC, USHORT ifrHint);
  233. #ifdef UNUSED
  234. BOOL ModemSendTCF(PThrdGlbl pTG, HMODEM, USHORT uMod, ULONG ulDuration);
  235. #endif // UNUSED
  236. BOOL ModemSendMem(PThrdGlbl pTG, HMODEM, LPBYTE lpb, USHORT uCount, USHORT uParams);
  237. BOOL ModemSendSilence(PThrdGlbl pTG, HMODEM, USHORT uMillisecs, ULONG ulTimeout);
  238. BOOL ModemRecvSilence(PThrdGlbl pTG, HMODEM, USHORT uMillisecs, ULONG ulTimeout);
  239. USHORT ModemRecvMode(PThrdGlbl pTG, HMODEM, USHORT uMod, BOOL fHDLC, ULONG ulTimeout, USHORT ifrHint);
  240. USHORT ModemRecvMem(PThrdGlbl pTG, HMODEM, LPBYTE lpb, USHORT cbMax, ULONG ulTimeout, USHORT far* lpcbRecv);
  241. BOOL ModemSetParams(PThrdGlbl pTG, USHORT uModem, LPMODEMPARAMS lpParms);
  242. typedef BOOL (WINAPI *LPFN_MODEMSETPARAMS)(PThrdGlbl pTG, USHORT uModem, LPMODEMPARAMS lpParms);
  243. void ModemEndRecv(PThrdGlbl pTG, HMODEM);
  244. BOOL NCUModemUpdateConfig(PThrdGlbl pTG);
  245. /***************** end of prototypes from ddi.c *****************/
  246. // Modem Diagnostics API
  247. DWORD NCUModemDiagnostic(PThrdGlbl pTG, HLINE, HMODEM, WORD inparam);
  248. //////////////// This is used for Modem Diagnostics //////////////
  249. // Start a Modem diagnostic session
  250. WORD WINAPI MdmStartDiagnostic(PThrdGlbl pTG);
  251. // return a handle or 0 on failure (modem busy)
  252. // Execute a modem diagnostic & return result
  253. DWORD WINAPI MdmExecDiagnostic(PThrdGlbl pTG, WORD hndle, WORD inparam);
  254. // calls Low-level modem driver disgnostic function
  255. // NCUModemDiagnostic(HLINE, HMODEM, WORD inparam)
  256. // and returned the DWORD result
  257. // Start a Modem transport diagnostic session
  258. WORD WINAPI MdmEndDiagnostic(PThrdGlbl pTG, WORD hndle);
  259. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  260. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  261. //fxrn
  262. void SetFailureCode(PThrdGlbl pTG, T30FAILURECODE uT30Fail);
  263. void SetStatus(PThrdGlbl pTG, T30STATUS uT30Stat, USHORT uN1, USHORT uN2, USHORT uN3);
  264. LPBUFFER MyAllocBuf(PThrdGlbl pTG, LONG sSize);
  265. BOOL MyFreeBuf(PThrdGlbl pTG, LPBUFFER);
  266. void MyAllocInit(PThrdGlbl pTG);
  267. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  268. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  269. //negot.c
  270. BOOL NegotiateCaps(PThrdGlbl pTG);
  271. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  272. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  273. // my own stuff
  274. typedef VOID (T30LINECALLBACK)(
  275. HLINE hLine,
  276. DWORD hDevice,
  277. DWORD dwMessage,
  278. DWORD_PTR dwInstance,
  279. DWORD_PTR dwParam1,
  280. DWORD_PTR dwParam2,
  281. DWORD_PTR dwParam3
  282. );
  283. VOID
  284. T30LineCallBackFunction(
  285. HANDLE hFax,
  286. DWORD hDevice,
  287. DWORD dwMessage,
  288. DWORD_PTR dwInstance,
  289. DWORD_PTR dwParam1,
  290. DWORD_PTR dwParam2,
  291. DWORD_PTR dwParam3
  292. );
  293. VOID FaxDevInit(PThrdGlbl pTG, HLINE hLine,HCALL hCall);
  294. BOOL T30ComInit( PThrdGlbl pTG, HANDLE hComm);
  295. PVOID T30AllocThreadGlobalData(VOID);
  296. BOOL T30Cl1Rx (PThrdGlbl pTG);
  297. BOOL T30Cl1Tx (PThrdGlbl pTG,LPSTR szPhone);
  298. HANDLE T30GetCommHandle(HLINE hLine, HCALL hCall);
  299. USHORT
  300. T30ModemInit(PThrdGlbl pTG,HANDLE hComm,DWORD dwLineID,DWORD dwLineIDType,
  301. DWORD dwProfileID, LPSTR lpszKey, BOOL fInstall);
  302. BOOL itapi_async_setup(PThrdGlbl pTG);
  303. BOOL itapi_async_wait(PThrdGlbl pTG,DWORD dwRequestID,PDWORD lpdwParam2,PDWORD_PTR lpdwParam3,DWORD dwTimeout);
  304. BOOL itapi_async_signal(PThrdGlbl pTG, DWORD dwRequestID, DWORD dwParam2, DWORD_PTR dwParam3);
  305. VOID
  306. MyDebugPrint(
  307. PThrdGlbl pTG,
  308. int DbgLevel,
  309. LPSTR Format,
  310. ...
  311. );
  312. LPLINECALLPARAMS itapi_create_linecallparams(void);
  313. void
  314. GetCommErrorNT(
  315. PThrdGlbl pTG,
  316. HANDLE h,
  317. int* pn,
  318. LPCOMSTAT pstat);
  319. int
  320. ReadFileNT(
  321. PThrdGlbl pTG,
  322. HANDLE h,
  323. LPVOID lpBuffer,
  324. DWORD BytesToRead,
  325. LPDWORD BytesHadRead,
  326. LPOVERLAPPED lpOverlapped,
  327. DWORD TimeOut,
  328. HANDLE SecondEvent
  329. );
  330. void
  331. ClearCommCache(
  332. PThrdGlbl pTG
  333. );
  334. int FComFilterFillCache(PThrdGlbl pTG, UWORD cbSize, LPTO lptoRead);
  335. BOOL MonInit(PThrdGlbl pTG, LPMONOPTIONS lpmo);
  336. // dwPrefNumMRs - preferred number of MONREC structures in circ. buf
  337. // dwPrefBufSize - preferred size of byte circular buf
  338. // -- May globally alloc data of the appropriate size.
  339. // -- May use internal static data
  340. void MonDeInit(PThrdGlbl pTG);
  341. // Inverse of MonInit.
  342. BOOL MonPutComm(PThrdGlbl pTG, WORD wFlags, LPBYTE lpb, WORD wcb);
  343. // Adds comm info to monitor record.
  344. BOOL MonPutEvent(PThrdGlbl pTG, WORD wFlags, WORD wID, WORD wSubID,
  345. DWORD dwData0, DWORD dwData1, LPSTR lpszTxtMsg);
  346. // Adds event info to monitor record.
  347. void MonDump(PThrdGlbl pTG);
  348. // Dumps the .mon (byte buffer) and .mrc (MONREC buffer) to the
  349. // file constructed using lpszStubName, if non NULL.
  350. // EG: if lpszStubName == "d:\logs\awfax", the files
  351. // Created would be of the form "d:\logs\awfaxN.mon" and
  352. // "d:\logs\awfaxN.mrc", where N is a number starting with 0 and
  353. // incremented each time MonDump is called (it wraps around at 16
  354. // currently). N is reset to zero each time MonInit is called.
  355. // If lpszStubName is NULL, a default of "c:\fax" is used instead.
  356. UWORD FComStripBuf(PThrdGlbl pTG, LPB lpbOut, LPB lpbIn, UWORD cb, BOOL fClass2, LPSWORD lpswEOF);
  357. void InitCapsBC(PThrdGlbl pTG, LPBC lpbc, USHORT uSize, BCTYPE bctype);
  358. BOOL
  359. SignalStatusChange(
  360. PThrdGlbl pTG,
  361. DWORD StatusId
  362. );
  363. ////////////////////////////////////////////////////////////////////
  364. // Ansi prototypes
  365. ////////////////////////////////////////////////////////////////////
  366. VOID CALLBACK
  367. T30LineCallBackFunctionA(
  368. HANDLE hFax,
  369. DWORD hDevice,
  370. DWORD dwMessage,
  371. DWORD_PTR dwInstance,
  372. DWORD_PTR dwParam1,
  373. DWORD_PTR dwParam2,
  374. DWORD_PTR dwParam3
  375. );
  376. BOOL WINAPI
  377. FaxDevInitializeA(
  378. IN HLINEAPP LineAppHandle,
  379. IN HANDLE HeapHandle,
  380. OUT PFAX_LINECALLBACK *LineCallbackFunction,
  381. IN PFAX_SERVICE_CALLBACK FaxServiceCallback
  382. );
  383. BOOL WINAPI
  384. FaxDevStartJobA(
  385. HLINE LineHandle,
  386. DWORD DeviceId,
  387. PHANDLE pFaxHandle,
  388. HANDLE CompletionPortHandle,
  389. ULONG_PTR CompletionKey
  390. );
  391. BOOL WINAPI
  392. FaxDevEndJobA(
  393. HANDLE FaxHandle
  394. );
  395. BOOL WINAPI
  396. FaxDevSendA(
  397. IN HANDLE FaxHandle,
  398. IN PFAX_SEND_A FaxSend,
  399. IN PFAX_SEND_CALLBACK FaxSendCallback
  400. );
  401. BOOL WINAPI
  402. FaxDevReceiveA(
  403. HANDLE FaxHandle,
  404. HCALL CallHandle,
  405. PFAX_RECEIVE_A FaxReceive
  406. );
  407. BOOL WINAPI
  408. FaxDevReportStatusA(
  409. IN HANDLE FaxHandle OPTIONAL,
  410. OUT PFAX_DEV_STATUS FaxStatus,
  411. IN DWORD FaxStatusSize,
  412. OUT LPDWORD FaxStatusSizeRequired
  413. );
  414. BOOL WINAPI
  415. FaxDevAbortOperationA(
  416. HANDLE FaxHandle
  417. );
  418. HANDLE
  419. TiffCreateW(
  420. LPWSTR FileName,
  421. DWORD CompressionType,
  422. DWORD ImageWidth,
  423. DWORD FillOrder,
  424. DWORD HiRes
  425. );
  426. HANDLE
  427. TiffOpenW(
  428. LPWSTR FileName,
  429. PTIFF_INFO TiffInfo,
  430. BOOL ReadOnly
  431. );
  432. // fast tiff
  433. DWORD
  434. TiffConvertThreadSafe(
  435. PThrdGlbl pTG
  436. );
  437. DWORD
  438. TiffConvertThread(
  439. PThrdGlbl pTG
  440. );
  441. DWORD
  442. PageAckThreadSafe(
  443. PThrdGlbl pTG
  444. );
  445. DWORD
  446. PageAckThread(
  447. PThrdGlbl pTG
  448. );
  449. VOID
  450. SignalHelperError(
  451. PThrdGlbl pTG
  452. );
  453. BOOL
  454. DecodeMHFaxPageAsync(
  455. PThrdGlbl pTG,
  456. DWORD *RetFlags,
  457. char *InFileName
  458. );
  459. BOOL
  460. DecodeMRFaxPageAsync(
  461. PThrdGlbl pTG,
  462. DWORD *RetFlags,
  463. char *InFileName,
  464. BOOL HiRes
  465. );
  466. DWORD
  467. ComputeCheckSum(
  468. LPDWORD BaseAddr,
  469. DWORD NumDwords
  470. );
  471. BOOL
  472. SignalRecoveryStatusChange(
  473. T30_RECOVERY_GLOB *Recovery
  474. );
  475. VOID
  476. SimulateError(
  477. DWORD ErrorType
  478. );
  479. int
  480. SearchNewInfFile(
  481. PThrdGlbl pTG,
  482. char *Key1,
  483. char *Key2,
  484. BOOL fRead
  485. );
  486. int
  487. my_strcmp(
  488. LPSTR sz1,
  489. LPSTR sz2
  490. );
  491. void
  492. TalkToModem (
  493. PThrdGlbl pTG,
  494. BOOL fGetClass
  495. );
  496. BOOL
  497. SaveInf2Registry (
  498. PThrdGlbl pTG
  499. );
  500. BOOL
  501. SaveModemClass2Registry (
  502. PThrdGlbl pTG
  503. );
  504. BOOL
  505. ReadModemClassFromRegistry (
  506. PThrdGlbl pTG
  507. );
  508. VOID
  509. CleanModemInfStrings (
  510. PThrdGlbl pTG
  511. );
  512. BOOL
  513. RemoveCR (
  514. LPSTR sz
  515. );
  516. /*** BEGIN PROTOTYPES FROM CLASS2.c ***/
  517. BOOL
  518. T30Cl2Rx(
  519. PThrdGlbl pTG
  520. );
  521. BOOL
  522. T30Cl2Tx(
  523. PThrdGlbl pTG,
  524. LPSTR szPhone
  525. );
  526. BOOL Class2Send(PThrdGlbl pTG);
  527. BOOL Class2Receive(PThrdGlbl pTG);
  528. USHORT Class2Dial(PThrdGlbl pTG, LPSTR lpszDial);
  529. USHORT Class2Answer(PThrdGlbl pTG, BOOL fImmediate);
  530. SWORD Class2ModemSync(PThrdGlbl pTG);
  531. UWORD Class2iModemDialog(PThrdGlbl pTG, LPSTR szSend, UWORD uwLen, ULONG ulTimeout,
  532. BOOL fMultiLine, UWORD uwRepeatCount, ...);
  533. BOOL Class2ModemHangup(PThrdGlbl pTG);
  534. BOOL Class2ModemAbort(PThrdGlbl pTG);
  535. SWORD Class2HayesSyncSpeed(PThrdGlbl pTG, BOOL fTryCurrent, C2PSTR cbszCommand, UWORD uwLen);
  536. USHORT Class2ModemRecvData(PThrdGlbl pTG, LPB lpb, USHORT cbMax, USHORT uTimeout,
  537. USHORT far* lpcbRecv);
  538. BOOL Class2ModemSendMem(PThrdGlbl pTG, LPBYTE lpb, USHORT uCount);
  539. BOOL Class2ModemDrain(PThrdGlbl pTG);
  540. void Class2TwiddleThumbs(ULONG ulTime);
  541. LPSTR Class2_fstrstr( LPSTR sz1, LPSTR sz2);
  542. USHORT Class2MinScanToBytesPerLine(PThrdGlbl pTG, BYTE Minscan, BYTE Baud, BYTE Resolution);
  543. BOOL Class2ResponseAction(PThrdGlbl pTG, LPPCB lpPcb);
  544. USHORT Class2ModemRecvBuf(PThrdGlbl pTG, LPBUFFER far* lplpbf, USHORT uTimeout);
  545. USHORT Class2EndPageResponseAction(PThrdGlbl pTG);
  546. BOOL Class2GetModemMaker(PThrdGlbl pTG);
  547. void Class2SetMFRSpecific(PThrdGlbl pTG, LPSTR lpszSection);
  548. BOOL Class2Parse( PThrdGlbl pTG, CL2_COMM_ARRAY *, BYTE responsebuf[] );
  549. void Class2InitBC(PThrdGlbl pTG, LPBC lpbc, USHORT uSize, BCTYPE bctype);
  550. void Class2PCBtoBC(PThrdGlbl pTG, LPBC lpbc, USHORT uMaxSize, LPPCB lppcb);
  551. void Class2SetDIS_DCSParams(PThrdGlbl pTG, BCTYPE bctype, LPUWORD Encoding, LPUWORD Resolution,
  552. LPUWORD PageWidth, LPUWORD PageLength, LPSTR szID);
  553. void Class2BCHack(PThrdGlbl pTG);
  554. BOOL Class2GetBC(PThrdGlbl pTG, BCTYPE bctype);
  555. void Class2GetRecvPageAck(PThrdGlbl pTG);
  556. void Class2ReadProfile(PThrdGlbl pTG, LPSTR lpszSection);
  557. void cl2_flip_bytes( LPB lpb, DWORD dw);
  558. BOOL iModemGoClass(PThrdGlbl pTG, USHORT uClass);
  559. void Class2Abort(PThrdGlbl pTG, BOOL fEnable);
  560. BOOL Class2NCUSet(PThrdGlbl pTG, LPNCUPARAMS NCUParams2);
  561. void
  562. Class2Init(
  563. PThrdGlbl pTG
  564. );
  565. BOOL
  566. Class2SetProtParams(
  567. PThrdGlbl pTG,
  568. LPPROTPARAMS lp
  569. );
  570. /*** BEGIN PROTOTYPES FROM CLASS2_0.c ***/
  571. BOOL
  572. T30Cl20Rx (
  573. PThrdGlbl pTG
  574. );
  575. BOOL
  576. T30Cl20Tx(
  577. PThrdGlbl pTG,
  578. LPSTR szPhone
  579. );
  580. BOOL Class20Send(PThrdGlbl pTG);
  581. BOOL Class20Receive(PThrdGlbl pTG);
  582. void
  583. Class20Init(
  584. PThrdGlbl pTG
  585. );
  586. BOOL Class20GetModemMaker(PThrdGlbl pTG);
  587. BOOL Class20Parse( PThrdGlbl pTG, CL2_COMM_ARRAY *, BYTE responsebuf[] );