12 /* #define DEBUG_INT */
15 /* base WPROCS.DLL ordinal number for VxDs */
18 static void do_int2f_16( SIGCONTEXT
*context
);
19 void do_mscdex( SIGCONTEXT
*context
);
21 /**********************************************************************
24 * Handler for int 2fh (multiplex).
26 void INT_Int2fHandler( SIGCONTEXT
*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
))
45 case 0x10: /* smartdrv */
46 break; /* not installed */
47 case 0x11: /* dblspace */
48 break; /* not installed */
49 case 0x12: /* realtime compression interface */
50 break; /* not installed */
52 INT_BARF( context
, 0x2f );
55 case 0xb7: /* append */
56 AL_reg(context
) = 0; /* not installed */
59 INT_BARF( context
, 0x2f );
65 /**********************************************************************
68 static void do_int2f_16( SIGCONTEXT
*context
)
72 switch(AL_reg(context
))
74 case 0x00: /* Windows enhanced mode installation check */
75 AX_reg(context
) = (Options
.mode
== MODE_ENHANCED
) ? WINVERSION
: 0;
78 case 0x0a: /* Get Windows version and type */
80 BX_reg(context
) = (WINVERSION
>> 8) | ((WINVERSION
<< 8) & 0xff00);
81 CX_reg(context
) = (Options
.mode
== MODE_ENHANCED
) ? 3 : 2;
84 case 0x80: /* Release time-slice */
86 /* FIXME: We need to do something that lets some other process run
91 case 0x83: /* Return Current Virtual Machine ID */
92 /* Virtual Machines are usually created/destroyed when Windows runs
93 * DOS programs. Since we never do, we are always in the System VM.
94 * According to Ralf Brown's Interrupt List, never return 0. But it
95 * seems to work okay (returning 0), just to be sure we return 1.
97 BX_reg(context
) = 1; /* VM 1 is probably the System VM */
100 case 0x84: /* Get device API entry point */
101 addr
= (DWORD
)MODULE_GetEntryPoint( GetModuleHandle("WPROCS"),
102 VXD_BASE
+ BX_reg(context
) );
103 if (!addr
) /* not supported */
105 fprintf( stderr
,"Application attempted to access VxD %04x\n",
107 fprintf( stderr
,"This device is not known to Wine.");
108 fprintf( stderr
,"Expect a failure now\n");
110 ES_reg(context
) = SELECTOROF(addr
);
111 DI_reg(context
) = OFFSETOF(addr
);
114 case 0x86: /* DPMI detect mode */
115 AX_reg(context
) = 0; /* Running under DPMI */
118 /* FIXME: is this right? Specs say that this should only be callable
119 in real (v86) mode which we never enter. */
120 case 0x87: /* DPMI installation check */
121 AX_reg(context
) = 0x0000; /* DPMI Installed */
122 BX_reg(context
) = 0x0001; /* 32bits available */
123 CL_reg(context
) = runtime_cpu();
124 DX_reg(context
) = 0x005a; /* DPMI major/minor 0.90 */
125 SI_reg(context
) = 0; /* # of para. of DOS extended private data */
126 ES_reg(context
) = 0; /* ES:DI is DPMI switch entry point */
130 case 0x8a: /* DPMI get vendor-specific API entry point. */
131 /* The 1.0 specs say this should work with all 0.9 hosts. */
135 INT_BARF( context
, 0x2f );
139 void do_mscdex( SIGCONTEXT
*context
)
144 switch(AL_reg(context
))
146 case 0x00: /* Installation check */
147 /* Count the number of contiguous CDROM drives
149 for (drive
= count
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
151 if (DRIVE_GetType(drive
) == TYPE_CDROM
)
153 while (DRIVE_GetType(drive
+ count
) == TYPE_CDROM
) count
++;
158 BX_reg(context
) = count
;
159 CX_reg(context
) = (drive
< MAX_DOS_DRIVES
) ? drive
: 0;
162 case 0x0B: /* drive check */
163 AX_reg(context
) = (DRIVE_GetType(CX_reg(context
)) == TYPE_CDROM
);
164 BX_reg(context
) = 0xADAD;
167 case 0x0C: /* get version */
168 BX_reg(context
) = 0x020a;
171 case 0x0D: /* get drive letters */
172 p
= PTR_SEG_OFF_TO_LIN(ES_reg(context
), BX_reg(context
));
173 memset( p
, 0, MAX_DOS_DRIVES
);
174 for (drive
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
176 if (DRIVE_GetType(drive
) == TYPE_CDROM
) *p
++ = drive
;
181 fprintf(stderr
, "Unimplemented MSCDEX function 0x%02.2X.\n", AL_reg(context
));