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
91fde249
Commit
91fde249
authored
Dec 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole2: Reimplement OleMetafilePictFromIconAndLabel16 on top of the 32-bit version.
parent
55f024af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
33 deletions
+36
-33
ole2.c
dlls/ole2.dll16/ole2.c
+35
-32
ole2.dll16.spec
dlls/ole2.dll16/ole2.dll16.spec
+1
-1
No files found.
dlls/ole2.dll16/ole2.c
View file @
91fde249
...
...
@@ -50,7 +50,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define HICON_16(h32) (LOWORD(h32))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
/******************************************************************************
* OleBuildVersion (OLE2.1)
...
...
@@ -124,49 +123,53 @@ HRESULT WINAPI RevokeDragDrop16(
* If no hIcon is given, we load the icon via lpszSourceFile and iIconIndex.
* This code might be wrong at some places.
*/
HGLOBAL16
WINAPI
OleMeta
F
ilePictFromIconAndLabel16
(
HGLOBAL16
WINAPI
OleMeta
f
ilePictFromIconAndLabel16
(
HICON16
hIcon
,
LPCOLESTR16
lpszLabel
,
LPCOLESTR16
lpszSourceFile
,
UINT16
iIconIndex
)
{
METAFILEPICT16
*
mf16
;
METAFILEPICT
*
pict
;
HGLOBAL
hmf
;
HGLOBAL16
hmf16
;
HMETAFILE
hmf
;
INT
mfSize
;
HDC
hdc
;
if
(
!
hIcon
)
{
if
(
lpszSourceFile
)
{
HINSTANCE16
hInstance
=
LoadLibrary16
(
lpszSourceFile
);
/* load the icon at index from lpszSourceFile */
hIcon
=
HICON_16
(
LoadIconA
(
HINSTANCE_32
(
hInstance
),
(
LPCSTR
)(
DWORD
)
iIconIndex
));
FreeLibrary16
(
hInstance
);
}
else
return
0
;
}
LPWSTR
label
=
NULL
,
source
=
NULL
;
DWORD
len
;
FIXME
(
"(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !
\n
"
,
hIcon
,
lpszLabel
,
lpszSourceFile
,
iIconIndex
);
if
(
lpszLabel
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszLabel
,
-
1
,
NULL
,
0
);
label
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszLabel
,
-
1
,
label
,
len
);
}
if
(
lpszSourceFile
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszSourceFile
,
-
1
,
NULL
,
0
);
source
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszSourceFile
,
-
1
,
source
,
len
);
}
hmf
=
OleMetafilePictFromIconAndLabel
(
HICON_32
(
hIcon
),
label
,
source
,
iIconIndex
);
HeapFree
(
GetProcessHeap
(),
0
,
label
);
HeapFree
(
GetProcessHeap
(),
0
,
source
);
hdc
=
CreateMetaFileW
(
NULL
);
DrawIcon
(
hdc
,
0
,
0
,
HICON_32
(
hIcon
));
/* FIXME */
TextOutA
(
hdc
,
0
,
0
,
lpszLabel
,
1
);
/* FIXME */
hmf
=
CloseMetaFile
(
hdc
);
if
(
!
hmf
)
return
0
;
pict
=
GlobalLock
(
hmf
);
hmf16
=
GlobalAlloc16
(
0
,
sizeof
(
METAFILEPICT16
));
mf16
=
GlobalLock16
(
hmf16
);
mf16
->
mm
=
MM_ANISOTROPIC
;
mf16
->
xExt
=
20
;
/* FIXME: bogus */
mf16
->
yExt
=
20
;
/* ditto */
mfSize
=
GetMetaFileBitsEx
(
hmf
,
0
,
0
);
mf16
->
hMF
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
mfSize
);
if
(
mf16
->
hMF
)
if
(
hmf16
)
{
GetMetaFileBitsEx
(
hmf
,
mfSize
,
GlobalLock16
(
mf16
->
hMF
));
GlobalUnlock16
(
mf16
->
hMF
);
METAFILEPICT16
*
pict16
=
GlobalLock16
(
hmf16
);
pict16
->
mm
=
pict
->
mm
;
pict16
->
xExt
=
pict
->
xExt
;
pict16
->
yExt
=
pict
->
yExt
;
len
=
GetMetaFileBitsEx
(
pict
->
hMF
,
0
,
0
);
pict16
->
hMF
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
len
);
GetMetaFileBitsEx
(
pict
->
hMF
,
len
,
GlobalLock16
(
pict16
->
hMF
)
);
GlobalUnlock16
(
pict16
->
hMF
);
GlobalUnlock16
(
hmf16
);
}
DeleteMetaFile
(
pict
->
hMF
);
GlobalUnlock
(
hmf
);
GlobalFree
(
hmf
);
return
hmf16
;
}
...
...
dlls/ole2.dll16/ole2.dll16.spec
View file @
91fde249
...
...
@@ -53,7 +53,7 @@
53 stub OLEGETICONOFCLASS
54 pascal CreateILockBytesOnHGlobal(word word ptr) CreateILockBytesOnHGlobal16
55 stub GETHGLOBALFROMILOCKBYTES
56 pascal -ret16 OleMeta
FilePictFromIconAndLabel(word str str word) OleMetaF
ilePictFromIconAndLabel16
56 pascal -ret16 OleMeta
filePictFromIconAndLabel(word str str word) OleMetaf
ilePictFromIconAndLabel16
57 stub GETCLASSFILE
58 stub OLEDRAW
59 stub OLECREATEDEFAULTHANDLER
...
...
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