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
8e7a0411
Commit
8e7a0411
authored
Dec 01, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Simplify drag drop helper object creation.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
794efcce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
39 deletions
+56
-39
dragdrophelper.c
dlls/shell32/dragdrophelper.c
+35
-39
shellole.c
dlls/shell32/tests/shellole.c
+21
-0
No files found.
dlls/shell32/dragdrophelper.c
View file @
8e7a0411
...
...
@@ -52,43 +52,12 @@ typedef struct {
LONG
ref
;
}
IDropTargetHelperImpl
;
static
const
IDropTargetHelperVtbl
vt_IDropTargetHelper
;
static
inline
IDropTargetHelperImpl
*
impl_from_IDropTargetHelper
(
IDropTargetHelper
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDropTargetHelperImpl
,
IDropTargetHelper_iface
);
}
/**************************************************************************
* IDropTargetHelper_Constructor
*/
HRESULT
WINAPI
IDropTargetHelper_Constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
LPVOID
*
ppv
)
{
IDropTargetHelperImpl
*
dth
;
TRACE
(
"unkOut=%p %s
\n
"
,
pUnkOuter
,
shdebugstr_guid
(
riid
));
if
(
!
ppv
)
return
E_POINTER
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
dth
=
LocalAlloc
(
LMEM_ZEROINIT
,
sizeof
(
IDropTargetHelperImpl
));
if
(
!
dth
)
return
E_OUTOFMEMORY
;
dth
->
ref
=
0
;
dth
->
IDropTargetHelper_iface
.
lpVtbl
=
&
vt_IDropTargetHelper
;
if
(
FAILED
(
IDropTargetHelper_QueryInterface
(
&
dth
->
IDropTargetHelper_iface
,
riid
,
ppv
)))
{
LocalFree
(
dth
);
return
E_NOINTERFACE
;
}
TRACE
(
"--(%p)
\n
"
,
dth
);
return
S_OK
;
}
/**************************************************************************
* IDropTargetHelper_fnQueryInterface
*/
static
HRESULT
WINAPI
IDropTargetHelper_fnQueryInterface
(
IDropTargetHelper
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
...
...
@@ -179,12 +148,39 @@ static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL
static
const
IDropTargetHelperVtbl
vt_IDropTargetHelper
=
{
IDropTargetHelper_fnQueryInterface
,
IDropTargetHelper_fnAddRef
,
IDropTargetHelper_fnRelease
,
IDropTargetHelper_fnDragEnter
,
IDropTargetHelper_fnDragLeave
,
IDropTargetHelper_fnDragOver
,
IDropTargetHelper_fnDrop
,
IDropTargetHelper_fnShow
IDropTargetHelper_fnQueryInterface
,
IDropTargetHelper_fnAddRef
,
IDropTargetHelper_fnRelease
,
IDropTargetHelper_fnDragEnter
,
IDropTargetHelper_fnDragLeave
,
IDropTargetHelper_fnDragOver
,
IDropTargetHelper_fnDrop
,
IDropTargetHelper_fnShow
};
/**************************************************************************
* IDropTargetHelper_Constructor
*/
HRESULT
WINAPI
IDropTargetHelper_Constructor
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
LPVOID
*
ppv
)
{
IDropTargetHelperImpl
*
dth
;
HRESULT
hr
;
TRACE
(
"outer=%p %s %p
\n
"
,
pUnkOuter
,
shdebugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
dth
=
LocalAlloc
(
LMEM_ZEROINIT
,
sizeof
(
IDropTargetHelperImpl
));
if
(
!
dth
)
return
E_OUTOFMEMORY
;
dth
->
IDropTargetHelper_iface
.
lpVtbl
=
&
vt_IDropTargetHelper
;
dth
->
ref
=
1
;
hr
=
IDropTargetHelper_QueryInterface
(
&
dth
->
IDropTargetHelper_iface
,
riid
,
ppv
);
IDropTargetHelper_Release
(
&
dth
->
IDropTargetHelper_iface
);
return
hr
;
}
dlls/shell32/tests/shellole.c
View file @
8e7a0411
...
...
@@ -890,12 +890,33 @@ static void test_SHCreateSessionKey(void)
RegCloseKey
(
hkey2
);
}
static
void
test_dragdrophelper
(
void
)
{
IDropTargetHelper
*
target
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DragDropHelper
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDropTargetHelper
,
(
void
**
)
&
target
);
ok
(
hr
==
S_OK
,
"Failed to create IDropTargetHelper, %#x
\n
"
,
hr
);
IDropTargetHelper_Release
(
target
);
}
START_TEST
(
shellole
)
{
HRESULT
hr
;
init
();
hr
=
CoInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"CoInitialize failed (0x%08x)
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
test_SHPropStg_functions
();
test_SHCreateQueryCancelAutoPlayMoniker
();
test_DragQueryFile
();
test_SHCreateSessionKey
();
test_dragdrophelper
();
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