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
b6d50aed
Commit
b6d50aed
authored
Dec 10, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Added PICTYPE_NONE and PICTYPE_UNINITIALIZED to IPicture::Render.
parent
a19051b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
olepicture.c
dlls/oleaut32/olepicture.c
+8
-0
olepicture.c
dlls/oleaut32/tests/olepicture.c
+65
-0
No files found.
dlls/oleaut32/olepicture.c
View file @
b6d50aed
...
@@ -637,6 +637,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
...
@@ -637,6 +637,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
TRACE
(
"prcWBounds (%d,%d) - (%d,%d)
\n
"
,
prcWBounds
->
left
,
prcWBounds
->
top
,
TRACE
(
"prcWBounds (%d,%d) - (%d,%d)
\n
"
,
prcWBounds
->
left
,
prcWBounds
->
top
,
prcWBounds
->
right
,
prcWBounds
->
bottom
);
prcWBounds
->
right
,
prcWBounds
->
bottom
);
if
(
cx
==
0
||
cy
==
0
||
cxSrc
==
0
||
cySrc
==
0
){
return
CTL_E_INVALIDPROPERTYVALUE
;
}
/*
/*
* While the documentation suggests this to be here (or after rendering?)
* While the documentation suggests this to be here (or after rendering?)
* it does cause an endless recursion in my sample app. -MM 20010804
* it does cause an endless recursion in my sample app. -MM 20010804
...
@@ -644,6 +648,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
...
@@ -644,6 +648,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
*/
*/
switch
(
This
->
desc
.
picType
)
{
switch
(
This
->
desc
.
picType
)
{
case
PICTYPE_UNINITIALIZED
:
case
PICTYPE_NONE
:
/* nothing to do */
return
S_OK
;
case
PICTYPE_BITMAP
:
case
PICTYPE_BITMAP
:
{
{
HBITMAP
hbmpOld
;
HBITMAP
hbmpOld
;
...
...
dlls/oleaut32/tests/olepicture.c
View file @
b6d50aed
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <float.h>
#include <float.h>
#define COBJMACROS
#define COBJMACROS
#define NONAMELESSUNION
#include "wine/test.h"
#include "wine/test.h"
#include <windef.h>
#include <windef.h>
...
@@ -587,6 +588,69 @@ static void test_enhmetafile(void)
...
@@ -587,6 +588,69 @@ static void test_enhmetafile(void)
GlobalFree
(
hglob
);
GlobalFree
(
hglob
);
}
}
static
void
test_Render
(
void
)
{
IPicture
*
pic
;
HRESULT
hres
;
short
type
;
PICTDESC
desc
;
HDC
hdc
=
GetDC
(
0
);
/* test IPicture::Render return code on uninitialized picture */
OleCreatePictureIndirect
(
NULL
,
&
IID_IPicture
,
TRUE
,
(
VOID
**
)
&
pic
);
hres
=
IPicture_get_Type
(
pic
,
&
type
);
ok
(
hres
==
S_OK
,
"IPicture_get_Type does not return S_OK, but 0x%08x
\n
"
,
hres
);
ok
(
type
==
PICTYPE_UNINITIALIZED
,
"Expected type = PICTYPE_UNINITIALIZED, got = %d
\n
"
,
type
);
/* zero dimensions */
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
10
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
0
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
0
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
10
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
0
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
/* nonzero dimensions, PICTYPE_UNINITIALIZED */
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
S_OK
);
IPicture_Release
(
pic
);
desc
.
cbSizeofstruct
=
sizeof
(
PICTDESC
);
desc
.
picType
=
PICTYPE_ICON
;
desc
.
u
.
icon
.
hicon
=
LoadIcon
(
NULL
,
IDI_APPLICATION
);
if
(
!
desc
.
u
.
icon
.
hicon
){
win_skip
(
"LoadIcon failed. Skipping...
\n
"
);
ReleaseDC
(
NULL
,
hdc
);
return
;
}
OleCreatePictureIndirect
(
&
desc
,
&
IID_IPicture
,
TRUE
,
(
VOID
**
)
&
pic
);
/* zero dimensions, PICTYPE_ICON */
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
10
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
0
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
10
,
0
,
0
,
0
,
0
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
10
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
10
,
0
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
hres
=
IPicture_Render
(
pic
,
hdc
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
10
,
NULL
);
ole_expect
(
hres
,
CTL_E_INVALIDPROPERTYVALUE
);
IPicture_Release
(
pic
);
ReleaseDC
(
NULL
,
hdc
);
}
START_TEST
(
olepicture
)
START_TEST
(
olepicture
)
{
{
hOleaut32
=
GetModuleHandleA
(
"oleaut32.dll"
);
hOleaut32
=
GetModuleHandleA
(
"oleaut32.dll"
);
...
@@ -613,6 +677,7 @@ START_TEST(olepicture)
...
@@ -613,6 +677,7 @@ START_TEST(olepicture)
test_Invoke
();
test_Invoke
();
test_OleCreatePictureIndirect
();
test_OleCreatePictureIndirect
();
test_Render
();
}
}
...
...
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