Process and thread id now use the server-side id instead of an
[wine/multimedia.git] / msdos / int25.c
blob19d4598b80a9e4782db58529f1ffab300c84389c
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 "debug.h"
16 /**********************************************************************
17 * INT_Int25Handler
19 * Handler for int 25h (absolute disk read).
21 void WINAPI INT_Int25Handler( CONTEXT *context )
23 BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, DS_reg(context), EBX_reg(context) );
24 DWORD begin, length;
26 if (!DRIVE_IsValid(AL_reg(context)))
28 SET_CFLAG(context);
29 AX_reg(context) = 0x0101; /* unknown unit */
30 return;
33 if (CX_reg(context) == 0xffff)
35 begin = *(DWORD *)dataptr;
36 length = *(WORD *)(dataptr + 4);
37 dataptr = (BYTE *)CTX_SEG_OFF_TO_LIN( context,
38 *(WORD *)(dataptr + 8), *(DWORD *)(dataptr + 6) );
40 else
42 begin = DX_reg(context);
43 length = CX_reg(context);
45 TRACE(int, "int25: abs diskread, drive %d, sector %ld, "
46 "count %ld, buffer %p\n",
47 AL_reg(context), begin, length, dataptr);
49 DRIVE_RawRead(AL_reg(context), begin, length, dataptr, TRUE);
50 RESET_CFLAG(context);