device.c patch

Andreas Mohr a.mohr at mailto.de
Thu May 24 11:05:02 CDT 2001


Hi all,

- add handler for VCD VxD ("virtual comm device" ?)
- SetLastError( ERROR_INVALID_FUNCTION ); for unimplemented functions
- spelling fixes

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at rhlx01.fht-esslingen.de:/home/wine
Index: win32/device.c
===================================================================
RCS file: /home/wine/wine/win32/device.c,v
retrieving revision 1.49
diff -u -r1.49 device.c
--- win32/device.c	2001/05/14 20:09:39	1.49
+++ win32/device.c	2001/05/24 14:03:11
@@ -57,6 +57,12 @@
 			      LPDWORD lpcbBytesReturned,
 			      LPOVERLAPPED lpOverlapped);
 
+static BOOL DeviceIo_VCD(DWORD dwIoControlCode, 
+			      LPVOID lpvInBuffer, DWORD cbInBuffer,
+			      LPVOID lpvOutBuffer, DWORD cbOutBuffer,
+			      LPDWORD lpcbBytesReturned,
+			      LPOVERLAPPED lpOverlapped);
+
 static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context );
 
 static BOOL DeviceIo_VWin32(DWORD dwIoControlCode, 
@@ -105,7 +111,7 @@
     { "VSD",      0x000B, NULL, NULL },
     { "VMD",      0x000C, NULL, NULL },
     { "VKD",      0x000D, NULL, NULL },
-    { "VCD",      0x000E, NULL, NULL },
+    { "VCD",      0x000E, NULL, DeviceIo_VCD },
     { "VPD",      0x000F, NULL, NULL },
     { "BLOCKDEV", 0x0010, NULL, NULL },
     { "VMCPD",    0x0011, NULL, NULL },
@@ -295,7 +301,7 @@
 
 /* PageCommit flags */
 #define PC_FIXED    0x00000008	/* pages are permanently locked */
-#define PC_LOCKED   0x00000080	/* pages are made present and locked*/
+#define PC_LOCKED   0x00000080	/* pages are made present and locked */
 #define PC_LOCKEDIFDP	0x00000100  /* pages are locked if swap via DOS */
 #define PC_WRITEABLE	0x00020000  /* make the pages writeable */
 #define PC_USER     0x00040000	/* make the pages ring 3 accessible */
@@ -352,7 +358,7 @@
  * used for VxD communication.
  *
  * A return value of FALSE indicates that something has gone wrong which
- * GetLastError can decypher.
+ * GetLastError can decipher.
  */
 BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, 
 			      LPVOID lpvInBuffer, DWORD cbInBuffer,
@@ -384,9 +390,12 @@
 		}
 		else
 		{
-			/* FIXME: Set appropriate error */
 			FIXME( "Unimplemented control %ld for VxD device %s\n", 
                                dwIoControlCode, info->name ? info->name : "???" );
+			/* FIXME: this is for invalid calls on W98SE,
+			 * but maybe we should use ERROR_CALL_NOT_IMPLEMENTED
+			 * instead ? */
+			SetLastError( ERROR_INVALID_FUNCTION );
 		}
 	}
 	else
@@ -685,8 +694,8 @@
 	  ERR("Can't reserve ring 1 memory\n");
 	  return -1;
 	}
-	/* FIXME: This has to be handled separately, when we have separate
-	   address-spaces */
+	/* FIXME: This has to be handled separately for the separate
+	   address-spaces we now have */
 	if ( page == PR_PRIVATE || page == PR_SHARED ) page = 0;
 	/* FIXME: Handle flags in some way */
 	address = (LPVOID )(page * psize); 
@@ -849,11 +858,11 @@
 /***********************************************************************
  *           DeviceIo_IFSMgr
  * NOTES
- *   The ioctls is used by 'MSNET32.DLL'.
+ *   These ioctls are used by 'MSNET32.DLL'.
  *
  *   I have been unable to uncover any documentation about the ioctls so 
  *   the implementation of the cases IFS_IOCTL_21 and IFS_IOCTL_2F are
- *   based on a resonable guesses on information found in the Windows 95 DDK.
+ *   based on reasonable guesses on information found in the Windows 95 DDK.
  *   
  */
 
@@ -983,7 +992,7 @@
  *      VxDCall_VWin32
  *
  *  Service numbers taken from page 448 of Pietrek's "Windows 95 System
- *  Progrmaming Secrets".  Parameters from experimentation on real Win98.
+ *  Programming Secrets".  Parameters from experimentation on real Win98.
  *
  */
 
@@ -1043,6 +1052,37 @@
   return 0xffffffff;
 }
                          
+
+/***********************************************************************
+ *           DeviceIo_VCD
+ */
+static BOOL DeviceIo_VCD(DWORD dwIoControlCode, 
+			      LPVOID lpvInBuffer, DWORD cbInBuffer,
+			      LPVOID lpvOutBuffer, DWORD cbOutBuffer,
+			      LPDWORD lpcbBytesReturned,
+			      LPOVERLAPPED lpOverlapped)
+{
+    BOOL retv = TRUE;
+
+    switch (dwIoControlCode)
+    {
+    case IOCTL_SERIAL_LSRMST_INSERT:
+    {
+        CONTEXT86 cxt;
+
+        FIXME( "IOCTL_SERIAL_LSRMST_INSERT NIY !\n");
+        retv = FALSE;
+    }
+    break;
+
+    default:
+        FIXME( "Unknown Control %ld\n", dwIoControlCode);
+        retv = FALSE;
+        break;
+    }
+
+    return retv;
+}
 
  
 /***********************************************************************


More information about the wine-patches mailing list