ReactOS  0.4.15-dev-1171-gab82533
objsel.c
Go to the documentation of this file.
1 /*
2  * Object Picker Dialog
3  *
4  * Copyright 2005 Thomas Weidenmueller <w3seek@reactos.com>
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include "objsel_private.h"
22 #include "rpcproxy.h"
23 
24 #include "wine/debug.h"
25 
27 
30 
31 /***********************************************************************
32  * DllEntryPoint
33  */
35 {
36  switch(fdwReason)
37  {
38  case DLL_PROCESS_ATTACH:
39  hInstance = hinstDLL;
41  break;
42  }
43  return TRUE;
44 }
45 
46 
47 /***********************************************************************
48  * DllGetClassObject (OBJSEL.@)
49  */
51 {
52  TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
53 
54  *ppv = NULL;
55 
56  if (IsEqualGUID(rclsid, &CLSID_DsObjectPicker))
57  return IClassFactory_QueryInterface(&OBJSEL_ClassFactory.IClassFactory_iface, iid, ppv);
58 
59  FIXME("CLSID: %s, IID: %s\n", debugstr_guid(rclsid), debugstr_guid(iid));
61 }
62 
63 
64 /***********************************************************************
65  * DllCanUnloadNow (OBJSEL.@)
66  */
68 {
69  return dll_refs != 0 ? S_FALSE : S_OK;
70 }
71 
72 
73 /***********************************************************************
74  * DllRegisterServer (OBJSEL.@)
75  */
77 {
79 }
80 
81 
82 /***********************************************************************
83  * DllUnregisterServer (OBJSEL.@)
84  */
86 {
88 }
89 
90 
91 /**********************************************************************
92  * OBJSEL_IDsObjectPicker_Destroy (also IUnknown)
93  */
95 {
97  0,
98  This);
99 }
100 
101 
102 static inline IDsObjectPickerImpl *impl_from_IDsObjectPicker(IDsObjectPicker *iface)
103 {
104  return CONTAINING_RECORD(iface, IDsObjectPickerImpl, IDsObjectPicker_iface);
105 }
106 
107 /**********************************************************************
108  * OBJSEL_IDsObjectPicker_AddRef (also IUnknown)
109  */
110 static ULONG WINAPI OBJSEL_IDsObjectPicker_AddRef(IDsObjectPicker * iface)
111 {
113  ULONG ref;
114 
115  TRACE("\n");
116 
117  if (This == NULL) return E_POINTER;
118 
119  ref = InterlockedIncrement(&This->ref);
120 
121  if (ref == 1)
122  {
124  }
125 
126  return ref;
127 }
128 
129 
130 /**********************************************************************
131  * OBJSEL_IDsObjectPicker_Release (also IUnknown)
132  */
133 static ULONG WINAPI OBJSEL_IDsObjectPicker_Release(IDsObjectPicker * iface)
134 {
136  ULONG ref;
137 
138  TRACE("\n");
139 
140  if (This == NULL) return E_POINTER;
141 
142  ref = InterlockedDecrement(&This->ref);
143 
144  if (ref == 0)
145  {
148  }
149 
150  return ref;
151 }
152 
153 
154 /**********************************************************************
155  * OBJSEL_IDsObjectPicker_QueryInterface (also IUnknown)
156  */
158  IDsObjectPicker * iface,
159  REFIID riid,
160  LPVOID *ppvObj)
161 {
162  TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
163 
164  if (ppvObj == NULL) return E_POINTER;
165 
166  if (IsEqualGUID(riid, &IID_IUnknown) ||
167  IsEqualGUID(riid, &IID_IDsObjectPicker))
168  {
169  *ppvObj = iface;
171  return S_OK;
172  }
173 
174  FIXME("- no interface IID: %s\n", debugstr_guid(riid));
175  return E_NOINTERFACE;
176 }
177 
178 
179 /**********************************************************************
180  * OBJSEL_IDsObjectPicker_Initialize
181  */
183  IDsObjectPicker * iface,
184  PDSOP_INIT_INFO pInitInfo)
185 {
186  FIXME("stub!\n");
187  return S_OK;
188 }
189 
190 
191 /**********************************************************************
192  * OBJSEL_IDsObjectPicker_InvokeDialog
193  */
195  IDsObjectPicker * iface,
197  IDataObject** ppdoSelections)
198 {
199  FIXME("stub!\n");
200  return S_FALSE;
201 }
202 
203 
204 /**********************************************************************
205  * IDsObjectPicker_Vtbl
206  */
207 static IDsObjectPickerVtbl IDsObjectPicker_Vtbl =
208 {
214 };
215 
216 
217 /**********************************************************************
218  * OBJSEL_IDsObjectPicker_Create
219  */
221 {
224  sizeof(IDsObjectPickerImpl));
225  if (Instance != NULL)
226  {
227  Instance->IDsObjectPicker_iface.lpVtbl = &IDsObjectPicker_Vtbl;
228  OBJSEL_IDsObjectPicker_AddRef(&Instance->IDsObjectPicker_iface);
229 
230  *ppvObj = Instance;
231  return S_OK;
232  }
233  else
234  return E_OUTOFMEMORY;
235 }
static IDsObjectPickerVtbl IDsObjectPicker_Vtbl
Definition: objsel.c:207
WINE_DEFAULT_DEBUG_CHANNEL(objsel)
#define REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
Definition: objsel.c:50
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
#define REFCLSID
Definition: guiddef.h:117
REFIID LPVOID * ppv
Definition: atlbase.h:39
static ULONG WINAPI OBJSEL_IDsObjectPicker_Release(IDsObjectPicker *iface)
Definition: objsel.c:133
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
Definition: send.c:48
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: objsel.c:34
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
static ULONG WINAPI OBJSEL_IDsObjectPicker_AddRef(IDsObjectPicker *iface)
Definition: objsel.c:110
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:111
static VOID OBJSEL_IDsObjectPicker_Destroy(IDsObjectPickerImpl *This)
Definition: objsel.c:94
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
ClassFactoryImpl OBJSEL_ClassFactory
Definition: factory.c:168
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static HRESULT WINAPI OBJSEL_IDsObjectPicker_InvokeDialog(IDsObjectPicker *iface, HWND hwndParent, IDataObject **ppdoSelections)
Definition: objsel.c:194
LONG HRESULT
Definition: typedefs.h:79
static HRESULT WINAPI OBJSEL_IDsObjectPicker_Initialize(IDsObjectPicker *iface, PDSOP_INIT_INFO pInitInfo)
Definition: objsel.c:182
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
HRESULT WINAPI OBJSEL_IDsObjectPicker_Create(LPVOID *ppvObj)
Definition: objsel.c:220
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG dll_refs
Definition: objsel.c:28
#define InterlockedDecrement
Definition: armddk.h:52
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
static IDsObjectPickerImpl * impl_from_IDsObjectPicker(IDsObjectPicker *iface)
Definition: objsel.c:102
HRESULT WINAPI DllUnregisterServer(void)
Definition: objsel.c:85
IClassFactory IClassFactory_iface
Definition: factory.c:26
#define S_OK
Definition: intsafe.h:51
#define InterlockedIncrement
Definition: armddk.h:53
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
HRESULT WINAPI DllRegisterServer(void)
Definition: objsel.c:76
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
IN PVOID Instance
Definition: pci.h:361
static HINSTANCE hInstance
Definition: objsel.c:29
static HRESULT WINAPI OBJSEL_IDsObjectPicker_QueryInterface(IDsObjectPicker *iface, REFIID riid, LPVOID *ppvObj)
Definition: objsel.c:157
unsigned int ULONG
Definition: retypes.h:1
HRESULT WINAPI DllCanUnloadNow(void)
Definition: objsel.c:67
#define E_POINTER
Definition: winerror.h:2365
#define HeapFree(x, y, z)
Definition: compat.h:483