Restored MakeCriticalSectionGlobal that got lost somewhere.
[wine/multimedia.git] / msdos / int11.c
blobd7ac9d70e54d19da5ce2a722ba5bd1a72149b494
1 /*
2 * BIOS interrupt 11h handler
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "config.h"
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
27 #include "windef.h"
28 #include "miscemu.h"
29 #include "msdos.h"
30 #include "file.h"
31 #include "wine/debug.h"
33 /**********************************************************************
34 * INT_Int11Handler (WPROCS.117)
36 * Handler for int 11h (get equipment list).
38 void WINAPI INT_Int11Handler( CONTEXT86 *context )
40 int diskdrives = 0;
41 int parallelports = 0;
42 int serialports = 0;
43 int x;
45 /* borrowed from Ralph Brown's interrupt lists
47 bits 15-14: number of parallel devices
48 bit 13: [Conv] Internal modem
49 bit 12: reserved
50 bits 11- 9: number of serial devices
51 bit 8: reserved
52 bits 7- 6: number of diskette drives minus one
53 bits 5- 4: Initial video mode:
54 00b = EGA,VGA,PGA
55 01b = 40 x 25 color
56 10b = 80 x 25 color
57 11b = 80 x 25 mono
58 bit 3: reserved
59 bit 2: [PS] =1 if pointing device
60 [non-PS] reserved
61 bit 1: =1 if math co-processor
62 bit 0: =1 if diskette available for boot
64 /* Currently the only of these bits correctly set are:
65 bits 15-14 } Added by William Owen Smith,
66 bits 11-9 } wos@dcs.warwick.ac.uk
67 bits 7-6
68 bit 2 (always set)
71 if (GetDriveTypeA("A:\\") == DRIVE_REMOVABLE) diskdrives++;
72 if (GetDriveTypeA("B:\\") == DRIVE_REMOVABLE) diskdrives++;
73 if (diskdrives) diskdrives--;
75 for (x=0; x < 9; x++)
77 char temp[16],name[16];
79 sprintf(name,"COM%d",x+1);
80 PROFILE_GetWineIniString("serialports",name,"*",temp,sizeof temp);
81 if(strcmp(temp,"*"))
82 serialports++;
84 sprintf(name,"LPT%d",x+1);
85 PROFILE_GetWineIniString("parallelports",name,"*",temp,sizeof temp);
86 if(strcmp(temp,"*"))
87 parallelports++;
89 if (serialports > 7) /* 3 bits -- maximum value = 7 */
90 serialports=7;
91 if (parallelports > 3) /* 2 bits -- maximum value = 3 */
92 parallelports=3;
94 AX_reg(context) = (diskdrives << 6) | (serialports << 9) |
95 (parallelports << 14) | 0x02;