fixed GDIOBJ locking issue with DC_SET_MODE macro

svn path=/trunk/; revision=5610
This commit is contained in:
Royce Mitchell III 2003-08-17 03:32:59 +00:00
parent 96a1097b2d
commit 85f2a50511

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dc.c,v 1.68 2003/08/04 19:10:52 royce Exp $
/* $Id: dc.c,v 1.69 2003/08/17 03:32:59 royce Exp $
*
* DC.C - Device context functions
*
@ -79,9 +79,7 @@ BOOL STDCALL func_name( HDC hdc, LP##type pt ) \
{ \
PDC dc = DC_HandleToPtr ( hdc ); \
if (!dc) \
{ \
return FALSE; \
} \
((LPPOINT)pt)->x = dc->ret_x; \
((LPPOINT)pt)->y = dc->ret_y; \
DC_ReleasePtr ( hdc ); \
@ -92,15 +90,12 @@ BOOL STDCALL func_name( HDC hdc, LP##type pt ) \
INT STDCALL func_name( HDC hdc, INT mode ) \
{ \
INT prevMode; \
PDC dc = DC_HandleToPtr( hdc ); \
if(!dc) \
{ \
return 0; \
} \
PDC dc; \
if ((mode < min_val) || (mode > max_val)) \
{ \
return 0; \
} \
dc = DC_HandleToPtr ( hdc ); \
if ( !dc ) \
return 0; \
prevMode = dc->dc_field; \
dc->dc_field = mode; \
DC_ReleasePtr ( hdc ); \
@ -136,7 +131,8 @@ W32kCreateCompatableDC(HDC hDC)
if( hNewDC )
NewDC = DC_HandleToPtr( hNewDC );
}
else {
else
{
/* Allocate a new DC based on the original DC's device */
hNewDC = DC_AllocDC(OrigDC->DriverName);
if( hNewDC )
@ -152,8 +148,11 @@ W32kCreateCompatableDC(HDC hDC)
NewDC->hSelf = NewDC;
/* FIXME: Should this DC request its own PDEV? */
if(OrigDC == NULL) {
} else {
if(OrigDC == NULL)
{
}
else
{
NewDC->PDev = OrigDC->PDev;
NewDC->DMW = OrigDC->DMW;
memcpy(NewDC->FillPatternSurfaces,
@ -164,9 +163,12 @@ W32kCreateCompatableDC(HDC hDC)
}
/* DriverName is copied in the AllocDC routine */
if(OrigDC == NULL) {
if(OrigDC == NULL)
{
NewDC->DeviceDriver = DRIVER_FindMPDriver(NewDC->DriverName);
} else {
}
else
{
NewDC->DeviceDriver = OrigDC->DeviceDriver;
NewDC->wndOrgX = OrigDC->wndOrgX;
NewDC->wndOrgY = OrigDC->wndOrgY;