ReactOS 0.4.15-dev-7961-gdcf9eb0
bindctx.c File Reference
#include <stdarg.h>
#include <string.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "objbase.h"
#include "wine/debug.h"
Include dependency graph for bindctx.c:

Go to the source code of this file.

Classes

struct  BindCtxObject
 
struct  BindCtxImpl
 

Macros

#define COBJMACROS
 
#define BINDCTX_FIRST_TABLE_SIZE   4
 

Typedefs

typedef struct BindCtxObject BindCtxObject
 
typedef struct BindCtxImpl BindCtxImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects (IBindCtx *)
 
static HRESULT BindCtxImpl_GetObjectIndex (BindCtxImpl *, IUnknown *, LPOLESTR, DWORD *)
 
static HRESULT BindCtxImpl_ExpandTable (BindCtxImpl *)
 
static BindCtxImplimpl_from_IBindCtx (IBindCtx *iface)
 
static HRESULT WINAPI BindCtxImpl_QueryInterface (IBindCtx *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI BindCtxImpl_AddRef (IBindCtx *iface)
 
static HRESULT BindCtxImpl_Destroy (BindCtxImpl *This)
 
static ULONG WINAPI BindCtxImpl_Release (IBindCtx *iface)
 
static HRESULT WINAPI BindCtxImpl_RegisterObjectBound (IBindCtx *iface, IUnknown *punk)
 
static HRESULT WINAPI BindCtxImpl_RevokeObjectBound (IBindCtx *iface, IUnknown *punk)
 
static HRESULT WINAPI BindCtxImpl_SetBindOptions (IBindCtx *iface, BIND_OPTS *pbindopts)
 
static HRESULT WINAPI BindCtxImpl_GetBindOptions (IBindCtx *iface, BIND_OPTS *pbindopts)
 
static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable (IBindCtx *iface, IRunningObjectTable **pprot)
 
static HRESULT WINAPI BindCtxImpl_RegisterObjectParam (IBindCtx *iface, LPOLESTR pszkey, IUnknown *punk)
 
static HRESULT WINAPI BindCtxImpl_GetObjectParam (IBindCtx *iface, LPOLESTR pszkey, IUnknown **punk)
 
static HRESULT WINAPI BindCtxImpl_RevokeObjectParam (IBindCtx *iface, LPOLESTR ppenum)
 
static HRESULT WINAPI BindCtxImpl_EnumObjectParam (IBindCtx *iface, IEnumString **pszkey)
 
static HRESULT BindCtxImpl_Construct (BindCtxImpl *This)
 
HRESULT WINAPI CreateBindCtx (DWORD reserved, LPBC *ppbc)
 
HRESULT WINAPI BindMoniker (LPMONIKER pmk, DWORD grfOpt, REFIID riid, LPVOID *ppvResult)
 

Variables

static const IBindCtxVtbl VT_BindCtxImpl
 

Macro Definition Documentation

◆ BINDCTX_FIRST_TABLE_SIZE

#define BINDCTX_FIRST_TABLE_SIZE   4

Definition at line 36 of file bindctx.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file bindctx.c.

Typedef Documentation

◆ BindCtxImpl

◆ BindCtxObject

Function Documentation

◆ BindCtxImpl_AddRef()

static ULONG WINAPI BindCtxImpl_AddRef ( IBindCtx iface)
static

Definition at line 106 of file bindctx.c.

107{
109
110 TRACE("(%p)\n",This);
111
112 return InterlockedIncrement(&This->ref);
113}
#define InterlockedIncrement
Definition: armddk.h:53
static BindCtxImpl * impl_from_IBindCtx(IBindCtx *iface)
Definition: bindctx.c:69
#define TRACE(s)
Definition: solgame.cpp:4

◆ BindCtxImpl_Construct()

static HRESULT BindCtxImpl_Construct ( BindCtxImpl This)
static

Definition at line 515 of file bindctx.c.

516{
517 TRACE("(%p)\n",This);
518
519 /* Initialize the virtual function table.*/
520 This->IBindCtx_iface.lpVtbl = &VT_BindCtxImpl;
521 This->ref = 0;
522
523 /* Initialize the BIND_OPTS2 structure */
524 This->bindOption2.cbStruct = sizeof(BIND_OPTS2);
525 This->bindOption2.grfFlags = 0;
526 This->bindOption2.grfMode = STGM_READWRITE;
527 This->bindOption2.dwTickCountDeadline = 0;
528
529 This->bindOption2.dwTrackFlags = 0;
530 This->bindOption2.dwClassContext = CLSCTX_SERVER;
531 This->bindOption2.locale = GetThreadLocale();
532 This->bindOption2.pServerInfo = 0;
533
534 /* Initialize the bindctx table */
535 This->bindCtxTableSize=0;
536 This->bindCtxTableLastIndex=0;
537 This->bindCtxTable = NULL;
538
539 return S_OK;
540}
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1459
#define STGM_READWRITE
Definition: objbase.h:919
static const IBindCtxVtbl VT_BindCtxImpl
Definition: bindctx.c:495

Referenced by CreateBindCtx().

◆ BindCtxImpl_Destroy()

static HRESULT BindCtxImpl_Destroy ( BindCtxImpl This)
static

Definition at line 118 of file bindctx.c.

119{
120 TRACE("(%p)\n",This);
121
122 /* free the table space memory */
123 HeapFree(GetProcessHeap(),0,This->bindCtxTable);
124
125 /* free the bindctx structure */
127
128 return S_OK;
129}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by BindCtxImpl_Release().

◆ BindCtxImpl_EnumObjectParam()

static HRESULT WINAPI BindCtxImpl_EnumObjectParam ( IBindCtx iface,
IEnumString **  pszkey 
)
static

Definition at line 417 of file bindctx.c.

418{
419 TRACE("(%p,%p)\n",iface,pszkey);
420
421 *pszkey = NULL;
422
423 /* not implemented in native either */
424 return E_NOTIMPL;
425}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BindCtxImpl_ExpandTable()

static HRESULT BindCtxImpl_ExpandTable ( BindCtxImpl This)
static

Definition at line 471 of file bindctx.c.

472{
473 if (!This->bindCtxTableSize)
474 {
475 This->bindCtxTableSize = BINDCTX_FIRST_TABLE_SIZE;
477 This->bindCtxTableSize * sizeof(BindCtxObject));
478 }
479 else
480 {
481 This->bindCtxTableSize *= 2;
482
483 This->bindCtxTable = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,This->bindCtxTable,
484 This->bindCtxTableSize * sizeof(BindCtxObject));
485 }
486
487 if (!This->bindCtxTable)
488 return E_OUTOFMEMORY;
489
490 return S_OK;
491}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define BINDCTX_FIRST_TABLE_SIZE
Definition: bindctx.c:36

