2 * Miscellaneous Marshaling Routines
4 * Copyright 2005 Robert Shearman
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #define NONAMELESSUNION
38 #include "wine/unicode.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
43 #define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
44 #define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
45 #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
46 #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
48 #define USER_MARSHAL_PTR_PREFIX \
49 ( (DWORD)'U' | ( (DWORD)'s' << 8 ) | \
50 ( (DWORD)'e' << 16 ) | ( (DWORD)'r' << 24 ) )
52 static const char* debugstr_user_flags(ULONG
*pFlags
)
56 switch (LOWORD(*pFlags
))
59 loword
="MSHCTX_LOCAL";
61 case MSHCTX_NOSHAREDMEM
:
62 loword
="MSHCTX_NOSHAREDMEM";
64 case MSHCTX_DIFFERENTMACHINE
:
65 loword
="MSHCTX_DIFFERENTMACHINE";
68 loword
="MSHCTX_INPROC";
71 sprintf(buf
, "%d", LOWORD(*pFlags
));
75 if (HIWORD(*pFlags
) == NDR_LOCAL_DATA_REPRESENTATION
)
76 return wine_dbg_sprintf("MAKELONG(%s, NDR_LOCAL_DATA_REPRESENTATION)", loword
);
78 return wine_dbg_sprintf("MAKELONG(%s, 0x%04x)", loword
, HIWORD(*pFlags
));
81 /******************************************************************************
82 * CLIPFORMAT_UserSize [OLE32.@]
84 * Calculates the buffer size required to marshal a clip format.
87 * pFlags [I] Flags. See notes.
88 * StartingSize [I] Starting size of the buffer. This value is added on to
89 * the buffer size required for the clip format.
90 * pCF [I] Clip format to size.
93 * The buffer size required to marshal a clip format plus the starting size.
96 * Even though the function is documented to take a pointer to an unsigned
97 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
98 * the first parameter is an unsigned long.
99 * This function is only intended to be called by the RPC runtime.
101 ULONG __RPC_USER
CLIPFORMAT_UserSize(ULONG
*pFlags
, ULONG StartingSize
, CLIPFORMAT
*pCF
)
103 ULONG size
= StartingSize
;
105 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pCF
);
109 /* only need to marshal the name if it is not a pre-defined type and
110 * we are going remote */
111 if ((*pCF
>= 0xc000) && (LOWORD(*pFlags
) == MSHCTX_DIFFERENTMACHINE
))
115 size
+= 3 * sizeof(UINT
);
116 /* urg! this function is badly designed because it won't tell us how
117 * much space is needed without doing a dummy run of storing the
118 * name into a buffer */
119 ret
= GetClipboardFormatNameW(*pCF
, format
, sizeof(format
)/sizeof(format
[0])-1);
121 RaiseException(DV_E_CLIPFORMAT
, 0, 0, NULL
);
122 size
+= (ret
+ 1) * sizeof(WCHAR
);
127 /******************************************************************************
128 * CLIPFORMAT_UserMarshal [OLE32.@]
130 * Marshals a clip format into a buffer.
133 * pFlags [I] Flags. See notes.
134 * pBuffer [I] Buffer to marshal the clip format into.
135 * pCF [I] Clip format to marshal.
138 * The end of the marshaled data in the buffer.
141 * Even though the function is documented to take a pointer to an unsigned
142 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
143 * the first parameter is an unsigned long.
144 * This function is only intended to be called by the RPC runtime.
146 unsigned char * __RPC_USER
CLIPFORMAT_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, CLIPFORMAT
*pCF
)
148 TRACE("(%s, %p, &0x%04x\n", debugstr_user_flags(pFlags
), pBuffer
, *pCF
);
150 /* only need to marshal the name if it is not a pre-defined type and
151 * we are going remote */
152 if ((*pCF
>= 0xc000) && (LOWORD(*pFlags
) == MSHCTX_DIFFERENTMACHINE
))
157 *(DWORD
*)pBuffer
= WDT_REMOTE_CALL
;
159 *(DWORD
*)pBuffer
= *pCF
;
162 len
= GetClipboardFormatNameW(*pCF
, format
, sizeof(format
)/sizeof(format
[0])-1);
164 RaiseException(DV_E_CLIPFORMAT
, 0, 0, NULL
);
166 *(UINT
*)pBuffer
= len
;
167 pBuffer
+= sizeof(UINT
);
168 *(UINT
*)pBuffer
= 0;
169 pBuffer
+= sizeof(UINT
);
170 *(UINT
*)pBuffer
= len
;
171 pBuffer
+= sizeof(UINT
);
172 TRACE("marshaling format name %s\n", debugstr_w(format
));
173 memcpy(pBuffer
, format
, len
* sizeof(WCHAR
));
174 pBuffer
+= len
* sizeof(WCHAR
);
178 *(DWORD
*)pBuffer
= WDT_INPROC_CALL
;
180 *(DWORD
*)pBuffer
= *pCF
;
187 /******************************************************************************
188 * CLIPFORMAT_UserUnmarshal [OLE32.@]
190 * Unmarshals a clip format from a buffer.
193 * pFlags [I] Flags. See notes.
194 * pBuffer [I] Buffer to marshal the clip format from.
195 * pCF [O] Address that receive the unmarshaled clip format.
198 * The end of the marshaled data in the buffer.
201 * Even though the function is documented to take a pointer to an unsigned
202 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
203 * the first parameter is an unsigned long.
204 * This function is only intended to be called by the RPC runtime.
206 unsigned char * __RPC_USER
CLIPFORMAT_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, CLIPFORMAT
*pCF
)
210 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pCF
);
212 fContext
= *(DWORD
*)pBuffer
;
215 if (fContext
== WDT_INPROC_CALL
)
217 *pCF
= *(CLIPFORMAT
*)pBuffer
;
220 else if (fContext
== WDT_REMOTE_CALL
)
225 /* pointer ID for registered clip format string */
226 if (*(DWORD
*)pBuffer
== 0)
227 RaiseException(RPC_S_INVALID_BOUND
, 0, 0, NULL
);
230 len
= *(UINT
*)pBuffer
;
231 pBuffer
+= sizeof(UINT
);
232 if (*(UINT
*)pBuffer
!= 0)
233 RaiseException(RPC_S_INVALID_BOUND
, 0, 0, NULL
);
234 pBuffer
+= sizeof(UINT
);
235 if (*(UINT
*)pBuffer
!= len
)
236 RaiseException(RPC_S_INVALID_BOUND
, 0, 0, NULL
);
237 pBuffer
+= sizeof(UINT
);
238 if (((WCHAR
*)pBuffer
)[len
- 1] != '\0')
239 RaiseException(RPC_S_INVALID_BOUND
, 0, 0, NULL
);
240 TRACE("unmarshaling clip format %s\n", debugstr_w((LPCWSTR
)pBuffer
));
241 cf
= RegisterClipboardFormatW((LPCWSTR
)pBuffer
);
242 pBuffer
+= len
* sizeof(WCHAR
);
244 RaiseException(DV_E_CLIPFORMAT
, 0, 0, NULL
);
248 /* code not really appropriate, but nearest I can find */
249 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
253 /******************************************************************************
254 * CLIPFORMAT_UserFree [OLE32.@]
256 * Frees an unmarshaled clip format.
259 * pFlags [I] Flags. See notes.
260 * pCF [I] Clip format to free.
263 * The end of the marshaled data in the buffer.
266 * Even though the function is documented to take a pointer to an unsigned
267 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB
268 * structure, of which the first parameter is an unsigned long.
269 * This function is only intended to be called by the RPC runtime.
271 void __RPC_USER
CLIPFORMAT_UserFree(ULONG
*pFlags
, CLIPFORMAT
*pCF
)
273 /* there is no inverse of the RegisterClipboardFormat function,
274 * so nothing to do */
277 static ULONG
handle_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HANDLE
*handle
)
279 if (LOWORD(*pFlags
) == MSHCTX_DIFFERENTMACHINE
)
281 ERR("can't remote a local handle\n");
282 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
285 return StartingSize
+ sizeof(RemotableHandle
);
288 static unsigned char * handle_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HANDLE
*handle
)
290 RemotableHandle
*remhandle
= (RemotableHandle
*)pBuffer
;
291 if (LOWORD(*pFlags
) == MSHCTX_DIFFERENTMACHINE
)
293 ERR("can't remote a local handle\n");
294 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
297 remhandle
->fContext
= WDT_INPROC_CALL
;
298 remhandle
->u
.hInproc
= (LONG_PTR
)*handle
;
299 return pBuffer
+ sizeof(RemotableHandle
);
302 static unsigned char * handle_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HANDLE
*handle
)
304 RemotableHandle
*remhandle
= (RemotableHandle
*)pBuffer
;
305 if (remhandle
->fContext
!= WDT_INPROC_CALL
)
306 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
307 *handle
= (HANDLE
)(LONG_PTR
)remhandle
->u
.hInproc
;
308 return pBuffer
+ sizeof(RemotableHandle
);
311 static void handle_UserFree(ULONG
*pFlags
, HANDLE
*handle
)
316 #define IMPL_WIREM_HANDLE(type) \
317 ULONG __RPC_USER type##_UserSize(ULONG *pFlags, ULONG StartingSize, type *handle) \
319 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, handle); \
320 return handle_UserSize(pFlags, StartingSize, (HANDLE *)handle); \
323 unsigned char * __RPC_USER type##_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \
325 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *handle); \
326 return handle_UserMarshal(pFlags, pBuffer, (HANDLE *)handle); \
329 unsigned char * __RPC_USER type##_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \
331 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, handle); \
332 return handle_UserUnmarshal(pFlags, pBuffer, (HANDLE *)handle); \
335 void __RPC_USER type##_UserFree(ULONG *pFlags, type *handle) \
337 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *handle); \
338 handle_UserFree(pFlags, (HANDLE *)handle); \
341 IMPL_WIREM_HANDLE(HACCEL
)
342 IMPL_WIREM_HANDLE(HMENU
)
343 IMPL_WIREM_HANDLE(HWND
)
344 IMPL_WIREM_HANDLE(HDC
)
345 IMPL_WIREM_HANDLE(HICON
)
346 IMPL_WIREM_HANDLE(HBRUSH
)
348 /******************************************************************************
349 * HGLOBAL_UserSize [OLE32.@]
351 * Calculates the buffer size required to marshal an HGLOBAL.
354 * pFlags [I] Flags. See notes.
355 * StartingSize [I] Starting size of the buffer. This value is added on to
356 * the buffer size required for the clip format.
357 * phGlobal [I] HGLOBAL to size.
360 * The buffer size required to marshal an HGLOBAL plus the starting size.
363 * Even though the function is documented to take a pointer to a ULONG in
364 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
365 * the first parameter is a ULONG.
366 * This function is only intended to be called by the RPC runtime.
368 ULONG __RPC_USER
HGLOBAL_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HGLOBAL
*phGlobal
)
370 ULONG size
= StartingSize
;
372 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, phGlobal
);
374 ALIGN_LENGTH(size
, 3);
376 size
+= sizeof(ULONG
);
378 if (LOWORD(*pFlags
== MSHCTX_INPROC
))
379 size
+= sizeof(HGLOBAL
);
382 size
+= sizeof(ULONG
);
386 size
+= 3 * sizeof(ULONG
);
387 ret
= GlobalSize(*phGlobal
);
395 /******************************************************************************
396 * HGLOBAL_UserMarshal [OLE32.@]
398 * Marshals an HGLOBAL into a buffer.
401 * pFlags [I] Flags. See notes.
402 * pBuffer [I] Buffer to marshal the clip format into.
403 * phGlobal [I] HGLOBAL to marshal.
406 * The end of the marshaled data in the buffer.
409 * Even though the function is documented to take a pointer to a ULONG in
410 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
411 * the first parameter is a ULONG.
412 * This function is only intended to be called by the RPC runtime.
414 unsigned char * __RPC_USER
HGLOBAL_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HGLOBAL
*phGlobal
)
416 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phGlobal
);
418 ALIGN_POINTER(pBuffer
, 3);
420 if (LOWORD(*pFlags
== MSHCTX_INPROC
))
422 if (sizeof(*phGlobal
) == 8)
423 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
425 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
426 pBuffer
+= sizeof(ULONG
);
427 *(HGLOBAL
*)pBuffer
= *phGlobal
;
428 pBuffer
+= sizeof(HGLOBAL
);
432 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
433 pBuffer
+= sizeof(ULONG
);
434 *(ULONG
*)pBuffer
= HandleToULong(*phGlobal
);
435 pBuffer
+= sizeof(ULONG
);
438 const unsigned char *memory
;
439 SIZE_T size
= GlobalSize(*phGlobal
);
440 *(ULONG
*)pBuffer
= (ULONG
)size
;
441 pBuffer
+= sizeof(ULONG
);
442 *(ULONG
*)pBuffer
= HandleToULong(*phGlobal
);
443 pBuffer
+= sizeof(ULONG
);
444 *(ULONG
*)pBuffer
= (ULONG
)size
;
445 pBuffer
+= sizeof(ULONG
);
447 memory
= GlobalLock(*phGlobal
);
448 memcpy(pBuffer
, memory
, size
);
450 GlobalUnlock(*phGlobal
);
457 /******************************************************************************
458 * HGLOBAL_UserUnmarshal [OLE32.@]
460 * Unmarshals an HGLOBAL from a buffer.
463 * pFlags [I] Flags. See notes.
464 * pBuffer [I] Buffer to marshal the clip format from.
465 * phGlobal [O] Address that receive the unmarshaled HGLOBAL.
468 * The end of the marshaled data in the buffer.
471 * Even though the function is documented to take a pointer to an ULONG in
472 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
473 * the first parameter is an ULONG.
474 * This function is only intended to be called by the RPC runtime.
476 unsigned char * __RPC_USER
HGLOBAL_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HGLOBAL
*phGlobal
)
480 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phGlobal
);
482 ALIGN_POINTER(pBuffer
, 3);
484 fContext
= *(ULONG
*)pBuffer
;
485 pBuffer
+= sizeof(ULONG
);
487 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phGlobal
) < 8)) ||
488 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phGlobal
) == 8)))
490 *phGlobal
= *(HGLOBAL
*)pBuffer
;
491 pBuffer
+= sizeof(*phGlobal
);
493 else if (fContext
== WDT_REMOTE_CALL
)
497 handle
= *(ULONG
*)pBuffer
;
498 pBuffer
+= sizeof(ULONG
);
505 size
= *(ULONG
*)pBuffer
;
506 pBuffer
+= sizeof(ULONG
);
507 /* redundancy is bad - it means you have to check consistency like
509 if (*(ULONG
*)pBuffer
!= handle
)
511 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
514 pBuffer
+= sizeof(ULONG
);
515 /* redundancy is bad - it means you have to check consistency like
517 if (*(ULONG
*)pBuffer
!= size
)
519 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
522 pBuffer
+= sizeof(ULONG
);
524 /* FIXME: check size is not too big */
526 *phGlobal
= GlobalAlloc(GMEM_MOVEABLE
, size
);
527 memory
= GlobalLock(*phGlobal
);
528 memcpy(memory
, pBuffer
, size
);
530 GlobalUnlock(*phGlobal
);
536 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
541 /******************************************************************************
542 * HGLOBAL_UserFree [OLE32.@]
544 * Frees an unmarshaled HGLOBAL.
547 * pFlags [I] Flags. See notes.
548 * phGlobal [I] HGLOBAL to free.
551 * The end of the marshaled data in the buffer.
554 * Even though the function is documented to take a pointer to a ULONG in
555 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
556 * which the first parameter is a ULONG.
557 * This function is only intended to be called by the RPC runtime.
559 void __RPC_USER
HGLOBAL_UserFree(ULONG
*pFlags
, HGLOBAL
*phGlobal
)
561 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phGlobal
);
563 if (LOWORD(*pFlags
!= MSHCTX_INPROC
) && *phGlobal
)
564 GlobalFree(*phGlobal
);
567 /******************************************************************************
568 * HBITMAP_UserSize [OLE32.@]
570 * Calculates the buffer size required to marshal a bitmap.
573 * pFlags [I] Flags. See notes.
574 * StartingSize [I] Starting size of the buffer. This value is added on to
575 * the buffer size required for the clip format.
576 * phBmp [I] Bitmap to size.
579 * The buffer size required to marshal an bitmap plus the starting size.
582 * Even though the function is documented to take a pointer to a ULONG in
583 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
584 * the first parameter is a ULONG.
585 * This function is only intended to be called by the RPC runtime.
587 ULONG __RPC_USER
HBITMAP_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HBITMAP
*phBmp
)
593 /******************************************************************************
594 * HBITMAP_UserMarshal [OLE32.@]
596 * Marshals a bitmap into a buffer.
599 * pFlags [I] Flags. See notes.
600 * pBuffer [I] Buffer to marshal the clip format into.
601 * phBmp [I] Bitmap to marshal.
604 * The end of the marshaled data in the buffer.
607 * Even though the function is documented to take a pointer to a ULONG in
608 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
609 * the first parameter is a ULONG.
610 * This function is only intended to be called by the RPC runtime.
612 unsigned char * __RPC_USER
HBITMAP_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HBITMAP
*phBmp
)
618 /******************************************************************************
619 * HBITMAP_UserUnmarshal [OLE32.@]
621 * Unmarshals a bitmap from a buffer.
624 * pFlags [I] Flags. See notes.
625 * pBuffer [I] Buffer to marshal the clip format from.
626 * phBmp [O] Address that receive the unmarshaled bitmap.
629 * The end of the marshaled data in the buffer.
632 * Even though the function is documented to take a pointer to an ULONG in
633 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
634 * the first parameter is an ULONG.
635 * This function is only intended to be called by the RPC runtime.
637 unsigned char * __RPC_USER
HBITMAP_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HBITMAP
*phBmp
)
643 /******************************************************************************
644 * HBITMAP_UserFree [OLE32.@]
646 * Frees an unmarshaled bitmap.
649 * pFlags [I] Flags. See notes.
650 * phBmp [I] Bitmap to free.
653 * The end of the marshaled data in the buffer.
656 * Even though the function is documented to take a pointer to a ULONG in
657 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
658 * which the first parameter is a ULONG.
659 * This function is only intended to be called by the RPC runtime.
661 void __RPC_USER
HBITMAP_UserFree(ULONG
*pFlags
, HBITMAP
*phBmp
)
666 /******************************************************************************
667 * HPALETTE_UserSize [OLE32.@]
669 * Calculates the buffer size required to marshal a palette.
672 * pFlags [I] Flags. See notes.
673 * StartingSize [I] Starting size of the buffer. This value is added on to
674 * the buffer size required for the clip format.
675 * phPal [I] Palette to size.
678 * The buffer size required to marshal a palette plus the starting size.
681 * Even though the function is documented to take a pointer to a ULONG in
682 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
683 * the first parameter is a ULONG.
684 * This function is only intended to be called by the RPC runtime.
686 ULONG __RPC_USER
HPALETTE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HPALETTE
*phPal
)
692 /******************************************************************************
693 * HPALETTE_UserMarshal [OLE32.@]
695 * Marshals a palette into a buffer.
698 * pFlags [I] Flags. See notes.
699 * pBuffer [I] Buffer to marshal the clip format into.
700 * phPal [I] Palette to marshal.
703 * The end of the marshaled data in the buffer.
706 * Even though the function is documented to take a pointer to a ULONG in
707 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
708 * the first parameter is a ULONG.
709 * This function is only intended to be called by the RPC runtime.
711 unsigned char * __RPC_USER
HPALETTE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HPALETTE
*phPal
)
717 /******************************************************************************
718 * HPALETTE_UserUnmarshal [OLE32.@]
720 * Unmarshals a palette from a buffer.
723 * pFlags [I] Flags. See notes.
724 * pBuffer [I] Buffer to marshal the clip format from.
725 * phPal [O] Address that receive the unmarshaled palette.
728 * The end of the marshaled data in the buffer.
731 * Even though the function is documented to take a pointer to an ULONG in
732 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
733 * the first parameter is an ULONG.
734 * This function is only intended to be called by the RPC runtime.
736 unsigned char * __RPC_USER
HPALETTE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HPALETTE
*phPal
)
742 /******************************************************************************
743 * HPALETTE_UserFree [OLE32.@]
745 * Frees an unmarshaled palette.
748 * pFlags [I] Flags. See notes.
749 * phPal [I] Palette to free.
752 * The end of the marshaled data in the buffer.
755 * Even though the function is documented to take a pointer to a ULONG in
756 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
757 * which the first parameter is a ULONG.
758 * This function is only intended to be called by the RPC runtime.
760 void __RPC_USER
HPALETTE_UserFree(ULONG
*pFlags
, HPALETTE
*phPal
)
766 /******************************************************************************
767 * HMETAFILE_UserSize [OLE32.@]
769 * Calculates the buffer size required to marshal a metafile.
772 * pFlags [I] Flags. See notes.
773 * StartingSize [I] Starting size of the buffer. This value is added on to
774 * the buffer size required for the clip format.
775 * phmf [I] Metafile to size.
778 * The buffer size required to marshal a metafile plus the starting size.
781 * Even though the function is documented to take a pointer to a ULONG in
782 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
783 * the first parameter is a ULONG.
784 * This function is only intended to be called by the RPC runtime.
786 ULONG __RPC_USER
HMETAFILE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HMETAFILE
*phmf
)
788 ULONG size
= StartingSize
;
790 TRACE("(%s, %d, &%p\n", debugstr_user_flags(pFlags
), StartingSize
, *phmf
);
792 ALIGN_LENGTH(size
, 3);
794 size
+= sizeof(ULONG
);
795 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
796 size
+= sizeof(ULONG_PTR
);
799 size
+= sizeof(ULONG
);
805 size
+= 2 * sizeof(ULONG
);
806 mfsize
= GetMetaFileBitsEx(*phmf
, 0, NULL
);
814 /******************************************************************************
815 * HMETAFILE_UserMarshal [OLE32.@]
817 * Marshals a metafile into a buffer.
820 * pFlags [I] Flags. See notes.
821 * pBuffer [I] Buffer to marshal the clip format into.
822 * phEmf [I] Metafile to marshal.
825 * The end of the marshaled data in the buffer.
828 * Even though the function is documented to take a pointer to a ULONG in
829 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
830 * the first parameter is a ULONG.
831 * This function is only intended to be called by the RPC runtime.
833 unsigned char * __RPC_USER
HMETAFILE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILE
*phmf
)
835 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phmf
);
837 ALIGN_POINTER(pBuffer
, 3);
839 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
841 if (sizeof(*phmf
) == 8)
842 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
844 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
845 pBuffer
+= sizeof(ULONG
);
846 *(HMETAFILE
*)pBuffer
= *phmf
;
847 pBuffer
+= sizeof(HMETAFILE
);
851 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
852 pBuffer
+= sizeof(ULONG
);
853 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phmf
;
854 pBuffer
+= sizeof(ULONG
);
858 UINT mfsize
= GetMetaFileBitsEx(*phmf
, 0, NULL
);
860 *(ULONG
*)pBuffer
= mfsize
;
861 pBuffer
+= sizeof(ULONG
);
862 *(ULONG
*)pBuffer
= mfsize
;
863 pBuffer
+= sizeof(ULONG
);
864 GetMetaFileBitsEx(*phmf
, mfsize
, pBuffer
);
872 /******************************************************************************
873 * HMETAFILE_UserUnmarshal [OLE32.@]
875 * Unmarshals a metafile from a buffer.
878 * pFlags [I] Flags. See notes.
879 * pBuffer [I] Buffer to marshal the clip format from.
880 * phmf [O] Address that receive the unmarshaled metafile.
883 * The end of the marshaled data in the buffer.
886 * Even though the function is documented to take a pointer to an ULONG in
887 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
888 * the first parameter is an ULONG.
889 * This function is only intended to be called by the RPC runtime.
891 unsigned char * __RPC_USER
HMETAFILE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILE
*phmf
)
895 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, phmf
);
897 ALIGN_POINTER(pBuffer
, 3);
899 fContext
= *(ULONG
*)pBuffer
;
900 pBuffer
+= sizeof(ULONG
);
902 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phmf
) < 8)) ||
903 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phmf
) == 8)))
905 *phmf
= *(HMETAFILE
*)pBuffer
;
906 pBuffer
+= sizeof(*phmf
);
908 else if (fContext
== WDT_REMOTE_CALL
)
912 handle
= *(ULONG
*)pBuffer
;
913 pBuffer
+= sizeof(ULONG
);
918 size
= *(ULONG
*)pBuffer
;
919 pBuffer
+= sizeof(ULONG
);
920 if (size
!= *(ULONG
*)pBuffer
)
922 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
925 pBuffer
+= sizeof(ULONG
);
926 *phmf
= SetMetaFileBitsEx(size
, pBuffer
);
933 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
938 /******************************************************************************
939 * HMETAFILE_UserFree [OLE32.@]
941 * Frees an unmarshaled metafile.
944 * pFlags [I] Flags. See notes.
945 * phmf [I] Metafile to free.
948 * The end of the marshaled data in the buffer.
951 * Even though the function is documented to take a pointer to a ULONG in
952 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
953 * which the first parameter is a ULONG.
954 * This function is only intended to be called by the RPC runtime.
956 void __RPC_USER
HMETAFILE_UserFree(ULONG
*pFlags
, HMETAFILE
*phmf
)
958 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phmf
);
960 if (LOWORD(*pFlags
) != MSHCTX_INPROC
)
961 DeleteMetaFile(*phmf
);
964 /******************************************************************************
965 * HENHMETAFILE_UserSize [OLE32.@]
967 * Calculates the buffer size required to marshal an enhanced metafile.
970 * pFlags [I] Flags. See notes.
971 * StartingSize [I] Starting size of the buffer. This value is added on to
972 * the buffer size required for the clip format.
973 * phEmf [I] Enhanced metafile to size.
976 * The buffer size required to marshal an enhanced metafile plus the starting size.
979 * Even though the function is documented to take a pointer to a ULONG in
980 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
981 * the first parameter is a ULONG.
982 * This function is only intended to be called by the RPC runtime.
984 ULONG __RPC_USER
HENHMETAFILE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HENHMETAFILE
*phEmf
)
986 ULONG size
= StartingSize
;
988 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, *phEmf
);
990 size
+= sizeof(ULONG
);
991 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
992 size
+= sizeof(ULONG_PTR
);
995 size
+= sizeof(ULONG
);
1001 size
+= 2 * sizeof(ULONG
);
1002 emfsize
= GetEnhMetaFileBits(*phEmf
, 0, NULL
);
1010 /******************************************************************************
1011 * HENHMETAFILE_UserMarshal [OLE32.@]
1013 * Marshals an enhance metafile into a buffer.
1016 * pFlags [I] Flags. See notes.
1017 * pBuffer [I] Buffer to marshal the clip format into.
1018 * phEmf [I] Enhanced metafile to marshal.
1021 * The end of the marshaled data in the buffer.
1024 * Even though the function is documented to take a pointer to a ULONG in
1025 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1026 * the first parameter is a ULONG.
1027 * This function is only intended to be called by the RPC runtime.
1029 unsigned char * __RPC_USER
HENHMETAFILE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HENHMETAFILE
*phEmf
)
1031 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phEmf
);
1033 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1035 if (sizeof(*phEmf
) == 8)
1036 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
1038 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
1039 pBuffer
+= sizeof(ULONG
);
1040 *(HENHMETAFILE
*)pBuffer
= *phEmf
;
1041 pBuffer
+= sizeof(HENHMETAFILE
);
1045 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
1046 pBuffer
+= sizeof(ULONG
);
1047 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phEmf
;
1048 pBuffer
+= sizeof(ULONG
);
1052 UINT emfsize
= GetEnhMetaFileBits(*phEmf
, 0, NULL
);
1054 *(ULONG
*)pBuffer
= emfsize
;
1055 pBuffer
+= sizeof(ULONG
);
1056 *(ULONG
*)pBuffer
= emfsize
;
1057 pBuffer
+= sizeof(ULONG
);
1058 GetEnhMetaFileBits(*phEmf
, emfsize
, pBuffer
);
1066 /******************************************************************************
1067 * HENHMETAFILE_UserUnmarshal [OLE32.@]
1069 * Unmarshals an enhanced metafile from a buffer.
1072 * pFlags [I] Flags. See notes.
1073 * pBuffer [I] Buffer to marshal the clip format from.
1074 * phEmf [O] Address that receive the unmarshaled enhanced metafile.
1077 * The end of the marshaled data in the buffer.
1080 * Even though the function is documented to take a pointer to an ULONG in
1081 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1082 * the first parameter is an ULONG.
1083 * This function is only intended to be called by the RPC runtime.
1085 unsigned char * __RPC_USER
HENHMETAFILE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HENHMETAFILE
*phEmf
)
1089 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, phEmf
);
1091 fContext
= *(ULONG
*)pBuffer
;
1092 pBuffer
+= sizeof(ULONG
);
1094 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phEmf
) < 8)) ||
1095 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phEmf
) == 8)))
1097 *phEmf
= *(HENHMETAFILE
*)pBuffer
;
1098 pBuffer
+= sizeof(*phEmf
);
1100 else if (fContext
== WDT_REMOTE_CALL
)
1104 handle
= *(ULONG
*)pBuffer
;
1105 pBuffer
+= sizeof(ULONG
);
1110 size
= *(ULONG
*)pBuffer
;
1111 pBuffer
+= sizeof(ULONG
);
1112 if (size
!= *(ULONG
*)pBuffer
)
1114 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1117 pBuffer
+= sizeof(ULONG
);
1118 *phEmf
= SetEnhMetaFileBits(size
, pBuffer
);
1125 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
1130 /******************************************************************************
1131 * HENHMETAFILE_UserFree [OLE32.@]
1133 * Frees an unmarshaled enhanced metafile.
1136 * pFlags [I] Flags. See notes.
1137 * phEmf [I] Enhanced metafile to free.
1140 * The end of the marshaled data in the buffer.
1143 * Even though the function is documented to take a pointer to a ULONG in
1144 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1145 * which the first parameter is a ULONG.
1146 * This function is only intended to be called by the RPC runtime.
1148 void __RPC_USER
HENHMETAFILE_UserFree(ULONG
*pFlags
, HENHMETAFILE
*phEmf
)
1150 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phEmf
);
1152 if (LOWORD(*pFlags
) != MSHCTX_INPROC
)
1153 DeleteEnhMetaFile(*phEmf
);
1156 /******************************************************************************
1157 * HMETAFILEPICT_UserSize [OLE32.@]
1159 * Calculates the buffer size required to marshal an metafile pict.
1162 * pFlags [I] Flags. See notes.
1163 * StartingSize [I] Starting size of the buffer. This value is added on to
1164 * the buffer size required for the clip format.
1165 * phMfp [I] Metafile pict to size.
1168 * The buffer size required to marshal a metafile pict plus the starting size.
1171 * Even though the function is documented to take a pointer to a ULONG in
1172 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1173 * the first parameter is a ULONG.
1174 * This function is only intended to be called by the RPC runtime.
1176 ULONG __RPC_USER
HMETAFILEPICT_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HMETAFILEPICT
*phMfp
)
1178 ULONG size
= StartingSize
;
1180 TRACE("(%s, %d, &%p)\n", debugstr_user_flags(pFlags
), StartingSize
, *phMfp
);
1182 size
+= sizeof(ULONG
);
1184 if(LOWORD(*pFlags
) == MSHCTX_INPROC
)
1185 size
+= sizeof(HMETAFILEPICT
);
1188 size
+= sizeof(ULONG
);
1192 METAFILEPICT
*mfpict
= GlobalLock(*phMfp
);
1194 /* FIXME: raise an exception if mfpict is NULL? */
1195 size
+= 3 * sizeof(ULONG
);
1196 size
+= sizeof(ULONG
);
1198 size
= HMETAFILE_UserSize(pFlags
, size
, &mfpict
->hMF
);
1200 GlobalUnlock(*phMfp
);
1207 /******************************************************************************
1208 * HMETAFILEPICT_UserMarshal [OLE32.@]
1210 * Marshals a metafile pict into a buffer.
1213 * pFlags [I] Flags. See notes.
1214 * pBuffer [I] Buffer to marshal the clip format into.
1215 * phMfp [I] Metafile pict to marshal.
1218 * The end of the marshaled data in the buffer.
1221 * Even though the function is documented to take a pointer to a ULONG in
1222 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1223 * the first parameter is a ULONG.
1224 * This function is only intended to be called by the RPC runtime.
1226 unsigned char * __RPC_USER
HMETAFILEPICT_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILEPICT
*phMfp
)
1228 TRACE("(%s, %p, &%p)\n", debugstr_user_flags(pFlags
), pBuffer
, *phMfp
);
1230 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1232 if (sizeof(HMETAFILEPICT
) == 8)
1233 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
1235 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
1236 pBuffer
+= sizeof(ULONG
);
1237 *(HMETAFILEPICT
*)pBuffer
= *phMfp
;
1238 pBuffer
+= sizeof(HMETAFILEPICT
);
1242 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
1243 pBuffer
+= sizeof(ULONG
);
1244 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phMfp
;
1245 pBuffer
+= sizeof(ULONG
);
1249 METAFILEPICT
*mfpict
= GlobalLock(*phMfp
);
1250 remoteMETAFILEPICT
* remmfpict
= (remoteMETAFILEPICT
*)pBuffer
;
1252 /* FIXME: raise an exception if mfpict is NULL? */
1253 remmfpict
->mm
= mfpict
->mm
;
1254 remmfpict
->xExt
= mfpict
->xExt
;
1255 remmfpict
->yExt
= mfpict
->yExt
;
1256 pBuffer
+= 3 * sizeof(ULONG
);
1257 *(ULONG
*)pBuffer
= USER_MARSHAL_PTR_PREFIX
;
1258 pBuffer
+= sizeof(ULONG
);
1260 pBuffer
= HMETAFILE_UserMarshal(pFlags
, pBuffer
, &mfpict
->hMF
);
1262 GlobalUnlock(*phMfp
);
1268 /******************************************************************************
1269 * HMETAFILEPICT_UserUnmarshal [OLE32.@]
1271 * Unmarshals an metafile pict from a buffer.
1274 * pFlags [I] Flags. See notes.
1275 * pBuffer [I] Buffer to marshal the clip format from.
1276 * phMfp [O] Address that receive the unmarshaled metafile pict.
1279 * The end of the marshaled data in the buffer.
1282 * Even though the function is documented to take a pointer to an ULONG in
1283 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1284 * the first parameter is an ULONG.
1285 * This function is only intended to be called by the RPC runtime.
1287 unsigned char * __RPC_USER
HMETAFILEPICT_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILEPICT
*phMfp
)
1291 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, phMfp
);
1293 fContext
= *(ULONG
*)pBuffer
;
1294 pBuffer
+= sizeof(ULONG
);
1296 if ((fContext
== WDT_INPROC_CALL
) || fContext
== WDT_INPROC64_CALL
)
1298 *phMfp
= *(HMETAFILEPICT
*)pBuffer
;
1299 pBuffer
+= sizeof(HMETAFILEPICT
);
1303 ULONG handle
= *(ULONG
*)pBuffer
;
1304 pBuffer
+= sizeof(ULONG
);
1309 METAFILEPICT
*mfpict
;
1310 const remoteMETAFILEPICT
*remmfpict
;
1311 ULONG user_marshal_prefix
;
1313 remmfpict
= (const remoteMETAFILEPICT
*)pBuffer
;
1315 *phMfp
= GlobalAlloc(GMEM_MOVEABLE
, sizeof(METAFILEPICT
));
1317 RpcRaiseException(E_OUTOFMEMORY
);
1319 mfpict
= GlobalLock(*phMfp
);
1320 mfpict
->mm
= remmfpict
->mm
;
1321 mfpict
->xExt
= remmfpict
->xExt
;
1322 mfpict
->yExt
= remmfpict
->yExt
;
1323 pBuffer
+= 3 * sizeof(ULONG
);
1324 user_marshal_prefix
= *(ULONG
*)pBuffer
;
1325 pBuffer
+= sizeof(ULONG
);
1327 if (user_marshal_prefix
!= USER_MARSHAL_PTR_PREFIX
)
1328 RpcRaiseException(RPC_X_INVALID_TAG
);
1330 pBuffer
= HMETAFILE_UserUnmarshal(pFlags
, pBuffer
, &mfpict
->hMF
);
1332 GlobalUnlock(*phMfp
);
1338 /******************************************************************************
1339 * HMETAFILEPICT_UserFree [OLE32.@]
1341 * Frees an unmarshaled metafile pict.
1344 * pFlags [I] Flags. See notes.
1345 * phMfp [I] Metafile pict to free.
1348 * The end of the marshaled data in the buffer.
1351 * Even though the function is documented to take a pointer to a ULONG in
1352 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1353 * which the first parameter is a ULONG.
1354 * This function is only intended to be called by the RPC runtime.
1356 void __RPC_USER
HMETAFILEPICT_UserFree(ULONG
*pFlags
, HMETAFILEPICT
*phMfp
)
1358 TRACE("(%s, &%p)\n", debugstr_user_flags(pFlags
), *phMfp
);
1360 if ((LOWORD(*pFlags
) != MSHCTX_INPROC
) && *phMfp
)
1362 METAFILEPICT
*mfpict
;
1364 mfpict
= GlobalLock(*phMfp
);
1365 /* FIXME: raise an exception if mfpict is NULL? */
1366 HMETAFILE_UserFree(pFlags
, &mfpict
->hMF
);
1367 GlobalUnlock(*phMfp
);
1373 /******************************************************************************
1374 * WdtpInterfacePointer_UserSize [OLE32.@]
1376 * Calculates the buffer size required to marshal an interface pointer.
1379 * pFlags [I] Flags. See notes.
1380 * RealFlags [I] The MSHCTX to use when marshaling the interface.
1381 * punk [I] Interface pointer to size.
1382 * StartingSize [I] Starting size of the buffer. This value is added on to
1383 * the buffer size required for the clip format.
1384 * riid [I] ID of interface to size.
1387 * The buffer size required to marshal an interface pointer plus the starting size.
1390 * Even though the function is documented to take a pointer to a ULONG in
1391 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1392 * the first parameter is a ULONG.
1394 ULONG __RPC_USER
WdtpInterfacePointer_UserSize(ULONG
*pFlags
, ULONG RealFlags
, ULONG StartingSize
, IUnknown
*punk
, REFIID riid
)
1396 DWORD marshal_size
= 0;
1399 TRACE("(%s, 0%x, %d, %p, %s)\n", debugstr_user_flags(pFlags
), RealFlags
, StartingSize
, punk
, debugstr_guid(riid
));
1401 hr
= CoGetMarshalSizeMax(&marshal_size
, riid
, punk
, LOWORD(RealFlags
), NULL
, MSHLFLAGS_NORMAL
);
1402 if(FAILED(hr
)) return StartingSize
;
1404 ALIGN_LENGTH(StartingSize
, 3);
1405 StartingSize
+= 2 * sizeof(DWORD
);
1406 return StartingSize
+ marshal_size
;
1409 /******************************************************************************
1410 * WdtpInterfacePointer_UserMarshal [OLE32.@]
1412 * Marshals an interface pointer into a buffer.
1415 * pFlags [I] Flags. See notes.
1416 * RealFlags [I] The MSHCTX to use when marshaling the interface.
1417 * pBuffer [I] Buffer to marshal the clip format into.
1418 * punk [I] Interface pointer to marshal.
1419 * riid [I] ID of interface to marshal.
1422 * The end of the marshaled data in the buffer.
1425 * Even though the function is documented to take a pointer to a ULONG in
1426 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1427 * the first parameter is a ULONG.
1429 unsigned char * WINAPI
WdtpInterfacePointer_UserMarshal(ULONG
*pFlags
, ULONG RealFlags
, unsigned char *pBuffer
, IUnknown
*punk
, REFIID riid
)
1431 HGLOBAL h
= GlobalAlloc(GMEM_MOVEABLE
, 0);
1436 TRACE("(%s, 0x%x, %p, &%p, %s)\n", debugstr_user_flags(pFlags
), RealFlags
, pBuffer
, punk
, debugstr_guid(riid
));
1439 if(CreateStreamOnHGlobal(h
, TRUE
, &stm
) != S_OK
)
1445 if(CoMarshalInterface(stm
, riid
, punk
, LOWORD(RealFlags
), NULL
, MSHLFLAGS_NORMAL
) != S_OK
)
1447 IStream_Release(stm
);
1451 ALIGN_POINTER(pBuffer
, 3);
1452 size
= GlobalSize(h
);
1454 *(DWORD
*)pBuffer
= size
;
1455 pBuffer
+= sizeof(DWORD
);
1456 *(DWORD
*)pBuffer
= size
;
1457 pBuffer
+= sizeof(DWORD
);
1459 ptr
= GlobalLock(h
);
1460 memcpy(pBuffer
, ptr
, size
);
1463 IStream_Release(stm
);
1464 return pBuffer
+ size
;
1467 /******************************************************************************
1468 * WdtpInterfacePointer_UserUnmarshal [OLE32.@]
1470 * Unmarshals an interface pointer from a buffer.
1473 * pFlags [I] Flags. See notes.
1474 * pBuffer [I] Buffer to marshal the clip format from.
1475 * ppunk [I/O] Address that receives the unmarshaled interface pointer.
1476 * riid [I] ID of interface to unmarshal.
1479 * The end of the marshaled data in the buffer.
1482 * Even though the function is documented to take a pointer to an ULONG in
1483 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1484 * the first parameter is an ULONG.
1486 unsigned char * WINAPI
WdtpInterfacePointer_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, IUnknown
**ppunk
, REFIID riid
)
1495 TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags
), pBuffer
, ppunk
, debugstr_guid(riid
));
1497 ALIGN_POINTER(pBuffer
, 3);
1499 size
= *(DWORD
*)pBuffer
;
1500 pBuffer
+= sizeof(DWORD
);
1501 if(size
!= *(DWORD
*)pBuffer
)
1502 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1504 pBuffer
+= sizeof(DWORD
);
1506 /* FIXME: sanity check on size */
1508 h
= GlobalAlloc(GMEM_MOVEABLE
, size
);
1509 if(!h
) RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1511 if(CreateStreamOnHGlobal(h
, TRUE
, &stm
) != S_OK
)
1514 RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1517 ptr
= GlobalLock(h
);
1518 memcpy(ptr
, pBuffer
, size
);
1522 hr
= CoUnmarshalInterface(stm
, riid
, (void**)ppunk
);
1523 IStream_Release(stm
);
1525 if(hr
!= S_OK
) RaiseException(hr
, 0, 0, NULL
);
1527 if(orig
) IUnknown_Release(orig
);
1529 return pBuffer
+ size
;
1532 /******************************************************************************
1533 * WdtpInterfacePointer_UserFree [OLE32.@]
1535 * Releases an unmarshaled interface pointer.
1538 * punk [I] Interface pointer to release.
1543 void WINAPI
WdtpInterfacePointer_UserFree(IUnknown
*punk
)
1545 TRACE("(%p)\n", punk
);
1546 if(punk
) IUnknown_Release(punk
);
1549 /******************************************************************************
1550 * STGMEDIUM_UserSize [OLE32.@]
1552 * Calculates the buffer size required to marshal an STGMEDIUM.
1555 * pFlags [I] Flags. See notes.
1556 * StartingSize [I] Starting size of the buffer. This value is added on to
1557 * the buffer size required for the clip format.
1558 * pStgMedium [I] STGMEDIUM to size.
1561 * The buffer size required to marshal an STGMEDIUM plus the starting size.
1564 * Even though the function is documented to take a pointer to a ULONG in
1565 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1566 * the first parameter is a ULONG.
1567 * This function is only intended to be called by the RPC runtime.
1569 ULONG __RPC_USER
STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, STGMEDIUM
*pStgMedium
)
1571 ULONG size
= StartingSize
;
1573 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pStgMedium
);
1575 ALIGN_LENGTH(size
, 3);
1577 size
+= 2 * sizeof(DWORD
);
1578 if (pStgMedium
->tymed
!= TYMED_NULL
)
1579 size
+= sizeof(DWORD
);
1581 switch (pStgMedium
->tymed
)
1584 TRACE("TYMED_NULL\n");
1587 TRACE("TYMED_HGLOBAL\n");
1588 if (pStgMedium
->u
.hGlobal
)
1589 size
= HGLOBAL_UserSize(pFlags
, size
, &pStgMedium
->u
.hGlobal
);
1592 TRACE("TYMED_FILE\n");
1593 if (pStgMedium
->u
.lpszFileName
)
1595 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1596 size
+= 3 * sizeof(DWORD
) +
1597 (strlenW(pStgMedium
->u
.lpszFileName
) + 1) * sizeof(WCHAR
);
1601 TRACE("TYMED_ISTREAM\n");
1602 if (pStgMedium
->u
.pstm
)
1605 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1606 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStream
);
1607 IUnknown_Release(unk
);
1610 case TYMED_ISTORAGE
:
1611 TRACE("TYMED_ISTORAGE\n");
1612 if (pStgMedium
->u
.pstg
)
1615 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1616 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStorage
);
1617 IUnknown_Release(unk
);
1621 TRACE("TYMED_GDI\n");
1622 if (pStgMedium
->u
.hBitmap
)
1624 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1628 TRACE("TYMED_MFPICT\n");
1629 if (pStgMedium
->u
.hMetaFilePict
)
1630 size
= HMETAFILEPICT_UserSize(pFlags
, size
, &pStgMedium
->u
.hMetaFilePict
);
1633 TRACE("TYMED_ENHMF\n");
1634 if (pStgMedium
->u
.hEnhMetaFile
)
1635 size
= HENHMETAFILE_UserSize(pFlags
, size
, &pStgMedium
->u
.hEnhMetaFile
);
1638 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1641 if (pStgMedium
->pUnkForRelease
)
1642 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1647 /******************************************************************************
1648 * STGMEDIUM_UserMarshal [OLE32.@]
1650 * Marshals a STGMEDIUM into a buffer.
1653 * pFlags [I] Flags. See notes.
1654 * pBuffer [I] Buffer to marshal the clip format into.
1655 * pCF [I] STGMEDIUM to marshal.
1658 * The end of the marshaled data in the buffer.
1661 * Even though the function is documented to take a pointer to a ULONG in
1662 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1663 * the first parameter is a ULONG.
1664 * This function is only intended to be called by the RPC runtime.
1666 unsigned char * __RPC_USER
STGMEDIUM_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1668 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1670 ALIGN_POINTER(pBuffer
, 3);
1672 *(DWORD
*)pBuffer
= pStgMedium
->tymed
;
1673 pBuffer
+= sizeof(DWORD
);
1674 if (pStgMedium
->tymed
!= TYMED_NULL
)
1676 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->u
.pstg
;
1677 pBuffer
+= sizeof(DWORD
);
1679 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->pUnkForRelease
;
1680 pBuffer
+= sizeof(DWORD
);
1682 switch (pStgMedium
->tymed
)
1685 TRACE("TYMED_NULL\n");
1688 TRACE("TYMED_HGLOBAL\n");
1689 if (pStgMedium
->u
.hGlobal
)
1690 pBuffer
= HGLOBAL_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1693 TRACE("TYMED_FILE\n");
1694 if (pStgMedium
->u
.lpszFileName
)
1697 len
= strlenW(pStgMedium
->u
.lpszFileName
);
1699 *(DWORD
*)pBuffer
= len
+ 1;
1700 pBuffer
+= sizeof(DWORD
);
1702 *(DWORD
*)pBuffer
= 0;
1703 pBuffer
+= sizeof(DWORD
);
1705 *(DWORD
*)pBuffer
= len
+ 1;
1706 pBuffer
+= sizeof(DWORD
);
1708 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1709 memcpy(pBuffer
, pStgMedium
->u
.lpszFileName
, (len
+ 1) * sizeof(WCHAR
));
1713 TRACE("TYMED_ISTREAM\n");
1714 if (pStgMedium
->u
.pstm
)
1717 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1718 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStream
);
1719 IUnknown_Release(unk
);
1722 case TYMED_ISTORAGE
:
1723 TRACE("TYMED_ISTORAGE\n");
1724 if (pStgMedium
->u
.pstg
)
1727 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1728 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStorage
);
1729 IUnknown_Release(unk
);
1733 TRACE("TYMED_GDI\n");
1734 if (pStgMedium
->u
.hBitmap
)
1736 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1740 TRACE("TYMED_MFPICT\n");
1741 if (pStgMedium
->u
.hMetaFilePict
)
1742 pBuffer
= HMETAFILEPICT_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
1745 TRACE("TYMED_ENHMF\n");
1746 if (pStgMedium
->u
.hEnhMetaFile
)
1747 pBuffer
= HENHMETAFILE_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
1750 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1753 if (pStgMedium
->pUnkForRelease
)
1754 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1759 /******************************************************************************
1760 * STGMEDIUM_UserUnmarshal [OLE32.@]
1762 * Unmarshals a STGMEDIUM from a buffer.
1765 * pFlags [I] Flags. See notes.
1766 * pBuffer [I] Buffer to marshal the clip format from.
1767 * pStgMedium [O] Address that receive the unmarshaled STGMEDIUM.
1770 * The end of the marshaled data in the buffer.
1773 * Even though the function is documented to take a pointer to an ULONG in
1774 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1775 * the first parameter is an ULONG.
1776 * This function is only intended to be called by the RPC runtime.
1778 unsigned char * __RPC_USER
STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1783 ALIGN_POINTER(pBuffer
, 3);
1785 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1787 pStgMedium
->tymed
= *(DWORD
*)pBuffer
;
1788 pBuffer
+= sizeof(DWORD
);
1789 if (pStgMedium
->tymed
!= TYMED_NULL
)
1791 content
= *(DWORD
*)pBuffer
;
1792 pBuffer
+= sizeof(DWORD
);
1794 releaseunk
= *(DWORD
*)pBuffer
;
1795 pBuffer
+= sizeof(DWORD
);
1797 switch (pStgMedium
->tymed
)
1800 TRACE("TYMED_NULL\n");
1803 TRACE("TYMED_HGLOBAL\n");
1805 pBuffer
= HGLOBAL_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1808 TRACE("TYMED_FILE\n");
1813 conformance
= *(DWORD
*)pBuffer
;
1814 pBuffer
+= sizeof(DWORD
);
1815 if (*(DWORD
*)pBuffer
!= 0)
1817 ERR("invalid offset %d\n", *(DWORD
*)pBuffer
);
1818 RpcRaiseException(RPC_S_INVALID_BOUND
);
1821 pBuffer
+= sizeof(DWORD
);
1822 variance
= *(DWORD
*)pBuffer
;
1823 pBuffer
+= sizeof(DWORD
);
1824 if (conformance
!= variance
)
1826 ERR("conformance (%d) and variance (%d) should be equal\n",
1827 conformance
, variance
);
1828 RpcRaiseException(RPC_S_INVALID_BOUND
);
1831 if (conformance
> 0x7fffffff)
1833 ERR("conformance 0x%x too large\n", conformance
);
1834 RpcRaiseException(RPC_S_INVALID_BOUND
);
1837 pStgMedium
->u
.lpszFileName
= CoTaskMemAlloc(conformance
* sizeof(WCHAR
));
1838 if (!pStgMedium
->u
.lpszFileName
) RpcRaiseException(ERROR_OUTOFMEMORY
);
1839 TRACE("unmarshalled file name is %s\n", debugstr_wn((const WCHAR
*)pBuffer
, variance
));
1840 memcpy(pStgMedium
->u
.lpszFileName
, pBuffer
, variance
* sizeof(WCHAR
));
1841 pBuffer
+= variance
* sizeof(WCHAR
);
1844 pStgMedium
->u
.lpszFileName
= NULL
;
1847 TRACE("TYMED_ISTREAM\n");
1850 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstm
, &IID_IStream
);
1854 if (pStgMedium
->u
.pstm
) IStream_Release( pStgMedium
->u
.pstm
);
1855 pStgMedium
->u
.pstm
= NULL
;
1858 case TYMED_ISTORAGE
:
1859 TRACE("TYMED_ISTORAGE\n");
1862 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstg
, &IID_IStorage
);
1866 if (pStgMedium
->u
.pstg
) IStorage_Release( pStgMedium
->u
.pstg
);
1867 pStgMedium
->u
.pstg
= NULL
;
1871 TRACE("TYMED_GDI\n");
1874 FIXME("not implemented for GDI object\n");
1877 pStgMedium
->u
.hBitmap
= NULL
;
1880 TRACE("TYMED_MFPICT\n");
1882 pBuffer
= HMETAFILEPICT_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
1884 pStgMedium
->u
.hMetaFilePict
= NULL
;
1887 TRACE("TYMED_ENHMF\n");
1889 pBuffer
= HENHMETAFILE_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
1891 pStgMedium
->u
.hEnhMetaFile
= NULL
;
1894 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1898 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1899 /* Unlike the IStream / IStorage ifaces, the existing pUnkForRelease
1900 is left intact if a NULL ptr is unmarshalled - see the tests. */
1905 /******************************************************************************
1906 * STGMEDIUM_UserFree [OLE32.@]
1908 * Frees an unmarshaled STGMEDIUM.
1911 * pFlags [I] Flags. See notes.
1912 * pStgmedium [I] STGMEDIUM to free.
1915 * The end of the marshaled data in the buffer.
1918 * Even though the function is documented to take a pointer to a ULONG in
1919 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1920 * which the first parameter is a ULONG.
1921 * This function is only intended to be called by the RPC runtime.
1923 void __RPC_USER
STGMEDIUM_UserFree(ULONG
*pFlags
, STGMEDIUM
*pStgMedium
)
1925 TRACE("(%s, %p\n", debugstr_user_flags(pFlags
), pStgMedium
);
1927 ReleaseStgMedium(pStgMedium
);
1930 ULONG __RPC_USER
ASYNC_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, ASYNC_STGMEDIUM
*pStgMedium
)
1933 return STGMEDIUM_UserSize(pFlags
, StartingSize
, pStgMedium
);
1936 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
1939 return STGMEDIUM_UserMarshal(pFlags
, pBuffer
, pStgMedium
);
1942 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
1945 return STGMEDIUM_UserUnmarshal(pFlags
, pBuffer
, pStgMedium
);
1948 void __RPC_USER
ASYNC_STGMEDIUM_UserFree(ULONG
*pFlags
, ASYNC_STGMEDIUM
*pStgMedium
)
1951 STGMEDIUM_UserFree(pFlags
, pStgMedium
);
1954 ULONG __RPC_USER
FLAG_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, FLAG_STGMEDIUM
*pStgMedium
)
1957 return StartingSize
;
1960 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
1966 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
1972 void __RPC_USER
FLAG_STGMEDIUM_UserFree(ULONG
*pFlags
, FLAG_STGMEDIUM
*pStgMedium
)
1977 ULONG __RPC_USER
SNB_UserSize(ULONG
*pFlags
, ULONG StartingSize
, SNB
*pSnb
)
1979 ULONG size
= StartingSize
;
1981 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pSnb
);
1983 ALIGN_LENGTH(size
, 3);
1985 /* two counters from RemSNB header, plus one more ULONG */
1986 size
+= 3*sizeof(ULONG
);
1988 /* now actual data length */
1991 WCHAR
**ptrW
= *pSnb
;
1995 size
+= (strlenW(*ptrW
) + 1)*sizeof(WCHAR
);
2010 unsigned char * __RPC_USER
SNB_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2012 struct SNB_wire
*wire
;
2015 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2017 ALIGN_POINTER(pBuffer
, 3);
2019 wire
= (struct SNB_wire
*)pBuffer
;
2020 wire
->charcnt
= wire
->strcnt
= 0;
2021 size
= 3*sizeof(ULONG
);
2025 WCHAR
**ptrW
= *pSnb
;
2026 WCHAR
*dataW
= wire
->data
;
2030 ULONG len
= strlenW(*ptrW
) + 1;
2033 wire
->charcnt
+= len
;
2034 memcpy(dataW
, *ptrW
, len
*sizeof(WCHAR
));
2037 size
+= len
*sizeof(WCHAR
);
2042 wire
->datalen
= wire
->charcnt
;
2043 return pBuffer
+ size
;
2046 unsigned char * __RPC_USER
SNB_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2048 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2049 struct SNB_wire
*wire
;
2051 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2053 wire
= (struct SNB_wire
*)pBuffer
;
2056 umcb
->pStubMsg
->pfnFree(*pSnb
);
2058 if (wire
->datalen
== 0)
2062 WCHAR
*src
= wire
->data
, *dest
;
2066 ptrW
= *pSnb
= umcb
->pStubMsg
->pfnAllocate((wire
->strcnt
+1)*sizeof(WCHAR
*) + wire
->datalen
*sizeof(WCHAR
));
2067 dest
= (WCHAR
*)(*pSnb
+ wire
->strcnt
+ 1);
2069 for (i
= 0; i
< wire
->strcnt
; i
++)
2071 ULONG len
= strlenW(src
);
2072 memcpy(dest
, src
, (len
+ 1)*sizeof(WCHAR
));
2081 return pBuffer
+ 3*sizeof(ULONG
) + wire
->datalen
*sizeof(WCHAR
);
2084 void __RPC_USER
SNB_UserFree(ULONG
*pFlags
, SNB
*pSnb
)
2086 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2087 TRACE("(%p)\n", pSnb
);
2089 umcb
->pStubMsg
->pfnFree(*pSnb
);
2092 /* call_as/local stubs for unknwn.idl */
2094 HRESULT CALLBACK
IClassFactory_CreateInstance_Proxy(
2095 IClassFactory
* This
,
2096 IUnknown
*pUnkOuter
,
2100 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObject
);
2104 ERR("aggregation is not allowed on remote objects\n");
2105 return CLASS_E_NOAGGREGATION
;
2107 return IClassFactory_RemoteCreateInstance_Proxy(This
, riid
,
2108 (IUnknown
**) ppvObject
);
2111 HRESULT __RPC_STUB
IClassFactory_CreateInstance_Stub(
2112 IClassFactory
* This
,
2114 IUnknown
**ppvObject
)
2116 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObject
);
2117 return IClassFactory_CreateInstance(This
, NULL
, riid
, (void **) ppvObject
);
2120 HRESULT CALLBACK
IClassFactory_LockServer_Proxy(
2121 IClassFactory
* This
,
2128 HRESULT __RPC_STUB
IClassFactory_LockServer_Stub(
2129 IClassFactory
* This
,
2136 /* call_as/local stubs for objidl.idl */
2138 HRESULT CALLBACK
IEnumUnknown_Next_Proxy(
2142 ULONG
*pceltFetched
)
2145 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2146 if (!pceltFetched
) pceltFetched
= &fetched
;
2147 return IEnumUnknown_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2150 HRESULT __RPC_STUB
IEnumUnknown_Next_Stub(
2154 ULONG
*pceltFetched
)
2157 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2159 hr
= IEnumUnknown_Next(This
, celt
, rgelt
, pceltFetched
);
2160 if (hr
== S_OK
) *pceltFetched
= celt
;
2164 HRESULT CALLBACK
IBindCtx_SetBindOptions_Proxy(
2166 BIND_OPTS
*pbindopts
)
2172 HRESULT __RPC_STUB
IBindCtx_SetBindOptions_Stub(
2174 BIND_OPTS2
*pbindopts
)
2180 HRESULT CALLBACK
IBindCtx_GetBindOptions_Proxy(
2182 BIND_OPTS
*pbindopts
)
2188 HRESULT __RPC_STUB
IBindCtx_GetBindOptions_Stub(
2190 BIND_OPTS2
*pbindopts
)
2196 HRESULT CALLBACK
IEnumMoniker_Next_Proxy(
2200 ULONG
*pceltFetched
)
2203 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2204 if (!pceltFetched
) pceltFetched
= &fetched
;
2205 return IEnumMoniker_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2208 HRESULT __RPC_STUB
IEnumMoniker_Next_Stub(
2212 ULONG
*pceltFetched
)
2215 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2217 hr
= IEnumMoniker_Next(This
, celt
, rgelt
, pceltFetched
);
2218 if (hr
== S_OK
) *pceltFetched
= celt
;
2222 BOOL CALLBACK
IRunnableObject_IsRunning_Proxy(
2223 IRunnableObject
* This
)
2227 memset(&rv
, 0, sizeof rv
);
2231 HRESULT __RPC_STUB
IRunnableObject_IsRunning_Stub(
2232 IRunnableObject
* This
)
2238 HRESULT CALLBACK
IMoniker_BindToObject_Proxy(
2241 IMoniker
*pmkToLeft
,
2249 HRESULT __RPC_STUB
IMoniker_BindToObject_Stub(
2252 IMoniker
*pmkToLeft
,
2254 IUnknown
**ppvResult
)
2260 HRESULT CALLBACK
IMoniker_BindToStorage_Proxy(
2263 IMoniker
*pmkToLeft
,
2267 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2268 return IMoniker_RemoteBindToStorage_Proxy(This
, pbc
, pmkToLeft
, riid
, (IUnknown
**)ppvObj
);
2271 HRESULT __RPC_STUB
IMoniker_BindToStorage_Stub(
2274 IMoniker
*pmkToLeft
,
2278 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2279 return IMoniker_BindToStorage(This
, pbc
, pmkToLeft
, riid
, (void**)ppvObj
);
2282 HRESULT CALLBACK
IEnumString_Next_Proxy(
2286 ULONG
*pceltFetched
)
2289 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2290 if (!pceltFetched
) pceltFetched
= &fetched
;
2291 return IEnumString_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2294 HRESULT __RPC_STUB
IEnumString_Next_Stub(
2298 ULONG
*pceltFetched
)
2301 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2303 hr
= IEnumString_Next(This
, celt
, rgelt
, pceltFetched
);
2304 if (hr
== S_OK
) *pceltFetched
= celt
;
2308 HRESULT CALLBACK
ISequentialStream_Read_Proxy(
2309 ISequentialStream
* This
,
2317 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2319 hr
= ISequentialStream_RemoteRead_Proxy(This
, pv
, cb
, &read
);
2320 if(pcbRead
) *pcbRead
= read
;
2325 HRESULT __RPC_STUB
ISequentialStream_Read_Stub(
2326 ISequentialStream
* This
,
2331 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2332 return ISequentialStream_Read(This
, pv
, cb
, pcbRead
);
2335 HRESULT CALLBACK
ISequentialStream_Write_Proxy(
2336 ISequentialStream
* This
,
2344 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2346 hr
= ISequentialStream_RemoteWrite_Proxy(This
, pv
, cb
, &written
);
2347 if(pcbWritten
) *pcbWritten
= written
;
2352 HRESULT __RPC_STUB
ISequentialStream_Write_Stub(
2353 ISequentialStream
* This
,
2358 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2359 return ISequentialStream_Write(This
, pv
, cb
, pcbWritten
);
2362 HRESULT CALLBACK
IStream_Seek_Proxy(
2364 LARGE_INTEGER dlibMove
,
2366 ULARGE_INTEGER
*plibNewPosition
)
2368 ULARGE_INTEGER newpos
;
2371 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2373 hr
= IStream_RemoteSeek_Proxy(This
, dlibMove
, dwOrigin
, &newpos
);
2374 if(plibNewPosition
) *plibNewPosition
= newpos
;
2379 HRESULT __RPC_STUB
IStream_Seek_Stub(
2381 LARGE_INTEGER dlibMove
,
2383 ULARGE_INTEGER
*plibNewPosition
)
2385 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2386 return IStream_Seek(This
, dlibMove
, dwOrigin
, plibNewPosition
);
2389 HRESULT CALLBACK
IStream_CopyTo_Proxy(
2393 ULARGE_INTEGER
*pcbRead
,
2394 ULARGE_INTEGER
*pcbWritten
)
2396 ULARGE_INTEGER read
, written
;
2399 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2401 hr
= IStream_RemoteCopyTo_Proxy(This
, pstm
, cb
, &read
, &written
);
2402 if(pcbRead
) *pcbRead
= read
;
2403 if(pcbWritten
) *pcbWritten
= written
;
2408 HRESULT __RPC_STUB
IStream_CopyTo_Stub(
2412 ULARGE_INTEGER
*pcbRead
,
2413 ULARGE_INTEGER
*pcbWritten
)
2415 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2417 return IStream_CopyTo(This
, pstm
, cb
, pcbRead
, pcbWritten
);
2420 HRESULT CALLBACK
IEnumSTATSTG_Next_Proxy(
2424 ULONG
*pceltFetched
)
2427 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2428 if (!pceltFetched
) pceltFetched
= &fetched
;
2429 return IEnumSTATSTG_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2432 HRESULT __RPC_STUB
IEnumSTATSTG_Next_Stub(
2436 ULONG
*pceltFetched
)
2439 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2441 hr
= IEnumSTATSTG_Next(This
, celt
, rgelt
, pceltFetched
);
2442 if (hr
== S_OK
) *pceltFetched
= celt
;
2446 HRESULT CALLBACK
IStorage_OpenStream_Proxy(
2454 TRACE("(%p)->(%s, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), reserved1
, grfMode
, reserved2
, ppstm
);
2455 if(reserved1
) WARN("reserved1 %p\n", reserved1
);
2457 return IStorage_RemoteOpenStream_Proxy(This
, pwcsName
, 0, NULL
, grfMode
, reserved2
, ppstm
);
2460 HRESULT __RPC_STUB
IStorage_OpenStream_Stub(
2469 TRACE("(%p)->(%s, %d, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), cbReserved1
, reserved1
, grfMode
, reserved2
, ppstm
);
2470 if(cbReserved1
|| reserved1
) WARN("cbReserved1 %d reserved1 %p\n", cbReserved1
, reserved1
);
2472 return IStorage_OpenStream(This
, pwcsName
, NULL
, grfMode
, reserved2
, ppstm
);
2475 HRESULT CALLBACK
IStorage_EnumElements_Proxy(
2480 IEnumSTATSTG
**ppenum
)
2482 TRACE("(%p)->(%d, %p, %d, %p)\n", This
, reserved1
, reserved2
, reserved3
, ppenum
);
2483 if(reserved2
) WARN("reserved2 %p\n", reserved2
);
2485 return IStorage_RemoteEnumElements_Proxy(This
, reserved1
, 0, NULL
, reserved3
, ppenum
);
2488 HRESULT __RPC_STUB
IStorage_EnumElements_Stub(
2494 IEnumSTATSTG
**ppenum
)
2496 TRACE("(%p)->(%d, %d, %p, %d, %p)\n", This
, reserved1
, cbReserved2
, reserved2
, reserved3
, ppenum
);
2497 if(cbReserved2
|| reserved2
) WARN("cbReserved2 %d reserved2 %p\n", cbReserved2
, reserved2
);
2499 return IStorage_EnumElements(This
, reserved1
, NULL
, reserved3
, ppenum
);
2502 HRESULT CALLBACK
ILockBytes_ReadAt_Proxy(
2504 ULARGE_INTEGER ulOffset
,
2512 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2514 hr
= ILockBytes_RemoteReadAt_Proxy(This
, ulOffset
, pv
, cb
, &read
);
2515 if(pcbRead
) *pcbRead
= read
;
2520 HRESULT __RPC_STUB
ILockBytes_ReadAt_Stub(
2522 ULARGE_INTEGER ulOffset
,
2527 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2528 return ILockBytes_ReadAt(This
, ulOffset
, pv
, cb
, pcbRead
);
2531 HRESULT CALLBACK
ILockBytes_WriteAt_Proxy(
2533 ULARGE_INTEGER ulOffset
,
2541 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2543 hr
= ILockBytes_RemoteWriteAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2544 if(pcbWritten
) *pcbWritten
= written
;
2549 HRESULT __RPC_STUB
ILockBytes_WriteAt_Stub(
2551 ULARGE_INTEGER ulOffset
,
2556 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2557 return ILockBytes_WriteAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2560 HRESULT CALLBACK
IFillLockBytes_FillAppend_Proxy(
2561 IFillLockBytes
* This
,
2569 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2571 hr
= IFillLockBytes_RemoteFillAppend_Proxy(This
, pv
, cb
, &written
);
2572 if(pcbWritten
) *pcbWritten
= written
;
2577 HRESULT __RPC_STUB
IFillLockBytes_FillAppend_Stub(
2578 IFillLockBytes
* This
,
2583 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2584 return IFillLockBytes_FillAppend(This
, pv
, cb
, pcbWritten
);
2587 HRESULT CALLBACK
IFillLockBytes_FillAt_Proxy(
2588 IFillLockBytes
* This
,
2589 ULARGE_INTEGER ulOffset
,
2597 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2599 hr
= IFillLockBytes_RemoteFillAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2600 if(pcbWritten
) *pcbWritten
= written
;
2605 HRESULT __RPC_STUB
IFillLockBytes_FillAt_Stub(
2606 IFillLockBytes
* This
,
2607 ULARGE_INTEGER ulOffset
,
2612 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2613 return IFillLockBytes_FillAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2616 HRESULT CALLBACK
IEnumFORMATETC_Next_Proxy(
2617 IEnumFORMATETC
* This
,
2620 ULONG
*pceltFetched
)
2623 if (!pceltFetched
) pceltFetched
= &fetched
;
2624 return IEnumFORMATETC_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2627 HRESULT __RPC_STUB
IEnumFORMATETC_Next_Stub(
2628 IEnumFORMATETC
* This
,
2631 ULONG
*pceltFetched
)
2635 hr
= IEnumFORMATETC_Next(This
, celt
, rgelt
, pceltFetched
);
2636 if (hr
== S_OK
) *pceltFetched
= celt
;
2640 HRESULT CALLBACK
IEnumSTATDATA_Next_Proxy(
2641 IEnumSTATDATA
* This
,
2644 ULONG
*pceltFetched
)
2647 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2648 if (!pceltFetched
) pceltFetched
= &fetched
;
2649 return IEnumSTATDATA_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2652 HRESULT __RPC_STUB
IEnumSTATDATA_Next_Stub(
2653 IEnumSTATDATA
* This
,
2656 ULONG
*pceltFetched
)
2659 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2661 hr
= IEnumSTATDATA_Next(This
, celt
, rgelt
, pceltFetched
);
2662 if (hr
== S_OK
) *pceltFetched
= celt
;
2666 void CALLBACK
IAdviseSink_OnDataChange_Proxy(
2668 FORMATETC
*pFormatetc
,
2671 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2672 IAdviseSink_RemoteOnDataChange_Proxy(This
, pFormatetc
, pStgmed
);
2675 HRESULT __RPC_STUB
IAdviseSink_OnDataChange_Stub(
2677 FORMATETC
*pFormatetc
,
2678 ASYNC_STGMEDIUM
*pStgmed
)
2680 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2681 IAdviseSink_OnDataChange(This
, pFormatetc
, pStgmed
);
2685 void CALLBACK
IAdviseSink_OnViewChange_Proxy(
2690 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2691 IAdviseSink_RemoteOnViewChange_Proxy(This
, dwAspect
, lindex
);
2694 HRESULT __RPC_STUB
IAdviseSink_OnViewChange_Stub(
2699 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2700 IAdviseSink_OnViewChange(This
, dwAspect
, lindex
);
2704 void CALLBACK
IAdviseSink_OnRename_Proxy(
2708 TRACE("(%p)->(%p)\n", This
, pmk
);
2709 IAdviseSink_RemoteOnRename_Proxy(This
, pmk
);
2712 HRESULT __RPC_STUB
IAdviseSink_OnRename_Stub(
2716 TRACE("(%p)->(%p)\n", This
, pmk
);
2717 IAdviseSink_OnRename(This
, pmk
);
2721 void CALLBACK
IAdviseSink_OnSave_Proxy(
2724 TRACE("(%p)\n", This
);
2725 IAdviseSink_RemoteOnSave_Proxy(This
);
2728 HRESULT __RPC_STUB
IAdviseSink_OnSave_Stub(
2731 TRACE("(%p)\n", This
);
2732 IAdviseSink_OnSave(This
);
2736 void CALLBACK
IAdviseSink_OnClose_Proxy(
2739 TRACE("(%p)\n", This
);
2740 IAdviseSink_RemoteOnClose_Proxy(This
);
2743 HRESULT __RPC_STUB
IAdviseSink_OnClose_Stub(
2746 TRACE("(%p)\n", This
);
2747 IAdviseSink_OnClose(This
);
2751 void CALLBACK
IAdviseSink2_OnLinkSrcChange_Proxy(
2755 TRACE("(%p)->(%p)\n", This
, pmk
);
2756 IAdviseSink2_RemoteOnLinkSrcChange_Proxy(This
, pmk
);
2759 HRESULT __RPC_STUB
IAdviseSink2_OnLinkSrcChange_Stub(
2763 TRACE("(%p)->(%p)\n", This
, pmk
);
2764 IAdviseSink2_OnLinkSrcChange(This
, pmk
);
2768 HRESULT CALLBACK
IDataObject_GetData_Proxy(
2770 FORMATETC
*pformatetcIn
,
2773 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pmedium
);
2774 return IDataObject_RemoteGetData_Proxy(This
, pformatetcIn
, pmedium
);
2777 HRESULT __RPC_STUB
IDataObject_GetData_Stub(
2779 FORMATETC
*pformatetcIn
,
2780 STGMEDIUM
*pRemoteMedium
)
2782 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pRemoteMedium
);
2783 return IDataObject_GetData(This
, pformatetcIn
, pRemoteMedium
);
2786 HRESULT CALLBACK
IDataObject_GetDataHere_Proxy(IDataObject
*iface
, FORMATETC
*fmt
, STGMEDIUM
*med
)
2789 IStorage
*stg
= NULL
;
2792 TRACE("(%p)->(%p, %p)\n", iface
, fmt
, med
);
2794 if ((med
->tymed
& (TYMED_HGLOBAL
| TYMED_FILE
| TYMED_ISTREAM
| TYMED_ISTORAGE
)) == 0)
2796 if (med
->tymed
!= fmt
->tymed
)
2799 release
= med
->pUnkForRelease
;
2800 med
->pUnkForRelease
= NULL
;
2802 if (med
->tymed
== TYMED_ISTREAM
|| med
->tymed
== TYMED_ISTORAGE
)
2804 stg
= med
->u
.pstg
; /* This may actually be a stream, but that's ok */
2805 if (stg
) IStorage_AddRef( stg
);
2808 hr
= IDataObject_RemoteGetDataHere_Proxy(iface
, fmt
, med
);
2810 med
->pUnkForRelease
= release
;
2814 IStorage_Release( med
->u
.pstg
);
2821 HRESULT __RPC_STUB
IDataObject_GetDataHere_Stub(
2823 FORMATETC
*pformatetc
,
2824 STGMEDIUM
*pRemoteMedium
)
2826 TRACE("(%p)->(%p, %p)\n", This
, pformatetc
, pRemoteMedium
);
2827 return IDataObject_GetDataHere(This
, pformatetc
, pRemoteMedium
);
2830 HRESULT CALLBACK
IDataObject_SetData_Proxy(
2832 FORMATETC
*pformatetc
,
2840 HRESULT __RPC_STUB
IDataObject_SetData_Stub(
2842 FORMATETC
*pformatetc
,
2843 FLAG_STGMEDIUM
*pmedium
,
2850 /* call_as/local stubs for oleidl.idl */
2852 HRESULT CALLBACK
IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
2853 IOleInPlaceActiveObject
* This
,
2856 TRACE("(%p %p)\n", This
, lpmsg
);
2857 return IOleInPlaceActiveObject_RemoteTranslateAccelerator_Proxy(This
);
2860 HRESULT __RPC_STUB
IOleInPlaceActiveObject_TranslateAccelerator_Stub(
2861 IOleInPlaceActiveObject
* This
)
2863 TRACE("(%p)\n", This
);
2867 HRESULT CALLBACK
IOleInPlaceActiveObject_ResizeBorder_Proxy(
2868 IOleInPlaceActiveObject
* This
,
2870 IOleInPlaceUIWindow
*pUIWindow
,
2877 HRESULT __RPC_STUB
IOleInPlaceActiveObject_ResizeBorder_Stub(
2878 IOleInPlaceActiveObject
* This
,
2881 IOleInPlaceUIWindow
*pUIWindow
,
2888 HRESULT CALLBACK
IOleCache2_UpdateCache_Proxy(
2890 LPDATAOBJECT pDataObject
,
2894 TRACE("(%p, %p, 0x%08x, %p)\n", This
, pDataObject
, grfUpdf
, pReserved
);
2895 return IOleCache2_RemoteUpdateCache_Proxy(This
, pDataObject
, grfUpdf
, (LONG_PTR
)pReserved
);
2898 HRESULT __RPC_STUB
IOleCache2_UpdateCache_Stub(
2900 LPDATAOBJECT pDataObject
,
2904 TRACE("(%p, %p, 0x%08x, %li)\n", This
, pDataObject
, grfUpdf
, pReserved
);
2905 return IOleCache2_UpdateCache(This
, pDataObject
, grfUpdf
, (void*)pReserved
);
2908 HRESULT CALLBACK
IEnumOLEVERB_Next_Proxy(
2912 ULONG
*pceltFetched
)
2915 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2916 if (!pceltFetched
) pceltFetched
= &fetched
;
2917 return IEnumOLEVERB_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2920 HRESULT __RPC_STUB
IEnumOLEVERB_Next_Stub(
2924 ULONG
*pceltFetched
)
2927 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2929 hr
= IEnumOLEVERB_Next(This
, celt
, rgelt
, pceltFetched
);
2930 if (hr
== S_OK
) *pceltFetched
= celt
;
2934 HRESULT CALLBACK
IViewObject_Draw_Proxy(
2939 DVTARGETDEVICE
*ptd
,
2942 LPCRECTL lprcBounds
,
2943 LPCRECTL lprcWBounds
,
2944 BOOL (STDMETHODCALLTYPE
*pfnContinue
)(ULONG_PTR dwContinue
),
2945 ULONG_PTR dwContinue
)
2951 HRESULT __RPC_STUB
IViewObject_Draw_Stub(
2956 DVTARGETDEVICE
*ptd
,
2957 ULONG_PTR hdcTargetDev
,
2959 LPCRECTL lprcBounds
,
2960 LPCRECTL lprcWBounds
,
2961 IContinue
*pContinue
)
2967 HRESULT CALLBACK
IViewObject_GetColorSet_Proxy(
2972 DVTARGETDEVICE
*ptd
,
2974 LOGPALETTE
**ppColorSet
)
2980 HRESULT __RPC_STUB
IViewObject_GetColorSet_Stub(
2985 DVTARGETDEVICE
*ptd
,
2986 ULONG_PTR hicTargetDev
,
2987 LOGPALETTE
**ppColorSet
)
2993 HRESULT CALLBACK
IViewObject_Freeze_Proxy(
3004 HRESULT __RPC_STUB
IViewObject_Freeze_Stub(
3015 HRESULT CALLBACK
IViewObject_GetAdvise_Proxy(
3019 IAdviseSink
**ppAdvSink
)
3025 HRESULT __RPC_STUB
IViewObject_GetAdvise_Stub(
3029 IAdviseSink
**ppAdvSink
)