ReactOS 0.4.16-dev-2332-g4cba65d
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 "wine/heap.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 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)
 
HRESULT WINAPI CreateBindCtx (DWORD reserved, IBindCtx **bind_context)
 
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 37 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 107 of file bindctx.c.

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

◆ BindCtxImpl_EnumObjectParam()

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

Definition at line 395 of file bindctx.c.

396{
397 TRACE("(%p,%p)\n",iface,pszkey);
398
399 *pszkey = NULL;
400
401 /* not implemented in native either */
402 return E_NOTIMPL;
403}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112

◆ BindCtxImpl_ExpandTable()

static HRESULT BindCtxImpl_ExpandTable ( BindCtxImpl This)
static

Definition at line 449 of file bindctx.c.

450{
451 if (!This->bindCtxTableSize)
452 {
453 This->bindCtxTableSize = BINDCTX_FIRST_TABLE_SIZE;
455 This->bindCtxTableSize * sizeof(BindCtxObject));
456 }
457 else
458 {
459 This->bindCtxTableSize *= 2;
460
461 This->bindCtxTable = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,This->bindCtxTable,
462 This->bindCtxTableSize * sizeof(BindCtxObject));
463 }
464
465 if (!This->bindCtxTable)
466 return E_OUTOFMEMORY;
467
468 return S_OK;
469}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define S_OK
Definition: intsafe.h:52
#define BINDCTX_FIRST_TABLE_SIZE
Definition: bindctx.c:37

Referenced by BindCtxImpl_RegisterObjectBound(), and BindCtxImpl_RegisterObjectParam().

◆ BindCtxImpl_GetBindOptions()

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

Definition at line 248 of file bindctx.c.

249{
251 DWORD size;
252
253 TRACE("(%p,%p)\n",This,pbindopts);
254
255 if (pbindopts==NULL)
256 return E_POINTER;
257
258 size = min(pbindopts->cbStruct, sizeof(This->options));
259 memcpy(pbindopts, &This->options, size);
260 pbindopts->cbStruct = size;
261
262 return S_OK;
263}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
#define E_POINTER
Definition: winerror.h:3480

◆ BindCtxImpl_GetObjectIndex()

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

Definition at line 408 of file bindctx.c.

412{
413 DWORD i;
414 BOOL found = FALSE;
415
416 TRACE("(%p,%p,%p,%p)\n",This,punk,pszkey,index);
417
418 if (punk==NULL)
419 /* search object identified by a register key */
420 for(i=0; ( (i<This->bindCtxTableLastIndex) && (!found));i++)
421 {
422 if(This->bindCtxTable[i].regType==1){
423
424 if ( ( (This->bindCtxTable[i].pkeyObj==NULL) && (pszkey==NULL) ) ||
425 ( (This->bindCtxTable[i].pkeyObj!=NULL) &&
426 (pszkey!=NULL) &&
427 (wcscmp(This->bindCtxTable[i].pkeyObj,pszkey)==0)
428 )
429 )
430
431 found = TRUE;
432 }
433 }
434 else
435 /* search object identified by a moniker*/
436 for(i=0; ( (i<This->bindCtxTableLastIndex) && (!found));i++)
437 if(This->bindCtxTable[i].pObj==punk)
438 found = TRUE;
439
440 if (index != NULL)
441 *index=i-1;
442
443 if (found)
444 return S_OK;
445 TRACE("key not found\n");
446 return S_FALSE;
447}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
unsigned int BOOL
Definition: ntddk_ex.h:94
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
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
#define S_FALSE
Definition: winerror.h:3451

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 340 of file bindctx.c.

341{
342 DWORD index;
344
345 TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk);
346
347 if (punk==NULL)
348 return E_POINTER;
349
350 *punk=0;
351
353 return E_FAIL;
354
355 IUnknown_AddRef(This->bindCtxTable[index].pObj);
356
357 *punk = This->bindCtxTable[index].pObj;
358
359 return S_OK;
360}
#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:408

◆ BindCtxImpl_GetRunningObjectTable()

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

Definition at line 269 of file bindctx.c.

