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.

78 lines
2.2 KiB

  1. /*
  2. ** lzpriv.h - Private information for LZEXPAND.DLL.
  3. **
  4. ** Author: DavidDi
  5. */
  6. // Constants
  7. /////////////
  8. #define IN_BUF_LEN (1 + 1024) // size of input buffer
  9. #define EXP_BUF_LEN 1024 // size of expanded data buffer
  10. #define RING_BUF_LEN 4096 // size of ring buffer data area
  11. #define MAX_RING_BUF_LEN 4224 // total size of ring buffer
  12. #define MAX_CHAR_CODES 400 // maximum number of character codes
  13. #define MAX_LZFILES 16 // maximum number of LZFile structs
  14. #define LZ_TABLE_BIAS 1024 // offset of first LZFile entry in table of
  15. // handles, should be > 255
  16. // (255 == largest possible DOS file handle)
  17. #define STYLE_MASK 0xff0f // wStyle mask used to determine whether
  18. // or not to set up an LZFile information
  19. // struct in LZOpenFile()
  20. // (used to ignore SHARE bits)
  21. #define LZAPI PASCAL
  22. // Decoding bit flags used in LZFile.DecodeState.wFlags:
  23. #define LZF_INITIALIZED 0x00000001 // 1 ==> buffers have been initialized
  24. // 0 ==> not initialized yet
  25. // DOS Extended Error Codes
  26. #define DEE_FILENOTFOUND 0x02 // File not found. Awww...
  27. // Types
  28. /////////
  29. typedef struct tagLZFile
  30. {
  31. int dosh; /* DOS file handle of compressed file */
  32. BYTE byteAlgorithm; /* compression algorithm */
  33. WORD wFlags; /* bit flags */
  34. unsigned long cbulUncompSize; /* uncompressed file size */
  35. unsigned long cbulCompSize; /* compressed file size */
  36. RTL_CRITICAL_SECTION semFile; /* protect against >1 threads LZReading the same file all at once */
  37. long lCurSeekPos; /* expanded file pointer position */
  38. PLZINFO pLZI;
  39. } LZFile;
  40. // Globals
  41. ///////////
  42. extern HANDLE rghLZFileTable[MAX_LZFILES];
  43. // Prototypes
  44. //////////////
  45. // state.c
  46. VOID SetGlobalBuffers(LZFile FAR *pLZFile);
  47. VOID SaveDecodingState(LZFile FAR *pLZFile);
  48. VOID RestoreDecodingState(LZFile FAR *pLZFile);
  49. INT ConvertWin32FHToDos(HFILE DoshSource);
  50. HFILE ConvertDosFHToWin32(INT DoshSource);
  51.