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.

168 lines
4.4 KiB

  1. //
  2. // Compression stuff
  3. //
  4. typedef enum {
  5. CompressNone,
  6. CompressMrci1,
  7. CompressMrci2,
  8. CompressMax
  9. } CompressionType;
  10. typedef BOOL(WINAPI COMPRESSNOTIFICATIONA)(
  11. IN PCSTR FileName,
  12. IN LONGLONG FileSize,
  13. OUT PBOOL ExtractFile,
  14. IN OUT PCSTR *NewFileName
  15. );
  16. typedef COMPRESSNOTIFICATIONA *PCOMPRESSNOTIFICATIONA;
  17. typedef BOOL(WINAPI COMPRESSNOTIFICATIONW)(
  18. IN PCWSTR FileName,
  19. IN LONGLONG FileSize,
  20. OUT PBOOL ExtractFile,
  21. IN OUT PCWSTR *NewFileName
  22. );
  23. typedef COMPRESSNOTIFICATIONW *PCOMPRESSNOTIFICATIONW;
  24. typedef struct {
  25. HANDLE CurrFileHandle;
  26. UINT FirstFileIndex;
  27. UINT CurrFileIndex;
  28. LONGLONG MaxFileSize;
  29. LONGLONG CurrFileSize;
  30. LONGLONG FilesStored;
  31. PCSTR StorePath;
  32. PCSTR MainFilePattern;
  33. PBYTE ReadBuffer;
  34. PBYTE CompBuffer;
  35. PBYTE ExtraBuffer;
  36. } COMPRESS_HANDLEA, *PCOMPRESS_HANDLEA;
  37. typedef struct {
  38. HANDLE CurrFileHandle;
  39. UINT FirstFileIndex;
  40. UINT CurrFileIndex;
  41. LONGLONG MaxFileSize;
  42. LONGLONG CurrFileSize;
  43. LONGLONG FilesStored;
  44. PCWSTR StorePath;
  45. PCWSTR MainFilePattern;
  46. PBYTE ReadBuffer;
  47. PBYTE CompBuffer;
  48. PBYTE ExtraBuffer;
  49. } COMPRESS_HANDLEW, *PCOMPRESS_HANDLEW;
  50. BOOL
  51. CompressCreateHandleA (
  52. IN PCSTR StorePath,
  53. IN PCSTR MainFilePattern,
  54. IN UINT StartIndex,
  55. IN LONGLONG MaxFileSize,
  56. OUT PCOMPRESS_HANDLEA CompressedHandle
  57. );
  58. BOOL
  59. CompressCreateHandleW (
  60. IN PCWSTR StorePath,
  61. IN PCWSTR MainFilePattern,
  62. IN UINT StartIndex,
  63. IN LONGLONG MaxFileSize,
  64. OUT PCOMPRESS_HANDLEW CompressedHandle
  65. );
  66. BOOL
  67. CompressOpenHandleA (
  68. IN PCSTR StorePath,
  69. IN PCSTR MainFilePattern,
  70. IN UINT StartIndex,
  71. OUT PCOMPRESS_HANDLEA CompressedHandle
  72. );
  73. BOOL
  74. CompressOpenHandleW (
  75. IN PCWSTR StorePath,
  76. IN PCWSTR MainFilePattern,
  77. IN UINT StartIndex,
  78. OUT PCOMPRESS_HANDLEW CompressedHandle
  79. );
  80. BOOL
  81. CompressFlushAndCloseHandleA (
  82. IN OUT PCOMPRESS_HANDLEA CompressedHandle
  83. );
  84. BOOL
  85. CompressFlushAndCloseHandleW (
  86. IN OUT PCOMPRESS_HANDLEW CompressedHandle
  87. );
  88. VOID
  89. CompressCleanupHandleA (
  90. IN OUT PCOMPRESS_HANDLEA CompressedHandle
  91. );
  92. VOID
  93. CompressCleanupHandleW (
  94. IN OUT PCOMPRESS_HANDLEW CompressedHandle
  95. );
  96. BOOL
  97. CompressAddFileToHandleA (
  98. IN PCSTR FileName,
  99. IN PCSTR StoredName,
  100. IN OUT PCOMPRESS_HANDLEA CompressedHandle
  101. );
  102. BOOL
  103. CompressAddFileToHandleW (
  104. IN PCWSTR FileName,
  105. IN PCWSTR StoredName,
  106. IN OUT PCOMPRESS_HANDLEW CompressedHandle
  107. );
  108. BOOL
  109. CompressExtractAllFilesA (
  110. IN PCSTR ExtractPath,
  111. IN OUT PCOMPRESS_HANDLEA CompressedHandle,
  112. IN PCOMPRESSNOTIFICATIONA CompressNotification OPTIONAL
  113. );
  114. BOOL
  115. CompressExtractAllFilesW (
  116. IN PCWSTR ExtractPath,
  117. IN OUT PCOMPRESS_HANDLEW CompressedHandle,
  118. IN PCOMPRESSNOTIFICATIONW CompressNotification OPTIONAL
  119. );
  120. BOOL
  121. CompressSetErrorMode (
  122. IN BOOL ErrorMode
  123. );
  124. #ifndef UNICODE
  125. #define COMPRESS_HANDLE COMPRESS_HANDLEA
  126. #define PCOMPRESS_HANDLE PCOMPRESS_HANDLEA
  127. #define COMPRESSNOTIFICATION COMPRESSNOTIFICATIONA
  128. #define PCOMPRESSNOTIFICATION PCOMPRESSNOTIFICATIONA
  129. #define CompressCreateHandle CompressCreateHandleA
  130. #define CompressOpenHandle CompressOpenHandleA
  131. #define CompressFlushAndCloseHandle CompressFlushAndCloseHandleA
  132. #define CompressCleanupHandle CompressCleanupHandleA
  133. #define CompressAddFileToHandle CompressAddFileToHandleA
  134. #define CompressExtractAllFiles CompressExtractAllFilesA
  135. #else
  136. #define COMPRESS_HANDLE COMPRESS_HANDLEW
  137. #define PCOMPRESS_HANDLE PCOMPRESS_HANDLEW
  138. #define COMPRESSNOTIFICATION COMPRESSNOTIFICATIONW
  139. #define PCOMPRESSNOTIFICATION PCOMPRESSNOTIFICATIONW
  140. #define CompressCreateHandle CompressCreateHandleW
  141. #define CompressOpenHandle CompressOpenHandleW
  142. #define CompressFlushAndCloseHandle CompressFlushAndCloseHandleW
  143. #define CompressCleanupHandle CompressCleanupHandleW
  144. #define CompressAddFileToHandle CompressAddFileToHandleW
  145. #define CompressExtractAllFiles CompressExtractAllFilesW
  146. #endif