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 switch(AH_reg(context))
32 AL_reg(context) = 0xff; /* share is installed */
35 case 0x15: /* mscdex */
40 do_int2f_16( context );
44 switch (AL_reg(context))
55 /* Microsoft Profiler - not installed */
58 INT_BARF( context, 0x2f );
63 switch(AL_reg(context))
65 case 0x10: /* smartdrv */
66 break; /* not installed */
67 case 0x11: /* dblspace */
68 break; /* not installed */
69 case 0x12: /* realtime compression interface */
70 break; /* not installed */
72 INT_BARF( context, 0x2f );
75 case 0x56: /* INTERLNK */
76 switch(AL_reg(context))
78 case 0x01: /* check if redirected drive */
79 AL_reg(context) = 0; /* not redirected */
82 INT_BARF( context, 0x2f );
85 case 0xb7: /* append */
86 AL_reg(context) = 0; /* not installed */
88 case 0xbd: /* some Novell network install check ??? */
89 AX_reg(context) = 0xa5a5; /* pretend to have Novell IPX installed */
91 case 0xfa: /* Watcom debugger check, returns 0x666 if installed */
94 INT_BARF( context, 0x2f );
100 /**********************************************************************
103 static void do_int2f_16( CONTEXT *context )
107 switch(AL_reg(context))
109 case 0x00: /* Windows enhanced mode installation check */
110 AX_reg(context) = (GetWinFlags() & WF_ENHANCED) ?
111 LOWORD(GetVersion16()) : 0;
114 case 0x0a: /* Get Windows version and type */
116 BX_reg(context) = (LOWORD(GetVersion16()) << 8) |
117 (LOWORD(GetVersion16()) >> 8);
118 CX_reg(context) = (GetWinFlags() & WF_ENHANCED) ? 3 : 2;
121 case 0x80: /* Release time-slice */
123 /* FIXME: We need to do something that lets some other process run
128 case 0x81: /* Begin critical section. */
132 case 0x82: /* End critical section. */
136 case 0x83: /* Return Current Virtual Machine ID */
137 /* Virtual Machines are usually created/destroyed when Windows runs
138 * DOS programs. Since we never do, we are always in the System VM.
139 * According to Ralf Brown's Interrupt List, never return 0. But it
140 * seems to work okay (returning 0), just to be sure we return 1.
142 BX_reg(context) = 1; /* VM 1 is probably the System VM */
145 case 0x84: /* Get device API entry point */
146 addr = (DWORD)NE_GetEntryPoint( GetModuleHandle16("WPROCS"),
147 VXD_BASE + BX_reg(context) );
148 if (!addr) /* not supported */
150 WARN(int,"Application attempted to access VxD %04x\n",
152 WARN(int,"This device is not known to Wine.");
153 WARN(int,"Expect a failure now\n");
155 ES_reg(context) = SELECTOROF(addr);
156 DI_reg(context) = OFFSETOF(addr);
159 case 0x86: /* DPMI detect mode */
160 AX_reg(context) = 0; /* Running under DPMI */
163 /* FIXME: is this right? Specs say that this should only be callable
164 in real (v86) mode which we never enter. */
165 case 0x87: /* DPMI installation check */
170 AX_reg(context) = 0x0000; /* DPMI Installed */
171 BX_reg(context) = 0x0001; /* 32bits available */
172 CL_reg(context) = si.wProcessorLevel;
173 DX_reg(context) = 0x005a; /* DPMI major/minor 0.90 */
174 SI_reg(context) = 0; /* # of para. of DOS extended private data */
175 ES_reg(context) = 0; /* ES:DI is DPMI switch entry point */
179 case 0x8a: /* DPMI get vendor-specific API entry point. */
180 /* The 1.0 specs say this should work with all 0.9 hosts. */
184 INT_BARF( context, 0x2f );
188 void do_mscdex( CONTEXT *context )
193 switch(AL_reg(context))
195 case 0x00: /* Installation check */
196 /* Count the number of contiguous CDROM drives
198 for (drive = count = 0; drive < MAX_DOS_DRIVES; drive++)
200 if (DRIVE_GetType(drive) == TYPE_CDROM)
202 while (DRIVE_GetType(drive + count) == TYPE_CDROM) count++;
207 BX_reg(context) = count;
208 CX_reg(context) = (drive < MAX_DOS_DRIVES) ? drive : 0;
211 case 0x0B: /* drive check */
212 AX_reg(context) = (DRIVE_GetType(CX_reg(context)) == TYPE_CDROM);
213 BX_reg(context) = 0xADAD;
216 case 0x0C: /* get version */
217 BX_reg(context) = 0x020a;
220 case 0x0D: /* get drive letters */
221 p = PTR_SEG_OFF_TO_LIN(ES_reg(context), BX_reg(context));
222 memset( p, 0, MAX_DOS_DRIVES );
223 for (drive = 0; drive < MAX_DOS_DRIVES; drive++)
225 if (DRIVE_GetType(drive) == TYPE_CDROM) *p++ = drive;
230 FIXME(int, "Unimplemented MSCDEX function 0x%02X.\n", AL_reg(context));