Don't define COBJMACROS in objbase.h.
[wine/multimedia.git] / dlls / shell32 / dragdrophelper.c
blobf800570843377274ebf637d9885a1e1b7fb661f7
1 /*
2 * file system folder
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
23 #include "wine/port.h"
25 #include <stdarg.h>
26 #include <string.h>
28 #define COBJMACROS
30 #include "windef.h"
31 #include "winbase.h"
32 #include "winreg.h"
33 #include "wingdi.h"
34 #include "winuser.h"
36 #include "objbase.h"
37 #include "ole2.h"
38 #include "shlguid.h"
39 #include "shlobj.h"
41 #include "wine/debug.h"
42 #include "debughlp.h"
44 WINE_DEFAULT_DEBUG_CHANNEL (shell);
46 /***********************************************************************
47 * IDropTargetHelper implementation
50 typedef struct {
51 IDropTargetHelperVtbl *lpVtbl;
52 DWORD ref;
53 } IDropTargetHelperImpl;
55 static struct IDropTargetHelperVtbl vt_IDropTargetHelper;
57 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
58 #define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl)
60 /**************************************************************************
61 * IDropTargetHelper_Constructor
63 HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
65 IDropTargetHelperImpl *dth;
67 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
69 if (!ppv)
70 return E_POINTER;
71 if (pUnkOuter)
72 return CLASS_E_NOAGGREGATION;
74 dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
75 if (!dth) return E_OUTOFMEMORY;
77 dth->ref = 0;
78 dth->lpVtbl = &vt_IDropTargetHelper;
80 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (dth), riid, ppv))) {
81 IUnknown_Release (_IUnknown_ (dth));
82 return E_NOINTERFACE;
85 TRACE ("--(%p)\n", dth);
86 return S_OK;
89 /**************************************************************************
90 * IDropTargetHelper_fnQueryInterface
92 static HRESULT WINAPI IDropTargetHelper_fnQueryInterface (IDropTargetHelper * iface, REFIID riid, LPVOID * ppvObj)
94 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
96 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
98 *ppvObj = NULL;
100 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDropTargetHelper)) {
101 *ppvObj = This;
104 if (*ppvObj) {
105 IUnknown_AddRef ((IUnknown *) (*ppvObj));
106 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
107 return S_OK;
109 FIXME ("-- Interface: E_NOINTERFACE\n");
110 return E_NOINTERFACE;
113 static ULONG WINAPI IDropTargetHelper_fnAddRef (IDropTargetHelper * iface)
115 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
117 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
119 return ++(This->ref);
122 static ULONG WINAPI IDropTargetHelper_fnRelease (IDropTargetHelper * iface)
124 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
126 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
128 if (!--(This->ref)) {
129 TRACE("-- destroying (%p)\n", This);
130 LocalFree ((HLOCAL) This);
131 return 0;
133 return This->ref;
136 static HRESULT WINAPI IDropTargetHelper_fnDragEnter (
137 IDropTargetHelper * iface,
138 HWND hwndTarget,
139 IDataObject* pDataObject,
140 POINT* ppt,
141 DWORD dwEffect)
143 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
144 FIXME ("(%p)->(%p %p %p 0x%08lx)\n", This,hwndTarget, pDataObject, ppt, dwEffect);
145 return E_NOTIMPL;
148 static HRESULT WINAPI IDropTargetHelper_fnDragLeave (IDropTargetHelper * iface)
150 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
151 FIXME ("(%p)->()\n", This);
152 return E_NOTIMPL;
155 static HRESULT WINAPI IDropTargetHelper_fnDragOver (IDropTargetHelper * iface, POINT* ppt, DWORD dwEffect)
157 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
158 FIXME ("(%p)->(%p 0x%08lx)\n", This, ppt, dwEffect);
159 return E_NOTIMPL;
162 static HRESULT WINAPI IDropTargetHelper_fnDrop (IDropTargetHelper * iface, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect)
164 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
165 FIXME ("(%p)->(%p %p 0x%08lx)\n", This, pDataObject, ppt, dwEffect);
166 return E_NOTIMPL;
169 static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL fShow)
171 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
172 FIXME ("(%p)->(%u)\n", This, fShow);
173 return E_NOTIMPL;
176 static IDropTargetHelperVtbl vt_IDropTargetHelper =
178 IDropTargetHelper_fnQueryInterface,
179 IDropTargetHelper_fnAddRef,
180 IDropTargetHelper_fnRelease,
181 IDropTargetHelper_fnDragEnter,
182 IDropTargetHelper_fnDragLeave,
183 IDropTargetHelper_fnDragOver,
184 IDropTargetHelper_fnDrop,
185 IDropTargetHelper_fnShow