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.

60 lines
1.6 KiB

  1. #include "stdafx.h"
  2. #include <windows.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <io.h>
  7. #include <fcntl.h>
  8. #include <dos.h>
  9. #include <fci.h>
  10. /*
  11. * When a CAB file reaches this size, a new CAB will be created
  12. * automatically. This is useful for fitting CAB files onto disks.
  13. *
  14. * If you want to create just one huge CAB file with everything in
  15. * it, change this to a very very large number.
  16. */
  17. #define MEDIA_SIZE 0x7fffffff
  18. /*
  19. * When a folder has this much compressed data inside it,
  20. * automatically flush the folder.
  21. *
  22. * Flushing the folder hurts compression a little bit, but
  23. * helps random access significantly.
  24. */
  25. #define FOLDER_THRESHOLD 0x7fffffff
  26. /*
  27. * Compression type to use
  28. */
  29. #define COMPRESSION_TYPE tcompTYPE_MSZIP
  30. typedef struct
  31. {
  32. long total_compressed_size; /* total compressed size so far */
  33. long total_uncompressed_size; /* total uncompressed size so far */
  34. long start_uncompressed_size;
  35. } client_state;
  36. extern ULONG g_CompressedPercentage;
  37. extern BOOL g_CancelCompression;
  38. /*
  39. * Function prototypes
  40. */
  41. void store_cab_name(char *cabname, int iCab);
  42. void set_cab_parameters(PCCAB cab_parms);
  43. BOOL test_fci(int num_files, char *file_list[]);
  44. void strip_path(char *filename, char *stripped_name);
  45. int get_percentage(unsigned long a, unsigned long b);
  46. char *return_fci_error_string(FCIERROR err);
  47. void UnicodeToAnsi1(wchar_t *pszW, LPSTR ppszA);
  48. BOOL Compress (wchar_t *CabName, wchar_t *fileName, DWORD * UploadTime);