270{
272
273 TRACE("(%p,%p)\n",This,pprot);
274
275 if (pprot==NULL)
276 return E_POINTER;
277
278 return GetRunningObjectTable(0, pprot);
279}
HRESULT WINAPI GetRunningObjectTable(DWORD reserved, IRunningObjectTable **ret)
Definition: moniker.c:729

◆ BindCtxImpl_QueryInterface()

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

Definition at line 79 of file bindctx.c.

80{
82
83 TRACE("(%p %s %p)\n",This, debugstr_guid(riid), ppvObject);
84
85 /* Perform a sanity check on the parameters.*/
86 if (!ppvObject)
87 return E_POINTER;
88
89 /* Initialize the return parameter.*/
90 *ppvObject = 0;
91
92 /* Compare the riid with the interface IDs implemented by this object.*/
94 IsEqualIID(&IID_IBindCtx, riid))
95 {
96 *ppvObject = &This->IBindCtx_iface;
97 IBindCtx_AddRef(iface);
98 return S_OK;
99 }
100
101 return E_NOINTERFACE;
102}
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
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ BindCtxImpl_RegisterObjectBound()

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

Definition at line 138 of file bindctx.c.

139{
141 DWORD lastIndex=This->bindCtxTableLastIndex;
142
143 TRACE("(%p,%p)\n",This,punk);
144
145 if (punk==NULL)
146 return S_OK;
147
148 if (lastIndex == This->bindCtxTableSize)
149 {
151 if (FAILED(hr))
152 return hr;
153 }
154
155 IUnknown_AddRef(punk);
156
157 /* put the object in the first free element in the table */
158 This->bindCtxTable[lastIndex].pObj = punk;
159 This->bindCtxTable[lastIndex].pkeyObj = NULL;
160 This->bindCtxTable[lastIndex].regType = 0;
161 lastIndex= ++This->bindCtxTableLastIndex;
162
163 return S_OK;
164}
#define FAILED(hr)
Definition: intsafe.h:51
static HRESULT BindCtxImpl_ExpandTable(BindCtxImpl *)
Definition: bindctx.c:449
HRESULT hr
Definition: shlfolder.c:183

◆ BindCtxImpl_RegisterObjectParam()

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

Definition at line 285 of file bindctx.c.

286{
287 DWORD index=0;
289
290 TRACE("(%p,%s,%p)\n",This,debugstr_w(pszkey),punk);
291
292 if (punk==NULL)
293 return E_INVALIDARG;
294
295 if (pszkey!=NULL && BindCtxImpl_GetObjectIndex(This,NULL,pszkey,&index)==S_OK)
296 {
297 TRACE("Overwriting existing key\n");
298 if(This->bindCtxTable[index].pObj!=NULL)
299 IUnknown_Release(This->bindCtxTable[index].pObj);
300 This->bindCtxTable[index].pObj=punk;
301 IUnknown_AddRef(punk);
302 return S_OK;
303 }
304
305 if (This->bindCtxTableLastIndex == This->bindCtxTableSize)
306 {
308 if (FAILED(hr))
309 return hr;
310 }
311
312 This->bindCtxTable[This->bindCtxTableLastIndex].pObj = punk;
313 This->bindCtxTable[This->bindCtxTableLastIndex].regType = 1;
314
315 if (pszkey==NULL)
316
317 This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=NULL;
318
319 else
320 {
321
322 This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj=
323 HeapAlloc(GetProcessHeap(),0,(sizeof(WCHAR)*(1+lstrlenW(pszkey))));
324
325 if (This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj==NULL)
326 return E_OUTOFMEMORY;
327 lstrcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
328 }
329
330 This->bindCtxTableLastIndex++;
331
332 IUnknown_AddRef(punk);
333 return S_OK;
334}
#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 116 of file bindctx.c.

117{
119 ULONG refcount = InterlockedDecrement(&context->ref);
120
121 TRACE("%p, refcount %lu.\n", iface, refcount);
122
123 if (!refcount)
124 {
126 heap_free(context->bindCtxTable);
128 }
129
130 return refcount;
131}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects(IBindCtx *)
Definition: bindctx.c:202
Definition: http.c:7252
uint32_t ULONG
Definition: typedefs.h:59