Referenced by BindCtxImpl_RegisterObjectBound(), and BindCtxImpl_RegisterObjectParam().

◆ BindCtxImpl_GetBindOptions()

static HRESULT WINAPI BindCtxImpl_GetBindOptions ( IBindCtx iface,
BIND_OPTS *  pbindopts 
)
static

Definition at line 267 of file bindctx.c.

268{
270 ULONG cbStruct;
271
272 TRACE("(%p,%p)\n",This,pbindopts);
273
274 if (pbindopts==NULL)
275 return E_POINTER;
276
277 cbStruct = pbindopts->cbStruct;
278 if (cbStruct > sizeof(BIND_OPTS2))
279 cbStruct = sizeof(BIND_OPTS2);
280
281 memcpy(pbindopts, &This->bindOption2, cbStruct);
282 pbindopts->cbStruct = cbStruct;
283
284 return S_OK;
285}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
uint32_t ULONG
Definition: typedefs.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ BindCtxImpl_GetObjectIndex()

static HRESULT BindCtxImpl_GetObjectIndex ( BindCtxImpl This,
IUnknown punk,
LPOLESTR  pszkey,
DWORD index 
)
static

Definition at line 430 of file bindctx.c.

434{
435 DWORD i;
436 BOOL found = FALSE;
437
438 TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index);
439
440 if (punk==NULL)
441 /* search object identified by a register key */
442 for(i=0; ( (i<This->bindCtxTableLastIndex) && (!found));i++)
443 {
444 if(This->bindCtxTable[i].regType==1){
445
446 if ( ( (This->bindCtxTable[i].pkeyObj==NULL) && (pszkey==NULL) ) ||
447 ( (This->bindCtxTable[i].pkeyObj!=NULL) &&
448 (pszkey!=NULL) &&
449 (wcscmp(This->bindCtxTable[i].pkeyObj,pszkey)==0)
450 )
451 )
452
453 found = TRUE;
454 }
455 }
456 else
457 /* search object identified by a moniker*/
458 for(i=0; ( (i<This->bindCtxTableLastIndex) && (!found));i++)
459 if(This->bindCtxTable[i].pObj==punk)
460 found = TRUE;
461
462 if (index != NULL)
463 *index=i-1;
464
465 if (found)
466 return S_OK;
467 TRACE("key not found\n");
468 return S_FALSE;
469}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define S_FALSE
Definition: winerror.h:2357

