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
d9d99834
Commit
d9d99834
authored
Feb 07, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement IShellImageData::Decode() when created from file path.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f04b66e6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
4 deletions
+52
-4
Makefile.in
dlls/shell32/Makefile.in
+1
-1
shellole.c
dlls/shell32/shellole.c
+43
-2
shimgdata.idl
include/shimgdata.idl
+8
-1
No files found.
dlls/shell32/Makefile.in
View file @
d9d99834
...
...
@@ -2,7 +2,7 @@ EXTRADEFS = -D_SHELL32_
MODULE
=
shell32.dll
IMPORTLIB
=
shell32
IMPORTS
=
uuid shlwapi user32 gdi32 advapi32
DELAYIMPORTS
=
ole32 oleaut32 shdocvw version comctl32
DELAYIMPORTS
=
ole32 oleaut32 shdocvw version comctl32
gdiplus
EXTRALIBS
=
$(CORESERVICES_LIBS)
# AUTHORS file is in the top-level directory
EXTRAINCL
=
-I
$(top_srcdir)
...
...
dlls/shell32/shellole.c
View file @
d9d99834
...
...
@@ -36,6 +36,7 @@
#include "shlobj.h"
#include "shlguid.h"
#include "shldisp.h"
#include "gdiplus.h"
#include "shimgdata.h"
#include "winreg.h"
#include "winerror.h"
...
...
@@ -811,6 +812,23 @@ HRESULT WINAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker **moniker)
return
CreateClassMoniker
(
&
CLSID_QueryCancelAutoPlay
,
moniker
);
}
static
HRESULT
gpstatus_to_hresult
(
GpStatus
status
)
{
switch
(
status
)
{
case
Ok
:
return
S_OK
;
case
InvalidParameter
:
return
E_INVALIDARG
;
case
OutOfMemory
:
return
E_OUTOFMEMORY
;
case
NotImplemented
:
return
E_NOTIMPL
;
default:
return
E_FAIL
;
}
}
/* IShellImageData */
typedef
struct
{
...
...
@@ -818,6 +836,7 @@ typedef struct
LONG
ref
;
WCHAR
*
path
;
GpImage
*
image
;
}
ShellImageData
;
static
inline
ShellImageData
*
impl_from_IShellImageData
(
IShellImageData
*
iface
)
...
...
@@ -861,6 +880,7 @@ static ULONG WINAPI ShellImageData_Release(IShellImageData *iface)
if
(
!
ref
)
{
GdipDisposeImage
(
This
->
image
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
path
);
SHFree
(
This
);
}
...
...
@@ -871,10 +891,30 @@ static ULONG WINAPI ShellImageData_Release(IShellImageData *iface)
static
HRESULT
WINAPI
ShellImageData_Decode
(
IShellImageData
*
iface
,
DWORD
flags
,
ULONG
cx_desired
,
ULONG
cy_desired
)
{
ShellImageData
*
This
=
impl_from_IShellImageData
(
iface
);
GpImage
*
image
;
HRESULT
hr
;
FIXME
(
"%p, %#x, %u, %u: stub
\n
"
,
This
,
flags
,
cx_desired
,
cy_desired
);
TRACE
(
"%p, %#x, %u, %u
\n
"
,
This
,
flags
,
cx_desired
,
cy_desired
);
return
E_NOTIMPL
;
if
(
This
->
image
)
return
S_FALSE
;
if
(
flags
&
SHIMGDEC_LOADFULL
)
FIXME
(
"LOADFULL flag ignored
\n
"
);
hr
=
gpstatus_to_hresult
(
GdipLoadImageFromFile
(
This
->
path
,
&
image
));
if
(
FAILED
(
hr
))
return
hr
;
if
(
flags
&
SHIMGDEC_THUMBNAIL
)
{
hr
=
gpstatus_to_hresult
(
GdipGetImageThumbnail
(
image
,
cx_desired
,
cy_desired
,
&
This
->
image
,
NULL
,
NULL
));
GdipDisposeImage
(
image
);
}
else
This
->
image
=
image
;
return
hr
;
}
static
HRESULT
WINAPI
ShellImageData_Draw
(
IShellImageData
*
iface
,
HDC
hdc
,
RECT
*
dest
,
RECT
*
src
)
...
...
@@ -1186,6 +1226,7 @@ static HRESULT create_shellimagedata_from_path(const WCHAR *path, IShellImageDat
This
->
ref
=
1
;
This
->
path
=
strdupW
(
path
);
This
->
image
=
NULL
;
*
data
=
&
This
->
IShellImageData_iface
;
return
S_OK
;
...
...
include/shimgdata.idl
View file @
d9d99834
...
...
@@ -27,11 +27,18 @@ cpp_quote("#ifndef _GDIPLUSENUMS_H")
typedef
DWORD
InterpolationMode
;
cpp_quote
(
"#endif"
)
cpp_quote
(
"#ifndef _GDIPLUS
HEADERS
_H"
)
cpp_quote
(
"#ifndef _GDIPLUS
IMAGING
_H"
)
typedef
BYTE
EncoderParameters
;
cpp_quote
(
"#endif"
)
cpp_quote
(
"#ifndef _GDIPLUSHEADERS_H"
)
typedef
BYTE
Image
;
cpp_quote
(
"#endif"
)
cpp_quote
(
"#define SHIMGDEC_DEFAULT 0x0"
)
cpp_quote
(
"#define SHIMGDEC_THUMBNAIL 0x1"
)
cpp_quote
(
"#define SHIMGDEC_LOADFULL 0x2"
)
[
object
,
uuid
(
53
fb8e58
-
50
c0
-
4003
-
b4aa
-
0
c8df28e7f3a
)
...
...
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