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.

92 lines
2.9 KiB

  1. //typedef unsigned char BYTE;
  2. const BYTE terminator[5] = {0x1B, 0x7E, 0x01, 0x00, 0x00};
  3. #define RL4_MAXISIZE 0xFFFE
  4. #define RL4_MAXHEIGHT 0xFFFE
  5. #define RL4_MAXWIDTH 4096
  6. #define VALID 0x00
  7. #define INVALID 0x01
  8. LPBYTE RL_ImagePtr;
  9. LPBYTE RL_CodePtr;
  10. LPBYTE RL_BufEnd;
  11. WORD RL_ImageSize;
  12. WORD RL_CodeSize;
  13. WORD FAR PASCAL RL_ECmd(LPBYTE, LPBYTE, WORD);
  14. BYTE FAR PASCAL RL_Init(LPBYTE, LPBYTE, WORD);
  15. char FAR PASCAL RL_Enc( void );
  16. #define RL4_BLACK 0x00
  17. #define RL4_WHITE 0x01
  18. #define RL4_BYTE 0x00
  19. #define RL4_NONBYTE 0x01
  20. #define RL4_CLEAN 0x00
  21. #define RL4_DIRTY 0x01
  22. #define RL4_FIRST 0x00
  23. #define RL4_SECOND 0x01
  24. #define COMP_FAIL 0x00
  25. #define COMP_SUCC 0x01
  26. #define CODBUFSZ 0x7FED /* NOTE : THIS SHOULD MATCH THE SPACE GIVEN */
  27. /* TO COMPRESSED DATA BY THE DEVICE */
  28. /* DRIVER. CHANGE THIS BASED ON YOUR */
  29. /* OWN DISCRETION. C.Chi */
  30. /* Variables */
  31. LPBYTE RL4_CodePtr;
  32. LPBYTE RL4_ImagePtr;
  33. WORD RL4_IWidth;
  34. WORD RL4_IHeight;
  35. WORD RL4_CurrRL;
  36. WORD RL4_NblCnt;
  37. BYTE RL4_RowAttrib;
  38. BYTE RL4_CurrColor;
  39. BYTE RL4_Status;
  40. BYTE RL4_Nibble;
  41. WORD RL4_ISize;
  42. WORD RL4_CodeSize;
  43. LPBYTE RL4_BufEnd;
  44. BYTE BUF_OVERFLOW;
  45. /* macros */
  46. #define PUTNBL(lval, nblcnt) { \
  47. short i; \
  48. for (i=nblcnt ; i>0; i--) \
  49. { if (RL4_Nibble==RL4_FIRST) \
  50. { RL4_Nibble = RL4_SECOND; \
  51. *RL4_CodePtr = (BYTE) (lval >> ((i-1)*4)) << 4 ; \
  52. } else \
  53. { RL4_Nibble = RL4_FIRST; \
  54. *RL4_CodePtr |= (BYTE) (lval >> ((i-1)*4)) ; \
  55. RL4_CodePtr++; \
  56. if (RL4_CodePtr>RL4_BufEnd) \
  57. { BUF_OVERFLOW = 1; return; \
  58. } \
  59. } \
  60. } \
  61. }
  62. /* Function Prototypes */
  63. WORD FAR PASCAL RL4_ECmd (LPBYTE, LPBYTE, WORD, WORD, WORD);
  64. BYTE FAR PASCAL RL4_ChkParms (LPBYTE, LPBYTE, WORD , WORD, WORD );
  65. char FAR PASCAL RL4_Enc (void);
  66. char FAR PASCAL RL4_ConvRow(LPBYTE);
  67. char FAR PASCAL RL4_ConvLast(LPBYTE, WORD);
  68. char FAR PASCAL RL4_ByteProc (BYTE);
  69. char FAR PASCAL RL4_EncRow(LPBYTE, WORD);
  70. WORD FAR PASCAL RL4_TransRun(WORD);
  71. char RL4_PutNbl(long , short );