Add an error message if devmode structure in registry is invalid;
[wine.git] / win32 / device.c
blobce5f29ad56e52ad0de0b34845b223305e8b94504
1 /*
2 * Win32 device functions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Ulrich Weigand
6 * Copyright 1998 Patrik Stridvall
8 */
10 #include "config.h"
12 #include <errno.h>
13 #include <assert.h>
14 #include <stdlib.h>
15 #include <unistd.h>
16 #include <sys/types.h>
17 #include <sys/stat.h>
18 #ifdef HAVE_SYS_MMAN_H
19 #include <sys/mman.h>
20 #endif
21 #include <fcntl.h>
22 #include <string.h>
23 #include <stdarg.h>
24 #include <time.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winreg.h"
28 #include "winerror.h"
29 #include "file.h"
30 #include "process.h"
31 #include "heap.h"
32 #include "winioctl.h"
33 #include "winnt.h"
34 #include "msdos.h"
35 #include "miscemu.h"
36 #include "stackframe.h"
37 #include "server.h"
38 #include "debugtools.h"
39 #include "global.h"
41 DEFAULT_DEBUG_CHANNEL(win32);
44 static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode,
45 LPVOID lpvInBuffer, DWORD cbInBuffer,
46 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
47 LPDWORD lpcbBytesReturned,
48 LPOVERLAPPED lpOverlapped);
49 static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode,
50 LPVOID lpvInBuffer, DWORD cbInBuffer,
51 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
52 LPDWORD lpcbBytesReturned,
53 LPOVERLAPPED lpOverlapped);
54 static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode,
55 LPVOID lpvInBuffer, DWORD cbInBuffer,
56 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
57 LPDWORD lpcbBytesReturned,
58 LPOVERLAPPED lpOverlapped);
60 static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context );
62 static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode,
63 LPVOID lpvInBuffer, DWORD cbInBuffer,
64 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
65 LPDWORD lpcbBytesReturned,
66 LPOVERLAPPED lpOverlapped);
68 static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context );
70 static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
71 LPVOID lpvInBuffer, DWORD cbInBuffer,
72 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
73 LPDWORD lpcbBytesReturned,
74 LPOVERLAPPED lpOverlapped);
76 static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode,
77 LPVOID lpvInBuffer, DWORD cbInBuffer,
78 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
79 LPDWORD lpcbBytesReturned,
80 LPOVERLAPPED lpOverlapped);
82 * VxD names are taken from the Win95 DDK
85 struct VxDInfo
87 LPCSTR name;
88 WORD id;
89 DWORD (*vxdcall)(DWORD, CONTEXT86 *);
90 BOOL (*deviceio)(DWORD, LPVOID, DWORD,
91 LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
94 static const struct VxDInfo VxDList[] =
96 /* Standard VxD IDs */
97 { "VMM", 0x0001, VxDCall_VMM, NULL },
98 { "DEBUG", 0x0002, NULL, NULL },
99 { "VPICD", 0x0003, NULL, NULL },
100 { "VDMAD", 0x0004, NULL, NULL },
101 { "VTD", 0x0005, NULL, NULL },
102 { "V86MMGR", 0x0006, NULL, NULL },
103 { "PAGESWAP", 0x0007, NULL, NULL },
104 { "PARITY", 0x0008, NULL, NULL },
105 { "REBOOT", 0x0009, NULL, NULL },
106 { "VDD", 0x000A, NULL, NULL },
107 { "VSD", 0x000B, NULL, NULL },
108 { "VMD", 0x000C, NULL, NULL },
109 { "VKD", 0x000D, NULL, NULL },
110 { "VCD", 0x000E, NULL, NULL },
111 { "VPD", 0x000F, NULL, NULL },
112 { "BLOCKDEV", 0x0010, NULL, NULL },
113 { "VMCPD", 0x0011, NULL, NULL },
114 { "EBIOS", 0x0012, NULL, NULL },
115 { "BIOSXLAT", 0x0013, NULL, NULL },
116 { "VNETBIOS", 0x0014, NULL, NULL },
117 { "DOSMGR", 0x0015, NULL, NULL },
118 { "WINLOAD", 0x0016, NULL, NULL },
119 { "SHELL", 0x0017, NULL, NULL },
120 { "VMPOLL", 0x0018, NULL, NULL },
121 { "VPROD", 0x0019, NULL, NULL },
122 { "DOSNET", 0x001A, NULL, NULL },
123 { "VFD", 0x001B, NULL, NULL },
124 { "VDD2", 0x001C, NULL, NULL },
125 { "WINDEBUG", 0x001D, NULL, NULL },
126 { "TSRLOAD", 0x001E, NULL, NULL },
127 { "BIOSHOOK", 0x001F, NULL, NULL },
128 { "INT13", 0x0020, NULL, NULL },
129 { "PAGEFILE", 0x0021, NULL, NULL },
130 { "SCSI", 0x0022, NULL, NULL },
131 { "MCA_POS", 0x0023, NULL, NULL },
132 { "SCSIFD", 0x0024, NULL, NULL },
133 { "VPEND", 0x0025, NULL, NULL },
134 { "VPOWERD", 0x0026, NULL, NULL },
135 { "VXDLDR", 0x0027, NULL, NULL },
136 { "NDIS", 0x0028, NULL, NULL },
137 { "BIOS_EXT", 0x0029, NULL, NULL },
138 { "VWIN32", 0x002A, VxDCall_VWin32, DeviceIo_VWin32 },
139 { "VCOMM", 0x002B, NULL, NULL },
140 { "SPOOLER", 0x002C, NULL, NULL },
141 { "WIN32S", 0x002D, NULL, NULL },
142 { "DEBUGCMD", 0x002E, NULL, NULL },
144 { "VNB", 0x0031, NULL, NULL },
145 { "SERVER", 0x0032, NULL, NULL },
146 { "CONFIGMG", 0x0033, NULL, NULL },
147 { "DWCFGMG", 0x0034, NULL, NULL },
148 { "SCSIPORT", 0x0035, NULL, NULL },
149 { "VFBACKUP", 0x0036, NULL, NULL },
150 { "ENABLE", 0x0037, NULL, NULL },
151 { "VCOND", 0x0038, NULL, NULL },
153 { "EFAX", 0x003A, NULL, NULL },
154 { "DSVXD", 0x003B, NULL, NULL },
155 { "ISAPNP", 0x003C, NULL, NULL },
156 { "BIOS", 0x003D, NULL, NULL },
157 { "WINSOCK", 0x003E, NULL, NULL },
158 { "WSOCK", 0x003E, NULL, NULL },
159 { "WSIPX", 0x003F, NULL, NULL },
160 { "IFSMgr", 0x0040, NULL, DeviceIo_IFSMgr },
161 { "VCDFSD", 0x0041, NULL, NULL },
162 { "MRCI2", 0x0042, NULL, NULL },
163 { "PCI", 0x0043, NULL, NULL },
164 { "PELOADER", 0x0044, NULL, NULL },
165 { "EISA", 0x0045, NULL, NULL },
166 { "DRAGCLI", 0x0046, NULL, NULL },
167 { "DRAGSRV", 0x0047, NULL, NULL },
168 { "PERF", 0x0048, NULL, NULL },
169 { "AWREDIR", 0x0049, NULL, NULL },
171 /* Far East support */
172 { "ETEN", 0x0060, NULL, NULL },
173 { "CHBIOS", 0x0061, NULL, NULL },
174 { "VMSGD", 0x0062, NULL, NULL },
175 { "VPPID", 0x0063, NULL, NULL },
176 { "VIME", 0x0064, NULL, NULL },
177 { "VHBIOSD", 0x0065, NULL, NULL },
179 /* Multimedia OEM IDs */
180 { "VTDAPI", 0x0442, NULL, DeviceIo_VTDAPI },
181 { "MMDEVLDR", 0x044A, NULL, DeviceIo_MMDEVLDR },
183 /* Network Device IDs */
184 { "VNetSup", 0x0480, NULL, NULL },
185 { "VRedir", 0x0481, NULL, NULL },
186 { "VBrowse", 0x0482, NULL, NULL },
187 { "VSHARE", 0x0483, NULL, NULL },
188 { "IFSMgr", 0x0484, NULL, NULL },
189 { "MEMPROBE", 0x0485, NULL, NULL },
190 { "VFAT", 0x0486, NULL, NULL },
191 { "NWLINK", 0x0487, NULL, NULL },
192 { "VNWLINK", 0x0487, NULL, NULL },
193 { "NWSUP", 0x0487, NULL, NULL },
194 { "VTDI", 0x0488, NULL, NULL },
195 { "VIP", 0x0489, NULL, NULL },
196 { "VTCP", 0x048A, NULL, NULL },
197 { "VCache", 0x048B, NULL, NULL },
198 { "VUDP", 0x048C, NULL, NULL },
199 { "VAsync", 0x048D, NULL, NULL },
200 { "NWREDIR", 0x048E, NULL, NULL },
201 { "STAT80", 0x048F, NULL, NULL },
202 { "SCSIPORT", 0x0490, NULL, NULL },
203 { "FILESEC", 0x0491, NULL, NULL },
204 { "NWSERVER", 0x0492, NULL, NULL },
205 { "SECPROV", 0x0493, NULL, NULL },
206 { "NSCL", 0x0494, NULL, NULL },
207 { "WSTCP", 0x0495, NULL, NULL },
208 { "NDIS2SUP", 0x0496, NULL, NULL },
209 { "MSODISUP", 0x0497, NULL, NULL },
210 { "Splitter", 0x0498, NULL, NULL },
211 { "PPP", 0x0499, NULL, NULL },
212 { "VDHCP", 0x049A, NULL, NULL },
213 { "VNBT", 0x049B, NULL, NULL },
214 { "LOGGER", 0x049D, NULL, NULL },
215 { "EFILTER", 0x049E, NULL, NULL },
216 { "FFILTER", 0x049F, NULL, NULL },
217 { "TFILTER", 0x04A0, NULL, NULL },
218 { "AFILTER", 0x04A1, NULL, NULL },
219 { "IRLAMP", 0x04A2, NULL, NULL },
221 { "PCCARD", 0x097C, NULL, DeviceIo_PCCARD },
223 /* WINE additions, ids unknown */
224 { "MONODEBG.VXD", 0x4242, NULL, DeviceIo_MONODEBG },
226 { NULL, 0, NULL, NULL }
230 * VMM VxDCall service names are (mostly) taken from Stan Mitchell's
231 * "Inside the Windows 95 File System"
234 #define N_VMM_SERVICE 41
236 LPCSTR VMM_Service_Name[N_VMM_SERVICE] =
238 "PageReserve", /* 0x0000 */
239 "PageCommit", /* 0x0001 */
240 "PageDecommit", /* 0x0002 */
241 "PagerRegister", /* 0x0003 */
242 "PagerQuery", /* 0x0004 */
243 "HeapAllocate", /* 0x0005 */
244 "ContextCreate", /* 0x0006 */
245 "ContextDestroy", /* 0x0007 */
246 "PageAttach", /* 0x0008 */
247 "PageFlush", /* 0x0009 */
248 "PageFree", /* 0x000A */
249 "ContextSwitch", /* 0x000B */
250 "HeapReAllocate", /* 0x000C */
251 "PageModifyPermissions", /* 0x000D */
252 "PageQuery", /* 0x000E */
253 "GetCurrentContext", /* 0x000F */
254 "HeapFree", /* 0x0010 */
255 "RegOpenKey", /* 0x0011 */
256 "RegCreateKey", /* 0x0012 */
257 "RegCloseKey", /* 0x0013 */
258 "RegDeleteKey", /* 0x0014 */
259 "RegSetValue", /* 0x0015 */
260 "RegDeleteValue", /* 0x0016 */
261 "RegQueryValue", /* 0x0017 */
262 "RegEnumKey", /* 0x0018 */
263 "RegEnumValue", /* 0x0019 */
264 "RegQueryValueEx", /* 0x001A */
265 "RegSetValueEx", /* 0x001B */
266 "RegFlushKey", /* 0x001C */
267 "RegQueryInfoKey", /* 0x001D */
268 "GetDemandPageInfo", /* 0x001E */
269 "BlockOnID", /* 0x001F */
270 "SignalID", /* 0x0020 */
271 "RegLoadKey", /* 0x0021 */
272 "RegUnLoadKey", /* 0x0022 */
273 "RegSaveKey", /* 0x0023 */
274 "RegRemapPreDefKey", /* 0x0024 */
275 "PageChangePager", /* 0x0025 */
276 "RegQueryMultipleValues", /* 0x0026 */
277 "RegReplaceKey", /* 0x0027 */
278 "<KERNEL32.101>" /* 0x0028 -- What does this do??? */
281 /* PageReserve arena values */
282 #define PR_PRIVATE 0x80000400 /* anywhere in private arena */
283 #define PR_SHARED 0x80060000 /* anywhere in shared arena */
284 #define PR_SYSTEM 0x80080000 /* anywhere in system arena */
286 /* PageReserve flags */
287 #define PR_FIXED 0x00000008 /* don't move during PageReAllocate */
288 #define PR_4MEG 0x00000001 /* allocate on 4mb boundary */
289 #define PR_STATIC 0x00000010 /* see PageReserve documentation */
291 /* PageCommit default pager handle values */
292 #define PD_ZEROINIT 0x00000001 /* swappable zero-initialized pages */
293 #define PD_NOINIT 0x00000002 /* swappable uninitialized pages */
294 #define PD_FIXEDZERO 0x00000003 /* fixed zero-initialized pages */
295 #define PD_FIXED 0x00000004 /* fixed uninitialized pages */
297 /* PageCommit flags */
298 #define PC_FIXED 0x00000008 /* pages are permanently locked */
299 #define PC_LOCKED 0x00000080 /* pages are made present and locked*/
300 #define PC_LOCKEDIFDP 0x00000100 /* pages are locked if swap via DOS */
301 #define PC_WRITEABLE 0x00020000 /* make the pages writeable */
302 #define PC_USER 0x00040000 /* make the pages ring 3 accessible */
303 #define PC_INCR 0x40000000 /* increment "pagerdata" each page */
304 #define PC_PRESENT 0x80000000 /* make pages initially present */
305 #define PC_STATIC 0x20000000 /* allow commit in PR_STATIC object */
306 #define PC_DIRTY 0x08000000 /* make pages initially dirty */
307 #define PC_CACHEDIS 0x00100000 /* Allocate uncached pages - new for WDM */
308 #define PC_CACHEWT 0x00080000 /* Allocate write through cache pages - new for WDM */
309 #define PC_PAGEFLUSH 0x00008000 /* Touch device mapped pages on alloc - new for WDM */
311 /* PageCommitContig additional flags */
312 #define PCC_ZEROINIT 0x00000001 /* zero-initialize new pages */
313 #define PCC_NOLIN 0x10000000 /* don't map to any linear address */
317 HANDLE DEVICE_Open( LPCSTR filename, DWORD access,
318 LPSECURITY_ATTRIBUTES sa )
320 const struct VxDInfo *info;
322 for (info = VxDList; info->name; info++)
323 if (!strncasecmp( info->name, filename, strlen(info->name) ))
324 return FILE_CreateDevice( info->id | 0x10000, access, sa );
326 FIXME( "Unknown VxD %s\n", filename);
327 SetLastError( ERROR_FILE_NOT_FOUND );
328 return HFILE_ERROR;
331 static const struct VxDInfo *DEVICE_GetInfo( HANDLE handle )
333 struct get_file_info_request *req = get_req_buffer();
335 req->handle = handle;
336 if (!server_call( REQ_GET_FILE_INFO ) &&
337 (req->type == FILE_TYPE_UNKNOWN) &&
338 (req->attr & 0x10000))
340 const struct VxDInfo *info;
341 for (info = VxDList; info->name; info++)
342 if (info->id == LOWORD(req->attr)) return info;
344 return NULL;
347 /****************************************************************************
348 * DeviceIoControl (KERNEL32.188)
349 * This is one of those big ugly nasty procedure which can do
350 * a million and one things when it comes to devices. It can also be
351 * used for VxD communication.
353 * A return value of FALSE indicates that something has gone wrong which
354 * GetLastError can decypher.
356 BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
357 LPVOID lpvInBuffer, DWORD cbInBuffer,
358 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
359 LPDWORD lpcbBytesReturned,
360 LPOVERLAPPED lpOverlapped)
362 const struct VxDInfo *info;
364 TRACE( "(%d,%ld,%p,%ld,%p,%ld,%p,%p)\n",
365 hDevice,dwIoControlCode,lpvInBuffer,cbInBuffer,
366 lpvOutBuffer,cbOutBuffer,lpcbBytesReturned,lpOverlapped );
368 if (!(info = DEVICE_GetInfo( hDevice )))
370 SetLastError( ERROR_INVALID_PARAMETER );
371 return FALSE;
374 /* Check if this is a user defined control code for a VxD */
375 if( HIWORD( dwIoControlCode ) == 0 )
377 if ( info->deviceio )
379 return info->deviceio( dwIoControlCode,
380 lpvInBuffer, cbInBuffer,
381 lpvOutBuffer, cbOutBuffer,
382 lpcbBytesReturned, lpOverlapped );
384 else
386 /* FIXME: Set appropriate error */
387 FIXME( "Unimplemented control %ld for VxD device %s\n",
388 dwIoControlCode, info->name ? info->name : "???" );
391 else
393 switch( dwIoControlCode )
395 case FSCTL_DELETE_REPARSE_POINT:
396 case FSCTL_DISMOUNT_VOLUME:
397 case FSCTL_GET_COMPRESSION:
398 case FSCTL_GET_REPARSE_POINT:
399 case FSCTL_LOCK_VOLUME:
400 case FSCTL_QUERY_ALLOCATED_RANGES:
401 case FSCTL_SET_COMPRESSION:
402 case FSCTL_SET_REPARSE_POINT:
403 case FSCTL_SET_SPARSE:
404 case FSCTL_SET_ZERO_DATA:
405 case FSCTL_UNLOCK_VOLUME:
406 case IOCTL_DISK_CHECK_VERIFY:
407 case IOCTL_DISK_EJECT_MEDIA:
408 case IOCTL_DISK_FORMAT_TRACKS:
409 case IOCTL_DISK_GET_DRIVE_GEOMETRY:
410 case IOCTL_DISK_GET_DRIVE_LAYOUT:
411 case IOCTL_DISK_GET_MEDIA_TYPES:
412 case IOCTL_DISK_GET_PARTITION_INFO:
413 case IOCTL_DISK_LOAD_MEDIA:
414 case IOCTL_DISK_MEDIA_REMOVAL:
415 case IOCTL_DISK_PERFORMANCE:
416 case IOCTL_DISK_REASSIGN_BLOCKS:
417 case IOCTL_DISK_SET_DRIVE_LAYOUT:
418 case IOCTL_DISK_SET_PARTITION_INFO:
419 case IOCTL_DISK_VERIFY:
420 case IOCTL_SERIAL_LSRMST_INSERT:
421 case IOCTL_STORAGE_CHECK_VERIFY:
422 case IOCTL_STORAGE_EJECT_MEDIA:
423 case IOCTL_STORAGE_GET_MEDIA_TYPES:
424 case IOCTL_STORAGE_LOAD_MEDIA:
425 case IOCTL_STORAGE_MEDIA_REMOVAL:
426 FIXME( "unimplemented dwIoControlCode=%08lx\n", dwIoControlCode);
427 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
428 return FALSE;
429 break;
430 default:
431 FIXME( "ignored dwIoControlCode=%08lx\n",dwIoControlCode);
432 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
433 return FALSE;
434 break;
437 return FALSE;
440 /***********************************************************************
441 * DeviceIo_VTDAPI
443 static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
444 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
445 LPDWORD lpcbBytesReturned,
446 LPOVERLAPPED lpOverlapped)
448 BOOL retv = TRUE;
450 switch (dwIoControlCode)
452 case 5:
453 if (lpvOutBuffer && (cbOutBuffer>=4))
454 *(DWORD*)lpvOutBuffer = GetTickCount();
456 if (lpcbBytesReturned)
457 *lpcbBytesReturned = 4;
459 break;
461 default:
462 FIXME( "Control %ld not implemented\n", dwIoControlCode);
463 retv = FALSE;
464 break;
467 return retv;
474 /***********************************************************************
475 * VxDCall (KERNEL32.[1-9])
477 void VxDCall( DWORD service, CONTEXT86 *context )
479 DWORD ret = 0xffffffff; /* FIXME */
480 int i;
482 TRACE( "(%08lx, ...)\n", service);
484 for (i = 0; VxDList[i].name; i++)
485 if (VxDList[i].id == HIWORD(service))
486 break;
488 if (!VxDList[i].name)
489 FIXME( "Unknown VxD (%08lx)\n", service);
490 else if (!VxDList[i].vxdcall)
491 FIXME( "Unimplemented VxD (%08lx)\n", service);
492 else
493 ret = VxDList[i].vxdcall( service, context );
495 EAX_reg( context ) = ret;
499 /***********************************************************************
500 * VxDCall_VMM
502 static DWORD VxDCall_VMM( DWORD service, CONTEXT86 *context )
504 switch ( LOWORD(service) )
506 case 0x0011: /* RegOpenKey */
508 HKEY hkey = (HKEY) stack32_pop( context );
509 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
510 LPHKEY retkey = (LPHKEY)stack32_pop( context );
511 return RegOpenKeyA( hkey, lpszSubKey, retkey );
514 case 0x0012: /* RegCreateKey */
516 HKEY hkey = (HKEY) stack32_pop( context );
517 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
518 LPHKEY retkey = (LPHKEY)stack32_pop( context );
519 return RegCreateKeyA( hkey, lpszSubKey, retkey );
522 case 0x0013: /* RegCloseKey */
524 HKEY hkey = (HKEY)stack32_pop( context );
525 return RegCloseKey( hkey );
528 case 0x0014: /* RegDeleteKey */
530 HKEY hkey = (HKEY) stack32_pop( context );
531 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
532 return RegDeleteKeyA( hkey, lpszSubKey );
535 case 0x0015: /* RegSetValue */
537 HKEY hkey = (HKEY) stack32_pop( context );
538 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
539 DWORD dwType = (DWORD) stack32_pop( context );
540 LPCSTR lpszData = (LPCSTR)stack32_pop( context );
541 DWORD cbData = (DWORD) stack32_pop( context );
542 return RegSetValueA( hkey, lpszSubKey, dwType, lpszData, cbData );
545 case 0x0016: /* RegDeleteValue */
547 HKEY hkey = (HKEY) stack32_pop( context );
548 LPSTR lpszValue = (LPSTR)stack32_pop( context );
549 return RegDeleteValueA( hkey, lpszValue );
552 case 0x0017: /* RegQueryValue */
554 HKEY hkey = (HKEY) stack32_pop( context );
555 LPSTR lpszSubKey = (LPSTR) stack32_pop( context );
556 LPSTR lpszData = (LPSTR) stack32_pop( context );
557 LPDWORD lpcbData = (LPDWORD)stack32_pop( context );
558 return RegQueryValueA( hkey, lpszSubKey, lpszData, lpcbData );
561 case 0x0018: /* RegEnumKey */
563 HKEY hkey = (HKEY) stack32_pop( context );
564 DWORD iSubkey = (DWORD)stack32_pop( context );
565 LPSTR lpszName = (LPSTR)stack32_pop( context );
566 DWORD lpcchName = (DWORD)stack32_pop( context );
567 return RegEnumKeyA( hkey, iSubkey, lpszName, lpcchName );
570 case 0x0019: /* RegEnumValue */
572 HKEY hkey = (HKEY) stack32_pop( context );
573 DWORD iValue = (DWORD) stack32_pop( context );
574 LPSTR lpszValue = (LPSTR) stack32_pop( context );
575 LPDWORD lpcchValue = (LPDWORD)stack32_pop( context );
576 LPDWORD lpReserved = (LPDWORD)stack32_pop( context );
577 LPDWORD lpdwType = (LPDWORD)stack32_pop( context );
578 LPBYTE lpbData = (LPBYTE) stack32_pop( context );
579 LPDWORD lpcbData = (LPDWORD)stack32_pop( context );
580 return RegEnumValueA( hkey, iValue, lpszValue, lpcchValue,
581 lpReserved, lpdwType, lpbData, lpcbData );
584 case 0x001A: /* RegQueryValueEx */
586 HKEY hkey = (HKEY) stack32_pop( context );
587 LPSTR lpszValue = (LPSTR) stack32_pop( context );
588 LPDWORD lpReserved = (LPDWORD)stack32_pop( context );
589 LPDWORD lpdwType = (LPDWORD)stack32_pop( context );
590 LPBYTE lpbData = (LPBYTE) stack32_pop( context );
591 LPDWORD lpcbData = (LPDWORD)stack32_pop( context );
592 return RegQueryValueExA( hkey, lpszValue, lpReserved,
593 lpdwType, lpbData, lpcbData );
596 case 0x001B: /* RegSetValueEx */
598 HKEY hkey = (HKEY) stack32_pop( context );
599 LPSTR lpszValue = (LPSTR) stack32_pop( context );
600 DWORD dwReserved = (DWORD) stack32_pop( context );
601 DWORD dwType = (DWORD) stack32_pop( context );
602 LPBYTE lpbData = (LPBYTE)stack32_pop( context );
603 DWORD cbData = (DWORD) stack32_pop( context );
604 return RegSetValueExA( hkey, lpszValue, dwReserved,
605 dwType, lpbData, cbData );
608 case 0x001C: /* RegFlushKey */
610 HKEY hkey = (HKEY)stack32_pop( context );
611 return RegFlushKey( hkey );
614 case 0x001D: /* RegQueryInfoKey */
616 /* NOTE: This VxDCall takes only a subset of the parameters that the
617 corresponding Win32 API call does. The implementation in Win95
618 ADVAPI32 sets all output parameters not mentioned here to zero. */
620 HKEY hkey = (HKEY) stack32_pop( context );
621 LPDWORD lpcSubKeys = (LPDWORD)stack32_pop( context );
622 LPDWORD lpcchMaxSubKey = (LPDWORD)stack32_pop( context );
623 LPDWORD lpcValues = (LPDWORD)stack32_pop( context );
624 LPDWORD lpcchMaxValueName = (LPDWORD)stack32_pop( context );
625 LPDWORD lpcchMaxValueData = (LPDWORD)stack32_pop( context );
626 return RegQueryInfoKeyA( hkey, NULL, NULL, NULL, lpcSubKeys, lpcchMaxSubKey,
627 NULL, lpcValues, lpcchMaxValueName, lpcchMaxValueData,
628 NULL, NULL );
631 case 0x0021: /* RegLoadKey */
633 HKEY hkey = (HKEY) stack32_pop( context );
634 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
635 LPCSTR lpszFile = (LPCSTR)stack32_pop( context );
636 return RegLoadKeyA( hkey, lpszSubKey, lpszFile );
639 case 0x0022: /* RegUnLoadKey */
641 HKEY hkey = (HKEY) stack32_pop( context );
642 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
643 return RegUnLoadKeyA( hkey, lpszSubKey );
646 case 0x0023: /* RegSaveKey */
648 HKEY hkey = (HKEY) stack32_pop( context );
649 LPCSTR lpszFile = (LPCSTR)stack32_pop( context );
650 LPSECURITY_ATTRIBUTES sa = (LPSECURITY_ATTRIBUTES)stack32_pop( context );
651 return RegSaveKeyA( hkey, lpszFile, sa );
654 #if 0 /* Functions are not yet implemented in misc/registry.c */
655 case 0x0024: /* RegRemapPreDefKey */
656 case 0x0026: /* RegQueryMultipleValues */
657 #endif
659 case 0x0027: /* RegReplaceKey */
661 HKEY hkey = (HKEY) stack32_pop( context );
662 LPCSTR lpszSubKey = (LPCSTR)stack32_pop( context );
663 LPCSTR lpszNewFile= (LPCSTR)stack32_pop( context );
664 LPCSTR lpszOldFile= (LPCSTR)stack32_pop( context );
665 return RegReplaceKeyA( hkey, lpszSubKey, lpszNewFile, lpszOldFile );
667 case 0x0000: /* PageReserve */
669 LPVOID address;
670 LPVOID ret;
671 DWORD psize = VIRTUAL_GetPageSize();
672 ULONG page = (ULONG) stack32_pop( context );
673 ULONG npages = (ULONG) stack32_pop( context );
674 ULONG flags = (ULONG) stack32_pop( context );
676 FIXME("PageReserve: page: %08lx, npages: %08lx, flags: %08lx partial stub!\n",
677 page, npages, flags );
679 if ( page == PR_SYSTEM ) {
680 ERR("Can't reserve ring 1 memory\n");
681 return -1;
683 /* FIXME: This has to be handled seperatly, when we have seperate
684 address-spaces */
685 if ( page == PR_PRIVATE || page == PR_SHARED ) page = 0;
686 /* FIXME: Handle flags in some way */
687 address = (LPVOID )(page * psize);
688 ret = VirtualAlloc ( address, ( npages * psize ), MEM_RESERVE, 0 );
689 FIXME("PageReserve: returning: %08lx\n", (DWORD )ret );
690 if ( ret == NULL )
691 return -1;
692 else
693 return (DWORD )ret;
696 case 0x0001: /* PageCommit */
698 LPVOID address;
699 LPVOID ret;
700 DWORD virt_perm;
701 DWORD psize = VIRTUAL_GetPageSize();
702 ULONG page = (ULONG) stack32_pop( context );
703 ULONG npages = (ULONG) stack32_pop( context );
704 ULONG hpd = (ULONG) stack32_pop( context );
705 ULONG pagerdata = (ULONG) stack32_pop( context );
706 ULONG flags = (ULONG) stack32_pop( context );
708 FIXME("PageCommit: page: %08lx, npages: %08lx, hpd: %08lx pagerdata: "
709 "%08lx, flags: %08lx partial stub\n",
710 page, npages, hpd, pagerdata, flags );
712 if ( flags & PC_USER )
713 if ( flags & PC_WRITEABLE )
714 virt_perm = PAGE_EXECUTE_READWRITE;
715 else
716 virt_perm = PAGE_EXECUTE_READ;
717 else
718 virt_perm = PAGE_NOACCESS;
720 address = (LPVOID )(page * psize);
721 ret = VirtualAlloc ( address, ( npages * psize ), MEM_COMMIT, virt_perm );
722 FIXME("PageCommit: Returning: %08lx\n", (DWORD )ret );
723 return (DWORD )ret;
726 case 0x0002: /* PageDecommit */
728 LPVOID address;
729 BOOL ret;
730 DWORD psize = VIRTUAL_GetPageSize();
731 ULONG page = (ULONG) stack32_pop( context );
732 ULONG npages = (ULONG) stack32_pop( context );
733 ULONG flags = (ULONG) stack32_pop( context );
735 FIXME("PageDecommit: page: %08lx, npages: %08lx, flags: %08lx partial stub\n",
736 page, npages, flags );
737 address = (LPVOID )( page * psize );
738 ret = VirtualFree ( address, ( npages * psize ), MEM_DECOMMIT );
739 FIXME("PageDecommit: Returning: %s\n", ret ? "TRUE" : "FALSE" );
740 return ret;
742 case 0x000d: /* PageModifyPermissions */
744 DWORD pg_old_perm;
745 DWORD pg_new_perm;
746 DWORD virt_old_perm;
747 DWORD virt_new_perm;
748 MEMORY_BASIC_INFORMATION mbi;
749 LPVOID address;
750 DWORD psize = VIRTUAL_GetPageSize();
751 ULONG page = stack32_pop ( context );
752 ULONG npages = stack32_pop ( context );
753 ULONG permand = stack32_pop ( context );
754 ULONG permor = stack32_pop ( context );
756 FIXME("PageModifyPermissions %08lx %08lx %08lx %08lx partial stub\n",
757 page, npages, permand, permor );
758 address = (LPVOID )( page * psize );
760 VirtualQuery ( address, &mbi, sizeof ( MEMORY_BASIC_INFORMATION ));
761 virt_old_perm = mbi.Protect;
763 switch ( virt_old_perm & mbi.Protect ) {
764 case PAGE_READONLY:
765 case PAGE_EXECUTE:
766 case PAGE_EXECUTE_READ:
767 pg_old_perm = PC_USER;
768 break;
769 case PAGE_READWRITE:
770 case PAGE_WRITECOPY:
771 case PAGE_EXECUTE_READWRITE:
772 case PAGE_EXECUTE_WRITECOPY:
773 pg_old_perm = PC_USER | PC_WRITEABLE;
774 break;
775 case PAGE_NOACCESS:
776 default:
777 pg_old_perm = 0;
778 break;
780 pg_new_perm = pg_old_perm;
781 pg_new_perm &= permand & ~PC_STATIC;
782 pg_new_perm |= permor & ~PC_STATIC;
784 virt_new_perm = ( virt_old_perm ) & ~0xff;
785 if ( pg_new_perm & PC_USER )
787 if ( pg_new_perm & PC_WRITEABLE )
788 virt_new_perm |= PAGE_EXECUTE_READWRITE;
789 else
790 virt_new_perm |= PAGE_EXECUTE_READ;
793 if ( ! VirtualProtect ( address, ( npages * psize ), virt_new_perm, &virt_old_perm ) ) {
794 ERR("Can't change page permissions for %08lx\n", (DWORD )address );
795 return 0xffffffff;
797 FIXME("Returning: %08lx\n", pg_old_perm );
798 return pg_old_perm;
800 case 0x000a: /* PageFree */
802 BOOL ret;
803 LPVOID hmem = (LPVOID) stack32_pop( context );
804 DWORD flags = (DWORD ) stack32_pop( context );
806 FIXME("PageFree: hmem: %08lx, flags: %08lx partial stub\n",
807 (DWORD )hmem, flags );
809 ret = VirtualFree ( hmem, 0, MEM_RELEASE );
810 EAX_reg( context ) = ret;
811 FIXME("Returning: %d\n", ret );
813 return 0;
815 case 0x001e: /* GetDemandPageInfo */
817 DWORD dinfo = (DWORD)stack32_pop( context );
818 DWORD flags = (DWORD)stack32_pop( context );
820 /* GetDemandPageInfo is supposed to fill out the struct at
821 * "dinfo" with various low-level memory management information.
822 * Apps are certainly not supposed to call this, although it's
823 * demoed and documented by Pietrek on pages 441-443 of "Windows
824 * 95 System Programming Secrets" if any program needs a real
825 * implementation of this.
828 FIXME("GetDemandPageInfo(%08lx %08lx): stub!\n", dinfo, flags);
830 return 0;
832 default:
833 if (LOWORD(service) < N_VMM_SERVICE)
834 FIXME( "Unimplemented service %s (%08lx)\n",
835 VMM_Service_Name[LOWORD(service)], service);
836 else
837 FIXME( "Unknown service %08lx\n", service);
838 break;
841 return 0xffffffff; /* FIXME */
844 /***********************************************************************
845 * DeviceIo_IFSMgr
846 * NOTES
847 * The ioctls is used by 'MSNET32.DLL'.
849 * I have been unable to uncover any documentation about the ioctls so
850 * the implementation of the cases IFS_IOCTL_21 and IFS_IOCTL_2F are
851 * based on a resonable guesses on information found in the Windows 95 DDK.
856 * IFSMgr DeviceIO service
859 #define IFS_IOCTL_21 100
860 #define IFS_IOCTL_2F 101
861 #define IFS_IOCTL_GET_RES 102
862 #define IFS_IOCTL_GET_NETPRO_NAME_A 103
864 struct win32apireq {
865 unsigned long ar_proid;
866 unsigned long ar_eax;
867 unsigned long ar_ebx;
868 unsigned long ar_ecx;
869 unsigned long ar_edx;
870 unsigned long ar_esi;
871 unsigned long ar_edi;
872 unsigned long ar_ebp;
873 unsigned short ar_error;
874 unsigned short ar_pad;
877 static void win32apieq_2_CONTEXT(struct win32apireq *pIn,CONTEXT86 *pCxt)
879 memset(pCxt,0,sizeof(*pCxt));
881 pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL;
882 pCxt->Eax = pIn->ar_eax;
883 pCxt->Ebx = pIn->ar_ebx;
884 pCxt->Ecx = pIn->ar_ecx;
885 pCxt->Edx = pIn->ar_edx;
886 pCxt->Esi = pIn->ar_esi;
887 pCxt->Edi = pIn->ar_edi;
889 /* FIXME: Only partial CONTEXT86_CONTROL */
890 pCxt->Ebp = pIn->ar_ebp;
892 /* FIXME: pIn->ar_proid ignored */
893 /* FIXME: pIn->ar_error ignored */
894 /* FIXME: pIn->ar_pad ignored */
897 static void CONTEXT_2_win32apieq(CONTEXT86 *pCxt,struct win32apireq *pOut)
899 memset(pOut,0,sizeof(struct win32apireq));
901 pOut->ar_eax = pCxt->Eax;
902 pOut->ar_ebx = pCxt->Ebx;
903 pOut->ar_ecx = pCxt->Ecx;
904 pOut->ar_edx = pCxt->Edx;
905 pOut->ar_esi = pCxt->Esi;
906 pOut->ar_edi = pCxt->Edi;
908 /* FIXME: Only partial CONTEXT86_CONTROL */
909 pOut->ar_ebp = pCxt->Ebp;
911 /* FIXME: pOut->ar_proid ignored */
912 /* FIXME: pOut->ar_error ignored */
913 /* FIXME: pOut->ar_pad ignored */
916 static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
917 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
918 LPDWORD lpcbBytesReturned,
919 LPOVERLAPPED lpOverlapped)
921 BOOL retv = TRUE;
922 TRACE("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
923 dwIoControlCode,
924 lpvInBuffer,cbInBuffer,
925 lpvOutBuffer,cbOutBuffer,
926 lpcbBytesReturned,
927 lpOverlapped);
929 switch (dwIoControlCode)
931 case IFS_IOCTL_21:
932 case IFS_IOCTL_2F:{
933 CONTEXT86 cxt;
934 struct win32apireq *pIn=(struct win32apireq *) lpvInBuffer;
935 struct win32apireq *pOut=(struct win32apireq *) lpvOutBuffer;
937 TRACE(
938 "Control '%s': "
939 "proid=0x%08lx, eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
940 "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx, ebp=0x%08lx, "
941 "error=0x%04x, pad=0x%04x\n",
942 (dwIoControlCode==IFS_IOCTL_21)?"IFS_IOCTL_21":"IFS_IOCTL_2F",
943 pIn->ar_proid, pIn->ar_eax, pIn->ar_ebx, pIn->ar_ecx,
944 pIn->ar_edx, pIn->ar_esi, pIn->ar_edi, pIn->ar_ebp,
945 pIn->ar_error, pIn->ar_pad
948 win32apieq_2_CONTEXT(pIn,&cxt);
950 if(dwIoControlCode==IFS_IOCTL_21)
952 DOS3Call(&cxt); /* Call int 21h */
953 } else {
954 INT_Int2fHandler(&cxt); /* Call int 2Fh */
957 CONTEXT_2_win32apieq(&cxt,pOut);
959 retv = TRUE;
960 } break;
961 case IFS_IOCTL_GET_RES:{
962 FIXME( "Control 'IFS_IOCTL_GET_RES' not implemented\n");
963 retv = FALSE;
964 } break;
965 case IFS_IOCTL_GET_NETPRO_NAME_A:{
966 FIXME( "Control 'IFS_IOCTL_GET_NETPRO_NAME_A' not implemented\n");
967 retv = FALSE;
968 } break;
969 default:
970 FIXME( "Control %ld not implemented\n", dwIoControlCode);
971 retv = FALSE;
974 return retv;
977 /********************************************************************************
978 * VxDCall_VWin32
980 * Service numbers taken from page 448 of Pietrek's "Windows 95 System
981 * Progrmaming Secrets". Parameters from experimentation on real Win98.
985 static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
987 switch ( LOWORD(service) )
989 case 0x0000: /* GetVersion */
991 DWORD vers = GetVersion();
992 return (LOBYTE(vers) << 8) | HIBYTE(vers);
994 break;
996 case 0x0020: /* Get VMCPD Version */
998 DWORD parm = (DWORD) stack32_pop(context);
1000 FIXME("Get VMCPD Version(%08lx): partial stub!\n", parm);
1002 /* FIXME: This is what Win98 returns, it may
1003 * not be correct in all situations.
1004 * It makes Bleem! happy though.
1007 return 0x0405;
1010 case 0x0029: /* Int31/DPMI dispatch */
1012 DWORD callnum = (DWORD) stack32_pop(context);
1013 DWORD parm = (DWORD) stack32_pop(context);
1015 TRACE("Int31/DPMI dispatch(%08lx)\n", callnum);
1017 AX_reg(context) = callnum;
1018 CX_reg(context) = parm;
1019 INT_Int31Handler(context);
1021 return(AX_reg(context));
1023 break;
1025 case 0x002a: /* Int41 dispatch - parm = int41 service number */
1027 DWORD callnum = (DWORD) stack32_pop(context);
1029 return callnum; /* FIXME: should really call INT_Int41Handler() */
1031 break;
1033 default:
1034 FIXME("Unknown VWin32 service %08lx\n", service);
1035 break;
1038 return 0xffffffff;
1043 /***********************************************************************
1044 * DeviceIo_VWin32
1047 static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT86 *pCxt )
1049 memset( pCxt, 0, sizeof(*pCxt) );
1050 /* Note: segment registers == 0 means that CTX_SEG_OFF_TO_LIN
1051 will interpret 32-bit register contents as linear pointers */
1053 pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL;
1054 pCxt->Eax = pIn->reg_EAX;
1055 pCxt->Ebx = pIn->reg_EBX;
1056 pCxt->Ecx = pIn->reg_ECX;
1057 pCxt->Edx = pIn->reg_EDX;
1058 pCxt->Esi = pIn->reg_ESI;
1059 pCxt->Edi = pIn->reg_EDI;
1061 /* FIXME: Only partial CONTEXT86_CONTROL */
1062 pCxt->EFlags = pIn->reg_Flags;
1065 static void CONTEXT_2_DIOCRegs( CONTEXT86 *pCxt, DIOC_REGISTERS *pOut )
1067 memset( pOut, 0, sizeof(DIOC_REGISTERS) );
1069 pOut->reg_EAX = pCxt->Eax;
1070 pOut->reg_EBX = pCxt->Ebx;
1071 pOut->reg_ECX = pCxt->Ecx;
1072 pOut->reg_EDX = pCxt->Edx;
1073 pOut->reg_ESI = pCxt->Esi;
1074 pOut->reg_EDI = pCxt->Edi;
1076 /* FIXME: Only partial CONTEXT86_CONTROL */
1077 pOut->reg_Flags = pCxt->EFlags;
1081 static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
1082 LPVOID lpvInBuffer, DWORD cbInBuffer,
1083 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
1084 LPDWORD lpcbBytesReturned,
1085 LPOVERLAPPED lpOverlapped)
1087 BOOL retv = TRUE;
1089 switch (dwIoControlCode)
1091 case VWIN32_DIOC_DOS_IOCTL:
1092 case VWIN32_DIOC_DOS_INT13:
1093 case VWIN32_DIOC_DOS_INT25:
1094 case VWIN32_DIOC_DOS_INT26:
1095 case VWIN32_DIOC_DOS_DRIVEINFO:
1097 CONTEXT86 cxt;
1098 DIOC_REGISTERS *pIn = (DIOC_REGISTERS *)lpvInBuffer;
1099 DIOC_REGISTERS *pOut = (DIOC_REGISTERS *)lpvOutBuffer;
1101 TRACE( "Control '%s': "
1102 "eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
1103 "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx ",
1104 (dwIoControlCode == VWIN32_DIOC_DOS_IOCTL)? "VWIN32_DIOC_DOS_IOCTL" :
1105 (dwIoControlCode == VWIN32_DIOC_DOS_INT13)? "VWIN32_DIOC_DOS_INT13" :
1106 (dwIoControlCode == VWIN32_DIOC_DOS_INT25)? "VWIN32_DIOC_DOS_INT25" :
1107 (dwIoControlCode == VWIN32_DIOC_DOS_INT26)? "VWIN32_DIOC_DOS_INT26" :
1108 (dwIoControlCode == VWIN32_DIOC_DOS_DRIVEINFO)? "VWIN32_DIOC_DOS_DRIVEINFO" : "???",
1109 pIn->reg_EAX, pIn->reg_EBX, pIn->reg_ECX,
1110 pIn->reg_EDX, pIn->reg_ESI, pIn->reg_EDI );
1112 DIOCRegs_2_CONTEXT( pIn, &cxt );
1114 switch (dwIoControlCode)
1116 case VWIN32_DIOC_DOS_IOCTL: DOS3Call( &cxt ); break; /* Call int 21h */
1117 case VWIN32_DIOC_DOS_INT13: INT_Int13Handler( &cxt ); break;
1118 case VWIN32_DIOC_DOS_INT25: INT_Int25Handler( &cxt ); break;
1119 case VWIN32_DIOC_DOS_INT26: INT_Int26Handler( &cxt ); break;
1120 case VWIN32_DIOC_DOS_DRIVEINFO: DOS3Call( &cxt ); break; /* Call int 21h 730x */
1123 CONTEXT_2_DIOCRegs( &cxt, pOut );
1125 break;
1127 case VWIN32_DIOC_SIMCTRLC:
1128 FIXME( "Control VWIN32_DIOC_SIMCTRLC not implemented\n");
1129 retv = FALSE;
1130 break;
1132 default:
1133 FIXME( "Unknown Control %ld\n", dwIoControlCode);
1134 retv = FALSE;
1135 break;
1138 return retv;
1141 /* this is the main multimedia device loader */
1142 static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode,
1143 LPVOID lpvInBuffer, DWORD cbInBuffer,
1144 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
1145 LPDWORD lpcbBytesReturned,
1146 LPOVERLAPPED lpOverlapped)
1148 FIXME("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
1149 dwIoControlCode,
1150 lpvInBuffer,cbInBuffer,
1151 lpvOutBuffer,cbOutBuffer,
1152 lpcbBytesReturned,
1153 lpOverlapped
1155 switch (dwIoControlCode) {
1156 case 5:
1157 /* Hmm. */
1158 *(DWORD*)lpvOutBuffer=0;
1159 *lpcbBytesReturned=4;
1160 return TRUE;
1162 return FALSE;
1164 /* this is used by some Origin games */
1165 static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode,
1166 LPVOID lpvInBuffer, DWORD cbInBuffer,
1167 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
1168 LPDWORD lpcbBytesReturned,
1169 LPOVERLAPPED lpOverlapped)
1171 switch (dwIoControlCode) {
1172 case 1: /* version */
1173 *(LPDWORD)lpvOutBuffer = 0x20004; /* WC SecretOps */
1174 break;
1175 case 9: /* debug output */
1176 ERR("MONODEBG: %s\n",debugstr_a(lpvInBuffer));
1177 break;
1178 default:
1179 FIXME("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
1180 dwIoControlCode,
1181 lpvInBuffer,cbInBuffer,
1182 lpvOutBuffer,cbOutBuffer,
1183 lpcbBytesReturned,
1184 lpOverlapped
1186 break;
1188 return TRUE;
1190 /* pccard */
1191 static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode,
1192 LPVOID lpvInBuffer, DWORD cbInBuffer,
1193 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
1194 LPDWORD lpcbBytesReturned,
1195 LPOVERLAPPED lpOverlapped)
1197 switch (dwIoControlCode) {
1198 case 0x0000: /* PCCARD_Get_Version */
1199 case 0x0001: /* PCCARD_Card_Services */
1200 default:
1201 FIXME( "(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
1202 dwIoControlCode,
1203 lpvInBuffer,cbInBuffer,
1204 lpvOutBuffer,cbOutBuffer,
1205 lpcbBytesReturned,
1206 lpOverlapped
1208 break;
1210 return FALSE;
1213 /***********************************************************************
1214 * OpenVxDHandle
1216 DWORD WINAPI OpenVxDHandle(DWORD pmt)
1218 FIXME( "(0x%08lx) stub!\n", pmt);
1219 return 0;