Beispiel #1
0
 protected void PopulateBackupPolicyFromNative(NativeBackupRestoreTypes.FABRIC_BACKUP_POLICY backupPolicy)
 {
     Name     = NativeTypes.FromNativeString(backupPolicy.Name);
     PolicyId = backupPolicy.PolicyId;
     MaxIncrementalBackups = backupPolicy.MaxIncrementalBackups;
     StoreInformation      = BackupStoreInformation.FromNative(backupPolicy.StoreInformation);
 }
        internal static unsafe BackupNowConfiguration FromNative(IntPtr pointer)
        {
            var nativeBackupConfiguration = *(NativeBackupRestoreTypes.FABRIC_BACKUP_CONFIGURATION *)pointer;

            return(new BackupNowConfiguration
            {
                OperationTimeoutMilliseconds = (int)nativeBackupConfiguration.OperationTimeoutMilliseconds,
                StoreInformation = BackupStoreInformation.FromNative(nativeBackupConfiguration.StoreInformation),
            });
        }
Beispiel #3
0
        internal static unsafe RestorePointDetails FromNative(IntPtr pointer)
        {
            var nativeRestorePointDetails   = *(NativeBackupRestoreTypes.FABRIC_RESTORE_POINT_DETAILS *)pointer;
            var managedRecoveryPointDetails = new RestorePointDetails
            {
                OperationId            = nativeRestorePointDetails.OperationId,
                UserInitiatedOperation = NativeTypes.FromBOOLEAN(nativeRestorePointDetails.UserInitiatedOperation),
                StoreInformation       = BackupStoreInformation.FromNative(nativeRestorePointDetails.StoreInformation),
            };

            var nativeBackupLocations = *(NativeTypes.FABRIC_STRING_LIST *)nativeRestorePointDetails.BackupLocations;

            managedRecoveryPointDetails.BackupLocations = NativeTypes.FromNativeStringList(nativeBackupLocations);
            return(managedRecoveryPointDetails);
        }