14 /* #define DEBUG_INT */
17 /* base WINPROC module number for VxDs */
20 static void do_int2f_16(struct sigcontext_struct
*context
);
21 void do_mscdex(struct sigcontext_struct
*context
);
23 /**********************************************************************
26 * Handler for int 2fh (multiplex).
28 void INT_Int2fHandler( struct sigcontext_struct context
)
30 switch(AH_reg(&context
))
33 AL_reg(&context
) = 0xff; /* share is installed */
36 case 0x15: /* mscdex */
41 do_int2f_16( &context
);
45 switch(AL_reg(&context
))
47 case 0x10: /* smartdrv */
48 break; /* not installed */
49 case 0x11: /* dblspace */
50 break; /* not installed */
51 case 0x12: /* realtime compression interface */
52 break; /* not installed */
54 INT_BARF( &context
, 0x2f );
58 INT_BARF( &context
, 0x2f );
64 /**********************************************************************
67 static void do_int2f_16(struct sigcontext_struct
*context
)
71 switch(AL_reg(context
))
73 case 0x00: /* Windows enhanced mode installation check */
74 AX_reg(context
) = (Options
.mode
== MODE_ENHANCED
) ? WINVERSION
: 0;
77 case 0x0a: /* Get Windows version and type */
79 BX_reg(context
) = (WINVERSION
>> 8) | ((WINVERSION
<< 8) & 0xff00);
80 CX_reg(context
) = (Options
.mode
== MODE_ENHANCED
) ? 3 : 2;
83 case 0x80: /* Release time-slice */
85 /* FIXME: We need to do something that lets some other process run
90 case 0x83: /* Return Current Virtual Machine ID */
91 /* Virtual Machines are usually created/destroyed when Windows runs
92 * DOS programs. Since we never do, we are always in the System VM.
93 * According to Ralf Brown's Interrupt List, never return 0. But it
94 * seems to work okay (returning 0), just to be sure we return 1.
96 BX_reg(context
) = 1; /* VM 1 is probably the System VM */
99 case 0x84: /* Get device API entry point */
100 addr
= MODULE_GetEntryPoint( GetModuleHandle("WINPROCS"),
101 VXD_BASE
+ BX_reg(context
) );
102 if (!addr
) /* not supported */
104 fprintf( stderr
,"Application attempted to access VxD %04x\n",
106 fprintf( stderr
,"This device is not known to Wine.");
107 fprintf( stderr
,"Expect a failure now\n");
109 ES_reg(context
) = SELECTOROF(addr
);
110 DI_reg(context
) = OFFSETOF(addr
);
113 case 0x86: /* DPMI detect mode */
114 AX_reg(context
) = 0; /* Running under DPMI */
117 /* FIXME: is this right? Specs say that this should only be callable
118 in real (v86) mode which we never enter. */
119 case 0x87: /* DPMI installation check */
120 AX_reg(context
) = 0x0000; /* DPMI Installed */
121 BX_reg(context
) = 0x0001; /* 32bits available */
122 CL_reg(context
) = runtime_cpu();
123 DX_reg(context
) = 0x005a; /* DPMI major/minor 0.90 */
124 SI_reg(context
) = 0; /* # of para. of DOS extended private data */
125 ES_reg(context
) = 0; /* ES:DI is DPMI switch entry point */
129 case 0x8a: /* DPMI get vendor-specific API entry point. */
130 /* The 1.0 specs say this should work with all 0.9 hosts. */
134 INT_BARF( context
, 0x2f );
138 void do_mscdex(struct sigcontext_struct
*context
)
143 switch(AL_reg(context
))
145 case 0x00: /* Installation check */
146 /* Count the number of contiguous CDROM drives
148 for (drive
= count
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
150 if (DRIVE_GetType(drive
) == TYPE_CDROM
)
152 while (DRIVE_GetType(drive
+ count
) == TYPE_CDROM
) count
++;
157 BX_reg(context
) = count
;
158 CX_reg(context
) = (drive
< MAX_DOS_DRIVES
) ? drive
: 0;
161 case 0x0B: /* drive check */
162 AX_reg(context
) = (DRIVE_GetType(CX_reg(context
)) == TYPE_CDROM
);
163 BX_reg(context
) = 0xADAD;
166 case 0x0C: /* get version */
167 BX_reg(context
) = 0x020a;
170 case 0x0D: /* get drive letters */
171 p
= PTR_SEG_OFF_TO_LIN(ES_reg(context
), BX_reg(context
));
172 memset( p
, 0, MAX_DOS_DRIVES
);
173 for (drive
= 0; drive
< MAX_DOS_DRIVES
; drive
++)
175 if (DRIVE_GetType(drive
) == TYPE_CDROM
) *p
++ = drive
;
180 fprintf(stderr
, "Unimplemented MSCDEX function 0x%02.2X.\n", AL_reg(context
));