Referenced by BindCtxImpl_GetObjectParam(), BindCtxImpl_RegisterObjectParam(), BindCtxImpl_RevokeObjectBound(), and BindCtxImpl_RevokeObjectParam().

◆ BindCtxImpl_GetObjectParam()

static HRESULT WINAPI BindCtxImpl_GetObjectParam ( IBindCtx iface,
LPOLESTR  pszkey,
IUnknown **  punk 
)
static

Definition at line 362 of file bindctx.c.

363{
364 DWORD index;
366
367 TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk);
368
369 if (punk==NULL)
370 return E_POINTER;
371
372 *punk=0;
373
375 return E_FAIL;
376
377 IUnknown_AddRef(This->bindCtxTable[index].pObj);
378
379 *punk = This->bindCtxTable[index].pObj;
380
381 return S_OK;
382}
#define index(s, c)
Definition: various.h:29
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
static HRESULT BindCtxImpl_GetObjectIndex(BindCtxImpl *, IUnknown *, LPOLESTR, DWORD *)
Definition: bindctx.c:430

◆ BindCtxImpl_GetRunningObjectTable()

static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable ( IBindCtx iface,
IRunningObjectTable **  pprot 
)
static

Definition at line 291 of file bindctx.c.

292{
294
295 TRACE("(%p,%p)\n",This,pprot);
296
297 if (pprot==NULL)
298 return E_POINTER;
299
300 return GetRunningObjectTable(0, pprot);
301}
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot)
Definition: moniker.c:1035

◆ BindCtxImpl_QueryInterface()

static HRESULT WINAPI BindCtxImpl_QueryInterface ( IBindCtx iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 78 of file bindctx.c.

79{
81
82 TRACE("(%p %s %p)\n",This, debugstr_guid(riid), ppvObject);
83
84 /* Perform a sanity check on the parameters.*/
85 if (!ppvObject)
86 return E_POINTER;
87
88 /* Initialize the return parameter.*/
89 *ppvObject = 0;
90
91 /* Compare the riid with the interface IDs implemented by this object.*/
93 IsEqualIID(&IID_IBindCtx, riid))
94 {
95 *ppvObject = &This->IBindCtx_iface;
96 IBindCtx_AddRef(iface);
97 return S_OK;
98 }
99
100 return E_NOINTERFACE;
101}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by CreateBindCtx().

◆ BindCtxImpl_RegisterObjectBound()

static HRESULT WINAPI BindCtxImpl_RegisterObjectBound ( IBindCtx iface,
IUnknown punk 
)
static

Definition at line 157 of file bindctx.c.

