Release 960114
[wine/gsoc-2012-control.git] / miscemu / vxd.c
blob95712f47b03da80d5df26dfcf6d67b8c4a722dd7
1 /*
2 * VxD emulation
4 * Copyright 1995 Anand Kumria
5 */
7 #include <stdio.h>
8 #include "windows.h"
9 #include "msdos.h"
10 #include "miscemu.h"
11 #include "wine.h"
12 #include "stddebug.h"
13 /* #define DEBUG_VXD */
14 #include "debug.h"
17 /***********************************************************************
18 * VXD_PageFile
20 void VXD_PageFile( struct sigcontext_struct context )
22 /* taken from Ralf Brown's Interrupt List */
24 dprintf_vxd(stddeb,"VxD PageFile called ...\n");
26 switch(AX_reg(&context))
28 case 0x00: /* get version, is this windows version? */
29 dprintf_vxd(stddeb,"VxD PageFile: returning version\n");
30 AX_reg(&context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
31 RESET_CFLAG(&context);
32 break;
34 case 0x01: /* get swap file info */
35 dprintf_vxd(stddeb,"VxD PageFile: returning swap file info\n");
36 AX_reg(&context) = 0x00; /* paging disabled */
37 ECX_reg(&context) = 0; /* maximum size of paging file */
38 /* FIXME: do I touch DS:SI or DS:DI? */
39 RESET_CFLAG(&context);
40 break;
42 case 0x02: /* delete permanent swap on exit */
43 dprintf_vxd(stddeb,"VxD PageFile: supposed to delete swap\n");
44 RESET_CFLAG(&context);
45 break;
47 case 0x03: /* current temporary swap file size */
48 dprintf_vxd(stddeb,"VxD PageFile: what is current temp. swap size\n");
49 RESET_CFLAG(&context);
50 break;
52 case 0x04: /* read or write?? INTERRUP.D */
53 case 0x05: /* cancel?? INTERRUP.D */
54 case 0x06: /* test I/O valid INTERRUP.D */
55 default:
56 INT_BARF( &context, 0x2f);
57 break;
62 /***********************************************************************
63 * VXD_Shell
65 void VXD_Shell( struct sigcontext_struct context )
67 dprintf_vxd(stddeb,"VxD Shell called ...\n");
69 switch (DX_reg(&context)) /* Ralf Brown says EDX, but I use DX instead */
71 case 0x0000:
72 dprintf_vxd(stddeb,"VxD Shell: returning version\n");
73 AX_reg(&context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
74 EBX_reg(&context) = 1; /* system VM Handle */
75 break;
77 case 0x0001:
78 case 0x0002:
79 case 0x0003:
80 case 0x0004:
81 case 0x0005:
82 dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(&context));
83 INT_BARF( &context, 0x2f);
84 break;
86 case 0x0006: /* SHELL_Get_VM_State */
87 dprintf_vxd(stddeb,"VxD Shell: returning VM state\n");
88 /* Actually we don't, not yet. We have to return a structure
89 * and I am not to sure how to set it up and return it yet,
90 * so for now let's do nothing. I can (hopefully) get this
91 * by the next release
93 /* RESET_CFLAG(&context); */
94 break;
96 case 0x0007:
97 case 0x0008:
98 case 0x0009:
99 case 0x000A:
100 case 0x000B:
101 case 0x000C:
102 case 0x000D:
103 case 0x000E:
104 case 0x000F:
105 case 0x0010:
106 case 0x0011:
107 case 0x0012:
108 case 0x0013:
109 case 0x0014:
110 case 0x0015:
111 case 0x0016:
112 default:
113 dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(&context));
114 INT_BARF( &context, 0x2f);
115 break;
120 /***********************************************************************
121 * VXD_Comm
123 void VXD_Comm( struct sigcontext_struct context )
125 dprintf_vxd(stddeb,"VxD Comm called ...\n");
127 switch (AX_reg(&context))
129 case 0x0000: /* get version */
130 dprintf_vxd(stddeb,"VxD Comm: returning version\n");
131 AX_reg(&context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
132 RESET_CFLAG(&context);
133 break;
135 case 0x0001: /* set port global */
136 case 0x0002: /* get focus */
137 case 0x0003: /* virtualise port */
138 default:
139 INT_BARF( &context, 0x2f);