2 * Misc marshalling routines
4 * Copyright 2002 Ove Kaaven
5 * Copyright 2003 Mike Hearn
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #define NONAMELESSUNION
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
42 #define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
43 #define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
44 #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
45 #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
47 /* ole32 exports those, not defined in public headers */
48 ULONG __RPC_USER
WdtpInterfacePointer_UserSize(ULONG
*, ULONG
, ULONG
, IUnknown
*, REFIID
);
49 unsigned char * __RPC_USER
WdtpInterfacePointer_UserMarshal(ULONG
*, ULONG
, unsigned char*, IUnknown
*, REFIID
);
50 unsigned char * __RPC_USER
WdtpInterfacePointer_UserUnmarshal(ULONG
*, unsigned char*, IUnknown
**, REFIID
);
52 static void dump_user_flags(const ULONG
*pFlags
)
54 if (HIWORD(*pFlags
) == NDR_LOCAL_DATA_REPRESENTATION
)
55 TRACE("MAKELONG(NDR_LOCAL_REPRESENTATION, ");
57 TRACE("MAKELONG(0x%04x, ", HIWORD(*pFlags
));
58 switch (LOWORD(*pFlags
))
60 case MSHCTX_LOCAL
: TRACE("MSHCTX_LOCAL)"); break;
61 case MSHCTX_NOSHAREDMEM
: TRACE("MSHCTX_NOSHAREDMEM)"); break;
62 case MSHCTX_DIFFERENTMACHINE
: TRACE("MSHCTX_DIFFERENTMACHINE)"); break;
63 case MSHCTX_INPROC
: TRACE("MSHCTX_INPROC)"); break;
64 default: TRACE("%d)", LOWORD(*pFlags
));
68 /* CLEANLOCALSTORAGE */
70 #define CLS_FUNCDESC 'f'
71 #define CLS_LIBATTR 'l'
72 #define CLS_TYPEATTR 't'
73 #define CLS_VARDESC 'v'
75 ULONG WINAPI
CLEANLOCALSTORAGE_UserSize(ULONG
*pFlags
, ULONG Start
, CLEANLOCALSTORAGE
*pstg
)
77 ALIGN_LENGTH(Start
, 3);
78 return Start
+ sizeof(DWORD
);
81 unsigned char * WINAPI
CLEANLOCALSTORAGE_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, CLEANLOCALSTORAGE
*pstg
)
83 ALIGN_POINTER(Buffer
, 3);
84 *(DWORD
*)Buffer
= pstg
->flags
;
86 if (!pstg
->pInterface
)
87 return Buffer
+ sizeof(DWORD
);
92 ITypeLib_ReleaseTLibAttr((ITypeLib
*)pstg
->pInterface
, *(TLIBATTR
**)pstg
->pStorage
);
95 ITypeInfo_ReleaseTypeAttr((ITypeInfo
*)pstg
->pInterface
, *(TYPEATTR
**)pstg
->pStorage
);
98 ITypeInfo_ReleaseFuncDesc((ITypeInfo
*)pstg
->pInterface
, *(FUNCDESC
**)pstg
->pStorage
);
101 ITypeInfo_ReleaseVarDesc((ITypeInfo
*)pstg
->pInterface
, *(VARDESC
**)pstg
->pStorage
);
105 ERR("Unknown type %x\n", pstg
->flags
);
108 *(VOID
**)pstg
->pStorage
= NULL
;
109 IUnknown_Release(pstg
->pInterface
);
110 pstg
->pInterface
= NULL
;
112 return Buffer
+ sizeof(DWORD
);
115 unsigned char * WINAPI
CLEANLOCALSTORAGE_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, CLEANLOCALSTORAGE
*pstr
)
117 ALIGN_POINTER(Buffer
, 3);
118 pstr
->flags
= *(DWORD
*)Buffer
;
119 return Buffer
+ sizeof(DWORD
);
122 void WINAPI
CLEANLOCALSTORAGE_UserFree(ULONG
*pFlags
, CLEANLOCALSTORAGE
*pstr
)
131 DWORD len
; /* No. of chars not including trailing '\0' */
132 DWORD byte_len
; /* len * 2 or 0xffffffff if len == 0 */
133 DWORD len2
; /* == len */
136 ULONG WINAPI
BSTR_UserSize(ULONG
*pFlags
, ULONG Start
, BSTR
*pstr
)
138 TRACE("(%x,%d,%p) => %p\n", *pFlags
, Start
, pstr
, *pstr
);
139 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
140 ALIGN_LENGTH(Start
, 3);
141 Start
+= sizeof(bstr_wire_t
) + ((SysStringByteLen(*pstr
) + 1) & ~1);
142 TRACE("returning %d\n", Start
);
146 unsigned char * WINAPI
BSTR_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, BSTR
*pstr
)
149 DWORD len
= SysStringByteLen(*pstr
);
151 TRACE("(%x,%p,%p) => %p\n", *pFlags
, Buffer
, pstr
, *pstr
);
152 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
154 ALIGN_POINTER(Buffer
, 3);
155 header
= (bstr_wire_t
*)Buffer
;
156 header
->len
= header
->len2
= (len
+ 1) / 2;
159 header
->byte_len
= len
;
160 memcpy(header
+ 1, *pstr
, header
->len
* 2);
163 header
->byte_len
= 0xffffffff; /* special case for a null bstr */
165 return Buffer
+ sizeof(*header
) + sizeof(OLECHAR
) * header
->len
;
168 unsigned char * WINAPI
BSTR_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, BSTR
*pstr
)
171 TRACE("(%x,%p,%p) => %p\n", *pFlags
, Buffer
, pstr
, *pstr
);
173 ALIGN_POINTER(Buffer
, 3);
174 header
= (bstr_wire_t
*)Buffer
;
175 if(header
->len
!= header
->len2
)
176 FIXME("len %08x != len2 %08x\n", header
->len
, header
->len2
);
178 if (header
->byte_len
== 0xffffffff)
180 SysFreeString(*pstr
);
183 else SysReAllocStringLen( pstr
, (OLECHAR
*)(header
+ 1), header
->len
);
185 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
186 return Buffer
+ sizeof(*header
) + sizeof(OLECHAR
) * header
->len
;
189 void WINAPI
BSTR_UserFree(ULONG
*pFlags
, BSTR
*pstr
)
191 TRACE("(%x,%p) => %p\n", *pFlags
, pstr
, *pstr
);
192 SysFreeString(*pstr
);
209 unsigned int get_type_size(ULONG
*pFlags
, VARTYPE vt
)
211 if (vt
& VT_ARRAY
) return 4;
213 switch (vt
& ~VT_BYREF
) {
222 return sizeof(SHORT
);
231 return sizeof(FLOAT
);
233 return sizeof(DOUBLE
);
235 return sizeof(VARIANT_BOOL
);
237 return sizeof(SCODE
);
243 return sizeof(DECIMAL
);
245 return sizeof(ULONG
);
247 return sizeof(VARIANT
);
253 FIXME("unhandled VT %d\n", vt
);
258 static unsigned int get_type_alignment(ULONG
*pFlags
, VARTYPE vt
)
260 unsigned int size
= get_type_size(pFlags
, vt
);
261 if(vt
& VT_BYREF
) return 3;
262 if(size
== 0) return 0;
263 if(size
<= 4) return size
- 1;
267 /* WdtpInterfacePointer_UserSize takes care of 2 additional DWORDs to store marshalling buffer size */
268 static unsigned interface_variant_size(ULONG
*pFlags
, REFIID riid
, IUnknown
*punk
)
274 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), 0, punk
, riid
);
277 ERR("interface variant buffer size calculation failed\n");
281 size
+= sizeof(ULONG
);
282 TRACE("wire-size extra of interface variant is %d\n", size
);
286 static ULONG
wire_extra_user_size(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
291 return LPSAFEARRAY_UserSize(pFlags
, Start
, V_ARRAYREF(pvar
));
293 return LPSAFEARRAY_UserSize(pFlags
, Start
, &V_ARRAY(pvar
));
296 switch (V_VT(pvar
)) {
298 return BSTR_UserSize(pFlags
, Start
, &V_BSTR(pvar
));
299 case VT_BSTR
| VT_BYREF
:
300 return BSTR_UserSize(pFlags
, Start
, V_BSTRREF(pvar
));
301 case VT_VARIANT
| VT_BYREF
:
302 return VARIANT_UserSize(pFlags
, Start
, V_VARIANTREF(pvar
));
304 return Start
+ interface_variant_size(pFlags
, &IID_IUnknown
, V_UNKNOWN(pvar
));
305 case VT_UNKNOWN
| VT_BYREF
:
306 return Start
+ interface_variant_size(pFlags
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
308 return Start
+ interface_variant_size(pFlags
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
309 case VT_DISPATCH
| VT_BYREF
:
310 return Start
+ interface_variant_size(pFlags
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
312 FIXME("wire-size record\n");
315 case VT_SAFEARRAY
| VT_BYREF
:
316 FIXME("wire-size safearray: shouldn't be marshaling this\n");
323 /* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer */
324 static unsigned char* interface_variant_marshal(ULONG
*pFlags
, unsigned char *Buffer
,
325 REFIID riid
, IUnknown
*punk
)
327 TRACE("pFlags=%d, Buffer=%p, pUnk=%p\n", *pFlags
, Buffer
, punk
);
329 /* first DWORD is used to store pointer itself, truncated on win64 */
332 memset(Buffer
, 0, sizeof(ULONG
));
333 return Buffer
+ sizeof(ULONG
);
337 *(DWORD
*)Buffer
= (DWORD_PTR
)punk
;
338 Buffer
+= sizeof(DWORD
);
341 return WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), Buffer
, punk
, riid
);
344 /* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer */
345 static unsigned char *interface_variant_unmarshal(ULONG
*pFlags
, unsigned char *Buffer
,
346 REFIID riid
, IUnknown
**ppunk
)
350 TRACE("pFlags=%d, Buffer=%p, ppUnk=%p\n", *pFlags
, Buffer
, ppunk
);
352 /* skip pointer part itself */
353 ptr
= *(DWORD
*)Buffer
;
354 Buffer
+= sizeof(DWORD
);
359 return WdtpInterfacePointer_UserUnmarshal(pFlags
, Buffer
, ppunk
, riid
);
362 ULONG WINAPI
VARIANT_UserSize(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
365 TRACE("(%x,%d,%p)\n", *pFlags
, Start
, pvar
);
366 TRACE("vt=%04x\n", V_VT(pvar
));
368 ALIGN_LENGTH(Start
, 7);
369 Start
+= sizeof(variant_wire_t
);
370 if(V_VT(pvar
) & VT_BYREF
)
373 align
= get_type_alignment(pFlags
, V_VT(pvar
));
374 ALIGN_LENGTH(Start
, align
);
375 if(V_VT(pvar
) == (VT_VARIANT
| VT_BYREF
))
378 Start
+= get_type_size(pFlags
, V_VT(pvar
));
379 Start
= wire_extra_user_size(pFlags
, Start
, pvar
);
381 TRACE("returning %d\n", Start
);
385 unsigned char * WINAPI
VARIANT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
387 variant_wire_t
*header
;
392 TRACE("(%x,%p,%p)\n", *pFlags
, Buffer
, pvar
);
393 TRACE("vt=%04x\n", V_VT(pvar
));
395 ALIGN_POINTER(Buffer
, 7);
397 header
= (variant_wire_t
*)Buffer
;
399 header
->clSize
= 0; /* fixed up at the end */
400 header
->rpcReserved
= 0;
401 header
->vt
= pvar
->n1
.n2
.vt
;
402 header
->wReserved1
= pvar
->n1
.n2
.wReserved1
;
403 header
->wReserved2
= pvar
->n1
.n2
.wReserved2
;
404 header
->wReserved3
= pvar
->n1
.n2
.wReserved3
;
405 header
->switch_is
= pvar
->n1
.n2
.vt
;
406 if(header
->switch_is
& VT_ARRAY
)
407 header
->switch_is
&= ~VT_TYPEMASK
;
409 Pos
= (unsigned char*)(header
+ 1);
410 type_size
= get_type_size(pFlags
, V_VT(pvar
));
411 align
= get_type_alignment(pFlags
, V_VT(pvar
));
412 ALIGN_POINTER(Pos
, align
);
414 if(header
->vt
& VT_BYREF
)
416 *(DWORD
*)Pos
= max(type_size
, 4);
418 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
420 memcpy(Pos
, pvar
->n1
.n2
.n3
.byref
, type_size
);
425 *(DWORD
*)Pos
= 'U' | 's' << 8 | 'e' << 16 | 'r' << 24;
431 if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
432 memcpy(Pos
, pvar
, type_size
);
434 memcpy(Pos
, &pvar
->n1
.n2
.n3
, type_size
);
438 if(header
->vt
& VT_ARRAY
)
440 if(header
->vt
& VT_BYREF
)
441 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
443 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
450 Pos
= BSTR_UserMarshal(pFlags
, Pos
, &V_BSTR(pvar
));
452 case VT_BSTR
| VT_BYREF
:
453 Pos
= BSTR_UserMarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
455 case VT_VARIANT
| VT_BYREF
:
456 Pos
= VARIANT_UserMarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
459 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWN(pvar
));
461 case VT_UNKNOWN
| VT_BYREF
:
462 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
465 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
467 case VT_DISPATCH
| VT_BYREF
:
468 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
471 FIXME("handle BRECORD by val\n");
473 case VT_RECORD
| VT_BYREF
:
474 FIXME("handle BRECORD by ref\n");
478 header
->clSize
= ((Pos
- Buffer
) + 7) >> 3;
479 TRACE("marshalled size=%d\n", header
->clSize
);
483 unsigned char * WINAPI
VARIANT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
485 variant_wire_t
*header
;
490 TRACE("(%x,%p,%p)\n", *pFlags
, Buffer
, pvar
);
492 ALIGN_POINTER(Buffer
, 7);
494 header
= (variant_wire_t
*)Buffer
;
496 Pos
= (unsigned char*)(header
+ 1);
497 type_size
= get_type_size(pFlags
, header
->vt
);
498 align
= get_type_alignment(pFlags
, header
->vt
);
499 ALIGN_POINTER(Pos
, align
);
501 if(header
->vt
& VT_BYREF
)
506 switch (header
->vt
& ~VT_BYREF
)
508 /* these types have a different memory size compared to wire size */
512 mem_size
= sizeof(void *);
515 mem_size
= type_size
;
519 if (V_VT(pvar
) != header
->vt
)
522 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
523 memset(V_BYREF(pvar
), 0, mem_size
);
525 else if (!V_BYREF(pvar
))
527 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
528 memset(V_BYREF(pvar
), 0, mem_size
);
531 if(!(header
->vt
& VT_ARRAY
)
532 && (header
->vt
& VT_TYPEMASK
) != VT_BSTR
533 && (header
->vt
& VT_TYPEMASK
) != VT_VARIANT
534 && (header
->vt
& VT_TYPEMASK
) != VT_UNKNOWN
535 && (header
->vt
& VT_TYPEMASK
) != VT_DISPATCH
536 && (header
->vt
& VT_TYPEMASK
) != VT_RECORD
)
537 memcpy(V_BYREF(pvar
), Pos
, type_size
);
539 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
547 if(header
->vt
& VT_ARRAY
)
548 V_ARRAY(pvar
) = NULL
;
549 else if((header
->vt
& VT_TYPEMASK
) == VT_BSTR
)
551 else if((header
->vt
& VT_TYPEMASK
) == VT_UNKNOWN
)
552 V_UNKNOWN(pvar
) = NULL
;
553 else if((header
->vt
& VT_TYPEMASK
) == VT_DISPATCH
)
554 V_DISPATCH(pvar
) = NULL
;
555 else if((header
->vt
& VT_TYPEMASK
) == VT_RECORD
)
556 V_RECORD(pvar
) = NULL
;
557 else if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
558 memcpy(pvar
, Pos
, type_size
);
560 memcpy(&pvar
->n1
.n2
.n3
, Pos
, type_size
);
564 pvar
->n1
.n2
.vt
= header
->vt
;
565 pvar
->n1
.n2
.wReserved1
= header
->wReserved1
;
566 pvar
->n1
.n2
.wReserved2
= header
->wReserved2
;
567 pvar
->n1
.n2
.wReserved3
= header
->wReserved3
;
569 if(header
->vt
& VT_ARRAY
)
571 if(header
->vt
& VT_BYREF
)
572 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
574 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
581 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, &V_BSTR(pvar
));
583 case VT_BSTR
| VT_BYREF
:
584 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
586 case VT_VARIANT
| VT_BYREF
:
587 Pos
= VARIANT_UserUnmarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
590 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IUnknown
, &V_UNKNOWN(pvar
));
592 case VT_UNKNOWN
| VT_BYREF
:
593 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWNREF(pvar
));
596 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)&V_DISPATCH(pvar
));
598 case VT_DISPATCH
| VT_BYREF
:
599 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)V_DISPATCHREF(pvar
));
602 FIXME("handle BRECORD by val\n");
604 case VT_RECORD
| VT_BYREF
:
605 FIXME("handle BRECORD by ref\n");
612 void WINAPI
VARIANT_UserFree(ULONG
*pFlags
, VARIANT
*pvar
)
614 VARTYPE vt
= V_VT(pvar
);
617 TRACE("(%x,%p)\n", *pFlags
, pvar
);
618 TRACE("vt=%04x\n", V_VT(pvar
));
620 if (vt
& VT_BYREF
) ref
= pvar
->n1
.n2
.n3
.byref
;
628 LPSAFEARRAY_UserFree(pFlags
, V_ARRAYREF(pvar
));
630 LPSAFEARRAY_UserFree(pFlags
, &V_ARRAY(pvar
));
636 case VT_BSTR
| VT_BYREF
:
637 BSTR_UserFree(pFlags
, V_BSTRREF(pvar
));
639 case VT_VARIANT
| VT_BYREF
:
640 VARIANT_UserFree(pFlags
, V_VARIANTREF(pvar
));
642 case VT_RECORD
| VT_BYREF
:
643 FIXME("handle BRECORD by ref\n");
645 case VT_UNKNOWN
| VT_BYREF
:
646 case VT_DISPATCH
| VT_BYREF
:
647 IUnknown_Release(*V_UNKNOWNREF(pvar
));
657 /* Get the number of cells in a SafeArray */
658 static ULONG
SAFEARRAY_GetCellCount(const SAFEARRAY
*psa
)
660 const SAFEARRAYBOUND
* psab
= psa
->rgsabound
;
661 USHORT cCount
= psa
->cDims
;
662 ULONG ulNumCells
= 1;
666 /* This is a valid bordercase. See testcases. -Marcus */
667 if (!psab
->cElements
)
669 ulNumCells
*= psab
->cElements
;
675 static inline SF_TYPE
SAFEARRAY_GetUnionType(SAFEARRAY
*psa
)
680 hr
= SafeArrayGetVartype(psa
, &vt
);
683 if(psa
->fFeatures
& FADF_VARIANT
) return SF_VARIANT
;
685 switch(psa
->cbElements
)
687 case 1: vt
= VT_I1
; break;
688 case 2: vt
= VT_I2
; break;
689 case 4: vt
= VT_I4
; break;
690 case 8: vt
= VT_I8
; break;
692 RpcRaiseException(hr
);
696 if (psa
->fFeatures
& FADF_HAVEIID
)
702 case VT_UI1
: return SF_I1
;
705 case VT_UI2
: return SF_I2
;
710 case VT_R4
: return SF_I4
;
715 case VT_UI8
: return SF_I8
;
717 case VT_UINT_PTR
: return (sizeof(UINT_PTR
) == 4 ? SF_I4
: SF_I8
);
718 case VT_BSTR
: return SF_BSTR
;
719 case VT_DISPATCH
: return SF_DISPATCH
;
720 case VT_VARIANT
: return SF_VARIANT
;
721 case VT_UNKNOWN
: return SF_UNKNOWN
;
722 /* Note: Return a non-zero size to indicate vt is valid. The actual size
723 * of a UDT is taken from the result of IRecordInfo_GetSize().
725 case VT_RECORD
: return SF_RECORD
;
726 default: return SF_ERROR
;
730 static DWORD
elem_wire_size(LPSAFEARRAY lpsa
, SF_TYPE sftype
)
732 if (sftype
== SF_BSTR
)
733 return sizeof(DWORD
);
734 else if (sftype
== SF_VARIANT
)
735 return sizeof(variant_wire_t
) - sizeof(DWORD
);
737 return lpsa
->cbElements
;
740 static DWORD
elem_mem_size(wireSAFEARRAY wiresa
, SF_TYPE sftype
)
742 if (sftype
== SF_BSTR
)
744 else if (sftype
== SF_VARIANT
)
745 return sizeof(VARIANT
);
747 return wiresa
->cbElements
;
750 ULONG WINAPI
LPSAFEARRAY_UserSize(ULONG
*pFlags
, ULONG StartingSize
, LPSAFEARRAY
*ppsa
)
752 ULONG size
= StartingSize
;
754 TRACE("("); dump_user_flags(pFlags
); TRACE(", %d, %p\n", StartingSize
, *ppsa
);
756 ALIGN_LENGTH(size
, 3);
757 size
+= sizeof(ULONG
);
760 SAFEARRAY
*psa
= *ppsa
;
761 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
765 size
+= sizeof(ULONG
);
766 size
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
768 sftype
= SAFEARRAY_GetUnionType(psa
);
769 size
+= sizeof(ULONG
);
771 size
+= sizeof(ULONG
);
772 size
+= sizeof(ULONG
);
773 if (sftype
== SF_HAVEIID
)
776 size
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
778 size
+= sizeof(ULONG
);
786 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
787 size
= BSTR_UserSize(pFlags
, size
, lpBstr
);
794 FIXME("size interfaces\n");
800 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
801 size
= VARIANT_UserSize(pFlags
, size
, lpVariant
);
807 IRecordInfo
* pRecInfo
= NULL
;
809 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
811 RpcRaiseException(hr
);
815 FIXME("size record info %p\n", pRecInfo
);
817 IRecordInfo_Release(pRecInfo
);
822 ALIGN_LENGTH(size
, 7);
827 size
+= ulCellCount
* psa
->cbElements
;
838 unsigned char * WINAPI
LPSAFEARRAY_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
842 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, &%p\n", Buffer
, *ppsa
);
844 ALIGN_POINTER(Buffer
, 3);
845 *(ULONG
*)Buffer
= *ppsa
? 0x1 : 0x0;
846 Buffer
+= sizeof(ULONG
);
850 SAFEARRAY
*psa
= *ppsa
;
851 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
852 SAFEARRAYBOUND
*bound
;
857 sftype
= SAFEARRAY_GetUnionType(psa
);
859 *(ULONG
*)Buffer
= psa
->cDims
;
860 Buffer
+= sizeof(ULONG
);
861 *(USHORT
*)Buffer
= psa
->cDims
;
862 Buffer
+= sizeof(USHORT
);
863 *(USHORT
*)Buffer
= psa
->fFeatures
;
864 Buffer
+= sizeof(USHORT
);
865 *(ULONG
*)Buffer
= elem_wire_size(psa
, sftype
);
866 Buffer
+= sizeof(ULONG
);
868 hr
= SafeArrayGetVartype(psa
, &vt
);
869 if (FAILED(hr
)) vt
= 0;
871 *(ULONG
*)Buffer
= (USHORT
)psa
->cLocks
| (vt
<< 16);
872 Buffer
+= sizeof(ULONG
);
874 *(ULONG
*)Buffer
= sftype
;
875 Buffer
+= sizeof(ULONG
);
877 *(ULONG
*)Buffer
= ulCellCount
;
878 Buffer
+= sizeof(ULONG
);
879 *(ULONG
*)Buffer
= psa
->pvData
? 0x2 : 0x0;
880 Buffer
+= sizeof(ULONG
);
881 if (sftype
== SF_HAVEIID
)
883 SafeArrayGetIID(psa
, &guid
);
884 memcpy(Buffer
, &guid
, sizeof(guid
));
885 Buffer
+= sizeof(guid
);
888 /* bounds are marshaled in opposite order comparing to storage layout */
889 bound
= (SAFEARRAYBOUND
*)Buffer
;
890 for (i
= 0; i
< psa
->cDims
; i
++)
892 memcpy(bound
++, &psa
->rgsabound
[psa
->cDims
-i
-1], sizeof(psa
->rgsabound
[0]));
894 Buffer
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
896 *(ULONG
*)Buffer
= ulCellCount
;
897 Buffer
+= sizeof(ULONG
);
907 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
908 Buffer
= BSTR_UserMarshal(pFlags
, Buffer
, lpBstr
);
915 FIXME("marshal interfaces\n");
921 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
922 Buffer
= VARIANT_UserMarshal(pFlags
, Buffer
, lpVariant
);
928 IRecordInfo
* pRecInfo
= NULL
;
930 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
932 RpcRaiseException(hr
);
936 FIXME("write record info %p\n", pRecInfo
);
938 IRecordInfo_Release(pRecInfo
);
944 ALIGN_POINTER(Buffer
, 7);
949 /* Just copy the data over */
950 memcpy(Buffer
, psa
->pvData
, ulCellCount
* psa
->cbElements
);
951 Buffer
+= ulCellCount
* psa
->cbElements
;
962 #define FADF_AUTOSETFLAGS (FADF_HAVEIID | FADF_RECORD | FADF_HAVEVARTYPE | \
963 FADF_BSTR | FADF_UNKNOWN | FADF_DISPATCH | \
964 FADF_VARIANT | FADF_CREATEVECTOR)
966 unsigned char * WINAPI
LPSAFEARRAY_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
969 wireSAFEARRAY wiresa
;
976 SAFEARRAYBOUND
*wiresab
;
978 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, %p\n", Buffer
, ppsa
);
980 ALIGN_POINTER(Buffer
, 3);
981 ptr
= *(ULONG
*)Buffer
;
982 Buffer
+= sizeof(ULONG
);
986 SafeArrayDestroy(*ppsa
);
989 TRACE("NULL safe array unmarshaled\n");
994 cDims
= *(ULONG
*)Buffer
;
995 Buffer
+= sizeof(ULONG
);
997 wiresa
= (wireSAFEARRAY
)Buffer
;
998 Buffer
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
1000 if (cDims
!= wiresa
->cDims
)
1001 RpcRaiseException(RPC_S_INVALID_BOUND
);
1003 /* FIXME: there should be a limit on how large cDims can be */
1005 vt
= HIWORD(wiresa
->cLocks
);
1007 sftype
= *(ULONG
*)Buffer
;
1008 Buffer
+= sizeof(ULONG
);
1010 cell_count
= *(ULONG
*)Buffer
;
1011 Buffer
+= sizeof(ULONG
);
1012 ptr
= *(ULONG
*)Buffer
;
1013 Buffer
+= sizeof(ULONG
);
1014 if (sftype
== SF_HAVEIID
)
1016 memcpy(&guid
, Buffer
, sizeof(guid
));
1017 Buffer
+= sizeof(guid
);
1020 wiresab
= (SAFEARRAYBOUND
*)Buffer
;
1021 Buffer
+= sizeof(wiresab
[0]) * wiresa
->cDims
;
1023 if(*ppsa
&& (*ppsa
)->cDims
==wiresa
->cDims
)
1025 if(((*ppsa
)->fFeatures
& ~FADF_AUTOSETFLAGS
) != (wiresa
->fFeatures
& ~FADF_AUTOSETFLAGS
))
1026 RpcRaiseException(DISP_E_BADCALLEE
);
1028 if(SAFEARRAY_GetCellCount(*ppsa
)*(*ppsa
)->cbElements
!= cell_count
*elem_mem_size(wiresa
, sftype
))
1030 if((*ppsa
)->fFeatures
& (FADF_AUTO
|FADF_STATIC
|FADF_EMBEDDED
|FADF_FIXEDSIZE
))
1031 RpcRaiseException(DISP_E_BADCALLEE
);
1033 hr
= SafeArrayDestroyData(*ppsa
);
1035 RpcRaiseException(hr
);
1037 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(*wiresab
)*wiresa
->cDims
);
1039 if((*ppsa
)->fFeatures
& FADF_HAVEVARTYPE
)
1040 ((DWORD
*)(*ppsa
))[-1] = vt
;
1044 SafeArrayDestroy(*ppsa
);
1045 *ppsa
= SafeArrayCreateEx(vt
, wiresa
->cDims
, wiresab
, NULL
);
1046 if (!*ppsa
) RpcRaiseException(E_OUTOFMEMORY
);
1050 SafeArrayDestroy(*ppsa
);
1051 if (FAILED(SafeArrayAllocDescriptor(wiresa
->cDims
, ppsa
)))
1052 RpcRaiseException(E_OUTOFMEMORY
);
1053 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(SAFEARRAYBOUND
) * wiresa
->cDims
);
1056 /* be careful about which flags we set since they could be a security
1058 (*ppsa
)->fFeatures
&= FADF_AUTOSETFLAGS
;
1059 (*ppsa
)->fFeatures
|= (wiresa
->fFeatures
& ~(FADF_AUTOSETFLAGS
));
1060 /* FIXME: there should be a limit on how large wiresa->cbElements can be */
1061 (*ppsa
)->cbElements
= elem_mem_size(wiresa
, sftype
);
1063 /* SafeArrayCreateEx allocates the data for us, but
1064 * SafeArrayAllocDescriptor doesn't */
1065 if(!(*ppsa
)->pvData
)
1067 hr
= SafeArrayAllocData(*ppsa
);
1069 RpcRaiseException(hr
);
1072 if ((*(ULONG
*)Buffer
!= cell_count
) || (SAFEARRAY_GetCellCount(*ppsa
) != cell_count
))
1073 RpcRaiseException(RPC_S_INVALID_BOUND
);
1074 Buffer
+= sizeof(ULONG
);
1084 for (lpBstr
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpBstr
++)
1085 Buffer
= BSTR_UserUnmarshal(pFlags
, Buffer
, lpBstr
);
1092 FIXME("marshal interfaces\n");
1098 for (lpVariant
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpVariant
++)
1099 Buffer
= VARIANT_UserUnmarshal(pFlags
, Buffer
, lpVariant
);
1105 FIXME("set record info\n");
1111 ALIGN_POINTER(Buffer
, 7);
1116 /* Just copy the data over */
1117 memcpy((*ppsa
)->pvData
, Buffer
, cell_count
* (*ppsa
)->cbElements
);
1118 Buffer
+= cell_count
* (*ppsa
)->cbElements
;
1125 TRACE("safe array unmarshaled: %p\n", *ppsa
);
1130 void WINAPI
LPSAFEARRAY_UserFree(ULONG
*pFlags
, LPSAFEARRAY
*ppsa
)
1132 TRACE("("); dump_user_flags(pFlags
); TRACE(", &%p\n", *ppsa
);
1134 SafeArrayDestroy(*ppsa
);
1139 ULONG WINAPI
HFONT_UserSize(ULONG
*pFlags
, ULONG Start
, HFONT
*phfont
)
1145 unsigned char * WINAPI
HFONT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1151 unsigned char * WINAPI
HFONT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1157 void WINAPI
HFONT_UserFree(ULONG
*pFlags
, HFONT
*phfont
)
1165 /* exactly how Invoke is marshalled is not very clear to me yet,
1166 * but the way I've done it seems to work for me */
1168 HRESULT CALLBACK
IDispatch_Invoke_Proxy(
1170 DISPID dispIdMember
,
1174 DISPPARAMS
* pDispParams
,
1175 VARIANT
* pVarResult
,
1176 EXCEPINFO
* pExcepInfo
,
1181 UINT
* rgVarRefIdx
= NULL
;
1182 VARIANTARG
* rgVarRef
= NULL
;
1185 EXCEPINFO ExcepInfo
;
1187 TRACE("(%p)->(%d,%s,%x,%x,%p,%p,%p,%p)\n", This
,
1188 dispIdMember
, debugstr_guid(riid
),
1189 lcid
, wFlags
, pDispParams
, pVarResult
,
1190 pExcepInfo
, puArgErr
);
1192 /* [out] args can't be null, use dummy vars if needed */
1193 if (!pVarResult
) pVarResult
= &VarResult
;
1194 if (!puArgErr
) puArgErr
= &uArgErr
;
1195 if (!pExcepInfo
) pExcepInfo
= &ExcepInfo
;
1197 /* count by-ref args */
1198 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1199 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1200 if (V_ISBYREF(arg
)) {
1205 rgVarRefIdx
= CoTaskMemAlloc(sizeof(UINT
)*cVarRef
);
1206 rgVarRef
= CoTaskMemAlloc(sizeof(VARIANTARG
)*cVarRef
);
1207 /* make list of by-ref args */
1208 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1209 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1210 if (V_ISBYREF(arg
)) {
1211 rgVarRefIdx
[cVarRef
] = u
;
1212 VariantInit(&rgVarRef
[cVarRef
]);
1213 VariantCopy(&rgVarRef
[cVarRef
], arg
);
1219 /* [out] args still can't be null,
1220 * but we can point these anywhere in this case,
1221 * since they won't be written to when cVarRef is 0 */
1222 rgVarRefIdx
= puArgErr
;
1223 rgVarRef
= pVarResult
;
1225 TRACE("passed by ref: %d args\n", cVarRef
);
1226 hr
= IDispatch_RemoteInvoke_Proxy(This
,
1239 for (u
=0; u
<cVarRef
; u
++) {
1240 unsigned i
= rgVarRefIdx
[u
];
1241 VariantCopy(&pDispParams
->rgvarg
[i
],
1243 VariantClear(&rgVarRef
[u
]);
1245 CoTaskMemFree(rgVarRef
);
1246 CoTaskMemFree(rgVarRefIdx
);
1249 if(pExcepInfo
== &ExcepInfo
)
1251 SysFreeString(pExcepInfo
->bstrSource
);
1252 SysFreeString(pExcepInfo
->bstrDescription
);
1253 SysFreeString(pExcepInfo
->bstrHelpFile
);
1258 HRESULT __RPC_STUB
IDispatch_Invoke_Stub(
1260 DISPID dispIdMember
,
1264 DISPPARAMS
* pDispParams
,
1265 VARIANT
* pVarResult
,
1266 EXCEPINFO
* pExcepInfo
,
1270 VARIANTARG
* rgVarRef
)
1273 VARIANTARG
*rgvarg
, *arg
;
1276 /* initialize out parameters, so that they can be marshalled
1277 * in case the real Invoke doesn't initialize them */
1278 VariantInit(pVarResult
);
1279 memset(pExcepInfo
, 0, sizeof(*pExcepInfo
));
1282 /* let the real Invoke operate on a copy of the in parameters,
1283 * so we don't risk losing pointers to allocated memory */
1284 rgvarg
= pDispParams
->rgvarg
;
1285 arg
= CoTaskMemAlloc(sizeof(VARIANTARG
)*pDispParams
->cArgs
);
1286 if (!arg
) return E_OUTOFMEMORY
;
1288 /* init all args so we can call VariantClear on all the args if the copy
1290 for (u
= 0; u
< pDispParams
->cArgs
; u
++)
1291 VariantInit(&arg
[u
]);
1293 for (u
= 0; u
< pDispParams
->cArgs
; u
++) {
1294 hr
= VariantCopy(&arg
[u
], &rgvarg
[u
]);
1299 if (SUCCEEDED(hr
)) {
1300 /* copy ref args to arg array */
1301 for (u
=0; u
<cVarRef
; u
++) {
1302 unsigned i
= rgVarRefIdx
[u
];
1303 VariantCopy(&arg
[i
], &rgVarRef
[u
]);
1306 pDispParams
->rgvarg
= arg
;
1308 hr
= IDispatch_Invoke(This
,
1318 /* copy ref args from arg array */
1319 for (u
=0; u
<cVarRef
; u
++) {
1320 unsigned i
= rgVarRefIdx
[u
];
1321 VariantCopy(&rgVarRef
[u
], &arg
[i
]);
1325 /* clear the duplicate argument list */
1326 for (u
=0; u
<pDispParams
->cArgs
; u
++)
1327 VariantClear(&arg
[u
]);
1329 pDispParams
->rgvarg
= rgvarg
;
1337 HRESULT CALLBACK
IEnumVARIANT_Next_Proxy(
1341 ULONG
* pCeltFetched
)
1345 pCeltFetched
= &fetched
;
1346 return IEnumVARIANT_RemoteNext_Proxy(This
,
1352 HRESULT __RPC_STUB
IEnumVARIANT_Next_Stub(
1356 ULONG
* pCeltFetched
)
1360 hr
= IEnumVARIANT_Next(This
,
1364 if (hr
== S_OK
) *pCeltFetched
= celt
;
1368 /* TypeInfo related freers */
1370 static void free_embedded_typedesc(TYPEDESC
*tdesc
);
1371 static void free_embedded_arraydesc(ARRAYDESC
*adesc
)
1373 switch(adesc
->tdescElem
.vt
)
1377 free_embedded_typedesc(adesc
->tdescElem
.u
.lptdesc
);
1378 CoTaskMemFree(adesc
->tdescElem
.u
.lptdesc
);
1381 free_embedded_arraydesc(adesc
->tdescElem
.u
.lpadesc
);
1382 CoTaskMemFree(adesc
->tdescElem
.u
.lpadesc
);
1387 static void free_embedded_typedesc(TYPEDESC
*tdesc
)
1393 free_embedded_typedesc(tdesc
->u
.lptdesc
);
1394 CoTaskMemFree(tdesc
->u
.lptdesc
);
1397 free_embedded_arraydesc(tdesc
->u
.lpadesc
);
1398 CoTaskMemFree(tdesc
->u
.lpadesc
);
1403 static void free_embedded_elemdesc(ELEMDESC
*edesc
)
1405 free_embedded_typedesc(&edesc
->tdesc
);
1406 if(edesc
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FHASDEFAULT
)
1407 CoTaskMemFree(edesc
->u
.paramdesc
.pparamdescex
);
1412 HRESULT CALLBACK
ITypeComp_Bind_Proxy(
1421 CLEANLOCALSTORAGE stg
= { 0 };
1422 ITypeComp
*typecomp
;
1427 TRACE("(%p, %s, %#x, %#x, %p, %p, %p)\n", This
, debugstr_w(name
), lHashVal
, flags
, ti
,
1430 *desckind
= DESCKIND_NONE
;
1431 memset(bindptr
, 0, sizeof(*bindptr
));
1433 hr
= ITypeComp_RemoteBind_Proxy(This
, name
, lHashVal
, flags
, ti
, desckind
,
1434 &funcdesc
, &vardesc
, &typecomp
, &stg
);
1440 case DESCKIND_FUNCDESC
:
1441 bindptr
->lpfuncdesc
= funcdesc
;
1443 case DESCKIND_VARDESC
:
1444 case DESCKIND_IMPLICITAPPOBJ
:
1445 bindptr
->lpvardesc
= vardesc
;
1447 case DESCKIND_TYPECOMP
:
1448 bindptr
->lptcomp
= typecomp
;
1458 HRESULT __RPC_STUB
ITypeComp_Bind_Stub(
1465 FUNCDESC
**funcdesc
,
1467 ITypeComp
**typecomp
,
1468 CLEANLOCALSTORAGE
*stg
)
1473 TRACE("(%p, %s, %#x, %#x, %p, %p, %p, %p, %p, %p)\n", This
, debugstr_w(name
),
1474 lHashVal
, flags
, ti
, desckind
, funcdesc
, vardesc
, typecomp
, stg
);
1476 memset(stg
, 0, sizeof(*stg
));
1477 memset(&bindptr
, 0, sizeof(bindptr
));
1484 hr
= ITypeComp_Bind(This
, name
, lHashVal
, flags
, ti
, desckind
, &bindptr
);
1490 case DESCKIND_FUNCDESC
:
1491 *funcdesc
= bindptr
.lpfuncdesc
;
1492 stg
->pInterface
= (IUnknown
*)*ti
;
1493 stg
->pStorage
= funcdesc
;
1494 stg
->flags
= CLS_FUNCDESC
;
1496 case DESCKIND_VARDESC
:
1497 case DESCKIND_IMPLICITAPPOBJ
:
1498 *vardesc
= bindptr
.lpvardesc
;
1499 stg
->pInterface
= (IUnknown
*)*ti
;
1500 stg
->pStorage
= vardesc
;
1501 stg
->flags
= CLS_VARDESC
;
1503 case DESCKIND_TYPECOMP
:
1504 *typecomp
= bindptr
.lptcomp
;
1510 if (stg
->pInterface
)
1511 IUnknown_AddRef(stg
->pInterface
);
1516 HRESULT CALLBACK
ITypeComp_BindType_Proxy(
1521 ITypeComp
**typecomp
)
1525 TRACE("(%p, %s, %#x, %p, %p)\n", This
, debugstr_w(name
), lHashVal
, ti
, typecomp
);
1527 hr
= ITypeComp_RemoteBindType_Proxy(This
, name
, lHashVal
, ti
);
1529 ITypeInfo_GetTypeComp(*ti
, typecomp
);
1536 HRESULT __RPC_STUB
ITypeComp_BindType_Stub(
1542 ITypeComp
*typecomp
= NULL
;
1545 TRACE("(%p, %s, %#x, %p)\n", This
, debugstr_w(name
), lHashVal
, ti
);
1547 hr
= ITypeComp_BindType(This
, name
, lHashVal
, ti
, &typecomp
);
1550 ITypeComp_Release(typecomp
);
1557 HRESULT CALLBACK
ITypeInfo_GetTypeAttr_Proxy(
1559 TYPEATTR
** ppTypeAttr
)
1562 CLEANLOCALSTORAGE stg
;
1563 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1566 stg
.pStorage
= NULL
;
1567 stg
.pInterface
= NULL
;
1569 return ITypeInfo_RemoteGetTypeAttr_Proxy(This
, ppTypeAttr
, &stg
);
1572 HRESULT __RPC_STUB
ITypeInfo_GetTypeAttr_Stub(
1574 LPTYPEATTR
* ppTypeAttr
,
1575 CLEANLOCALSTORAGE
* pDummy
)
1578 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1580 hr
= ITypeInfo_GetTypeAttr(This
, ppTypeAttr
);
1584 pDummy
->flags
= CLS_TYPEATTR
;
1585 ITypeInfo_AddRef(This
);
1586 pDummy
->pInterface
= (IUnknown
*)This
;
1587 pDummy
->pStorage
= ppTypeAttr
;
1591 HRESULT CALLBACK
ITypeInfo_GetFuncDesc_Proxy(
1594 FUNCDESC
** ppFuncDesc
)
1596 CLEANLOCALSTORAGE stg
;
1597 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1600 stg
.pStorage
= NULL
;
1601 stg
.pInterface
= NULL
;
1603 return ITypeInfo_RemoteGetFuncDesc_Proxy(This
, index
, ppFuncDesc
, &stg
);
1606 HRESULT __RPC_STUB
ITypeInfo_GetFuncDesc_Stub(
1609 LPFUNCDESC
* ppFuncDesc
,
1610 CLEANLOCALSTORAGE
* pDummy
)
1613 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1615 hr
= ITypeInfo_GetFuncDesc(This
, index
, ppFuncDesc
);
1619 pDummy
->flags
= CLS_FUNCDESC
;
1620 ITypeInfo_AddRef(This
);
1621 pDummy
->pInterface
= (IUnknown
*)This
;
1622 pDummy
->pStorage
= ppFuncDesc
;
1626 HRESULT CALLBACK
ITypeInfo_GetVarDesc_Proxy(
1629 VARDESC
** ppVarDesc
)
1631 CLEANLOCALSTORAGE stg
;
1632 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1635 stg
.pStorage
= NULL
;
1636 stg
.pInterface
= NULL
;
1638 return ITypeInfo_RemoteGetVarDesc_Proxy(This
, index
, ppVarDesc
, &stg
);
1641 HRESULT __RPC_STUB
ITypeInfo_GetVarDesc_Stub(
1644 LPVARDESC
* ppVarDesc
,
1645 CLEANLOCALSTORAGE
* pDummy
)
1648 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1650 hr
= ITypeInfo_GetVarDesc(This
, index
, ppVarDesc
);
1654 pDummy
->flags
= CLS_VARDESC
;
1655 ITypeInfo_AddRef(This
);
1656 pDummy
->pInterface
= (IUnknown
*)This
;
1657 pDummy
->pStorage
= ppVarDesc
;
1661 HRESULT CALLBACK
ITypeInfo_GetNames_Proxy(
1668 TRACE("(%p, %08x, %p, %d, %p)\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1670 return ITypeInfo_RemoteGetNames_Proxy(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1673 HRESULT __RPC_STUB
ITypeInfo_GetNames_Stub(
1680 TRACE("(%p, %08x, %p, %d, %p)\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1682 return ITypeInfo_GetNames(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1685 HRESULT CALLBACK
ITypeInfo_GetIDsOfNames_Proxy(
1687 LPOLESTR
* rgszNames
,
1691 FIXME("not implemented\n");
1695 HRESULT __RPC_STUB
ITypeInfo_GetIDsOfNames_Stub(
1698 FIXME("not implemented\n");
1702 HRESULT CALLBACK
ITypeInfo_Invoke_Proxy(
1707 DISPPARAMS
* pDispParams
,
1708 VARIANT
* pVarResult
,
1709 EXCEPINFO
* pExcepInfo
,
1712 FIXME("not implemented\n");
1716 HRESULT __RPC_STUB
ITypeInfo_Invoke_Stub(
1719 FIXME("not implemented\n");
1723 HRESULT CALLBACK
ITypeInfo_GetDocumentation_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1724 BSTR
*name
, BSTR
*doc_string
,
1725 DWORD
*help_context
, BSTR
*help_file
)
1727 DWORD dummy_help_context
, flags
= 0;
1728 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
1730 TRACE("(%p, %08x, %p, %p, %p, %p)\n", This
, memid
, name
, doc_string
, help_context
, help_file
);
1732 if(!name
) name
= &dummy_name
;
1735 if(!doc_string
) doc_string
= &dummy_doc_string
;
1738 if(!help_context
) help_context
= &dummy_help_context
;
1741 if(!help_file
) help_file
= &dummy_help_file
;
1744 hr
= ITypeInfo_RemoteGetDocumentation_Proxy(This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1746 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1751 HRESULT __RPC_STUB
ITypeInfo_GetDocumentation_Stub(ITypeInfo
*This
, MEMBERID memid
,
1752 DWORD flags
, BSTR
*name
, BSTR
*doc_string
,
1753 DWORD
*help_context
, BSTR
*help_file
)
1755 TRACE("(%p, %08x, %08x, %p, %p, %p, %p)\n", This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1757 *name
= *doc_string
= *help_file
= NULL
;
1760 if(!(flags
& 1)) name
= NULL
;
1761 if(!(flags
& 2)) doc_string
= NULL
;
1762 if(!(flags
& 4)) help_context
= NULL
;
1763 if(!(flags
& 8)) help_file
= NULL
;
1765 return ITypeInfo_GetDocumentation(This
, memid
, name
, doc_string
, help_context
, help_file
);
1768 HRESULT CALLBACK
ITypeInfo_GetDllEntry_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1769 INVOKEKIND invkind
, BSTR
*dll_name
,
1770 BSTR
* name
, WORD
*ordinal
)
1773 BSTR dummy_dll_name
, dummy_name
;
1776 TRACE("(%p, %08x, %x, %p, %p, %p)\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1778 if(!dll_name
) dll_name
= &dummy_dll_name
;
1781 if(!name
) name
= &dummy_name
;
1784 if(!ordinal
) ordinal
= &dummy_ordinal
;
1787 hr
= ITypeInfo_RemoteGetDllEntry_Proxy(This
, memid
, invkind
, flags
, dll_name
, name
, ordinal
);
1789 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1794 HRESULT __RPC_STUB
ITypeInfo_GetDllEntry_Stub(ITypeInfo
*This
, MEMBERID memid
,
1795 INVOKEKIND invkind
, DWORD flags
,
1796 BSTR
*dll_name
, BSTR
*name
,
1799 TRACE("(%p, %08x, %x, %p, %p, %p)\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1801 *dll_name
= *name
= NULL
;
1804 if(!(flags
& 1)) dll_name
= NULL
;
1805 if(!(flags
& 2)) name
= NULL
;
1806 if(!(flags
& 4)) ordinal
= NULL
;
1808 return ITypeInfo_GetDllEntry(This
, memid
, invkind
, dll_name
, name
, ordinal
);
1811 HRESULT CALLBACK
ITypeInfo_AddressOfMember_Proxy(
1817 FIXME("not implemented\n");
1821 HRESULT __RPC_STUB
ITypeInfo_AddressOfMember_Stub(
1824 FIXME("not implemented\n");
1828 HRESULT CALLBACK
ITypeInfo_CreateInstance_Proxy(
1830 IUnknown
* pUnkOuter
,
1834 FIXME("not implemented\n");
1838 HRESULT __RPC_STUB
ITypeInfo_CreateInstance_Stub(
1843 FIXME("not implemented\n");
1847 HRESULT CALLBACK
ITypeInfo_GetContainingTypeLib_Proxy(
1856 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1858 hr
= ITypeInfo_RemoteGetContainingTypeLib_Proxy(This
, &pTL
, &index
);
1867 ITypeLib_Release(pTL
);
1872 HRESULT __RPC_STUB
ITypeInfo_GetContainingTypeLib_Stub(
1877 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1878 return ITypeInfo_GetContainingTypeLib(This
, ppTLib
, pIndex
);
1881 void CALLBACK
ITypeInfo_ReleaseTypeAttr_Proxy(
1883 TYPEATTR
* pTypeAttr
)
1885 TRACE("(%p, %p)\n", This
, pTypeAttr
);
1886 free_embedded_typedesc(&pTypeAttr
->tdescAlias
);
1887 CoTaskMemFree(pTypeAttr
);
1890 HRESULT __RPC_STUB
ITypeInfo_ReleaseTypeAttr_Stub(
1893 TRACE("nothing to do\n");
1897 void CALLBACK
ITypeInfo_ReleaseFuncDesc_Proxy(
1899 FUNCDESC
* pFuncDesc
)
1902 TRACE("(%p, %p)\n", This
, pFuncDesc
);
1904 for(param
= 0; param
< pFuncDesc
->cParams
; param
++)
1905 free_embedded_elemdesc(pFuncDesc
->lprgelemdescParam
+ param
);
1907 CoTaskMemFree(pFuncDesc
->lprgelemdescParam
);
1909 free_embedded_elemdesc(&pFuncDesc
->elemdescFunc
);
1911 if(pFuncDesc
->cScodes
!= 0 && pFuncDesc
->cScodes
!= -1)
1912 CoTaskMemFree(pFuncDesc
->lprgscode
);
1914 CoTaskMemFree(pFuncDesc
);
1917 HRESULT __RPC_STUB
ITypeInfo_ReleaseFuncDesc_Stub(
1920 TRACE("nothing to do\n");
1924 void CALLBACK
ITypeInfo_ReleaseVarDesc_Proxy(
1928 TRACE("(%p, %p)\n", This
, pVarDesc
);
1930 CoTaskMemFree(pVarDesc
->lpstrSchema
);
1932 if(pVarDesc
->varkind
== VAR_CONST
)
1933 CoTaskMemFree(pVarDesc
->u
.lpvarValue
);
1935 free_embedded_elemdesc(&pVarDesc
->elemdescVar
);
1936 CoTaskMemFree(pVarDesc
);
1939 HRESULT __RPC_STUB
ITypeInfo_ReleaseVarDesc_Stub(
1942 TRACE("nothing to do\n");
1949 HRESULT CALLBACK
ITypeInfo2_GetDocumentation2_Proxy(ITypeInfo2
*This
, MEMBERID memid
,
1950 LCID lcid
, BSTR
*help_string
,
1951 DWORD
*help_context
, BSTR
*help_dll
)
1953 DWORD dummy_help_context
, flags
= 0;
1954 BSTR dummy_help_string
, dummy_help_dll
;
1956 TRACE("(%p, %08x, %08x, %p, %p, %p)\n", This
, memid
, lcid
, help_string
, help_context
, help_dll
);
1958 if(!help_string
) help_string
= &dummy_help_string
;
1961 if(!help_context
) help_context
= &dummy_help_context
;
1964 if(!help_dll
) help_dll
= &dummy_help_dll
;
1967 hr
= ITypeInfo2_RemoteGetDocumentation2_Proxy(This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
1969 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1974 HRESULT __RPC_STUB
ITypeInfo2_GetDocumentation2_Stub(ITypeInfo2
*This
, MEMBERID memid
,
1975 LCID lcid
, DWORD flags
,
1976 BSTR
*help_string
, DWORD
*help_context
,
1979 TRACE("(%p, %08x, %08x, %08x, %p, %p, %p)\n", This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
1981 *help_string
= *help_dll
= NULL
;
1984 if(!(flags
& 1)) help_string
= NULL
;
1985 if(!(flags
& 2)) help_context
= NULL
;
1986 if(!(flags
& 4)) help_dll
= NULL
;
1988 return ITypeInfo2_GetDocumentation2(This
, memid
, lcid
, help_string
, help_context
, help_dll
);
1993 UINT CALLBACK
ITypeLib_GetTypeInfoCount_Proxy(
1997 TRACE("(%p)\n", This
);
1999 ITypeLib_RemoteGetTypeInfoCount_Proxy(This
, &count
);
2004 HRESULT __RPC_STUB
ITypeLib_GetTypeInfoCount_Stub(
2008 TRACE("(%p, %p)\n", This
, pcTInfo
);
2009 *pcTInfo
= ITypeLib_GetTypeInfoCount(This
);
2013 HRESULT CALLBACK
ITypeLib_GetLibAttr_Proxy(
2015 TLIBATTR
** ppTLibAttr
)
2017 CLEANLOCALSTORAGE stg
;
2018 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2021 stg
.pStorage
= NULL
;
2022 stg
.pInterface
= NULL
;
2024 return ITypeLib_RemoteGetLibAttr_Proxy(This
, ppTLibAttr
, &stg
);
2027 HRESULT __RPC_STUB
ITypeLib_GetLibAttr_Stub(
2029 LPTLIBATTR
* ppTLibAttr
,
2030 CLEANLOCALSTORAGE
* pDummy
)
2033 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2035 hr
= ITypeLib_GetLibAttr(This
, ppTLibAttr
);
2039 pDummy
->flags
= CLS_LIBATTR
;
2040 ITypeLib_AddRef(This
);
2041 pDummy
->pInterface
= (IUnknown
*)This
;
2042 pDummy
->pStorage
= ppTLibAttr
;
2046 HRESULT CALLBACK
ITypeLib_GetDocumentation_Proxy(ITypeLib
*This
, INT index
, BSTR
*name
,
2047 BSTR
*doc_string
, DWORD
*help_context
,
2050 DWORD dummy_help_context
, flags
= 0;
2051 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
2053 TRACE("(%p, %d, %p, %p, %p, %p)\n", This
, index
, name
, doc_string
, help_context
, help_file
);
2055 if(!name
) name
= &dummy_name
;
2058 if(!doc_string
) doc_string
= &dummy_doc_string
;
2061 if(!help_context
) help_context
= &dummy_help_context
;
2064 if(!help_file
) help_file
= &dummy_help_file
;
2067 hr
= ITypeLib_RemoteGetDocumentation_Proxy(This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2069 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2074 HRESULT __RPC_STUB
ITypeLib_GetDocumentation_Stub(ITypeLib
*This
, INT index
, DWORD flags
,
2075 BSTR
*name
, BSTR
*doc_string
,
2076 DWORD
*help_context
, BSTR
*help_file
)
2078 TRACE("(%p, %d, %08x, %p, %p, %p, %p)\n", This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2080 *name
= *doc_string
= *help_file
= NULL
;
2083 if(!(flags
& 1)) name
= NULL
;
2084 if(!(flags
& 2)) doc_string
= NULL
;
2085 if(!(flags
& 4)) help_context
= NULL
;
2086 if(!(flags
& 8)) help_file
= NULL
;
2088 return ITypeLib_GetDocumentation(This
, index
, name
, doc_string
, help_context
, help_file
);
2091 HRESULT CALLBACK
ITypeLib_IsName_Proxy(
2097 FIXME("not implemented\n");
2101 HRESULT __RPC_STUB
ITypeLib_IsName_Stub(
2108 FIXME("not implemented\n");
2112 HRESULT CALLBACK
ITypeLib_FindName_Proxy(
2116 ITypeInfo
** ppTInfo
,
2120 FIXME("not implemented\n");
2124 HRESULT __RPC_STUB
ITypeLib_FindName_Stub(
2128 ITypeInfo
** ppTInfo
,
2133 FIXME("not implemented\n");
2137 void CALLBACK
ITypeLib_ReleaseTLibAttr_Proxy(
2139 TLIBATTR
* pTLibAttr
)
2141 TRACE("(%p, %p)\n", This
, pTLibAttr
);
2142 CoTaskMemFree(pTLibAttr
);
2145 HRESULT __RPC_STUB
ITypeLib_ReleaseTLibAttr_Stub(
2148 TRACE("nothing to do\n");
2155 HRESULT CALLBACK
ITypeLib2_GetLibStatistics_Proxy(
2157 ULONG
* pcUniqueNames
,
2158 ULONG
* pcchUniqueNames
)
2160 FIXME("not implemented\n");
2164 HRESULT __RPC_STUB
ITypeLib2_GetLibStatistics_Stub(
2166 ULONG
* pcUniqueNames
,
2167 ULONG
* pcchUniqueNames
)
2169 FIXME("not implemented\n");
2173 HRESULT CALLBACK
ITypeLib2_GetDocumentation2_Proxy(ITypeLib2
*This
, INT index
,
2174 LCID lcid
, BSTR
*help_string
,
2175 DWORD
*help_context
, BSTR
*help_dll
)
2177 DWORD dummy_help_context
, flags
= 0;
2178 BSTR dummy_help_string
, dummy_help_dll
;
2180 TRACE("(%p, %d, %08x, %p, %p, %p)\n", This
, index
, lcid
, help_string
, help_context
, help_dll
);
2182 if(!help_string
) help_string
= &dummy_help_string
;
2185 if(!help_context
) help_context
= &dummy_help_context
;
2188 if(!help_dll
) help_dll
= &dummy_help_dll
;
2191 hr
= ITypeLib2_RemoteGetDocumentation2_Proxy(This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2193 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2198 HRESULT __RPC_STUB
ITypeLib2_GetDocumentation2_Stub(ITypeLib2
*This
, INT index
, LCID lcid
,
2199 DWORD flags
, BSTR
*help_string
,
2200 DWORD
*help_context
, BSTR
*help_dll
)
2202 TRACE("(%p, %d, %08x, %08x, %p, %p, %p)\n", This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2204 *help_string
= *help_dll
= NULL
;
2207 if(!(flags
& 1)) help_string
= NULL
;
2208 if(!(flags
& 2)) help_context
= NULL
;
2209 if(!(flags
& 4)) help_dll
= NULL
;
2211 return ITypeLib2_GetDocumentation2(This
, index
, lcid
, help_string
, help_context
, help_dll
);
2214 HRESULT CALLBACK
IPropertyBag_Read_Proxy(
2216 LPCOLESTR pszPropName
,
2218 IErrorLog
*pErrorLog
)
2220 IUnknown
*pUnk
= NULL
;
2221 TRACE("(%p, %s, %p, %p)\n", This
, debugstr_w(pszPropName
), pVar
, pErrorLog
);
2226 if(V_VT(pVar
) & (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2228 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2235 pUnk
= (IUnknown
*)V_DISPATCH(pVar
);
2238 pUnk
= V_UNKNOWN(pVar
);
2241 FIXME("Safearray support not yet implemented.\n");
2244 FIXME("Unknown V_VT %d - support not yet implemented.\n", V_VT(pVar
));
2248 return IPropertyBag_RemoteRead_Proxy(This
, pszPropName
, pVar
, pErrorLog
,
2252 HRESULT __RPC_STUB
IPropertyBag_Read_Stub(
2254 LPCOLESTR pszPropName
,
2256 IErrorLog
*pErrorLog
,
2260 static const WCHAR emptyWstr
[] = {0};
2263 TRACE("(%p, %s, %p, %p, %x, %p)\n", This
, debugstr_w(pszPropName
), pVar
,
2264 pErrorLog
, varType
, pUnkObj
);
2266 if(varType
& (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2268 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2272 V_VT(pVar
) = varType
;
2276 hr
= IUnknown_QueryInterface(pUnkObj
, &IID_IDispatch
, (LPVOID
*)&disp
);
2279 IUnknown_Release(pUnkObj
);
2280 V_DISPATCH(pVar
) = disp
;
2283 V_UNKNOWN(pVar
) = pUnkObj
;
2286 V_BSTR(pVar
) = SysAllocString(emptyWstr
);
2289 FIXME("Safearray support not yet implemented.\n");
2294 hr
= IPropertyBag_Read(This
, pszPropName
, pVar
, pErrorLog
);
2301 /* call_as/local stubs for ocidl.idl */
2303 HRESULT CALLBACK
IClassFactory2_CreateInstanceLic_Proxy(
2304 IClassFactory2
* This
,
2305 IUnknown
*pUnkOuter
,
2306 IUnknown
*pUnkReserved
,
2311 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObj
);
2317 ERR("aggregation is not allowed on remote objects\n");
2318 return CLASS_E_NOAGGREGATION
;
2321 return IClassFactory2_RemoteCreateInstanceLic_Proxy(This
, riid
, bstrKey
, (IUnknown
**)ppvObj
);
2324 HRESULT __RPC_STUB
IClassFactory2_CreateInstanceLic_Stub(
2325 IClassFactory2
* This
,
2330 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObj
);
2331 return IClassFactory2_CreateInstanceLic(This
, NULL
, NULL
, riid
, bstrKey
, (void**)ppvObj
);
2334 HRESULT CALLBACK
IEnumConnections_Next_Proxy(
2335 IEnumConnections
* This
,
2342 TRACE("(%u, %p %p)\n", cConnections
, rgcd
, pcFetched
);
2345 pcFetched
= &fetched
;
2347 return IEnumConnections_RemoteNext_Proxy(This
, cConnections
, rgcd
, pcFetched
);
2350 HRESULT __RPC_STUB
IEnumConnections_Next_Stub(
2351 IEnumConnections
* This
,
2358 TRACE("(%u, %p, %p)\n", cConnections
, rgcd
, pcFetched
);
2361 hr
= IEnumConnections_Next(This
, cConnections
, rgcd
, pcFetched
);
2363 *pcFetched
= cConnections
;
2368 HRESULT CALLBACK
IEnumConnectionPoints_Next_Proxy(
2369 IEnumConnectionPoints
* This
,
2371 IConnectionPoint
**ppCP
,
2376 TRACE("(%u, %p %p)\n", cConnections
, ppCP
, pcFetched
);
2379 pcFetched
= &fetched
;
2381 return IEnumConnectionPoints_RemoteNext_Proxy(This
, cConnections
, ppCP
, pcFetched
);
2384 HRESULT __RPC_STUB
IEnumConnectionPoints_Next_Stub(
2385 IEnumConnectionPoints
* This
,
2387 IConnectionPoint
**ppCP
,
2392 TRACE("(%u, %p, %p)\n", cConnections
, ppCP
, pcFetched
);
2395 hr
= IEnumConnectionPoints_Next(This
, cConnections
, ppCP
, pcFetched
);
2397 *pcFetched
= cConnections
;
2402 HRESULT CALLBACK
IPersistMemory_Load_Proxy(
2403 IPersistMemory
* This
,
2407 TRACE("(%p, %u)\n", pMem
, cbSize
);
2412 return IPersistMemory_RemoteLoad_Proxy(This
, pMem
, cbSize
);
2415 HRESULT __RPC_STUB
IPersistMemory_Load_Stub(
2416 IPersistMemory
* This
,
2420 TRACE("(%p, %u)\n", pMem
, cbSize
);
2421 return IPersistMemory_Load(This
, pMem
, cbSize
);
2424 HRESULT CALLBACK
IPersistMemory_Save_Proxy(
2425 IPersistMemory
* This
,
2430 TRACE("(%p, %d, %u)\n", pMem
, fClearDirty
, cbSize
);
2435 return IPersistMemory_RemoteSave_Proxy(This
, pMem
, fClearDirty
, cbSize
);
2438 HRESULT __RPC_STUB
IPersistMemory_Save_Stub(
2439 IPersistMemory
* This
,
2444 TRACE("(%p, %d, %u)\n", pMem
, fClearDirty
, cbSize
);
2445 return IPersistMemory_Save(This
, pMem
, fClearDirty
, cbSize
);
2448 void CALLBACK
IAdviseSinkEx_OnViewStatusChange_Proxy(
2449 IAdviseSinkEx
* This
,
2452 TRACE("(%p, 0x%08x)\n", This
, dwViewStatus
);
2453 IAdviseSinkEx_RemoteOnViewStatusChange_Proxy(This
, dwViewStatus
);
2456 HRESULT __RPC_STUB
IAdviseSinkEx_OnViewStatusChange_Stub(
2457 IAdviseSinkEx
* This
,
2460 TRACE("(%p, 0x%08x)\n", This
, dwViewStatus
);
2461 IAdviseSinkEx_OnViewStatusChange(This
, dwViewStatus
);
2465 HRESULT CALLBACK
IEnumOleUndoUnits_Next_Proxy(
2466 IEnumOleUndoUnits
* This
,
2468 IOleUndoUnit
**rgElt
,
2469 ULONG
*pcEltFetched
)
2473 TRACE("(%u, %p %p)\n", cElt
, rgElt
, pcEltFetched
);
2476 pcEltFetched
= &fetched
;
2478 return IEnumOleUndoUnits_RemoteNext_Proxy(This
, cElt
, rgElt
, pcEltFetched
);
2481 HRESULT __RPC_STUB
IEnumOleUndoUnits_Next_Stub(
2482 IEnumOleUndoUnits
* This
,
2484 IOleUndoUnit
**rgElt
,
2485 ULONG
*pcEltFetched
)
2489 TRACE("(%u, %p, %p)\n", cElt
, rgElt
, pcEltFetched
);
2492 hr
= IEnumOleUndoUnits_Next(This
, cElt
, rgElt
, pcEltFetched
);
2494 *pcEltFetched
= cElt
;
2499 HRESULT CALLBACK
IQuickActivate_QuickActivate_Proxy(
2500 IQuickActivate
* This
,
2501 QACONTAINER
*pQaContainer
,
2502 QACONTROL
*pQaControl
)
2504 FIXME("not implemented\n");
2508 HRESULT __RPC_STUB
IQuickActivate_QuickActivate_Stub(
2509 IQuickActivate
* This
,
2510 QACONTAINER
*pQaContainer
,
2511 QACONTROL
*pQaControl
)
2513 FIXME("not implemented\n");