158{
160 DWORD lastIndex=This->bindCtxTableLastIndex;
161
162 TRACE("(%p,%p)\n",This,punk);
163
164 if (punk==NULL)
165 return S_OK;
166
167 if (lastIndex == This->bindCtxTableSize)
168 {
170 if (FAILED(hr))
171 return hr;
172 }
173
174 IUnknown_AddRef(punk);
175
176 /* put the object in the first free element in the table */
177 This->bindCtxTable[lastIndex].pObj = punk;
178 This->bindCtxTable[lastIndex].pkeyObj = NULL;
179 This->bindCtxTable[lastIndex].regType = 0;
180 lastIndex= ++This->bindCtxTableLastIndex;
181
182 return S_OK;
183}
#define FAILED(hr)
Definition: intsafe.h:51
static HRESULT BindCtxImpl_ExpandTable(BindCtxImpl *)
Definition: bindctx.c:471
HRESULT hr
Definition: shlfolder.c:183

◆ BindCtxImpl_RegisterObjectParam()

static HRESULT WINAPI BindCtxImpl_RegisterObjectParam ( IBindCtx iface,
LPOLESTR  pszkey,
IUnknown punk 
)
static

Definition at line 307 of file bindctx.c.

308{
309 DWORD index=0;
311
312 TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk);
313
314 if (punk==NULL)
315 return E_INVALIDARG;
316
317 if (pszkey!=NULL && BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_OK)
318 {
319 TRACE("Overwriting existing key\n");
320 if(This->bindCtxTable[index].pObj!=NULL)
321 IUnknown_Release(This->bindCtxTable[index].pObj);
322 This->bindCtxTable[index].pObj=punk;
323 IUnknown_AddRef(punk);
324 return S_OK;
325 }
326
327 if (This->bindCtxTableLastIndex == This->bindCtxTableSize)
328 {
330 if (FAILED(hr))
331 return hr;
332 }
333
334 This->bindCtxTable[This->bindCtxTableLastIndex].pObj = punk;
335 This->bindCtxTable[This->bindCtxTableLastIndex].regType = 1;
336
337 if (pszkey==NULL)
338
339 This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=NULL;
340
341 else
342 {
343
344 This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=
345 HeapAlloc(GetProcessHeap(),0,(sizeof(WCHAR)*(1+lstrlenW(pszkey))));
346
347 if (This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj==NULL)
348 return E_OUTOFMEMORY;
349 lstrcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
350 }
351
352 This->bindCtxTableLastIndex++;
353
354 IUnknown_AddRef(punk);
355 return S_OK;
356}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ BindCtxImpl_Release()

static ULONG WINAPI BindCtxImpl_Release ( IBindCtx iface)
static

Definition at line 134 of file bindctx.c.

135{
137 ULONG ref;
138
139 TRACE("(%p)\n",This);
140
142 if (ref == 0)
143 {
144 /* release all registered objects */
145 BindCtxImpl_ReleaseBoundObjects(&This->IBindCtx_iface);
146
148 }
149 return ref;
150}
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx *)
Definition: bindctx.c:221
static HRESULT BindCtxImpl_Destroy(BindCtxImpl *This)
Definition: bindctx.c:118
Definition: send.c:48

◆ BindCtxImpl_ReleaseBoundObjects()

static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects ( IBindCtx iface)
static

Definition at line 221 of file bindctx.c.

222{
223 DWORD i;
224
226
227 TRACE("(%p)\n",This);
228
229 for(i=0;i<This->bindCtxTableLastIndex;i++)
230 {
231 if(This->bindCtxTable[i].pObj)
232 IUnknown_Release(This->bindCtxTable[i].pObj);
233 HeapFree(GetProcessHeap(),0,This->bindCtxTable[i].pkeyObj);
234 }
235
236 This->bindCtxTableLastIndex = 0;
237
238 return S_OK;
239}

Referenced by BindCtxImpl_Release().

◆ BindCtxImpl_RevokeObjectBound()

static HRESULT WINAPI BindCtxImpl_RevokeObjectBound ( IBindCtx iface,
IUnknown punk 
)
static

Definition at line 189 of file bindctx.c.

