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.

83 lines
1.4 KiB

  1. /* File: \foo.c (Created: 01-Nov-1991)
  2. *
  3. * Copyright 1990 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 2 $
  7. * $Date: 4/05/02 4:39p $
  8. */
  9. #include <windows.h>
  10. #pragma hdrstop
  11. // #define DEBUGSTR
  12. #define BYTE unsigned char
  13. #include <tdll\stdtyp.h>
  14. #include <tdll\com.h>
  15. #include <tdll\session.h>
  16. #include <tdll\assert.h>
  17. #include "foo.h"
  18. #include "xfr_todo.h"
  19. int fooComSendClear(HCOM h, stFB *pB)
  20. {
  21. int rc;
  22. pB->usSend = 0;
  23. rc = ComSendClear(h);
  24. //assert(rc == COM_OK);
  25. return rc;
  26. }
  27. int fooComSendChar(HCOM h, stFB *pB, BYTE c)
  28. {
  29. int rc = COM_OK;
  30. if (sizeof (pB->acSend) > pB->usSend)
  31. {
  32. pB->acSend[pB->usSend++] = c;
  33. rc = ComSndBufrSend(h, (void *)pB->acSend, pB->usSend, 200);
  34. //assert(rc == COM_OK);
  35. pB->usSend = 0;
  36. }
  37. else
  38. {
  39. rc = COM_NOT_ENOUGH_MEMORY;
  40. }
  41. return rc;
  42. }
  43. int fooComSendPush(HCOM h, stFB *pB)
  44. {
  45. int rc = COM_OK;
  46. if (pB->usSend > 0)
  47. {
  48. rc = ComSndBufrSend(h, (void *)pB->acSend, pB->usSend, 200);
  49. //assert(rc == COM_OK);
  50. pB->usSend = 0;
  51. }
  52. return rc;
  53. }
  54. int fooComSendCharNow(HCOM h, stFB *pB, BYTE c)
  55. {
  56. int rc;
  57. rc = fooComSendChar(h, pB, c);
  58. //assert(rc == COM_OK);
  59. if (rc == COM_OK)
  60. {
  61. rc = fooComSendPush(h, pB);
  62. //assert(rc == COM_OK);
  63. }
  64. return rc;
  65. }