Well, SetParent doesn't work properly at all, but at least it must preserve
[wine.git] / msdos / int25.c
blob1a628ba1cea06919326bfb21544c1cd43978e9b2
1 /*
2 * DOS interrupt 25h handler
3 */
5 #include <stdlib.h>
6 #include <string.h>
7 #include <fcntl.h>
8 #include <unistd.h>
9 #include "msdos.h"
10 #include "ldt.h"
11 #include "miscemu.h"
12 #include "drive.h"
13 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(int)
18 /**********************************************************************
19 * INT_Int25Handler
21 * Handler for int 25h (absolute disk read).
23 void WINAPI INT_Int25Handler( CONTEXT86 *context )
25 BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EBX_reg(context) );
26 DWORD begin, length;
28 if (!DRIVE_IsValid(AL_reg(context)))
30 SET_CFLAG(context);
31 AX_reg(context) = 0x0201; /* unknown unit */
32 return;
35 if (CX_reg(context) == 0xffff)
37 begin = *(DWORD *)dataptr;
38 length = *(WORD *)(dataptr + 4);
39 dataptr = (BYTE *)CTX_SEG_OFF_TO_LIN( context,
40 *(WORD *)(dataptr + 8), *(DWORD *)(dataptr + 6) );
42 else
44 begin = DX_reg(context);
45 length = CX_reg(context);
47 TRACE("int25: abs diskread, drive %d, sector %ld, "
48 "count %ld, buffer %p\n",
49 AL_reg(context), begin, length, dataptr);
51 DRIVE_RawRead(AL_reg(context), begin, length, dataptr, TRUE);
52 RESET_CFLAG(context);