190{
191 DWORD index,j;
192
194
195 TRACE("(%p,%p)\n",This,punk);
196
197 if (!punk)
198 return E_INVALIDARG;
199
200 /* check if the object was registered or not */
202 return MK_E_NOTBOUND;
203
204 if(This->bindCtxTable[index].pObj)
205 IUnknown_Release(This->bindCtxTable[index].pObj);
206 HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj);
207
208 /* left-shift all elements in the right side of the current revoked object */
209 for(j=index; j<This->bindCtxTableLastIndex-1; j++)
210 This->bindCtxTable[j]= This->bindCtxTable[j+1];
211
212 This->bindCtxTableLastIndex--;
213
214 return S_OK;
215}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define MK_E_NOTBOUND
Definition: winerror.h:2790

◆ BindCtxImpl_RevokeObjectParam()

static HRESULT WINAPI BindCtxImpl_RevokeObjectParam ( IBindCtx iface,
LPOLESTR  ppenum 
)
static

Definition at line 388 of file bindctx.c.

389{
390 DWORD index,j;
391
393
394 TRACE("(%p,%s)\n",This,debugstr_w(ppenum));
395
397 return E_FAIL;
398
399 /* release the object if it's found */
400 if(This->bindCtxTable[index].pObj)
401 IUnknown_Release(This->bindCtxTable[index].pObj);
402 HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj);
403
404 /* remove the object from the table with a left-shifting of all objects in the right side */
405 for(j=index; j<This->bindCtxTableLastIndex-1; j++)
406 This->bindCtxTable[j]= This->bindCtxTable[j+1];
407
408 This->bindCtxTableLastIndex--;
409
410 return S_OK;
411}

◆ BindCtxImpl_SetBindOptions()

static HRESULT WINAPI BindCtxImpl_SetBindOptions ( IBindCtx iface,
BIND_OPTS *  pbindopts 
)
static

Definition at line 245 of file bindctx.c.

246{
248
249 TRACE("(%p,%p)\n",This,pbindopts);
250
251 if (pbindopts==NULL)
252 return E_POINTER;
253
254 if (pbindopts->cbStruct > sizeof(BIND_OPTS2))
255 {
256 WARN("invalid size\n");
257 return E_INVALIDARG; /* FIXME : not verified */
258 }
259 memcpy(&This->bindOption2, pbindopts, pbindopts->cbStruct);
260 return S_OK;
261}
#define WARN(fmt,...)
Definition: debug.h:112

◆ BindMoniker()

HRESULT WINAPI BindMoniker ( LPMONIKER  pmk,
DWORD  grfOpt,
REFIID  riid,
LPVOID ppvResult 
)

Definition at line 602 of file bindctx.c.

603{
604 HRESULT res;
605 IBindCtx * pbc;
606
607 TRACE("(%p, %x, %s, %p)\n", pmk, grfOpt, debugstr_guid(riid), ppvResult);
608
609 res = CreateBindCtx(grfOpt, &pbc);
610 if (SUCCEEDED(res))
611 {
612 res = IMoniker_BindToObject(pmk, pbc, NULL, riid, ppvResult);
613 IBindCtx_Release(pbc);
614 }
615 return res;
616}
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556

Referenced by OleCreateFromFileEx().

◆ CreateBindCtx()

HRESULT WINAPI CreateBindCtx ( DWORD  reserved,
LPBC ppbc 
)

Definition at line 556 of file bindctx.c.

