2 * Win32 device functions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Ulrich Weigand
6 * Copyright 1998 Patrik Stridvall
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "wine/port.h"
30 #include <sys/types.h>
44 #include "kernel_private.h"
45 #include "wine/server.h"
46 #include "wine/debug.h"
48 WINE_DEFAULT_DEBUG_CHANNEL(file);
51 static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode,
52 LPVOID lpvInBuffer, DWORD cbInBuffer,
53 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
54 LPDWORD lpcbBytesReturned,
55 LPOVERLAPPED lpOverlapped);
56 static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode,
57 LPVOID lpvInBuffer, DWORD cbInBuffer,
58 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
59 LPDWORD lpcbBytesReturned,
60 LPOVERLAPPED lpOverlapped);
61 static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode,
62 LPVOID lpvInBuffer, DWORD cbInBuffer,
63 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
64 LPDWORD lpcbBytesReturned,
65 LPOVERLAPPED lpOverlapped);
67 static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode,
68 LPVOID lpvInBuffer, DWORD cbInBuffer,
69 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
70 LPDWORD lpcbBytesReturned,
71 LPOVERLAPPED lpOverlapped);
73 static BOOL DeviceIo_VCD(DWORD dwIoControlCode,
74 LPVOID lpvInBuffer, DWORD cbInBuffer,
75 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
76 LPDWORD lpcbBytesReturned,
77 LPOVERLAPPED lpOverlapped);
79 static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
80 LPVOID lpvInBuffer, DWORD cbInBuffer,
81 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
82 LPDWORD lpcbBytesReturned,
83 LPOVERLAPPED lpOverlapped);
85 static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode,
86 LPVOID lpvInBuffer, DWORD cbInBuffer,
87 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
88 LPDWORD lpcbBytesReturned,
89 LPOVERLAPPED lpOverlapped);
91 static BOOL DeviceIo_HASP (DWORD dwIoControlCode,
92 LPVOID lpvInBuffer, DWORD cbInBuffer,
93 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
94 LPDWORD lpcbBytesReturned,
95 LPOVERLAPPED lpOverlapped);
97 * VxD names are taken from the Win95 DDK
104 BOOL (*deviceio)(DWORD, LPVOID, DWORD,
105 LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
108 static const struct VxDInfo VxDList[] =
110 /* Standard VxD IDs */
111 { "VMM", 0x0001, NULL },
112 { "DEBUG", 0x0002, NULL },
113 { "VPICD", 0x0003, NULL },
114 { "VDMAD", 0x0004, NULL },
115 { "VTD", 0x0005, NULL },
116 { "V86MMGR", 0x0006, NULL },
117 { "PAGESWAP", 0x0007, NULL },
118 { "PARITY", 0x0008, NULL },
119 { "REBOOT", 0x0009, NULL },
120 { "VDD", 0x000A, NULL },
121 { "VSD", 0x000B, NULL },
122 { "VMD", 0x000C, NULL },
123 { "VKD", 0x000D, NULL },
124 { "VCD", 0x000E, DeviceIo_VCD },
125 { "VPD", 0x000F, NULL },
126 { "BLOCKDEV", 0x0010, NULL },
127 { "VMCPD", 0x0011, NULL },
128 { "EBIOS", 0x0012, NULL },
129 { "BIOSXLAT", 0x0013, NULL },
130 { "VNETBIOS", 0x0014, NULL },
131 { "DOSMGR", 0x0015, NULL },
132 { "WINLOAD", 0x0016, NULL },
133 { "SHELL", 0x0017, NULL },
134 { "VMPOLL", 0x0018, NULL },
135 { "VPROD", 0x0019, NULL },
136 { "DOSNET", 0x001A, NULL },
137 { "VFD", 0x001B, NULL },
138 { "VDD2", 0x001C, NULL },
139 { "WINDEBUG", 0x001D, NULL },
140 { "TSRLOAD", 0x001E, NULL },
141 { "BIOSHOOK", 0x001F, NULL },
142 { "INT13", 0x0020, NULL },
143 { "PAGEFILE", 0x0021, NULL },
144 { "SCSI", 0x0022, NULL },
145 { "MCA_POS", 0x0023, NULL },
146 { "SCSIFD", 0x0024, NULL },
147 { "VPEND", 0x0025, NULL },
148 { "VPOWERD", 0x0026, NULL },
149 { "VXDLDR", 0x0027, NULL },
150 { "NDIS", 0x0028, NULL },
151 { "BIOS_EXT", 0x0029, NULL },
152 { "VWIN32", 0x002A, DeviceIo_VWin32 },
153 { "VCOMM", 0x002B, NULL },
154 { "SPOOLER", 0x002C, NULL },
155 { "WIN32S", 0x002D, NULL },
156 { "DEBUGCMD", 0x002E, NULL },
158 { "VNB", 0x0031, NULL },
159 { "SERVER", 0x0032, NULL },
160 { "CONFIGMG", 0x0033, NULL },
161 { "DWCFGMG", 0x0034, NULL },
162 { "SCSIPORT", 0x0035, NULL },
163 { "VFBACKUP", 0x0036, NULL },
164 { "ENABLE", 0x0037, NULL },
165 { "VCOND", 0x0038, NULL },
167 { "EFAX", 0x003A, NULL },
168 { "DSVXD", 0x003B, NULL },
169 { "ISAPNP", 0x003C, NULL },
170 { "BIOS", 0x003D, NULL },
171 { "WINSOCK", 0x003E, NULL },
172 { "WSOCK", 0x003E, NULL },
173 { "WSIPX", 0x003F, NULL },
174 { "IFSMgr", 0x0040, DeviceIo_IFSMgr },
175 { "VCDFSD", 0x0041, NULL },
176 { "MRCI2", 0x0042, NULL },
177 { "PCI", 0x0043, NULL },
178 { "PELOADER", 0x0044, NULL },
179 { "EISA", 0x0045, NULL },
180 { "DRAGCLI", 0x0046, NULL },
181 { "DRAGSRV", 0x0047, NULL },
182 { "PERF", 0x0048, NULL },
183 { "AWREDIR", 0x0049, NULL },
185 /* Far East support */
186 { "ETEN", 0x0060, NULL },
187 { "CHBIOS", 0x0061, NULL },
188 { "VMSGD", 0x0062, NULL },
189 { "VPPID", 0x0063, NULL },
190 { "VIME", 0x0064, NULL },
191 { "VHBIOSD", 0x0065, NULL },
193 /* Multimedia OEM IDs */
194 { "VTDAPI", 0x0442, DeviceIo_VTDAPI },
195 { "MMDEVLDR", 0x044A, DeviceIo_MMDEVLDR },
197 /* Network Device IDs */
198 { "VNetSup", 0x0480, NULL },
199 { "VRedir", 0x0481, NULL },
200 { "VBrowse", 0x0482, NULL },
201 { "VSHARE", 0x0483, NULL },
202 { "IFSMgr", 0x0484, NULL },
203 { "MEMPROBE", 0x0485, NULL },
204 { "VFAT", 0x0486, NULL },
205 { "NWLINK", 0x0487, NULL },
206 { "VNWLINK", 0x0487, NULL },
207 { "NWSUP", 0x0487, NULL },
208 { "VTDI", 0x0488, NULL },
209 { "VIP", 0x0489, NULL },
210 { "VTCP", 0x048A, NULL },
211 { "VCache", 0x048B, NULL },
212 { "VUDP", 0x048C, NULL },
213 { "VAsync", 0x048D, NULL },
214 { "NWREDIR", 0x048E, NULL },
215 { "STAT80", 0x048F, NULL },
216 { "SCSIPORT", 0x0490, NULL },
217 { "FILESEC", 0x0491, NULL },
218 { "NWSERVER", 0x0492, NULL },
219 { "SECPROV", 0x0493, NULL },
220 { "NSCL", 0x0494, NULL },
221 { "WSTCP", 0x0495, NULL },
222 { "NDIS2SUP", 0x0496, NULL },
223 { "MSODISUP", 0x0497, NULL },
224 { "Splitter", 0x0498, NULL },
225 { "PPP", 0x0499, NULL },
226 { "VDHCP", 0x049A, NULL },
227 { "VNBT", 0x049B, NULL },
228 { "LOGGER", 0x049D, NULL },
229 { "EFILTER", 0x049E, NULL },
230 { "FFILTER", 0x049F, NULL },
231 { "TFILTER", 0x04A0, NULL },
232 { "AFILTER", 0x04A1, NULL },
233 { "IRLAMP", 0x04A2, NULL },
235 { "PCCARD", 0x097C, DeviceIo_PCCARD },
236 { "HASP95", 0x3721, DeviceIo_HASP },
238 /* WINE additions, ids unknown */
239 { "MONODEBG.VXD", 0x4242, DeviceIo_MONODEBG },
244 HANDLE DEVICE_Open( LPCWSTR filenameW, DWORD access, LPSECURITY_ATTRIBUTES sa )
246 const struct VxDInfo *info;
247 char filename[MAX_PATH];
249 if (!WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, MAX_PATH, NULL, NULL))
251 SetLastError( ERROR_FILE_NOT_FOUND );
255 for (info = VxDList; info->name; info++)
256 if (!strncasecmp( info->name, filename, strlen(info->name) ))
257 return FILE_CreateDevice( info->id | 0x10000, access, sa );
259 FIXME( "Unknown/unsupported VxD %s. Try setting Windows version to 'nt40' or 'win31'.\n",
261 SetLastError( ERROR_FILE_NOT_FOUND );
265 static DWORD DEVICE_GetClientID( HANDLE handle )
268 SERVER_START_REQ( get_device_id )
270 req->handle = handle;
271 if (!wine_server_call( req )) ret = reply->id;
277 static const struct VxDInfo *DEVICE_GetInfo( DWORD clientID )
279 const struct VxDInfo *info = NULL;
281 if (clientID & 0x10000)
283 for (info = VxDList; info->name; info++)
284 if (info->id == LOWORD(clientID)) break;
289 /****************************************************************************
290 * DeviceIoControl (KERNEL32.@)
291 * This is one of those big ugly nasty procedure which can do
292 * a million and one things when it comes to devices. It can also be
293 * used for VxD communication.
295 * A return value of FALSE indicates that something has gone wrong which
296 * GetLastError can decipher.
298 BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
299 LPVOID lpvInBuffer, DWORD cbInBuffer,
300 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
301 LPDWORD lpcbBytesReturned,
302 LPOVERLAPPED lpOverlapped)
306 TRACE( "(%p,%ld,%p,%ld,%p,%ld,%p,%p)\n",
307 hDevice,dwIoControlCode,lpvInBuffer,cbInBuffer,
308 lpvOutBuffer,cbOutBuffer,lpcbBytesReturned,lpOverlapped );
310 if (!(clientID = DEVICE_GetClientID( hDevice )))
312 SetLastError( ERROR_INVALID_PARAMETER );
316 /* Check if this is a user defined control code for a VxD */
317 if( HIWORD( dwIoControlCode ) == 0 )
319 const struct VxDInfo *info;
320 if (!(info = DEVICE_GetInfo( clientID )))
322 FIXME( "No device found for id %lx\n", clientID);
324 else if ( info->deviceio )
326 return info->deviceio( dwIoControlCode,
327 lpvInBuffer, cbInBuffer,
328 lpvOutBuffer, cbOutBuffer,
329 lpcbBytesReturned, lpOverlapped );
333 FIXME( "Unimplemented control %ld for VxD device %s\n",
334 dwIoControlCode, info->name ? info->name : "???" );
335 /* FIXME: this is for invalid calls on W98SE,
336 * but maybe we should use ERROR_CALL_NOT_IMPLEMENTED
338 SetLastError( ERROR_INVALID_FUNCTION );
347 status = NtDeviceIoControlFile(hDevice, lpOverlapped->hEvent,
349 (PIO_STATUS_BLOCK)lpOverlapped,
351 lpvInBuffer, cbInBuffer,
352 lpvOutBuffer, cbOutBuffer);
353 if (status) SetLastError(RtlNtStatusToDosError(status));
354 if (lpcbBytesReturned) *lpcbBytesReturned = lpOverlapped->InternalHigh;
359 IO_STATUS_BLOCK iosb;
361 status = NtDeviceIoControlFile(hDevice, NULL, NULL, NULL, &iosb,
363 lpvInBuffer, cbInBuffer,
364 lpvOutBuffer, cbOutBuffer);
365 if (status) SetLastError(RtlNtStatusToDosError(status));
366 if (lpcbBytesReturned) *lpcbBytesReturned = iosb.Information;
373 /***********************************************************************
376 static BOOL DeviceIo_VTDAPI(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
377 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
378 LPDWORD lpcbBytesReturned,
379 LPOVERLAPPED lpOverlapped)
383 switch (dwIoControlCode)
386 if (lpvOutBuffer && (cbOutBuffer>=4))
387 *(DWORD*)lpvOutBuffer = GetTickCount();
389 if (lpcbBytesReturned)
390 *lpcbBytesReturned = 4;
395 FIXME( "Control %ld not implemented\n", dwIoControlCode);
403 /***********************************************************************
406 * These ioctls are used by 'MSNET32.DLL'.
408 * I have been unable to uncover any documentation about the ioctls so
409 * the implementation of the cases IFS_IOCTL_21 and IFS_IOCTL_2F are
410 * based on reasonable guesses on information found in the Windows 95 DDK.
415 * IFSMgr DeviceIO service
418 #define IFS_IOCTL_21 100
419 #define IFS_IOCTL_2F 101
420 #define IFS_IOCTL_GET_RES 102
421 #define IFS_IOCTL_GET_NETPRO_NAME_A 103
424 unsigned long ar_proid;
425 unsigned long ar_eax;
426 unsigned long ar_ebx;
427 unsigned long ar_ecx;
428 unsigned long ar_edx;
429 unsigned long ar_esi;
430 unsigned long ar_edi;
431 unsigned long ar_ebp;
432 unsigned short ar_error;
433 unsigned short ar_pad;
436 static void win32apieq_2_CONTEXT(struct win32apireq *pIn,CONTEXT86 *pCxt)
438 memset(pCxt,0,sizeof(*pCxt));
440 pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL;
441 pCxt->Eax = pIn->ar_eax;
442 pCxt->Ebx = pIn->ar_ebx;
443 pCxt->Ecx = pIn->ar_ecx;
444 pCxt->Edx = pIn->ar_edx;
445 pCxt->Esi = pIn->ar_esi;
446 pCxt->Edi = pIn->ar_edi;
448 /* FIXME: Only partial CONTEXT86_CONTROL */
449 pCxt->Ebp = pIn->ar_ebp;
451 /* FIXME: pIn->ar_proid ignored */
452 /* FIXME: pIn->ar_error ignored */
453 /* FIXME: pIn->ar_pad ignored */
456 static void CONTEXT_2_win32apieq(CONTEXT86 *pCxt,struct win32apireq *pOut)
458 memset(pOut,0,sizeof(struct win32apireq));
460 pOut->ar_eax = pCxt->Eax;
461 pOut->ar_ebx = pCxt->Ebx;
462 pOut->ar_ecx = pCxt->Ecx;
463 pOut->ar_edx = pCxt->Edx;
464 pOut->ar_esi = pCxt->Esi;
465 pOut->ar_edi = pCxt->Edi;
467 /* FIXME: Only partial CONTEXT86_CONTROL */
468 pOut->ar_ebp = pCxt->Ebp;
470 /* FIXME: pOut->ar_proid ignored */
471 /* FIXME: pOut->ar_error ignored */
472 /* FIXME: pOut->ar_pad ignored */
475 static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
476 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
477 LPDWORD lpcbBytesReturned,
478 LPOVERLAPPED lpOverlapped)
481 TRACE("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
483 lpvInBuffer,cbInBuffer,
484 lpvOutBuffer,cbOutBuffer,
488 switch (dwIoControlCode)
493 struct win32apireq *pIn=(struct win32apireq *) lpvInBuffer;
494 struct win32apireq *pOut=(struct win32apireq *) lpvOutBuffer;
498 "proid=0x%08lx, eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
499 "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx, ebp=0x%08lx, "
500 "error=0x%04x, pad=0x%04x\n",
501 (dwIoControlCode==IFS_IOCTL_21)?"IFS_IOCTL_21":"IFS_IOCTL_2F",
502 pIn->ar_proid, pIn->ar_eax, pIn->ar_ebx, pIn->ar_ecx,
503 pIn->ar_edx, pIn->ar_esi, pIn->ar_edi, pIn->ar_ebp,
504 pIn->ar_error, pIn->ar_pad
507 win32apieq_2_CONTEXT(pIn,&cxt);
509 if(dwIoControlCode==IFS_IOCTL_21)
510 INSTR_CallBuiltinHandler( &cxt, 0x21 );
512 INSTR_CallBuiltinHandler( &cxt, 0x2f );
514 CONTEXT_2_win32apieq(&cxt,pOut);
518 case IFS_IOCTL_GET_RES:{
519 FIXME( "Control 'IFS_IOCTL_GET_RES' not implemented\n");
522 case IFS_IOCTL_GET_NETPRO_NAME_A:{
523 FIXME( "Control 'IFS_IOCTL_GET_NETPRO_NAME_A' not implemented\n");
527 FIXME( "Control %ld not implemented\n", dwIoControlCode);
534 /***********************************************************************
537 static BOOL DeviceIo_VCD(DWORD dwIoControlCode,
538 LPVOID lpvInBuffer, DWORD cbInBuffer,
539 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
540 LPDWORD lpcbBytesReturned,
541 LPOVERLAPPED lpOverlapped)
545 switch (dwIoControlCode)
547 case IOCTL_SERIAL_LSRMST_INSERT:
549 FIXME( "IOCTL_SERIAL_LSRMST_INSERT NIY !\n");
555 FIXME( "Unknown Control %ld\n", dwIoControlCode);
564 /***********************************************************************
568 static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT86 *pCxt )
570 memset( pCxt, 0, sizeof(*pCxt) );
571 /* Note: segment registers == 0 means that CTX_SEG_OFF_TO_LIN
572 will interpret 32-bit register contents as linear pointers */
574 pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL;
575 pCxt->Eax = pIn->reg_EAX;
576 pCxt->Ebx = pIn->reg_EBX;
577 pCxt->Ecx = pIn->reg_ECX;
578 pCxt->Edx = pIn->reg_EDX;
579 pCxt->Esi = pIn->reg_ESI;
580 pCxt->Edi = pIn->reg_EDI;
582 /* FIXME: Only partial CONTEXT86_CONTROL */
583 pCxt->EFlags = pIn->reg_Flags;
586 static void CONTEXT_2_DIOCRegs( CONTEXT86 *pCxt, DIOC_REGISTERS *pOut )
588 memset( pOut, 0, sizeof(DIOC_REGISTERS) );
590 pOut->reg_EAX = pCxt->Eax;
591 pOut->reg_EBX = pCxt->Ebx;
592 pOut->reg_ECX = pCxt->Ecx;
593 pOut->reg_EDX = pCxt->Edx;
594 pOut->reg_ESI = pCxt->Esi;
595 pOut->reg_EDI = pCxt->Edi;
597 /* FIXME: Only partial CONTEXT86_CONTROL */
598 pOut->reg_Flags = pCxt->EFlags;
601 #define DIOC_AH(regs) (((unsigned char*)&((regs)->reg_EAX))[1])
602 #define DIOC_AL(regs) (((unsigned char*)&((regs)->reg_EAX))[0])
603 #define DIOC_BH(regs) (((unsigned char*)&((regs)->reg_EBX))[1])
604 #define DIOC_BL(regs) (((unsigned char*)&((regs)->reg_EBX))[0])
605 #define DIOC_DH(regs) (((unsigned char*)&((regs)->reg_EDX))[1])
606 #define DIOC_DL(regs) (((unsigned char*)&((regs)->reg_EDX))[0])
608 #define DIOC_AX(regs) (((unsigned short*)&((regs)->reg_EAX))[0])
609 #define DIOC_BX(regs) (((unsigned short*)&((regs)->reg_EBX))[0])
610 #define DIOC_CX(regs) (((unsigned short*)&((regs)->reg_ECX))[0])
611 #define DIOC_DX(regs) (((unsigned short*)&((regs)->reg_EDX))[0])
613 #define DIOC_SET_CARRY(regs) (((regs)->reg_Flags)|=0x00000001)
615 static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
616 LPVOID lpvInBuffer, DWORD cbInBuffer,
617 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
618 LPDWORD lpcbBytesReturned,
619 LPOVERLAPPED lpOverlapped)
623 switch (dwIoControlCode)
625 case VWIN32_DIOC_DOS_IOCTL:
626 case 0x10: /* Int 0x21 call, call it VWIN_DIOC_INT21 ? */
627 case VWIN32_DIOC_DOS_INT13:
628 case VWIN32_DIOC_DOS_INT25:
629 case VWIN32_DIOC_DOS_INT26:
630 case 0x29: /* Int 0x31 call, call it VWIN_DIOC_INT31 ? */
631 case VWIN32_DIOC_DOS_DRIVEINFO:
634 DIOC_REGISTERS *pIn = (DIOC_REGISTERS *)lpvInBuffer;
635 DIOC_REGISTERS *pOut = (DIOC_REGISTERS *)lpvOutBuffer;
638 TRACE( "Control '%s': "
639 "eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
640 "edx=0x%08lx, esi=0x%08lx, edi=0x%08lx \n",
641 (dwIoControlCode == VWIN32_DIOC_DOS_IOCTL)? "VWIN32_DIOC_DOS_IOCTL" :
642 (dwIoControlCode == VWIN32_DIOC_DOS_INT25)? "VWIN32_DIOC_DOS_INT25" :
643 (dwIoControlCode == VWIN32_DIOC_DOS_INT26)? "VWIN32_DIOC_DOS_INT26" :
644 (dwIoControlCode == VWIN32_DIOC_DOS_DRIVEINFO)? "VWIN32_DIOC_DOS_DRIVEINFO" : "???",
645 pIn->reg_EAX, pIn->reg_EBX, pIn->reg_ECX,
646 pIn->reg_EDX, pIn->reg_ESI, pIn->reg_EDI );
648 DIOCRegs_2_CONTEXT( pIn, &cxt );
650 switch (dwIoControlCode)
652 case VWIN32_DIOC_DOS_IOCTL: /* Call int 21h */
653 case 0x10: /* Int 0x21 call, call it VWIN_DIOC_INT21 ? */
654 case VWIN32_DIOC_DOS_DRIVEINFO: /* Call int 21h 730x */
657 case VWIN32_DIOC_DOS_INT13:
660 case VWIN32_DIOC_DOS_INT25:
663 case VWIN32_DIOC_DOS_INT26:
666 case 0x29: /* Int 0x31 call, call it VWIN_DIOC_INT31 ? */
671 INSTR_CallBuiltinHandler( &cxt, intnum );
672 CONTEXT_2_DIOCRegs( &cxt, pOut );
676 case VWIN32_DIOC_SIMCTRLC:
677 FIXME( "Control VWIN32_DIOC_SIMCTRLC not implemented\n");
682 FIXME( "Unknown Control %ld\n", dwIoControlCode);
690 /* this is the main multimedia device loader */
691 static BOOL DeviceIo_MMDEVLDR(DWORD dwIoControlCode,
692 LPVOID lpvInBuffer, DWORD cbInBuffer,
693 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
694 LPDWORD lpcbBytesReturned,
695 LPOVERLAPPED lpOverlapped)
697 FIXME("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
699 lpvInBuffer,cbInBuffer,
700 lpvOutBuffer,cbOutBuffer,
704 switch (dwIoControlCode) {
707 *(DWORD*)lpvOutBuffer=0;
708 *lpcbBytesReturned=4;
713 /* this is used by some Origin games */
714 static BOOL DeviceIo_MONODEBG(DWORD dwIoControlCode,
715 LPVOID lpvInBuffer, DWORD cbInBuffer,
716 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
717 LPDWORD lpcbBytesReturned,
718 LPOVERLAPPED lpOverlapped)
720 switch (dwIoControlCode) {
721 case 1: /* version */
722 *(LPDWORD)lpvOutBuffer = 0x20004; /* WC SecretOps */
724 case 9: /* debug output */
725 ERR("MONODEBG: %s\n",debugstr_a(lpvInBuffer));
728 FIXME("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
730 lpvInBuffer,cbInBuffer,
731 lpvOutBuffer,cbOutBuffer,
740 static BOOL DeviceIo_PCCARD (DWORD dwIoControlCode,
741 LPVOID lpvInBuffer, DWORD cbInBuffer,
742 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
743 LPDWORD lpcbBytesReturned,
744 LPOVERLAPPED lpOverlapped)
746 switch (dwIoControlCode) {
747 case 0x0000: /* PCCARD_Get_Version */
748 case 0x0001: /* PCCARD_Card_Services */
750 FIXME( "(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
752 lpvInBuffer,cbInBuffer,
753 lpvOutBuffer,cbOutBuffer,
762 static BOOL DeviceIo_HASP(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer,
763 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
764 LPDWORD lpcbBytesReturned,
765 LPOVERLAPPED lpOverlapped)
768 FIXME("(%ld,%p,%ld,%p,%ld,%p,%p): stub\n",
770 lpvInBuffer,cbInBuffer,
771 lpvOutBuffer,cbOutBuffer,