public void Start(string pathDirectory) { try { IntPtr directory = _GetPointDirectory(pathDirectory); int lpBytesReturned = 0; apiwindows.LPOVERLAPPED ol = new apiwindows.LPOVERLAPPED(); int err = apiwindows.DeviceIoControl(directory, apiwindows.FSCTL_TXFS_START_RM, new apiwindows.TXFS_START_RM_INFORMATION(), 0, IntPtr.Zero, 0, ref lpBytesReturned, ol); if (err == 0) { throw new Win32Exception(Marshal.GetLastWin32Error()); } err = apiwindows.DeviceIoControl(directory, apiwindows.FSCTL_TXFS_ROLLFORWARD_REDO, new apiwindows.TXFS_ROLLFORWARD_REDO_INFORMATION(), 0, IntPtr.Zero, 0, ref lpBytesReturned, ol); if (err == 0) { throw new Win32Exception(Marshal.GetLastWin32Error()); } err = apiwindows.DeviceIoControl(directory, apiwindows.FSCTL_TXFS_ROLLFORWARD_UNDO, IntPtr.Zero, 0, IntPtr.Zero, 0, ref lpBytesReturned, ol); if (err == 0) { throw new Win32Exception(Marshal.GetLastWin32Error()); } } catch (Exception) { throw; } finally { } }
public void Create(string pathDirectory) { try { IntPtr directory = _GetPointDirectory(pathDirectory); int lpBytesReturned = 0; apiwindows.LPOVERLAPPED ol = new apiwindows.LPOVERLAPPED(); int err = apiwindows.DeviceIoControl(directory, apiwindows.FSCTL_TXFS_CREATE_SECONDARY_RM, IntPtr.Zero, 0, IntPtr.Zero, 0, ref lpBytesReturned, ol); if (err == 0) { throw new Win32Exception(Marshal.GetLastWin32Error()); } } catch (Exception) { throw; } finally { } }