From c22013fe9fa2c20ac7d617ad15a2a6c7e72a6c1d Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 1 Sep 2021 22:52:32 +0000 Subject: [PATCH] amex/eeprom.c: Handle ABI version ioctl --- amex/eeprom.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/amex/eeprom.c b/amex/eeprom.c index b9dd8b7..84e4701 100644 --- a/amex/eeprom.c +++ b/amex/eeprom.c @@ -20,6 +20,10 @@ #include "util/dprintf.h" #include "util/str.h" +enum { + EEPROM_IOCTL_GET_ABI_VERSION = 0x80006000, +}; + static HRESULT eeprom_handle_irp(struct irp *irp); static HRESULT eeprom_handle_open(struct irp *irp); static HRESULT eeprom_handle_close(struct irp *irp); @@ -28,6 +32,7 @@ static HRESULT eeprom_handle_read(struct irp *irp); static HRESULT eeprom_handle_write(struct irp *irp); static HRESULT eeprom_ioctl_get_geometry(struct irp *irp); +static HRESULT eeprom_ioctl_get_abi_version(struct irp *irp); static struct eeprom_config eeprom_config; static HANDLE eeprom_file; @@ -117,6 +122,9 @@ static HRESULT eeprom_handle_ioctl(struct irp *irp) case IOCTL_DISK_GET_DRIVE_GEOMETRY: return eeprom_ioctl_get_geometry(irp); + case EEPROM_IOCTL_GET_ABI_VERSION: + return eeprom_ioctl_get_abi_version(irp); + default: dprintf("EEPROM: Unknown ioctl %x, write %i read %i\n", irp->ioctl, @@ -150,6 +158,11 @@ static HRESULT eeprom_ioctl_get_geometry(struct irp *irp) return hr; } +static HRESULT eeprom_ioctl_get_abi_version(struct irp *irp) +{ + return iobuf_write_le16(&irp->read, 256); +} + static HRESULT eeprom_handle_read(struct irp *irp) { if (irp->ovl == NULL) {