Fixed a simple bug in the implementation of the ShellView objects.
[wine/multimedia.git] / msdos / int26.c
blob5ed49957b2798d8d645fff9fb0510d4449834256
1 /*
2 * DOS interrupt 26h handler
3 */
5 #include <stdlib.h>
6 #include <fcntl.h>
7 #include <unistd.h>
8 #include "msdos.h"
9 #include "ldt.h"
10 #include "miscemu.h"
11 #include "drive.h"
12 #include "debug.h"
14 /**********************************************************************
15 * INT_Int26Handler
17 * Handler for int 26h (absolute disk read).
19 void WINAPI INT_Int26Handler( CONTEXT *context )
21 BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EBX_reg(context) );
22 DWORD begin, length;
24 if (!DRIVE_IsValid(AL_reg(context)))
26 SET_CFLAG(context);
27 AX_reg(context) = 0x0101; /* unknown unit */
28 return;
31 if (CX_reg(context) == 0xffff)
33 begin = *(DWORD *)dataptr;
34 length = *(WORD *)(dataptr + 4);
35 dataptr = (BYTE *)CTX_SEG_OFF_TO_LIN( context,
36 *(WORD *)(dataptr + 8), *(DWORD *)(dataptr + 6) );
38 else
40 begin = DX_reg(context);
41 length = CX_reg(context);
44 TRACE(int,"int26: abs diskwrite, drive %d, sector %ld, "
45 "count %ld, buffer %p\n",
46 AL_reg(context), begin, length, dataptr );
48 DRIVE_RawWrite(AL_reg(context), begin, length, dataptr, TRUE);
49 RESET_CFLAG(context);