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.

123 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. checkpoint.hxx
  6. Abstract:
  7. This file implements a class (or for 'C' handle based) calls to set and
  8. restore system breakpoints.
  9. Author:
  10. Mark Lawrence (mlawrenc).
  11. Environment:
  12. User Mode -Win32
  13. Revision History:
  14. --*/
  15. #ifndef _CHECKPOINT_HXX_
  16. #define _CHECKPOINT_HXX_
  17. #ifdef __cplusplus
  18. //
  19. // This only needs to be included from C++ includers, and is a very small header indeed.
  20. //
  21. #include <srrestoreptapi.h>
  22. class TSystemRestorePoint
  23. {
  24. SIGNATURE('srsp');
  25. public:
  26. TSystemRestorePoint(
  27. VOID
  28. );
  29. ~TSystemRestorePoint(
  30. VOID
  31. );
  32. HRESULT
  33. IsValid(
  34. VOID
  35. ) const;
  36. HRESULT
  37. StartSystemRestorePoint(
  38. IN PCWSTR pszServer,
  39. IN PCWSTR pszDriverName,
  40. IN HINSTANCE hInst,
  41. IN UINT ResId
  42. );
  43. HRESULT
  44. EndSystemRestorePoint(
  45. IN BOOL bCancel
  46. );
  47. private:
  48. typedef BOOL
  49. (__stdcall* PFnSRSetRestorePoint)(
  50. IN PRESTOREPOINTINFOW pRestorePtSpec,
  51. OUT PSTATEMGRSTATUS pSMgrStatus
  52. );
  53. //
  54. // Copying and assignment are not defined.
  55. //
  56. TSystemRestorePoint(const TSystemRestorePoint &);
  57. TSystemRestorePoint &operator=(const TSystemRestorePoint &);
  58. HRESULT
  59. Initialize(
  60. VOID
  61. );
  62. HMODULE m_hLibrary;
  63. PFnSRSetRestorePoint m_pfnSetRestorePoint;
  64. RESTOREPOINTINFO m_RestorePointInfo;
  65. BOOL m_bSystemRestoreSet;
  66. HRESULT m_hr;
  67. };
  68. extern "C"
  69. {
  70. #endif
  71. HRESULT
  72. GetLastErrorAsHResult(
  73. VOID
  74. );
  75. HANDLE
  76. StartSystemRestorePoint(
  77. IN PCWSTR pszServer,
  78. IN PCWSTR pszDriverName,
  79. IN HINSTANCE hInst,
  80. IN UINT ResId
  81. );
  82. BOOL
  83. EndSystemRestorePoint(
  84. IN HANDLE hRestorePoint,
  85. IN BOOL bCancel
  86. );
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif // #ifndef _CHECKPOINT_HXX_