Commit 9711cdbc authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

user32: Respect the requested size of NONCLIENTMETRICSW structure.

parent d8ca6972
...@@ -1582,11 +1582,21 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, ...@@ -1582,11 +1582,21 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
{ {
LPNONCLIENTMETRICSW lpnm = pvParam; LPNONCLIENTMETRICSW lpnm = pvParam;
if (!lpnm)
{
ret = FALSE;
break;
}
if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics(); if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
if (lpnm && (lpnm->cbSize == sizeof(NONCLIENTMETRICSW) || if (lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
lpnm->cbSize == FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth)))
*lpnm = nonclient_metrics; *lpnm = nonclient_metrics;
else if (lpnm->cbSize == FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth))
{
memcpy(lpnm, &nonclient_metrics, FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth));
lpnm->cbSize = FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth);
}
else else
ret = FALSE; ret = FALSE;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment