Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f9ebe5ab
Commit
f9ebe5ab
authored
Sep 12, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't store a DC pointer in the metafile devices.
parent
0a134e9e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
23 deletions
+19
-23
dc.c
dlls/gdi32/enhmfdrv/dc.c
+3
-1
enhmetafiledrv.h
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+0
-1
init.c
dlls/gdi32/enhmfdrv/init.c
+7
-9
init.c
dlls/gdi32/mfdrv/init.c
+9
-11
metafiledrv.h
dlls/gdi32/mfdrv/metafiledrv.h
+0
-1
No files found.
dlls/gdi32/enhmfdrv/dc.c
View file @
f9ebe5ab
...
...
@@ -34,6 +34,7 @@ INT EMFDRV_SaveDC( PHYSDEV dev )
BOOL
EMFDRV_RestoreDC
(
PHYSDEV
dev
,
INT
level
)
{
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
get_dc_ptr
(
physDev
->
hdc
);
EMRRESTOREDC
emr
;
emr
.
emr
.
iType
=
EMR_RESTOREDC
;
...
...
@@ -42,10 +43,11 @@ BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level )
if
(
level
<
0
)
emr
.
iRelative
=
level
;
else
emr
.
iRelative
=
level
-
physDev
->
dc
->
saveLevel
-
1
;
emr
.
iRelative
=
level
-
dc
->
saveLevel
-
1
;
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
);
release_dc_ptr
(
dc
);
return
TRUE
;
}
...
...
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
View file @
f9ebe5ab
...
...
@@ -33,7 +33,6 @@
typedef
struct
{
HDC
hdc
;
DC
*
dc
;
ENHMETAHEADER
*
emh
;
/* Pointer to enhanced metafile header */
UINT
handles_size
,
cur_handles
;
HGDIOBJ
*
handles
;
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
f9ebe5ab
...
...
@@ -159,10 +159,9 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
/**********************************************************************
* EMFDRV_DeleteDC
*/
static
BOOL
EMFDRV_DeleteDC
(
PHYSDEV
dev
)
static
BOOL
EMFDRV_DeleteDC
(
DC
*
dc
)
{
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dc
->
physDev
;
UINT
index
;
if
(
physDev
->
emh
)
HeapFree
(
GetProcessHeap
(),
0
,
physDev
->
emh
);
...
...
@@ -324,7 +323,6 @@ HDC WINAPI CreateEnhMetaFileW(
}
dc
->
physDev
=
(
PHYSDEV
)
physDev
;
physDev
->
hdc
=
dc
->
hSelf
;
physDev
->
dc
=
dc
;
if
(
description
)
{
/* App name\0Title\0\0 */
length
=
lstrlenW
(
description
);
...
...
@@ -405,11 +403,11 @@ HDC WINAPI CreateEnhMetaFileW(
{
if
((
hFile
=
CreateFileW
(
filename
,
GENERIC_WRITE
|
GENERIC_READ
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
EMFDRV_DeleteDC
(
dc
->
physDev
);
EMFDRV_DeleteDC
(
dc
);
return
0
;
}
if
(
!
WriteFile
(
hFile
,
(
LPSTR
)
physDev
->
emh
,
size
,
NULL
,
NULL
))
{
EMFDRV_DeleteDC
(
dc
->
physDev
);
EMFDRV_DeleteDC
(
dc
);
return
0
;
}
physDev
->
hFile
=
hFile
;
...
...
@@ -479,7 +477,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
if
(
SetFilePointer
(
physDev
->
hFile
,
0
,
NULL
,
FILE_BEGIN
)
!=
0
)
{
CloseHandle
(
physDev
->
hFile
);
EMFDRV_DeleteDC
(
dc
->
physDev
);
EMFDRV_DeleteDC
(
dc
);
return
0
;
}
...
...
@@ -487,7 +485,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
sizeof
(
*
physDev
->
emh
),
NULL
,
NULL
))
{
CloseHandle
(
physDev
->
hFile
);
EMFDRV_DeleteDC
(
dc
->
physDev
);
EMFDRV_DeleteDC
(
dc
);
return
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
physDev
->
emh
);
...
...
@@ -502,6 +500,6 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
hmf
=
EMF_Create_HENHMETAFILE
(
physDev
->
emh
,
(
physDev
->
hFile
!=
0
)
);
physDev
->
emh
=
NULL
;
/* So it won't be deleted */
EMFDRV_DeleteDC
(
dc
->
physDev
);
EMFDRV_DeleteDC
(
dc
);
return
hmf
;
}
dlls/gdi32/mfdrv/init.c
View file @
f9ebe5ab
...
...
@@ -175,7 +175,6 @@ static DC *MFDRV_AllocMetaFile(void)
}
dc
->
physDev
=
(
PHYSDEV
)
physDev
;
physDev
->
hdc
=
dc
->
hSelf
;
physDev
->
dc
=
dc
;
if
(
!
(
physDev
->
mh
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
physDev
->
mh
)
)))
{
...
...
@@ -204,10 +203,9 @@ static DC *MFDRV_AllocMetaFile(void)
/**********************************************************************
* MFDRV_DeleteDC
*/
static
BOOL
MFDRV_DeleteDC
(
PHYSDEV
dev
)
static
BOOL
MFDRV_DeleteDC
(
DC
*
dc
)
{
METAFILEDRV_PDEVICE
*
physDev
=
(
METAFILEDRV_PDEVICE
*
)
dev
;
DC
*
dc
=
physDev
->
dc
;
METAFILEDRV_PDEVICE
*
physDev
=
(
METAFILEDRV_PDEVICE
*
)
dc
->
physDev
;
DWORD
index
;
HeapFree
(
GetProcessHeap
(),
0
,
physDev
->
mh
);
...
...
@@ -251,12 +249,12 @@ HDC WINAPI CreateMetaFileW( LPCWSTR filename )
physDev
->
mh
->
mtType
=
METAFILE_DISK
;
if
((
hFile
=
CreateFileW
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
0
;
}
if
(
!
WriteFile
(
hFile
,
physDev
->
mh
,
sizeof
(
*
physDev
->
mh
),
NULL
,
NULL
))
{
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
0
;
}
physDev
->
hFile
=
hFile
;
...
...
@@ -328,21 +326,21 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
if
(
!
MFDRV_MetaParam0
(
dc
->
physDev
,
META_EOF
))
{
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
0
;
}
if
(
physDev
->
mh
->
mtType
==
METAFILE_DISK
)
/* disk based metafile */
{
if
(
SetFilePointer
(
physDev
->
hFile
,
0
,
NULL
,
FILE_BEGIN
)
!=
0
)
{
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
0
;
}
physDev
->
mh
->
mtType
=
METAFILE_MEMORY
;
/* This is what windows does */
if
(
!
WriteFile
(
physDev
->
hFile
,
(
LPSTR
)
physDev
->
mh
,
sizeof
(
*
physDev
->
mh
),
NULL
,
NULL
))
{
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
0
;
}
CloseHandle
(
physDev
->
hFile
);
...
...
@@ -394,7 +392,7 @@ HMETAFILE16 WINAPI CloseMetaFile16(HDC16 hdc)
hmf
=
MF_Create_HMETAFILE16
(
physDev
->
mh
);
physDev
->
mh
=
NULL
;
/* So it won't be deleted */
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
hmf
;
}
...
...
@@ -423,7 +421,7 @@ HMETAFILE WINAPI CloseMetaFile(HDC hdc)
hmf
=
MF_Create_HMETAFILE
(
physDev
->
mh
);
physDev
->
mh
=
NULL
;
/* So it won't be deleted */
MFDRV_DeleteDC
(
dc
->
physDev
);
MFDRV_DeleteDC
(
dc
);
return
hmf
;
}
...
...
dlls/gdi32/mfdrv/metafiledrv.h
View file @
f9ebe5ab
...
...
@@ -33,7 +33,6 @@
typedef
struct
{
HDC
hdc
;
DC
*
dc
;
METAHEADER
*
mh
;
/* Pointer to metafile header */
UINT
handles_size
,
cur_handles
;
HGDIOBJ
*
handles
;
...
...
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