◆ BindCtxImpl_ReleaseBoundObjects()

static HRESULT WINAPI BindCtxImpl_ReleaseBoundObjects ( IBindCtx iface)
static

Definition at line 202 of file bindctx.c.

203{
204 DWORD i;
205
207
208 TRACE("(%p)\n",This);
209
210 for(i=0;i<This->bindCtxTableLastIndex;i++)
211 {
212 if(This->bindCtxTable[i].pObj)
213 IUnknown_Release(This->bindCtxTable[i].pObj);
214 HeapFree(GetProcessHeap(),0,This->bindCtxTable[i].pkeyObj);
215 }
216
217 This->bindCtxTableLastIndex = 0;
218
219 return S_OK;
220}
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by BindCtxImpl_Release().

◆ BindCtxImpl_RevokeObjectBound()

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

Definition at line 170 of file bindctx.c.

171{
172 DWORD index,j;
173
175
176 TRACE("(%p,%p)\n",This,punk);
177
178 if (!punk)
179 return E_INVALIDARG;
180
181 /* check if the object was registered or not */
183 return MK_E_NOTBOUND;
184
185 if(This->bindCtxTable[index].pObj)
186 IUnknown_Release(This->bindCtxTable[index].pObj);
187 HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj);
188
189 /* left-shift all elements in the right side of the current revoked object */
190 for(j=index; j<This->bindCtxTableLastIndex-1; j++)
191 This->bindCtxTable[j]= This->bindCtxTable[j+1];
192
193 This->bindCtxTableLastIndex--;
194
195 return S_OK;
196}
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:3904

◆ BindCtxImpl_RevokeObjectParam()

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

Definition at line 366 of file bindctx.c.

367{
368 DWORD index,j;
369
371
372 TRACE("(%p,%s)\n",This,debugstr_w(ppenum));
373
375 return E_FAIL;
376
377 /* release the object if it's found */
378 if(This->bindCtxTable[index].pObj)
379 IUnknown_Release(This->bindCtxTable[index].pObj);
380 HeapFree(GetProcessHeap(),0,This->bindCtxTable[index].pkeyObj);
381
382 /* remove the object from the table with a left-shifting of all objects in the right side */
383 for(j=index; j<This->bindCtxTableLastIndex-1; j++)
384 This->bindCtxTable[j]= This->bindCtxTable[j+1];
385
386 This->bindCtxTableLastIndex--;
387
388 return S_OK;
389}

◆ BindCtxImpl_SetBindOptions()

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

Definition at line 226 of file bindctx.c.

227{
229
230 TRACE("(%p,%p)\n",This, pbindopts);
231
232 if (pbindopts==NULL)
233 return E_POINTER;
234
235 if (pbindopts->cbStruct > sizeof(This->options))
236 {
237 WARN("invalid size %lu.\n", pbindopts->cbStruct);
238 return E_INVALIDARG;
239 }
240 memcpy(&This->options, pbindopts, pbindopts->cbStruct);
241 return S_OK;
242}
#define WARN(fmt,...)
Definition: precomp.h:61

◆ BindMoniker()

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

Definition at line 537 of file bindctx.c.

538{
539 HRESULT res;
540 IBindCtx * pbc;
541
542 TRACE("%p, %lx, %s, %p.\n", pmk, grfOpt, debugstr_guid(riid), ppvResult);
543
544 res = CreateBindCtx(grfOpt, &pbc);
545 if (SUCCEEDED(res))
546 {
547 res = IMoniker_BindToObject(pmk, pbc, NULL, riid, ppvResult);
548 IBindCtx_Release(pbc);
549 }
550 return res;
551}
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI CreateBindCtx(DWORD reserved, IBindCtx **bind_context)
Definition: bindctx.c:491

Referenced by OleCreateFromFileEx().

◆ CreateBindCtx()

HRESULT WINAPI CreateBindCtx ( DWORD  reserved,
IBindCtx **  bind_context 
)

Definition at line 491 of file bindctx.c.