557{
558 BindCtxImpl* newBindCtx;
559 HRESULT hr;
560
561 TRACE("(%d,%p)\n",reserved,ppbc);
562
563 if (!ppbc) return E_INVALIDARG;
564
565 *ppbc = NULL;
566
567 if (reserved != 0)
568 {
569 ERR("reserved should be 0, not 0x%x\n", reserved);
570 return E_INVALIDARG;
571 }
572
573 newBindCtx = HeapAlloc(GetProcessHeap(), 0, sizeof(BindCtxImpl));
574 if (newBindCtx == 0)
575 return E_OUTOFMEMORY;
576
577 hr = BindCtxImpl_Construct(newBindCtx);
578 if (FAILED(hr))
579 {
580 HeapFree(GetProcessHeap(),0,newBindCtx);
581 return hr;
582 }
583
584 return BindCtxImpl_QueryInterface(&newBindCtx->IBindCtx_iface,&IID_IBindCtx,(void**)ppbc);
585}
#define ERR(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:3006
static HRESULT BindCtxImpl_Construct(BindCtxImpl *This)
Definition: bindctx.c:515
static HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx *iface, REFIID riid, void **ppvObject)
Definition: bindctx.c:78
IBindCtx IBindCtx_iface
Definition: bindctx.c:52

Referenced by bind_url(), BindCtx_CreateWithMode(), BindCtx_RegisterObjectParam(), BindMoniker(), ClassMoniker_IsEqual(), CoGetObject(), create_doc_from_url(), CreateAsyncBindCtx(), CreateAsyncBindCtxEx(), CreateBindCtxWithOpts(), DEVENUM_IMediaCatMoniker_IsEqual(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_IsEqual(), FileMonikerImpl_RelativePathTo(), FilterMapper3_RegisterFilter(), general_dlg_proc(), get_moniker_comparison_data(), Global_GetObject(), handle_extern_mime_navigation(), HlinkBrowseContext_GetObject(), HlinkResolveMonikerForData(), IFileSystemBindData_Constructor(), IHlink_fnGetFriendlyName(), IHlink_fnGetStringReference(), IHlink_fnNavigate(), IHlink_fnSetMonikerReference(), IHlink_fnSetStringReference(), ItemMonikerImpl_IsEqual(), OleLoadPicturePath(), perform_test(), reduce_moniker(), RunningObjectTableImpl_Register(), CDesktopFolder::ShellUrlParseDisplayName(), START_TEST(), test_anti_moniker(), test_bind_context(), test_BindToStorage(), test_class_moniker(), test_create(), test_CreateAsyncBindCtxEx(), test_generic_composite_moniker(), test_Hlink_Navigate(), test_HlinkParseDisplayName(), test_HlinkResolveMonikerForData(), test_HlinkSite(), test_IsValidURL(), test_item_moniker(), test_Load(), test_MimeOleObjectFromMoniker(), test_MkParseDisplayName(), test_MkParseDisplayNameEx(), test_moniker(), test_ParseDisplayName(), test_ParseDisplayNamePBC(), test_pointer_moniker(), test_RegisterBindStatusCallback(), test_RegisterFormatEnumerator(), test_SetInitialHlink(), test_SHCreateQueryCancelAutoPlayMoniker(), URLMoniker_IsEqual(), URLStartDownload(), and user_notice_dlg_proc().

◆ impl_from_IBindCtx()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ VT_BindCtxImpl

const IBindCtxVtbl VT_BindCtxImpl
static
Initial value:
=
{
}
static HRESULT WINAPI BindCtxImpl_GetObjectParam(IBindCtx *iface, LPOLESTR pszkey, IUnknown **punk)
Definition: bindctx.c:362
static ULONG WINAPI BindCtxImpl_Release(IBindCtx *iface)
Definition: bindctx.c:134
static HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx *iface, LPOLESTR ppenum)
Definition: bindctx.c:388
static HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx *iface, IEnumString **pszkey)
Definition: bindctx.c:417
static HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts)
Definition: bindctx.c:267
static HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx *iface, LPOLESTR pszkey, IUnknown *punk)
Definition: bindctx.c:307
static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx *iface)
Definition: bindctx.c:106
static HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts)
Definition: bindctx.c:245
static HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx *iface, IUnknown *punk)
Definition: bindctx.c:189
static HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx *iface, IUnknown *punk)
Definition: bindctx.c:157
static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx *iface, IRunningObjectTable **pprot)
Definition: bindctx.c:291

Definition at line 495 of file bindctx.c.

Referenced by BindCtxImpl_Construct().