user32: Respect the requested size of NONCLIENTMETRICSW structure.
This commit is contained in:
parent
d8ca697233
commit
9711cdbcab
|
@ -1582,11 +1582,21 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
|
|||
{
|
||||
LPNONCLIENTMETRICSW lpnm = pvParam;
|
||||
|
||||
if (!lpnm)
|
||||
{
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
|
||||
|
||||
if (lpnm && (lpnm->cbSize == sizeof(NONCLIENTMETRICSW) ||
|
||||
lpnm->cbSize == FIELD_OFFSET(NONCLIENTMETRICSW, iPaddedBorderWidth)))
|
||||
if (lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
|
||||
*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
|
||||
ret = FALSE;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue