mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 17:35:07 +00:00
fix Mesa ICD DrvSetFormatPixel, do not create stack cruption by ignore the 3 param.
copy code from fxgl interface and make DrvSetFormatPixel work svn path=/trunk/; revision=30399
This commit is contained in:
parent
90e352745f
commit
a240dabd79
|
@ -284,18 +284,22 @@ WGLAPI int GLAPIENTRY DrvDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nByte
|
|||
LPPIXELFORMATDESCRIPTOR ppfd)
|
||||
{
|
||||
int qt_valid_pix;
|
||||
(void) hdc;
|
||||
|
||||
qt_valid_pix = qt_pix;
|
||||
|
||||
if(ppfd == NULL)
|
||||
return(qt_valid_pix);
|
||||
if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR))
|
||||
{
|
||||
|
||||
if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix ||
|
||||
((nBytes != sizeof(PIXELFORMATDESCRIPTOR)) && (nBytes != 0))) {
|
||||
SetLastError(0);
|
||||
return(0);
|
||||
return qt_valid_pix;
|
||||
}
|
||||
|
||||
if (nBytes != 0)
|
||||
*ppfd = pix[iPixelFormat - 1].pfd;
|
||||
return(qt_valid_pix);
|
||||
|
||||
return qt_valid_pix;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -311,19 +315,27 @@ WGLAPI PROC GLAPIENTRY DrvGetProcAddress(LPCSTR lpszProc)
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
WGLAPI BOOL GLAPIENTRY DrvSetPixelFormat(HDC hdc,int iPixelFormat)
|
||||
WGLAPI BOOL GLAPIENTRY DrvSetPixelFormat(HDC hdc,int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd)
|
||||
{
|
||||
int qt_valid_pix;
|
||||
(void) hdc;
|
||||
|
||||
qt_valid_pix = qt_pix;
|
||||
if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix)
|
||||
{
|
||||
|
||||
if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix) {
|
||||
if (ppfd == NULL) {
|
||||
PIXELFORMATDESCRIPTOR my_pfd;
|
||||
if (!DrvDescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &my_pfd)) {
|
||||
SetLastError(0);
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
} else if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) {
|
||||
SetLastError(0);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
curPFD = iPixelFormat;
|
||||
return(TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WGLAPI BOOL GLAPIENTRY DrvSwapBuffers(HDC hdc)
|
||||
|
|
Loading…
Reference in a new issue