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
656fc938
Commit
656fc938
authored
Jan 02, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GetDC instead of CreateDC where possible.
parent
d44ed08d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
13 deletions
+12
-13
treeview.c
dlls/comctl32/treeview.c
+2
-3
main.c
dlls/ddraw/main.c
+2
-2
device.c
dlls/wined3d/device.c
+2
-2
directx.c
dlls/wined3d/directx.c
+2
-2
surface.c
dlls/wined3d/surface.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+2
-2
No files found.
dlls/comctl32/treeview.c
View file @
656fc938
...
...
@@ -4823,7 +4823,6 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam)
static
LRESULT
TREEVIEW_Create
(
HWND
hwnd
,
const
CREATESTRUCTW
*
lpcs
)
{
static
const
WCHAR
szDisplayW
[]
=
{
'D'
,
'I'
,
'S'
,
'P'
,
'L'
,
'A'
,
'Y'
,
'\0'
};
RECT
rcClient
;
TREEVIEW_INFO
*
infoPtr
;
LOGFONTW
lf
;
...
...
@@ -4931,7 +4930,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr
->
himlState
=
ImageList_Create
(
16
,
16
,
ILC_COLOR
|
ILC_MASK
,
3
,
0
);
hdcScreen
=
CreateDCW
(
szDisplayW
,
NULL
,
NULL
,
NULL
);
hdcScreen
=
GetDC
(
0
);
/* Create a coloured bitmap compatible with the screen depth
because checkboxes are not black&white */
...
...
@@ -4959,7 +4958,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
DeleteObject
(
hbm
);
DeleteDC
(
hdc
);
DeleteDC
(
hdcScreen
);
ReleaseDC
(
0
,
hdcScreen
);
infoPtr
->
stateImageWidth
=
16
;
infoPtr
->
stateImageHeight
=
16
;
...
...
dlls/ddraw/main.c
View file @
656fc938
...
...
@@ -164,9 +164,9 @@ DDRAW_Create(GUID *guid,
This
->
ImplType
=
DefaultSurfaceType
;
/* Get the current screen settings */
hDC
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
hDC
=
GetDC
(
0
);
This
->
orig_bpp
=
GetDeviceCaps
(
hDC
,
BITSPIXEL
)
*
GetDeviceCaps
(
hDC
,
PLANES
);
DeleteDC
(
hDC
);
ReleaseDC
(
0
,
hDC
);
This
->
orig_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
This
->
orig_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
...
...
dlls/wined3d/device.c
View file @
656fc938
...
...
@@ -1440,9 +1440,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
RECT
clip_rc
;
/* Get info on the current display setup */
hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
hdc
=
GetDC
(
0
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
DeleteDC
(
hdc
);
ReleaseDC
(
0
,
hdc
);
/* Change the display settings */
memset
(
&
devmode
,
0
,
sizeof
(
DEVMODEW
));
...
...
dlls/wined3d/directx.c
View file @
656fc938
...
...
@@ -2439,9 +2439,9 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
/* Get the initial screen setup for ddraw */
object
->
ddraw_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
object
->
ddraw_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
hDC
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
hDC
=
GetDC
(
0
);
object
->
ddraw_format
=
pixelformat_for_depth
(
GetDeviceCaps
(
hDC
,
BITSPIXEL
)
*
GetDeviceCaps
(
hDC
,
PLANES
));
DeleteDC
(
hDC
);
ReleaseDC
(
0
,
hDC
);
return
WINED3D_OK
;
create_device_error:
...
...
dlls/wined3d/surface.c
View file @
656fc938
...
...
@@ -1370,7 +1370,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) {
break
;
}
ddc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
ddc
=
GetDC
(
0
);
if
(
ddc
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
b_info
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
...
...
@@ -1378,7 +1378,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) {
TRACE
(
"Creating a DIB section with size %dx%dx%d, size=%d
\n
"
,
b_info
->
bmiHeader
.
biWidth
,
b_info
->
bmiHeader
.
biHeight
,
b_info
->
bmiHeader
.
biBitCount
,
b_info
->
bmiHeader
.
biSizeImage
);
This
->
dib
.
DIBsection
=
CreateDIBSection
(
ddc
,
b_info
,
usage
,
&
This
->
dib
.
bitmap_data
,
0
/* Handle */
,
0
/* Offset */
);
DeleteDC
(
ddc
);
ReleaseDC
(
0
,
ddc
);
if
(
!
This
->
dib
.
DIBsection
)
{
ERR
(
"CreateDIBSection failed!
\n
"
);
...
...
dlls/wined3d/swapchain.c
View file @
656fc938
...
...
@@ -489,9 +489,9 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *if
pMode
->
Height
=
GetSystemMetrics
(
SM_CYSCREEN
);
pMode
->
RefreshRate
=
85
;
/* FIXME: How to identify? */
hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
hdc
=
GetDC
(
0
);
bpp
=
GetDeviceCaps
(
hdc
,
BITSPIXEL
);
DeleteDC
(
hdc
);
ReleaseDC
(
0
,
hdc
);
switch
(
bpp
)
{
case
8
:
pMode
->
Format
=
WINED3DFMT_R8G8B8
;
break
;
...
...
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