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
*phMenu
)
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
)
345 /******************************************************************************
346 * HGLOBAL_UserSize [OLE32.@]
348 * Calculates the buffer size required to marshal an HGLOBAL.
351 * pFlags [I] Flags. See notes.
352 * StartingSize [I] Starting size of the buffer. This value is added on to
353 * the buffer size required for the clip format.
354 * phGlobal [I] HGLOBAL to size.
357 * The buffer size required to marshal an HGLOBAL plus the starting size.
360 * Even though the function is documented to take a pointer to a ULONG in
361 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
362 * the first parameter is a ULONG.
363 * This function is only intended to be called by the RPC runtime.
365 ULONG __RPC_USER
HGLOBAL_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HGLOBAL
*phGlobal
)
367 ULONG size
= StartingSize
;
369 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, phGlobal
);
371 ALIGN_LENGTH(size
, 3);
373 size
+= sizeof(ULONG
);
375 if (LOWORD(*pFlags
== MSHCTX_INPROC
))
376 size
+= sizeof(HGLOBAL
);
379 size
+= sizeof(ULONG
);
383 size
+= 3 * sizeof(ULONG
);
384 ret
= GlobalSize(*phGlobal
);
392 /******************************************************************************
393 * HGLOBAL_UserMarshal [OLE32.@]
395 * Marshals an HGLOBAL into a buffer.
398 * pFlags [I] Flags. See notes.
399 * pBuffer [I] Buffer to marshal the clip format into.
400 * phGlobal [I] HGLOBAL to marshal.
403 * The end of the marshaled data in the buffer.
406 * Even though the function is documented to take a pointer to a ULONG in
407 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
408 * the first parameter is a ULONG.
409 * This function is only intended to be called by the RPC runtime.
411 unsigned char * __RPC_USER
HGLOBAL_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HGLOBAL
*phGlobal
)
413 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phGlobal
);
415 ALIGN_POINTER(pBuffer
, 3);
417 if (LOWORD(*pFlags
== MSHCTX_INPROC
))
419 if (sizeof(*phGlobal
) == 8)
420 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
422 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
423 pBuffer
+= sizeof(ULONG
);
424 *(HGLOBAL
*)pBuffer
= *phGlobal
;
425 pBuffer
+= sizeof(HGLOBAL
);
429 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
430 pBuffer
+= sizeof(ULONG
);
431 *(ULONG
*)pBuffer
= HandleToULong(*phGlobal
);
432 pBuffer
+= sizeof(ULONG
);
435 const unsigned char *memory
;
436 SIZE_T size
= GlobalSize(*phGlobal
);
437 *(ULONG
*)pBuffer
= (ULONG
)size
;
438 pBuffer
+= sizeof(ULONG
);
439 *(ULONG
*)pBuffer
= HandleToULong(*phGlobal
);
440 pBuffer
+= sizeof(ULONG
);
441 *(ULONG
*)pBuffer
= (ULONG
)size
;
442 pBuffer
+= sizeof(ULONG
);
444 memory
= GlobalLock(*phGlobal
);
445 memcpy(pBuffer
, memory
, size
);
447 GlobalUnlock(*phGlobal
);
454 /******************************************************************************
455 * HGLOBAL_UserUnmarshal [OLE32.@]
457 * Unmarshals an HGLOBAL from a buffer.
460 * pFlags [I] Flags. See notes.
461 * pBuffer [I] Buffer to marshal the clip format from.
462 * phGlobal [O] Address that receive the unmarshaled HGLOBAL.
465 * The end of the marshaled data in the buffer.
468 * Even though the function is documented to take a pointer to an ULONG in
469 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
470 * the first parameter is an ULONG.
471 * This function is only intended to be called by the RPC runtime.
473 unsigned char * __RPC_USER
HGLOBAL_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HGLOBAL
*phGlobal
)
477 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phGlobal
);
479 ALIGN_POINTER(pBuffer
, 3);
481 fContext
= *(ULONG
*)pBuffer
;
482 pBuffer
+= sizeof(ULONG
);
484 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phGlobal
) < 8)) ||
485 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phGlobal
) == 8)))
487 *phGlobal
= *(HGLOBAL
*)pBuffer
;
488 pBuffer
+= sizeof(*phGlobal
);
490 else if (fContext
== WDT_REMOTE_CALL
)
494 handle
= *(ULONG
*)pBuffer
;
495 pBuffer
+= sizeof(ULONG
);
502 size
= *(ULONG
*)pBuffer
;
503 pBuffer
+= sizeof(ULONG
);
504 /* redundancy is bad - it means you have to check consistency like
506 if (*(ULONG
*)pBuffer
!= handle
)
508 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
511 pBuffer
+= sizeof(ULONG
);
512 /* redundancy is bad - it means you have to check consistency like
514 if (*(ULONG
*)pBuffer
!= size
)
516 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
519 pBuffer
+= sizeof(ULONG
);
521 /* FIXME: check size is not too big */
523 *phGlobal
= GlobalAlloc(GMEM_MOVEABLE
, size
);
524 memory
= GlobalLock(*phGlobal
);
525 memcpy(memory
, pBuffer
, size
);
527 GlobalUnlock(*phGlobal
);
533 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
538 /******************************************************************************
539 * HGLOBAL_UserFree [OLE32.@]
541 * Frees an unmarshaled HGLOBAL.
544 * pFlags [I] Flags. See notes.
545 * phGlobal [I] HGLOBAL to free.
548 * The end of the marshaled data in the buffer.
551 * Even though the function is documented to take a pointer to a ULONG in
552 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
553 * which the first parameter is a ULONG.
554 * This function is only intended to be called by the RPC runtime.
556 void __RPC_USER
HGLOBAL_UserFree(ULONG
*pFlags
, HGLOBAL
*phGlobal
)
558 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phGlobal
);
560 if (LOWORD(*pFlags
!= MSHCTX_INPROC
) && *phGlobal
)
561 GlobalFree(*phGlobal
);
564 /******************************************************************************
565 * HBITMAP_UserSize [OLE32.@]
567 * Calculates the buffer size required to marshal a bitmap.
570 * pFlags [I] Flags. See notes.
571 * StartingSize [I] Starting size of the buffer. This value is added on to
572 * the buffer size required for the clip format.
573 * phBmp [I] Bitmap to size.
576 * The buffer size required to marshal an bitmap plus the starting size.
579 * Even though the function is documented to take a pointer to a ULONG in
580 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
581 * the first parameter is a ULONG.
582 * This function is only intended to be called by the RPC runtime.
584 ULONG __RPC_USER
HBITMAP_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HBITMAP
*phBmp
)
590 /******************************************************************************
591 * HBITMAP_UserMarshal [OLE32.@]
593 * Marshals a bitmap into a buffer.
596 * pFlags [I] Flags. See notes.
597 * pBuffer [I] Buffer to marshal the clip format into.
598 * phBmp [I] Bitmap to marshal.
601 * The end of the marshaled data in the buffer.
604 * Even though the function is documented to take a pointer to a ULONG in
605 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
606 * the first parameter is a ULONG.
607 * This function is only intended to be called by the RPC runtime.
609 unsigned char * __RPC_USER
HBITMAP_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HBITMAP
*phBmp
)
615 /******************************************************************************
616 * HBITMAP_UserUnmarshal [OLE32.@]
618 * Unmarshals a bitmap from a buffer.
621 * pFlags [I] Flags. See notes.
622 * pBuffer [I] Buffer to marshal the clip format from.
623 * phBmp [O] Address that receive the unmarshaled bitmap.
626 * The end of the marshaled data in the buffer.
629 * Even though the function is documented to take a pointer to an ULONG in
630 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
631 * the first parameter is an ULONG.
632 * This function is only intended to be called by the RPC runtime.
634 unsigned char * __RPC_USER
HBITMAP_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HBITMAP
*phBmp
)
640 /******************************************************************************
641 * HBITMAP_UserFree [OLE32.@]
643 * Frees an unmarshaled bitmap.
646 * pFlags [I] Flags. See notes.
647 * phBmp [I] Bitmap to free.
650 * The end of the marshaled data in the buffer.
653 * Even though the function is documented to take a pointer to a ULONG in
654 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
655 * which the first parameter is a ULONG.
656 * This function is only intended to be called by the RPC runtime.
658 void __RPC_USER
HBITMAP_UserFree(ULONG
*pFlags
, HBITMAP
*phBmp
)
663 /******************************************************************************
664 * HICON_UserSize [OLE32.@]
666 * Calculates the buffer size required to marshal an icon.
669 * pFlags [I] Flags. See notes.
670 * StartingSize [I] Starting size of the buffer. This value is added on to
671 * the buffer size required for the icon.
672 * phIcon [I] Icon to size.
675 * The buffer size required to marshal an icon plus the starting size.
678 * Even though the function is documented to take a pointer to a ULONG in
679 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
680 * the first parameter is a ULONG.
681 * This function is only intended to be called by the RPC runtime.
683 ULONG __RPC_USER
HICON_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HICON
*phIcon
)
689 /******************************************************************************
690 * HICON_UserMarshal [OLE32.@]
692 * Marshals an icon into a buffer.
695 * pFlags [I] Flags. See notes.
696 * pBuffer [I] Buffer to marshal the icon into.
697 * phIcon [I] Icon to marshal.
700 * The end of the marshaled data in the buffer.
703 * Even though the function is documented to take a pointer to a ULONG in
704 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
705 * the first parameter is a ULONG.
706 * This function is only intended to be called by the RPC runtime.
708 unsigned char * __RPC_USER
HICON_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HICON
*phIcon
)
714 /******************************************************************************
715 * HICON_UserUnmarshal [OLE32.@]
717 * Unmarshals an icon from a buffer.
720 * pFlags [I] Flags. See notes.
721 * pBuffer [I] Buffer to marshal the icon from.
722 * phIcon [O] Address that receive the unmarshaled icon.
725 * The end of the marshaled data in the buffer.
728 * Even though the function is documented to take a pointer to an ULONG in
729 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
730 * the first parameter is an ULONG.
731 * This function is only intended to be called by the RPC runtime.
733 unsigned char * __RPC_USER
HICON_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HICON
*phIcon
)
739 /******************************************************************************
740 * HICON_UserFree [OLE32.@]
742 * Frees an unmarshaled icon.
745 * pFlags [I] Flags. See notes.
746 * phIcon [I] Icon to free.
749 * The end of the marshaled data in the buffer.
752 * Even though the function is documented to take a pointer to a ULONG in
753 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
754 * which the first parameter is a ULONG.
755 * This function is only intended to be called by the RPC runtime.
757 void __RPC_USER
HICON_UserFree(ULONG
*pFlags
, HICON
*phIcon
)
762 /******************************************************************************
763 * HDC_UserSize [OLE32.@]
765 * Calculates the buffer size required to marshal an HDC.
768 * pFlags [I] Flags. See notes.
769 * StartingSize [I] Starting size of the buffer. This value is added on to
770 * the buffer size required for the clip format.
771 * phGlobal [I] HDC to size.
774 * The buffer size required to marshal an HDC plus the starting size.
777 * Even though the function is documented to take a pointer to a ULONG in
778 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
779 * the first parameter is a ULONG.
780 * This function is only intended to be called by the RPC runtime.
782 ULONG __RPC_USER
HDC_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HDC
*phdc
)
788 /******************************************************************************
789 * HDC_UserMarshal [OLE32.@]
791 * Marshals an HDC into a buffer.
794 * pFlags [I] Flags. See notes.
795 * pBuffer [I] Buffer to marshal the clip format into.
796 * phdc [I] HDC to marshal.
799 * The end of the marshaled data in the buffer.
802 * Even though the function is documented to take a pointer to a ULONG in
803 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
804 * the first parameter is a ULONG.
805 * This function is only intended to be called by the RPC runtime.
807 unsigned char * __RPC_USER
HDC_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HDC
*phdc
)
813 /******************************************************************************
814 * HDC_UserUnmarshal [OLE32.@]
816 * Unmarshals an HDC from a buffer.
819 * pFlags [I] Flags. See notes.
820 * pBuffer [I] Buffer to marshal the clip format from.
821 * phdc [O] Address that receive the unmarshaled HDC.
824 * The end of the marshaled data in the buffer.
827 * Even though the function is documented to take a pointer to an ULONG in
828 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
829 * the first parameter is an ULONG.
830 * This function is only intended to be called by the RPC runtime.
832 unsigned char * __RPC_USER
HDC_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HDC
*phdc
)
838 /******************************************************************************
839 * HDC_UserFree [OLE32.@]
841 * Frees an unmarshaled HDC.
844 * pFlags [I] Flags. See notes.
845 * phdc [I] HDC to free.
848 * The end of the marshaled data in the buffer.
851 * Even though the function is documented to take a pointer to a ULONG in
852 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
853 * which the first parameter is a ULONG.
854 * This function is only intended to be called by the RPC runtime.
856 void __RPC_USER
HDC_UserFree(ULONG
*pFlags
, HDC
*phdc
)
861 /******************************************************************************
862 * HPALETTE_UserSize [OLE32.@]
864 * Calculates the buffer size required to marshal a palette.
867 * pFlags [I] Flags. See notes.
868 * StartingSize [I] Starting size of the buffer. This value is added on to
869 * the buffer size required for the clip format.
870 * phPal [I] Palette to size.
873 * The buffer size required to marshal a palette plus the starting size.
876 * Even though the function is documented to take a pointer to a ULONG in
877 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
878 * the first parameter is a ULONG.
879 * This function is only intended to be called by the RPC runtime.
881 ULONG __RPC_USER
HPALETTE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HPALETTE
*phPal
)
887 /******************************************************************************
888 * HPALETTE_UserMarshal [OLE32.@]
890 * Marshals a palette into a buffer.
893 * pFlags [I] Flags. See notes.
894 * pBuffer [I] Buffer to marshal the clip format into.
895 * phPal [I] Palette to marshal.
898 * The end of the marshaled data in the buffer.
901 * Even though the function is documented to take a pointer to a ULONG in
902 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
903 * the first parameter is a ULONG.
904 * This function is only intended to be called by the RPC runtime.
906 unsigned char * __RPC_USER
HPALETTE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HPALETTE
*phPal
)
912 /******************************************************************************
913 * HPALETTE_UserUnmarshal [OLE32.@]
915 * Unmarshals a palette from a buffer.
918 * pFlags [I] Flags. See notes.
919 * pBuffer [I] Buffer to marshal the clip format from.
920 * phPal [O] Address that receive the unmarshaled palette.
923 * The end of the marshaled data in the buffer.
926 * Even though the function is documented to take a pointer to an ULONG in
927 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
928 * the first parameter is an ULONG.
929 * This function is only intended to be called by the RPC runtime.
931 unsigned char * __RPC_USER
HPALETTE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HPALETTE
*phPal
)
937 /******************************************************************************
938 * HPALETTE_UserFree [OLE32.@]
940 * Frees an unmarshaled palette.
943 * pFlags [I] Flags. See notes.
944 * phPal [I] Palette to free.
947 * The end of the marshaled data in the buffer.
950 * Even though the function is documented to take a pointer to a ULONG in
951 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
952 * which the first parameter is a ULONG.
953 * This function is only intended to be called by the RPC runtime.
955 void __RPC_USER
HPALETTE_UserFree(ULONG
*pFlags
, HPALETTE
*phPal
)
961 /******************************************************************************
962 * HMETAFILE_UserSize [OLE32.@]
964 * Calculates the buffer size required to marshal a metafile.
967 * pFlags [I] Flags. See notes.
968 * StartingSize [I] Starting size of the buffer. This value is added on to
969 * the buffer size required for the clip format.
970 * phmf [I] Metafile to size.
973 * The buffer size required to marshal a metafile plus the starting size.
976 * Even though the function is documented to take a pointer to a ULONG in
977 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
978 * the first parameter is a ULONG.
979 * This function is only intended to be called by the RPC runtime.
981 ULONG __RPC_USER
HMETAFILE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HMETAFILE
*phmf
)
983 ULONG size
= StartingSize
;
985 TRACE("(%s, %d, &%p\n", debugstr_user_flags(pFlags
), StartingSize
, *phmf
);
987 ALIGN_LENGTH(size
, 3);
989 size
+= sizeof(ULONG
);
990 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
991 size
+= sizeof(ULONG_PTR
);
994 size
+= sizeof(ULONG
);
1000 size
+= 2 * sizeof(ULONG
);
1001 mfsize
= GetMetaFileBitsEx(*phmf
, 0, NULL
);
1009 /******************************************************************************
1010 * HMETAFILE_UserMarshal [OLE32.@]
1012 * Marshals a metafile into a buffer.
1015 * pFlags [I] Flags. See notes.
1016 * pBuffer [I] Buffer to marshal the clip format into.
1017 * phEmf [I] Metafile to marshal.
1020 * The end of the marshaled data in the buffer.
1023 * Even though the function is documented to take a pointer to a ULONG in
1024 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1025 * the first parameter is a ULONG.
1026 * This function is only intended to be called by the RPC runtime.
1028 unsigned char * __RPC_USER
HMETAFILE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILE
*phmf
)
1030 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phmf
);
1032 ALIGN_POINTER(pBuffer
, 3);
1034 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1036 if (sizeof(*phmf
) == 8)
1037 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
1039 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
1040 pBuffer
+= sizeof(ULONG
);
1041 *(HMETAFILE
*)pBuffer
= *phmf
;
1042 pBuffer
+= sizeof(HMETAFILE
);
1046 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
1047 pBuffer
+= sizeof(ULONG
);
1048 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phmf
;
1049 pBuffer
+= sizeof(ULONG
);
1053 UINT mfsize
= GetMetaFileBitsEx(*phmf
, 0, NULL
);
1055 *(ULONG
*)pBuffer
= mfsize
;
1056 pBuffer
+= sizeof(ULONG
);
1057 *(ULONG
*)pBuffer
= mfsize
;
1058 pBuffer
+= sizeof(ULONG
);
1059 GetMetaFileBitsEx(*phmf
, mfsize
, pBuffer
);
1067 /******************************************************************************
1068 * HMETAFILE_UserUnmarshal [OLE32.@]
1070 * Unmarshals a metafile from a buffer.
1073 * pFlags [I] Flags. See notes.
1074 * pBuffer [I] Buffer to marshal the clip format from.
1075 * phmf [O] Address that receive the unmarshaled metafile.
1078 * The end of the marshaled data in the buffer.
1081 * Even though the function is documented to take a pointer to an ULONG in
1082 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1083 * the first parameter is an ULONG.
1084 * This function is only intended to be called by the RPC runtime.
1086 unsigned char * __RPC_USER
HMETAFILE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILE
*phmf
)
1090 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, phmf
);
1092 ALIGN_POINTER(pBuffer
, 3);
1094 fContext
= *(ULONG
*)pBuffer
;
1095 pBuffer
+= sizeof(ULONG
);
1097 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phmf
) < 8)) ||
1098 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phmf
) == 8)))
1100 *phmf
= *(HMETAFILE
*)pBuffer
;
1101 pBuffer
+= sizeof(*phmf
);
1103 else if (fContext
== WDT_REMOTE_CALL
)
1107 handle
= *(ULONG
*)pBuffer
;
1108 pBuffer
+= sizeof(ULONG
);
1113 size
= *(ULONG
*)pBuffer
;
1114 pBuffer
+= sizeof(ULONG
);
1115 if (size
!= *(ULONG
*)pBuffer
)
1117 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1120 pBuffer
+= sizeof(ULONG
);
1121 *phmf
= SetMetaFileBitsEx(size
, pBuffer
);
1128 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
1133 /******************************************************************************
1134 * HMETAFILE_UserFree [OLE32.@]
1136 * Frees an unmarshaled metafile.
1139 * pFlags [I] Flags. See notes.
1140 * phmf [I] Metafile to free.
1143 * The end of the marshaled data in the buffer.
1146 * Even though the function is documented to take a pointer to a ULONG in
1147 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1148 * which the first parameter is a ULONG.
1149 * This function is only intended to be called by the RPC runtime.
1151 void __RPC_USER
HMETAFILE_UserFree(ULONG
*pFlags
, HMETAFILE
*phmf
)
1153 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phmf
);
1155 if (LOWORD(*pFlags
) != MSHCTX_INPROC
)
1156 DeleteMetaFile(*phmf
);
1159 /******************************************************************************
1160 * HENHMETAFILE_UserSize [OLE32.@]
1162 * Calculates the buffer size required to marshal an enhanced metafile.
1165 * pFlags [I] Flags. See notes.
1166 * StartingSize [I] Starting size of the buffer. This value is added on to
1167 * the buffer size required for the clip format.
1168 * phEmf [I] Enhanced metafile to size.
1171 * The buffer size required to marshal an enhanced metafile plus the starting size.
1174 * Even though the function is documented to take a pointer to a ULONG in
1175 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1176 * the first parameter is a ULONG.
1177 * This function is only intended to be called by the RPC runtime.
1179 ULONG __RPC_USER
HENHMETAFILE_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HENHMETAFILE
*phEmf
)
1181 ULONG size
= StartingSize
;
1183 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, *phEmf
);
1185 size
+= sizeof(ULONG
);
1186 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1187 size
+= sizeof(ULONG_PTR
);
1190 size
+= sizeof(ULONG
);
1196 size
+= 2 * sizeof(ULONG
);
1197 emfsize
= GetEnhMetaFileBits(*phEmf
, 0, NULL
);
1205 /******************************************************************************
1206 * HENHMETAFILE_UserMarshal [OLE32.@]
1208 * Marshals an enhance metafile into a buffer.
1211 * pFlags [I] Flags. See notes.
1212 * pBuffer [I] Buffer to marshal the clip format into.
1213 * phEmf [I] Enhanced metafile to marshal.
1216 * The end of the marshaled data in the buffer.
1219 * Even though the function is documented to take a pointer to a ULONG in
1220 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1221 * the first parameter is a ULONG.
1222 * This function is only intended to be called by the RPC runtime.
1224 unsigned char * __RPC_USER
HENHMETAFILE_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HENHMETAFILE
*phEmf
)
1226 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags
), pBuffer
, *phEmf
);
1228 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1230 if (sizeof(*phEmf
) == 8)
1231 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
1233 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
1234 pBuffer
+= sizeof(ULONG
);
1235 *(HENHMETAFILE
*)pBuffer
= *phEmf
;
1236 pBuffer
+= sizeof(HENHMETAFILE
);
1240 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
1241 pBuffer
+= sizeof(ULONG
);
1242 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phEmf
;
1243 pBuffer
+= sizeof(ULONG
);
1247 UINT emfsize
= GetEnhMetaFileBits(*phEmf
, 0, NULL
);
1249 *(ULONG
*)pBuffer
= emfsize
;
1250 pBuffer
+= sizeof(ULONG
);
1251 *(ULONG
*)pBuffer
= emfsize
;
1252 pBuffer
+= sizeof(ULONG
);
1253 GetEnhMetaFileBits(*phEmf
, emfsize
, pBuffer
);
1261 /******************************************************************************
1262 * HENHMETAFILE_UserUnmarshal [OLE32.@]
1264 * Unmarshals an enhanced metafile from a buffer.
1267 * pFlags [I] Flags. See notes.
1268 * pBuffer [I] Buffer to marshal the clip format from.
1269 * phEmf [O] Address that receive the unmarshaled enhanced metafile.
1272 * The end of the marshaled data in the buffer.
1275 * Even though the function is documented to take a pointer to an ULONG in
1276 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1277 * the first parameter is an ULONG.
1278 * This function is only intended to be called by the RPC runtime.
1280 unsigned char * __RPC_USER
HENHMETAFILE_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HENHMETAFILE
*phEmf
)
1284 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, phEmf
);
1286 fContext
= *(ULONG
*)pBuffer
;
1287 pBuffer
+= sizeof(ULONG
);
1289 if (((fContext
== WDT_INPROC_CALL
) && (sizeof(*phEmf
) < 8)) ||
1290 ((fContext
== WDT_INPROC64_CALL
) && (sizeof(*phEmf
) == 8)))
1292 *phEmf
= *(HENHMETAFILE
*)pBuffer
;
1293 pBuffer
+= sizeof(*phEmf
);
1295 else if (fContext
== WDT_REMOTE_CALL
)
1299 handle
= *(ULONG
*)pBuffer
;
1300 pBuffer
+= sizeof(ULONG
);
1305 size
= *(ULONG
*)pBuffer
;
1306 pBuffer
+= sizeof(ULONG
);
1307 if (size
!= *(ULONG
*)pBuffer
)
1309 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1312 pBuffer
+= sizeof(ULONG
);
1313 *phEmf
= SetEnhMetaFileBits(size
, pBuffer
);
1320 RaiseException(RPC_S_INVALID_TAG
, 0, 0, NULL
);
1325 /******************************************************************************
1326 * HENHMETAFILE_UserFree [OLE32.@]
1328 * Frees an unmarshaled enhanced metafile.
1331 * pFlags [I] Flags. See notes.
1332 * phEmf [I] Enhanced metafile to free.
1335 * The end of the marshaled data in the buffer.
1338 * Even though the function is documented to take a pointer to a ULONG in
1339 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1340 * which the first parameter is a ULONG.
1341 * This function is only intended to be called by the RPC runtime.
1343 void __RPC_USER
HENHMETAFILE_UserFree(ULONG
*pFlags
, HENHMETAFILE
*phEmf
)
1345 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags
), *phEmf
);
1347 if (LOWORD(*pFlags
) != MSHCTX_INPROC
)
1348 DeleteEnhMetaFile(*phEmf
);
1351 /******************************************************************************
1352 * HMETAFILEPICT_UserSize [OLE32.@]
1354 * Calculates the buffer size required to marshal an metafile pict.
1357 * pFlags [I] Flags. See notes.
1358 * StartingSize [I] Starting size of the buffer. This value is added on to
1359 * the buffer size required for the clip format.
1360 * phMfp [I] Metafile pict to size.
1363 * The buffer size required to marshal a metafile pict plus the starting size.
1366 * Even though the function is documented to take a pointer to a ULONG in
1367 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1368 * the first parameter is a ULONG.
1369 * This function is only intended to be called by the RPC runtime.
1371 ULONG __RPC_USER
HMETAFILEPICT_UserSize(ULONG
*pFlags
, ULONG StartingSize
, HMETAFILEPICT
*phMfp
)
1373 ULONG size
= StartingSize
;
1375 TRACE("(%s, %d, &%p)\n", debugstr_user_flags(pFlags
), StartingSize
, *phMfp
);
1377 size
+= sizeof(ULONG
);
1379 if(LOWORD(*pFlags
) == MSHCTX_INPROC
)
1380 size
+= sizeof(HMETAFILEPICT
);
1383 size
+= sizeof(ULONG
);
1387 METAFILEPICT
*mfpict
= GlobalLock(*phMfp
);
1389 /* FIXME: raise an exception if mfpict is NULL? */
1390 size
+= 3 * sizeof(ULONG
);
1391 size
+= sizeof(ULONG
);
1393 size
= HMETAFILE_UserSize(pFlags
, size
, &mfpict
->hMF
);
1395 GlobalUnlock(*phMfp
);
1402 /******************************************************************************
1403 * HMETAFILEPICT_UserMarshal [OLE32.@]
1405 * Marshals a metafile pict into a buffer.
1408 * pFlags [I] Flags. See notes.
1409 * pBuffer [I] Buffer to marshal the clip format into.
1410 * phMfp [I] Metafile pict to marshal.
1413 * The end of the marshaled data in the buffer.
1416 * Even though the function is documented to take a pointer to a ULONG in
1417 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1418 * the first parameter is a ULONG.
1419 * This function is only intended to be called by the RPC runtime.
1421 unsigned char * __RPC_USER
HMETAFILEPICT_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILEPICT
*phMfp
)
1423 TRACE("(%s, %p, &%p)\n", debugstr_user_flags(pFlags
), pBuffer
, *phMfp
);
1425 if (LOWORD(*pFlags
) == MSHCTX_INPROC
)
1427 if (sizeof(HMETAFILEPICT
) == 8)
1428 *(ULONG
*)pBuffer
= WDT_INPROC64_CALL
;
1430 *(ULONG
*)pBuffer
= WDT_INPROC_CALL
;
1431 pBuffer
+= sizeof(ULONG
);
1432 *(HMETAFILEPICT
*)pBuffer
= *phMfp
;
1433 pBuffer
+= sizeof(HMETAFILEPICT
);
1437 *(ULONG
*)pBuffer
= WDT_REMOTE_CALL
;
1438 pBuffer
+= sizeof(ULONG
);
1439 *(ULONG
*)pBuffer
= (ULONG
)(ULONG_PTR
)*phMfp
;
1440 pBuffer
+= sizeof(ULONG
);
1444 METAFILEPICT
*mfpict
= GlobalLock(*phMfp
);
1445 remoteMETAFILEPICT
* remmfpict
= (remoteMETAFILEPICT
*)pBuffer
;
1447 /* FIXME: raise an exception if mfpict is NULL? */
1448 remmfpict
->mm
= mfpict
->mm
;
1449 remmfpict
->xExt
= mfpict
->xExt
;
1450 remmfpict
->yExt
= mfpict
->yExt
;
1451 pBuffer
+= 3 * sizeof(ULONG
);
1452 *(ULONG
*)pBuffer
= USER_MARSHAL_PTR_PREFIX
;
1453 pBuffer
+= sizeof(ULONG
);
1455 pBuffer
= HMETAFILE_UserMarshal(pFlags
, pBuffer
, &mfpict
->hMF
);
1457 GlobalUnlock(*phMfp
);
1463 /******************************************************************************
1464 * HMETAFILEPICT_UserUnmarshal [OLE32.@]
1466 * Unmarshals an metafile pict from a buffer.
1469 * pFlags [I] Flags. See notes.
1470 * pBuffer [I] Buffer to marshal the clip format from.
1471 * phMfp [O] Address that receive the unmarshaled metafile pict.
1474 * The end of the marshaled data in the buffer.
1477 * Even though the function is documented to take a pointer to an ULONG in
1478 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1479 * the first parameter is an ULONG.
1480 * This function is only intended to be called by the RPC runtime.
1482 unsigned char * __RPC_USER
HMETAFILEPICT_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, HMETAFILEPICT
*phMfp
)
1486 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, phMfp
);
1488 fContext
= *(ULONG
*)pBuffer
;
1489 pBuffer
+= sizeof(ULONG
);
1491 if ((fContext
== WDT_INPROC_CALL
) || fContext
== WDT_INPROC64_CALL
)
1493 *phMfp
= *(HMETAFILEPICT
*)pBuffer
;
1494 pBuffer
+= sizeof(HMETAFILEPICT
);
1498 ULONG handle
= *(ULONG
*)pBuffer
;
1499 pBuffer
+= sizeof(ULONG
);
1504 METAFILEPICT
*mfpict
;
1505 const remoteMETAFILEPICT
*remmfpict
;
1506 ULONG user_marshal_prefix
;
1508 remmfpict
= (const remoteMETAFILEPICT
*)pBuffer
;
1510 *phMfp
= GlobalAlloc(GMEM_MOVEABLE
, sizeof(METAFILEPICT
));
1512 RpcRaiseException(E_OUTOFMEMORY
);
1514 mfpict
= GlobalLock(*phMfp
);
1515 mfpict
->mm
= remmfpict
->mm
;
1516 mfpict
->xExt
= remmfpict
->xExt
;
1517 mfpict
->yExt
= remmfpict
->yExt
;
1518 pBuffer
+= 3 * sizeof(ULONG
);
1519 user_marshal_prefix
= *(ULONG
*)pBuffer
;
1520 pBuffer
+= sizeof(ULONG
);
1522 if (user_marshal_prefix
!= USER_MARSHAL_PTR_PREFIX
)
1523 RpcRaiseException(RPC_X_INVALID_TAG
);
1525 pBuffer
= HMETAFILE_UserUnmarshal(pFlags
, pBuffer
, &mfpict
->hMF
);
1527 GlobalUnlock(*phMfp
);
1533 /******************************************************************************
1534 * HMETAFILEPICT_UserFree [OLE32.@]
1536 * Frees an unmarshaled metafile pict.
1539 * pFlags [I] Flags. See notes.
1540 * phMfp [I] Metafile pict to free.
1543 * The end of the marshaled data in the buffer.
1546 * Even though the function is documented to take a pointer to a ULONG in
1547 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1548 * which the first parameter is a ULONG.
1549 * This function is only intended to be called by the RPC runtime.
1551 void __RPC_USER
HMETAFILEPICT_UserFree(ULONG
*pFlags
, HMETAFILEPICT
*phMfp
)
1553 TRACE("(%s, &%p)\n", debugstr_user_flags(pFlags
), *phMfp
);
1555 if ((LOWORD(*pFlags
) != MSHCTX_INPROC
) && *phMfp
)
1557 METAFILEPICT
*mfpict
;
1559 mfpict
= GlobalLock(*phMfp
);
1560 /* FIXME: raise an exception if mfpict is NULL? */
1561 HMETAFILE_UserFree(pFlags
, &mfpict
->hMF
);
1562 GlobalUnlock(*phMfp
);
1568 /******************************************************************************
1569 * WdtpInterfacePointer_UserSize [OLE32.@]
1571 * Calculates the buffer size required to marshal an interface pointer.
1574 * pFlags [I] Flags. See notes.
1575 * RealFlags [I] The MSHCTX to use when marshaling the interface.
1576 * punk [I] Interface pointer to size.
1577 * StartingSize [I] Starting size of the buffer. This value is added on to
1578 * the buffer size required for the clip format.
1579 * riid [I] ID of interface to size.
1582 * The buffer size required to marshal an interface pointer plus the starting size.
1585 * Even though the function is documented to take a pointer to a ULONG in
1586 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1587 * the first parameter is a ULONG.
1589 ULONG __RPC_USER
WdtpInterfacePointer_UserSize(ULONG
*pFlags
, ULONG RealFlags
, ULONG StartingSize
, IUnknown
*punk
, REFIID riid
)
1591 DWORD marshal_size
= 0;
1594 TRACE("(%s, 0%x, %d, %p, %s)\n", debugstr_user_flags(pFlags
), RealFlags
, StartingSize
, punk
, debugstr_guid(riid
));
1596 hr
= CoGetMarshalSizeMax(&marshal_size
, riid
, punk
, LOWORD(RealFlags
), NULL
, MSHLFLAGS_NORMAL
);
1597 if(FAILED(hr
)) return StartingSize
;
1599 ALIGN_LENGTH(StartingSize
, 3);
1600 StartingSize
+= 2 * sizeof(DWORD
);
1601 return StartingSize
+ marshal_size
;
1604 /******************************************************************************
1605 * WdtpInterfacePointer_UserMarshal [OLE32.@]
1607 * Marshals an interface pointer into a buffer.
1610 * pFlags [I] Flags. See notes.
1611 * RealFlags [I] The MSHCTX to use when marshaling the interface.
1612 * pBuffer [I] Buffer to marshal the clip format into.
1613 * punk [I] Interface pointer to marshal.
1614 * riid [I] ID of interface to marshal.
1617 * The end of the marshaled data in the buffer.
1620 * Even though the function is documented to take a pointer to a ULONG in
1621 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1622 * the first parameter is a ULONG.
1624 unsigned char * WINAPI
WdtpInterfacePointer_UserMarshal(ULONG
*pFlags
, ULONG RealFlags
, unsigned char *pBuffer
, IUnknown
*punk
, REFIID riid
)
1626 HGLOBAL h
= GlobalAlloc(GMEM_MOVEABLE
, 0);
1631 TRACE("(%s, 0x%x, %p, &%p, %s)\n", debugstr_user_flags(pFlags
), RealFlags
, pBuffer
, punk
, debugstr_guid(riid
));
1634 if(CreateStreamOnHGlobal(h
, TRUE
, &stm
) != S_OK
)
1640 if(CoMarshalInterface(stm
, riid
, punk
, LOWORD(RealFlags
), NULL
, MSHLFLAGS_NORMAL
) != S_OK
)
1642 IStream_Release(stm
);
1646 ALIGN_POINTER(pBuffer
, 3);
1647 size
= GlobalSize(h
);
1649 *(DWORD
*)pBuffer
= size
;
1650 pBuffer
+= sizeof(DWORD
);
1651 *(DWORD
*)pBuffer
= size
;
1652 pBuffer
+= sizeof(DWORD
);
1654 ptr
= GlobalLock(h
);
1655 memcpy(pBuffer
, ptr
, size
);
1658 IStream_Release(stm
);
1659 return pBuffer
+ size
;
1662 /******************************************************************************
1663 * WdtpInterfacePointer_UserUnmarshal [OLE32.@]
1665 * Unmarshals an interface pointer from a buffer.
1668 * pFlags [I] Flags. See notes.
1669 * pBuffer [I] Buffer to marshal the clip format from.
1670 * ppunk [I/O] Address that receives the unmarshaled interface pointer.
1671 * riid [I] ID of interface to unmarshal.
1674 * The end of the marshaled data in the buffer.
1677 * Even though the function is documented to take a pointer to an ULONG in
1678 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1679 * the first parameter is an ULONG.
1681 unsigned char * WINAPI
WdtpInterfacePointer_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, IUnknown
**ppunk
, REFIID riid
)
1689 TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags
), pBuffer
, ppunk
, debugstr_guid(riid
));
1691 ALIGN_POINTER(pBuffer
, 3);
1693 size
= *(DWORD
*)pBuffer
;
1694 pBuffer
+= sizeof(DWORD
);
1695 if(size
!= *(DWORD
*)pBuffer
)
1696 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1698 pBuffer
+= sizeof(DWORD
);
1700 /* FIXME: sanity check on size */
1702 h
= GlobalAlloc(GMEM_MOVEABLE
, size
);
1703 if(!h
) RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1705 if(CreateStreamOnHGlobal(h
, TRUE
, &stm
) != S_OK
)
1708 RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1711 ptr
= GlobalLock(h
);
1712 memcpy(ptr
, pBuffer
, size
);
1715 hr
= CoUnmarshalInterface(stm
, riid
, (void**)ppunk
);
1716 IStream_Release(stm
);
1718 if(hr
!= S_OK
) RaiseException(hr
, 0, 0, NULL
);
1720 return pBuffer
+ size
;
1723 /******************************************************************************
1724 * WdtpInterfacePointer_UserFree [OLE32.@]
1726 * Releases an unmarshaled interface pointer.
1729 * punk [I] Interface pointer to release.
1734 void WINAPI
WdtpInterfacePointer_UserFree(IUnknown
*punk
)
1736 TRACE("(%p)\n", punk
);
1737 if(punk
) IUnknown_Release(punk
);
1740 /******************************************************************************
1741 * STGMEDIUM_UserSize [OLE32.@]
1743 * Calculates the buffer size required to marshal an STGMEDIUM.
1746 * pFlags [I] Flags. See notes.
1747 * StartingSize [I] Starting size of the buffer. This value is added on to
1748 * the buffer size required for the clip format.
1749 * pStgMedium [I] STGMEDIUM to size.
1752 * The buffer size required to marshal an STGMEDIUM plus the starting size.
1755 * Even though the function is documented to take a pointer to a ULONG in
1756 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1757 * the first parameter is a ULONG.
1758 * This function is only intended to be called by the RPC runtime.
1760 ULONG __RPC_USER
STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, STGMEDIUM
*pStgMedium
)
1762 ULONG size
= StartingSize
;
1764 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pStgMedium
);
1766 ALIGN_LENGTH(size
, 3);
1768 size
+= 2 * sizeof(DWORD
);
1769 if (pStgMedium
->tymed
!= TYMED_NULL
)
1770 size
+= sizeof(DWORD
);
1772 switch (pStgMedium
->tymed
)
1775 TRACE("TYMED_NULL\n");
1778 TRACE("TYMED_HGLOBAL\n");
1779 if (pStgMedium
->u
.hGlobal
)
1780 size
= HGLOBAL_UserSize(pFlags
, size
, &pStgMedium
->u
.hGlobal
);
1783 TRACE("TYMED_FILE\n");
1784 if (pStgMedium
->u
.lpszFileName
)
1786 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1787 size
+= 3 * sizeof(DWORD
) +
1788 (strlenW(pStgMedium
->u
.lpszFileName
) + 1) * sizeof(WCHAR
);
1792 TRACE("TYMED_ISTREAM\n");
1793 if (pStgMedium
->u
.pstm
)
1796 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1797 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStream
);
1798 IUnknown_Release(unk
);
1801 case TYMED_ISTORAGE
:
1802 TRACE("TYMED_ISTORAGE\n");
1803 if (pStgMedium
->u
.pstg
)
1806 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1807 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStorage
);
1808 IUnknown_Release(unk
);
1812 TRACE("TYMED_GDI\n");
1813 if (pStgMedium
->u
.hBitmap
)
1815 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1819 TRACE("TYMED_MFPICT\n");
1820 if (pStgMedium
->u
.hMetaFilePict
)
1821 size
= HMETAFILEPICT_UserSize(pFlags
, size
, &pStgMedium
->u
.hMetaFilePict
);
1824 TRACE("TYMED_ENHMF\n");
1825 if (pStgMedium
->u
.hEnhMetaFile
)
1826 size
= HENHMETAFILE_UserSize(pFlags
, size
, &pStgMedium
->u
.hEnhMetaFile
);
1829 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1832 if (pStgMedium
->pUnkForRelease
)
1833 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1838 /******************************************************************************
1839 * STGMEDIUM_UserMarshal [OLE32.@]
1841 * Marshals a STGMEDIUM into a buffer.
1844 * pFlags [I] Flags. See notes.
1845 * pBuffer [I] Buffer to marshal the clip format into.
1846 * pCF [I] STGMEDIUM to marshal.
1849 * The end of the marshaled data in the buffer.
1852 * Even though the function is documented to take a pointer to a ULONG in
1853 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1854 * the first parameter is a ULONG.
1855 * This function is only intended to be called by the RPC runtime.
1857 unsigned char * __RPC_USER
STGMEDIUM_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1859 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1861 ALIGN_POINTER(pBuffer
, 3);
1863 *(DWORD
*)pBuffer
= pStgMedium
->tymed
;
1864 pBuffer
+= sizeof(DWORD
);
1865 if (pStgMedium
->tymed
!= TYMED_NULL
)
1867 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->u
.pstg
;
1868 pBuffer
+= sizeof(DWORD
);
1870 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->pUnkForRelease
;
1871 pBuffer
+= sizeof(DWORD
);
1873 switch (pStgMedium
->tymed
)
1876 TRACE("TYMED_NULL\n");
1879 TRACE("TYMED_HGLOBAL\n");
1880 if (pStgMedium
->u
.hGlobal
)
1881 pBuffer
= HGLOBAL_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1884 TRACE("TYMED_FILE\n");
1885 if (pStgMedium
->u
.lpszFileName
)
1888 len
= strlenW(pStgMedium
->u
.lpszFileName
);
1890 *(DWORD
*)pBuffer
= len
+ 1;
1891 pBuffer
+= sizeof(DWORD
);
1893 *(DWORD
*)pBuffer
= 0;
1894 pBuffer
+= sizeof(DWORD
);
1896 *(DWORD
*)pBuffer
= len
+ 1;
1897 pBuffer
+= sizeof(DWORD
);
1899 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1900 memcpy(pBuffer
, pStgMedium
->u
.lpszFileName
, (len
+ 1) * sizeof(WCHAR
));
1904 TRACE("TYMED_ISTREAM\n");
1905 if (pStgMedium
->u
.pstm
)
1908 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1909 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStream
);
1910 IUnknown_Release(unk
);
1913 case TYMED_ISTORAGE
:
1914 TRACE("TYMED_ISTORAGE\n");
1915 if (pStgMedium
->u
.pstg
)
1918 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1919 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStorage
);
1920 IUnknown_Release(unk
);
1924 TRACE("TYMED_GDI\n");
1925 if (pStgMedium
->u
.hBitmap
)
1927 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1931 TRACE("TYMED_MFPICT\n");
1932 if (pStgMedium
->u
.hMetaFilePict
)
1933 pBuffer
= HMETAFILEPICT_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
1936 TRACE("TYMED_ENHMF\n");
1937 if (pStgMedium
->u
.hEnhMetaFile
)
1938 pBuffer
= HENHMETAFILE_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
1941 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1944 if (pStgMedium
->pUnkForRelease
)
1945 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1950 /******************************************************************************
1951 * STGMEDIUM_UserUnmarshal [OLE32.@]
1953 * Unmarshals a STGMEDIUM from a buffer.
1956 * pFlags [I] Flags. See notes.
1957 * pBuffer [I] Buffer to marshal the clip format from.
1958 * pStgMedium [O] Address that receive the unmarshaled STGMEDIUM.
1961 * The end of the marshaled data in the buffer.
1964 * Even though the function is documented to take a pointer to an ULONG in
1965 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1966 * the first parameter is an ULONG.
1967 * This function is only intended to be called by the RPC runtime.
1969 unsigned char * __RPC_USER
STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1974 ALIGN_POINTER(pBuffer
, 3);
1976 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1978 pStgMedium
->tymed
= *(DWORD
*)pBuffer
;
1979 pBuffer
+= sizeof(DWORD
);
1980 if (pStgMedium
->tymed
!= TYMED_NULL
)
1982 content
= *(DWORD
*)pBuffer
;
1983 pBuffer
+= sizeof(DWORD
);
1985 releaseunk
= *(DWORD
*)pBuffer
;
1986 pBuffer
+= sizeof(DWORD
);
1988 switch (pStgMedium
->tymed
)
1991 TRACE("TYMED_NULL\n");
1994 TRACE("TYMED_HGLOBAL\n");
1996 pBuffer
= HGLOBAL_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1999 TRACE("TYMED_FILE\n");
2004 conformance
= *(DWORD
*)pBuffer
;
2005 pBuffer
+= sizeof(DWORD
);
2006 if (*(DWORD
*)pBuffer
!= 0)
2008 ERR("invalid offset %d\n", *(DWORD
*)pBuffer
);
2009 RpcRaiseException(RPC_S_INVALID_BOUND
);
2012 pBuffer
+= sizeof(DWORD
);
2013 variance
= *(DWORD
*)pBuffer
;
2014 pBuffer
+= sizeof(DWORD
);
2015 if (conformance
!= variance
)
2017 ERR("conformance (%d) and variance (%d) should be equal\n",
2018 conformance
, variance
);
2019 RpcRaiseException(RPC_S_INVALID_BOUND
);
2022 if (conformance
> 0x7fffffff)
2024 ERR("conformance 0x%x too large\n", conformance
);
2025 RpcRaiseException(RPC_S_INVALID_BOUND
);
2028 pStgMedium
->u
.lpszFileName
= CoTaskMemAlloc(conformance
* sizeof(WCHAR
));
2029 if (!pStgMedium
->u
.lpszFileName
) RpcRaiseException(ERROR_OUTOFMEMORY
);
2030 TRACE("unmarshalled file name is %s\n", debugstr_wn((const WCHAR
*)pBuffer
, variance
));
2031 memcpy(pStgMedium
->u
.lpszFileName
, pBuffer
, variance
* sizeof(WCHAR
));
2032 pBuffer
+= variance
* sizeof(WCHAR
);
2035 pStgMedium
->u
.lpszFileName
= NULL
;
2038 TRACE("TYMED_ISTREAM\n");
2041 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstm
, &IID_IStream
);
2044 pStgMedium
->u
.pstm
= NULL
;
2046 case TYMED_ISTORAGE
:
2047 TRACE("TYMED_ISTORAGE\n");
2050 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstg
, &IID_IStorage
);
2053 pStgMedium
->u
.pstg
= NULL
;
2056 TRACE("TYMED_GDI\n");
2059 FIXME("not implemented for GDI object\n");
2062 pStgMedium
->u
.hBitmap
= NULL
;
2065 TRACE("TYMED_MFPICT\n");
2067 pBuffer
= HMETAFILEPICT_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
2069 pStgMedium
->u
.hMetaFilePict
= NULL
;
2072 TRACE("TYMED_ENHMF\n");
2074 pBuffer
= HENHMETAFILE_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
2076 pStgMedium
->u
.hEnhMetaFile
= NULL
;
2079 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
2082 pStgMedium
->pUnkForRelease
= NULL
;
2084 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
2089 /******************************************************************************
2090 * STGMEDIUM_UserFree [OLE32.@]
2092 * Frees an unmarshaled STGMEDIUM.
2095 * pFlags [I] Flags. See notes.
2096 * pStgmedium [I] STGMEDIUM to free.
2099 * The end of the marshaled data in the buffer.
2102 * Even though the function is documented to take a pointer to a ULONG in
2103 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
2104 * which the first parameter is a ULONG.
2105 * This function is only intended to be called by the RPC runtime.
2107 void __RPC_USER
STGMEDIUM_UserFree(ULONG
*pFlags
, STGMEDIUM
*pStgMedium
)
2109 TRACE("(%s, %p\n", debugstr_user_flags(pFlags
), pStgMedium
);
2111 ReleaseStgMedium(pStgMedium
);
2114 ULONG __RPC_USER
ASYNC_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, ASYNC_STGMEDIUM
*pStgMedium
)
2117 return STGMEDIUM_UserSize(pFlags
, StartingSize
, pStgMedium
);
2120 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
2123 return STGMEDIUM_UserMarshal(pFlags
, pBuffer
, pStgMedium
);
2126 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
2129 return STGMEDIUM_UserUnmarshal(pFlags
, pBuffer
, pStgMedium
);
2132 void __RPC_USER
ASYNC_STGMEDIUM_UserFree(ULONG
*pFlags
, ASYNC_STGMEDIUM
*pStgMedium
)
2135 STGMEDIUM_UserFree(pFlags
, pStgMedium
);
2138 ULONG __RPC_USER
FLAG_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, FLAG_STGMEDIUM
*pStgMedium
)
2141 return StartingSize
;
2144 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
2150 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
2156 void __RPC_USER
FLAG_STGMEDIUM_UserFree(ULONG
*pFlags
, FLAG_STGMEDIUM
*pStgMedium
)
2161 ULONG __RPC_USER
SNB_UserSize(ULONG
*pFlags
, ULONG StartingSize
, SNB
*pSnb
)
2163 ULONG size
= StartingSize
;
2165 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pSnb
);
2167 ALIGN_LENGTH(size
, 3);
2169 /* two counters from RemSNB header, plus one more ULONG */
2170 size
+= 3*sizeof(ULONG
);
2172 /* now actual data length */
2175 WCHAR
**ptrW
= *pSnb
;
2179 size
+= (strlenW(*ptrW
) + 1)*sizeof(WCHAR
);
2194 unsigned char * __RPC_USER
SNB_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2196 struct SNB_wire
*wire
;
2199 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2201 ALIGN_POINTER(pBuffer
, 3);
2203 wire
= (struct SNB_wire
*)pBuffer
;
2204 wire
->charcnt
= wire
->strcnt
= 0;
2205 size
= 3*sizeof(ULONG
);
2209 WCHAR
**ptrW
= *pSnb
;
2210 WCHAR
*dataW
= wire
->data
;
2214 ULONG len
= strlenW(*ptrW
) + 1;
2217 wire
->charcnt
+= len
;
2218 memcpy(dataW
, *ptrW
, len
*sizeof(WCHAR
));
2221 size
+= len
*sizeof(WCHAR
);
2226 wire
->datalen
= wire
->charcnt
;
2227 return pBuffer
+ size
;
2230 unsigned char * __RPC_USER
SNB_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2232 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2233 struct SNB_wire
*wire
;
2235 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2237 wire
= (struct SNB_wire
*)pBuffer
;
2240 umcb
->pStubMsg
->pfnFree(*pSnb
);
2242 if (wire
->datalen
== 0)
2246 WCHAR
*src
= wire
->data
, *dest
;
2250 ptrW
= *pSnb
= umcb
->pStubMsg
->pfnAllocate((wire
->strcnt
+1)*sizeof(WCHAR
*) + wire
->datalen
);
2251 dest
= (WCHAR
*)(*pSnb
+ wire
->strcnt
+ 1);
2253 for (i
= 0; i
< wire
->strcnt
; i
++)
2255 ULONG len
= strlenW(src
);
2256 memcpy(dest
, src
, (len
+ 1)*sizeof(WCHAR
));
2265 return pBuffer
+ 3*sizeof(ULONG
) + wire
->datalen
*sizeof(WCHAR
);
2268 void __RPC_USER
SNB_UserFree(ULONG
*pFlags
, SNB
*pSnb
)
2270 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2271 TRACE("(%p)\n", pSnb
);
2273 umcb
->pStubMsg
->pfnFree(*pSnb
);
2276 /* call_as/local stubs for unknwn.idl */
2278 HRESULT CALLBACK
IClassFactory_CreateInstance_Proxy(
2279 IClassFactory
* This
,
2280 IUnknown
*pUnkOuter
,
2284 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObject
);
2288 ERR("aggregation is not allowed on remote objects\n");
2289 return CLASS_E_NOAGGREGATION
;
2291 return IClassFactory_RemoteCreateInstance_Proxy(This
, riid
,
2292 (IUnknown
**) ppvObject
);
2295 HRESULT __RPC_STUB
IClassFactory_CreateInstance_Stub(
2296 IClassFactory
* This
,
2298 IUnknown
**ppvObject
)
2300 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObject
);
2301 return IClassFactory_CreateInstance(This
, NULL
, riid
, (void **) ppvObject
);
2304 HRESULT CALLBACK
IClassFactory_LockServer_Proxy(
2305 IClassFactory
* This
,
2312 HRESULT __RPC_STUB
IClassFactory_LockServer_Stub(
2313 IClassFactory
* This
,
2320 /* call_as/local stubs for objidl.idl */
2322 HRESULT CALLBACK
IEnumUnknown_Next_Proxy(
2326 ULONG
*pceltFetched
)
2329 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2330 if (!pceltFetched
) pceltFetched
= &fetched
;
2331 return IEnumUnknown_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2334 HRESULT __RPC_STUB
IEnumUnknown_Next_Stub(
2338 ULONG
*pceltFetched
)
2341 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2343 hr
= IEnumUnknown_Next(This
, celt
, rgelt
, pceltFetched
);
2344 if (hr
== S_OK
) *pceltFetched
= celt
;
2348 HRESULT CALLBACK
IBindCtx_SetBindOptions_Proxy(
2350 BIND_OPTS
*pbindopts
)
2356 HRESULT __RPC_STUB
IBindCtx_SetBindOptions_Stub(
2358 BIND_OPTS2
*pbindopts
)
2364 HRESULT CALLBACK
IBindCtx_GetBindOptions_Proxy(
2366 BIND_OPTS
*pbindopts
)
2372 HRESULT __RPC_STUB
IBindCtx_GetBindOptions_Stub(
2374 BIND_OPTS2
*pbindopts
)
2380 HRESULT CALLBACK
IEnumMoniker_Next_Proxy(
2384 ULONG
*pceltFetched
)
2387 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2388 if (!pceltFetched
) pceltFetched
= &fetched
;
2389 return IEnumMoniker_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2392 HRESULT __RPC_STUB
IEnumMoniker_Next_Stub(
2396 ULONG
*pceltFetched
)
2399 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2401 hr
= IEnumMoniker_Next(This
, celt
, rgelt
, pceltFetched
);
2402 if (hr
== S_OK
) *pceltFetched
= celt
;
2406 BOOL CALLBACK
IRunnableObject_IsRunning_Proxy(
2407 IRunnableObject
* This
)
2411 memset(&rv
, 0, sizeof rv
);
2415 HRESULT __RPC_STUB
IRunnableObject_IsRunning_Stub(
2416 IRunnableObject
* This
)
2422 HRESULT CALLBACK
IMoniker_BindToObject_Proxy(
2425 IMoniker
*pmkToLeft
,
2433 HRESULT __RPC_STUB
IMoniker_BindToObject_Stub(
2436 IMoniker
*pmkToLeft
,
2438 IUnknown
**ppvResult
)
2444 HRESULT CALLBACK
IMoniker_BindToStorage_Proxy(
2447 IMoniker
*pmkToLeft
,
2451 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2452 return IMoniker_RemoteBindToStorage_Proxy(This
, pbc
, pmkToLeft
, riid
, (IUnknown
**)ppvObj
);
2455 HRESULT __RPC_STUB
IMoniker_BindToStorage_Stub(
2458 IMoniker
*pmkToLeft
,
2462 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2463 return IMoniker_BindToStorage(This
, pbc
, pmkToLeft
, riid
, (void**)ppvObj
);
2466 HRESULT CALLBACK
IEnumString_Next_Proxy(
2470 ULONG
*pceltFetched
)
2473 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2474 if (!pceltFetched
) pceltFetched
= &fetched
;
2475 return IEnumString_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2478 HRESULT __RPC_STUB
IEnumString_Next_Stub(
2482 ULONG
*pceltFetched
)
2485 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2487 hr
= IEnumString_Next(This
, celt
, rgelt
, pceltFetched
);
2488 if (hr
== S_OK
) *pceltFetched
= celt
;
2492 HRESULT CALLBACK
ISequentialStream_Read_Proxy(
2493 ISequentialStream
* This
,
2501 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2503 hr
= ISequentialStream_RemoteRead_Proxy(This
, pv
, cb
, &read
);
2504 if(pcbRead
) *pcbRead
= read
;
2509 HRESULT __RPC_STUB
ISequentialStream_Read_Stub(
2510 ISequentialStream
* This
,
2515 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2516 return ISequentialStream_Read(This
, pv
, cb
, pcbRead
);
2519 HRESULT CALLBACK
ISequentialStream_Write_Proxy(
2520 ISequentialStream
* This
,
2528 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2530 hr
= ISequentialStream_RemoteWrite_Proxy(This
, pv
, cb
, &written
);
2531 if(pcbWritten
) *pcbWritten
= written
;
2536 HRESULT __RPC_STUB
ISequentialStream_Write_Stub(
2537 ISequentialStream
* This
,
2542 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2543 return ISequentialStream_Write(This
, pv
, cb
, pcbWritten
);
2546 HRESULT CALLBACK
IStream_Seek_Proxy(
2548 LARGE_INTEGER dlibMove
,
2550 ULARGE_INTEGER
*plibNewPosition
)
2552 ULARGE_INTEGER newpos
;
2555 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2557 hr
= IStream_RemoteSeek_Proxy(This
, dlibMove
, dwOrigin
, &newpos
);
2558 if(plibNewPosition
) *plibNewPosition
= newpos
;
2563 HRESULT __RPC_STUB
IStream_Seek_Stub(
2565 LARGE_INTEGER dlibMove
,
2567 ULARGE_INTEGER
*plibNewPosition
)
2569 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2570 return IStream_Seek(This
, dlibMove
, dwOrigin
, plibNewPosition
);
2573 HRESULT CALLBACK
IStream_CopyTo_Proxy(
2577 ULARGE_INTEGER
*pcbRead
,
2578 ULARGE_INTEGER
*pcbWritten
)
2580 ULARGE_INTEGER read
, written
;
2583 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2585 hr
= IStream_RemoteCopyTo_Proxy(This
, pstm
, cb
, &read
, &written
);
2586 if(pcbRead
) *pcbRead
= read
;
2587 if(pcbWritten
) *pcbWritten
= written
;
2592 HRESULT __RPC_STUB
IStream_CopyTo_Stub(
2596 ULARGE_INTEGER
*pcbRead
,
2597 ULARGE_INTEGER
*pcbWritten
)
2599 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2601 return IStream_CopyTo(This
, pstm
, cb
, pcbRead
, pcbWritten
);
2604 HRESULT CALLBACK
IEnumSTATSTG_Next_Proxy(
2608 ULONG
*pceltFetched
)
2611 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2612 if (!pceltFetched
) pceltFetched
= &fetched
;
2613 return IEnumSTATSTG_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2616 HRESULT __RPC_STUB
IEnumSTATSTG_Next_Stub(
2620 ULONG
*pceltFetched
)
2623 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2625 hr
= IEnumSTATSTG_Next(This
, celt
, rgelt
, pceltFetched
);
2626 if (hr
== S_OK
) *pceltFetched
= celt
;
2630 HRESULT CALLBACK
IStorage_OpenStream_Proxy(
2638 TRACE("(%p)->(%s, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), reserved1
, grfMode
, reserved2
, ppstm
);
2639 if(reserved1
) WARN("reserved1 %p\n", reserved1
);
2641 return IStorage_RemoteOpenStream_Proxy(This
, pwcsName
, 0, NULL
, grfMode
, reserved2
, ppstm
);
2644 HRESULT __RPC_STUB
IStorage_OpenStream_Stub(
2653 TRACE("(%p)->(%s, %d, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), cbReserved1
, reserved1
, grfMode
, reserved2
, ppstm
);
2654 if(cbReserved1
|| reserved1
) WARN("cbReserved1 %d reserved1 %p\n", cbReserved1
, reserved1
);
2656 return IStorage_OpenStream(This
, pwcsName
, NULL
, grfMode
, reserved2
, ppstm
);
2659 HRESULT CALLBACK
IStorage_EnumElements_Proxy(
2664 IEnumSTATSTG
**ppenum
)
2666 TRACE("(%p)->(%d, %p, %d, %p)\n", This
, reserved1
, reserved2
, reserved3
, ppenum
);
2667 if(reserved2
) WARN("reserved2 %p\n", reserved2
);
2669 return IStorage_RemoteEnumElements_Proxy(This
, reserved1
, 0, NULL
, reserved3
, ppenum
);
2672 HRESULT __RPC_STUB
IStorage_EnumElements_Stub(
2678 IEnumSTATSTG
**ppenum
)
2680 TRACE("(%p)->(%d, %d, %p, %d, %p)\n", This
, reserved1
, cbReserved2
, reserved2
, reserved3
, ppenum
);
2681 if(cbReserved2
|| reserved2
) WARN("cbReserved2 %d reserved2 %p\n", cbReserved2
, reserved2
);
2683 return IStorage_EnumElements(This
, reserved1
, NULL
, reserved3
, ppenum
);
2686 HRESULT CALLBACK
ILockBytes_ReadAt_Proxy(
2688 ULARGE_INTEGER ulOffset
,
2696 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2698 hr
= ILockBytes_RemoteReadAt_Proxy(This
, ulOffset
, pv
, cb
, &read
);
2699 if(pcbRead
) *pcbRead
= read
;
2704 HRESULT __RPC_STUB
ILockBytes_ReadAt_Stub(
2706 ULARGE_INTEGER ulOffset
,
2711 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2712 return ILockBytes_ReadAt(This
, ulOffset
, pv
, cb
, pcbRead
);
2715 HRESULT CALLBACK
ILockBytes_WriteAt_Proxy(
2717 ULARGE_INTEGER ulOffset
,
2725 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2727 hr
= ILockBytes_RemoteWriteAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2728 if(pcbWritten
) *pcbWritten
= written
;
2733 HRESULT __RPC_STUB
ILockBytes_WriteAt_Stub(
2735 ULARGE_INTEGER ulOffset
,
2740 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2741 return ILockBytes_WriteAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2744 HRESULT CALLBACK
IFillLockBytes_FillAppend_Proxy(
2745 IFillLockBytes
* This
,
2753 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2755 hr
= IFillLockBytes_RemoteFillAppend_Proxy(This
, pv
, cb
, &written
);
2756 if(pcbWritten
) *pcbWritten
= written
;
2761 HRESULT __RPC_STUB
IFillLockBytes_FillAppend_Stub(
2762 IFillLockBytes
* This
,
2767 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2768 return IFillLockBytes_FillAppend(This
, pv
, cb
, pcbWritten
);
2771 HRESULT CALLBACK
IFillLockBytes_FillAt_Proxy(
2772 IFillLockBytes
* This
,
2773 ULARGE_INTEGER ulOffset
,
2781 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2783 hr
= IFillLockBytes_RemoteFillAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2784 if(pcbWritten
) *pcbWritten
= written
;
2789 HRESULT __RPC_STUB
IFillLockBytes_FillAt_Stub(
2790 IFillLockBytes
* This
,
2791 ULARGE_INTEGER ulOffset
,
2796 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2797 return IFillLockBytes_FillAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2800 HRESULT CALLBACK
IEnumFORMATETC_Next_Proxy(
2801 IEnumFORMATETC
* This
,
2804 ULONG
*pceltFetched
)
2807 if (!pceltFetched
) pceltFetched
= &fetched
;
2808 return IEnumFORMATETC_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2811 HRESULT __RPC_STUB
IEnumFORMATETC_Next_Stub(
2812 IEnumFORMATETC
* This
,
2815 ULONG
*pceltFetched
)
2819 hr
= IEnumFORMATETC_Next(This
, celt
, rgelt
, pceltFetched
);
2820 if (hr
== S_OK
) *pceltFetched
= celt
;
2824 HRESULT CALLBACK
IEnumSTATDATA_Next_Proxy(
2825 IEnumSTATDATA
* This
,
2828 ULONG
*pceltFetched
)
2831 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2832 if (!pceltFetched
) pceltFetched
= &fetched
;
2833 return IEnumSTATDATA_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2836 HRESULT __RPC_STUB
IEnumSTATDATA_Next_Stub(
2837 IEnumSTATDATA
* This
,
2840 ULONG
*pceltFetched
)
2843 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2845 hr
= IEnumSTATDATA_Next(This
, celt
, rgelt
, pceltFetched
);
2846 if (hr
== S_OK
) *pceltFetched
= celt
;
2850 void CALLBACK
IAdviseSink_OnDataChange_Proxy(
2852 FORMATETC
*pFormatetc
,
2855 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2856 IAdviseSink_RemoteOnDataChange_Proxy(This
, pFormatetc
, pStgmed
);
2859 HRESULT __RPC_STUB
IAdviseSink_OnDataChange_Stub(
2861 FORMATETC
*pFormatetc
,
2862 ASYNC_STGMEDIUM
*pStgmed
)
2864 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2865 IAdviseSink_OnDataChange(This
, pFormatetc
, pStgmed
);
2869 void CALLBACK
IAdviseSink_OnViewChange_Proxy(
2874 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2875 IAdviseSink_RemoteOnViewChange_Proxy(This
, dwAspect
, lindex
);
2878 HRESULT __RPC_STUB
IAdviseSink_OnViewChange_Stub(
2883 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2884 IAdviseSink_OnViewChange(This
, dwAspect
, lindex
);
2888 void CALLBACK
IAdviseSink_OnRename_Proxy(
2892 TRACE("(%p)->(%p)\n", This
, pmk
);
2893 IAdviseSink_RemoteOnRename_Proxy(This
, pmk
);
2896 HRESULT __RPC_STUB
IAdviseSink_OnRename_Stub(
2900 TRACE("(%p)->(%p)\n", This
, pmk
);
2901 IAdviseSink_OnRename(This
, pmk
);
2905 void CALLBACK
IAdviseSink_OnSave_Proxy(
2908 TRACE("(%p)\n", This
);
2909 IAdviseSink_RemoteOnSave_Proxy(This
);
2912 HRESULT __RPC_STUB
IAdviseSink_OnSave_Stub(
2915 TRACE("(%p)\n", This
);
2916 IAdviseSink_OnSave(This
);
2920 void CALLBACK
IAdviseSink_OnClose_Proxy(
2923 TRACE("(%p)\n", This
);
2924 IAdviseSink_RemoteOnClose_Proxy(This
);
2927 HRESULT __RPC_STUB
IAdviseSink_OnClose_Stub(
2930 TRACE("(%p)\n", This
);
2931 IAdviseSink_OnClose(This
);
2935 void CALLBACK
IAdviseSink2_OnLinkSrcChange_Proxy(
2939 TRACE("(%p)->(%p)\n", This
, pmk
);
2940 IAdviseSink2_RemoteOnLinkSrcChange_Proxy(This
, pmk
);
2943 HRESULT __RPC_STUB
IAdviseSink2_OnLinkSrcChange_Stub(
2947 TRACE("(%p)->(%p)\n", This
, pmk
);
2948 IAdviseSink2_OnLinkSrcChange(This
, pmk
);
2952 HRESULT CALLBACK
IDataObject_GetData_Proxy(
2954 FORMATETC
*pformatetcIn
,
2957 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pmedium
);
2958 return IDataObject_RemoteGetData_Proxy(This
, pformatetcIn
, pmedium
);
2961 HRESULT __RPC_STUB
IDataObject_GetData_Stub(
2963 FORMATETC
*pformatetcIn
,
2964 STGMEDIUM
*pRemoteMedium
)
2966 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pRemoteMedium
);
2967 return IDataObject_GetData(This
, pformatetcIn
, pRemoteMedium
);
2970 HRESULT CALLBACK
IDataObject_GetDataHere_Proxy(
2972 FORMATETC
*pformatetc
,
2975 TRACE("(%p)->(%p, %p)\n", This
, pformatetc
, pmedium
);
2976 return IDataObject_RemoteGetDataHere_Proxy(This
, pformatetc
, pmedium
);
2979 HRESULT __RPC_STUB
IDataObject_GetDataHere_Stub(
2981 FORMATETC
*pformatetc
,
2982 STGMEDIUM
*pRemoteMedium
)
2984 TRACE("(%p)->(%p, %p)\n", This
, pformatetc
, pRemoteMedium
);
2985 return IDataObject_GetDataHere(This
, pformatetc
, pRemoteMedium
);
2988 HRESULT CALLBACK
IDataObject_SetData_Proxy(
2990 FORMATETC
*pformatetc
,
2998 HRESULT __RPC_STUB
IDataObject_SetData_Stub(
3000 FORMATETC
*pformatetc
,
3001 FLAG_STGMEDIUM
*pmedium
,
3008 /* call_as/local stubs for oleidl.idl */
3010 HRESULT CALLBACK
IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
3011 IOleInPlaceActiveObject
* This
,
3018 HRESULT __RPC_STUB
IOleInPlaceActiveObject_TranslateAccelerator_Stub(
3019 IOleInPlaceActiveObject
* This
)
3025 HRESULT CALLBACK
IOleInPlaceActiveObject_ResizeBorder_Proxy(
3026 IOleInPlaceActiveObject
* This
,
3028 IOleInPlaceUIWindow
*pUIWindow
,
3035 HRESULT __RPC_STUB
IOleInPlaceActiveObject_ResizeBorder_Stub(
3036 IOleInPlaceActiveObject
* This
,
3039 IOleInPlaceUIWindow
*pUIWindow
,
3046 HRESULT CALLBACK
IOleCache2_UpdateCache_Proxy(
3048 LPDATAOBJECT pDataObject
,
3056 HRESULT __RPC_STUB
IOleCache2_UpdateCache_Stub(
3058 LPDATAOBJECT pDataObject
,
3066 HRESULT CALLBACK
IEnumOLEVERB_Next_Proxy(
3070 ULONG
*pceltFetched
)
3073 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
3074 if (!pceltFetched
) pceltFetched
= &fetched
;
3075 return IEnumOLEVERB_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
3078 HRESULT __RPC_STUB
IEnumOLEVERB_Next_Stub(
3082 ULONG
*pceltFetched
)
3085 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
3087 hr
= IEnumOLEVERB_Next(This
, celt
, rgelt
, pceltFetched
);
3088 if (hr
== S_OK
) *pceltFetched
= celt
;
3092 HRESULT CALLBACK
IViewObject_Draw_Proxy(
3097 DVTARGETDEVICE
*ptd
,
3100 LPCRECTL lprcBounds
,
3101 LPCRECTL lprcWBounds
,
3102 BOOL (STDMETHODCALLTYPE
*pfnContinue
)(ULONG_PTR dwContinue
),
3103 ULONG_PTR dwContinue
)
3109 HRESULT __RPC_STUB
IViewObject_Draw_Stub(
3114 DVTARGETDEVICE
*ptd
,
3115 ULONG_PTR hdcTargetDev
,
3117 LPCRECTL lprcBounds
,
3118 LPCRECTL lprcWBounds
,
3119 IContinue
*pContinue
)
3125 HRESULT CALLBACK
IViewObject_GetColorSet_Proxy(
3130 DVTARGETDEVICE
*ptd
,
3132 LOGPALETTE
**ppColorSet
)
3138 HRESULT __RPC_STUB
IViewObject_GetColorSet_Stub(
3143 DVTARGETDEVICE
*ptd
,
3144 ULONG_PTR hicTargetDev
,
3145 LOGPALETTE
**ppColorSet
)
3151 HRESULT CALLBACK
IViewObject_Freeze_Proxy(
3162 HRESULT __RPC_STUB
IViewObject_Freeze_Stub(
3173 HRESULT CALLBACK
IViewObject_GetAdvise_Proxy(
3177 IAdviseSink
**ppAdvSink
)
3183 HRESULT __RPC_STUB
IViewObject_GetAdvise_Stub(
3187 IAdviseSink
**ppAdvSink
)