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
);
232 return sizeof(LONGLONG
);
234 return sizeof(FLOAT
);
236 return sizeof(DOUBLE
);
238 return sizeof(VARIANT_BOOL
);
240 return sizeof(SCODE
);
246 return sizeof(DECIMAL
);
248 return sizeof(ULONG
);
250 return sizeof(VARIANT
);
256 FIXME("unhandled VT %d\n", vt
);
261 static unsigned int get_type_alignment(ULONG
*pFlags
, VARTYPE vt
)
263 unsigned int size
= get_type_size(pFlags
, vt
);
264 if(vt
& VT_BYREF
) return 3;
265 if(size
== 0) return 0;
266 if(size
<= 4) return size
- 1;
270 /* WdtpInterfacePointer_UserSize takes care of 2 additional DWORDs to store marshalling buffer size */
271 static unsigned interface_variant_size(ULONG
*pFlags
, REFIID riid
, IUnknown
*punk
)
277 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), 0, punk
, riid
);
280 ERR("interface variant buffer size calculation failed\n");
284 size
+= sizeof(ULONG
);
285 TRACE("wire-size extra of interface variant is %d\n", size
);
289 static ULONG
wire_extra_user_size(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
294 return LPSAFEARRAY_UserSize(pFlags
, Start
, V_ARRAYREF(pvar
));
296 return LPSAFEARRAY_UserSize(pFlags
, Start
, &V_ARRAY(pvar
));
299 switch (V_VT(pvar
)) {
301 return BSTR_UserSize(pFlags
, Start
, &V_BSTR(pvar
));
302 case VT_BSTR
| VT_BYREF
:
303 return BSTR_UserSize(pFlags
, Start
, V_BSTRREF(pvar
));
304 case VT_VARIANT
| VT_BYREF
:
305 return VARIANT_UserSize(pFlags
, Start
, V_VARIANTREF(pvar
));
307 return Start
+ interface_variant_size(pFlags
, &IID_IUnknown
, V_UNKNOWN(pvar
));
308 case VT_UNKNOWN
| VT_BYREF
:
309 return Start
+ interface_variant_size(pFlags
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
311 return Start
+ interface_variant_size(pFlags
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
312 case VT_DISPATCH
| VT_BYREF
:
313 return Start
+ interface_variant_size(pFlags
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
315 FIXME("wire-size record\n");
318 case VT_SAFEARRAY
| VT_BYREF
:
319 FIXME("wire-size safearray: shouldn't be marshaling this\n");
326 /* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer */
327 static unsigned char* interface_variant_marshal(ULONG
*pFlags
, unsigned char *Buffer
,
328 REFIID riid
, IUnknown
*punk
)
330 TRACE("pFlags=%d, Buffer=%p, pUnk=%p\n", *pFlags
, Buffer
, punk
);
332 /* first DWORD is used to store pointer itself, truncated on win64 */
335 memset(Buffer
, 0, sizeof(ULONG
));
336 return Buffer
+ sizeof(ULONG
);
340 *(DWORD
*)Buffer
= (DWORD_PTR
)punk
;
341 Buffer
+= sizeof(DWORD
);
344 return WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), Buffer
, punk
, riid
);
347 /* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer */
348 static unsigned char *interface_variant_unmarshal(ULONG
*pFlags
, unsigned char *Buffer
,
349 REFIID riid
, IUnknown
**ppunk
)
353 TRACE("pFlags=%d, Buffer=%p, ppUnk=%p\n", *pFlags
, Buffer
, ppunk
);
355 /* skip pointer part itself */
356 ptr
= *(DWORD
*)Buffer
;
357 Buffer
+= sizeof(DWORD
);
362 return WdtpInterfacePointer_UserUnmarshal(pFlags
, Buffer
, ppunk
, riid
);
365 ULONG WINAPI
VARIANT_UserSize(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
368 TRACE("(%x,%d,%p)\n", *pFlags
, Start
, pvar
);
369 TRACE("vt=%04x\n", V_VT(pvar
));
371 ALIGN_LENGTH(Start
, 7);
372 Start
+= sizeof(variant_wire_t
);
373 if(V_VT(pvar
) & VT_BYREF
)
376 align
= get_type_alignment(pFlags
, V_VT(pvar
));
377 ALIGN_LENGTH(Start
, align
);
378 if(V_VT(pvar
) == (VT_VARIANT
| VT_BYREF
))
381 Start
+= get_type_size(pFlags
, V_VT(pvar
));
382 Start
= wire_extra_user_size(pFlags
, Start
, pvar
);
384 TRACE("returning %d\n", Start
);
388 unsigned char * WINAPI
VARIANT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
390 variant_wire_t
*header
;
395 TRACE("(%x,%p,%p)\n", *pFlags
, Buffer
, pvar
);
396 TRACE("vt=%04x\n", V_VT(pvar
));
398 ALIGN_POINTER(Buffer
, 7);
400 header
= (variant_wire_t
*)Buffer
;
402 header
->clSize
= 0; /* fixed up at the end */
403 header
->rpcReserved
= 0;
404 header
->vt
= pvar
->n1
.n2
.vt
;
405 header
->wReserved1
= pvar
->n1
.n2
.wReserved1
;
406 header
->wReserved2
= pvar
->n1
.n2
.wReserved2
;
407 header
->wReserved3
= pvar
->n1
.n2
.wReserved3
;
408 header
->switch_is
= pvar
->n1
.n2
.vt
;
409 if(header
->switch_is
& VT_ARRAY
)
410 header
->switch_is
&= ~VT_TYPEMASK
;
412 Pos
= (unsigned char*)(header
+ 1);
413 type_size
= get_type_size(pFlags
, V_VT(pvar
));
414 align
= get_type_alignment(pFlags
, V_VT(pvar
));
415 ALIGN_POINTER(Pos
, align
);
417 if(header
->vt
& VT_BYREF
)
419 *(DWORD
*)Pos
= max(type_size
, 4);
421 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
423 memcpy(Pos
, pvar
->n1
.n2
.n3
.byref
, type_size
);
428 *(DWORD
*)Pos
= 'U' | 's' << 8 | 'e' << 16 | 'r' << 24;
434 if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
435 memcpy(Pos
, pvar
, type_size
);
437 memcpy(Pos
, &pvar
->n1
.n2
.n3
, type_size
);
441 if(header
->vt
& VT_ARRAY
)
443 if(header
->vt
& VT_BYREF
)
444 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
446 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
453 Pos
= BSTR_UserMarshal(pFlags
, Pos
, &V_BSTR(pvar
));
455 case VT_BSTR
| VT_BYREF
:
456 Pos
= BSTR_UserMarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
458 case VT_VARIANT
| VT_BYREF
:
459 Pos
= VARIANT_UserMarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
462 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWN(pvar
));
464 case VT_UNKNOWN
| VT_BYREF
:
465 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
468 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
470 case VT_DISPATCH
| VT_BYREF
:
471 Pos
= interface_variant_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
474 FIXME("handle BRECORD by val\n");
476 case VT_RECORD
| VT_BYREF
:
477 FIXME("handle BRECORD by ref\n");
481 header
->clSize
= ((Pos
- Buffer
) + 7) >> 3;
482 TRACE("marshalled size=%d\n", header
->clSize
);
486 unsigned char * WINAPI
VARIANT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
488 variant_wire_t
*header
;
493 TRACE("(%x,%p,%p)\n", *pFlags
, Buffer
, pvar
);
495 ALIGN_POINTER(Buffer
, 7);
497 header
= (variant_wire_t
*)Buffer
;
499 Pos
= (unsigned char*)(header
+ 1);
500 type_size
= get_type_size(pFlags
, header
->vt
);
501 align
= get_type_alignment(pFlags
, header
->vt
);
502 ALIGN_POINTER(Pos
, align
);
504 if(header
->vt
& VT_BYREF
)
509 switch (header
->vt
& ~VT_BYREF
)
511 /* these types have a different memory size compared to wire size */
515 mem_size
= sizeof(void *);
518 mem_size
= type_size
;
522 if (V_VT(pvar
) != header
->vt
)
525 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
526 memset(V_BYREF(pvar
), 0, mem_size
);
528 else if (!V_BYREF(pvar
))
530 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
531 memset(V_BYREF(pvar
), 0, mem_size
);
534 if(!(header
->vt
& VT_ARRAY
)
535 && (header
->vt
& VT_TYPEMASK
) != VT_BSTR
536 && (header
->vt
& VT_TYPEMASK
) != VT_VARIANT
537 && (header
->vt
& VT_TYPEMASK
) != VT_UNKNOWN
538 && (header
->vt
& VT_TYPEMASK
) != VT_DISPATCH
539 && (header
->vt
& VT_TYPEMASK
) != VT_RECORD
)
540 memcpy(V_BYREF(pvar
), Pos
, type_size
);
542 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
550 if(header
->vt
& VT_ARRAY
)
551 V_ARRAY(pvar
) = NULL
;
552 else if((header
->vt
& VT_TYPEMASK
) == VT_BSTR
)
554 else if((header
->vt
& VT_TYPEMASK
) == VT_UNKNOWN
)
555 V_UNKNOWN(pvar
) = NULL
;
556 else if((header
->vt
& VT_TYPEMASK
) == VT_DISPATCH
)
557 V_DISPATCH(pvar
) = NULL
;
558 else if((header
->vt
& VT_TYPEMASK
) == VT_RECORD
)
559 V_RECORD(pvar
) = NULL
;
560 else if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
561 memcpy(pvar
, Pos
, type_size
);
563 memcpy(&pvar
->n1
.n2
.n3
, Pos
, type_size
);
567 pvar
->n1
.n2
.vt
= header
->vt
;
568 pvar
->n1
.n2
.wReserved1
= header
->wReserved1
;
569 pvar
->n1
.n2
.wReserved2
= header
->wReserved2
;
570 pvar
->n1
.n2
.wReserved3
= header
->wReserved3
;
572 if(header
->vt
& VT_ARRAY
)
574 if(header
->vt
& VT_BYREF
)
575 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
577 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
584 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, &V_BSTR(pvar
));
586 case VT_BSTR
| VT_BYREF
:
587 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
589 case VT_VARIANT
| VT_BYREF
:
590 Pos
= VARIANT_UserUnmarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
593 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IUnknown
, &V_UNKNOWN(pvar
));
595 case VT_UNKNOWN
| VT_BYREF
:
596 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWNREF(pvar
));
599 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)&V_DISPATCH(pvar
));
601 case VT_DISPATCH
| VT_BYREF
:
602 Pos
= interface_variant_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)V_DISPATCHREF(pvar
));
605 FIXME("handle BRECORD by val\n");
607 case VT_RECORD
| VT_BYREF
:
608 FIXME("handle BRECORD by ref\n");
615 void WINAPI
VARIANT_UserFree(ULONG
*pFlags
, VARIANT
*pvar
)
617 VARTYPE vt
= V_VT(pvar
);
620 TRACE("(%x,%p)\n", *pFlags
, pvar
);
621 TRACE("vt=%04x\n", V_VT(pvar
));
623 if (vt
& VT_BYREF
) ref
= pvar
->n1
.n2
.n3
.byref
;
631 LPSAFEARRAY_UserFree(pFlags
, V_ARRAYREF(pvar
));
633 LPSAFEARRAY_UserFree(pFlags
, &V_ARRAY(pvar
));
639 case VT_BSTR
| VT_BYREF
:
640 BSTR_UserFree(pFlags
, V_BSTRREF(pvar
));
642 case VT_VARIANT
| VT_BYREF
:
643 VARIANT_UserFree(pFlags
, V_VARIANTREF(pvar
));
645 case VT_RECORD
| VT_BYREF
:
646 FIXME("handle BRECORD by ref\n");
648 case VT_UNKNOWN
| VT_BYREF
:
649 case VT_DISPATCH
| VT_BYREF
:
650 if (*V_UNKNOWNREF(pvar
))
651 IUnknown_Release(*V_UNKNOWNREF(pvar
));
661 /* Get the number of cells in a SafeArray */
662 static ULONG
SAFEARRAY_GetCellCount(const SAFEARRAY
*psa
)
664 const SAFEARRAYBOUND
* psab
= psa
->rgsabound
;
665 USHORT cCount
= psa
->cDims
;
666 ULONG ulNumCells
= 1;
670 /* This is a valid bordercase. See testcases. -Marcus */
671 if (!psab
->cElements
)
673 ulNumCells
*= psab
->cElements
;
679 static inline SF_TYPE
SAFEARRAY_GetUnionType(SAFEARRAY
*psa
)
684 hr
= SafeArrayGetVartype(psa
, &vt
);
687 if(psa
->fFeatures
& FADF_VARIANT
) return SF_VARIANT
;
689 switch(psa
->cbElements
)
691 case 1: vt
= VT_I1
; break;
692 case 2: vt
= VT_I2
; break;
693 case 4: vt
= VT_I4
; break;
694 case 8: vt
= VT_I8
; break;
696 RpcRaiseException(hr
);
700 if (psa
->fFeatures
& FADF_HAVEIID
)
706 case VT_UI1
: return SF_I1
;
709 case VT_UI2
: return SF_I2
;
714 case VT_R4
: return SF_I4
;
719 case VT_UI8
: return SF_I8
;
721 case VT_UINT_PTR
: return (sizeof(UINT_PTR
) == 4 ? SF_I4
: SF_I8
);
722 case VT_BSTR
: return SF_BSTR
;
723 case VT_DISPATCH
: return SF_DISPATCH
;
724 case VT_VARIANT
: return SF_VARIANT
;
725 case VT_UNKNOWN
: return SF_UNKNOWN
;
726 /* Note: Return a non-zero size to indicate vt is valid. The actual size
727 * of a UDT is taken from the result of IRecordInfo_GetSize().
729 case VT_RECORD
: return SF_RECORD
;
730 default: return SF_ERROR
;
734 static DWORD
elem_wire_size(LPSAFEARRAY lpsa
, SF_TYPE sftype
)
736 if (sftype
== SF_BSTR
)
737 return sizeof(DWORD
);
738 else if (sftype
== SF_VARIANT
)
739 return sizeof(variant_wire_t
) - sizeof(DWORD
);
741 return lpsa
->cbElements
;
744 static DWORD
elem_mem_size(wireSAFEARRAY wiresa
, SF_TYPE sftype
)
746 if (sftype
== SF_BSTR
)
748 else if (sftype
== SF_VARIANT
)
749 return sizeof(VARIANT
);
751 return wiresa
->cbElements
;
754 ULONG WINAPI
LPSAFEARRAY_UserSize(ULONG
*pFlags
, ULONG StartingSize
, LPSAFEARRAY
*ppsa
)
756 ULONG size
= StartingSize
;
758 TRACE("("); dump_user_flags(pFlags
); TRACE(", %d, %p\n", StartingSize
, *ppsa
);
760 ALIGN_LENGTH(size
, 3);
761 size
+= sizeof(ULONG
);
764 SAFEARRAY
*psa
= *ppsa
;
765 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
769 size
+= sizeof(ULONG
);
770 size
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
772 sftype
= SAFEARRAY_GetUnionType(psa
);
773 size
+= sizeof(ULONG
);
775 size
+= sizeof(ULONG
);
776 size
+= sizeof(ULONG
);
777 if (sftype
== SF_HAVEIID
)
780 size
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
782 size
+= sizeof(ULONG
);
790 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
791 size
= BSTR_UserSize(pFlags
, size
, lpBstr
);
798 FIXME("size interfaces\n");
804 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
805 size
= VARIANT_UserSize(pFlags
, size
, lpVariant
);
811 IRecordInfo
* pRecInfo
= NULL
;
813 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
815 RpcRaiseException(hr
);
819 FIXME("size record info %p\n", pRecInfo
);
821 IRecordInfo_Release(pRecInfo
);
826 ALIGN_LENGTH(size
, 7);
831 size
+= ulCellCount
* psa
->cbElements
;
842 unsigned char * WINAPI
LPSAFEARRAY_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
846 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, &%p\n", Buffer
, *ppsa
);
848 ALIGN_POINTER(Buffer
, 3);
849 *(ULONG
*)Buffer
= *ppsa
? 0x1 : 0x0;
850 Buffer
+= sizeof(ULONG
);
854 SAFEARRAY
*psa
= *ppsa
;
855 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
856 SAFEARRAYBOUND
*bound
;
861 sftype
= SAFEARRAY_GetUnionType(psa
);
863 *(ULONG
*)Buffer
= psa
->cDims
;
864 Buffer
+= sizeof(ULONG
);
865 *(USHORT
*)Buffer
= psa
->cDims
;
866 Buffer
+= sizeof(USHORT
);
867 *(USHORT
*)Buffer
= psa
->fFeatures
;
868 Buffer
+= sizeof(USHORT
);
869 *(ULONG
*)Buffer
= elem_wire_size(psa
, sftype
);
870 Buffer
+= sizeof(ULONG
);
872 hr
= SafeArrayGetVartype(psa
, &vt
);
873 if (FAILED(hr
)) vt
= 0;
875 *(ULONG
*)Buffer
= (USHORT
)psa
->cLocks
| (vt
<< 16);
876 Buffer
+= sizeof(ULONG
);
878 *(ULONG
*)Buffer
= sftype
;
879 Buffer
+= sizeof(ULONG
);
881 *(ULONG
*)Buffer
= ulCellCount
;
882 Buffer
+= sizeof(ULONG
);
883 *(ULONG
*)Buffer
= psa
->pvData
? 0x2 : 0x0;
884 Buffer
+= sizeof(ULONG
);
885 if (sftype
== SF_HAVEIID
)
887 SafeArrayGetIID(psa
, &guid
);
888 memcpy(Buffer
, &guid
, sizeof(guid
));
889 Buffer
+= sizeof(guid
);
892 /* bounds are marshaled in opposite order comparing to storage layout */
893 bound
= (SAFEARRAYBOUND
*)Buffer
;
894 for (i
= 0; i
< psa
->cDims
; i
++)
896 memcpy(bound
++, &psa
->rgsabound
[psa
->cDims
-i
-1], sizeof(psa
->rgsabound
[0]));
898 Buffer
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
900 *(ULONG
*)Buffer
= ulCellCount
;
901 Buffer
+= sizeof(ULONG
);
911 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
912 Buffer
= BSTR_UserMarshal(pFlags
, Buffer
, lpBstr
);
919 FIXME("marshal interfaces\n");
925 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
926 Buffer
= VARIANT_UserMarshal(pFlags
, Buffer
, lpVariant
);
932 IRecordInfo
* pRecInfo
= NULL
;
934 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
936 RpcRaiseException(hr
);
940 FIXME("write record info %p\n", pRecInfo
);
942 IRecordInfo_Release(pRecInfo
);
948 ALIGN_POINTER(Buffer
, 7);
953 /* Just copy the data over */
954 memcpy(Buffer
, psa
->pvData
, ulCellCount
* psa
->cbElements
);
955 Buffer
+= ulCellCount
* psa
->cbElements
;
966 #define FADF_AUTOSETFLAGS (FADF_HAVEIID | FADF_RECORD | FADF_HAVEVARTYPE | \
967 FADF_BSTR | FADF_UNKNOWN | FADF_DISPATCH | \
968 FADF_VARIANT | FADF_CREATEVECTOR)
970 unsigned char * WINAPI
LPSAFEARRAY_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
973 wireSAFEARRAY wiresa
;
980 SAFEARRAYBOUND
*wiresab
;
982 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, %p\n", Buffer
, ppsa
);
984 ALIGN_POINTER(Buffer
, 3);
985 ptr
= *(ULONG
*)Buffer
;
986 Buffer
+= sizeof(ULONG
);
990 SafeArrayDestroy(*ppsa
);
993 TRACE("NULL safe array unmarshaled\n");
998 cDims
= *(ULONG
*)Buffer
;
999 Buffer
+= sizeof(ULONG
);
1001 wiresa
= (wireSAFEARRAY
)Buffer
;
1002 Buffer
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
1004 if (cDims
!= wiresa
->cDims
)
1005 RpcRaiseException(RPC_S_INVALID_BOUND
);
1007 /* FIXME: there should be a limit on how large cDims can be */
1009 vt
= HIWORD(wiresa
->cLocks
);
1011 sftype
= *(ULONG
*)Buffer
;
1012 Buffer
+= sizeof(ULONG
);
1014 cell_count
= *(ULONG
*)Buffer
;
1015 Buffer
+= sizeof(ULONG
);
1016 ptr
= *(ULONG
*)Buffer
;
1017 Buffer
+= sizeof(ULONG
);
1018 if (sftype
== SF_HAVEIID
)
1020 memcpy(&guid
, Buffer
, sizeof(guid
));
1021 Buffer
+= sizeof(guid
);
1024 wiresab
= (SAFEARRAYBOUND
*)Buffer
;
1025 Buffer
+= sizeof(wiresab
[0]) * wiresa
->cDims
;
1027 if(*ppsa
&& (*ppsa
)->cDims
==wiresa
->cDims
)
1029 if(((*ppsa
)->fFeatures
& ~FADF_AUTOSETFLAGS
) != (wiresa
->fFeatures
& ~FADF_AUTOSETFLAGS
))
1030 RpcRaiseException(DISP_E_BADCALLEE
);
1032 if(SAFEARRAY_GetCellCount(*ppsa
)*(*ppsa
)->cbElements
!= cell_count
*elem_mem_size(wiresa
, sftype
))
1034 if((*ppsa
)->fFeatures
& (FADF_AUTO
|FADF_STATIC
|FADF_EMBEDDED
|FADF_FIXEDSIZE
))
1035 RpcRaiseException(DISP_E_BADCALLEE
);
1037 hr
= SafeArrayDestroyData(*ppsa
);
1039 RpcRaiseException(hr
);
1041 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(*wiresab
)*wiresa
->cDims
);
1043 if((*ppsa
)->fFeatures
& FADF_HAVEVARTYPE
)
1044 ((DWORD
*)(*ppsa
))[-1] = vt
;
1048 SafeArrayDestroy(*ppsa
);
1049 *ppsa
= SafeArrayCreateEx(vt
, wiresa
->cDims
, wiresab
, NULL
);
1050 if (!*ppsa
) RpcRaiseException(E_OUTOFMEMORY
);
1054 SafeArrayDestroy(*ppsa
);
1055 if (FAILED(SafeArrayAllocDescriptor(wiresa
->cDims
, ppsa
)))
1056 RpcRaiseException(E_OUTOFMEMORY
);
1057 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(SAFEARRAYBOUND
) * wiresa
->cDims
);
1060 /* be careful about which flags we set since they could be a security
1062 (*ppsa
)->fFeatures
&= FADF_AUTOSETFLAGS
;
1063 (*ppsa
)->fFeatures
|= (wiresa
->fFeatures
& ~(FADF_AUTOSETFLAGS
));
1064 /* FIXME: there should be a limit on how large wiresa->cbElements can be */
1065 (*ppsa
)->cbElements
= elem_mem_size(wiresa
, sftype
);
1067 /* SafeArrayCreateEx allocates the data for us, but
1068 * SafeArrayAllocDescriptor doesn't */
1069 if(!(*ppsa
)->pvData
)
1071 hr
= SafeArrayAllocData(*ppsa
);
1073 RpcRaiseException(hr
);
1076 if ((*(ULONG
*)Buffer
!= cell_count
) || (SAFEARRAY_GetCellCount(*ppsa
) != cell_count
))
1077 RpcRaiseException(RPC_S_INVALID_BOUND
);
1078 Buffer
+= sizeof(ULONG
);
1088 for (lpBstr
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpBstr
++)
1089 Buffer
= BSTR_UserUnmarshal(pFlags
, Buffer
, lpBstr
);
1096 FIXME("marshal interfaces\n");
1102 for (lpVariant
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpVariant
++)
1103 Buffer
= VARIANT_UserUnmarshal(pFlags
, Buffer
, lpVariant
);
1109 FIXME("set record info\n");
1115 ALIGN_POINTER(Buffer
, 7);
1120 /* Just copy the data over */
1121 memcpy((*ppsa
)->pvData
, Buffer
, cell_count
* (*ppsa
)->cbElements
);
1122 Buffer
+= cell_count
* (*ppsa
)->cbElements
;
1129 TRACE("safe array unmarshaled: %p\n", *ppsa
);
1134 void WINAPI
LPSAFEARRAY_UserFree(ULONG
*pFlags
, LPSAFEARRAY
*ppsa
)
1136 TRACE("("); dump_user_flags(pFlags
); TRACE(", &%p\n", *ppsa
);
1138 SafeArrayDestroy(*ppsa
);
1143 ULONG WINAPI
HFONT_UserSize(ULONG
*pFlags
, ULONG Start
, HFONT
*phfont
)
1149 unsigned char * WINAPI
HFONT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1155 unsigned char * WINAPI
HFONT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1161 void WINAPI
HFONT_UserFree(ULONG
*pFlags
, HFONT
*phfont
)
1169 /* exactly how Invoke is marshalled is not very clear to me yet,
1170 * but the way I've done it seems to work for me */
1172 HRESULT CALLBACK
IDispatch_Invoke_Proxy(
1174 DISPID dispIdMember
,
1178 DISPPARAMS
* pDispParams
,
1179 VARIANT
* pVarResult
,
1180 EXCEPINFO
* pExcepInfo
,
1185 UINT
* rgVarRefIdx
= NULL
;
1186 VARIANTARG
* rgVarRef
= NULL
;
1189 EXCEPINFO ExcepInfo
;
1191 TRACE("(%p)->(%d,%s,%x,%x,%p,%p,%p,%p)\n", This
,
1192 dispIdMember
, debugstr_guid(riid
),
1193 lcid
, wFlags
, pDispParams
, pVarResult
,
1194 pExcepInfo
, puArgErr
);
1196 /* [out] args can't be null, use dummy vars if needed */
1197 if (!pVarResult
) pVarResult
= &VarResult
;
1198 if (!puArgErr
) puArgErr
= &uArgErr
;
1199 if (!pExcepInfo
) pExcepInfo
= &ExcepInfo
;
1201 /* count by-ref args */
1202 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1203 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1204 if (V_ISBYREF(arg
)) {
1209 rgVarRefIdx
= CoTaskMemAlloc(sizeof(UINT
)*cVarRef
);
1210 rgVarRef
= CoTaskMemAlloc(sizeof(VARIANTARG
)*cVarRef
);
1211 /* make list of by-ref args */
1212 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1213 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1214 if (V_ISBYREF(arg
)) {
1215 rgVarRefIdx
[cVarRef
] = u
;
1216 VariantInit(&rgVarRef
[cVarRef
]);
1217 VariantCopy(&rgVarRef
[cVarRef
], arg
);
1223 /* [out] args still can't be null,
1224 * but we can point these anywhere in this case,
1225 * since they won't be written to when cVarRef is 0 */
1226 rgVarRefIdx
= puArgErr
;
1227 rgVarRef
= pVarResult
;
1229 TRACE("passed by ref: %d args\n", cVarRef
);
1230 hr
= IDispatch_RemoteInvoke_Proxy(This
,
1243 for (u
=0; u
<cVarRef
; u
++) {
1244 unsigned i
= rgVarRefIdx
[u
];
1245 VariantCopy(&pDispParams
->rgvarg
[i
],
1247 VariantClear(&rgVarRef
[u
]);
1249 CoTaskMemFree(rgVarRef
);
1250 CoTaskMemFree(rgVarRefIdx
);
1253 if(pExcepInfo
== &ExcepInfo
)
1255 SysFreeString(pExcepInfo
->bstrSource
);
1256 SysFreeString(pExcepInfo
->bstrDescription
);
1257 SysFreeString(pExcepInfo
->bstrHelpFile
);
1262 HRESULT __RPC_STUB
IDispatch_Invoke_Stub(
1264 DISPID dispIdMember
,
1268 DISPPARAMS
* pDispParams
,
1269 VARIANT
* pVarResult
,
1270 EXCEPINFO
* pExcepInfo
,
1274 VARIANTARG
* rgVarRef
)
1277 VARIANTARG
*rgvarg
, *arg
;
1280 /* initialize out parameters, so that they can be marshalled
1281 * in case the real Invoke doesn't initialize them */
1282 VariantInit(pVarResult
);
1283 memset(pExcepInfo
, 0, sizeof(*pExcepInfo
));
1286 /* let the real Invoke operate on a copy of the in parameters,
1287 * so we don't risk losing pointers to allocated memory */
1288 rgvarg
= pDispParams
->rgvarg
;
1289 arg
= CoTaskMemAlloc(sizeof(VARIANTARG
)*pDispParams
->cArgs
);
1290 if (!arg
) return E_OUTOFMEMORY
;
1292 /* init all args so we can call VariantClear on all the args if the copy
1294 for (u
= 0; u
< pDispParams
->cArgs
; u
++)
1295 VariantInit(&arg
[u
]);
1297 for (u
= 0; u
< pDispParams
->cArgs
; u
++) {
1298 hr
= VariantCopy(&arg
[u
], &rgvarg
[u
]);
1303 if (SUCCEEDED(hr
)) {
1304 /* copy ref args to arg array */
1305 for (u
=0; u
<cVarRef
; u
++) {
1306 unsigned i
= rgVarRefIdx
[u
];
1307 VariantCopy(&arg
[i
], &rgVarRef
[u
]);
1310 pDispParams
->rgvarg
= arg
;
1312 hr
= IDispatch_Invoke(This
,
1322 /* copy ref args from arg array */
1323 for (u
=0; u
<cVarRef
; u
++) {
1324 unsigned i
= rgVarRefIdx
[u
];
1325 VariantCopy(&rgVarRef
[u
], &arg
[i
]);
1329 /* clear the duplicate argument list */
1330 for (u
=0; u
<pDispParams
->cArgs
; u
++)
1331 VariantClear(&arg
[u
]);
1333 pDispParams
->rgvarg
= rgvarg
;
1341 HRESULT CALLBACK
IEnumVARIANT_Next_Proxy(
1345 ULONG
* pCeltFetched
)
1349 pCeltFetched
= &fetched
;
1350 return IEnumVARIANT_RemoteNext_Proxy(This
,
1356 HRESULT __RPC_STUB
IEnumVARIANT_Next_Stub(
1360 ULONG
* pCeltFetched
)
1364 hr
= IEnumVARIANT_Next(This
,
1368 if (hr
== S_OK
) *pCeltFetched
= celt
;
1372 /* TypeInfo related freers */
1374 static void free_embedded_typedesc(TYPEDESC
*tdesc
);
1375 static void free_embedded_arraydesc(ARRAYDESC
*adesc
)
1377 switch(adesc
->tdescElem
.vt
)
1381 free_embedded_typedesc(adesc
->tdescElem
.u
.lptdesc
);
1382 CoTaskMemFree(adesc
->tdescElem
.u
.lptdesc
);
1385 free_embedded_arraydesc(adesc
->tdescElem
.u
.lpadesc
);
1386 CoTaskMemFree(adesc
->tdescElem
.u
.lpadesc
);
1391 static void free_embedded_typedesc(TYPEDESC
*tdesc
)
1397 free_embedded_typedesc(tdesc
->u
.lptdesc
);
1398 CoTaskMemFree(tdesc
->u
.lptdesc
);
1401 free_embedded_arraydesc(tdesc
->u
.lpadesc
);
1402 CoTaskMemFree(tdesc
->u
.lpadesc
);
1407 static void free_embedded_elemdesc(ELEMDESC
*edesc
)
1409 free_embedded_typedesc(&edesc
->tdesc
);
1410 if(edesc
->u
.paramdesc
.wParamFlags
& PARAMFLAG_FHASDEFAULT
)
1411 CoTaskMemFree(edesc
->u
.paramdesc
.pparamdescex
);
1416 HRESULT CALLBACK
ITypeComp_Bind_Proxy(
1425 CLEANLOCALSTORAGE stg
= { 0 };
1426 ITypeComp
*typecomp
;
1431 TRACE("(%p, %s, %#x, %#x, %p, %p, %p)\n", This
, debugstr_w(name
), lHashVal
, flags
, ti
,
1434 *desckind
= DESCKIND_NONE
;
1435 memset(bindptr
, 0, sizeof(*bindptr
));
1437 hr
= ITypeComp_RemoteBind_Proxy(This
, name
, lHashVal
, flags
, ti
, desckind
,
1438 &funcdesc
, &vardesc
, &typecomp
, &stg
);
1444 case DESCKIND_FUNCDESC
:
1445 bindptr
->lpfuncdesc
= funcdesc
;
1447 case DESCKIND_VARDESC
:
1448 case DESCKIND_IMPLICITAPPOBJ
:
1449 bindptr
->lpvardesc
= vardesc
;
1451 case DESCKIND_TYPECOMP
:
1452 bindptr
->lptcomp
= typecomp
;
1462 HRESULT __RPC_STUB
ITypeComp_Bind_Stub(
1469 FUNCDESC
**funcdesc
,
1471 ITypeComp
**typecomp
,
1472 CLEANLOCALSTORAGE
*stg
)
1477 TRACE("(%p, %s, %#x, %#x, %p, %p, %p, %p, %p, %p)\n", This
, debugstr_w(name
),
1478 lHashVal
, flags
, ti
, desckind
, funcdesc
, vardesc
, typecomp
, stg
);
1480 memset(stg
, 0, sizeof(*stg
));
1481 memset(&bindptr
, 0, sizeof(bindptr
));
1488 hr
= ITypeComp_Bind(This
, name
, lHashVal
, flags
, ti
, desckind
, &bindptr
);
1494 case DESCKIND_FUNCDESC
:
1495 *funcdesc
= bindptr
.lpfuncdesc
;
1496 stg
->pInterface
= (IUnknown
*)*ti
;
1497 stg
->pStorage
= funcdesc
;
1498 stg
->flags
= CLS_FUNCDESC
;
1500 case DESCKIND_VARDESC
:
1501 case DESCKIND_IMPLICITAPPOBJ
:
1502 *vardesc
= bindptr
.lpvardesc
;
1503 stg
->pInterface
= (IUnknown
*)*ti
;
1504 stg
->pStorage
= vardesc
;
1505 stg
->flags
= CLS_VARDESC
;
1507 case DESCKIND_TYPECOMP
:
1508 *typecomp
= bindptr
.lptcomp
;
1514 if (stg
->pInterface
)
1515 IUnknown_AddRef(stg
->pInterface
);
1520 HRESULT CALLBACK
ITypeComp_BindType_Proxy(
1525 ITypeComp
**typecomp
)
1529 TRACE("(%p, %s, %#x, %p, %p)\n", This
, debugstr_w(name
), lHashVal
, ti
, typecomp
);
1531 hr
= ITypeComp_RemoteBindType_Proxy(This
, name
, lHashVal
, ti
);
1533 ITypeInfo_GetTypeComp(*ti
, typecomp
);
1540 HRESULT __RPC_STUB
ITypeComp_BindType_Stub(
1546 ITypeComp
*typecomp
= NULL
;
1549 TRACE("(%p, %s, %#x, %p)\n", This
, debugstr_w(name
), lHashVal
, ti
);
1551 hr
= ITypeComp_BindType(This
, name
, lHashVal
, ti
, &typecomp
);
1554 ITypeComp_Release(typecomp
);
1561 HRESULT CALLBACK
ITypeInfo_GetTypeAttr_Proxy(
1563 TYPEATTR
** ppTypeAttr
)
1566 CLEANLOCALSTORAGE stg
;
1567 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1570 stg
.pStorage
= NULL
;
1571 stg
.pInterface
= NULL
;
1573 return ITypeInfo_RemoteGetTypeAttr_Proxy(This
, ppTypeAttr
, &stg
);
1576 HRESULT __RPC_STUB
ITypeInfo_GetTypeAttr_Stub(
1578 LPTYPEATTR
* ppTypeAttr
,
1579 CLEANLOCALSTORAGE
* pDummy
)
1582 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1584 hr
= ITypeInfo_GetTypeAttr(This
, ppTypeAttr
);
1588 pDummy
->flags
= CLS_TYPEATTR
;
1589 ITypeInfo_AddRef(This
);
1590 pDummy
->pInterface
= (IUnknown
*)This
;
1591 pDummy
->pStorage
= ppTypeAttr
;
1595 HRESULT CALLBACK
ITypeInfo_GetFuncDesc_Proxy(
1598 FUNCDESC
** ppFuncDesc
)
1600 CLEANLOCALSTORAGE stg
;
1601 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1604 stg
.pStorage
= NULL
;
1605 stg
.pInterface
= NULL
;
1607 return ITypeInfo_RemoteGetFuncDesc_Proxy(This
, index
, ppFuncDesc
, &stg
);
1610 HRESULT __RPC_STUB
ITypeInfo_GetFuncDesc_Stub(
1613 LPFUNCDESC
* ppFuncDesc
,
1614 CLEANLOCALSTORAGE
* pDummy
)
1617 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1619 hr
= ITypeInfo_GetFuncDesc(This
, index
, ppFuncDesc
);
1623 pDummy
->flags
= CLS_FUNCDESC
;
1624 ITypeInfo_AddRef(This
);
1625 pDummy
->pInterface
= (IUnknown
*)This
;
1626 pDummy
->pStorage
= ppFuncDesc
;
1630 HRESULT CALLBACK
ITypeInfo_GetVarDesc_Proxy(
1633 VARDESC
** ppVarDesc
)
1635 CLEANLOCALSTORAGE stg
;
1636 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1639 stg
.pStorage
= NULL
;
1640 stg
.pInterface
= NULL
;
1642 return ITypeInfo_RemoteGetVarDesc_Proxy(This
, index
, ppVarDesc
, &stg
);
1645 HRESULT __RPC_STUB
ITypeInfo_GetVarDesc_Stub(
1648 LPVARDESC
* ppVarDesc
,
1649 CLEANLOCALSTORAGE
* pDummy
)
1652 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1654 hr
= ITypeInfo_GetVarDesc(This
, index
, ppVarDesc
);
1658 pDummy
->flags
= CLS_VARDESC
;
1659 ITypeInfo_AddRef(This
);
1660 pDummy
->pInterface
= (IUnknown
*)This
;
1661 pDummy
->pStorage
= ppVarDesc
;
1665 HRESULT CALLBACK
ITypeInfo_GetNames_Proxy(
1672 TRACE("(%p, %08x, %p, %d, %p)\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1674 return ITypeInfo_RemoteGetNames_Proxy(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1677 HRESULT __RPC_STUB
ITypeInfo_GetNames_Stub(
1684 TRACE("(%p, %08x, %p, %d, %p)\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1686 return ITypeInfo_GetNames(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1689 HRESULT CALLBACK
ITypeInfo_GetIDsOfNames_Proxy(
1691 LPOLESTR
* rgszNames
,
1695 FIXME("not implemented\n");
1699 HRESULT __RPC_STUB
ITypeInfo_GetIDsOfNames_Stub(
1702 FIXME("not implemented\n");
1706 HRESULT CALLBACK
ITypeInfo_Invoke_Proxy(
1711 DISPPARAMS
* pDispParams
,
1712 VARIANT
* pVarResult
,
1713 EXCEPINFO
* pExcepInfo
,
1716 FIXME("not implemented\n");
1720 HRESULT __RPC_STUB
ITypeInfo_Invoke_Stub(
1723 FIXME("not implemented\n");
1727 HRESULT CALLBACK
ITypeInfo_GetDocumentation_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1728 BSTR
*name
, BSTR
*doc_string
,
1729 DWORD
*help_context
, BSTR
*help_file
)
1731 DWORD dummy_help_context
, flags
= 0;
1732 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
1734 TRACE("(%p, %08x, %p, %p, %p, %p)\n", This
, memid
, name
, doc_string
, help_context
, help_file
);
1736 if(!name
) name
= &dummy_name
;
1739 if(!doc_string
) doc_string
= &dummy_doc_string
;
1742 if(!help_context
) help_context
= &dummy_help_context
;
1745 if(!help_file
) help_file
= &dummy_help_file
;
1748 hr
= ITypeInfo_RemoteGetDocumentation_Proxy(This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1750 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1755 HRESULT __RPC_STUB
ITypeInfo_GetDocumentation_Stub(ITypeInfo
*This
, MEMBERID memid
,
1756 DWORD flags
, BSTR
*name
, BSTR
*doc_string
,
1757 DWORD
*help_context
, BSTR
*help_file
)
1759 TRACE("(%p, %08x, %08x, %p, %p, %p, %p)\n", This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1761 *name
= *doc_string
= *help_file
= NULL
;
1764 if(!(flags
& 1)) name
= NULL
;
1765 if(!(flags
& 2)) doc_string
= NULL
;
1766 if(!(flags
& 4)) help_context
= NULL
;
1767 if(!(flags
& 8)) help_file
= NULL
;
1769 return ITypeInfo_GetDocumentation(This
, memid
, name
, doc_string
, help_context
, help_file
);
1772 HRESULT CALLBACK
ITypeInfo_GetDllEntry_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1773 INVOKEKIND invkind
, BSTR
*dll_name
,
1774 BSTR
* name
, WORD
*ordinal
)
1777 BSTR dummy_dll_name
, dummy_name
;
1780 TRACE("(%p, %08x, %x, %p, %p, %p)\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1782 if(!dll_name
) dll_name
= &dummy_dll_name
;
1785 if(!name
) name
= &dummy_name
;
1788 if(!ordinal
) ordinal
= &dummy_ordinal
;
1791 hr
= ITypeInfo_RemoteGetDllEntry_Proxy(This
, memid
, invkind
, flags
, dll_name
, name
, ordinal
);
1793 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1798 HRESULT __RPC_STUB
ITypeInfo_GetDllEntry_Stub(ITypeInfo
*This
, MEMBERID memid
,
1799 INVOKEKIND invkind
, DWORD flags
,
1800 BSTR
*dll_name
, BSTR
*name
,
1803 TRACE("(%p, %08x, %x, %p, %p, %p)\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1805 *dll_name
= *name
= NULL
;
1808 if(!(flags
& 1)) dll_name
= NULL
;
1809 if(!(flags
& 2)) name
= NULL
;
1810 if(!(flags
& 4)) ordinal
= NULL
;
1812 return ITypeInfo_GetDllEntry(This
, memid
, invkind
, dll_name
, name
, ordinal
);
1815 HRESULT CALLBACK
ITypeInfo_AddressOfMember_Proxy(
1821 FIXME("not implemented\n");
1825 HRESULT __RPC_STUB
ITypeInfo_AddressOfMember_Stub(
1828 FIXME("not implemented\n");
1832 HRESULT CALLBACK
ITypeInfo_CreateInstance_Proxy(
1834 IUnknown
* pUnkOuter
,
1838 FIXME("not implemented\n");
1842 HRESULT __RPC_STUB
ITypeInfo_CreateInstance_Stub(
1847 FIXME("not implemented\n");
1851 HRESULT CALLBACK
ITypeInfo_GetContainingTypeLib_Proxy(
1860 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1862 hr
= ITypeInfo_RemoteGetContainingTypeLib_Proxy(This
, &pTL
, &index
);
1871 ITypeLib_Release(pTL
);
1876 HRESULT __RPC_STUB
ITypeInfo_GetContainingTypeLib_Stub(
1881 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1882 return ITypeInfo_GetContainingTypeLib(This
, ppTLib
, pIndex
);
1885 void CALLBACK
ITypeInfo_ReleaseTypeAttr_Proxy(
1887 TYPEATTR
* pTypeAttr
)
1889 TRACE("(%p, %p)\n", This
, pTypeAttr
);
1890 free_embedded_typedesc(&pTypeAttr
->tdescAlias
);
1891 CoTaskMemFree(pTypeAttr
);
1894 HRESULT __RPC_STUB
ITypeInfo_ReleaseTypeAttr_Stub(
1897 TRACE("nothing to do\n");
1901 void CALLBACK
ITypeInfo_ReleaseFuncDesc_Proxy(
1903 FUNCDESC
* pFuncDesc
)
1906 TRACE("(%p, %p)\n", This
, pFuncDesc
);
1908 for(param
= 0; param
< pFuncDesc
->cParams
; param
++)
1909 free_embedded_elemdesc(pFuncDesc
->lprgelemdescParam
+ param
);
1911 CoTaskMemFree(pFuncDesc
->lprgelemdescParam
);
1913 free_embedded_elemdesc(&pFuncDesc
->elemdescFunc
);
1915 if(pFuncDesc
->cScodes
!= 0 && pFuncDesc
->cScodes
!= -1)
1916 CoTaskMemFree(pFuncDesc
->lprgscode
);
1918 CoTaskMemFree(pFuncDesc
);
1921 HRESULT __RPC_STUB
ITypeInfo_ReleaseFuncDesc_Stub(
1924 TRACE("nothing to do\n");
1928 void CALLBACK
ITypeInfo_ReleaseVarDesc_Proxy(
1932 TRACE("(%p, %p)\n", This
, pVarDesc
);
1934 CoTaskMemFree(pVarDesc
->lpstrSchema
);
1936 if(pVarDesc
->varkind
== VAR_CONST
)
1937 CoTaskMemFree(pVarDesc
->u
.lpvarValue
);
1939 free_embedded_elemdesc(&pVarDesc
->elemdescVar
);
1940 CoTaskMemFree(pVarDesc
);
1943 HRESULT __RPC_STUB
ITypeInfo_ReleaseVarDesc_Stub(
1946 TRACE("nothing to do\n");
1953 HRESULT CALLBACK
ITypeInfo2_GetDocumentation2_Proxy(ITypeInfo2
*This
, MEMBERID memid
,
1954 LCID lcid
, BSTR
*help_string
,
1955 DWORD
*help_context
, BSTR
*help_dll
)
1957 DWORD dummy_help_context
, flags
= 0;
1958 BSTR dummy_help_string
, dummy_help_dll
;
1960 TRACE("(%p, %08x, %08x, %p, %p, %p)\n", This
, memid
, lcid
, help_string
, help_context
, help_dll
);
1962 if(!help_string
) help_string
= &dummy_help_string
;
1965 if(!help_context
) help_context
= &dummy_help_context
;
1968 if(!help_dll
) help_dll
= &dummy_help_dll
;
1971 hr
= ITypeInfo2_RemoteGetDocumentation2_Proxy(This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
1973 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1978 HRESULT __RPC_STUB
ITypeInfo2_GetDocumentation2_Stub(ITypeInfo2
*This
, MEMBERID memid
,
1979 LCID lcid
, DWORD flags
,
1980 BSTR
*help_string
, DWORD
*help_context
,
1983 TRACE("(%p, %08x, %08x, %08x, %p, %p, %p)\n", This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
1985 *help_string
= *help_dll
= NULL
;
1988 if(!(flags
& 1)) help_string
= NULL
;
1989 if(!(flags
& 2)) help_context
= NULL
;
1990 if(!(flags
& 4)) help_dll
= NULL
;
1992 return ITypeInfo2_GetDocumentation2(This
, memid
, lcid
, help_string
, help_context
, help_dll
);
1997 UINT CALLBACK
ITypeLib_GetTypeInfoCount_Proxy(
2001 TRACE("(%p)\n", This
);
2003 ITypeLib_RemoteGetTypeInfoCount_Proxy(This
, &count
);
2008 HRESULT __RPC_STUB
ITypeLib_GetTypeInfoCount_Stub(
2012 TRACE("(%p, %p)\n", This
, pcTInfo
);
2013 *pcTInfo
= ITypeLib_GetTypeInfoCount(This
);
2017 HRESULT CALLBACK
ITypeLib_GetLibAttr_Proxy(
2019 TLIBATTR
** ppTLibAttr
)
2021 CLEANLOCALSTORAGE stg
;
2022 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2025 stg
.pStorage
= NULL
;
2026 stg
.pInterface
= NULL
;
2028 return ITypeLib_RemoteGetLibAttr_Proxy(This
, ppTLibAttr
, &stg
);
2031 HRESULT __RPC_STUB
ITypeLib_GetLibAttr_Stub(
2033 LPTLIBATTR
* ppTLibAttr
,
2034 CLEANLOCALSTORAGE
* pDummy
)
2037 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2039 hr
= ITypeLib_GetLibAttr(This
, ppTLibAttr
);
2043 pDummy
->flags
= CLS_LIBATTR
;
2044 ITypeLib_AddRef(This
);
2045 pDummy
->pInterface
= (IUnknown
*)This
;
2046 pDummy
->pStorage
= ppTLibAttr
;
2050 HRESULT CALLBACK
ITypeLib_GetDocumentation_Proxy(ITypeLib
*This
, INT index
, BSTR
*name
,
2051 BSTR
*doc_string
, DWORD
*help_context
,
2054 DWORD dummy_help_context
, flags
= 0;
2055 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
2057 TRACE("(%p, %d, %p, %p, %p, %p)\n", This
, index
, name
, doc_string
, help_context
, help_file
);
2059 if(!name
) name
= &dummy_name
;
2062 if(!doc_string
) doc_string
= &dummy_doc_string
;
2065 if(!help_context
) help_context
= &dummy_help_context
;
2068 if(!help_file
) help_file
= &dummy_help_file
;
2071 hr
= ITypeLib_RemoteGetDocumentation_Proxy(This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2073 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2078 HRESULT __RPC_STUB
ITypeLib_GetDocumentation_Stub(ITypeLib
*This
, INT index
, DWORD flags
,
2079 BSTR
*name
, BSTR
*doc_string
,
2080 DWORD
*help_context
, BSTR
*help_file
)
2082 TRACE("(%p, %d, %08x, %p, %p, %p, %p)\n", This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2084 *name
= *doc_string
= *help_file
= NULL
;
2087 if(!(flags
& 1)) name
= NULL
;
2088 if(!(flags
& 2)) doc_string
= NULL
;
2089 if(!(flags
& 4)) help_context
= NULL
;
2090 if(!(flags
& 8)) help_file
= NULL
;
2092 return ITypeLib_GetDocumentation(This
, index
, name
, doc_string
, help_context
, help_file
);
2095 HRESULT CALLBACK
ITypeLib_IsName_Proxy(
2101 FIXME("not implemented\n");
2105 HRESULT __RPC_STUB
ITypeLib_IsName_Stub(
2112 FIXME("not implemented\n");
2116 HRESULT CALLBACK
ITypeLib_FindName_Proxy(
2120 ITypeInfo
** ppTInfo
,
2124 FIXME("not implemented\n");
2128 HRESULT __RPC_STUB
ITypeLib_FindName_Stub(
2132 ITypeInfo
** ppTInfo
,
2137 FIXME("not implemented\n");
2141 void CALLBACK
ITypeLib_ReleaseTLibAttr_Proxy(
2143 TLIBATTR
* pTLibAttr
)
2145 TRACE("(%p, %p)\n", This
, pTLibAttr
);
2146 CoTaskMemFree(pTLibAttr
);
2149 HRESULT __RPC_STUB
ITypeLib_ReleaseTLibAttr_Stub(
2152 TRACE("nothing to do\n");
2159 HRESULT CALLBACK
ITypeLib2_GetLibStatistics_Proxy(
2161 ULONG
* pcUniqueNames
,
2162 ULONG
* pcchUniqueNames
)
2164 FIXME("not implemented\n");
2168 HRESULT __RPC_STUB
ITypeLib2_GetLibStatistics_Stub(
2170 ULONG
* pcUniqueNames
,
2171 ULONG
* pcchUniqueNames
)
2173 FIXME("not implemented\n");
2177 HRESULT CALLBACK
ITypeLib2_GetDocumentation2_Proxy(ITypeLib2
*This
, INT index
,
2178 LCID lcid
, BSTR
*help_string
,
2179 DWORD
*help_context
, BSTR
*help_dll
)
2181 DWORD dummy_help_context
, flags
= 0;
2182 BSTR dummy_help_string
, dummy_help_dll
;
2184 TRACE("(%p, %d, %08x, %p, %p, %p)\n", This
, index
, lcid
, help_string
, help_context
, help_dll
);
2186 if(!help_string
) help_string
= &dummy_help_string
;
2189 if(!help_context
) help_context
= &dummy_help_context
;
2192 if(!help_dll
) help_dll
= &dummy_help_dll
;
2195 hr
= ITypeLib2_RemoteGetDocumentation2_Proxy(This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2197 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2202 HRESULT __RPC_STUB
ITypeLib2_GetDocumentation2_Stub(ITypeLib2
*This
, INT index
, LCID lcid
,
2203 DWORD flags
, BSTR
*help_string
,
2204 DWORD
*help_context
, BSTR
*help_dll
)
2206 TRACE("(%p, %d, %08x, %08x, %p, %p, %p)\n", This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2208 *help_string
= *help_dll
= NULL
;
2211 if(!(flags
& 1)) help_string
= NULL
;
2212 if(!(flags
& 2)) help_context
= NULL
;
2213 if(!(flags
& 4)) help_dll
= NULL
;
2215 return ITypeLib2_GetDocumentation2(This
, index
, lcid
, help_string
, help_context
, help_dll
);
2218 HRESULT CALLBACK
IPropertyBag_Read_Proxy(
2220 LPCOLESTR pszPropName
,
2222 IErrorLog
*pErrorLog
)
2224 IUnknown
*pUnk
= NULL
;
2225 TRACE("(%p, %s, %p, %p)\n", This
, debugstr_w(pszPropName
), pVar
, pErrorLog
);
2230 if(V_VT(pVar
) & (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2232 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2239 pUnk
= (IUnknown
*)V_DISPATCH(pVar
);
2242 pUnk
= V_UNKNOWN(pVar
);
2245 FIXME("Safearray support not yet implemented.\n");
2248 FIXME("Unknown V_VT %d - support not yet implemented.\n", V_VT(pVar
));
2252 return IPropertyBag_RemoteRead_Proxy(This
, pszPropName
, pVar
, pErrorLog
,
2256 HRESULT __RPC_STUB
IPropertyBag_Read_Stub(
2258 LPCOLESTR pszPropName
,
2260 IErrorLog
*pErrorLog
,
2264 static const WCHAR emptyWstr
[] = {0};
2267 TRACE("(%p, %s, %p, %p, %x, %p)\n", This
, debugstr_w(pszPropName
), pVar
,
2268 pErrorLog
, varType
, pUnkObj
);
2270 if(varType
& (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2272 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2276 V_VT(pVar
) = varType
;
2280 hr
= IUnknown_QueryInterface(pUnkObj
, &IID_IDispatch
, (LPVOID
*)&disp
);
2283 IUnknown_Release(pUnkObj
);
2284 V_DISPATCH(pVar
) = disp
;
2287 V_UNKNOWN(pVar
) = pUnkObj
;
2290 V_BSTR(pVar
) = SysAllocString(emptyWstr
);
2293 FIXME("Safearray support not yet implemented.\n");
2298 hr
= IPropertyBag_Read(This
, pszPropName
, pVar
, pErrorLog
);
2305 /* call_as/local stubs for ocidl.idl */
2307 HRESULT CALLBACK
IClassFactory2_CreateInstanceLic_Proxy(
2308 IClassFactory2
* This
,
2309 IUnknown
*pUnkOuter
,
2310 IUnknown
*pUnkReserved
,
2315 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObj
);
2321 ERR("aggregation is not allowed on remote objects\n");
2322 return CLASS_E_NOAGGREGATION
;
2325 return IClassFactory2_RemoteCreateInstanceLic_Proxy(This
, riid
, bstrKey
, (IUnknown
**)ppvObj
);
2328 HRESULT __RPC_STUB
IClassFactory2_CreateInstanceLic_Stub(
2329 IClassFactory2
* This
,
2334 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObj
);
2335 return IClassFactory2_CreateInstanceLic(This
, NULL
, NULL
, riid
, bstrKey
, (void**)ppvObj
);
2338 HRESULT CALLBACK
IEnumConnections_Next_Proxy(
2339 IEnumConnections
* This
,
2346 TRACE("(%u, %p %p)\n", cConnections
, rgcd
, pcFetched
);
2349 pcFetched
= &fetched
;
2351 return IEnumConnections_RemoteNext_Proxy(This
, cConnections
, rgcd
, pcFetched
);
2354 HRESULT __RPC_STUB
IEnumConnections_Next_Stub(
2355 IEnumConnections
* This
,
2362 TRACE("(%u, %p, %p)\n", cConnections
, rgcd
, pcFetched
);
2365 hr
= IEnumConnections_Next(This
, cConnections
, rgcd
, pcFetched
);
2367 *pcFetched
= cConnections
;
2372 HRESULT CALLBACK
IEnumConnectionPoints_Next_Proxy(
2373 IEnumConnectionPoints
* This
,
2375 IConnectionPoint
**ppCP
,
2380 TRACE("(%u, %p %p)\n", cConnections
, ppCP
, pcFetched
);
2383 pcFetched
= &fetched
;
2385 return IEnumConnectionPoints_RemoteNext_Proxy(This
, cConnections
, ppCP
, pcFetched
);
2388 HRESULT __RPC_STUB
IEnumConnectionPoints_Next_Stub(
2389 IEnumConnectionPoints
* This
,
2391 IConnectionPoint
**ppCP
,
2396 TRACE("(%u, %p, %p)\n", cConnections
, ppCP
, pcFetched
);
2399 hr
= IEnumConnectionPoints_Next(This
, cConnections
, ppCP
, pcFetched
);
2401 *pcFetched
= cConnections
;
2406 HRESULT CALLBACK
IPersistMemory_Load_Proxy(
2407 IPersistMemory
* This
,
2411 TRACE("(%p, %u)\n", pMem
, cbSize
);
2416 return IPersistMemory_RemoteLoad_Proxy(This
, pMem
, cbSize
);
2419 HRESULT __RPC_STUB
IPersistMemory_Load_Stub(
2420 IPersistMemory
* This
,
2424 TRACE("(%p, %u)\n", pMem
, cbSize
);
2425 return IPersistMemory_Load(This
, pMem
, cbSize
);
2428 HRESULT CALLBACK
IPersistMemory_Save_Proxy(
2429 IPersistMemory
* This
,
2434 TRACE("(%p, %d, %u)\n", pMem
, fClearDirty
, cbSize
);
2439 return IPersistMemory_RemoteSave_Proxy(This
, pMem
, fClearDirty
, cbSize
);
2442 HRESULT __RPC_STUB
IPersistMemory_Save_Stub(
2443 IPersistMemory
* This
,
2448 TRACE("(%p, %d, %u)\n", pMem
, fClearDirty
, cbSize
);
2449 return IPersistMemory_Save(This
, pMem
, fClearDirty
, cbSize
);
2452 void CALLBACK
IAdviseSinkEx_OnViewStatusChange_Proxy(
2453 IAdviseSinkEx
* This
,
2456 TRACE("(%p, 0x%08x)\n", This
, dwViewStatus
);
2457 IAdviseSinkEx_RemoteOnViewStatusChange_Proxy(This
, dwViewStatus
);
2460 HRESULT __RPC_STUB
IAdviseSinkEx_OnViewStatusChange_Stub(
2461 IAdviseSinkEx
* This
,
2464 TRACE("(%p, 0x%08x)\n", This
, dwViewStatus
);
2465 IAdviseSinkEx_OnViewStatusChange(This
, dwViewStatus
);
2469 HRESULT CALLBACK
IEnumOleUndoUnits_Next_Proxy(
2470 IEnumOleUndoUnits
* This
,
2472 IOleUndoUnit
**rgElt
,
2473 ULONG
*pcEltFetched
)
2477 TRACE("(%u, %p %p)\n", cElt
, rgElt
, pcEltFetched
);
2480 pcEltFetched
= &fetched
;
2482 return IEnumOleUndoUnits_RemoteNext_Proxy(This
, cElt
, rgElt
, pcEltFetched
);
2485 HRESULT __RPC_STUB
IEnumOleUndoUnits_Next_Stub(
2486 IEnumOleUndoUnits
* This
,
2488 IOleUndoUnit
**rgElt
,
2489 ULONG
*pcEltFetched
)
2493 TRACE("(%u, %p, %p)\n", cElt
, rgElt
, pcEltFetched
);
2496 hr
= IEnumOleUndoUnits_Next(This
, cElt
, rgElt
, pcEltFetched
);
2498 *pcEltFetched
= cElt
;
2503 HRESULT CALLBACK
IQuickActivate_QuickActivate_Proxy(
2504 IQuickActivate
* This
,
2505 QACONTAINER
*pQaContainer
,
2506 QACONTROL
*pQaControl
)
2508 FIXME("not implemented\n");
2512 HRESULT __RPC_STUB
IQuickActivate_QuickActivate_Stub(
2513 IQuickActivate
* This
,
2514 QACONTAINER
*pQaContainer
,
2515 QACONTROL
*pQaControl
)
2517 FIXME("not implemented\n");