From: Jactry Zeng <jzeng@codeweavers.com> --- dlls/mountmgr.sys/device.c | 24 ++++++++++++++++++++++++ include/ntddstor.h | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index f73476cdcd4..5ae4220931d 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -1619,6 +1619,30 @@ static NTSTATUS query_property( struct disk_device *device, IRP *irp ) } break; } + case StorageDeviceTrimProperty: + { + DEVICE_TRIM_DESCRIPTOR *d = irp->AssociatedIrp.SystemBuffer; + + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(STORAGE_DESCRIPTOR_HEADER)) + status = STATUS_INVALID_PARAMETER; + else + { + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(*d)) + { + d->Version = d->Size = sizeof(*d); + irp->IoStatus.Information = sizeof(STORAGE_DESCRIPTOR_HEADER); + } + else + { + FIXME( "Returning TRUE for StorageDeviceTrimProperty.\n" ); + d->Version = d->Size = sizeof(*d); + d->TrimEnabled = TRUE; + irp->IoStatus.Information = sizeof(*d); + } + status = STATUS_SUCCESS; + } + break; + } default: FIXME( "Unsupported property %#x\n", query->PropertyId ); diff --git a/include/ntddstor.h b/include/ntddstor.h index a59028df83a..7f5a0fd2bc7 100644 --- a/include/ntddstor.h +++ b/include/ntddstor.h @@ -266,6 +266,12 @@ typedef struct _DEVICE_SEEK_PENALTY_DESCRIPTOR { BOOLEAN IncursSeekPenalty; } DEVICE_SEEK_PENALTY_DESCRIPTOR, *PDEVICE_SEEK_PENALTY_DESCRIPTOR; +typedef struct _DEVICE_TRIM_DESCRIPTOR { + DWORD Version; + DWORD Size; + BOOLEAN TrimEnabled; +} DEVICE_TRIM_DESCRIPTOR, *PDEVICE_TRIM_DESCRIPTOR; + typedef struct _STORAGE_DESCRIPTOR_HEADER { ULONG Version; ULONG Size; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9984