Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
56331e2a
Commit
56331e2a
authored
Jan 06, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't allow Get/SetDeviceGammaRamp on DIBs or memory DCs.
parent
bf718448
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
4 deletions
+57
-4
dc.c
dlls/gdi32/dibdrv/dc.c
+20
-2
driver.c
dlls/gdi32/driver.c
+2
-0
dc.c
dlls/gdi32/tests/dc.c
+25
-2
xvidmode.c
dlls/winex11.drv/xvidmode.c
+10
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
56331e2a
...
...
@@ -418,6 +418,15 @@ static INT dibdrv_DescribePixelFormat( PHYSDEV dev, INT fmt, UINT size, PIXELFOR
}
/***********************************************************************
* dibdrv_GetDeviceGammaRamp
*/
static
BOOL
dibdrv_GetDeviceGammaRamp
(
PHYSDEV
dev
,
void
*
ramp
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/***********************************************************************
* dibdrv_GetPixelFormat
*/
static
INT
dibdrv_GetPixelFormat
(
PHYSDEV
dev
)
...
...
@@ -427,6 +436,15 @@ static INT dibdrv_GetPixelFormat( PHYSDEV dev )
}
/***********************************************************************
* dibdrv_SetDeviceGammaRamp
*/
static
BOOL
dibdrv_SetDeviceGammaRamp
(
PHYSDEV
dev
,
void
*
ramp
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/***********************************************************************
* dibdrv_SetPixelFormat
*/
static
BOOL
dibdrv_SetPixelFormat
(
PHYSDEV
dev
,
INT
fmt
,
const
PIXELFORMATDESCRIPTOR
*
pfd
)
...
...
@@ -598,7 +616,7 @@ const struct gdi_dc_funcs dib_driver =
NULL
,
/* pGetCharABCWidthsI */
NULL
,
/* pGetCharWidth */
NULL
,
/* pGetDeviceCaps */
NULL
,
/* pGetDeviceGammaRamp */
dibdrv_GetDeviceGammaRamp
,
/* pGetDeviceGammaRamp */
NULL
,
/* pGetFontData */
NULL
,
/* pGetFontUnicodeRanges */
NULL
,
/* pGetGlyphIndices */
...
...
@@ -660,7 +678,7 @@ const struct gdi_dc_funcs dib_driver =
dibdrv_SetDIBColorTable
,
/* pSetDIBColorTable */
NULL
,
/* pSetDIBitsToDevice */
dibdrv_SetDeviceClipping
,
/* pSetDeviceClipping */
NULL
,
/* pSetDeviceGammaRamp */
dibdrv_SetDeviceGammaRamp
,
/* pSetDeviceGammaRamp */
NULL
,
/* pSetLayout */
NULL
,
/* pSetMapMode */
NULL
,
/* pSetMapperFlags */
...
...
dlls/gdi32/driver.c
View file @
56331e2a
...
...
@@ -355,6 +355,7 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
static
BOOL
nulldrv_GetDeviceGammaRamp
(
PHYSDEV
dev
,
void
*
ramp
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
...
...
@@ -587,6 +588,7 @@ static DWORD nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
static
BOOL
nulldrv_SetDeviceGammaRamp
(
PHYSDEV
dev
,
void
*
ramp
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
...
...
dlls/gdi32/tests/dc.c
View file @
56331e2a
...
...
@@ -305,22 +305,39 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
DESKTOPVERTRES
,
DESKTOPHORZRES
,
BLTALIGNMENT
,
SHADEBLENDCAPS
,
COLORMGMTCAPS
SHADEBLENDCAPS
};
unsigned
int
i
;
WORD
ramp
[
3
][
256
];
BOOL
ret
;
if
(
GetObjectType
(
hdc
)
==
OBJ_METADC
)
{
for
(
i
=
0
;
i
<
sizeof
(
caps
)
/
sizeof
(
caps
[
0
]);
i
++
)
ok
(
GetDeviceCaps
(
hdc
,
caps
[
i
]
)
==
(
caps
[
i
]
==
TECHNOLOGY
?
DT_METAFILE
:
0
),
"wrong caps on %s for %u: %u
\n
"
,
descr
,
caps
[
i
],
GetDeviceCaps
(
hdc
,
caps
[
i
]
)
);
SetLastError
(
0xdeadbeef
);
ret
=
GetDeviceGammaRamp
(
hdc
,
&
ramp
);
ok
(
!
ret
,
"GetDeviceGammaRamp succeeded on %s
\n
"
,
descr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
}
else
{
for
(
i
=
0
;
i
<
sizeof
(
caps
)
/
sizeof
(
caps
[
0
]);
i
++
)
ok
(
GetDeviceCaps
(
hdc
,
caps
[
i
]
)
==
GetDeviceCaps
(
ref_dc
,
caps
[
i
]
),
"mismatched caps on %s for %u: %u/%u
\n
"
,
descr
,
caps
[
i
],
GetDeviceCaps
(
hdc
,
caps
[
i
]
),
GetDeviceCaps
(
ref_dc
,
caps
[
i
]
)
);
SetLastError
(
0xdeadbeef
);
ret
=
GetDeviceGammaRamp
(
hdc
,
&
ramp
);
ok
(
!
ret
,
"GetDeviceGammaRamp succeeded on %s
\n
"
,
descr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
}
if
(
GetObjectType
(
hdc
)
==
OBJ_MEMDC
)
{
char
buffer
[
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
)];
...
...
@@ -342,6 +359,12 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
"mismatched caps on %s and DIB for %u: %u/%u
\n
"
,
descr
,
caps
[
i
],
GetDeviceCaps
(
hdc
,
caps
[
i
]
),
GetDeviceCaps
(
ref_dc
,
caps
[
i
]
)
);
SetLastError
(
0xdeadbeef
);
ret
=
GetDeviceGammaRamp
(
hdc
,
&
ramp
);
ok
(
!
ret
,
"GetDeviceGammaRamp succeeded on %s
\n
"
,
descr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
SelectObject
(
hdc
,
old
);
DeleteObject
(
dib
);
}
...
...
dlls/winex11.drv/xvidmode.c
View file @
56331e2a
...
...
@@ -424,6 +424,11 @@ static BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp)
*/
BOOL
X11DRV_GetDeviceGammaRamp
(
PHYSDEV
dev
,
LPVOID
ramp
)
{
if
(
GetObjectType
(
dev
->
hdc
)
==
OBJ_MEMDC
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
#ifdef SONAME_LIBXXF86VM
return
X11DRV_XF86VM_GetGammaRamp
(
ramp
);
#else
...
...
@@ -440,6 +445,11 @@ BOOL X11DRV_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp)
*/
BOOL
X11DRV_SetDeviceGammaRamp
(
PHYSDEV
dev
,
LPVOID
ramp
)
{
if
(
GetObjectType
(
dev
->
hdc
)
==
OBJ_MEMDC
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
#ifdef SONAME_LIBXXF86VM
return
X11DRV_XF86VM_SetGammaRamp
(
ramp
);
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment