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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
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 /* FIXME: not supposed to be here */
49 const CLSID CLSID_PSDispatch = {
50 0x20420, 0, 0, {0xC0, 0, 0, 0, 0, 0, 0, 0x46}
53 static CStdPSFactoryBuffer PSFactoryBuffer;
55 CSTDSTUBBUFFERRELEASE(&PSFactoryBuffer)
57 extern const ExtendedProxyFileInfo oaidl_ProxyFileInfo;
59 const ProxyFileInfo* OLEAUT32_ProxyFileList[] = {
64 HRESULT OLEAUTPS_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
66 return NdrDllGetClassObject(rclsid, riid, ppv, OLEAUT32_ProxyFileList,
67 &CLSID_PSDispatch, &PSFactoryBuffer);
70 static void dump_user_flags(unsigned long *pFlags)
72 if (HIWORD(*pFlags) == NDR_LOCAL_DATA_REPRESENTATION)
73 TRACE("MAKELONG(NDR_LOCAL_REPRESENTATION, ");
75 TRACE("MAKELONG(0x%04x, ", HIWORD(*pFlags));
76 switch (LOWORD(*pFlags))
78 case MSHCTX_LOCAL: TRACE("MSHCTX_LOCAL)"); break;
79 case MSHCTX_NOSHAREDMEM: TRACE("MSHCTX_NOSHAREDMEM)"); break;
80 case MSHCTX_DIFFERENTMACHINE: TRACE("MSHCTX_DIFFERENTMACHINE)"); break;
81 case MSHCTX_INPROC: TRACE("MSHCTX_INPROC)"); break;
82 default: TRACE("%d)", LOWORD(*pFlags));
86 /* CLEANLOCALSTORAGE */
88 #define CLS_FUNCDESC 0x66
89 #define CLS_LIBATTR 0x6c
90 #define CLS_TYPEATTR 0x74
91 #define CLS_VARDESC 0x76
93 unsigned long WINAPI CLEANLOCALSTORAGE_UserSize(unsigned long *pFlags, unsigned long Start, CLEANLOCALSTORAGE *pstg)
95 ALIGN_LENGTH(Start, 3);
96 return Start + sizeof(DWORD);
99 unsigned char * WINAPI CLEANLOCALSTORAGE_UserMarshal(unsigned long *pFlags, unsigned char *Buffer, CLEANLOCALSTORAGE *pstg)
101 ALIGN_POINTER(Buffer, 3);
102 *(DWORD*)Buffer = pstg->flags;
106 ITypeLib_ReleaseTLibAttr((ITypeLib*)pstg->pInterface, *(TLIBATTR**)pstg->pStorage);
109 ITypeInfo_ReleaseTypeAttr((ITypeInfo*)pstg->pInterface, *(TYPEATTR**)pstg->pStorage);
112 ITypeInfo_ReleaseFuncDesc((ITypeInfo*)pstg->pInterface, *(FUNCDESC**)pstg->pStorage);
115 ITypeInfo_ReleaseVarDesc((ITypeInfo*)pstg->pInterface, *(VARDESC**)pstg->pStorage);
119 ERR("Unknown type %lx\n", pstg->flags);
122 *(VOID**)pstg->pStorage = NULL;
123 IUnknown_Release(pstg->pInterface);
124 pstg->pInterface = NULL;
126 return Buffer + sizeof(DWORD);
129 unsigned char * WINAPI CLEANLOCALSTORAGE_UserUnmarshal(unsigned long *pFlags, unsigned char *Buffer, CLEANLOCALSTORAGE *pstr)
131 ALIGN_POINTER(Buffer, 3);
132 pstr->flags = *(DWORD*)Buffer;
133 return Buffer + sizeof(DWORD);
136 void WINAPI CLEANLOCALSTORAGE_UserFree(unsigned long *pFlags, CLEANLOCALSTORAGE *pstr)
145 DWORD len; /* No. of chars not including trailing '\0' */
146 DWORD byte_len; /* len * 2 or 0xffffffff if len == 0 */
147 DWORD len2; /* == len */
150 unsigned long WINAPI BSTR_UserSize(unsigned long *pFlags, unsigned long Start, BSTR *pstr)
152 TRACE("(%lx,%ld,%p) => %p\n", *pFlags, Start, pstr, *pstr);
153 if (*pstr) TRACE("string=%s\n", debugstr_w(*pstr));
154 ALIGN_LENGTH(Start, 3);
155 Start += sizeof(bstr_wire_t) + sizeof(OLECHAR) * (SysStringLen(*pstr));
156 TRACE("returning %ld\n", Start);
160 unsigned char * WINAPI BSTR_UserMarshal(unsigned long *pFlags, unsigned char *Buffer, BSTR *pstr)
163 TRACE("(%lx,%p,%p) => %p\n", *pFlags, Buffer, pstr, *pstr);
164 if (*pstr) TRACE("string=%s\n", debugstr_w(*pstr));
166 ALIGN_POINTER(Buffer, 3);
167 header = (bstr_wire_t*)Buffer;
168 header->len = header->len2 = SysStringLen(*pstr);
171 header->byte_len = header->len * sizeof(OLECHAR);
172 memcpy(header + 1, *pstr, header->byte_len);
175 header->byte_len = 0xffffffff; /* special case for an empty string */
177 return Buffer + sizeof(*header) + sizeof(OLECHAR) * header->len;
180 unsigned char * WINAPI BSTR_UserUnmarshal(unsigned long *pFlags, unsigned char *Buffer, BSTR *pstr)
183 TRACE("(%lx,%p,%p) => %p\n", *pFlags, Buffer, pstr, *pstr);
185 ALIGN_POINTER(Buffer, 3);
186 header = (bstr_wire_t*)Buffer;
187 if(header->len != header->len2)
188 FIXME("len %08lx != len2 %08lx\n", header->len, header->len2);
191 SysReAllocStringLen(pstr, (OLECHAR*)(header + 1), header->len);
194 SysFreeString(*pstr);
198 if (*pstr) TRACE("string=%s\n", debugstr_w(*pstr));
199 return Buffer + sizeof(*header) + sizeof(OLECHAR) * header->len;
202 void WINAPI BSTR_UserFree(unsigned long *pFlags, BSTR *pstr)
204 TRACE("(%lx,%p) => %p\n", *pFlags, pstr, *pstr);
207 SysFreeString(*pstr);
225 static unsigned int get_type_size(unsigned long *pFlags, VARIANT *pvar)
227 if (V_VT(pvar) & VT_ARRAY) return 4;
229 switch (V_VT(pvar) & ~VT_BYREF) {
238 return sizeof(SHORT);
246 return sizeof(FLOAT);
248 return sizeof(DOUBLE);
250 return sizeof(VARIANT_BOOL);
252 return sizeof(SCODE);
258 return sizeof(DECIMAL);
262 return sizeof(VARIANT);
268 FIXME("unhandled VT %d\n", V_VT(pvar));
273 static unsigned int get_type_alignment(unsigned long *pFlags, VARIANT *pvar)
275 unsigned int size = get_type_size(pFlags, pvar);
276 if(V_VT(pvar) & VT_BYREF) return 3;
277 if(size == 0) return 0;
278 if(size <= 4) return size - 1;
282 static unsigned interface_variant_size(unsigned long *pFlags, REFIID riid, VARIANT *pvar)
286 /* find the buffer size of the marshalled dispatch interface */
287 hr = CoGetMarshalSizeMax(&size, riid, V_UNKNOWN(pvar), LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
289 if (!V_DISPATCH(pvar))
290 WARN("NULL dispatch pointer\n");
292 ERR("Dispatch variant buffer size calculation failed, HRESULT=0x%lx\n", hr);
295 size += sizeof(ULONG); /* we have to store the buffersize in the stream */
296 TRACE("wire-size extra of dispatch variant is %ld\n", size);
300 static unsigned long wire_extra_user_size(unsigned long *pFlags, unsigned long Start, VARIANT *pvar)
305 return LPSAFEARRAY_UserSize(pFlags, Start, V_ARRAYREF(pvar));
307 return LPSAFEARRAY_UserSize(pFlags, Start, &V_ARRAY(pvar));
310 switch (V_VT(pvar)) {
312 return BSTR_UserSize(pFlags, Start, &V_BSTR(pvar));
313 case VT_BSTR | VT_BYREF:
314 return BSTR_UserSize(pFlags, Start, V_BSTRREF(pvar));
315 case VT_VARIANT | VT_BYREF:
316 return VARIANT_UserSize(pFlags, Start, V_VARIANTREF(pvar));
318 return Start + interface_variant_size(pFlags, &IID_IUnknown, pvar);
320 return Start + interface_variant_size(pFlags, &IID_IDispatch, pvar);
322 FIXME("wire-size record\n");
325 case VT_SAFEARRAY | VT_BYREF:
326 FIXME("wire-size safearray: shouldn't be marshaling this\n");
333 /* helper: called for VT_DISPATCH variants to marshal the IDispatch* into the buffer. returns Buffer on failure, new position otherwise */
334 static unsigned char* interface_variant_marshal(unsigned long *pFlags, unsigned char *Buffer, REFIID riid, VARIANT *pvar)
338 void *working_memlocked;
339 unsigned char *oldpos;
343 TRACE("pFlags=%ld, Buffer=%p, pvar=%p\n", *pFlags, Buffer, pvar);
347 /* CoMarshalInterface needs a stream, whereas at this level we are operating in terms of buffers.
348 * We create a stream on an HGLOBAL, so we can simply do a memcpy to move it to the buffer.
349 * in rpcrt4/ndr_ole.c, a simple IStream implementation is wrapped around the buffer object,
350 * but that would be overkill here, hence this implementation. We save the size because the unmarshal
351 * code has no way to know how long the marshalled buffer is. */
353 size = wire_extra_user_size(pFlags, 0, pvar);
355 working_mem = GlobalAlloc(0, size);
356 if (!working_mem) return oldpos;
358 hr = CreateStreamOnHGlobal(working_mem, TRUE, &working);
360 GlobalFree(working_mem);
364 hr = CoMarshalInterface(working, riid, V_UNKNOWN(pvar), LOWORD(*pFlags), NULL, MSHLFLAGS_NORMAL);
366 IStream_Release(working); /* this also releases the hglobal */
370 working_memlocked = GlobalLock(working_mem);
371 memcpy(Buffer, &size, sizeof(ULONG)); /* copy the buffersize */
372 memcpy(Buffer + sizeof(ULONG), working_memlocked, size - sizeof(ULONG));
373 GlobalUnlock(working_mem);
375 IStream_Release(working);
377 /* size includes the ULONG for the size written above */
378 TRACE("done, size=%ld\n", size);
379 return Buffer + size;
382 /* helper: called for VT_DISPATCH / VT_UNKNOWN variants to unmarshal the buffer. returns Buffer on failure, new position otherwise */
383 static unsigned char *interface_variant_unmarshal(unsigned long *pFlags, unsigned char *Buffer, REFIID riid, VARIANT *pvar)
387 void *working_memlocked;
388 unsigned char *oldpos;
392 TRACE("pFlags=%ld, Buffer=%p, pvar=%p\n", *pFlags, Buffer, pvar);
396 /* get the buffersize */
397 memcpy(&size, Buffer, sizeof(ULONG));
398 TRACE("buffersize=%ld\n", size);
400 working_mem = GlobalAlloc(0, size);
401 if (!working_mem) return oldpos;
403 hr = CreateStreamOnHGlobal(working_mem, TRUE, &working);
405 GlobalFree(working_mem);
409 working_memlocked = GlobalLock(working_mem);
411 /* now we copy the contents of the marshalling buffer to working_memlocked, unlock it, and demarshal the stream */
412 memcpy(working_memlocked, Buffer + sizeof(ULONG), size);
413 GlobalUnlock(working_mem);
415 hr = CoUnmarshalInterface(working, riid, (void**)&V_UNKNOWN(pvar));
417 IStream_Release(working);
421 IStream_Release(working); /* this also frees the underlying hglobal */
423 /* size includes the ULONG for the size written above */
424 TRACE("done, processed=%ld bytes\n", size);
425 return Buffer + size;
429 unsigned long WINAPI VARIANT_UserSize(unsigned long *pFlags, unsigned long Start, VARIANT *pvar)
432 TRACE("(%lx,%ld,%p)\n", *pFlags, Start, pvar);
433 TRACE("vt=%04x\n", V_VT(pvar));
435 ALIGN_LENGTH(Start, 7);
436 Start += sizeof(variant_wire_t);
437 if(V_VT(pvar) & VT_BYREF)
440 align = get_type_alignment(pFlags, pvar);
441 ALIGN_LENGTH(Start, align);
442 if(V_VT(pvar) == (VT_VARIANT | VT_BYREF))
445 Start += get_type_size(pFlags, pvar);
446 Start = wire_extra_user_size(pFlags, Start, pvar);
448 TRACE("returning %ld\n", Start);
452 unsigned char * WINAPI VARIANT_UserMarshal(unsigned long *pFlags, unsigned char *Buffer, VARIANT *pvar)
454 variant_wire_t *header;
455 unsigned long type_size;
459 TRACE("(%lx,%p,%p)\n", *pFlags, Buffer, pvar);
460 TRACE("vt=%04x\n", V_VT(pvar));
462 ALIGN_POINTER(Buffer, 7);
464 header = (variant_wire_t *)Buffer;
466 header->clSize = 0; /* fixed up at the end */
467 header->rpcReserverd = 0;
468 header->vt = pvar->n1.n2.vt;
469 header->wReserved1 = pvar->n1.n2.wReserved1;
470 header->wReserved2 = pvar->n1.n2.wReserved2;
471 header->wReserved3 = pvar->n1.n2.wReserved3;
472 header->switch_is = pvar->n1.n2.vt;
473 if(header->switch_is & VT_ARRAY)
474 header->switch_is &= ~VT_TYPEMASK;
476 Pos = (unsigned char*)(header + 1);
477 type_size = get_type_size(pFlags, pvar);
478 align = get_type_alignment(pFlags, pvar);
479 ALIGN_POINTER(Pos, align);
481 if(header->vt & VT_BYREF)
483 *(DWORD *)Pos = max(type_size, 4);
485 if((header->vt & VT_TYPEMASK) != VT_VARIANT)
487 memcpy(Pos, pvar->n1.n2.n3.byref, type_size);
492 *(DWORD*)Pos = 'U' | 's' << 8 | 'e' << 16 | 'r' << 24;
498 if((header->vt & VT_TYPEMASK) == VT_DECIMAL)
499 memcpy(Pos, pvar, type_size);
501 memcpy(Pos, &pvar->n1.n2.n3, type_size);
505 if(header->vt & VT_ARRAY)
507 if(header->vt & VT_BYREF)
508 Pos = LPSAFEARRAY_UserMarshal(pFlags, Pos, V_ARRAYREF(pvar));
510 Pos = LPSAFEARRAY_UserMarshal(pFlags, Pos, &V_ARRAY(pvar));
517 Pos = BSTR_UserMarshal(pFlags, Pos, &V_BSTR(pvar));
519 case VT_BSTR | VT_BYREF:
520 Pos = BSTR_UserMarshal(pFlags, Pos, V_BSTRREF(pvar));
522 case VT_VARIANT | VT_BYREF:
523 Pos = VARIANT_UserMarshal(pFlags, Pos, V_VARIANTREF(pvar));
525 case VT_DISPATCH | VT_BYREF:
526 FIXME("handle DISPATCH by ref\n");
529 /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
530 Pos = interface_variant_marshal(pFlags, Pos, &IID_IUnknown, pvar);
533 /* this should probably call WdtpInterfacePointer_UserMarshal in ole32.dll */
534 Pos = interface_variant_marshal(pFlags, Pos, &IID_IDispatch, pvar);
537 FIXME("handle BRECORD by val\n");
539 case VT_RECORD | VT_BYREF:
540 FIXME("handle BRECORD by ref\n");
544 header->clSize = ((Pos - Buffer) + 7) >> 3;
545 TRACE("marshalled size=%ld\n", header->clSize);
549 unsigned char * WINAPI VARIANT_UserUnmarshal(unsigned long *pFlags, unsigned char *Buffer, VARIANT *pvar)
551 variant_wire_t *header;
552 unsigned long type_size;
556 TRACE("(%lx,%p,%p)\n", *pFlags, Buffer, pvar);
558 ALIGN_POINTER(Buffer, 7);
561 header = (variant_wire_t *)Buffer;
563 pvar->n1.n2.vt = header->vt;
564 pvar->n1.n2.wReserved1 = header->wReserved1;
565 pvar->n1.n2.wReserved2 = header->wReserved2;
566 pvar->n1.n2.wReserved3 = header->wReserved3;
568 Pos = (unsigned char*)(header + 1);
569 type_size = get_type_size(pFlags, pvar);
570 align = get_type_alignment(pFlags, pvar);
571 ALIGN_POINTER(Pos, align);
573 if(header->vt & VT_BYREF)
576 pvar->n1.n2.n3.byref = CoTaskMemAlloc(type_size);
577 memcpy(pvar->n1.n2.n3.byref, Pos, type_size);
578 if((header->vt & VT_TYPEMASK) != VT_VARIANT)
585 if((header->vt & VT_TYPEMASK) == VT_DECIMAL)
586 memcpy(pvar, Pos, type_size);
588 memcpy(&pvar->n1.n2.n3, Pos, type_size);
592 if(header->vt & VT_ARRAY)
594 if(header->vt & VT_BYREF)
595 Pos = LPSAFEARRAY_UserUnmarshal(pFlags, Pos, V_ARRAYREF(pvar));
597 Pos = LPSAFEARRAY_UserUnmarshal(pFlags, Pos, &V_ARRAY(pvar));
605 Pos = BSTR_UserUnmarshal(pFlags, Pos, &V_BSTR(pvar));
607 case VT_BSTR | VT_BYREF:
608 *V_BSTRREF(pvar) = NULL;
609 Pos = BSTR_UserUnmarshal(pFlags, Pos, V_BSTRREF(pvar));
611 case VT_VARIANT | VT_BYREF:
612 Pos = VARIANT_UserUnmarshal(pFlags, Pos, V_VARIANTREF(pvar));
614 case VT_DISPATCH | VT_BYREF:
615 FIXME("handle DISPATCH by ref\n");
618 /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
619 Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IUnknown, pvar);
622 /* this should probably call WdtpInterfacePointer_UserUnmarshal in ole32.dll */
623 Pos = interface_variant_unmarshal(pFlags, Pos, &IID_IDispatch, pvar);
626 FIXME("handle BRECORD by val\n");
628 case VT_RECORD | VT_BYREF:
629 FIXME("handle BRECORD by ref\n");
636 void WINAPI VARIANT_UserFree(unsigned long *pFlags, VARIANT *pvar)
638 VARTYPE vt = V_VT(pvar);
641 TRACE("(%lx,%p)\n", *pFlags, pvar);
642 TRACE("vt=%04x\n", V_VT(pvar));
644 if (vt & VT_BYREF) ref = pvar->n1.n2.n3.byref;
650 LPSAFEARRAY_UserFree(pFlags, V_ARRAYREF(pvar));
655 case VT_BSTR | VT_BYREF:
656 BSTR_UserFree(pFlags, V_BSTRREF(pvar));
658 case VT_VARIANT | VT_BYREF:
659 VARIANT_UserFree(pFlags, V_VARIANTREF(pvar));
661 case VT_RECORD | VT_BYREF:
662 FIXME("handle BRECORD by ref\n");
664 case VT_UNKNOWN | VT_BYREF:
665 case VT_DISPATCH | VT_BYREF:
666 IUnknown_Release(*V_UNKNOWNREF(pvar));
676 /* Get the number of cells in a SafeArray */
677 static ULONG SAFEARRAY_GetCellCount(const SAFEARRAY *psa)
679 const SAFEARRAYBOUND* psab = psa->rgsabound;
680 USHORT cCount = psa->cDims;
681 ULONG ulNumCells = 1;
685 /* This is a valid bordercase. See testcases. -Marcus */
686 if (!psab->cElements)
688 ulNumCells *= psab->cElements;
694 static inline SF_TYPE SAFEARRAY_GetUnionType(SAFEARRAY *psa)
699 hr = SafeArrayGetVartype(psa, &vt);
701 RpcRaiseException(hr);
703 if (psa->fFeatures & FADF_HAVEIID)
709 case VT_UI1: return SF_I1;
712 case VT_UI2: return SF_I2;
717 case VT_R4: return SF_I4;
722 case VT_UI8: return SF_I8;
724 case VT_UINT_PTR: return (sizeof(UINT_PTR) == 4 ? SF_I4 : SF_I8);
725 case VT_BSTR: return SF_BSTR;
726 case VT_DISPATCH: return SF_DISPATCH;
727 case VT_VARIANT: return SF_VARIANT;
728 case VT_UNKNOWN: return SF_UNKNOWN;
729 /* Note: Return a non-zero size to indicate vt is valid. The actual size
730 * of a UDT is taken from the result of IRecordInfo_GetSize().
732 case VT_RECORD: return SF_RECORD;
733 default: return SF_ERROR;
737 unsigned long WINAPI LPSAFEARRAY_UserSize(unsigned long *pFlags, unsigned long StartingSize, LPSAFEARRAY *ppsa)
739 unsigned long size = StartingSize;
741 TRACE("("); dump_user_flags(pFlags); TRACE(", %ld, %p\n", StartingSize, *ppsa);
743 ALIGN_LENGTH(size, 3);
744 size += sizeof(ULONG_PTR);
747 SAFEARRAY *psa = *ppsa;
748 ULONG ulCellCount = SAFEARRAY_GetCellCount(psa);
752 size += sizeof(ULONG);
753 size += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs);
755 sftype = SAFEARRAY_GetUnionType(psa);
756 size += sizeof(ULONG);
758 size += sizeof(ULONG);
759 size += sizeof(ULONG_PTR);
760 if (sftype == SF_HAVEIID)
763 size += sizeof(psa->rgsabound[0]) * psa->cDims;
765 size += sizeof(ULONG);
773 for (lpBstr = (BSTR*)psa->pvData; ulCellCount; ulCellCount--, lpBstr++)
774 size = BSTR_UserSize(pFlags, size, lpBstr);
781 FIXME("size interfaces\n");
787 for (lpVariant = (VARIANT*)psa->pvData; ulCellCount; ulCellCount--, lpVariant++)
788 size = VARIANT_UserSize(pFlags, size, lpVariant);
794 IRecordInfo* pRecInfo = NULL;
796 hr = SafeArrayGetRecordInfo(psa, &pRecInfo);
798 RpcRaiseException(hr);
802 FIXME("size record info %p\n", pRecInfo);
804 IRecordInfo_Release(pRecInfo);
809 ALIGN_LENGTH(size, 7);
814 size += ulCellCount * psa->cbElements;
825 unsigned char * WINAPI LPSAFEARRAY_UserMarshal(unsigned long *pFlags, unsigned char *Buffer, LPSAFEARRAY *ppsa)
829 TRACE("("); dump_user_flags(pFlags); TRACE(", %p, &%p\n", Buffer, *ppsa);
831 ALIGN_POINTER(Buffer, 3);
832 *(ULONG_PTR *)Buffer = *ppsa ? TRUE : FALSE;
833 Buffer += sizeof(ULONG_PTR);
837 SAFEARRAY *psa = *ppsa;
838 ULONG ulCellCount = SAFEARRAY_GetCellCount(psa);
839 wireSAFEARRAY wiresa;
843 *(ULONG *)Buffer = psa->cDims;
844 Buffer += sizeof(ULONG);
845 wiresa = (wireSAFEARRAY)Buffer;
846 wiresa->cDims = psa->cDims;
847 wiresa->fFeatures = psa->fFeatures;
848 wiresa->cbElements = psa->cbElements;
850 hr = SafeArrayGetVartype(psa, &vt);
852 RpcRaiseException(hr);
853 wiresa->cLocks = (USHORT)psa->cLocks | (vt << 16);
855 Buffer += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs);
857 sftype = SAFEARRAY_GetUnionType(psa);
858 *(ULONG *)Buffer = sftype;
859 Buffer += sizeof(ULONG);
861 *(ULONG *)Buffer = ulCellCount;
862 Buffer += sizeof(ULONG);
863 *(ULONG_PTR *)Buffer = (ULONG_PTR)psa->pvData;
864 Buffer += sizeof(ULONG_PTR);
865 if (sftype == SF_HAVEIID)
867 SafeArrayGetIID(psa, &guid);
868 memcpy(Buffer, &guid, sizeof(guid));
869 Buffer += sizeof(guid);
872 memcpy(Buffer, psa->rgsabound, sizeof(psa->rgsabound[0]) * psa->cDims);
873 Buffer += sizeof(psa->rgsabound[0]) * psa->cDims;
875 *(ULONG *)Buffer = ulCellCount;
876 Buffer += sizeof(ULONG);
886 for (lpBstr = (BSTR*)psa->pvData; ulCellCount; ulCellCount--, lpBstr++)
887 Buffer = BSTR_UserMarshal(pFlags, Buffer, lpBstr);
894 FIXME("marshal interfaces\n");
900 for (lpVariant = (VARIANT*)psa->pvData; ulCellCount; ulCellCount--, lpVariant++)
901 Buffer = VARIANT_UserMarshal(pFlags, Buffer, lpVariant);
907 IRecordInfo* pRecInfo = NULL;
909 hr = SafeArrayGetRecordInfo(psa, &pRecInfo);
911 RpcRaiseException(hr);
915 FIXME("write record info %p\n", pRecInfo);
917 IRecordInfo_Release(pRecInfo);
923 ALIGN_POINTER(Buffer, 7);
928 /* Just copy the data over */
929 memcpy(Buffer, psa->pvData, ulCellCount * psa->cbElements);
930 Buffer += ulCellCount * psa->cbElements;
941 #define FADF_AUTOSETFLAGS (FADF_HAVEIID | FADF_RECORD | FADF_HAVEVARTYPE | \
942 FADF_BSTR | FADF_UNKNOWN | FADF_DISPATCH | \
943 FADF_VARIANT | FADF_CREATEVECTOR)
945 unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(unsigned long *pFlags, unsigned char *Buffer, LPSAFEARRAY *ppsa)
948 wireSAFEARRAY wiresa;
955 SAFEARRAYBOUND *wiresab;
957 TRACE("("); dump_user_flags(pFlags); TRACE(", %p, %p\n", Buffer, ppsa);
959 ALIGN_POINTER(Buffer, 3);
960 ptr = *(ULONG_PTR *)Buffer;
961 Buffer += sizeof(ULONG_PTR);
967 TRACE("NULL safe array unmarshaled\n");
972 cDims = *(ULONG *)Buffer;
973 Buffer += sizeof(ULONG);
975 wiresa = (wireSAFEARRAY)Buffer;
976 Buffer += FIELD_OFFSET(struct _wireSAFEARRAY, uArrayStructs);
978 if (cDims != wiresa->cDims)
979 RpcRaiseException(RPC_S_INVALID_BOUND);
981 /* FIXME: there should be a limit on how large cDims can be */
983 vt = HIWORD(wiresa->cLocks);
985 sftype = *(ULONG *)Buffer;
986 Buffer += sizeof(ULONG);
988 cell_count = *(ULONG *)Buffer;
989 Buffer += sizeof(ULONG);
990 ptr = *(ULONG_PTR *)Buffer;
991 Buffer += sizeof(ULONG_PTR);
992 if (sftype == SF_HAVEIID)
994 memcpy(&guid, Buffer, sizeof(guid));
995 Buffer += sizeof(guid);
998 wiresab = (SAFEARRAYBOUND *)Buffer;
999 Buffer += sizeof(wiresab[0]) * wiresa->cDims;
1001 *ppsa = SafeArrayCreateEx(vt, wiresa->cDims, wiresab, NULL);
1003 RpcRaiseException(E_OUTOFMEMORY);
1005 /* be careful about which flags we set since they could be a security
1007 (*ppsa)->fFeatures = wiresa->fFeatures & ~(FADF_AUTOSETFLAGS);
1008 /* FIXME: there should be a limit on how large wiresa->cbElements can be */
1009 (*ppsa)->cbElements = wiresa->cbElements;
1010 (*ppsa)->cLocks = LOWORD(wiresa->cLocks);
1012 hr = SafeArrayAllocData(*ppsa);
1014 RpcRaiseException(hr);
1016 if ((*(ULONG *)Buffer != cell_count) || (SAFEARRAY_GetCellCount(*ppsa) != cell_count))
1017 RpcRaiseException(RPC_S_INVALID_BOUND);
1018 Buffer += sizeof(ULONG);
1028 for (lpBstr = (BSTR*)(*ppsa)->pvData; cell_count; cell_count--, lpBstr++)
1029 Buffer = BSTR_UserUnmarshal(pFlags, Buffer, lpBstr);
1036 FIXME("marshal interfaces\n");
1042 for (lpVariant = (VARIANT*)(*ppsa)->pvData; cell_count; cell_count--, lpVariant++)
1043 Buffer = VARIANT_UserUnmarshal(pFlags, Buffer, lpVariant);
1049 FIXME("set record info\n");
1055 ALIGN_POINTER(Buffer, 7);
1060 /* Just copy the data over */
1061 memcpy((*ppsa)->pvData, Buffer, cell_count * (*ppsa)->cbElements);
1062 Buffer += cell_count * (*ppsa)->cbElements;
1069 TRACE("safe array unmarshaled: %p\n", *ppsa);
1074 void WINAPI LPSAFEARRAY_UserFree(unsigned long *pFlags, LPSAFEARRAY *ppsa)
1076 TRACE("("); dump_user_flags(pFlags); TRACE(", &%p\n", *ppsa);
1078 SafeArrayDestroy(*ppsa);
1082 /* exactly how Invoke is marshalled is not very clear to me yet,
1083 * but the way I've done it seems to work for me */
1085 HRESULT CALLBACK IDispatch_Invoke_Proxy(
1087 DISPID dispIdMember,
1091 DISPPARAMS* pDispParams,
1092 VARIANT* pVarResult,
1093 EXCEPINFO* pExcepInfo,
1098 UINT* rgVarRefIdx = NULL;
1099 VARIANTARG* rgVarRef = NULL;
1102 EXCEPINFO ExcepInfo;
1104 TRACE("(%p)->(%ld,%s,%lx,%x,%p,%p,%p,%p)\n", This,
1105 dispIdMember, debugstr_guid(riid),
1106 lcid, wFlags, pDispParams, pVarResult,
1107 pExcepInfo, puArgErr);
1109 /* [out] args can't be null, use dummy vars if needed */
1110 if (!pVarResult) pVarResult = &VarResult;
1111 if (!puArgErr) puArgErr = &uArgErr;
1112 if (!pExcepInfo) pExcepInfo = &ExcepInfo;
1114 /* count by-ref args */
1115 for (cVarRef=0,u=0; u<pDispParams->cArgs; u++) {
1116 VARIANTARG* arg = &pDispParams->rgvarg[u];
1117 if (V_ISBYREF(arg)) {
1122 rgVarRefIdx = CoTaskMemAlloc(sizeof(UINT)*cVarRef);
1123 rgVarRef = CoTaskMemAlloc(sizeof(VARIANTARG)*cVarRef);
1124 /* make list of by-ref args */
1125 for (cVarRef=0,u=0; u<pDispParams->cArgs; u++) {
1126 VARIANTARG* arg = &pDispParams->rgvarg[u];
1127 if (V_ISBYREF(arg)) {
1128 rgVarRefIdx[cVarRef] = u;
1129 VariantInit(&rgVarRef[cVarRef]);
1134 /* [out] args still can't be null,
1135 * but we can point these anywhere in this case,
1136 * since they won't be written to when cVarRef is 0 */
1137 rgVarRefIdx = puArgErr;
1138 rgVarRef = pVarResult;
1140 TRACE("passed by ref: %d args\n", cVarRef);
1141 hr = IDispatch_RemoteInvoke_Proxy(This,
1154 for (u=0; u<cVarRef; u++) {
1155 unsigned i = rgVarRefIdx[u];
1156 VariantCopy(&pDispParams->rgvarg[i],
1158 VariantClear(&rgVarRef[u]);
1160 CoTaskMemFree(rgVarRef);
1161 CoTaskMemFree(rgVarRefIdx);
1164 if(pExcepInfo == &ExcepInfo)
1166 SysFreeString(pExcepInfo->bstrSource);
1167 SysFreeString(pExcepInfo->bstrDescription);
1168 SysFreeString(pExcepInfo->bstrHelpFile);
1173 HRESULT __RPC_STUB IDispatch_Invoke_Stub(
1175 DISPID dispIdMember,
1179 DISPPARAMS* pDispParams,
1180 VARIANT* pVarResult,
1181 EXCEPINFO* pExcepInfo,
1185 VARIANTARG* rgVarRef)
1188 VARIANTARG *rgvarg, *arg;
1191 /* initialize out parameters, so that they can be marshalled
1192 * in case the real Invoke doesn't initialize them */
1193 VariantInit(pVarResult);
1194 memset(pExcepInfo, 0, sizeof(*pExcepInfo));
1197 /* let the real Invoke operate on a copy of the in parameters,
1198 * so we don't risk losing pointers to allocated memory */
1199 rgvarg = pDispParams->rgvarg;
1200 arg = CoTaskMemAlloc(sizeof(VARIANTARG)*pDispParams->cArgs);
1201 if (!arg) return E_OUTOFMEMORY;
1203 /* init all args so we can call VariantClear on all the args if the copy
1205 for (u = 0; u < pDispParams->cArgs; u++)
1206 VariantInit(&arg[u]);
1208 for (u = 0; u < pDispParams->cArgs; u++) {
1209 hr = VariantCopy(&arg[u], &rgvarg[u]);
1214 if (SUCCEEDED(hr)) {
1215 pDispParams->rgvarg = arg;
1217 hr = IDispatch_Invoke(This,
1227 /* copy ref args to out list */
1228 for (u=0; u<cVarRef; u++) {
1229 unsigned i = rgVarRefIdx[u];
1230 VariantInit(&rgVarRef[u]);
1231 VariantCopy(&rgVarRef[u], &arg[i]);
1232 /* clear original if equal, to avoid double-free */
1233 if (V_BYREF(&rgVarRef[u]) == V_BYREF(&rgvarg[i]))
1234 VariantClear(&rgvarg[i]);
1238 /* clear the duplicate argument list */
1239 for (u=0; u<pDispParams->cArgs; u++)
1240 VariantClear(&arg[u]);
1242 pDispParams->rgvarg = rgvarg;
1250 HRESULT CALLBACK IEnumVARIANT_Next_Proxy(
1254 ULONG* pCeltFetched)
1258 pCeltFetched = &fetched;
1259 return IEnumVARIANT_RemoteNext_Proxy(This,
1265 HRESULT __RPC_STUB IEnumVARIANT_Next_Stub(
1269 ULONG* pCeltFetched)
1273 hr = IEnumVARIANT_Next(This,
1277 if (hr == S_OK) *pCeltFetched = celt;
1281 /* TypeInfo related freers */
1283 static void free_embedded_typedesc(TYPEDESC *tdesc);
1284 static void free_embedded_arraydesc(ARRAYDESC *adesc)
1286 switch(adesc->tdescElem.vt)
1290 free_embedded_typedesc(adesc->tdescElem.u.lptdesc);
1291 CoTaskMemFree(adesc->tdescElem.u.lptdesc);
1294 free_embedded_arraydesc(adesc->tdescElem.u.lpadesc);
1295 CoTaskMemFree(adesc->tdescElem.u.lpadesc);
1300 static void free_embedded_typedesc(TYPEDESC *tdesc)
1306 free_embedded_typedesc(tdesc->u.lptdesc);
1307 CoTaskMemFree(tdesc->u.lptdesc);
1310 free_embedded_arraydesc(tdesc->u.lpadesc);
1311 CoTaskMemFree(tdesc->u.lpadesc);
1316 static void free_embedded_elemdesc(ELEMDESC *edesc)
1318 free_embedded_typedesc(&edesc->tdesc);
1319 if(edesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
1320 CoTaskMemFree(edesc->u.paramdesc.pparamdescex);
1325 HRESULT CALLBACK ITypeComp_Bind_Proxy(
1330 ITypeInfo** ppTInfo,
1331 DESCKIND* pDescKind,
1334 FIXME("not implemented\n");
1338 HRESULT __RPC_STUB ITypeComp_Bind_Stub(
1343 ITypeInfo** ppTInfo,
1344 DESCKIND* pDescKind,
1345 LPFUNCDESC* ppFuncDesc,
1346 LPVARDESC* ppVarDesc,
1347 ITypeComp** ppTypeComp,
1348 CLEANLOCALSTORAGE* pDummy)
1350 FIXME("not implemented\n");
1354 HRESULT CALLBACK ITypeComp_BindType_Proxy(
1358 ITypeInfo** ppTInfo,
1359 ITypeComp** ppTComp)
1361 FIXME("not implemented\n");
1365 HRESULT __RPC_STUB ITypeComp_BindType_Stub(
1369 ITypeInfo** ppTInfo)
1371 FIXME("not implemented\n");
1377 HRESULT CALLBACK ITypeInfo_GetTypeAttr_Proxy(
1379 TYPEATTR** ppTypeAttr)
1382 CLEANLOCALSTORAGE stg;
1383 TRACE("(%p, %p)\n", This, ppTypeAttr);
1386 stg.pStorage = NULL;
1387 stg.pInterface = NULL;
1389 return ITypeInfo_RemoteGetTypeAttr_Proxy(This, ppTypeAttr, &stg);
1392 HRESULT __RPC_STUB ITypeInfo_GetTypeAttr_Stub(
1394 LPTYPEATTR* ppTypeAttr,
1395 CLEANLOCALSTORAGE* pDummy)
1398 TRACE("(%p, %p)\n", This, ppTypeAttr);
1400 hr = ITypeInfo_GetTypeAttr(This, ppTypeAttr);
1404 pDummy->flags = CLS_TYPEATTR;
1405 ITypeInfo_AddRef(This);
1406 pDummy->pInterface = (IUnknown*)This;
1407 pDummy->pStorage = ppTypeAttr;
1411 HRESULT CALLBACK ITypeInfo_GetFuncDesc_Proxy(
1414 FUNCDESC** ppFuncDesc)
1416 CLEANLOCALSTORAGE stg;
1417 TRACE("(%p, %d, %p)\n", This, index, ppFuncDesc);
1420 stg.pStorage = NULL;
1421 stg.pInterface = NULL;
1423 return ITypeInfo_RemoteGetFuncDesc_Proxy(This, index, ppFuncDesc, &stg);
1426 HRESULT __RPC_STUB ITypeInfo_GetFuncDesc_Stub(
1429 LPFUNCDESC* ppFuncDesc,
1430 CLEANLOCALSTORAGE* pDummy)
1433 TRACE("(%p, %d, %p)\n", This, index, ppFuncDesc);
1435 hr = ITypeInfo_GetFuncDesc(This, index, ppFuncDesc);
1439 pDummy->flags = CLS_FUNCDESC;
1440 ITypeInfo_AddRef(This);
1441 pDummy->pInterface = (IUnknown*)This;
1442 pDummy->pStorage = ppFuncDesc;
1446 HRESULT CALLBACK ITypeInfo_GetVarDesc_Proxy(
1449 VARDESC** ppVarDesc)
1451 FIXME("not implemented\n");
1455 HRESULT __RPC_STUB ITypeInfo_GetVarDesc_Stub(
1458 LPVARDESC* ppVarDesc,
1459 CLEANLOCALSTORAGE* pDummy)
1461 FIXME("not implemented\n");
1465 HRESULT CALLBACK ITypeInfo_GetNames_Proxy(
1472 FIXME("not implemented\n");
1476 HRESULT __RPC_STUB ITypeInfo_GetNames_Stub(
1483 FIXME("not implemented\n");
1487 HRESULT CALLBACK ITypeInfo_GetIDsOfNames_Proxy(
1489 LPOLESTR* rgszNames,
1493 FIXME("not implemented\n");
1497 HRESULT __RPC_STUB ITypeInfo_GetIDsOfNames_Stub(
1500 FIXME("not implemented\n");
1504 HRESULT CALLBACK ITypeInfo_Invoke_Proxy(
1509 DISPPARAMS* pDispParams,
1510 VARIANT* pVarResult,
1511 EXCEPINFO* pExcepInfo,
1514 FIXME("not implemented\n");
1518 HRESULT __RPC_STUB ITypeInfo_Invoke_Stub(
1521 FIXME("not implemented\n");
1525 HRESULT CALLBACK ITypeInfo_GetDocumentation_Proxy(
1529 BSTR* pBstrDocString,
1530 DWORD* pdwHelpContext,
1531 BSTR* pBstrHelpFile)
1534 BSTR name, doc_string, help_file;
1536 TRACE("(%p, %08lx, %p, %p, %p, %p)\n", This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
1538 /* FIXME: presumably refPtrFlags is supposed to be a bitmask of which ptrs we actually want? */
1539 hr = ITypeInfo_RemoteGetDocumentation_Proxy(This, memid, 0, &name, &doc_string, &help_context, &help_file);
1542 if(pBstrName) *pBstrName = name;
1543 else SysFreeString(name);
1545 if(pBstrDocString) *pBstrDocString = doc_string;
1546 else SysFreeString(doc_string);
1548 if(pBstrHelpFile) *pBstrHelpFile = help_file;
1549 else SysFreeString(help_file);
1551 if(pdwHelpContext) *pdwHelpContext = help_context;
1556 HRESULT __RPC_STUB ITypeInfo_GetDocumentation_Stub(
1561 BSTR* pBstrDocString,
1562 DWORD* pdwHelpContext,
1563 BSTR* pBstrHelpFile)
1565 TRACE("(%p, %08lx, %08lx, %p, %p, %p, %p)\n", This, memid, refPtrFlags, pBstrName, pBstrDocString,
1566 pdwHelpContext, pBstrHelpFile);
1567 return ITypeInfo_GetDocumentation(This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
1570 HRESULT CALLBACK ITypeInfo_GetDllEntry_Proxy(
1578 FIXME("not implemented\n");
1582 HRESULT __RPC_STUB ITypeInfo_GetDllEntry_Stub(
1591 FIXME("not implemented\n");
1595 HRESULT CALLBACK ITypeInfo_AddressOfMember_Proxy(
1601 FIXME("not implemented\n");
1605 HRESULT __RPC_STUB ITypeInfo_AddressOfMember_Stub(
1608 FIXME("not implemented\n");
1612 HRESULT CALLBACK ITypeInfo_CreateInstance_Proxy(
1614 IUnknown* pUnkOuter,
1618 FIXME("not implemented\n");
1622 HRESULT __RPC_STUB ITypeInfo_CreateInstance_Stub(
1627 FIXME("not implemented\n");
1631 HRESULT CALLBACK ITypeInfo_GetContainingTypeLib_Proxy(
1640 TRACE("(%p, %p, %p)\n", This, ppTLib, pIndex );
1642 hr = ITypeInfo_RemoteGetContainingTypeLib_Proxy(This, &pTL, &index);
1651 ITypeLib_Release(pTL);
1656 HRESULT __RPC_STUB ITypeInfo_GetContainingTypeLib_Stub(
1661 TRACE("(%p, %p, %p)\n", This, ppTLib, pIndex );
1662 return ITypeInfo_GetContainingTypeLib(This, ppTLib, pIndex);
1665 void CALLBACK ITypeInfo_ReleaseTypeAttr_Proxy(
1667 TYPEATTR* pTypeAttr)
1669 TRACE("(%p, %p)\n", This, pTypeAttr);
1670 free_embedded_typedesc(&pTypeAttr->tdescAlias);
1671 CoTaskMemFree(pTypeAttr);
1674 HRESULT __RPC_STUB ITypeInfo_ReleaseTypeAttr_Stub(
1677 TRACE("nothing to do\n");
1681 void CALLBACK ITypeInfo_ReleaseFuncDesc_Proxy(
1683 FUNCDESC* pFuncDesc)
1686 TRACE("(%p, %p)\n", This, pFuncDesc);
1688 for(param = 0; param < pFuncDesc->cParams; param++)
1689 free_embedded_elemdesc(pFuncDesc->lprgelemdescParam + param);
1691 CoTaskMemFree(pFuncDesc->lprgelemdescParam);
1693 free_embedded_elemdesc(&pFuncDesc->elemdescFunc);
1695 if(pFuncDesc->cScodes != 0 && pFuncDesc->cScodes != -1)
1696 CoTaskMemFree(pFuncDesc->lprgscode);
1698 CoTaskMemFree(pFuncDesc);
1701 HRESULT __RPC_STUB ITypeInfo_ReleaseFuncDesc_Stub(
1704 TRACE("nothing to do\n");
1708 void CALLBACK ITypeInfo_ReleaseVarDesc_Proxy(
1712 FIXME("not implemented\n");
1715 HRESULT __RPC_STUB ITypeInfo_ReleaseVarDesc_Stub(
1718 FIXME("not implemented\n");
1725 HRESULT CALLBACK ITypeInfo2_GetDocumentation2_Proxy(
1729 BSTR* pbstrHelpString,
1730 DWORD* pdwHelpStringContext,
1731 BSTR* pbstrHelpStringDll)
1733 FIXME("not implemented\n");
1737 HRESULT __RPC_STUB ITypeInfo2_GetDocumentation2_Stub(
1742 BSTR* pbstrHelpString,
1743 DWORD* pdwHelpStringContext,
1744 BSTR* pbstrHelpStringDll)
1746 FIXME("not implemented\n");
1752 UINT CALLBACK ITypeLib_GetTypeInfoCount_Proxy(
1756 TRACE("(%p)\n", This);
1758 ITypeLib_RemoteGetTypeInfoCount_Proxy(This, &count);
1763 HRESULT __RPC_STUB ITypeLib_GetTypeInfoCount_Stub(
1767 TRACE("(%p, %p)\n", This, pcTInfo);
1768 *pcTInfo = ITypeLib_GetTypeInfoCount(This);
1772 HRESULT CALLBACK ITypeLib_GetLibAttr_Proxy(
1774 TLIBATTR** ppTLibAttr)
1776 CLEANLOCALSTORAGE stg;
1777 TRACE("(%p, %p)\n", This, ppTLibAttr);
1780 stg.pStorage = NULL;
1781 stg.pInterface = NULL;
1783 return ITypeLib_RemoteGetLibAttr_Proxy(This, ppTLibAttr, &stg);
1786 HRESULT __RPC_STUB ITypeLib_GetLibAttr_Stub(
1788 LPTLIBATTR* ppTLibAttr,
1789 CLEANLOCALSTORAGE* pDummy)
1792 TRACE("(%p, %p)\n", This, ppTLibAttr);
1794 hr = ITypeLib_GetLibAttr(This, ppTLibAttr);
1798 pDummy->flags = CLS_LIBATTR;
1799 ITypeLib_AddRef(This);
1800 pDummy->pInterface = (IUnknown*)This;
1801 pDummy->pStorage = ppTLibAttr;
1805 HRESULT CALLBACK ITypeLib_GetDocumentation_Proxy(
1809 BSTR* pBstrDocString,
1810 DWORD* pdwHelpContext,
1811 BSTR* pBstrHelpFile)
1813 FIXME("not implemented\n");
1817 HRESULT __RPC_STUB ITypeLib_GetDocumentation_Stub(
1822 BSTR* pBstrDocString,
1823 DWORD* pdwHelpContext,
1824 BSTR* pBstrHelpFile)
1826 FIXME("not implemented\n");
1830 HRESULT CALLBACK ITypeLib_IsName_Proxy(
1836 FIXME("not implemented\n");
1840 HRESULT __RPC_STUB ITypeLib_IsName_Stub(
1847 FIXME("not implemented\n");
1851 HRESULT CALLBACK ITypeLib_FindName_Proxy(
1855 ITypeInfo** ppTInfo,
1859 FIXME("not implemented\n");
1863 HRESULT __RPC_STUB ITypeLib_FindName_Stub(
1867 ITypeInfo** ppTInfo,
1872 FIXME("not implemented\n");
1876 void CALLBACK ITypeLib_ReleaseTLibAttr_Proxy(
1878 TLIBATTR* pTLibAttr)
1880 TRACE("(%p, %p)\n", This, pTLibAttr);
1881 CoTaskMemFree(pTLibAttr);
1884 HRESULT __RPC_STUB ITypeLib_ReleaseTLibAttr_Stub(
1887 TRACE("nothing to do\n");
1894 HRESULT CALLBACK ITypeLib2_GetLibStatistics_Proxy(
1896 ULONG* pcUniqueNames,
1897 ULONG* pcchUniqueNames)
1899 FIXME("not implemented\n");
1903 HRESULT __RPC_STUB ITypeLib2_GetLibStatistics_Stub(
1905 ULONG* pcUniqueNames,
1906 ULONG* pcchUniqueNames)
1908 FIXME("not implemented\n");
1912 HRESULT CALLBACK ITypeLib2_GetDocumentation2_Proxy(
1916 BSTR* pbstrHelpString,
1917 DWORD* pdwHelpStringContext,
1918 BSTR* pbstrHelpStringDll)
1920 FIXME("not implemented\n");
1924 HRESULT __RPC_STUB ITypeLib2_GetDocumentation2_Stub(
1929 BSTR* pbstrHelpString,
1930 DWORD* pdwHelpStringContext,
1931 BSTR* pbstrHelpStringDll)
1933 FIXME("not implemented\n");