Hello I implemented the Int21 7303 function (Get Extended free space on drive) according to Ralf Brown's Interrupt List. This function is called by the installer of the MS Train Simulator. My first mail to wine-patches was just dropped silently. Maybe somebody can add me to a white list on wine-patches, since I am not subscribed to wine-patches. Or maybe my formatting is wrong? Greetings Thomas Mertes Change log: * msdos/int21.c: Thomas Mertes <thomas.mertes@t-mobile.at> Implement Int21 7303 function: Get Extended free space on drive. diff -urN old_wine-20030115/msdos/int21.c new_wine-20030115/msdos/int21.c --- old_wine-20030115/msdos/int21.c Tue Dec 10 20:58:39 2002 +++ new_wine-20030115/msdos/int21.c Thu Jan 23 23:07:59 2003 @@ -122,6 +122,21 @@ }; +struct EFSS /* FAT32 extended free space structure */ +{ /* from Ralf Brown's Interrupt List */ + WORD structure_size; /* size of returned structure */ + WORD structure_version; /* (call) structure version, (ret) actual structure version */ + DWORD cluster_sectors; /* number of sectors per cluster (with adjustment for compression) */ + DWORD sector_bytes; /* number of bytes per sector */ + DWORD free_clusters; /* number of available clusters */ + DWORD total_clusters; /* total number of clusters on the drive */ + DWORD physical_sectors; /* number of physical sectors available on the drive, without adjustment for compression */ + DWORD total_physical_sectors; /* total number of physical sectors on the drive, without adjustment for compression */ + DWORD num_allocation_units; /* number of available allocation units, without adjustment for compression */ + DWORD total_allocation_units; /* total allocation units, without adjustment for compression */ + BYTE reserved[8]; +}; + DWORD dpbsegptr; struct DosHeap { @@ -1915,6 +1930,38 @@ break; case 0x03: /* Get Extended free space on drive */ + { + LPCSTR root; + struct EFSS *efss; + + root = (LPCSTR) CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); + TRACE("Get Extended free space on \"%s\"\n", root); + efss = (struct EFSS *) CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edi); + + /* validate passed-in buffer lengths */ + if (context->Ecx != sizeof(struct EFSS)) + { + WARN("Get extended free space: buffer lengths incorrect\n"); + WARN("CX = %lx\n", context->Ecx); + SET_CFLAG(context); + SET_AL( context, 0x18 ); /* bad buffer length */ + } + else + { + GetDiskFreeSpaceA(root, &efss->cluster_sectors, &efss->sector_bytes, + &efss->free_clusters, &efss->total_clusters); + efss->structure_size = sizeof(struct EFSS); + efss->structure_version = 0; + efss->physical_sectors = efss->cluster_sectors * efss->free_clusters; + efss->total_physical_sectors = efss->cluster_sectors * efss->total_clusters; + efss->num_allocation_units = efss->free_clusters; + efss->total_allocation_units = efss->total_clusters; + + SET_CFLAG(context); + SET_AL( context, 0 ); + } + break; + } case 0x04: /* Set DPB for formatting */ case 0x05: /* extended absolute disk read/write */ FIXME("Unimplemented FAT32 int32 function %04x\n", AX_reg(context));