Release 970112
[wine/multimedia.git] / msdos / vxd.c
bloba56c1e5e59c8178328efbc0f5ad8e9a9ff8cecf7
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 "stddebug.h"
12 /* #define DEBUG_VXD */
13 #include "debug.h"
16 #define VXD_BARF(context,name) \
17 fprintf( stderr, "vxd %s: unknown/not implemented parameters:\n" \
18 "vxd %s: AX %04x, BX %04x, CX %04x, DX %04x, " \
19 "SI %04x, DI %04x, DS %04x, ES %04x\n", \
20 (name), (name), AX_reg(context), BX_reg(context), \
21 CX_reg(context), DX_reg(context), SI_reg(context), \
22 DI_reg(context), (WORD)DS_reg(context), (WORD)ES_reg(context) )
24 /***********************************************************************
25 * VXD_PageFile
27 void VXD_PageFile( CONTEXT *context )
29 /* taken from Ralf Brown's Interrupt List */
31 dprintf_vxd(stddeb,"VxD PageFile called ...\n");
33 switch(AX_reg(context))
35 case 0x00: /* get version, is this windows version? */
36 dprintf_vxd(stddeb,"VxD PageFile: returning version\n");
37 AX_reg(context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
38 RESET_CFLAG(context);
39 break;
41 case 0x01: /* get swap file info */
42 dprintf_vxd(stddeb,"VxD PageFile: returning swap file info\n");
43 AX_reg(context) = 0x00; /* paging disabled */
44 ECX_reg(context) = 0; /* maximum size of paging file */
45 /* FIXME: do I touch DS:SI or DS:DI? */
46 RESET_CFLAG(context);
47 break;
49 case 0x02: /* delete permanent swap on exit */
50 dprintf_vxd(stddeb,"VxD PageFile: supposed to delete swap\n");
51 RESET_CFLAG(context);
52 break;
54 case 0x03: /* current temporary swap file size */
55 dprintf_vxd(stddeb,"VxD PageFile: what is current temp. swap size\n");
56 RESET_CFLAG(context);
57 break;
59 case 0x04: /* read or write?? INTERRUP.D */
60 case 0x05: /* cancel?? INTERRUP.D */
61 case 0x06: /* test I/O valid INTERRUP.D */
62 default:
63 VXD_BARF( context, "pagefile" );
64 break;
69 /***********************************************************************
70 * VXD_Shell
72 void VXD_Shell( CONTEXT *context )
74 dprintf_vxd(stddeb,"VxD Shell called ...\n");
76 switch (DX_reg(context)) /* Ralf Brown says EDX, but I use DX instead */
78 case 0x0000:
79 dprintf_vxd(stddeb,"VxD Shell: returning version\n");
80 AX_reg(context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
81 EBX_reg(context) = 1; /* system VM Handle */
82 break;
84 case 0x0001:
85 case 0x0002:
86 case 0x0003:
87 case 0x0004:
88 case 0x0005:
89 dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(context));
90 VXD_BARF( context, "shell" );
91 break;
93 case 0x0006: /* SHELL_Get_VM_State */
94 dprintf_vxd(stddeb,"VxD Shell: returning VM state\n");
95 /* Actually we don't, not yet. We have to return a structure
96 * and I am not to sure how to set it up and return it yet,
97 * so for now let's do nothing. I can (hopefully) get this
98 * by the next release
100 /* RESET_CFLAG(context); */
101 break;
103 case 0x0007:
104 case 0x0008:
105 case 0x0009:
106 case 0x000A:
107 case 0x000B:
108 case 0x000C:
109 case 0x000D:
110 case 0x000E:
111 case 0x000F:
112 case 0x0010:
113 case 0x0011:
114 case 0x0012:
115 case 0x0013:
116 case 0x0014:
117 case 0x0015:
118 case 0x0016:
119 default:
120 dprintf_vxd(stddeb,"VxD Shell: EDX = %08lx\n",EDX_reg(context));
121 VXD_BARF( context, "shell");
122 break;
127 /***********************************************************************
128 * VXD_Comm
130 void VXD_Comm( CONTEXT *context )
132 dprintf_vxd(stddeb,"VxD Comm called ...\n");
134 switch (AX_reg(context))
136 case 0x0000: /* get version */
137 dprintf_vxd(stddeb,"VxD Comm: returning version\n");
138 AX_reg(context) = (WINVERSION >> 8) | ((WINVERSION << 8) & 0xff00);
139 RESET_CFLAG(context);
140 break;
142 case 0x0001: /* set port global */
143 case 0x0002: /* get focus */
144 case 0x0003: /* virtualise port */
145 default:
146 VXD_BARF( context, "comm" );