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.

156 lines
5.0 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. SRShell.h
  5. Abstract:
  6. This file defines external constants and structures for SR UI and any
  7. related components.
  8. Revision History:
  9. Seong Kook Khang (SKKhang) 01/30/2000
  10. created
  11. Seong Kook Khang (SKKhang) 06/22/2000
  12. Expanded for Whistler
  13. ******************************************************************************/
  14. #ifndef _SRSHELL_H__INCLUDED_
  15. #define _SRSHELL_H__INCLUDED_
  16. /////////////////////////////////////////////////////////////////////////////
  17. //
  18. // Constants / Structures
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. // Restore Drive Info Flags
  22. #define RDIF_SYSTEM 0x00000001 // drive contains system
  23. #define RDIF_FROZEN 0x00000002 // drive is frozen
  24. #define RDIF_EXCLUDED 0x00000004 // drive is excluded
  25. #define RDIF_OFFLINE 0x00000008 // drive is not connected
  26. /////////////////////////////////////////////////////////////////////////////
  27. //
  28. // SR Restore Log
  29. //
  30. /////////////////////////////////////////////////////////////////////////////
  31. #define RSTRLOG_SIGNATURE1 0x72747372 // "rstr"
  32. #define RSTRLOG_SIGNATURE2 0x1A676F6C // "log" + EOF
  33. #define RSTRLOG_VER_MAJOR 3
  34. #define RSTRLOG_VER_MINOR 0
  35. #define RSTRLOG_VERSION MAKELONG(RSTRLOG_VER_MINOR, RSTRLOG_VER_MAJOR)
  36. // File headers of rstrlog.dat file.
  37. //
  38. struct SRstrLogHdrBase
  39. {
  40. DWORD dwSig1; // Signature (part 1/2)
  41. DWORD dwSig2; // Signature (part 2/2)
  42. DWORD dwVer; // Version
  43. };
  44. #define RLHF_SILENT 0x00000001
  45. #define RLHF_UNDO 0x00000002
  46. struct SRstrLogHdrV3
  47. {
  48. DWORD dwFlags; // Flags
  49. DWORD dwRPNum; // Chosen Restore Point ID
  50. DWORD dwRPNew; // Restore Point ID of the new "Restore" RP
  51. DWORD dwDrives; // Number of Drives
  52. };
  53. // Information about each drives follows SRstrLogHdrRPInfo:
  54. // 1. DWORD flags
  55. // 2. Dynamic sized string of drive letter or mount point.
  56. // 3. Dynamic sized string of unique volume name (GUID).
  57. struct SRstrLogHdrV3Ex
  58. {
  59. DWORD dwRPNew; // Restore Point ID of the new "Restore" RP
  60. DWORD dwCount; // Number of supposed-to-be entries
  61. // used to validate if every entry is in the log file.
  62. };
  63. // Constants to indicate result of Restore for each restore entries.
  64. //
  65. enum // Result Code for Log Entries
  66. {
  67. RSTRRES_UNKNOWN = 0,
  68. RSTRRES_FAIL, // 1 - Failure. (THE ONLY CONDITION TO ABORT RESTORE!)
  69. RSTRRES_OK, // 2 - Succeeded.
  70. //RSTRRES_WININIT, // 3 - Locked target, sent to wininit.ini.
  71. RSTRRES_LOCKED, // 3 - Locked target, use MoveFileEx.
  72. RSTRRES_DISKRO, // 4 - Target disk is read-only.
  73. RSTRRES_EXISTS, // 5 - Removed existing ghost file.
  74. RSTRRES_IGNORE, // 6 - Ignored special files, e.g. wininit.ini.
  75. RSTRRES_NOTFOUND, // 7 - Target file/dir not exists, ignored.
  76. RSTRRES_COLLISION, // 8 - Folder name conflict, existing dir was renamed.
  77. RSTRRES_OPTIMIZED, // 9 - Entry has been optimized, without any temp file.
  78. RSTRRES_LOCKED_ALT, // 10 - Locked target, but could be renamed. Use MoveFileEx to delete renamed file.
  79. RSTRRES_SENTINEL
  80. };
  81. #define RSTRLOGID_COLLISION 0xFFFFFFFF
  82. #define RSTRLOGID_ENDOFMAP 0xFFFFFFFE
  83. #define RSTRLOGID_STARTUNDO 0xFFFFFFFD
  84. #define RSTRLOGID_ENDOFUNDO 0xFFFFFFFC
  85. #define RSTRLOGID_SNAPSHOTFAIL 0xFFFFFFFB
  86. // Structure for restore entries stored in rstrlog.dat file.
  87. //
  88. // This structure will be followed by three entries of DWORD-aligned
  89. // strings: (1) source path (2) destination path (3) alternative path
  90. //
  91. struct SRstrEntryHdr
  92. {
  93. DWORD dwID; // Entry ID (zero-based). 0xFFFFFFFF means a collision entry.
  94. DWORD dwOpr; // Operation type
  95. INT64 llSeq; // Sequence Number
  96. //DWORD dwFlags; // Flags
  97. DWORD dwRes; // Result code
  98. DWORD dwErr; // WIN32 error code
  99. };
  100. /////////////////////////////////////////////////////////////////////////////
  101. //
  102. // SRRSTR.DLL (rstrcore)
  103. //
  104. /////////////////////////////////////////////////////////////////////////////
  105. /////////////////////////////////////////////////////////////////////////////
  106. // IRestoreContext
  107. struct IRestoreContext
  108. {
  109. virtual BOOL IsAnyDriveOfflineOrDisabled( LPWSTR szOffline ) = 0;
  110. virtual void SetSilent() = 0;
  111. virtual BOOL Release() = 0;
  112. virtual void SetUndo() = 0;
  113. };
  114. /////////////////////////////////////////////////////////////////////////////
  115. // External APIs
  116. extern "C"
  117. {
  118. BOOL APIENTRY IsSRFrozen();
  119. BOOL APIENTRY CheckPrivilegesForRestore();
  120. BOOL APIENTRY InvokeDiskCleanup( LPCWSTR cszDrive );
  121. BOOL APIENTRY PrepareRestore( int nRP, IRestoreContext **ppCtx );
  122. BOOL APIENTRY InitiateRestore( IRestoreContext *pCtx, DWORD *pdwNewRP );
  123. BOOL APIENTRY ResumeRestore();
  124. typedef BOOL (APIENTRY * PREPFUNC) ( int nRP, IRestoreContext **ppCtx );
  125. typedef BOOL (APIENTRY * INITFUNC) ( IRestoreContext *pCtx, DWORD *pdwNewRP );
  126. }
  127. #endif //_SRSHELL_H__INCLUDED_