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
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
40 #define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
41 #define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
42 #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
43 #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
45 /* ole32 exports those, not defined in public headers */
46 ULONG __RPC_USER
WdtpInterfacePointer_UserSize(ULONG
*, ULONG
, ULONG
, IUnknown
*, REFIID
);
47 unsigned char * __RPC_USER
WdtpInterfacePointer_UserMarshal(ULONG
*, ULONG
, unsigned char*, IUnknown
*, REFIID
);
48 unsigned char * __RPC_USER
WdtpInterfacePointer_UserUnmarshal(ULONG
*, unsigned char*, IUnknown
**, REFIID
);
50 static void dump_user_flags(const ULONG
*pFlags
)
52 if (HIWORD(*pFlags
) == NDR_LOCAL_DATA_REPRESENTATION
)
53 TRACE("MAKELONG(NDR_LOCAL_REPRESENTATION, ");
55 TRACE("MAKELONG(0x%04x, ", HIWORD(*pFlags
));
56 switch (LOWORD(*pFlags
))
58 case MSHCTX_LOCAL
: TRACE("MSHCTX_LOCAL)"); break;
59 case MSHCTX_NOSHAREDMEM
: TRACE("MSHCTX_NOSHAREDMEM)"); break;
60 case MSHCTX_DIFFERENTMACHINE
: TRACE("MSHCTX_DIFFERENTMACHINE)"); break;
61 case MSHCTX_INPROC
: TRACE("MSHCTX_INPROC)"); break;
62 default: TRACE("%d)", LOWORD(*pFlags
));
66 /* CLEANLOCALSTORAGE */
68 #define CLS_FUNCDESC 'f'
69 #define CLS_LIBATTR 'l'
70 #define CLS_TYPEATTR 't'
71 #define CLS_VARDESC 'v'
73 ULONG WINAPI
CLEANLOCALSTORAGE_UserSize(ULONG
*pFlags
, ULONG Start
, CLEANLOCALSTORAGE
*pstg
)
75 ALIGN_LENGTH(Start
, 3);
76 return Start
+ sizeof(DWORD
);
79 unsigned char * WINAPI
CLEANLOCALSTORAGE_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, CLEANLOCALSTORAGE
*pstg
)
81 ALIGN_POINTER(Buffer
, 3);
82 *(DWORD
*)Buffer
= pstg
->flags
;
84 if (!pstg
->pInterface
)
85 return Buffer
+ sizeof(DWORD
);
90 ITypeLib_ReleaseTLibAttr((ITypeLib
*)pstg
->pInterface
, *(TLIBATTR
**)pstg
->pStorage
);
93 ITypeInfo_ReleaseTypeAttr((ITypeInfo
*)pstg
->pInterface
, *(TYPEATTR
**)pstg
->pStorage
);
96 ITypeInfo_ReleaseFuncDesc((ITypeInfo
*)pstg
->pInterface
, *(FUNCDESC
**)pstg
->pStorage
);
99 ITypeInfo_ReleaseVarDesc((ITypeInfo
*)pstg
->pInterface
, *(VARDESC
**)pstg
->pStorage
);
103 ERR("Unknown type %lx\n", pstg
->flags
);
106 *(VOID
**)pstg
->pStorage
= NULL
;
107 IUnknown_Release(pstg
->pInterface
);
108 pstg
->pInterface
= NULL
;
110 return Buffer
+ sizeof(DWORD
);
113 unsigned char * WINAPI
CLEANLOCALSTORAGE_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, CLEANLOCALSTORAGE
*pstr
)
115 ALIGN_POINTER(Buffer
, 3);
116 pstr
->flags
= *(DWORD
*)Buffer
;
117 return Buffer
+ sizeof(DWORD
);
120 void WINAPI
CLEANLOCALSTORAGE_UserFree(ULONG
*pFlags
, CLEANLOCALSTORAGE
*pstr
)
129 DWORD len
; /* No. of chars not including trailing '\0' */
130 DWORD byte_len
; /* len * 2 or 0xffffffff if len == 0 */
131 DWORD len2
; /* == len */
134 ULONG WINAPI
BSTR_UserSize(ULONG
*pFlags
, ULONG Start
, BSTR
*pstr
)
136 TRACE("%#lx, %lu, %p => %p\n", *pFlags
, Start
, pstr
, *pstr
);
137 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
138 ALIGN_LENGTH(Start
, 3);
139 Start
+= sizeof(bstr_wire_t
) + ((SysStringByteLen(*pstr
) + 1) & ~1);
140 TRACE("returning %ld\n", Start
);
144 unsigned char * WINAPI
BSTR_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, BSTR
*pstr
)
147 DWORD len
= SysStringByteLen(*pstr
);
149 TRACE("%#lx, %p, %p => %p\n", *pFlags
, Buffer
, pstr
, *pstr
);
150 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
152 ALIGN_POINTER(Buffer
, 3);
153 header
= (bstr_wire_t
*)Buffer
;
154 header
->len
= header
->len2
= (len
+ 1) / 2;
157 header
->byte_len
= len
;
158 memcpy(header
+ 1, *pstr
, header
->len
* 2);
161 header
->byte_len
= 0xffffffff; /* special case for a null bstr */
163 return Buffer
+ sizeof(*header
) + sizeof(OLECHAR
) * header
->len
;
166 unsigned char * WINAPI
BSTR_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, BSTR
*pstr
)
169 TRACE("%#lx, %p, %p => %p\n", *pFlags
, Buffer
, pstr
, *pstr
);
171 ALIGN_POINTER(Buffer
, 3);
172 header
= (bstr_wire_t
*)Buffer
;
173 if(header
->len
!= header
->len2
)
174 FIXME("len %#lx != len2 %#lx\n", header
->len
, header
->len2
);
176 if (header
->byte_len
== 0xffffffff)
178 SysFreeString(*pstr
);
181 else SysReAllocStringLen( pstr
, (OLECHAR
*)(header
+ 1), header
->len
);
183 if (*pstr
) TRACE("string=%s\n", debugstr_w(*pstr
));
184 return Buffer
+ sizeof(*header
) + sizeof(OLECHAR
) * header
->len
;
187 void WINAPI
BSTR_UserFree(ULONG
*pFlags
, BSTR
*pstr
)
189 TRACE("%#lx, %p => %p\n", *pFlags
, pstr
, *pstr
);
190 SysFreeString(*pstr
);
207 unsigned int get_type_size(ULONG
*pFlags
, VARTYPE vt
)
209 if (vt
& VT_ARRAY
) return 4;
211 switch (vt
& ~VT_BYREF
) {
220 return sizeof(SHORT
);
230 return sizeof(LONGLONG
);
232 return sizeof(FLOAT
);
234 return sizeof(DOUBLE
);
236 return sizeof(VARIANT_BOOL
);
238 return sizeof(SCODE
);
244 return sizeof(DECIMAL
);
246 return sizeof(ULONG
);
248 return sizeof(VARIANT
);
254 FIXME("unhandled VT %d\n", vt
);
259 static unsigned int get_type_alignment(ULONG
*pFlags
, VARTYPE vt
)
261 unsigned int size
= get_type_size(pFlags
, vt
);
262 if(vt
& VT_BYREF
) return 3;
263 if(size
== 0) return 0;
264 if(size
<= 4) return size
- 1;
268 /* WdtpInterfacePointer_UserSize takes care of 2 additional DWORDs to store marshalling buffer size */
269 static unsigned interface_user_size(ULONG
*pFlags
, ULONG Start
, REFIID riid
, IUnknown
*punk
)
275 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), 0, punk
, riid
);
278 ERR("interface variant buffer size calculation failed\n");
282 size
+= sizeof(ULONG
);
283 TRACE("wire-size extra of interface variant is %ld.\n", size
);
287 static ULONG
wire_extra_user_size(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
292 return LPSAFEARRAY_UserSize(pFlags
, Start
, V_ARRAYREF(pvar
));
294 return LPSAFEARRAY_UserSize(pFlags
, Start
, &V_ARRAY(pvar
));
297 switch (V_VT(pvar
)) {
299 return BSTR_UserSize(pFlags
, Start
, &V_BSTR(pvar
));
300 case VT_BSTR
| VT_BYREF
:
301 return BSTR_UserSize(pFlags
, Start
, V_BSTRREF(pvar
));
302 case VT_VARIANT
| VT_BYREF
:
303 return VARIANT_UserSize(pFlags
, Start
, V_VARIANTREF(pvar
));
305 return interface_user_size(pFlags
, Start
, &IID_IUnknown
, V_UNKNOWN(pvar
));
306 case VT_UNKNOWN
| VT_BYREF
:
307 return interface_user_size(pFlags
, Start
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
309 return interface_user_size(pFlags
, Start
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
310 case VT_DISPATCH
| VT_BYREF
:
311 return interface_user_size(pFlags
, Start
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
313 FIXME("wire-size record\n");
316 case VT_SAFEARRAY
| VT_BYREF
:
317 FIXME("wire-size safearray: shouldn't be marshaling this\n");
324 /* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer */
325 static unsigned char* interface_user_marshal(ULONG
*pFlags
, unsigned char *Buffer
,
326 REFIID riid
, IUnknown
*punk
)
328 TRACE("%#lx, %p, %p.\n", *pFlags
, Buffer
, punk
);
330 /* first DWORD is used to store pointer itself, truncated on win64 */
333 memset(Buffer
, 0, sizeof(ULONG
));
334 return Buffer
+ sizeof(ULONG
);
338 *(DWORD
*)Buffer
= (DWORD_PTR
)punk
;
339 Buffer
+= sizeof(DWORD
);
342 return WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), Buffer
, punk
, riid
);
345 /* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer */
346 static unsigned char *interface_user_unmarshal(ULONG
*pFlags
, unsigned char *Buffer
,
347 REFIID riid
, IUnknown
**ppunk
)
351 TRACE("%#lx, %p, %p.\n", *pFlags
, Buffer
, ppunk
);
353 /* skip pointer part itself */
354 ptr
= *(DWORD
*)Buffer
;
355 Buffer
+= sizeof(DWORD
);
360 return WdtpInterfacePointer_UserUnmarshal(pFlags
, Buffer
, ppunk
, riid
);
363 ULONG WINAPI
VARIANT_UserSize(ULONG
*pFlags
, ULONG Start
, VARIANT
*pvar
)
366 TRACE("%#lx, %lu, %p.\n", *pFlags
, Start
, pvar
);
367 TRACE("vt=%04x\n", V_VT(pvar
));
369 ALIGN_LENGTH(Start
, 7);
370 Start
+= sizeof(variant_wire_t
);
371 if(V_VT(pvar
) & VT_BYREF
)
374 align
= get_type_alignment(pFlags
, V_VT(pvar
));
375 ALIGN_LENGTH(Start
, align
);
376 if(V_VT(pvar
) == (VT_VARIANT
| VT_BYREF
))
379 Start
+= get_type_size(pFlags
, V_VT(pvar
));
380 Start
= wire_extra_user_size(pFlags
, Start
, pvar
);
382 TRACE("returning %ld\n", Start
);
386 unsigned char * WINAPI
VARIANT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
388 variant_wire_t
*header
;
393 TRACE("%#lx, %p, %p.\n", *pFlags
, Buffer
, pvar
);
394 TRACE("vt=%04x\n", V_VT(pvar
));
396 ALIGN_POINTER(Buffer
, 7);
398 header
= (variant_wire_t
*)Buffer
;
400 header
->clSize
= 0; /* fixed up at the end */
401 header
->rpcReserved
= 0;
402 header
->vt
= V_VT(pvar
);
403 header
->wReserved1
= pvar
->wReserved1
;
404 header
->wReserved2
= pvar
->wReserved2
;
405 header
->wReserved3
= pvar
->wReserved3
;
406 header
->switch_is
= V_VT(pvar
);
407 if(header
->switch_is
& VT_ARRAY
)
408 header
->switch_is
&= ~VT_TYPEMASK
;
410 Pos
= (unsigned char*)(header
+ 1);
411 type_size
= get_type_size(pFlags
, V_VT(pvar
));
412 align
= get_type_alignment(pFlags
, V_VT(pvar
));
413 ALIGN_POINTER(Pos
, align
);
415 if(header
->vt
& VT_BYREF
)
417 *(DWORD
*)Pos
= max(type_size
, 4);
419 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
421 memcpy(Pos
, V_BYREF(pvar
), type_size
);
426 *(DWORD
*)Pos
= 'U' | 's' << 8 | 'e' << 16 | 'r' << 24;
432 if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
433 memcpy(Pos
, pvar
, type_size
);
435 memcpy(Pos
, &V_UI8(pvar
), type_size
);
439 if(header
->vt
& VT_ARRAY
)
441 if(header
->vt
& VT_BYREF
)
442 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
444 Pos
= LPSAFEARRAY_UserMarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
451 Pos
= BSTR_UserMarshal(pFlags
, Pos
, &V_BSTR(pvar
));
453 case VT_BSTR
| VT_BYREF
:
454 Pos
= BSTR_UserMarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
456 case VT_VARIANT
| VT_BYREF
:
457 Pos
= VARIANT_UserMarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
460 Pos
= interface_user_marshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWN(pvar
));
462 case VT_UNKNOWN
| VT_BYREF
:
463 Pos
= interface_user_marshal(pFlags
, Pos
, &IID_IUnknown
, *V_UNKNOWNREF(pvar
));
466 Pos
= interface_user_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)V_DISPATCH(pvar
));
468 case VT_DISPATCH
| VT_BYREF
:
469 Pos
= interface_user_marshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
*)*V_DISPATCHREF(pvar
));
472 FIXME("handle BRECORD by val\n");
474 case VT_RECORD
| VT_BYREF
:
475 FIXME("handle BRECORD by ref\n");
479 header
->clSize
= ((Pos
- Buffer
) + 7) >> 3;
480 TRACE("marshalled size %ld\n", header
->clSize
);
484 unsigned char * WINAPI
VARIANT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, VARIANT
*pvar
)
486 variant_wire_t
*header
;
491 TRACE("%#lx, %p, %p.\n", *pFlags
, Buffer
, pvar
);
493 ALIGN_POINTER(Buffer
, 7);
495 header
= (variant_wire_t
*)Buffer
;
497 Pos
= (unsigned char*)(header
+ 1);
498 type_size
= get_type_size(pFlags
, header
->vt
);
499 align
= get_type_alignment(pFlags
, header
->vt
);
500 ALIGN_POINTER(Pos
, align
);
502 if(header
->vt
& VT_BYREF
)
507 /* byref array needs to allocate a SAFEARRAY pointer */
508 if (header
->vt
& VT_ARRAY
)
509 mem_size
= sizeof(void *);
510 else switch (header
->vt
& ~VT_BYREF
)
512 /* these types have a different memory size compared to wire size */
516 mem_size
= sizeof(void *);
519 mem_size
= type_size
;
523 if (V_VT(pvar
) != header
->vt
)
526 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
527 memset(V_BYREF(pvar
), 0, mem_size
);
529 else if (!V_BYREF(pvar
))
531 V_BYREF(pvar
) = CoTaskMemAlloc(mem_size
);
532 memset(V_BYREF(pvar
), 0, mem_size
);
535 if(!(header
->vt
& VT_ARRAY
)
536 && (header
->vt
& VT_TYPEMASK
) != VT_BSTR
537 && (header
->vt
& VT_TYPEMASK
) != VT_VARIANT
538 && (header
->vt
& VT_TYPEMASK
) != VT_UNKNOWN
539 && (header
->vt
& VT_TYPEMASK
) != VT_DISPATCH
540 && (header
->vt
& VT_TYPEMASK
) != VT_RECORD
)
541 memcpy(V_BYREF(pvar
), Pos
, type_size
);
543 if((header
->vt
& VT_TYPEMASK
) != VT_VARIANT
)
551 if(header
->vt
& VT_ARRAY
)
552 V_ARRAY(pvar
) = NULL
;
553 else if((header
->vt
& VT_TYPEMASK
) == VT_BSTR
)
555 else if((header
->vt
& VT_TYPEMASK
) == VT_UNKNOWN
)
556 V_UNKNOWN(pvar
) = NULL
;
557 else if((header
->vt
& VT_TYPEMASK
) == VT_DISPATCH
)
558 V_DISPATCH(pvar
) = NULL
;
559 else if((header
->vt
& VT_TYPEMASK
) == VT_RECORD
)
560 V_RECORD(pvar
) = NULL
;
561 else if((header
->vt
& VT_TYPEMASK
) == VT_DECIMAL
)
562 memcpy(pvar
, Pos
, type_size
);
564 memcpy(&V_UI8(pvar
), Pos
, type_size
);
568 V_VT(pvar
) = header
->vt
;
569 pvar
->wReserved1
= header
->wReserved1
;
570 pvar
->wReserved2
= header
->wReserved2
;
571 pvar
->wReserved3
= header
->wReserved3
;
573 if(header
->vt
& VT_ARRAY
)
575 if(header
->vt
& VT_BYREF
)
576 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, V_ARRAYREF(pvar
));
578 Pos
= LPSAFEARRAY_UserUnmarshal(pFlags
, Pos
, &V_ARRAY(pvar
));
585 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, &V_BSTR(pvar
));
587 case VT_BSTR
| VT_BYREF
:
588 Pos
= BSTR_UserUnmarshal(pFlags
, Pos
, V_BSTRREF(pvar
));
590 case VT_VARIANT
| VT_BYREF
:
591 Pos
= VARIANT_UserUnmarshal(pFlags
, Pos
, V_VARIANTREF(pvar
));
594 Pos
= interface_user_unmarshal(pFlags
, Pos
, &IID_IUnknown
, &V_UNKNOWN(pvar
));
596 case VT_UNKNOWN
| VT_BYREF
:
597 Pos
= interface_user_unmarshal(pFlags
, Pos
, &IID_IUnknown
, V_UNKNOWNREF(pvar
));
600 Pos
= interface_user_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)&V_DISPATCH(pvar
));
602 case VT_DISPATCH
| VT_BYREF
:
603 Pos
= interface_user_unmarshal(pFlags
, Pos
, &IID_IDispatch
, (IUnknown
**)V_DISPATCHREF(pvar
));
606 FIXME("handle BRECORD by val\n");
608 case VT_RECORD
| VT_BYREF
:
609 FIXME("handle BRECORD by ref\n");
616 void WINAPI
VARIANT_UserFree(ULONG
*pFlags
, VARIANT
*pvar
)
618 VARTYPE vt
= V_VT(pvar
);
621 TRACE("%#lx, %p.\n", *pFlags
, pvar
);
622 TRACE("vt=%04x\n", V_VT(pvar
));
624 if (vt
& VT_BYREF
) ref
= V_BYREF(pvar
);
632 LPSAFEARRAY_UserFree(pFlags
, V_ARRAYREF(pvar
));
634 LPSAFEARRAY_UserFree(pFlags
, &V_ARRAY(pvar
));
640 case VT_BSTR
| VT_BYREF
:
641 BSTR_UserFree(pFlags
, V_BSTRREF(pvar
));
643 case VT_VARIANT
| VT_BYREF
:
644 VARIANT_UserFree(pFlags
, V_VARIANTREF(pvar
));
646 case VT_RECORD
| VT_BYREF
:
647 FIXME("handle BRECORD by ref\n");
649 case VT_UNKNOWN
| VT_BYREF
:
650 case VT_DISPATCH
| VT_BYREF
:
651 if (*V_UNKNOWNREF(pvar
))
652 IUnknown_Release(*V_UNKNOWNREF(pvar
));
662 /* Get the number of cells in a SafeArray */
663 static ULONG
SAFEARRAY_GetCellCount(const SAFEARRAY
*psa
)
665 const SAFEARRAYBOUND
* psab
= psa
->rgsabound
;
666 USHORT cCount
= psa
->cDims
;
667 ULONG ulNumCells
= 1;
671 /* This is a valid bordercase. See testcases. -Marcus */
672 if (!psab
->cElements
)
674 ulNumCells
*= psab
->cElements
;
680 static inline SF_TYPE
SAFEARRAY_GetUnionType(SAFEARRAY
*psa
)
685 hr
= SafeArrayGetVartype(psa
, &vt
);
688 if(psa
->fFeatures
& FADF_VARIANT
) return SF_VARIANT
;
690 switch(psa
->cbElements
)
692 case 1: vt
= VT_I1
; break;
693 case 2: vt
= VT_I2
; break;
694 case 4: vt
= VT_I4
; break;
695 case 8: vt
= VT_I8
; break;
697 RpcRaiseException(hr
);
701 if (psa
->fFeatures
& FADF_HAVEIID
)
707 case VT_UI1
: return SF_I1
;
710 case VT_UI2
: return SF_I2
;
715 case VT_R4
: return SF_I4
;
720 case VT_UI8
: return SF_I8
;
722 case VT_UINT_PTR
: return (sizeof(UINT_PTR
) == 4 ? SF_I4
: SF_I8
);
723 case VT_BSTR
: return SF_BSTR
;
724 case VT_DISPATCH
: return SF_DISPATCH
;
725 case VT_VARIANT
: return SF_VARIANT
;
726 case VT_UNKNOWN
: return SF_UNKNOWN
;
727 /* Note: Return a non-zero size to indicate vt is valid. The actual size
728 * of a UDT is taken from the result of IRecordInfo_GetSize().
730 case VT_RECORD
: return SF_RECORD
;
731 default: return SF_ERROR
;
735 static DWORD
elem_wire_size(LPSAFEARRAY lpsa
, SF_TYPE sftype
)
743 return sizeof(DWORD
);
746 return sizeof(variant_wire_t
) - sizeof(DWORD
);
749 return lpsa
->cbElements
;
753 static DWORD
elem_mem_size(wireSAFEARRAY wiresa
, SF_TYPE sftype
)
760 return sizeof(void *);
766 return sizeof(VARIANT
);
769 return wiresa
->cbElements
;
773 ULONG WINAPI
LPSAFEARRAY_UserSize(ULONG
*pFlags
, ULONG StartingSize
, LPSAFEARRAY
*ppsa
)
775 ULONG size
= StartingSize
;
777 TRACE("("); dump_user_flags(pFlags
); TRACE(", %ld, %p\n", StartingSize
, *ppsa
);
779 ALIGN_LENGTH(size
, 3);
780 size
+= sizeof(ULONG
);
783 SAFEARRAY
*psa
= *ppsa
;
784 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
788 size
+= sizeof(ULONG
);
789 size
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
791 sftype
= SAFEARRAY_GetUnionType(psa
);
792 size
+= sizeof(ULONG
);
794 size
+= sizeof(ULONG
);
795 size
+= sizeof(ULONG
);
796 if (sftype
== SF_HAVEIID
)
799 size
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
801 size
+= sizeof(ULONG
);
809 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
810 size
= BSTR_UserSize(pFlags
, size
, lpBstr
);
821 if (sftype
== SF_HAVEIID
)
822 SafeArrayGetIID(psa
, &guid
);
823 else if (sftype
== SF_UNKNOWN
)
826 guid
= IID_IDispatch
;
828 for (lpUnk
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpUnk
++)
829 size
= interface_user_size(pFlags
, size
, &guid
, *lpUnk
);
837 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
838 size
= VARIANT_UserSize(pFlags
, size
, lpVariant
);
844 IRecordInfo
* pRecInfo
= NULL
;
846 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
848 RpcRaiseException(hr
);
852 FIXME("size record info %p\n", pRecInfo
);
854 IRecordInfo_Release(pRecInfo
);
859 ALIGN_LENGTH(size
, 7);
864 size
+= ulCellCount
* psa
->cbElements
;
875 unsigned char * WINAPI
LPSAFEARRAY_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
879 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, &%p\n", Buffer
, *ppsa
);
881 ALIGN_POINTER(Buffer
, 3);
882 *(ULONG
*)Buffer
= *ppsa
? 0x1 : 0x0;
883 Buffer
+= sizeof(ULONG
);
887 SAFEARRAY
*psa
= *ppsa
;
888 ULONG ulCellCount
= SAFEARRAY_GetCellCount(psa
);
889 SAFEARRAYBOUND
*bound
;
894 sftype
= SAFEARRAY_GetUnionType(psa
);
896 *(ULONG
*)Buffer
= psa
->cDims
;
897 Buffer
+= sizeof(ULONG
);
898 *(USHORT
*)Buffer
= psa
->cDims
;
899 Buffer
+= sizeof(USHORT
);
900 *(USHORT
*)Buffer
= psa
->fFeatures
;
901 Buffer
+= sizeof(USHORT
);
902 *(ULONG
*)Buffer
= elem_wire_size(psa
, sftype
);
903 Buffer
+= sizeof(ULONG
);
905 hr
= SafeArrayGetVartype(psa
, &vt
);
906 if ((psa
->fFeatures
& FADF_HAVEIID
) || FAILED(hr
)) vt
= 0;
908 *(ULONG
*)Buffer
= (USHORT
)psa
->cLocks
| (vt
<< 16);
909 Buffer
+= sizeof(ULONG
);
911 *(ULONG
*)Buffer
= sftype
;
912 Buffer
+= sizeof(ULONG
);
914 *(ULONG
*)Buffer
= ulCellCount
;
915 Buffer
+= sizeof(ULONG
);
916 *(ULONG
*)Buffer
= psa
->pvData
? 0x2 : 0x0;
917 Buffer
+= sizeof(ULONG
);
918 if (sftype
== SF_HAVEIID
)
920 SafeArrayGetIID(psa
, &guid
);
921 memcpy(Buffer
, &guid
, sizeof(guid
));
922 Buffer
+= sizeof(guid
);
925 /* bounds are marshaled in opposite order comparing to storage layout */
926 bound
= (SAFEARRAYBOUND
*)Buffer
;
927 for (i
= 0; i
< psa
->cDims
; i
++)
929 memcpy(bound
++, &psa
->rgsabound
[psa
->cDims
-i
-1], sizeof(psa
->rgsabound
[0]));
931 Buffer
+= sizeof(psa
->rgsabound
[0]) * psa
->cDims
;
933 *(ULONG
*)Buffer
= ulCellCount
;
934 Buffer
+= sizeof(ULONG
);
944 for (lpBstr
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpBstr
++)
945 Buffer
= BSTR_UserMarshal(pFlags
, Buffer
, lpBstr
);
956 if (sftype
== SF_HAVEIID
)
958 else if (sftype
== SF_UNKNOWN
)
961 iid
= &IID_IDispatch
;
963 for (lpUnk
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpUnk
++)
964 Buffer
= interface_user_marshal(pFlags
, Buffer
, iid
, *lpUnk
);
972 for (lpVariant
= psa
->pvData
; ulCellCount
; ulCellCount
--, lpVariant
++)
973 Buffer
= VARIANT_UserMarshal(pFlags
, Buffer
, lpVariant
);
979 IRecordInfo
* pRecInfo
= NULL
;
981 hr
= SafeArrayGetRecordInfo(psa
, &pRecInfo
);
983 RpcRaiseException(hr
);
987 FIXME("write record info %p\n", pRecInfo
);
989 IRecordInfo_Release(pRecInfo
);
995 ALIGN_POINTER(Buffer
, 7);
1000 /* Just copy the data over */
1001 memcpy(Buffer
, psa
->pvData
, ulCellCount
* psa
->cbElements
);
1002 Buffer
+= ulCellCount
* psa
->cbElements
;
1013 #define FADF_AUTOSETFLAGS (FADF_HAVEIID | FADF_RECORD | FADF_HAVEVARTYPE | \
1014 FADF_BSTR | FADF_UNKNOWN | FADF_DISPATCH | \
1015 FADF_VARIANT | FADF_CREATEVECTOR)
1017 unsigned char * WINAPI
LPSAFEARRAY_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, LPSAFEARRAY
*ppsa
)
1020 wireSAFEARRAY wiresa
;
1027 SAFEARRAYBOUND
*wiresab
;
1029 TRACE("("); dump_user_flags(pFlags
); TRACE(", %p, %p\n", Buffer
, ppsa
);
1031 ALIGN_POINTER(Buffer
, 3);
1032 ptr
= *(ULONG
*)Buffer
;
1033 Buffer
+= sizeof(ULONG
);
1037 SafeArrayDestroy(*ppsa
);
1040 TRACE("NULL safe array unmarshaled\n");
1045 cDims
= *(ULONG
*)Buffer
;
1046 Buffer
+= sizeof(ULONG
);
1048 wiresa
= (wireSAFEARRAY
)Buffer
;
1049 Buffer
+= 2 * sizeof(USHORT
) + 2 * sizeof(ULONG
);
1051 if (cDims
!= wiresa
->cDims
)
1052 RpcRaiseException(RPC_S_INVALID_BOUND
);
1054 /* FIXME: there should be a limit on how large cDims can be */
1056 vt
= HIWORD(wiresa
->cLocks
);
1058 sftype
= *(ULONG
*)Buffer
;
1059 Buffer
+= sizeof(ULONG
);
1061 cell_count
= *(ULONG
*)Buffer
;
1062 Buffer
+= sizeof(ULONG
);
1063 ptr
= *(ULONG
*)Buffer
;
1064 Buffer
+= sizeof(ULONG
);
1065 if (sftype
== SF_HAVEIID
)
1067 memcpy(&guid
, Buffer
, sizeof(guid
));
1068 Buffer
+= sizeof(guid
);
1071 wiresab
= (SAFEARRAYBOUND
*)Buffer
;
1072 Buffer
+= sizeof(wiresab
[0]) * wiresa
->cDims
;
1074 if(*ppsa
&& (*ppsa
)->cDims
==wiresa
->cDims
)
1076 if(((*ppsa
)->fFeatures
& ~FADF_AUTOSETFLAGS
) != (wiresa
->fFeatures
& ~FADF_AUTOSETFLAGS
))
1077 RpcRaiseException(DISP_E_BADCALLEE
);
1079 if(SAFEARRAY_GetCellCount(*ppsa
)*(*ppsa
)->cbElements
!= cell_count
*elem_mem_size(wiresa
, sftype
))
1081 if((*ppsa
)->fFeatures
& (FADF_AUTO
|FADF_STATIC
|FADF_EMBEDDED
|FADF_FIXEDSIZE
))
1082 RpcRaiseException(DISP_E_BADCALLEE
);
1084 hr
= SafeArrayDestroyData(*ppsa
);
1086 RpcRaiseException(hr
);
1088 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(*wiresab
)*wiresa
->cDims
);
1090 if((*ppsa
)->fFeatures
& FADF_HAVEVARTYPE
)
1091 ((DWORD
*)(*ppsa
))[-1] = vt
;
1095 SafeArrayDestroy(*ppsa
);
1096 *ppsa
= SafeArrayCreateEx(vt
, wiresa
->cDims
, wiresab
, NULL
);
1097 if (!*ppsa
) RpcRaiseException(E_OUTOFMEMORY
);
1101 SafeArrayDestroy(*ppsa
);
1102 if (FAILED(SafeArrayAllocDescriptor(wiresa
->cDims
, ppsa
)))
1103 RpcRaiseException(E_OUTOFMEMORY
);
1104 memcpy((*ppsa
)->rgsabound
, wiresab
, sizeof(SAFEARRAYBOUND
) * wiresa
->cDims
);
1107 /* be careful about which flags we set since they could be a security
1109 (*ppsa
)->fFeatures
&= FADF_AUTOSETFLAGS
;
1110 (*ppsa
)->fFeatures
|= (wiresa
->fFeatures
& ~(FADF_AUTOSETFLAGS
));
1111 /* FIXME: there should be a limit on how large wiresa->cbElements can be */
1112 (*ppsa
)->cbElements
= elem_mem_size(wiresa
, sftype
);
1114 /* SafeArrayCreateEx allocates the data for us, but
1115 * SafeArrayAllocDescriptor doesn't */
1116 if(!(*ppsa
)->pvData
)
1118 hr
= SafeArrayAllocData(*ppsa
);
1120 RpcRaiseException(hr
);
1123 if ((*(ULONG
*)Buffer
!= cell_count
) || (SAFEARRAY_GetCellCount(*ppsa
) != cell_count
))
1124 RpcRaiseException(RPC_S_INVALID_BOUND
);
1125 Buffer
+= sizeof(ULONG
);
1135 for (lpBstr
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpBstr
++)
1136 Buffer
= BSTR_UserUnmarshal(pFlags
, Buffer
, lpBstr
);
1147 if (sftype
== SF_HAVEIID
)
1149 else if (sftype
== SF_UNKNOWN
)
1150 iid
= &IID_IUnknown
;
1152 iid
= &IID_IDispatch
;
1154 for (lpUnk
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpUnk
++)
1155 Buffer
= interface_user_unmarshal(pFlags
, Buffer
, iid
, lpUnk
);
1163 for (lpVariant
= (*ppsa
)->pvData
; cell_count
; cell_count
--, lpVariant
++)
1164 Buffer
= VARIANT_UserUnmarshal(pFlags
, Buffer
, lpVariant
);
1170 FIXME("set record info\n");
1176 ALIGN_POINTER(Buffer
, 7);
1181 /* Just copy the data over */
1182 memcpy((*ppsa
)->pvData
, Buffer
, cell_count
* (*ppsa
)->cbElements
);
1183 Buffer
+= cell_count
* (*ppsa
)->cbElements
;
1190 TRACE("safe array unmarshaled: %p\n", *ppsa
);
1195 void WINAPI
LPSAFEARRAY_UserFree(ULONG
*pFlags
, LPSAFEARRAY
*ppsa
)
1197 TRACE("("); dump_user_flags(pFlags
); TRACE(", &%p\n", *ppsa
);
1199 SafeArrayDestroy(*ppsa
);
1204 ULONG WINAPI
HFONT_UserSize(ULONG
*pFlags
, ULONG Start
, HFONT
*phfont
)
1210 unsigned char * WINAPI
HFONT_UserMarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1216 unsigned char * WINAPI
HFONT_UserUnmarshal(ULONG
*pFlags
, unsigned char *Buffer
, HFONT
*phfont
)
1222 void WINAPI
HFONT_UserFree(ULONG
*pFlags
, HFONT
*phfont
)
1230 /* exactly how Invoke is marshalled is not very clear to me yet,
1231 * but the way I've done it seems to work for me */
1233 HRESULT CALLBACK
IDispatch_Invoke_Proxy(
1235 DISPID dispIdMember
,
1239 DISPPARAMS
* pDispParams
,
1240 VARIANT
* pVarResult
,
1241 EXCEPINFO
* pExcepInfo
,
1246 UINT
* rgVarRefIdx
= NULL
;
1247 VARIANTARG
* rgVarRef
= NULL
;
1250 EXCEPINFO ExcepInfo
;
1252 TRACE("%p, %ld, %s, %#lx, %x, %p, %p, %p, %p.\n", This
,
1253 dispIdMember
, debugstr_guid(riid
),
1254 lcid
, wFlags
, pDispParams
, pVarResult
,
1255 pExcepInfo
, puArgErr
);
1257 /* [out] args can't be null, use dummy vars if needed */
1258 if (!pVarResult
) pVarResult
= &VarResult
;
1259 if (!puArgErr
) puArgErr
= &uArgErr
;
1260 if (!pExcepInfo
) pExcepInfo
= &ExcepInfo
;
1262 /* count by-ref args */
1263 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1264 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1265 if (V_ISBYREF(arg
)) {
1270 rgVarRefIdx
= CoTaskMemAlloc(sizeof(UINT
)*cVarRef
);
1271 rgVarRef
= CoTaskMemAlloc(sizeof(VARIANTARG
)*cVarRef
);
1272 /* make list of by-ref args */
1273 for (cVarRef
=0,u
=0; u
<pDispParams
->cArgs
; u
++) {
1274 VARIANTARG
* arg
= &pDispParams
->rgvarg
[u
];
1275 if (V_ISBYREF(arg
)) {
1276 rgVarRefIdx
[cVarRef
] = u
;
1277 VariantInit(&rgVarRef
[cVarRef
]);
1278 VariantCopy(&rgVarRef
[cVarRef
], arg
);
1284 /* [out] args still can't be null,
1285 * but we can point these anywhere in this case,
1286 * since they won't be written to when cVarRef is 0 */
1287 rgVarRefIdx
= puArgErr
;
1288 rgVarRef
= pVarResult
;
1290 TRACE("passed by ref: %d args\n", cVarRef
);
1291 hr
= IDispatch_RemoteInvoke_Proxy(This
,
1304 for (u
=0; u
<cVarRef
; u
++) {
1305 unsigned i
= rgVarRefIdx
[u
];
1306 VariantCopy(&pDispParams
->rgvarg
[i
],
1308 VariantClear(&rgVarRef
[u
]);
1310 CoTaskMemFree(rgVarRef
);
1311 CoTaskMemFree(rgVarRefIdx
);
1314 if(pExcepInfo
== &ExcepInfo
)
1316 SysFreeString(pExcepInfo
->bstrSource
);
1317 SysFreeString(pExcepInfo
->bstrDescription
);
1318 SysFreeString(pExcepInfo
->bstrHelpFile
);
1323 HRESULT __RPC_STUB
IDispatch_Invoke_Stub(
1325 DISPID dispIdMember
,
1329 DISPPARAMS
* pDispParams
,
1330 VARIANT
* pVarResult
,
1331 EXCEPINFO
* pExcepInfo
,
1335 VARIANTARG
* rgVarRef
)
1338 VARIANTARG
*rgvarg
, *arg
;
1341 /* initialize out parameters, so that they can be marshalled
1342 * in case the real Invoke doesn't initialize them */
1343 VariantInit(pVarResult
);
1344 memset(pExcepInfo
, 0, sizeof(*pExcepInfo
));
1347 /* let the real Invoke operate on a copy of the in parameters,
1348 * so we don't risk losing pointers to allocated memory */
1349 rgvarg
= pDispParams
->rgvarg
;
1350 arg
= CoTaskMemAlloc(sizeof(VARIANTARG
)*pDispParams
->cArgs
);
1351 if (!arg
) return E_OUTOFMEMORY
;
1353 /* init all args so we can call VariantClear on all the args if the copy
1355 for (u
= 0; u
< pDispParams
->cArgs
; u
++)
1356 VariantInit(&arg
[u
]);
1358 for (u
= 0; u
< pDispParams
->cArgs
; u
++) {
1359 hr
= VariantCopy(&arg
[u
], &rgvarg
[u
]);
1364 if (SUCCEEDED(hr
)) {
1365 /* copy ref args to arg array */
1366 for (u
=0; u
<cVarRef
; u
++) {
1367 unsigned i
= rgVarRefIdx
[u
];
1368 VariantCopy(&arg
[i
], &rgVarRef
[u
]);
1371 pDispParams
->rgvarg
= arg
;
1373 hr
= IDispatch_Invoke(This
,
1383 /* copy ref args from arg array */
1384 for (u
=0; u
<cVarRef
; u
++) {
1385 unsigned i
= rgVarRefIdx
[u
];
1386 VariantCopy(&rgVarRef
[u
], &arg
[i
]);
1390 /* clear the duplicate argument list */
1391 for (u
=0; u
<pDispParams
->cArgs
; u
++)
1392 VariantClear(&arg
[u
]);
1394 pDispParams
->rgvarg
= rgvarg
;
1402 HRESULT CALLBACK
IEnumVARIANT_Next_Proxy(
1406 ULONG
* pCeltFetched
)
1410 pCeltFetched
= &fetched
;
1411 return IEnumVARIANT_RemoteNext_Proxy(This
,
1417 HRESULT __RPC_STUB
IEnumVARIANT_Next_Stub(
1421 ULONG
* pCeltFetched
)
1425 hr
= IEnumVARIANT_Next(This
,
1429 if (hr
== S_OK
) *pCeltFetched
= celt
;
1433 /* TypeInfo related freers */
1435 static void free_embedded_typedesc(TYPEDESC
*tdesc
);
1436 static void free_embedded_arraydesc(ARRAYDESC
*adesc
)
1438 switch(adesc
->tdescElem
.vt
)
1442 free_embedded_typedesc(adesc
->tdescElem
.lptdesc
);
1443 CoTaskMemFree(adesc
->tdescElem
.lptdesc
);
1446 free_embedded_arraydesc(adesc
->tdescElem
.lpadesc
);
1447 CoTaskMemFree(adesc
->tdescElem
.lpadesc
);
1452 static void free_embedded_typedesc(TYPEDESC
*tdesc
)
1458 free_embedded_typedesc(tdesc
->lptdesc
);
1459 CoTaskMemFree(tdesc
->lptdesc
);
1462 free_embedded_arraydesc(tdesc
->lpadesc
);
1463 CoTaskMemFree(tdesc
->lpadesc
);
1468 static void free_embedded_elemdesc(ELEMDESC
*edesc
)
1470 free_embedded_typedesc(&edesc
->tdesc
);
1471 if(edesc
->paramdesc
.wParamFlags
& PARAMFLAG_FHASDEFAULT
)
1472 CoTaskMemFree(edesc
->paramdesc
.pparamdescex
);
1477 HRESULT CALLBACK
ITypeComp_Bind_Proxy(
1486 CLEANLOCALSTORAGE stg
= { 0 };
1487 ITypeComp
*typecomp
;
1492 TRACE("%p, %s, %#lx, %#x, %p, %p, %p.\n", This
, debugstr_w(name
), lHashVal
, flags
, ti
,
1495 *desckind
= DESCKIND_NONE
;
1496 memset(bindptr
, 0, sizeof(*bindptr
));
1498 hr
= ITypeComp_RemoteBind_Proxy(This
, name
, lHashVal
, flags
, ti
, desckind
,
1499 &funcdesc
, &vardesc
, &typecomp
, &stg
);
1505 case DESCKIND_FUNCDESC
:
1506 bindptr
->lpfuncdesc
= funcdesc
;
1508 case DESCKIND_VARDESC
:
1509 case DESCKIND_IMPLICITAPPOBJ
:
1510 bindptr
->lpvardesc
= vardesc
;
1512 case DESCKIND_TYPECOMP
:
1513 bindptr
->lptcomp
= typecomp
;
1523 HRESULT __RPC_STUB
ITypeComp_Bind_Stub(
1530 FUNCDESC
**funcdesc
,
1532 ITypeComp
**typecomp
,
1533 CLEANLOCALSTORAGE
*stg
)
1538 TRACE("%p, %s, %#lx, %#x, %p, %p, %p, %p, %p, %p.\n", This
, debugstr_w(name
),
1539 lHashVal
, flags
, ti
, desckind
, funcdesc
, vardesc
, typecomp
, stg
);
1541 memset(stg
, 0, sizeof(*stg
));
1542 memset(&bindptr
, 0, sizeof(bindptr
));
1549 hr
= ITypeComp_Bind(This
, name
, lHashVal
, flags
, ti
, desckind
, &bindptr
);
1555 case DESCKIND_FUNCDESC
:
1556 *funcdesc
= bindptr
.lpfuncdesc
;
1557 stg
->pInterface
= (IUnknown
*)*ti
;
1558 stg
->pStorage
= funcdesc
;
1559 stg
->flags
= CLS_FUNCDESC
;
1561 case DESCKIND_VARDESC
:
1562 case DESCKIND_IMPLICITAPPOBJ
:
1563 *vardesc
= bindptr
.lpvardesc
;
1564 stg
->pInterface
= (IUnknown
*)*ti
;
1565 stg
->pStorage
= vardesc
;
1566 stg
->flags
= CLS_VARDESC
;
1568 case DESCKIND_TYPECOMP
:
1569 *typecomp
= bindptr
.lptcomp
;
1575 if (stg
->pInterface
)
1576 IUnknown_AddRef(stg
->pInterface
);
1581 HRESULT CALLBACK
ITypeComp_BindType_Proxy(
1586 ITypeComp
**typecomp
)
1590 TRACE("%p, %s, %#lx, %p, %p.\n", This
, debugstr_w(name
), lHashVal
, ti
, typecomp
);
1592 hr
= ITypeComp_RemoteBindType_Proxy(This
, name
, lHashVal
, ti
);
1594 ITypeInfo_GetTypeComp(*ti
, typecomp
);
1601 HRESULT __RPC_STUB
ITypeComp_BindType_Stub(
1607 ITypeComp
*typecomp
= NULL
;
1610 TRACE("%p, %s, %#lx, %p.\n", This
, debugstr_w(name
), lHashVal
, ti
);
1612 hr
= ITypeComp_BindType(This
, name
, lHashVal
, ti
, &typecomp
);
1615 ITypeComp_Release(typecomp
);
1622 HRESULT CALLBACK
ITypeInfo_GetTypeAttr_Proxy(
1624 TYPEATTR
** ppTypeAttr
)
1627 CLEANLOCALSTORAGE stg
;
1628 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1631 stg
.pStorage
= NULL
;
1632 stg
.pInterface
= NULL
;
1634 return ITypeInfo_RemoteGetTypeAttr_Proxy(This
, ppTypeAttr
, &stg
);
1637 HRESULT __RPC_STUB
ITypeInfo_GetTypeAttr_Stub(
1639 LPTYPEATTR
* ppTypeAttr
,
1640 CLEANLOCALSTORAGE
* pDummy
)
1643 TRACE("(%p, %p)\n", This
, ppTypeAttr
);
1645 hr
= ITypeInfo_GetTypeAttr(This
, ppTypeAttr
);
1649 pDummy
->flags
= CLS_TYPEATTR
;
1650 ITypeInfo_AddRef(This
);
1651 pDummy
->pInterface
= (IUnknown
*)This
;
1652 pDummy
->pStorage
= ppTypeAttr
;
1656 HRESULT CALLBACK
ITypeInfo_GetFuncDesc_Proxy(
1659 FUNCDESC
** ppFuncDesc
)
1661 CLEANLOCALSTORAGE stg
;
1662 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1665 stg
.pStorage
= NULL
;
1666 stg
.pInterface
= NULL
;
1668 return ITypeInfo_RemoteGetFuncDesc_Proxy(This
, index
, ppFuncDesc
, &stg
);
1671 HRESULT __RPC_STUB
ITypeInfo_GetFuncDesc_Stub(
1674 LPFUNCDESC
* ppFuncDesc
,
1675 CLEANLOCALSTORAGE
* pDummy
)
1678 TRACE("(%p, %d, %p)\n", This
, index
, ppFuncDesc
);
1680 hr
= ITypeInfo_GetFuncDesc(This
, index
, ppFuncDesc
);
1684 pDummy
->flags
= CLS_FUNCDESC
;
1685 ITypeInfo_AddRef(This
);
1686 pDummy
->pInterface
= (IUnknown
*)This
;
1687 pDummy
->pStorage
= ppFuncDesc
;
1691 HRESULT CALLBACK
ITypeInfo_GetVarDesc_Proxy(
1694 VARDESC
** ppVarDesc
)
1696 CLEANLOCALSTORAGE stg
;
1697 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1700 stg
.pStorage
= NULL
;
1701 stg
.pInterface
= NULL
;
1703 return ITypeInfo_RemoteGetVarDesc_Proxy(This
, index
, ppVarDesc
, &stg
);
1706 HRESULT __RPC_STUB
ITypeInfo_GetVarDesc_Stub(
1709 LPVARDESC
* ppVarDesc
,
1710 CLEANLOCALSTORAGE
* pDummy
)
1713 TRACE("(%p, %d, %p)\n", This
, index
, ppVarDesc
);
1715 hr
= ITypeInfo_GetVarDesc(This
, index
, ppVarDesc
);
1719 pDummy
->flags
= CLS_VARDESC
;
1720 ITypeInfo_AddRef(This
);
1721 pDummy
->pInterface
= (IUnknown
*)This
;
1722 pDummy
->pStorage
= ppVarDesc
;
1726 HRESULT CALLBACK
ITypeInfo_GetNames_Proxy(
1733 TRACE("%p, %#lx, %p, %d, %p.\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1735 return ITypeInfo_RemoteGetNames_Proxy(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1738 HRESULT __RPC_STUB
ITypeInfo_GetNames_Stub(
1745 TRACE("%p, %#lx, %p, %d, %p.\n", This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1747 return ITypeInfo_GetNames(This
, memid
, rgBstrNames
, cMaxNames
, pcNames
);
1750 HRESULT CALLBACK
ITypeInfo_GetIDsOfNames_Proxy(
1752 LPOLESTR
* rgszNames
,
1756 FIXME("not implemented\n");
1760 HRESULT __RPC_STUB
ITypeInfo_GetIDsOfNames_Stub(
1763 FIXME("not implemented\n");
1767 HRESULT CALLBACK
ITypeInfo_Invoke_Proxy(
1772 DISPPARAMS
* pDispParams
,
1773 VARIANT
* pVarResult
,
1774 EXCEPINFO
* pExcepInfo
,
1777 FIXME("not implemented\n");
1781 HRESULT __RPC_STUB
ITypeInfo_Invoke_Stub(
1784 FIXME("not implemented\n");
1788 HRESULT CALLBACK
ITypeInfo_GetDocumentation_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1789 BSTR
*name
, BSTR
*doc_string
,
1790 DWORD
*help_context
, BSTR
*help_file
)
1792 DWORD dummy_help_context
, flags
= 0;
1793 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
1796 TRACE("%p, %#lx, %p, %p, %p, %p.\n", This
, memid
, name
, doc_string
, help_context
, help_file
);
1798 if(!name
) name
= &dummy_name
;
1801 if(!doc_string
) doc_string
= &dummy_doc_string
;
1804 if(!help_context
) help_context
= &dummy_help_context
;
1807 if(!help_file
) help_file
= &dummy_help_file
;
1810 hr
= ITypeInfo_RemoteGetDocumentation_Proxy(This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1812 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1817 HRESULT __RPC_STUB
ITypeInfo_GetDocumentation_Stub(ITypeInfo
*This
, MEMBERID memid
,
1818 DWORD flags
, BSTR
*name
, BSTR
*doc_string
,
1819 DWORD
*help_context
, BSTR
*help_file
)
1821 TRACE("%p, %#lx, %#lx, %p, %p, %p, %p.\n", This
, memid
, flags
, name
, doc_string
, help_context
, help_file
);
1823 *name
= *doc_string
= *help_file
= NULL
;
1826 if(!(flags
& 1)) name
= NULL
;
1827 if(!(flags
& 2)) doc_string
= NULL
;
1828 if(!(flags
& 4)) help_context
= NULL
;
1829 if(!(flags
& 8)) help_file
= NULL
;
1831 return ITypeInfo_GetDocumentation(This
, memid
, name
, doc_string
, help_context
, help_file
);
1834 HRESULT CALLBACK
ITypeInfo_GetDllEntry_Proxy(ITypeInfo
*This
, MEMBERID memid
,
1835 INVOKEKIND invkind
, BSTR
*dll_name
,
1836 BSTR
* name
, WORD
*ordinal
)
1839 BSTR dummy_dll_name
, dummy_name
;
1843 TRACE("%p, %#lx, %#x, %p, %p, %p.\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1845 if(!dll_name
) dll_name
= &dummy_dll_name
;
1848 if(!name
) name
= &dummy_name
;
1851 if(!ordinal
) ordinal
= &dummy_ordinal
;
1854 hr
= ITypeInfo_RemoteGetDllEntry_Proxy(This
, memid
, invkind
, flags
, dll_name
, name
, ordinal
);
1856 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
1861 HRESULT __RPC_STUB
ITypeInfo_GetDllEntry_Stub(ITypeInfo
*This
, MEMBERID memid
,
1862 INVOKEKIND invkind
, DWORD flags
,
1863 BSTR
*dll_name
, BSTR
*name
,
1866 TRACE("%p, %#lx, %x, %p, %p, %p.\n", This
, memid
, invkind
, dll_name
, name
, ordinal
);
1868 *dll_name
= *name
= NULL
;
1871 if(!(flags
& 1)) dll_name
= NULL
;
1872 if(!(flags
& 2)) name
= NULL
;
1873 if(!(flags
& 4)) ordinal
= NULL
;
1875 return ITypeInfo_GetDllEntry(This
, memid
, invkind
, dll_name
, name
, ordinal
);
1878 HRESULT CALLBACK
ITypeInfo_AddressOfMember_Proxy(
1884 FIXME("not implemented\n");
1888 HRESULT __RPC_STUB
ITypeInfo_AddressOfMember_Stub(
1891 FIXME("not implemented\n");
1895 HRESULT CALLBACK
ITypeInfo_CreateInstance_Proxy(
1897 IUnknown
* pUnkOuter
,
1901 FIXME("not implemented\n");
1905 HRESULT __RPC_STUB
ITypeInfo_CreateInstance_Stub(
1910 FIXME("not implemented\n");
1914 HRESULT CALLBACK
ITypeInfo_GetContainingTypeLib_Proxy(
1923 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1925 hr
= ITypeInfo_RemoteGetContainingTypeLib_Proxy(This
, &pTL
, &index
);
1934 ITypeLib_Release(pTL
);
1939 HRESULT __RPC_STUB
ITypeInfo_GetContainingTypeLib_Stub(
1944 TRACE("(%p, %p, %p)\n", This
, ppTLib
, pIndex
);
1945 return ITypeInfo_GetContainingTypeLib(This
, ppTLib
, pIndex
);
1948 void CALLBACK
ITypeInfo_ReleaseTypeAttr_Proxy(
1950 TYPEATTR
* pTypeAttr
)
1952 TRACE("(%p, %p)\n", This
, pTypeAttr
);
1953 free_embedded_typedesc(&pTypeAttr
->tdescAlias
);
1954 CoTaskMemFree(pTypeAttr
);
1957 HRESULT __RPC_STUB
ITypeInfo_ReleaseTypeAttr_Stub(
1960 TRACE("nothing to do\n");
1964 void CALLBACK
ITypeInfo_ReleaseFuncDesc_Proxy(
1966 FUNCDESC
* pFuncDesc
)
1969 TRACE("(%p, %p)\n", This
, pFuncDesc
);
1971 for(param
= 0; param
< pFuncDesc
->cParams
; param
++)
1972 free_embedded_elemdesc(pFuncDesc
->lprgelemdescParam
+ param
);
1974 CoTaskMemFree(pFuncDesc
->lprgelemdescParam
);
1976 free_embedded_elemdesc(&pFuncDesc
->elemdescFunc
);
1978 if(pFuncDesc
->cScodes
!= 0 && pFuncDesc
->cScodes
!= -1)
1979 CoTaskMemFree(pFuncDesc
->lprgscode
);
1981 CoTaskMemFree(pFuncDesc
);
1984 HRESULT __RPC_STUB
ITypeInfo_ReleaseFuncDesc_Stub(
1987 TRACE("nothing to do\n");
1991 void CALLBACK
ITypeInfo_ReleaseVarDesc_Proxy(
1995 TRACE("(%p, %p)\n", This
, pVarDesc
);
1997 CoTaskMemFree(pVarDesc
->lpstrSchema
);
1999 if(pVarDesc
->varkind
== VAR_CONST
)
2000 CoTaskMemFree(pVarDesc
->lpvarValue
);
2002 free_embedded_elemdesc(&pVarDesc
->elemdescVar
);
2003 CoTaskMemFree(pVarDesc
);
2006 HRESULT __RPC_STUB
ITypeInfo_ReleaseVarDesc_Stub(
2009 TRACE("nothing to do\n");
2016 HRESULT CALLBACK
ITypeInfo2_GetDocumentation2_Proxy(ITypeInfo2
*This
, MEMBERID memid
,
2017 LCID lcid
, BSTR
*help_string
,
2018 DWORD
*help_context
, BSTR
*help_dll
)
2020 DWORD dummy_help_context
, flags
= 0;
2021 BSTR dummy_help_string
, dummy_help_dll
;
2024 TRACE("%p, %#lx, %#lx, %p, %p, %p.\n", This
, memid
, lcid
, help_string
, help_context
, help_dll
);
2026 if(!help_string
) help_string
= &dummy_help_string
;
2029 if(!help_context
) help_context
= &dummy_help_context
;
2032 if(!help_dll
) help_dll
= &dummy_help_dll
;
2035 hr
= ITypeInfo2_RemoteGetDocumentation2_Proxy(This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
2037 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2042 HRESULT __RPC_STUB
ITypeInfo2_GetDocumentation2_Stub(ITypeInfo2
*This
, MEMBERID memid
,
2043 LCID lcid
, DWORD flags
,
2044 BSTR
*help_string
, DWORD
*help_context
,
2047 TRACE("%p, %#lx, %#lx, %#lx, %p, %p, %p.\n", This
, memid
, lcid
, flags
, help_string
, help_context
, help_dll
);
2049 *help_string
= *help_dll
= NULL
;
2052 if(!(flags
& 1)) help_string
= NULL
;
2053 if(!(flags
& 2)) help_context
= NULL
;
2054 if(!(flags
& 4)) help_dll
= NULL
;
2056 return ITypeInfo2_GetDocumentation2(This
, memid
, lcid
, help_string
, help_context
, help_dll
);
2061 UINT CALLBACK
ITypeLib_GetTypeInfoCount_Proxy(
2065 TRACE("(%p)\n", This
);
2067 ITypeLib_RemoteGetTypeInfoCount_Proxy(This
, &count
);
2072 HRESULT __RPC_STUB
ITypeLib_GetTypeInfoCount_Stub(
2076 TRACE("(%p, %p)\n", This
, pcTInfo
);
2077 *pcTInfo
= ITypeLib_GetTypeInfoCount(This
);
2081 HRESULT CALLBACK
ITypeLib_GetLibAttr_Proxy(
2083 TLIBATTR
** ppTLibAttr
)
2085 CLEANLOCALSTORAGE stg
;
2086 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2089 stg
.pStorage
= NULL
;
2090 stg
.pInterface
= NULL
;
2092 return ITypeLib_RemoteGetLibAttr_Proxy(This
, ppTLibAttr
, &stg
);
2095 HRESULT __RPC_STUB
ITypeLib_GetLibAttr_Stub(
2097 LPTLIBATTR
* ppTLibAttr
,
2098 CLEANLOCALSTORAGE
* pDummy
)
2101 TRACE("(%p, %p)\n", This
, ppTLibAttr
);
2103 hr
= ITypeLib_GetLibAttr(This
, ppTLibAttr
);
2107 pDummy
->flags
= CLS_LIBATTR
;
2108 ITypeLib_AddRef(This
);
2109 pDummy
->pInterface
= (IUnknown
*)This
;
2110 pDummy
->pStorage
= ppTLibAttr
;
2114 HRESULT CALLBACK
ITypeLib_GetDocumentation_Proxy(ITypeLib
*This
, INT index
, BSTR
*name
,
2115 BSTR
*doc_string
, DWORD
*help_context
,
2118 DWORD dummy_help_context
, flags
= 0;
2119 BSTR dummy_name
, dummy_doc_string
, dummy_help_file
;
2121 TRACE("(%p, %d, %p, %p, %p, %p)\n", This
, index
, name
, doc_string
, help_context
, help_file
);
2123 if(!name
) name
= &dummy_name
;
2126 if(!doc_string
) doc_string
= &dummy_doc_string
;
2129 if(!help_context
) help_context
= &dummy_help_context
;
2132 if(!help_file
) help_file
= &dummy_help_file
;
2135 hr
= ITypeLib_RemoteGetDocumentation_Proxy(This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2137 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2142 HRESULT __RPC_STUB
ITypeLib_GetDocumentation_Stub(ITypeLib
*This
, INT index
, DWORD flags
,
2143 BSTR
*name
, BSTR
*doc_string
,
2144 DWORD
*help_context
, BSTR
*help_file
)
2146 TRACE("%p, %d, %#lx, %p, %p, %p, %p.\n", This
, index
, flags
, name
, doc_string
, help_context
, help_file
);
2148 *name
= *doc_string
= *help_file
= NULL
;
2151 if(!(flags
& 1)) name
= NULL
;
2152 if(!(flags
& 2)) doc_string
= NULL
;
2153 if(!(flags
& 4)) help_context
= NULL
;
2154 if(!(flags
& 8)) help_file
= NULL
;
2156 return ITypeLib_GetDocumentation(This
, index
, name
, doc_string
, help_context
, help_file
);
2159 HRESULT CALLBACK
ITypeLib_IsName_Proxy(
2165 FIXME("not implemented\n");
2169 HRESULT __RPC_STUB
ITypeLib_IsName_Stub(
2176 FIXME("not implemented\n");
2180 HRESULT CALLBACK
ITypeLib_FindName_Proxy(
2184 ITypeInfo
** ppTInfo
,
2188 FIXME("not implemented\n");
2192 HRESULT __RPC_STUB
ITypeLib_FindName_Stub(
2196 ITypeInfo
** ppTInfo
,
2201 FIXME("not implemented\n");
2205 void CALLBACK
ITypeLib_ReleaseTLibAttr_Proxy(
2207 TLIBATTR
* pTLibAttr
)
2209 TRACE("(%p, %p)\n", This
, pTLibAttr
);
2210 CoTaskMemFree(pTLibAttr
);
2213 HRESULT __RPC_STUB
ITypeLib_ReleaseTLibAttr_Stub(
2216 TRACE("nothing to do\n");
2223 HRESULT CALLBACK
ITypeLib2_GetLibStatistics_Proxy(
2225 ULONG
* pcUniqueNames
,
2226 ULONG
* pcchUniqueNames
)
2228 FIXME("not implemented\n");
2232 HRESULT __RPC_STUB
ITypeLib2_GetLibStatistics_Stub(
2234 ULONG
* pcUniqueNames
,
2235 ULONG
* pcchUniqueNames
)
2237 FIXME("not implemented\n");
2241 HRESULT CALLBACK
ITypeLib2_GetDocumentation2_Proxy(ITypeLib2
*This
, INT index
,
2242 LCID lcid
, BSTR
*help_string
,
2243 DWORD
*help_context
, BSTR
*help_dll
)
2245 DWORD dummy_help_context
, flags
= 0;
2246 BSTR dummy_help_string
, dummy_help_dll
;
2249 TRACE("%p, %d, %#lx, %p, %p, %p.\n", This
, index
, lcid
, help_string
, help_context
, help_dll
);
2251 if(!help_string
) help_string
= &dummy_help_string
;
2254 if(!help_context
) help_context
= &dummy_help_context
;
2257 if(!help_dll
) help_dll
= &dummy_help_dll
;
2260 hr
= ITypeLib2_RemoteGetDocumentation2_Proxy(This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2262 /* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
2267 HRESULT __RPC_STUB
ITypeLib2_GetDocumentation2_Stub(ITypeLib2
*This
, INT index
, LCID lcid
,
2268 DWORD flags
, BSTR
*help_string
,
2269 DWORD
*help_context
, BSTR
*help_dll
)
2271 TRACE("%p, %d, %#lx, %#lx, %p, %p, %p.\n", This
, index
, lcid
, flags
, help_string
, help_context
, help_dll
);
2273 *help_string
= *help_dll
= NULL
;
2276 if(!(flags
& 1)) help_string
= NULL
;
2277 if(!(flags
& 2)) help_context
= NULL
;
2278 if(!(flags
& 4)) help_dll
= NULL
;
2280 return ITypeLib2_GetDocumentation2(This
, index
, lcid
, help_string
, help_context
, help_dll
);
2283 HRESULT CALLBACK
IPropertyBag_Read_Proxy(
2285 LPCOLESTR pszPropName
,
2287 IErrorLog
*pErrorLog
)
2289 IUnknown
*pUnk
= NULL
;
2290 TRACE("(%p, %s, %p, %p)\n", This
, debugstr_w(pszPropName
), pVar
, pErrorLog
);
2295 if(V_VT(pVar
) & (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2297 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2304 pUnk
= (IUnknown
*)V_DISPATCH(pVar
);
2307 pUnk
= V_UNKNOWN(pVar
);
2310 FIXME("Safearray support not yet implemented.\n");
2313 FIXME("Unknown V_VT %d - support not yet implemented.\n", V_VT(pVar
));
2317 return IPropertyBag_RemoteRead_Proxy(This
, pszPropName
, pVar
, pErrorLog
,
2321 HRESULT __RPC_STUB
IPropertyBag_Read_Stub(
2323 LPCOLESTR pszPropName
,
2325 IErrorLog
*pErrorLog
,
2332 TRACE("%p, %s, %p, %p, %lx, %p.\n", This
, debugstr_w(pszPropName
), pVar
,
2333 pErrorLog
, varType
, pUnkObj
);
2335 if(varType
& (VT_BYREF
| VT_ARRAY
| VT_VECTOR
))
2337 FIXME("Variant type %x is byref, array or vector. Not implemented.\n", V_VT(pVar
));
2341 V_VT(pVar
) = varType
;
2345 hr
= IUnknown_QueryInterface(pUnkObj
, &IID_IDispatch
, (LPVOID
*)&disp
);
2348 IUnknown_Release(pUnkObj
);
2349 V_DISPATCH(pVar
) = disp
;
2352 V_UNKNOWN(pVar
) = pUnkObj
;
2355 V_BSTR(pVar
) = SysAllocString(L
"");
2358 FIXME("Safearray support not yet implemented.\n");
2363 hr
= IPropertyBag_Read(This
, pszPropName
, pVar
, pErrorLog
);
2370 /* call_as/local stubs for ocidl.idl */
2372 HRESULT CALLBACK
IClassFactory2_CreateInstanceLic_Proxy(
2373 IClassFactory2
* This
,
2374 IUnknown
*pUnkOuter
,
2375 IUnknown
*pUnkReserved
,
2380 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObj
);
2386 ERR("aggregation is not allowed on remote objects\n");
2387 return CLASS_E_NOAGGREGATION
;
2390 return IClassFactory2_RemoteCreateInstanceLic_Proxy(This
, riid
, bstrKey
, (IUnknown
**)ppvObj
);
2393 HRESULT __RPC_STUB
IClassFactory2_CreateInstanceLic_Stub(
2394 IClassFactory2
* This
,
2399 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObj
);
2400 return IClassFactory2_CreateInstanceLic(This
, NULL
, NULL
, riid
, bstrKey
, (void**)ppvObj
);
2403 HRESULT CALLBACK
IEnumConnections_Next_Proxy(
2404 IEnumConnections
* This
,
2411 TRACE("%lu, %p, %p.\n", cConnections
, rgcd
, pcFetched
);
2414 pcFetched
= &fetched
;
2416 return IEnumConnections_RemoteNext_Proxy(This
, cConnections
, rgcd
, pcFetched
);
2419 HRESULT __RPC_STUB
IEnumConnections_Next_Stub(
2420 IEnumConnections
* This
,
2427 TRACE("%lu, %p, %p.\n", cConnections
, rgcd
, pcFetched
);
2430 hr
= IEnumConnections_Next(This
, cConnections
, rgcd
, pcFetched
);
2432 *pcFetched
= cConnections
;
2437 HRESULT CALLBACK
IEnumConnectionPoints_Next_Proxy(
2438 IEnumConnectionPoints
* This
,
2440 IConnectionPoint
**ppCP
,
2445 TRACE("%lu, %p %p.\n", cConnections
, ppCP
, pcFetched
);
2448 pcFetched
= &fetched
;
2450 return IEnumConnectionPoints_RemoteNext_Proxy(This
, cConnections
, ppCP
, pcFetched
);
2453 HRESULT __RPC_STUB
IEnumConnectionPoints_Next_Stub(
2454 IEnumConnectionPoints
* This
,
2456 IConnectionPoint
**ppCP
,
2461 TRACE("%lu, %p, %p.\n", cConnections
, ppCP
, pcFetched
);
2464 hr
= IEnumConnectionPoints_Next(This
, cConnections
, ppCP
, pcFetched
);
2466 *pcFetched
= cConnections
;
2471 HRESULT CALLBACK
IPersistMemory_Load_Proxy(
2472 IPersistMemory
* This
,
2476 TRACE("%p, %lu.\n", pMem
, cbSize
);
2481 return IPersistMemory_RemoteLoad_Proxy(This
, pMem
, cbSize
);
2484 HRESULT __RPC_STUB
IPersistMemory_Load_Stub(
2485 IPersistMemory
* This
,
2489 TRACE("%p, %lu.\n", pMem
, cbSize
);
2490 return IPersistMemory_Load(This
, pMem
, cbSize
);
2493 HRESULT CALLBACK
IPersistMemory_Save_Proxy(
2494 IPersistMemory
* This
,
2499 TRACE("%p, %d, %lu.\n", pMem
, fClearDirty
, cbSize
);
2504 return IPersistMemory_RemoteSave_Proxy(This
, pMem
, fClearDirty
, cbSize
);
2507 HRESULT __RPC_STUB
IPersistMemory_Save_Stub(
2508 IPersistMemory
* This
,
2513 TRACE("%p, %d, %lu.\n", pMem
, fClearDirty
, cbSize
);
2514 return IPersistMemory_Save(This
, pMem
, fClearDirty
, cbSize
);
2517 void CALLBACK
IAdviseSinkEx_OnViewStatusChange_Proxy(
2518 IAdviseSinkEx
* This
,
2521 TRACE("%p, %#lx.\n", This
, dwViewStatus
);
2522 IAdviseSinkEx_RemoteOnViewStatusChange_Proxy(This
, dwViewStatus
);
2525 HRESULT __RPC_STUB
IAdviseSinkEx_OnViewStatusChange_Stub(
2526 IAdviseSinkEx
* This
,
2529 TRACE("%p, %#lx.\n", This
, dwViewStatus
);
2530 IAdviseSinkEx_OnViewStatusChange(This
, dwViewStatus
);
2534 HRESULT CALLBACK
IEnumOleUndoUnits_Next_Proxy(
2535 IEnumOleUndoUnits
* This
,
2537 IOleUndoUnit
**rgElt
,
2538 ULONG
*pcEltFetched
)
2542 TRACE("%lu, %p %p.\n", cElt
, rgElt
, pcEltFetched
);
2545 pcEltFetched
= &fetched
;
2547 return IEnumOleUndoUnits_RemoteNext_Proxy(This
, cElt
, rgElt
, pcEltFetched
);
2550 HRESULT __RPC_STUB
IEnumOleUndoUnits_Next_Stub(
2551 IEnumOleUndoUnits
* This
,
2553 IOleUndoUnit
**rgElt
,
2554 ULONG
*pcEltFetched
)
2558 TRACE("%lu, %p, %p.\n", cElt
, rgElt
, pcEltFetched
);
2561 hr
= IEnumOleUndoUnits_Next(This
, cElt
, rgElt
, pcEltFetched
);
2563 *pcEltFetched
= cElt
;
2568 HRESULT CALLBACK
IQuickActivate_QuickActivate_Proxy(
2569 IQuickActivate
* This
,
2570 QACONTAINER
*pQaContainer
,
2571 QACONTROL
*pQaControl
)
2573 FIXME("not implemented\n");
2577 HRESULT __RPC_STUB
IQuickActivate_QuickActivate_Stub(
2578 IQuickActivate
* This
,
2579 QACONTAINER
*pQaContainer
,
2580 QACONTROL
*pQaControl
)
2582 FIXME("not implemented\n");