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
506ab8bc
Commit
506ab8bc
authored
Jan 13, 2004
by
Vincent Béron
Committed by
Alexandre Julliard
Jan 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a W->A cross-call (CopyMetaFileW->CopyMetaFileA).
parent
9d79df90
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
metafile.c
objects/metafile.c
+24
-16
No files found.
objects/metafile.c
View file @
506ab8bc
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
#include "wine/wingdi16.h"
#include "wine/wingdi16.h"
#include "bitmap.h"
#include "bitmap.h"
#include "wownt32.h"
#include "wownt32.h"
#include "winreg.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
metafile
);
WINE_DEFAULT_DEBUG_CHANNEL
(
metafile
);
...
@@ -418,7 +420,7 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
...
@@ -418,7 +420,7 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
/******************************************************************
/******************************************************************
* CopyMetaFile
A
(GDI32.@)
* CopyMetaFile
W
(GDI32.@)
*
*
* Copies the metafile corresponding to hSrcMetaFile to either
* Copies the metafile corresponding to hSrcMetaFile to either
* a disk file, if a filename is given, or to a new memory based
* a disk file, if a filename is given, or to a new memory based
...
@@ -432,15 +434,15 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
...
@@ -432,15 +434,15 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
*
*
* Copying to disk returns NULL even if successful.
* Copying to disk returns NULL even if successful.
*/
*/
HMETAFILE
WINAPI
CopyMetaFile
A
(
HMETAFILE
WINAPI
CopyMetaFile
W
(
HMETAFILE
hSrcMetaFile
,
/* [in] handle of metafile to copy */
HMETAFILE
hSrcMetaFile
,
/* [in] handle of metafile to copy */
LPC
STR
lpFilename
/* [in] filename if copying to a file */
LPC
WSTR
lpFilename
/* [in] filename if copying to a file */
)
{
)
{
METAHEADER
*
mh
=
MF_GetMetaHeader
(
hSrcMetaFile
);
METAHEADER
*
mh
=
MF_GetMetaHeader
(
hSrcMetaFile
);
METAHEADER
*
mh2
=
NULL
;
METAHEADER
*
mh2
=
NULL
;
HANDLE
hFile
;
HANDLE
hFile
;
TRACE
(
"(%p,%s)
\n
"
,
hSrcMetaFile
,
lpFilename
);
TRACE
(
"(%p,%s)
\n
"
,
hSrcMetaFile
,
debugstr_w
(
lpFilename
)
);
if
(
!
mh
)
return
0
;
if
(
!
mh
)
return
0
;
...
@@ -452,14 +454,20 @@ HMETAFILE WINAPI CopyMetaFileA(
...
@@ -452,14 +454,20 @@ HMETAFILE WINAPI CopyMetaFileA(
}
}
if
(
lpFilename
)
{
/* disk based metafile */
if
(
lpFilename
)
{
/* disk based metafile */
if
((
hFile
=
CreateFileA
(
lpFilename
,
GENERIC_WRITE
,
0
,
NULL
,
DWORD
len
;
LPSTR
lpFilenameA
;
if
((
hFile
=
CreateFileW
(
lpFilename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mh2
);
HeapFree
(
GetProcessHeap
(),
0
,
mh2
);
return
0
;
return
0
;
}
}
WriteFile
(
hFile
,
mh2
,
mh2
->
mtSize
*
2
,
NULL
,
NULL
);
WriteFile
(
hFile
,
mh2
,
mh2
->
mtSize
*
2
,
NULL
,
NULL
);
CloseHandle
(
hFile
);
CloseHandle
(
hFile
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilename
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
lpFilenameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
lpFilenameA
,
len
,
NULL
,
NULL
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilenameA
);
HeapFree
(
GetProcessHeap
(),
0
,
lpFilenameA
);
}
}
return
MF_Create_HMETAFILE
(
mh2
);
return
MF_Create_HMETAFILE
(
mh2
);
...
@@ -467,21 +475,21 @@ HMETAFILE WINAPI CopyMetaFileA(
...
@@ -467,21 +475,21 @@ HMETAFILE WINAPI CopyMetaFileA(
/******************************************************************
/******************************************************************
* CopyMetaFile
W
(GDI32.@)
* CopyMetaFile
A
(GDI32.@)
*/
*/
HMETAFILE
WINAPI
CopyMetaFile
W
(
HMETAFILE
hSrcMetaFile
,
HMETAFILE
WINAPI
CopyMetaFile
A
(
HMETAFILE
hSrcMetaFile
,
LPC
W
STR
lpFilename
)
LPCSTR
lpFilename
)
{
{
UNICODE_STRING
lpFilenameW
;
HMETAFILE
ret
=
0
;
HMETAFILE
ret
=
0
;
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
LPSTR
p
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
p
)
if
(
lpFilename
)
RtlCreateUnicodeStringFromAsciiz
(
&
lpFilenameW
,
lpFilename
);
{
else
lpFilenameW
.
Buffer
=
NULL
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
p
,
len
,
NULL
,
NULL
);
ret
=
CopyMetaFileA
(
hSrcMetaFile
,
p
);
if
(
lpFilenameW
.
Buffer
)
{
HeapFree
(
GetProcessHeap
(),
0
,
p
);
ret
=
CopyMetaFileW
(
hSrcMetaFile
,
lpFilenameW
.
Buffer
);
}
}
RtlFreeUnicodeString
(
&
lpFilenameW
);
return
ret
;
return
ret
;
}
}
...
...
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