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.

127 lines
3.6 KiB

  1. /*===========================================================================*/
  2. /* Copyright (c) 1987 - 1988, Future Soft Engineering, Inc. */
  3. /* Houston, Texas */
  4. /*===========================================================================*/
  5. #define NOLSTRING TRUE /* jtf win3 mod */
  6. #include <windows.h>
  7. #include "port1632.h"
  8. #include "dcrc.h"
  9. #include "dynacomm.h"
  10. #include "task.h"
  11. /*---------------------------------------------------------------------------*/
  12. /* xferPauseResume() - [mbb] */
  13. /*---------------------------------------------------------------------------*/
  14. VOID xferPauseResume(BOOL bPause, BOOL bResume)
  15. {
  16. setXferCtrlButton(IDPAUSE, !(xferPaused = bPause) ? STR_PAUSE : STR_RESUME);
  17. if(bResume)
  18. {
  19. if(xferViewPause > 0)
  20. xferEndTimer = 0;
  21. xferWaitEcho = FALSE;
  22. }
  23. }
  24. /*---------------------------------------------------------------------------*/
  25. /* xferStopBreak() - [mbb] */
  26. /*---------------------------------------------------------------------------*/
  27. VOID xferStopBreak(BOOL bStop)
  28. {
  29. if(bStop)
  30. {
  31. xferBytes = 0;
  32. xferEndTimer = 0;
  33. xferWaitEcho = FALSE;
  34. xferStopped = TRUE;
  35. }
  36. else
  37. PostMessage(hTermWnd, WM_KEYDOWN, VK_CANCEL, 0L);
  38. }
  39. /*---------------------------------------------------------------------------*/
  40. /* xferEnd() - Termination processing for file transfers. [scf] */
  41. /*---------------------------------------------------------------------------*/
  42. VOID xferEnd()
  43. {
  44. BYTE OEMname[STR255]; /* jtf 3.20 */
  45. LPSTR lpBuffer; /* rjs bugs 016 */
  46. if (xferFlag == XFRRCV) /* rjs bugs 016 */
  47. {
  48. lpBuffer = GlobalLock(xferBufferHandle); /* rjs bugs 016 */
  49. if (xferBufferCount > 0) /* rjs bugs 016 */
  50. _lwrite(xferRefNo, (LPSTR)lpBuffer, xferBufferCount); /* rjs bugs 016 */
  51. GlobalUnlock(xferBufferHandle); /* rjs bugs 016 */
  52. xferBufferCount = 0; /* rjs bugs 016 */
  53. GlobalFree(xferBufferHandle); /* rjs bugs 016 */
  54. }
  55. if(xferViewPause > 0)
  56. {
  57. xferViewPause = 0;
  58. xferViewLine = 0;
  59. }
  60. xferFlag = XFRNONE;
  61. xferWaitEcho = FALSE;
  62. xferStopped = FALSE;
  63. chrHeight = stdChrHeight;
  64. chrWidth = stdChrWidth;
  65. showXferCtrls(0); /* mbbx 2.00: xfer ctrls... */
  66. xferPauseResume(FALSE, FALSE);
  67. *strRXErrors =
  68. *strRXBytes =
  69. *strRXFname =
  70. *strRXFork = 0;
  71. if(xferRefNo)
  72. _lclose(xferRefNo);
  73. LoadString(hInst, STR_TEMPFILE, (LPSTR) xferVRefNum+(*xferVRefNum)+1, 16);
  74. // JYF -- replace below two lines with the following if()
  75. // to remove the use of AnsiToOem()
  76. //
  77. //AnsiToOem((LPSTR) (xferVRefNum+1), (LPSTR) OEMname); /* jtf 3.20 */
  78. //if(fileExist(OEMname)) /* jtf 3.20 */
  79. if (fileExist((LPSTR)xferVRefNum+1))
  80. MDeleteFile(xferVRefNum+1);
  81. KER_getflag = FALSE;
  82. flashIcon(TRUE, TRUE);
  83. }
  84. /*---------------------------------------------------------------------------*/
  85. /* rxEventLoop() - [scf] */
  86. /*---------------------------------------------------------------------------*/
  87. /* mbbx 1.04: moved from RXEVNTLP.C ... */
  88. VOID rxEventLoop()
  89. {
  90. MSG msg;
  91. // while(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
  92. // mainEventLoop ();
  93. idleProcess();
  94. #ifdef SLEEP_FOR_CONTEXT_SWTICH
  95. Sleep((DWORD)5);
  96. #endif
  97. }