mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:16:04 +00:00
patch from Yaroslav Ponomarenko yarryp at gmail dot com
revert 27521, bugfix the regress in second boot with this patch ----------------------------------------------------------------- I GreatLord hope it is no more regress, if any one found any werid with this change, please let me known direcly. svn path=/trunk/; revision=27531
This commit is contained in:
parent
2ee6ba87f9
commit
b660147329
1 changed files with 250 additions and 52 deletions
|
@ -1434,6 +1434,94 @@ IntSystemParametersInfo(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
UserSystemParametersInfo_StructSet(
|
||||||
|
UINT uiAction,
|
||||||
|
UINT uiParam,
|
||||||
|
PVOID pvParam,
|
||||||
|
UINT fWinIni,
|
||||||
|
PVOID pBuffer, /* private kmode buffer */
|
||||||
|
UINT cbSize /* size of buffer and expected size usermode data, pointed by pvParam */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForRead(pvParam, cbSize, 1);
|
||||||
|
RtlCopyMemory(pBuffer,pvParam,cbSize);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
if(*(PUINT)pBuffer != cbSize)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
return IntSystemParametersInfo(uiAction, uiParam, pBuffer, fWinIni);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
UserSystemParametersInfo_StructGet(
|
||||||
|
UINT uiAction,
|
||||||
|
UINT uiParam,
|
||||||
|
PVOID pvParam,
|
||||||
|
UINT fWinIni,
|
||||||
|
PVOID pBuffer, /* private kmode buffer */
|
||||||
|
UINT cbSize /* size of buffer and expected size usermode data, pointed by pvParam */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForRead(pvParam, cbSize, 1);
|
||||||
|
/* Copy only first UINT describing structure size*/
|
||||||
|
*((PUINT)pBuffer) = *((PUINT)pvParam);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
if(*((PUINT)pBuffer) != cbSize)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
if(!IntSystemParametersInfo(uiAction, uiParam, pBuffer, fWinIni))
|
||||||
|
{
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForWrite(pvParam, cbSize, 1);
|
||||||
|
RtlCopyMemory(pvParam,pBuffer,cbSize);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
return( TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -1625,64 +1713,125 @@ UserSystemParametersInfo(
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return( TRUE);
|
||||||
}
|
}
|
||||||
|
case SPI_GETICONMETRICS:
|
||||||
|
{
|
||||||
|
ICONMETRICSW Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETICONMETRICS:
|
||||||
|
{
|
||||||
|
ICONMETRICSW Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
case SPI_GETMINIMIZEDMETRICS:
|
case SPI_GETMINIMIZEDMETRICS:
|
||||||
|
{
|
||||||
|
MINIMIZEDMETRICS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
case SPI_SETMINIMIZEDMETRICS:
|
case SPI_SETMINIMIZEDMETRICS:
|
||||||
{
|
{
|
||||||
MINIMIZEDMETRICS minimetrics;
|
MINIMIZEDMETRICS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
Status = MmCopyFromCaller(&minimetrics, pvParam, sizeof(MINIMIZEDMETRICS));
|
&Buffer,sizeof(Buffer));
|
||||||
if(!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastNtError(Status);
|
|
||||||
return( FALSE);
|
|
||||||
}
|
|
||||||
if(minimetrics.cbSize != sizeof(MINIMIZEDMETRICS))
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
|
||||||
return( FALSE);
|
|
||||||
}
|
|
||||||
if(!IntSystemParametersInfo(uiAction, uiParam, &minimetrics, fWinIni))
|
|
||||||
{
|
|
||||||
return( FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = MmCopyToCaller(pvParam, &minimetrics, sizeof(MINIMIZEDMETRICS));
|
|
||||||
if(!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastNtError(Status);
|
|
||||||
return( FALSE);
|
|
||||||
}
|
|
||||||
return( TRUE);
|
|
||||||
}
|
}
|
||||||
case SPI_GETNONCLIENTMETRICS:
|
case SPI_GETNONCLIENTMETRICS:
|
||||||
|
{
|
||||||
|
NONCLIENTMETRICS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
case SPI_SETNONCLIENTMETRICS:
|
case SPI_SETNONCLIENTMETRICS:
|
||||||
{
|
{
|
||||||
NONCLIENTMETRICSW metrics;
|
NONCLIENTMETRICS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
Status = MmCopyFromCaller(&metrics, pvParam, sizeof(NONCLIENTMETRICSW));
|
&Buffer,sizeof(Buffer));
|
||||||
if(!NT_SUCCESS(Status))
|
}
|
||||||
{
|
case SPI_GETANIMATION:
|
||||||
SetLastNtError(Status);
|
{
|
||||||
return( FALSE);
|
ANIMATIONINFO Buffer;
|
||||||
}
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
if(metrics.cbSize != sizeof(NONCLIENTMETRICSW))
|
&Buffer,sizeof(Buffer));
|
||||||
{
|
}
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
case SPI_SETANIMATION:
|
||||||
return( FALSE);
|
{
|
||||||
}
|
ANIMATIONINFO Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
if(!IntSystemParametersInfo(uiAction, uiParam, &metrics, fWinIni))
|
&Buffer,sizeof(Buffer));
|
||||||
{
|
}
|
||||||
return( FALSE);
|
case SPI_GETACCESSTIMEOUT:
|
||||||
}
|
{
|
||||||
|
ACCESSTIMEOUT Buffer;
|
||||||
Status = MmCopyToCaller(pvParam, &metrics, sizeof(NONCLIENTMETRICSW));
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
if(!NT_SUCCESS(Status))
|
&Buffer,sizeof(Buffer));
|
||||||
{
|
}
|
||||||
SetLastNtError(Status);
|
case SPI_SETACCESSTIMEOUT:
|
||||||
return( FALSE);
|
{
|
||||||
}
|
ACCESSTIMEOUT Buffer;
|
||||||
return( TRUE);
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_GETFILTERKEYS:
|
||||||
|
{
|
||||||
|
FILTERKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETFILTERKEYS:
|
||||||
|
{
|
||||||
|
FILTERKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_GETHIGHCONTRAST:
|
||||||
|
{
|
||||||
|
HIGHCONTRAST Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETHIGHCONTRAST:
|
||||||
|
{
|
||||||
|
HIGHCONTRAST Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_GETSOUNDSENTRY:
|
||||||
|
{
|
||||||
|
SOUNDSENTRY Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETSOUNDSENTRY:
|
||||||
|
{
|
||||||
|
SOUNDSENTRY Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_GETSTICKYKEYS:
|
||||||
|
{
|
||||||
|
STICKYKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETSTICKYKEYS:
|
||||||
|
{
|
||||||
|
STICKYKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_GETTOGGLEKEYS:
|
||||||
|
{
|
||||||
|
TOGGLEKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructGet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
|
}
|
||||||
|
case SPI_SETTOGGLEKEYS:
|
||||||
|
{
|
||||||
|
TOGGLEKEYS Buffer;
|
||||||
|
return UserSystemParametersInfo_StructSet(uiAction, uiParam, pvParam, fWinIni,
|
||||||
|
&Buffer,sizeof(Buffer));
|
||||||
}
|
}
|
||||||
case SPI_SETWORKAREA:
|
case SPI_SETWORKAREA:
|
||||||
{
|
{
|
||||||
|
@ -1772,7 +1921,26 @@ UserSystemParametersInfo(
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return( TRUE);
|
||||||
}
|
}
|
||||||
|
case SPI_SETICONTITLELOGFONT:
|
||||||
|
{
|
||||||
|
LOGFONTW LogFont;
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForRead(pvParam, sizeof( LOGFONTW ), 1);
|
||||||
|
RtlCopyMemory(&LogFont,pvParam,sizeof(LOGFONTW));
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
return IntSystemParametersInfo(uiAction, uiParam, &LogFont, fWinIni);
|
||||||
|
}
|
||||||
case SPI_GETICONTITLELOGFONT:
|
case SPI_GETICONTITLELOGFONT:
|
||||||
{
|
{
|
||||||
LOGFONTW LogFont;
|
LOGFONTW LogFont;
|
||||||
|
@ -1797,6 +1965,35 @@ UserSystemParametersInfo(
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return( TRUE);
|
||||||
}
|
}
|
||||||
|
case SPI_ICONVERTICALSPACING:
|
||||||
|
case SPI_ICONHORIZONTALSPACING:
|
||||||
|
{
|
||||||
|
UINT Ret;
|
||||||
|
if(!IntSystemParametersInfo(uiAction, uiParam, &Ret, fWinIni))
|
||||||
|
{
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
if(NULL != pvParam)
|
||||||
|
{
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForWrite(pvParam, sizeof(UINT ), 1);
|
||||||
|
*(PUINT)pvParam = Ret;
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return( FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return( TRUE);
|
||||||
|
}
|
||||||
|
case SPI_SETDEFAULTINPUTLANG:
|
||||||
case SPI_SETDESKWALLPAPER: /* !!! As opposed to the user mode version this version accepts a handle
|
case SPI_SETDESKWALLPAPER: /* !!! As opposed to the user mode version this version accepts a handle
|
||||||
to the bitmap! */
|
to the bitmap! */
|
||||||
{
|
{
|
||||||
|
@ -1818,6 +2015,7 @@ UserSystemParametersInfo(
|
||||||
}
|
}
|
||||||
return IntSystemParametersInfo(uiAction, uiParam, &Handle, fWinIni);
|
return IntSystemParametersInfo(uiAction, uiParam, &Handle, fWinIni);
|
||||||
}
|
}
|
||||||
|
case SPI_GETDEFAULTINPUTLANG:
|
||||||
case SPI_GETDESKWALLPAPER:
|
case SPI_GETDESKWALLPAPER:
|
||||||
{
|
{
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue