Warn if open_count is already 0 when OSS_CloseDevice is called.
[wine/hacks.git] / dlls / shell32 / dragdrophelper.c
blob5e264d513cd1231d44872f8b03d06ad27df51eb9
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 <string.h>
27 #include "winbase.h"
28 #include "winreg.h"
30 #include "objbase.h"
31 #include "ole2.h"
32 #include "shlguid.h"
34 #include "wine/obj_dragdrophelper.h"
35 #include "wine/debug.h"
36 #include "debughlp.h"
38 WINE_DEFAULT_DEBUG_CHANNEL (shell);
40 /***********************************************************************
41 * IDropTargetHelper implementation
44 typedef struct {
45 ICOM_VFIELD (IDropTargetHelper);
46 DWORD ref;
47 } IDropTargetHelperImpl;
49 static struct ICOM_VTABLE (IDropTargetHelper) vt_IDropTargetHelper;
51 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
52 #define _IDropTargetHelper_(This) (IDropTargetHelper*)&(This->lpVtbl)
54 /**************************************************************************
55 * IDropTargetHelper_Constructor
57 HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
59 IDropTargetHelperImpl *dth;
61 TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
63 if (!ppv)
64 return E_POINTER;
65 if (pUnkOuter)
66 return CLASS_E_NOAGGREGATION;
68 dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
69 if (!dth) return E_OUTOFMEMORY;
71 dth->ref = 0;
72 ICOM_VTBL (dth) = &vt_IDropTargetHelper;
74 if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (dth), riid, ppv))) {
75 IUnknown_Release (_IUnknown_ (dth));
76 return E_NOINTERFACE;
79 TRACE ("--(%p)\n", dth);
80 return S_OK;
83 /**************************************************************************
84 * IDropTargetHelper_fnQueryInterface
86 static HRESULT WINAPI IDropTargetHelper_fnQueryInterface (IDropTargetHelper * iface, REFIID riid, LPVOID * ppvObj)
88 ICOM_THIS (IDropTargetHelperImpl, iface);
90 TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
92 *ppvObj = NULL;
94 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IDropTargetHelper)) {
95 *ppvObj = This;
98 if (*ppvObj) {
99 IUnknown_AddRef ((IUnknown *) (*ppvObj));
100 TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
101 return S_OK;
103 FIXME ("-- Interface: E_NOINTERFACE\n");
104 return E_NOINTERFACE;
107 static ULONG WINAPI IDropTargetHelper_fnAddRef (IDropTargetHelper * iface)
109 ICOM_THIS (IDropTargetHelperImpl, iface);
111 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
113 return ++(This->ref);
116 static ULONG WINAPI IDropTargetHelper_fnRelease (IDropTargetHelper * iface)
118 ICOM_THIS (IDropTargetHelperImpl, iface);
120 TRACE ("(%p)->(count=%lu)\n", This, This->ref);
122 if (!--(This->ref)) {
123 TRACE("-- destroying (%p)\n", This);
124 LocalFree ((HLOCAL) This);
125 return 0;
127 return This->ref;
130 static HRESULT WINAPI IDropTargetHelper_fnDragEnter (
131 IDropTargetHelper * iface,
132 HWND hwndTarget,
133 IDataObject* pDataObject,
134 POINT* ppt,
135 DWORD dwEffect)
137 ICOM_THIS (IDropTargetHelperImpl, iface);
138 FIXME ("(%p)->(%p %p %p 0x%08lx)\n", This,hwndTarget, pDataObject, ppt, dwEffect);
139 return E_NOTIMPL;
142 static HRESULT WINAPI IDropTargetHelper_fnDragLeave (IDropTargetHelper * iface)
144 ICOM_THIS (IDropTargetHelperImpl, iface);
145 FIXME ("(%p)->()\n", This);
146 return E_NOTIMPL;
149 static HRESULT WINAPI IDropTargetHelper_fnDragOver (IDropTargetHelper * iface, POINT* ppt, DWORD dwEffect)
151 ICOM_THIS (IDropTargetHelperImpl, iface);
152 FIXME ("(%p)->(%p 0x%08lx)\n", This, ppt, dwEffect);
153 return E_NOTIMPL;
156 static HRESULT WINAPI IDropTargetHelper_fnDrop (IDropTargetHelper * iface, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect)
158 ICOM_THIS (IDropTargetHelperImpl, iface);
159 FIXME ("(%p)->(%p %p 0x%08lx)\n", This, pDataObject, ppt, dwEffect);
160 return E_NOTIMPL;
163 static HRESULT WINAPI IDropTargetHelper_fnShow (IDropTargetHelper * iface, BOOL fShow)
165 ICOM_THIS (IDropTargetHelperImpl, iface);
166 FIXME ("(%p)->(%u)\n", This, fShow);
167 return E_NOTIMPL;
170 static ICOM_VTABLE (IDropTargetHelper) vt_IDropTargetHelper =
172 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
173 IDropTargetHelper_fnQueryInterface,
174 IDropTargetHelper_fnAddRef,
175 IDropTargetHelper_fnRelease,
176 IDropTargetHelper_fnDragEnter,
177 IDropTargetHelper_fnDragLeave,
178 IDropTargetHelper_fnDragOver,
179 IDropTargetHelper_fnDrop,
180 IDropTargetHelper_fnShow