2 * DOS interrupt 2fh handler
16 /* #define DEBUG_INT */
19 /* base WPROCS.DLL ordinal number for VxDs */
22 static void do_int2f_16( CONTEXT
*context
);
24 /**********************************************************************
27 * Handler for int 2fh (multiplex).
29 void WINAPI
INT_Int2fHandler( CONTEXT
*context
)
31 TRACE(int,"Subfunction 0x%X\n", AH_reg(context
));
33 switch(AH_reg(context
))
36 AL_reg(context
) = 0xff; /* share is installed */
39 case 0x11: /* Network Redirector / IFSFUNC */
40 switch (AL_reg(context
))
42 case 0x00: /* Install check */
45 case 0x80: /* Enhanced services - Install check */
49 INT_BARF( context
, 0x2f );
55 switch (AL_reg(context
))
57 case 0x2e: /* get or set DOS error table address */
58 switch (DL_reg(context
))
60 /* Four tables: even commands are 'get', odd are 'set' */
61 /* DOS 5.0+ ignores "set" commands */
68 /* Instead of having a message table in DOS-space, */
69 /* we can use a special case for MS-DOS to force */
70 /* the secondary interface. */
75 ES_reg(context
) = 0x0001;
76 DI_reg(context
) = 0x0000;
79 FIXME(int, "No real-mode handler for errors yet! (bye!)");
82 INT_BARF(context
, 0x2f);
86 INT_BARF(context
, 0x2f);
90 case 0x15: /* mscdex */
95 do_int2f_16( context
);
98 FIXME(int,"check for XMS (not supported)\n");
99 AL_reg(context
) = 0x42; /* != 0x80 */
103 switch (AL_reg(context
))
114 /* Microsoft Profiler - not installed */
117 INT_BARF( context
, 0x2f );
122 switch(AL_reg(context
))
124 case 0x10: /* smartdrv */
125 break; /* not installed */
126 case 0x11: /* dblspace */
127 break; /* not installed */
128 case 0x12: /* realtime compression interface */
129 break; /* not installed */
131 INT_BARF( context
, 0x2f );
134 case 0x56: /* INTERLNK */
135 switch(AL_reg(context
))
137 case 0x01: /* check if redirected drive */
138 AL_reg(context
) = 0; /* not redirected */
141 INT_BARF( context
, 0x2f );
144 case 0x7a: /* NOVELL NetWare */
145 switch (AL_reg(context
))
147 case 0x20: /* Get VLM Call Address */
148 /* return nothing -> NetWare not installed */
151 INT_BARF( context
, 0x2f );
155 case 0xb7: /* append */
156 AL_reg(context
) = 0; /* not installed */
158 case 0xb8: /* network */
159 switch (AL_reg(context
))
161 case 0x00: /* Install check */
165 INT_BARF( context
, 0x2f );
169 case 0xbd: /* some Novell network install check ??? */
170 AX_reg(context
) = 0xa5a5; /* pretend to have Novell IPX installed */
172 case 0xbf: /* REDIRIFS.EXE */
173 switch (AL_reg(context
))
175 case 0x00: /* Install check */
179 INT_BARF( context
, 0x2f );
183 case 0xd7: /* Banyan Vines */
184 switch (AL_reg(context
))
186 case 0x01: /* Install check - Get Int Number */
190 INT_BARF( context
, 0x2f );
194 case 0xfa: /* Watcom debugger check, returns 0x666 if installed */
197 INT_BARF( context
, 0x2f );
203 /**********************************************************************
206 static void do_int2f_16( CONTEXT
*context
)
210 switch(AL_reg(context
))
212 case 0x00: /* Windows enhanced mode installation check */
213 AX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ?
214 LOWORD(GetVersion16()) : 0;
217 case 0x0a: /* Get Windows version and type */
219 BX_reg(context
) = (LOWORD(GetVersion16()) << 8) |
220 (LOWORD(GetVersion16()) >> 8);
221 CX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ? 3 : 2;
224 case 0x80: /* Release time-slice */
226 /* FIXME: We need to do something that lets some other process run
231 case 0x81: /* Begin critical section. */
235 case 0x82: /* End critical section. */
239 case 0x83: /* Return Current Virtual Machine ID */
240 /* Virtual Machines are usually created/destroyed when Windows runs
241 * DOS programs. Since we never do, we are always in the System VM.
242 * According to Ralf Brown's Interrupt List, never return 0. But it
243 * seems to work okay (returning 0), just to be sure we return 1.
245 BX_reg(context
) = 1; /* VM 1 is probably the System VM */
248 case 0x84: /* Get device API entry point */
249 addr
= (DWORD
)NE_GetEntryPoint( GetModuleHandle16("WPROCS"),
250 VXD_BASE
+ BX_reg(context
) );
251 if (!addr
) /* not supported */
253 ERR(int,"Accessing unknown VxD %04x - Expect a failure now.\n",
256 ES_reg(context
) = SELECTOROF(addr
);
257 DI_reg(context
) = OFFSETOF(addr
);
260 case 0x86: /* DPMI detect mode */
261 AX_reg(context
) = 0; /* Running under DPMI */
264 case 0x87: /* DPMI installation check */
265 #if 1 /* DPMI still breaks pkunzip */
266 if (ISV86(context
)) break; /* so bail out for now if in v86 mode */
269 TDB
*pTask
= (TDB
*)GlobalLock16( GetCurrentTask() );
270 NE_MODULE
*pModule
= pTask
? NE_GetPtr( pTask
->hModule
) : NULL
;
273 GlobalUnlock16( GetCurrentTask() );
275 AX_reg(context
) = 0x0000; /* DPMI Installed */
276 BX_reg(context
) = 0x0001; /* 32bits available */
277 CL_reg(context
) = si
.wProcessorLevel
;
278 DX_reg(context
) = 0x005a; /* DPMI major/minor 0.90 */
279 SI_reg(context
) = 0; /* # of para. of DOS extended private data */
280 #ifdef MZ_SUPPORTED /* ES:DI is DPMI switch entry point */
281 if (pModule
&& pModule
->lpDosTask
)
282 ES_reg(context
) = pModule
->lpDosTask
->dpmi_seg
;
289 case 0x8a: /* DPMI get vendor-specific API entry point. */
290 /* The 1.0 specs say this should work with all 0.9 hosts. */
294 INT_BARF( context
, 0x2f );
298 void do_mscdex( CONTEXT
*context
)
303 switch(AL_reg(context
))
305 case 0x00: /* Installation check */
306 /* Count the number of contiguous CDROM drives
308 for (drive
= count
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
310 if (DRIVE_GetType(drive
) == TYPE_CDROM
)
312 while (DRIVE_GetType(drive
+ count
) == TYPE_CDROM
) count
++;
317 BX_reg(context
) = count
;
318 CX_reg(context
) = (drive
< MAX_DOS_DRIVES
) ? drive
: 0;
321 case 0x0B: /* drive check */
322 AX_reg(context
) = (DRIVE_GetType(CX_reg(context
)) == TYPE_CDROM
);
323 BX_reg(context
) = 0xADAD;
326 case 0x0C: /* get version */
327 BX_reg(context
) = 0x020a;
330 case 0x0D: /* get drive letters */
331 p
= CTX_SEG_OFF_TO_LIN(context
, ES_reg(context
), BX_reg(context
));
332 memset( p
, 0, MAX_DOS_DRIVES
);
333 for (drive
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
335 if (DRIVE_GetType(drive
) == TYPE_CDROM
) *p
++ = drive
;
340 /* FIXME: why a new linux-only CDROM drive access, for crying out loud?
341 * There are pretty complete routines in multimedia/mcicda.c already! */
342 case 0x10: /* direct driver acces */
343 FIXME(cdaudio
,"mscdex should use multimedia/mcicda.c");
344 do_mscdex_dd(context
,ISV86(context
));
350 FIXME(int, "Unimplemented MSCDEX function 0x%02X.\n", AL_reg(context
));