ntdll/tests: Adjust test_virtual_unwind() for Win11 results.
[wine.git] / dlls / objsel / objsel.c
blobe42ac5ab89868c420ceb22ed510f5c92905d762d
1 /*
2 * Object Picker Dialog
4 * Copyright 2005 Thomas Weidenmueller <w3seek@reactos.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "objsel_private.h"
22 #include "rpcproxy.h"
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(objsel);
28 LONG dll_refs = 0;
30 /***********************************************************************
31 * DllGetClassObject (OBJSEL.@)
33 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
35 TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
37 *ppv = NULL;
39 if (IsEqualGUID(rclsid, &CLSID_DsObjectPicker))
40 return IClassFactory_QueryInterface(&OBJSEL_ClassFactory.IClassFactory_iface, iid, ppv);
42 FIXME("CLSID: %s, IID: %s\n", debugstr_guid(rclsid), debugstr_guid(iid));
43 return CLASS_E_CLASSNOTAVAILABLE;
47 /***********************************************************************
48 * DllCanUnloadNow (OBJSEL.@)
50 HRESULT WINAPI DllCanUnloadNow(void)
52 return dll_refs != 0 ? S_FALSE : S_OK;
56 /**********************************************************************
57 * OBJSEL_IDsObjectPicker_Destroy (also IUnknown)
59 static VOID OBJSEL_IDsObjectPicker_Destroy(IDsObjectPickerImpl *This)
61 HeapFree(GetProcessHeap(),
63 This);
67 static inline IDsObjectPickerImpl *impl_from_IDsObjectPicker(IDsObjectPicker *iface)
69 return CONTAINING_RECORD(iface, IDsObjectPickerImpl, IDsObjectPicker_iface);
72 /**********************************************************************
73 * OBJSEL_IDsObjectPicker_AddRef (also IUnknown)
75 static ULONG WINAPI OBJSEL_IDsObjectPicker_AddRef(IDsObjectPicker * iface)
77 IDsObjectPickerImpl *This = impl_from_IDsObjectPicker(iface);
78 ULONG ref;
80 TRACE("\n");
82 if (This == NULL) return E_POINTER;
84 ref = InterlockedIncrement(&This->ref);
86 if (ref == 1)
88 InterlockedIncrement(&dll_refs);
91 return ref;
95 /**********************************************************************
96 * OBJSEL_IDsObjectPicker_Release (also IUnknown)
98 static ULONG WINAPI OBJSEL_IDsObjectPicker_Release(IDsObjectPicker * iface)
100 IDsObjectPickerImpl *This = impl_from_IDsObjectPicker(iface);
101 ULONG ref;
103 TRACE("\n");
105 if (This == NULL) return E_POINTER;
107 ref = InterlockedDecrement(&This->ref);
109 if (ref == 0)
111 InterlockedDecrement(&dll_refs);
112 OBJSEL_IDsObjectPicker_Destroy(This);
115 return ref;
119 /**********************************************************************
120 * OBJSEL_IDsObjectPicker_QueryInterface (also IUnknown)
122 static HRESULT WINAPI OBJSEL_IDsObjectPicker_QueryInterface(
123 IDsObjectPicker * iface,
124 REFIID riid,
125 LPVOID *ppvObj)
127 TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
129 if (ppvObj == NULL) return E_POINTER;
131 if (IsEqualGUID(riid, &IID_IUnknown) ||
132 IsEqualGUID(riid, &IID_IDsObjectPicker))
134 *ppvObj = iface;
135 OBJSEL_IDsObjectPicker_AddRef(iface);
136 return S_OK;
139 FIXME("- no interface IID: %s\n", debugstr_guid(riid));
140 return E_NOINTERFACE;
144 /**********************************************************************
145 * OBJSEL_IDsObjectPicker_Initialize
147 static HRESULT WINAPI OBJSEL_IDsObjectPicker_Initialize(
148 IDsObjectPicker * iface,
149 PDSOP_INIT_INFO pInitInfo)
151 FIXME("stub!\n");
152 return S_OK;
156 /**********************************************************************
157 * OBJSEL_IDsObjectPicker_InvokeDialog
159 static HRESULT WINAPI OBJSEL_IDsObjectPicker_InvokeDialog(
160 IDsObjectPicker * iface,
161 HWND hwndParent,
162 IDataObject** ppdoSelections)
164 FIXME("stub!\n");
165 return S_FALSE;
169 /**********************************************************************
170 * IDsObjectPicker_Vtbl
172 static IDsObjectPickerVtbl IDsObjectPicker_Vtbl =
174 OBJSEL_IDsObjectPicker_QueryInterface,
175 OBJSEL_IDsObjectPicker_AddRef,
176 OBJSEL_IDsObjectPicker_Release,
177 OBJSEL_IDsObjectPicker_Initialize,
178 OBJSEL_IDsObjectPicker_InvokeDialog
182 /**********************************************************************
183 * OBJSEL_IDsObjectPicker_Create
185 HRESULT WINAPI OBJSEL_IDsObjectPicker_Create(LPVOID *ppvObj)
187 IDsObjectPickerImpl *Instance = HeapAlloc(GetProcessHeap(),
188 HEAP_ZERO_MEMORY,
189 sizeof(IDsObjectPickerImpl));
190 if (Instance != NULL)
192 Instance->IDsObjectPicker_iface.lpVtbl = &IDsObjectPicker_Vtbl;
193 OBJSEL_IDsObjectPicker_AddRef(&Instance->IDsObjectPicker_iface);
195 *ppvObj = Instance;
196 return S_OK;
198 else
199 return E_OUTOFMEMORY;