I want to use Window API to create System Restore Point (SRP). However, creating SRP is limited in 24 hours.
Here're my steps
- Add SystemRestorePointCreationFrequency under the registry key HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore and set to Zero.
In source code
- Call LoadLibraryW(L"srclient.dll")
- Get GetProcAddress of SRSetRestorePointW
- Call SRSetRestorePointW method.
this method only create SRP in the first calling. In the second calling, it always return previous sequenceNumber(STATEMGRSTATUS.llSequenceNumber). it seem that SRSetRestorePointW does not refer SystemRestorePointCreationFrequency.
I tried using powershell to create 2 SRPs, it works well (without reboot system )
Checkpoint-Computer -Description 'Install_TEST' -RestorePointType 'APPLICATION_INSTALL'
This source code is referred from MSD. But it has this issue. (learn.microsoft.com/en-us/windows/win32/sr/using-system-restore)
You must be using Windows 8 or later for getting
SystemRestorePointCreationFrequency
to work.eventtype
toBEGIN_SYSTEM_CHANGE
.eventtype
toEND_SYSTEM_CHANGE
and setSequenceNumber
returned from the first call.