Windows NT 4.0 source code leak
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.

49 lines
1.1 KiB

4 years ago
  1. /***
  2. *w4io.h - fake FILE structure for Win 4 printf/sprintf/debug printf support
  3. *
  4. */
  5. #if defined(M_I386) || defined(WIN32)
  6. # ifndef WIN32
  7. # define WIN32
  8. # endif
  9. #elif !defined(M_I86LM)
  10. # error Must be FLAT or LARGE model.
  11. #endif
  12. #ifndef NULL
  13. # define NULL 0
  14. #endif
  15. struct w4io
  16. {
  17. union
  18. {
  19. struct
  20. {
  21. wchar_t *_pwcbuf; // wchar_t output buffer
  22. wchar_t *_pwcstart;
  23. } wc;
  24. struct
  25. {
  26. char *_pchbuf; // char output buffer
  27. char *_pchstart;
  28. } ch;
  29. } buf ;
  30. unsigned int cchleft; // output buffer character count
  31. void (_cdecl *writechar)(int ch,
  32. int num,
  33. struct w4io *f,
  34. int *pcchwritten);
  35. };
  36. #define pwcbuf buf.wc._pwcbuf
  37. #define pwcstart buf.wc._pwcstart
  38. #define pchbuf buf.ch._pchbuf
  39. #define pchstart buf.ch._pchstart
  40. #define REG1 register
  41. #define REG2 register
  42. /* prototypes */
  43. int _cdecl w4iooutput(struct w4io *stream, const char *format, va_list argptr);