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.

911 lines
26 KiB

  1. // headers\et30type.h is assumed to be included
  2. // ET30ACTION, ET30EVENT
  3. // headers\timeouts.h ... TO
  4. // headers\fr.h ... IFR
  5. #define MODEM_CLASS1 1
  6. #define MODEM_CLASS2 2
  7. #define MODEM_CLASS2_0 3
  8. typedef ET30ACTION ( __cdecl FAR* LPWHATNEXTPROC)(LPVOID, ET30EVENT, ...);
  9. typedef struct {
  10. LPWHATNEXTPROC lpfnWhatNext;
  11. HMODEM hModem; // Modem driver handle
  12. HLINE hLine; // NCU driver handle
  13. } ET30PARAMS;
  14. #define MAXRECVFRAMES 20
  15. typedef struct {
  16. LPFR rglpfr[MAXRECVFRAMES];
  17. BYTE b[];
  18. } FRAMESPACE, far* LPFRAMESPACE;
  19. typedef struct {
  20. LPFRAMESPACE lpfs; // ptr to storage for recvd frames
  21. UWORD Nframes; // Number of recvd frames
  22. IFR ifrCommand,
  23. ifrResp,
  24. ifrSend;
  25. USHORT uTrainCount;
  26. USHORT uRecvTCFMod; // for fastexit stuff
  27. // set this from the DCS and jump straight into RecvTCF
  28. // Used to decide whether to insert a 1 bit or not (T30 sec 5.3.6.1)
  29. BOOL fReceivedDIS;
  30. BOOL fReceivedDTC;
  31. BOOL fReceivedEOM;
  32. BOOL fAtEndOfRecvPage;
  33. LONG sRecvBufSize;
  34. TO toT1; // This is used in MainBody.
  35. #ifdef IFK
  36. TO toBuf; // This is used to wait for a free buffer
  37. #endif
  38. // INI file settings related stuff
  39. USHORT uSkippedDIS;
  40. // flag to know when we are doing send-after-send, and so should use
  41. // SendSilence instead of RecvSilence. If we dont do this, we take
  42. // too long & Ricoh's protocol tester complains. This is 7071, 7100
  43. BOOL fSendAfterSend;
  44. #ifdef MDDI
  45. # define CLEAR_MISSED_TCFS()
  46. #else // !MDDI
  47. // Some modems can't train at higher speeds (timeout or return
  48. // ERRROR on AT+FRM=xxx) with other specific devices, but are OK at lower
  49. // speeds. So we keep track of the number of times we try to get the TCF,
  50. // and after the 2nd failed attempt, send an FTT instead of going to
  51. // node F.
  52. # define CLEAR_MISSED_TCFS() (pTG->T30.uMissedTCFs=0)
  53. # define MAX_MISSED_TCFS_BEFORE_FTT 2
  54. USHORT uMissedTCFs;
  55. #endif // !MDDI
  56. #ifdef ADAPTIVE_ANSWER
  57. BOOL fEnableHandoff;
  58. #endif // ADAPTIVE_ANSWER
  59. } ET30T30;
  60. typedef struct {
  61. DWORD dwPageSize; // Size of current page in bytes
  62. USHORT uFrameSize;
  63. USHORT SendPageCount,
  64. SendBlockCount,
  65. SendFrameCount;
  66. USHORT FramesSent;
  67. USHORT uPPRCount;
  68. BOOL fEndOfPage;
  69. TO toT5; // Used in RR_RNRLoop().
  70. // Used for suppressing ST_FLAG in first PhaseC following
  71. // a CTC/CTR (for V.17)
  72. BOOL fSentCTC;
  73. BOOL fRecvdCTC;
  74. // Used in Recv
  75. IFR ifrPrevCommand;
  76. BOOL fRecvEndOfPage;
  77. BYTE bRecvBadFrameMask[32];
  78. BYTE bPrevPPS[4];
  79. IFR ifrPrevResponse;
  80. } ET30ECM;
  81. typedef enum { modeNONE=0, modeNONECM, modeECM, modeECMRETX } PHASECMODE;
  82. typedef struct {
  83. IFR ifrLastSent;
  84. PHASECMODE modePrevRecv;
  85. BOOL fGotWrongMode;
  86. } ET30ECHOPROTECT;
  87. //
  88. // headers\awnsfint.h is assumed to be included
  89. // force include to class1\*.c
  90. #pragma pack(1) // ensure packed structure
  91. typedef struct {
  92. BYTE G1stuff :3;
  93. BYTE G2stuff :5;
  94. BYTE G3Tx :1; // In DIS indicates poll doc avail. Must be 0 in DCS.
  95. BYTE G3Rx :1; // Must set to 1 in BOTH DCS/DTC
  96. BYTE Baud :4;
  97. BYTE ResFine_200 :1;
  98. BYTE MR_2D :1;
  99. BYTE PageWidth :2;
  100. BYTE PageLength :2;
  101. BYTE MinScanCode :3;
  102. BYTE Extend24 :1;
  103. BYTE Hand2400 :1;
  104. BYTE Uncompressed :1;
  105. BYTE ECM :1;
  106. BYTE SmallFrame :1;
  107. BYTE ELM :1;
  108. BYTE Reserved1 :1;
  109. BYTE MMR :1;
  110. BYTE Extend32 :1;
  111. BYTE WidthInvalid :1;
  112. BYTE Width2 :4;
  113. // 1 == WidthA5_1216
  114. // 2 == WidthA6_864
  115. // 4 == WidthA5_1728
  116. // 8 == WidthA6_1728
  117. BYTE Reserved2 :2;
  118. BYTE Extend40 :1;
  119. BYTE Res8x15 :1;
  120. BYTE Res_300 :1;
  121. BYTE Res16x15_400 :1;
  122. BYTE ResInchBased :1;
  123. BYTE ResMetricBased :1;
  124. BYTE MinScanSuperHalf:1;
  125. BYTE SEPcap :1;
  126. BYTE Extend48 :1;
  127. BYTE SUBcap :1;
  128. BYTE PWDcap :1;
  129. BYTE CanEmitDataFile :1;
  130. BYTE Reserved3 :1;
  131. BYTE BFTcap :1;
  132. BYTE DTMcap :1;
  133. BYTE EDIcap :1;
  134. BYTE Extend56 :1;
  135. BYTE BTMcap :1;
  136. BYTE Reserved4 :1;
  137. BYTE CanEmitCharFile :1;
  138. BYTE CharMode :1;
  139. BYTE Reserved5 :3;
  140. BYTE Extend64 :1;
  141. } DIS, far* LPDIS, near* NPDIS;
  142. #pragma pack()
  143. #define MAXFRAMES 10
  144. #define MAXSPACE 512
  145. typedef struct
  146. {
  147. USHORT uNumFrames;
  148. USHORT uFreeSpaceOff;
  149. LPFR rglpfr[MAXFRAMES];
  150. BYTE b[MAXSPACE];
  151. }
  152. RFS, near* NPRFS;
  153. #define IDFIFSIZE 20 // from protocol\protocol.h
  154. typedef struct {
  155. BOOL fInUse;
  156. ////////////////////////// Client BC parameters
  157. BCwithTEXT RecvCaps; // ==> NSF/DIS recved
  158. DWORD RecvCapsGuard;
  159. BCwithTEXT RecvParams; // ==> NSS/DCS recvd
  160. DWORD RecvParamsGuard;
  161. BCwithPOLL RecvPollReq; // ==> NSC/DTC recvd
  162. DWORD RecvPollReqGuard;
  163. BCwithTEXT SendCaps; // ==> NSF/DIS sent
  164. DWORD SendCapsGuard;
  165. BCwithTEXT SendParams; // ==> NSS/DCS sent
  166. DWORD SendParamsGuard;
  167. BCwithPOLL SendPollReq; // ==> NSC/DTC sent
  168. DWORD SendPollReqGuard;
  169. // LPBC lpbcSendCaps; // ==> NSF/DIS sent
  170. // LPBC lpbcSendParams; // ==> NSS/DCS sent
  171. // LPBC lpbcSendPollReq; // ==> NSC/DTC sent
  172. BOOL fRecvCapsGot;
  173. BOOL fSendCapsInited;
  174. BOOL fSendParamsInited;
  175. BOOL fRecvParamsGot;
  176. BOOL fRecvPollReqGot;
  177. BOOL fSendPollReqInited;
  178. ////////////////////////// Hardware parameters
  179. LLPARAMS llRecvCaps; // DIS recvd
  180. LLPARAMS llSendCaps; // DIS sent---use uRecvSpeeds
  181. LLPARAMS llSendParams; // used to negotiate DCS--use uSendSpeeds
  182. LLPARAMS llNegot; // DCS sent
  183. LLPARAMS llRecvParams; // recvd DCS
  184. BOOL fllRecvCapsGot;
  185. BOOL fllSendCapsInited;
  186. BOOL fllSendParamsInited;
  187. BOOL fllNegotiated;
  188. BOOL fllRecvParamsGot;
  189. BOOL fHWCapsInited;
  190. USHORT HighestSendSpeed;
  191. USHORT LowestSendSpeed;
  192. ////////////////////////// Flags to make decisions with
  193. // BYTE NextSend;
  194. // BOOL fSendingECM;
  195. // BOOL fReceivingECM;
  196. BOOL fPageOK;
  197. BOOL fAbort;
  198. ////////////////////////// Current Send/Recv params (to return on ExtFunc)
  199. // USHORT uCurRecvBaud;
  200. // USHORT uMinBytesPerLine;
  201. // USHORT uCurECMFrameSize;
  202. // USHORT uRecvECMFrameSize;
  203. USHORT uFramesInThisBlock;
  204. ///////////////////////// NSF/NSC/NSS Received Frames
  205. RFS RecvdNS;
  206. ///////////////////////// CSI/TSI/CIG Received Frames
  207. BOOL fRecvdID;
  208. BYTE bRemoteID[IDFIFSIZE+1];
  209. ///////////////////////// DIS Received Frames
  210. DIS RemoteDIS;
  211. USHORT uRemoteDISlen;
  212. BOOL fRecvdDIS;
  213. ///////////////////////// DTC Received Frames
  214. DIS RemoteDTC;
  215. USHORT uRemoteDTClen;
  216. BOOL fRecvdDTC;
  217. ///////////////////////// DCS Received Frames
  218. DIS RemoteDCS;
  219. USHORT uRemoteDCSlen;
  220. BOOL fRecvdDCS;
  221. ///////////////////////// ECM Received Frames
  222. BYTE bRemotePPR[32];
  223. BOOL fRecvdPPR;
  224. BYTE bRemotePPS[4]; // only 3 bytes, but use 4 so we can cast to DWORD
  225. BOOL fRecvdPPS;
  226. ///////////////////////// SUB (subaddress) Received Frames
  227. BOOL fRecvdSUB;
  228. BYTE bRecipSubAddr[IDFIFSIZE+1];
  229. }
  230. PROT, near* NPPROT;
  231. //
  232. // protapi.h includes protparm.h
  233. // which defines PROTPARAMS
  234. //
  235. typedef struct
  236. {
  237. USHORT uSize;
  238. SHORT Class;
  239. SHORT PreambleFlags,
  240. InterframeFlags,
  241. ClosingFlags;
  242. }
  243. MODEMPARAMS, far* LPMODEMPARAMS;
  244. #define COMMANDBUFSIZE 40
  245. typedef struct {
  246. // TO toDialog, toZero;
  247. TO toRecv;
  248. // BYTE bLastReply[REPLYBUFSIZE+1];
  249. BYTE bCmdBuf[COMMANDBUFSIZE];
  250. USHORT uCmdLen;
  251. BOOL fHDLC;
  252. USHORT CurMod;
  253. enum {SEND, RECV, IDLE } DriverMode;
  254. enum {COMMAND, FRH, FTH, FTM, FRM} ModemMode;
  255. BOOL fRecvNotStarted;
  256. // SHORT sRecvBufSize;
  257. HWND hwndNotify;
  258. BOOL fSendSWFraming;
  259. BOOL fRecvSWFraming;
  260. enum {RECV_FCS_DUNNO=0, RECV_FCS_NO, RECV_FCS_CHK, RECV_FCS_NOCHK} eRecvFCS;
  261. // Whether this modem appends FCS on HDLC recv.
  262. // Modems with AT&T bug don't append FCS.
  263. // Currently we determine this at run time.
  264. #ifdef ADAPTIVE_ANSWER
  265. BOOL fEnableHandoff;
  266. #endif // ADAPTIVE_ANSWER
  267. } CLASS1_MODEM;
  268. typedef struct {
  269. // BYTE fModemInit :1; // Reset & synced up with modem
  270. // BYTE fOffHook :1; // Online (either dialled or answered)
  271. USHORT ifrHint; // current hint
  272. // BOOL fNCUAbort; // When set, means Abort Dial/Answer
  273. } CLASS1_STATUS;
  274. typedef struct
  275. {
  276. USHORT uComPort;
  277. BOOL fLineInUse;
  278. BOOL fModemOpen;
  279. BOOL fNCUModemLinked;
  280. }
  281. CLASS1_DDI;
  282. #define OVBUFSIZE 4096
  283. typedef struct
  284. {
  285. enum {eDEINIT, eFREE, eALLOC, eIO_PENDING} eState;
  286. OVERLAPPED ov;
  287. char rgby[OVBUFSIZE]; // Buffer associated with this overlapped struct.
  288. DWORD dwcb; // Current count of data in this buffer.
  289. } OVREC;
  290. typedef struct
  291. {
  292. // Timeouts
  293. DWORD dwTOOutShortInactivity;
  294. DWORD dwTOOutLongInactivity;
  295. DWORD dwTOOutShortDeadComm;
  296. DWORD dwTOOutLongDeadComm;
  297. DWORD dwTOInOneChar;
  298. } FCOMSETTINGS, FAR * LPFCOMSETTINGS;
  299. typedef struct {
  300. LONG_PTR nCid; // _must_ be 32bits in WIN32 (has to hold a HANDLE) -- AJR 12/16/97, change to LONG_PTR for 64 bits
  301. int CommErr; // _must_ be 32bits in WIN32
  302. UWORD cbInSize;
  303. UWORD cbOutSize;
  304. DCB dcb;
  305. #ifdef METAPORT
  306. DCB dcbOrig;
  307. BOOL fExternalHandle;
  308. BOOL fStateChanged;
  309. #endif
  310. COMSTAT comstat;
  311. BYTE bDontYield; // Was a BOOL, now a counter.
  312. #ifdef NTF
  313. HWND hwndNotify; // can use this for timer msgs
  314. #endif
  315. #ifdef WFWBG
  316. BOOL fBG;
  317. #endif
  318. TO toCommDead, toOnechar, toDrain;
  319. USHORT uInterruptOverunCount;
  320. USHORT uBufferOverflowCount;
  321. USHORT uFramingBreakErrorCount;
  322. USHORT uOtherErrorCount;
  323. BOOL fCommOpen;
  324. FCOMSETTINGS CurSettings;
  325. #ifdef WIN32
  326. # define NUM_OVS 2 // Need atleast 2 to get true overlaped I/O
  327. // We maintain a queue of overlapped structures, having upto
  328. // NUM_OVS overlapped writes pending. If NUM_OVS writes are pending,
  329. // we do a GetOverlappedResult(fWait=TRUE) on the earliest write, and
  330. // then reuse that structure...
  331. OVERLAPPED ovAux; // For ReadFile and WriteFile(MyWriteComm only).
  332. OVREC rgovr[NUM_OVS]; // For WriteFile
  333. UINT uovFirst;
  334. UINT uovLast;
  335. UINT covAlloced;
  336. BOOL fDoOverlapped;
  337. BOOL fovInited;
  338. OVREC *lpovrCur;
  339. #endif // WIN32
  340. #ifdef ADAPTIVE_ANSWER
  341. BYTE fEnableHandoff:1; // True if we are to enable adaptive answer
  342. BYTE fDataCall:1; // True if a data call is active.
  343. #endif // ADAPTIVE_ANSWER
  344. } FCOM_COMM;
  345. //
  346. // NCUPARAMS is defined in headers\ncuparm.h, included by .\modemddi.h
  347. // we will force define modemddi.h
  348. //
  349. #define REPLYBUFSIZE 400
  350. #define MAXKEYSIZE 128
  351. typedef struct {
  352. BYTE fModemInit :1; // Reset & synced up with modem
  353. BYTE fOffHook :1; // Online (either dialled or answered)
  354. BOOL fInDial, fInAnswer, fInDialog;
  355. } FCOM_STATUS;
  356. typedef struct {
  357. DWORD dwDialCaps; // One of the LINEDEVCAPSFLAGS_* defined in filet30.h
  358. // (and also in tapi.h)
  359. } MODEMEXTCAPS, FAR *LPMODEMEXTCAPS;
  360. typedef struct {
  361. BYTE bLastReply[REPLYBUFSIZE+1];
  362. #ifdef ADAPTIVE_ANSWER
  363. BYTE bEntireReply[REPLYBUFSIZE+1]; // Used only for storing
  364. #endif // ADAPTIVE_ANSWER
  365. TO toDialog, toZero;
  366. CMDTAB CurrCmdTab;
  367. MODEMCAPS CurrMdmCaps;
  368. MODEMEXTCAPS CurrMdmExtCaps;
  369. // Following point to the location of the profile information.
  370. # define MAXKEYSIZE 128
  371. DWORD dwProfileID;
  372. char rgchKey[MAXKEYSIZE];
  373. char rgchOEMKey[MAXKEYSIZE];
  374. } FCOM_MODEM;
  375. // Inst from fxrn\efaxrun.h
  376. typedef enum { IDLE1, BEFORE_ANSWER, BEFORE_RECVCAPS, SENDDATA_PHASE,
  377. SENDDATA_BETWEENPAGES, /** BEFORE_HANGUP, BEFORE_ACCEPT, **/
  378. BEFORE_RECVPARAMS, RECVDATA_PHASE, RECVDATA_BETWEENPAGES,
  379. SEND_PENDING } STATE;
  380. #define MAXRECV 50
  381. #define FILENAMESIZE 15
  382. #define PHONENUMSIZE 60
  383. #define PATHSIZE 150
  384. #define MAXUSERATCMDLEN 80
  385. #define MAXSECTIONLENGTH 80
  386. typedef struct
  387. {
  388. USHORT uNumPages; // keep a running tally as we process the file
  389. USHORT vMsgProtocol;
  390. USHORT vSecurity;
  391. USHORT Encoding;
  392. #ifdef COMPRESS
  393. USHORT vMsgCompress;
  394. #endif
  395. DWORD AwRes;
  396. USHORT PageWidth;
  397. USHORT PageLength;
  398. USHORT fLin;
  399. USHORT fLastPage;
  400. DWORD lNextHeaderOffset;
  401. DWORD lDataOffset;
  402. DWORD lDataSize;
  403. enum {
  404. RFS_DEINIT=0, // Either before WriteFileHeader or after WriteFileEnder
  405. RFS_INIT, // After file opened, but before first StartWritePage
  406. RFS_INSIDE_PAGE, // We've called StartWritePage but not EndWritePage
  407. RFS_AFTER_PAGE // After EndWritePage
  408. } erfs; // Receive File State
  409. char szID[MAXFHBIDLEN + 2];
  410. }
  411. AWFILEINFO, FAR* LPAWFI;
  412. #define MAX_REMOTE_MACHINECAPS_SIZE 256
  413. typedef struct {
  414. BOOL fInited;
  415. BOOL fAbort;
  416. BOOL fExternalHandle; // TRUE iff the comm port handle was
  417. // supplied from outside.
  418. // BOOL fDiskError;
  419. // BOOL fInternalError;
  420. // BOOL fRinging;
  421. STATE state;
  422. HWND hwndSend;
  423. HWND hwndRecv;
  424. HWND hwndListen;
  425. USHORT uRingMessage; // message to post on RING
  426. HWND hwndStatus;
  427. DWORD dwLineID;
  428. USHORT usLineIDType;
  429. USHORT uModemClass;
  430. LONG sSendBufSize;
  431. USHORT uSendDataSize;
  432. BOOL fSendPad;
  433. BYTE szFaxDir[PATHSIZE + FILENAMESIZE + 1]; // add space to zap in file names
  434. USHORT cbFaxDir;
  435. ATOM aPhone;
  436. ATOM aCapsPhone; // Phone number be used for storing capabilities..
  437. // Typically in canonical form...
  438. char szPath[PATHSIZE + FILENAMESIZE + 1];
  439. char szFile[FILENAMESIZE];
  440. HFILE hfileMG3, hfileEFX, hfileIFX;
  441. BOOL fReceiving;
  442. BOOL fSending;
  443. #define MAXRECIPNAMELEN 128
  444. #define MAXSUBJECTLEN 40
  445. #define MAXSENDERLEN 40
  446. // default RecipName
  447. BYTE szDefRecipName[MAXRECIPNAMELEN + 2];
  448. BYTE szDefRecipAddr[MAXRECIPNAMELEN + 2];
  449. BYTE szDefSubject[MAXSUBJECTLEN + 2];
  450. BYTE szNamedSubject[MAXSUBJECTLEN + 2];
  451. BYTE szDefSender[MAXSENDERLEN + 2];
  452. BYTE szLocalID[MAXRECIPNAMELEN + 2];
  453. AWFILEINFO awfi;
  454. long cbPage;
  455. // long cbPageStart;
  456. long cbBlockStart; // file ptr to start of block
  457. long cbBlockSize; // size of block so far
  458. HFILE hfile;
  459. BCwithTEXT SendCaps;
  460. BCwithTEXT RemoteRecvCaps;
  461. BCwithTEXT SendParams;
  462. BCwithTEXT RecvParams;
  463. //BC RemoteRecvCaps;
  464. //BC SendParams;
  465. //BC RecvParams;
  466. USHORT uPageAcks;
  467. USHORT HorizScaling, VertScaling;
  468. USHORT HorizScaling300dpi, VertScaling300dpi;
  469. NCUPARAMS NcuParams;
  470. MODEMPARAMS ModemParams; // added in the add-class0 hack
  471. // HMODEM hModem;
  472. // HLINE hLine;
  473. PROTPARAMS ProtParams;
  474. DWORD FixSerialSpeed;
  475. // replaced by ProtParams
  476. // USHORT HighestSendSpeed, LowestSendSpeed;
  477. // BOOL fEnableV17Send, fEnableV17Recv;
  478. // BOOL fDisableECM;
  479. // BOOL f64ByteECM;
  480. BOOL fDisableG3ECM; // If TRUE, will disable *sending* of MMR
  481. // (so we don't use ECM when sending to
  482. // fax machines).
  483. BOOL fDisableSECtoMR; // If TRUE, we won't try to translate
  484. BOOL fDisableMRRecv; // If TRUE, we won't advertise ability
  485. // to receive MR..
  486. USHORT uCopyQualityCheckLevel;
  487. BYTE szWindowsDir[PATHSIZE + FILENAMESIZE + 1]; // add space to zap in DLL names
  488. USHORT cbWindowsDir;
  489. BOOL fProtInited; // for cleanups
  490. #ifdef TSK
  491. ATOM aFileMG3, aFileIFX, aFileEFX;
  492. #endif //TSK
  493. USHORT uRecvPageAck;
  494. USHORT uNumBadPages;
  495. #ifdef CHK
  496. BOOL fRecvChecking;
  497. #endif //CHK
  498. #ifdef SEC
  499. BOOL fSendRecoding;
  500. LPBUFFER lpbfPrev;
  501. BOOL fPassedEOP;
  502. #endif //SEC
  503. // Failure Codes
  504. USHORT uFirstFailureCode;
  505. USHORT uLastFailureCode;
  506. BOOL fLogFailureCode; // write failures to efaxtrans.log
  507. HFILE hfileFailureLog;
  508. // Prevent re-entry in FreeOrGetDll + ProcessANswerModeReturn loop
  509. // Re-entry can only happen inside the dialog box so we don't need
  510. // an atomic test-and-set. See bug#1181
  511. BOOL fChangingAnswerMode;
  512. // If PostMessage of vital messages (i.e. FILET30DONE only) fails
  513. // (which can happen if the msg queue is full), then try to post
  514. // it again later. See bug#1276
  515. MSG PostMsg;
  516. DWORD dwProfileID;
  517. char rgchSection[MAXSECTIONLENGTH];
  518. BOOL fInPollReq;
  519. #ifdef POLLREQ
  520. USHORT PollType;
  521. BOOL fPollNoSupportErr;
  522. char szDocName[MAXTOTALIDLEN+3];
  523. char szPassword[MAXTOTALIDLEN+3];
  524. BCwithPOLL SendPollReq;
  525. #endif
  526. #ifdef COMPRESS
  527. BOOL fDisableCmprsSend; // If true, we don't create compressed fls.
  528. BOOL fDisableCmprsRecv; // If true, we don't say we support cmprs.
  529. HFILE hfileEFXCmprs; // Handle of internally generated compressed
  530. // file. This file is opened in OpenSendFiles (fileio.c).
  531. // and closed on error (ErrCleanup, init.c)
  532. // or when the call is complete (EndOfCall, init.c)
  533. // From both places, I call the function
  534. // DeleteCompressedFile, fileio.c
  535. BOOL fCreatedEFXCmprs; // True if we've created this file.
  536. char szEFXCmprsFile[MAX_PATH]; // full path name
  537. #endif
  538. BOOL fReinitClass2; // Set in FileT30Init, used and cleared
  539. // in bgt30.c (call to lpfnClass2Calle[er].
  540. #ifdef ADAPTIVE_ANSWER
  541. BOOL fEnableHandoff;
  542. #endif // ADAPTIVE_ANSWER
  543. #ifdef USECAPI
  544. BYTE bRemoteMachineCapsData[MAX_REMOTE_MACHINECAPS_SIZE];
  545. #else // !USECAPI
  546. BYTE szTextCaps[TEXTCAPSSIZE];
  547. #endif // !USECAPI
  548. }
  549. INSTDATA, *PINSTDATA;
  550. //memory management
  551. #define STATICBUFSIZE (MY_BIGBUF_ACTUALSIZE * 2)
  552. #define STATICBUFCOUNT 2
  553. typedef struct {
  554. HANDLE hComm;
  555. CHAR szDeviceName[1];
  556. } DEVICEID, FAR * LPDEVICEID;
  557. // Device Setting Information BrianL 10/29/96
  558. //
  559. typedef struct tagDEVCFGHDR {
  560. DWORD dwSize;
  561. DWORD dwVersion;
  562. DWORD fdwSettings;
  563. } DEVCFGHDR;
  564. typedef struct tagDEVCFG {
  565. DEVCFGHDR dfgHdr;
  566. COMMCONFIG commconfig;
  567. } DEVCFG, *PDEVCFG, FAR* LPDEVCFG;
  568. #define IDVARSTRINGSIZE (sizeof(VARSTRING)+128)
  569. #define ASYNC_TIMEOUT 120000L
  570. #define ASYNC_SHORT_TIMEOUT 20000L
  571. #define BAD_HANDLE(h) (!(h) || (h)==INVALID_HANDLE_VALUE)
  572. // ASCII stuff
  573. typedef struct _FAX_RECEIVE_A {
  574. DWORD SizeOfStruct;
  575. LPSTR FileName;
  576. LPSTR ReceiverName;
  577. LPSTR ReceiverNumber;
  578. DWORD Reserved[4];
  579. } FAX_RECEIVE_A, *PFAX_RECEIVE_A;
  580. typedef struct _FAX_SEND_A {
  581. DWORD SizeOfStruct;
  582. LPSTR FileName;
  583. LPSTR CallerName;
  584. LPSTR CallerNumber;
  585. LPSTR ReceiverName;
  586. LPSTR ReceiverNumber;
  587. DWORD Reserved[4];
  588. } FAX_SEND_A, *PFAX_SEND_A;
  589. typedef struct _COMM_CACHE {
  590. DWORD dwMaxSize;
  591. DWORD dwCurrentSize;
  592. DWORD dwOffset;
  593. DWORD fReuse;
  594. char lpBuffer[4096];
  595. } COMM_CACHE;
  596. typedef struct {
  597. // BYTE fStuffZERO :1; // not used. Just set cbLineMin instead
  598. UWORD cbLineMin;
  599. // Output filtering (DLE stuffing and ZERO stuffing only)
  600. // All inited in FComOutFilterInit()
  601. LPB lpbFilterBuf;
  602. UWORD cbLineCount; // Has to be 16 bits
  603. BYTE bLastOutByte; // Stuff: last byte of previous input buffer
  604. // Input filtering (DLE stripping) only.
  605. // All inited in FComInFilterInit()
  606. BYTE fGotDLEETX :1;
  607. BYTE bPrevIn; // Strip::last byte of prev buffer was DLE
  608. UWORD cbPost;
  609. #define POSTBUFSIZE 20
  610. BYTE rgbPost[POSTBUFSIZE+1];
  611. } FCOM_FILTER;
  612. typedef struct {
  613. BYTE carry;
  614. BYTE dec_width;
  615. BYTE len;
  616. enum { NORMAL=0, FLAG=1, ABORT=2 } flagabort;
  617. } DECODESTATE, far* LPDECODESTATE;
  618. typedef struct {
  619. BYTE carry;
  620. BYTE enc_width;
  621. BYTE len;
  622. } ENCODESTATE, far* LPENCODESTATE;
  623. typedef struct {
  624. // BOOL fFrameSend;
  625. // BOOL fFrameRecv;
  626. // Used by both encode and decode, so can't be
  627. // both on at the same time
  628. LPB lpbBuf;
  629. USHORT cbBufSize;
  630. // Output framing
  631. // All inited in FramingSendSetup()
  632. ENCODESTATE EncodeState;
  633. // Input frame decoding
  634. // All inited in FramingRecvSetup()
  635. DECODESTATE DecodeState;
  636. USHORT cbBufCount; // data count in buf
  637. LPB lpbBufSrc; // start of data in buf
  638. SWORD swEOF;
  639. } COMMODEM_FRAMING;
  640. #define MAXDUMPFRAMES 100
  641. #define MAXDUMPSPACE 400
  642. typedef struct
  643. {
  644. USHORT uNumFrames;
  645. USHORT uFreeSpaceOff;
  646. USHORT uFrameOff[MAXDUMPFRAMES]; // arrays of offsets to frames
  647. BYTE b[MAXDUMPSPACE];
  648. } PROTDUMP, FAR* LPPROTDUMP;
  649. typedef struct {
  650. DWORD fAvail;
  651. DWORD ThreadId;
  652. HANDLE FaxHandle;
  653. LPVOID pTG;
  654. HLINE LineHandle;
  655. HCALL CallHandle;
  656. DWORD DeviceId;
  657. HANDLE CompletionPortHandle;
  658. ULONG_PTR CompletionKey;
  659. DWORD TiffThreadId;
  660. DWORD TimeStart;
  661. DWORD TimeUpdated;
  662. DWORD CkSum;
  663. } T30_RECOVERY_GLOB;
  664. typedef struct {
  665. DWORD dwContents; // Set to 1 (indicates containing key)
  666. DWORD dwKeyOffset; // Offset to key from start of this struct.
  667. // (not from start of LINEDEVCAPS ).
  668. // 8 in our case.
  669. BYTE rgby[1]; // place containing null-terminated
  670. // registry key.
  671. } MDM_DEVSPEC, FAR * LPMDM_DEVSPEC;