492{
494
495 TRACE("%#lx, %p.\n", reserved, bind_context);
496
497 if (!bind_context) return E_INVALIDARG;
498
499 *bind_context = NULL;
500
501 if (reserved)
502 {
503 WARN("reserved should be 0, not %#lx.\n", reserved);
504 return E_INVALIDARG;
505 }
506
507 if (!(object = heap_alloc_zero(sizeof(*object))))
508 return E_OUTOFMEMORY;
509
510 object->IBindCtx_iface.lpVtbl = &VT_BindCtxImpl;
511 object->ref = 1;
512 object->options.cbStruct = sizeof(object->options);
513 object->options.grfMode = STGM_READWRITE;
514 object->options.dwClassContext = CLSCTX_SERVER;
515 object->options.locale = GetThreadLocale();
516
517 *bind_context = &object->IBindCtx_iface;
518
519 return S_OK;
520}
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
r reserved
Definition: btrfs.c:3006
#define STGM_READWRITE
Definition: objbase.h:936
static const IBindCtxVtbl VT_BindCtxImpl
Definition: bindctx.c:471

Referenced by _test_moniker_name(), bind_url(), BindCtx_CreateWithMode(), BindCtx_RegisterObjectParam(), BindMoniker(), BindStatusCallback_create(), CoGetObject(), create_doc_from_url(), CreateAsyncBindCtx(), CreateAsyncBindCtxEx(), CreateBindCtxWithOpts(), DEVENUM_IMediaCatMoniker_IsEqual(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_RelativePathTo(), FilterMapper3_RegisterFilter(), general_dlg_proc(), get_moniker_comparison_data(), Global_GetObject(), handle_extern_mime_navigation(), handle_xml_load(), HlinkBrowseContext_GetObject(), HlinkResolveMonikerForData(), IFileSystemBindData_Constructor(), IHlink_fnGetFriendlyName(), IHlink_fnGetStringReference(), IHlink_fnNavigate(), IHlink_fnSetMonikerReference(), IHlink_fnSetStringReference(), 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_file_moniker(), test_file_monikers(), 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_objref_moniker(), test_ParseDisplayName(), test_ParseDisplayNamePBC(), test_pointer_moniker(), test_RegisterBindStatusCallback(), test_RegisterFormatEnumerator(), test_SetInitialHlink(), test_SHCreateQueryCancelAutoPlayMoniker(), URLMoniker_IsEqual(), URLStartDownload(), user_notice_dlg_proc(), and XMLView_PersistMoniker_Load().

◆ 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:340
static ULONG WINAPI BindCtxImpl_Release(IBindCtx *iface)
Definition: bindctx.c:116
static HRESULT WINAPI BindCtxImpl_RevokeObjectParam(IBindCtx *iface, LPOLESTR ppenum)
Definition: bindctx.c:366
static HRESULT WINAPI BindCtxImpl_EnumObjectParam(IBindCtx *iface, IEnumString **pszkey)
Definition: bindctx.c:395
static HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts)
Definition: bindctx.c:248
static HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx *iface, LPOLESTR pszkey, IUnknown *punk)
Definition: bindctx.c:285
static ULONG WINAPI BindCtxImpl_AddRef(IBindCtx *iface)
Definition: bindctx.c:107
static HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx *iface, BIND_OPTS *pbindopts)
Definition: bindctx.c:226
static HRESULT WINAPI BindCtxImpl_RevokeObjectBound(IBindCtx *iface, IUnknown *punk)
Definition: bindctx.c:170
static HRESULT WINAPI BindCtxImpl_RegisterObjectBound(IBindCtx *iface, IUnknown *punk)
Definition: bindctx.c:138
static HRESULT WINAPI BindCtxImpl_GetRunningObjectTable(IBindCtx *iface, IRunningObjectTable **pprot)
Definition: bindctx.c:269
static HRESULT WINAPI BindCtxImpl_QueryInterface(IBindCtx *iface, REFIID riid, void **ppvObject)
Definition: bindctx.c:79

Definition at line 471 of file bindctx.c.

Referenced by CreateBindCtx().