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
6a8b4f11
Commit
6a8b4f11
authored
Nov 26, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix OleDraw() regarding passed rectangle handling.
parent
acb56b07
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
12 deletions
+89
-12
ole2.c
dlls/ole32/ole2.c
+2
-12
ole2.c
dlls/ole32/tests/ole2.c
+87
-0
No files found.
dlls/ole32/ole2.c
View file @
6a8b4f11
...
...
@@ -2554,7 +2554,7 @@ HRESULT WINAPI OleDraw(
IUnknown
*
pUnk
,
DWORD
dwAspect
,
HDC
hdcDraw
,
LPCRECT
lprcBounds
)
LPCRECT
rect
)
{
HRESULT
hres
;
IViewObject
*
viewobject
;
...
...
@@ -2562,24 +2562,14 @@ HRESULT WINAPI OleDraw(
hres
=
IUnknown_QueryInterface
(
pUnk
,
&
IID_IViewObject
,
(
void
**
)
&
viewobject
);
if
(
SUCCEEDED
(
hres
))
{
RECTL
rectl
;
rectl
.
left
=
lprcBounds
->
left
;
rectl
.
right
=
lprcBounds
->
right
;
rectl
.
top
=
lprcBounds
->
top
;
rectl
.
bottom
=
lprcBounds
->
bottom
;
hres
=
IViewObject_Draw
(
viewobject
,
dwAspect
,
-
1
,
0
,
0
,
0
,
hdcDraw
,
&
rectl
,
0
,
0
,
0
);
hres
=
IViewObject_Draw
(
viewobject
,
dwAspect
,
-
1
,
0
,
0
,
0
,
hdcDraw
,
(
RECTL
*
)
rect
,
0
,
0
,
0
);
IViewObject_Release
(
viewobject
);
return
hres
;
}
else
{
return
DV_E_NOIVIEWOBJECT
;
}
}
/***********************************************************************
...
...
dlls/ole32/tests/ole2.c
View file @
6a8b4f11
...
...
@@ -726,6 +726,84 @@ static IRunnableObject OleObjectRunnable = { &OleObjectRunnableVtbl };
static
const
CLSID
CLSID_Equation3
=
{
0x0002CE02
,
0x0000
,
0x0000
,
{
0xC0
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x46
}
};
static
HRESULT
WINAPI
viewobject_QueryInterface
(
IViewObject
*
iface
,
REFIID
riid
,
void
**
obj
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IViewObject
))
{
*
obj
=
iface
;
return
S_OK
;
}
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
viewobject_AddRef
(
IViewObject
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
viewobject_Release
(
IViewObject
*
iface
)
{
return
1
;
}
static
HRESULT
WINAPI
viewobject_Draw
(
IViewObject
*
iface
,
DWORD
aspect
,
LONG
index
,
void
*
paspect
,
DVTARGETDEVICE
*
ptd
,
HDC
hdcTargetDev
,
HDC
hdcDraw
,
LPCRECTL
bounds
,
LPCRECTL
wbounds
,
BOOL
(
STDMETHODCALLTYPE
*
pfnContinue
)(
ULONG_PTR
dwContinue
),
ULONG_PTR
dwContinue
)
{
ok
(
index
==
-
1
,
"index=%d
\n
"
,
index
);
return
S_OK
;
}
static
HRESULT
WINAPI
viewobject_GetColorSet
(
IViewObject
*
iface
,
DWORD
draw_aspect
,
LONG
index
,
void
*
aspect
,
DVTARGETDEVICE
*
ptd
,
HDC
hicTargetDev
,
LOGPALETTE
**
colorset
)
{
ok
(
0
,
"unexpected call GetColorSet
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
viewobject_Freeze
(
IViewObject
*
iface
,
DWORD
draw_aspect
,
LONG
index
,
void
*
aspect
,
DWORD
*
freeze
)
{
ok
(
0
,
"unexpected call Freeze
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
viewobject_Unfreeze
(
IViewObject
*
iface
,
DWORD
freeze
)
{
ok
(
0
,
"unexpected call Unfreeze
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
viewobject_SetAdvise
(
IViewObject
*
iface
,
DWORD
aspects
,
DWORD
advf
,
IAdviseSink
*
sink
)
{
ok
(
0
,
"unexpected call SetAdvise
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
viewobject_GetAdvise
(
IViewObject
*
iface
,
DWORD
*
aspects
,
DWORD
*
advf
,
IAdviseSink
**
sink
)
{
ok
(
0
,
"unexpected call GetAdvise
\n
"
);
return
E_NOTIMPL
;
}
static
const
struct
IViewObjectVtbl
viewobjectvtbl
=
{
viewobject_QueryInterface
,
viewobject_AddRef
,
viewobject_Release
,
viewobject_Draw
,
viewobject_GetColorSet
,
viewobject_Freeze
,
viewobject_Unfreeze
,
viewobject_SetAdvise
,
viewobject_GetAdvise
};
static
IViewObject
viewobject
=
{
&
viewobjectvtbl
};
static
void
test_OleCreate
(
IStorage
*
pStorage
)
{
HRESULT
hr
;
...
...
@@ -1853,6 +1931,14 @@ static void test_OleLockRunning(void)
ok
(
hr
==
S_OK
,
"OleLockRunning failed 0x%08x
\n
"
,
hr
);
}
static
void
test_OleDraw
(
void
)
{
HRESULT
hr
;
hr
=
OleDraw
((
IUnknown
*
)
&
viewobject
,
0
,
(
HDC
)
0x1
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
}
START_TEST
(
ole2
)
{
DWORD
dwRegister
;
...
...
@@ -1889,6 +1975,7 @@ START_TEST(ole2)
test_default_handler
();
test_runnable
();
test_OleLockRunning
();
test_OleDraw
();
CoUninitialize
();
}
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