"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Driver/Ntdriver.c" between
VeraCrypt_1.22_Source.tar.bz2 and VeraCrypt_1.23_Source.tar.bz2

About: VeraCrypt is a free disk encryption software (based on TrueCrypt).

Ntdriver.c  (VeraCrypt_1.22_Source.tar.bz2):Ntdriver.c  (VeraCrypt_1.23_Source.tar.bz2)
skipping to change at line 132 skipping to change at line 132
int LastUniqueVolumeId; int LastUniqueVolumeId;
ULONG OsMajorVersion = 0; ULONG OsMajorVersion = 0;
ULONG OsMinorVersion; ULONG OsMinorVersion;
BOOL DriverUnloadDisabled = FALSE; BOOL DriverUnloadDisabled = FALSE;
BOOL PortableMode = FALSE; BOOL PortableMode = FALSE;
BOOL VolumeClassFilterRegistered = FALSE; BOOL VolumeClassFilterRegistered = FALSE;
BOOL CacheBootPassword = FALSE; BOOL CacheBootPassword = FALSE;
BOOL CacheBootPim = FALSE; BOOL CacheBootPim = FALSE;
BOOL NonAdminSystemFavoritesAccessDisabled = FALSE; BOOL NonAdminSystemFavoritesAccessDisabled = FALSE;
BOOL BlockSystemTrimCommand = FALSE; BOOL BlockSystemTrimCommand = FALSE;
BOOL AllowWindowsDefrag = FALSE;
static size_t EncryptionThreadPoolFreeCpuCountLimit = 0; static size_t EncryptionThreadPoolFreeCpuCountLimit = 0;
static BOOL SystemFavoriteVolumeDirty = FALSE; static BOOL SystemFavoriteVolumeDirty = FALSE;
static BOOL PagingFileCreationPrevented = FALSE; static BOOL PagingFileCreationPrevented = FALSE;
static BOOL EnableExtendedIoctlSupport = FALSE; static BOOL EnableExtendedIoctlSupport = FALSE;
static BOOL AllowTrimCommand = FALSE; static BOOL AllowTrimCommand = FALSE;
static KeSaveExtendedProcessorStateFn KeSaveExtendedProcessorStatePtr = NULL; static KeSaveExtendedProcessorStateFn KeSaveExtendedProcessorStatePtr = NULL;
static KeRestoreExtendedProcessorStateFn KeRestoreExtendedProcessorStatePtr = NU LL; static KeRestoreExtendedProcessorStateFn KeRestoreExtendedProcessorStatePtr = NU LL;
POOL_TYPE ExDefaultNonPagedPoolType = NonPagedPool; POOL_TYPE ExDefaultNonPagedPoolType = NonPagedPool;
ULONG ExDefaultMdlProtection = 0; ULONG ExDefaultMdlProtection = 0;
skipping to change at line 1259 skipping to change at line 1260
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
if (EnableExtendedIoctlSupport) if (EnableExtendedIoctlSupport)
{ {
Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
} }
break; break;
case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS: case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS:
Dump ("ProcessVolumeDeviceControlIrp (IOCTL_VOLUME_GET_VOLUME_DIS K_EXTENTS)\n"); Dump ("ProcessVolumeDeviceControlIrp (IOCTL_VOLUME_GET_VOLUME_DIS K_EXTENTS)\n");
// Vista's filesystem defragmenter fails if IOCTL_VOLUME_GET_VOLU // Vista's, Windows 8.1 and later filesystem defragmenter fails i
ME_DISK_EXTENTS does not succeed. f IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS does not succeed.
if (!(OsMajorVersion == 6 && OsMinorVersion == 0)) if (!(OsMajorVersion == 6 && OsMinorVersion == 0)
&& !(IsOSAtLeast (WIN_8_1) && AllowWindowsDefrag && Exten
sion->bRawDevice)
)
{ {
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
} }
else if (ValidateIOBufferSize (Irp, sizeof (VOLUME_DISK_EXTENTS), ValidateOutput)) else if (ValidateIOBufferSize (Irp, sizeof (VOLUME_DISK_EXTENTS), ValidateOutput))
{ {
VOLUME_DISK_EXTENTS *extents = (VOLUME_DISK_EXTENTS *) Ir p->AssociatedIrp.SystemBuffer; VOLUME_DISK_EXTENTS *extents = (VOLUME_DISK_EXTENTS *) Ir p->AssociatedIrp.SystemBuffer;
// No extent data can be returned as this is not a physic if (IsOSAtLeast (WIN_8_1))
al drive. {
memset (extents, 0, sizeof (*extents)); // Windows 10 filesystem defragmenter works only
extents->NumberOfDiskExtents = 0; if we report an extent with a real disk number
// So in the case of a VeraCrypt disk based volum
e, we use the disk number
// of the underlaying physical disk and we report
a single extent
extents->NumberOfDiskExtents = 1;
extents->Extents[0].DiskNumber = Extension->Devic
eNumber;
extents->Extents[0].StartingOffset.QuadPart = Ext
ension->BytesPerSector;
extents->Extents[0].ExtentLength.QuadPart = Exten
sion->DiskLength;
}
else
{
// Vista: No extent data can be returned as this
is not a physical drive.
memset (extents, 0, sizeof (*extents));
extents->NumberOfDiskExtents = 0;
}
Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof (*extents); Irp->IoStatus.Information = sizeof (*extents);
} }
break; break;
case IOCTL_STORAGE_READ_CAPACITY: case IOCTL_STORAGE_READ_CAPACITY:
Dump ("ProcessVolumeDeviceControlIrp (IOCTL_STORAGE_READ_CAPACITY )\n"); Dump ("ProcessVolumeDeviceControlIrp (IOCTL_STORAGE_READ_CAPACITY )\n");
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
skipping to change at line 3704 skipping to change at line 3720
// correct the label in the devic e // correct the label in the devic e
memset (&NewExtension->wszLabel[l abelEffectiveLen], 0, 33 - labelEffectiveLen); memset (&NewExtension->wszLabel[l abelEffectiveLen], 0, 33 - labelEffectiveLen);
memcpy (mount->wszLabel, NewExten sion->wszLabel, 33); memcpy (mount->wszLabel, NewExten sion->wszLabel, 33);
// set the volume label // set the volume label
__try __try
{ {
IO_STATUS_BLOCK ioblock; IO_STATUS_BLOCK ioblock;
ULONG labelInfoSize = siz eof(FILE_FS_LABEL_INFORMATION) + (labelEffectiveLen * sizeof(WCHAR)); ULONG labelInfoSize = siz eof(FILE_FS_LABEL_INFORMATION) + (labelEffectiveLen * sizeof(WCHAR));
FILE_FS_LABEL_INFORMATION * labelInfo = (FILE_FS_LABEL_INFORMATION*) TCalloc (labelInfoSize); FILE_FS_LABEL_INFORMATION * labelInfo = (FILE_FS_LABEL_INFORMATION*) TCalloc (labelInfoSize);
labelInfo->VolumeLabelLen if (labelInfo)
gth = labelEffectiveLen * sizeof(WCHAR);
memcpy (labelInfo->Volume
Label, mount->wszLabel, labelInfo->VolumeLabelLength);
if (STATUS_SUCCESS == ZwS
etVolumeInformationFile (volumeHandle, &ioblock, labelInfo, labelInfoSize, FileF
sLabelInformation))
{ {
mount->bDriverSet labelInfo->Volume
Label = TRUE; LabelLength = labelEffectiveLen * sizeof(WCHAR);
NewExtension->bDr memcpy (labelInfo
iverSetLabel = TRUE; ->VolumeLabel, mount->wszLabel, labelInfo->VolumeLabelLength);
}
if (STATUS_SUCCES
S == ZwSetVolumeInformationFile (volumeHandle, &ioblock, labelInfo, labelInfoSiz
e, FileFsLabelInformation))
{
mount->bD
riverSetLabel = TRUE;
NewExtens
ion->bDriverSetLabel = TRUE;
}
TCfree(labelInfo); TCfree(labelInfo)
;
}
} }
__except (EXCEPTION_EXECUTE_HANDL ER) __except (EXCEPTION_EXECUTE_HANDL ER)
{ {
} }
} }
TCCloseFsVolume (volumeHandle, volumeFile Object); TCCloseFsVolume (volumeHandle, volumeFile Object);
} }
} }
skipping to change at line 4185 skipping to change at line 4204
CacheBootPim = TRUE; CacheBootPim = TRUE;
if (flags & VC_DRIVER_CONFIG_BLOCK_SYS_TRIM) if (flags & VC_DRIVER_CONFIG_BLOCK_SYS_TRIM)
BlockSystemTrimCommand = TRUE; BlockSystemTrimCommand = TRUE;
} }
EnableHwEncryption ((flags & TC_DRIVER_CONFIG_DISABLE_HAR DWARE_ENCRYPTION) ? FALSE : TRUE); EnableHwEncryption ((flags & TC_DRIVER_CONFIG_DISABLE_HAR DWARE_ENCRYPTION) ? FALSE : TRUE);
EnableExtendedIoctlSupport = (flags & TC_DRIVER_CONFIG_EN ABLE_EXTENDED_IOCTL)? TRUE : FALSE; EnableExtendedIoctlSupport = (flags & TC_DRIVER_CONFIG_EN ABLE_EXTENDED_IOCTL)? TRUE : FALSE;
AllowTrimCommand = (flags & VC_DRIVER_CONFIG_ALLOW_NONSYS _TRIM)? TRUE : FALSE; AllowTrimCommand = (flags & VC_DRIVER_CONFIG_ALLOW_NONSYS _TRIM)? TRUE : FALSE;
AllowWindowsDefrag = (flags & VC_DRIVER_CONFIG_ALLOW_WIND OWS_DEFRAG)? TRUE : FALSE;
} }
else else
status = STATUS_INVALID_PARAMETER; status = STATUS_INVALID_PARAMETER;
TCfree (data); TCfree (data);
} }
if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, TC_ENCRYPTION_FR EE_CPU_COUNT_REG_VALUE_NAME, &data))) if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, TC_ENCRYPTION_FR EE_CPU_COUNT_REG_VALUE_NAME, &data)))
{ {
if (data->Type == REG_DWORD) if (data->Type == REG_DWORD)
 End of changes. 7 change blocks. 
21 lines changed or deleted 49 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)