2 * DOS interrupt 2fh handler
14 /* #define DEBUG_INT */
17 /* base WPROCS.DLL ordinal number for VxDs */
20 static void do_int2f_16( CONTEXT
*context
);
22 /**********************************************************************
25 * Handler for int 2fh (multiplex).
27 void WINAPI
INT_Int2fHandler( CONTEXT
*context
)
29 TRACE(int,"Subfunction 0x%X\n", AH_reg(context
));
31 switch(AH_reg(context
))
34 AL_reg(context
) = 0xff; /* share is installed */
38 switch (AL_reg(context
))
40 case 0x2e: /* get or set DOS error table address */
41 switch (DL_reg(context
))
43 /* Four tables: even commands are 'get', odd are 'set' */
44 /* DOS 5.0+ ignores "set" commands */
51 /* Instead of having a message table in DOS-space, */
52 /* we can use a special case for MS-DOS to force */
53 /* the secondary interface. */
58 ES_reg(context
) = 0x0001;
59 DI_reg(context
) = 0x0000;
62 FIXME(int, "No real-mode handler for errors yet! (bye!)");
65 INT_BARF(context
, 0x2f);
69 INT_BARF(context
, 0x2f);
73 case 0x15: /* mscdex */
78 do_int2f_16( context
);
81 FIXME(int,"check for XMS (not supported)\n");
82 AL_reg(context
) = 0x42; /* != 0x80 */
86 switch (AL_reg(context
))
97 /* Microsoft Profiler - not installed */
100 INT_BARF( context
, 0x2f );
105 switch(AL_reg(context
))
107 case 0x10: /* smartdrv */
108 break; /* not installed */
109 case 0x11: /* dblspace */
110 break; /* not installed */
111 case 0x12: /* realtime compression interface */
112 break; /* not installed */
114 INT_BARF( context
, 0x2f );
117 case 0x56: /* INTERLNK */
118 switch(AL_reg(context
))
120 case 0x01: /* check if redirected drive */
121 AL_reg(context
) = 0; /* not redirected */
124 INT_BARF( context
, 0x2f );
127 case 0x7a: /* NOVELL NetWare */
128 switch (AL_reg(context
))
130 case 0x20: /* Get VLM Call Address */
131 /* return nothing -> NetWare not installed */
138 case 0xb7: /* append */
139 AL_reg(context
) = 0; /* not installed */
141 case 0xbd: /* some Novell network install check ??? */
142 AX_reg(context
) = 0xa5a5; /* pretend to have Novell IPX installed */
144 case 0xfa: /* Watcom debugger check, returns 0x666 if installed */
147 INT_BARF( context
, 0x2f );
153 /**********************************************************************
156 static void do_int2f_16( CONTEXT
*context
)
160 switch(AL_reg(context
))
162 case 0x00: /* Windows enhanced mode installation check */
163 AX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ?
164 LOWORD(GetVersion16()) : 0;
167 case 0x0a: /* Get Windows version and type */
169 BX_reg(context
) = (LOWORD(GetVersion16()) << 8) |
170 (LOWORD(GetVersion16()) >> 8);
171 CX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ? 3 : 2;
174 case 0x80: /* Release time-slice */
176 /* FIXME: We need to do something that lets some other process run
181 case 0x81: /* Begin critical section. */
185 case 0x82: /* End critical section. */
189 case 0x83: /* Return Current Virtual Machine ID */
190 /* Virtual Machines are usually created/destroyed when Windows runs
191 * DOS programs. Since we never do, we are always in the System VM.
192 * According to Ralf Brown's Interrupt List, never return 0. But it
193 * seems to work okay (returning 0), just to be sure we return 1.
195 BX_reg(context
) = 1; /* VM 1 is probably the System VM */
198 case 0x84: /* Get device API entry point */
199 addr
= (DWORD
)NE_GetEntryPoint( GetModuleHandle16("WPROCS"),
200 VXD_BASE
+ BX_reg(context
) );
201 if (!addr
) /* not supported */
203 WARN(int,"Application attempted to access VxD %04x\n",
205 WARN(int,"This device is not known to Wine.");
206 WARN(int,"Expect a failure now\n");
208 ES_reg(context
) = SELECTOROF(addr
);
209 DI_reg(context
) = OFFSETOF(addr
);
212 case 0x86: /* DPMI detect mode */
213 AX_reg(context
) = 0; /* Running under DPMI */
216 /* FIXME: is this right? Specs say that this should only be callable
217 in real (v86) mode which we never enter. */
218 /* FIXME: we do now, and this breaks pkunzip */
219 case 0x87: /* DPMI installation check */
220 if (ISV86(context
)) break; /* so bail out for now if in v86 mode */
225 AX_reg(context
) = 0x0000; /* DPMI Installed */
226 BX_reg(context
) = 0x0001; /* 32bits available */
227 CL_reg(context
) = si
.wProcessorLevel
;
228 DX_reg(context
) = 0x005a; /* DPMI major/minor 0.90 */
229 SI_reg(context
) = 0; /* # of para. of DOS extended private data */
230 ES_reg(context
) = 0; /* ES:DI is DPMI switch entry point */
234 case 0x8a: /* DPMI get vendor-specific API entry point. */
235 /* The 1.0 specs say this should work with all 0.9 hosts. */
239 INT_BARF( context
, 0x2f );
243 void do_mscdex( CONTEXT
*context
)
248 switch(AL_reg(context
))
250 case 0x00: /* Installation check */
251 /* Count the number of contiguous CDROM drives
253 for (drive
= count
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
255 if (DRIVE_GetType(drive
) == TYPE_CDROM
)
257 while (DRIVE_GetType(drive
+ count
) == TYPE_CDROM
) count
++;
262 BX_reg(context
) = count
;
263 CX_reg(context
) = (drive
< MAX_DOS_DRIVES
) ? drive
: 0;
266 case 0x0B: /* drive check */
267 AX_reg(context
) = (DRIVE_GetType(CX_reg(context
)) == TYPE_CDROM
);
268 BX_reg(context
) = 0xADAD;
271 case 0x0C: /* get version */
272 BX_reg(context
) = 0x020a;
275 case 0x0D: /* get drive letters */
276 p
= CTX_SEG_OFF_TO_LIN(context
, ES_reg(context
), BX_reg(context
));
277 memset( p
, 0, MAX_DOS_DRIVES
);
278 for (drive
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
280 if (DRIVE_GetType(drive
) == TYPE_CDROM
) *p
++ = drive
;
285 /* FIXME: why a new linux-only CDROM drive access, for crying out loud?
286 * There are pretty complete routines in multimedia/mcicda.c already! */
287 case 0x10: /* direct driver acces */
288 FIXME(cdaudio
,"mscdex should use multimedia/mcicda.c");
289 do_mscdex_dd(context
,ISV86(context
));
295 FIXME(int, "Unimplemented MSCDEX function 0x%02X.\n", AL_reg(context
));