Removed some uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / shell32 / dragdrophelper.c
blobe2eeef8b97746a91675b49ddb93165155ad61dc6
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 #include "windef.h"
29 #include "winbase.h"
30 #include "winreg.h"
31 #include "wingdi.h"
32 #include "winuser.h"
34 #include "objbase.h"
35 #include "ole2.h"
36 #include "shlguid.h"
37 #include "shlobj.h"
39 #include "wine/debug.h"
40 #include "debughlp.h"
42 WINE_DEFAULT_DEBUG_CHANNEL (shell);
44 /***********************************************************************
45 * IDropTargetHelper implementation
48 typedef struct {
49 IDropTargetHelperVtbl *lpVtbl;
50 DWORD ref;
51 } IDropTargetHelperImpl;
53 static struct IDropTargetHelperVtbl vt_IDropTargetHelper;
55 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
56 #define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl)
58 /**************************************************************************
59 * IDropTargetHelper_Constructor
61 HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
63 IDropTargetHelperImpl *dth;
65 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
67 if (!ppv)
68 return E_POINTER;
69 if (pUnkOuter)
70 return CLASS_E_NOAGGREGATION;
72 dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
73 if (!dth) return E_OUTOFMEMORY;
75 dth->ref = 0;
76 dth->lpVtbl = &vt_IDropTargetHelper;
78 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (dth), riid, ppv))) {
79 IUnknown_Release (_IUnknown_ (dth));
80 return E_NOINTERFACE;
83 TRACE ("--(%p)\n", dth);
84 return S_OK;
87 /**************************************************************************
88 * IDropTargetHelper_fnQueryInterface
90 static HRESULT WINAPI IDropTargetHelper_fnQueryInterface (IDropTargetHelper * iface, REFIID riid, LPVOID * ppvObj)
92 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
94 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
96 *ppvObj = NULL;
98 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDropTargetHelper)) {
99 *ppvObj = This;
102 if (*ppvObj) {
103 IUnknown_AddRef ((IUnknown *) (*ppvObj));
104 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
105 return S_OK;
107 FIXME ("-- Interface: E_NOINTERFACE\n");
108 return E_NOINTERFACE;
111 static ULONG WINAPI IDropTargetHelper_fnAddRef (IDropTargetHelper * iface)
113 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
115 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
117 return ++(This->ref);
120 static ULONG WINAPI IDropTargetHelper_fnRelease (IDropTargetHelper * iface)
122 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
124 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
126 if (!--(This->ref)) {
127 TRACE("-- destroying (%p)\n", This);
128 LocalFree ((HLOCAL) This);
129 return 0;
131 return This->ref;
134 static HRESULT WINAPI IDropTargetHelper_fnDragEnter (
135 IDropTargetHelper * iface,
136 HWND hwndTarget,
137 IDataObject* pDataObject,
138 POINT* ppt,
139 DWORD dwEffect)
141 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
142 FIXME ("(%p)->(%p %p %p 0x%08lx)\n", This,hwndTarget, pDataObject, ppt, dwEffect);
143 return E_NOTIMPL;
146 static HRESULT WINAPI IDropTargetHelper_fnDragLeave (IDropTargetHelper * iface)
148 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
149 FIXME ("(%p)->()\n", This);
150 return E_NOTIMPL;
153 static HRESULT WINAPI IDropTargetHelper_fnDragOver (IDropTargetHelper * iface, POINT* ppt, DWORD dwEffect)
155 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
156 FIXME ("(%p)->(%p 0x%08lx)\n", This, ppt, dwEffect);
157 return E_NOTIMPL;
160 static HRESULT WINAPI IDropTargetHelper_fnDrop (IDropTargetHelper * iface, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect)
162 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
163 FIXME ("(%p)->(%p %p 0x%08lx)\n", This, pDataObject, ppt, dwEffect);
164 return E_NOTIMPL;
167 static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL fShow)
169 IDropTargetHelperImpl *This = (IDropTargetHelperImpl *)iface;
170 FIXME ("(%p)->(%u)\n", This, fShow);
171 return E_NOTIMPL;
174 static IDropTargetHelperVtbl vt_IDropTargetHelper =
176 IDropTargetHelper_fnQueryInterface,
177 IDropTargetHelper_fnAddRef,
178 IDropTargetHelper_fnRelease,
179 IDropTargetHelper_fnDragEnter,
180 IDropTargetHelper_fnDragLeave,
181 IDropTargetHelper_fnDragOver,
182 IDropTargetHelper_fnDrop,
183 IDropTargetHelper_fnShow