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.

105 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. spwin9xuninstall.h
  5. Abstract:
  6. Author:
  7. Jay Krell (a-JayK) December 2000
  8. Revision History:
  9. --*/
  10. #pragma once
  11. #include "spcab.h"
  12. #define BACKUP_IMAGE_IS_CAB 1
  13. #if !BACKUP_IMAGE_IS_CAB
  14. #pragma pack(push,1)
  15. typedef struct {
  16. DWORD Signature;
  17. DWORD FileCount;
  18. struct {
  19. // zero means "no directory"
  20. DWORD Low;
  21. DWORD High;
  22. } DirectoryOffset;
  23. } BACKUP_IMAGE_HEADER, *PBACKUP_IMAGE_HEADER;
  24. typedef struct {
  25. DWORD FileSize; // we don't support files > 4G
  26. WORD FileNameBytes;
  27. FILE_BASIC_INFORMATION Attributes;
  28. // file name is next (NT name in unicode)
  29. // file content is next
  30. } BACKUP_FILE_HEADER, *PBACKUP_FILE_HEADER;
  31. #pragma pack(pop)
  32. #define BACKUP_IMAGE_SIGNATURE 0x53574A01 // JWS plus version
  33. #else
  34. #pragma pack(push,1)
  35. typedef struct {
  36. BYTE Pad;
  37. } BACKUP_IMAGE_HEADER, *PBACKUP_IMAGE_HEADER;
  38. typedef struct {
  39. BYTE Pad;
  40. } BACKUP_FILE_HEADER, *PBACKUP_FILE_HEADER;
  41. #pragma pack(pop)
  42. typedef struct {
  43. // This is actually a OCAB_HANDLE / PFDI_CAB_HANDLE half the time, but this is ok.
  44. CCABHANDLE CabHandle;
  45. BOOL (*CloseCabinet)(PVOID CabHandle);
  46. } *BACKUP_IMAGE_HANDLE;
  47. #endif
  48. BOOLEAN
  49. SppPutFileInBackupImage(
  50. IN BACKUP_IMAGE_HANDLE ImageHandle,
  51. IN OUT PLARGE_INTEGER ImagePos,
  52. IN OUT PBACKUP_IMAGE_HEADER ImageHeader,
  53. IN PWSTR DosPath
  54. );
  55. BOOLEAN
  56. SppCloseBackupImage (
  57. IN BACKUP_IMAGE_HANDLE BackupImageHandle,
  58. IN PBACKUP_IMAGE_HEADER ImageHeader, OPTIONAL
  59. IN PWSTR JournalFile OPTIONAL
  60. );
  61. BOOLEAN
  62. SppWriteToFile (
  63. IN HANDLE FileHandle,
  64. IN PVOID Data,
  65. IN UINT DataSize,
  66. IN OUT PLARGE_INTEGER WritePos OPTIONAL
  67. );
  68. BOOLEAN
  69. SppReadFromFile (
  70. IN HANDLE FileHandle,
  71. OUT PVOID Data,
  72. IN UINT DataBufferSize,
  73. OUT PINT BytesRead,
  74. IN OUT PLARGE_INTEGER ReadPos OPTIONAL
  75. );