2 * DOS interrupt 2fh handler
13 /* #define DEBUG_INT */
16 /* base WPROCS.DLL ordinal number for VxDs */
19 static void do_int2f_16( CONTEXT
*context
);
21 /**********************************************************************
24 * Handler for int 2fh (multiplex).
26 void WINAPI
INT_Int2fHandler( CONTEXT
*context
)
28 switch(AH_reg(context
))
31 AL_reg(context
) = 0xff; /* share is installed */
34 case 0x15: /* mscdex */
39 do_int2f_16( context
);
43 switch (AL_reg(context
))
54 /* Microsoft Profiler - not installed */
57 INT_BARF( context
, 0x2f );
62 switch(AL_reg(context
))
64 case 0x10: /* smartdrv */
65 break; /* not installed */
66 case 0x11: /* dblspace */
67 break; /* not installed */
68 case 0x12: /* realtime compression interface */
69 break; /* not installed */
71 INT_BARF( context
, 0x2f );
74 case 0x56: /* INTERLNK */
75 switch(AL_reg(context
))
77 case 0x01: /* check if redirected drive */
78 AL_reg(context
) = 0; /* not redirected */
81 INT_BARF( context
, 0x2f );
84 case 0xb7: /* append */
85 AL_reg(context
) = 0; /* not installed */
87 case 0xbd: /* some Novell network install check ??? */
88 AX_reg(context
) = 0xa5a5; /* pretend to have Novell IPX installed */
90 case 0xfa: /* Watcom debugger check, returns 0x666 if installed */
93 INT_BARF( context
, 0x2f );
99 /**********************************************************************
102 static void do_int2f_16( CONTEXT
*context
)
106 switch(AL_reg(context
))
108 case 0x00: /* Windows enhanced mode installation check */
109 AX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ?
110 LOWORD(GetVersion16()) : 0;
113 case 0x0a: /* Get Windows version and type */
115 BX_reg(context
) = (LOWORD(GetVersion16()) << 8) |
116 (LOWORD(GetVersion16()) >> 8);
117 CX_reg(context
) = (GetWinFlags() & WF_ENHANCED
) ? 3 : 2;
120 case 0x80: /* Release time-slice */
122 /* FIXME: We need to do something that lets some other process run
127 case 0x81: /* Begin critical section. */
131 case 0x82: /* End critical section. */
135 case 0x83: /* Return Current Virtual Machine ID */
136 /* Virtual Machines are usually created/destroyed when Windows runs
137 * DOS programs. Since we never do, we are always in the System VM.
138 * According to Ralf Brown's Interrupt List, never return 0. But it
139 * seems to work okay (returning 0), just to be sure we return 1.
141 BX_reg(context
) = 1; /* VM 1 is probably the System VM */
144 case 0x84: /* Get device API entry point */
145 addr
= (DWORD
)NE_GetEntryPoint( GetModuleHandle16("WPROCS"),
146 VXD_BASE
+ BX_reg(context
) );
147 if (!addr
) /* not supported */
149 WARN(int,"Application attempted to access VxD %04x\n",
151 WARN(int,"This device is not known to Wine.");
152 WARN(int,"Expect a failure now\n");
154 ES_reg(context
) = SELECTOROF(addr
);
155 DI_reg(context
) = OFFSETOF(addr
);
158 case 0x86: /* DPMI detect mode */
159 AX_reg(context
) = 0; /* Running under DPMI */
162 /* FIXME: is this right? Specs say that this should only be callable
163 in real (v86) mode which we never enter. */
164 case 0x87: /* DPMI installation check */
169 AX_reg(context
) = 0x0000; /* DPMI Installed */
170 BX_reg(context
) = 0x0001; /* 32bits available */
171 CL_reg(context
) = si
.wProcessorLevel
;
172 DX_reg(context
) = 0x005a; /* DPMI major/minor 0.90 */
173 SI_reg(context
) = 0; /* # of para. of DOS extended private data */
174 ES_reg(context
) = 0; /* ES:DI is DPMI switch entry point */
178 case 0x8a: /* DPMI get vendor-specific API entry point. */
179 /* The 1.0 specs say this should work with all 0.9 hosts. */
183 INT_BARF( context
, 0x2f );
187 void do_mscdex( CONTEXT
*context
)
192 switch(AL_reg(context
))
194 case 0x00: /* Installation check */
195 /* Count the number of contiguous CDROM drives
197 for (drive
= count
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
199 if (DRIVE_GetType(drive
) == TYPE_CDROM
)
201 while (DRIVE_GetType(drive
+ count
) == TYPE_CDROM
) count
++;
206 BX_reg(context
) = count
;
207 CX_reg(context
) = (drive
< MAX_DOS_DRIVES
) ? drive
: 0;
210 case 0x0B: /* drive check */
211 AX_reg(context
) = (DRIVE_GetType(CX_reg(context
)) == TYPE_CDROM
);
212 BX_reg(context
) = 0xADAD;
215 case 0x0C: /* get version */
216 BX_reg(context
) = 0x020a;
219 case 0x0D: /* get drive letters */
220 p
= PTR_SEG_OFF_TO_LIN(ES_reg(context
), BX_reg(context
));
221 memset( p
, 0, MAX_DOS_DRIVES
);
222 for (drive
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
224 if (DRIVE_GetType(drive
) == TYPE_CDROM
) *p
++ = drive
;
229 FIXME(int, "Unimplemented MSCDEX function 0x%02X.\n", AL_reg(context
));