SystemParametersInfo patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In the process of trying to get a component installed in Borland
C++Builder 5, I ran across an AV in SystemParametersInfo as a result of
a bug in the component.  It seems Windows checks for NULL being passed
and returns an error instead of AVing.  The attached patch makes Wine do
the same.

(as an aside are patches preferred as MIME attachments or straight in
the mail here?)

-- 
Jon Bright
Lead Programmer, Silicon Circus Ltd.
http://www.siliconcircus.com/

diff -u -r1.49 sysparams.c
--- windows/sysparams.c	19 Feb 2003 22:04:46 -0000	1.49
+++ windows/sysparams.c	5 Mar 2003 10:39:39 -0000
@@ -1662,17 +1662,26 @@
     }
 
     case SPI_GETMOUSEHOVERWIDTH:		/*     98  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
-	*(UINT *)pvParam = 4;
+	if (pvParam==NULL)
+	    ret = FALSE;
+	else
+	    *(UINT *)pvParam = 4;
 	break;
     WINE_SPI_FIXME(SPI_SETMOUSEHOVERWIDTH);	/*     99  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
 
     case SPI_GETMOUSEHOVERHEIGHT:		/*    100  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
-	*(UINT *)pvParam = 4;
+	if (pvParam==NULL)
+	    ret = FALSE;
+	else
+	    *(UINT *)pvParam = 4;
 	break;
     WINE_SPI_FIXME(SPI_SETMOUSEHOVERHEIGHT);	/*    101  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
 
     case SPI_GETMOUSEHOVERTIME:			/*    102  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
-	*(UINT *)pvParam = 400; /* default for menu dropdowns */
+	if (pvParam==NULL)
+	    ret = FALSE;
+	else
+	    *(UINT *)pvParam = 400; /* default for menu dropdowns */
 	break;
     WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME);	/*    103  _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux