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.

153 lines
4.5 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. SRRestorePtAPI.h
  5. Abstract:
  6. This file contains the declarations for the SRRESTOREPT_API
  7. ******************************************************************************/
  8. #if !defined( _SRRESTOREPTAPI_H )
  9. #define _SRRESTOREPTAPI_H
  10. //
  11. // Type of Event
  12. //
  13. #define MIN_EVENT 100
  14. #define BEGIN_SYSTEM_CHANGE 100
  15. #define END_SYSTEM_CHANGE 101
  16. #define BEGIN_NESTED_SYSTEM_CHANGE 102 // for Whistler only - use this to prevent nested restore pts
  17. #define END_NESTED_SYSTEM_CHANGE 103 // for Whistler only - use this to prevent nested restore pts
  18. #define MAX_EVENT 103
  19. //
  20. // Type of Restore Points
  21. //
  22. #define MIN_RPT 0
  23. #define APPLICATION_INSTALL 0
  24. #define APPLICATION_UNINSTALL 1
  25. #define DESKTOP_SETTING 2 /* Not implemented */
  26. #define ACCESSIBILITY_SETTING 3 /* Not implemented */
  27. #define OE_SETTING 4 /* Not implemented */
  28. #define APPLICATION_RUN 5 /* Not implemented */
  29. #define RESTORE 6
  30. #define CHECKPOINT 7
  31. #define WINDOWS_SHUTDOWN 8 /* Not implemented */
  32. #define WINDOWS_BOOT 9 /* Not implemented */
  33. #define DEVICE_DRIVER_INSTALL 10
  34. #define FIRSTRUN 11
  35. #define MODIFY_SETTINGS 12
  36. #define CANCELLED_OPERATION 13 /* Only valid for END_SYSTEM_CHANGE */
  37. #define BACKUP_RECOVERY 14
  38. #define MAX_RPT 14
  39. #define MAX_DESC 64
  40. #define MAX_DESC_W 256 // longer for Whistler
  41. //
  42. // for Millennium compatibility
  43. //
  44. #pragma pack(push, srrestoreptapi_include)
  45. #pragma pack(1)
  46. //
  47. // Restore point information
  48. //
  49. typedef struct _RESTOREPTINFOA {
  50. DWORD dwEventType; // Type of Event - Begin or End
  51. DWORD dwRestorePtType; // Type of Restore Point - App install/uninstall
  52. INT64 llSequenceNumber; // Sequence Number - 0 for begin
  53. CHAR szDescription[MAX_DESC]; // Description - Name of Application / Operation
  54. } RESTOREPOINTINFOA, *PRESTOREPOINTINFOA;
  55. typedef struct _RESTOREPTINFOW {
  56. DWORD dwEventType;
  57. DWORD dwRestorePtType;
  58. INT64 llSequenceNumber;
  59. WCHAR szDescription[MAX_DESC_W];
  60. } RESTOREPOINTINFOW, *PRESTOREPOINTINFOW;
  61. //
  62. // Status returned by System Restore
  63. //
  64. typedef struct _SMGRSTATUS {
  65. DWORD nStatus; // Status returned by State Manager Process
  66. INT64 llSequenceNumber; // Sequence Number for the restore point
  67. } STATEMGRSTATUS, *PSTATEMGRSTATUS;
  68. #pragma pack(pop, srrestoreptapi_include)
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72. //
  73. // RPC call to set a restore point
  74. //
  75. // Return value TRUE if the call was a success
  76. // FALSE if the call failed
  77. //
  78. // If pSmgrStatus nStatus field is set as follows
  79. //
  80. // ERROR_SUCCESS If the call succeeded (return value will be TRUE)
  81. //
  82. // ERROR_TIMEOUT If the call timed out due to a wait on a mutex for
  83. // for setting restore points.
  84. //
  85. // ERROR_INVALID_DATA If the cancel restore point is called with an invalid
  86. // sequence number
  87. //
  88. // ERROR_INTERNAL_ERROR If there are internal failures.
  89. //
  90. // ERROR_BAD_ENVIRONMENT If the API is called in SafeMode
  91. //
  92. // ERROR_SERVICE_DISABLED If SystemRestore is Disabled.
  93. //
  94. // ERROR_DISK_FULL If System Restore is frozen (Windows Whistler only)
  95. //
  96. // ERROR_ALREADY_EXISTS If this is a nested restore point
  97. BOOL __stdcall
  98. SRSetRestorePointA(
  99. PRESTOREPOINTINFOA pRestorePtSpec, // [in] Restore Point specification
  100. PSTATEMGRSTATUS pSMgrStatus // [out] Status returned
  101. );
  102. BOOL __stdcall
  103. SRSetRestorePointW(
  104. PRESTOREPOINTINFOW pRestorePtSpec,
  105. PSTATEMGRSTATUS pSMgrStatus
  106. );
  107. DWORD __stdcall
  108. SRRemoveRestorePoint(DWORD dwRPNum);
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #ifdef UNICODE
  113. #define RESTOREPOINTINFO RESTOREPOINTINFOW
  114. #define PRESTOREPOINTINFO PRESTOREPOINTINFOW
  115. #define SRSetRestorePoint SRSetRestorePointW
  116. #else
  117. #define RESTOREPOINTINFO RESTOREPOINTINFOA
  118. #define PRESTOREPOINTINFO PRESTOREPOINTINFOA
  119. #define SRSetRestorePoint SRSetRestorePointA
  120. #endif
  121. #endif // !defined( _RESTOREPTAPI_H )