Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
2d4735ae
Commit
2d4735ae
authored
Feb 26, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Make DC creation fail if we cannot allocate the visible region.
parent
489db09d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
dc.c
dlls/gdi32/dc.c
+20
-20
No files found.
dlls/gdi32/dc.c
View file @
2d4735ae
...
...
@@ -626,14 +626,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
ERR
(
"no driver found for %s
\n
"
,
debugstr_w
(
buf
)
);
return
0
;
}
if
(
!
(
dc
=
DC_AllocDC
(
funcs
,
DC_MAGIC
)))
{
DRIVER_release_driver
(
funcs
);
return
0
;
}
if
(
!
(
dc
=
DC_AllocDC
(
funcs
,
DC_MAGIC
)))
goto
error
;
hdc
=
dc
->
hSelf
;
dc
->
hBitmap
=
GetStockObject
(
DEFAULT_BITMAP
);
if
(
!
(
dc
->
hVisRgn
=
CreateRectRgn
(
0
,
0
,
1
,
1
)))
goto
error
;
TRACE
(
"(driver=%s, device=%s, output=%s): returning %p
\n
"
,
debugstr_w
(
driver
),
debugstr_w
(
device
),
debugstr_w
(
output
),
dc
->
hSelf
);
...
...
@@ -642,17 +639,21 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
!
dc
->
funcs
->
pCreateDC
(
hdc
,
&
dc
->
physDev
,
buf
,
device
,
output
,
initData
))
{
WARN
(
"creation aborted by device
\n
"
);
GDI_FreeObject
(
dc
->
hSelf
,
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
goto
error
;
}
dc
->
hVisRgn
=
CreateRectRgn
(
0
,
0
,
GetDeviceCaps
(
hdc
,
DESKTOPHORZRES
)
,
GetDeviceCaps
(
hdc
,
DESKTOPVERTRES
)
);
SetRectRgn
(
dc
->
hVisRgn
,
0
,
0
,
GetDeviceCaps
(
hdc
,
DESKTOPHORZRES
),
GetDeviceCaps
(
hdc
,
DESKTOPVERTRES
)
);
DC_InitDC
(
dc
);
GDI_ReleaseObj
(
hdc
);
return
hdc
;
error:
if
(
dc
&&
dc
->
hVisRgn
)
DeleteObject
(
dc
->
hVisRgn
);
if
(
dc
)
GDI_FreeObject
(
dc
->
hSelf
,
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
}
...
...
@@ -741,15 +742,12 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
if
(
!
funcs
)
return
0
;
if
(
!
(
dc
=
DC_AllocDC
(
funcs
,
MEMORY_DC_MAGIC
)))
{
DRIVER_release_driver
(
funcs
);
return
0
;
}
if
(
!
(
dc
=
DC_AllocDC
(
funcs
,
MEMORY_DC_MAGIC
)))
goto
error
;
TRACE
(
"(%p): returning %p
\n
"
,
hdc
,
dc
->
hSelf
);
dc
->
hBitmap
=
GetStockObject
(
DEFAULT_BITMAP
);
if
(
!
(
dc
->
hVisRgn
=
CreateRectRgn
(
0
,
0
,
1
,
1
)))
goto
error
;
/* default bitmap is 1x1 */
/* Copy the driver-specific physical device info into
* the new DC. The driver may use this read-only info
...
...
@@ -760,16 +758,18 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
!
dc
->
funcs
->
pCreateDC
(
dc
->
hSelf
,
&
dc
->
physDev
,
NULL
,
NULL
,
NULL
,
NULL
))
{
WARN
(
"creation aborted by device
\n
"
);
GDI_FreeObject
(
dc
->
hSelf
,
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
goto
error
;
}
dc
->
hVisRgn
=
CreateRectRgn
(
0
,
0
,
1
,
1
);
/* default bitmap is 1x1 */
DC_InitDC
(
dc
);
GDI_ReleaseObj
(
dc
->
hSelf
);
return
dc
->
hSelf
;
error:
if
(
dc
&&
dc
->
hVisRgn
)
DeleteObject
(
dc
->
hVisRgn
);
if
(
dc
)
GDI_FreeObject
(
dc
->
hSelf
,
dc
);
DRIVER_release_driver
(
funcs
);
return
0
;
}
...
...
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