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
)
1494 TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags
), pBuffer
, ppunk
, debugstr_guid(riid
));
1496 ALIGN_POINTER(pBuffer
, 3);
1498 size
= *(DWORD
*)pBuffer
;
1499 pBuffer
+= sizeof(DWORD
);
1500 if(size
!= *(DWORD
*)pBuffer
)
1501 RaiseException(RPC_X_BAD_STUB_DATA
, 0, 0, NULL
);
1503 pBuffer
+= sizeof(DWORD
);
1505 /* FIXME: sanity check on size */
1507 h
= GlobalAlloc(GMEM_MOVEABLE
, size
);
1508 if(!h
) RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1510 if(CreateStreamOnHGlobal(h
, TRUE
, &stm
) != S_OK
)
1513 RaiseException(RPC_X_NO_MEMORY
, 0, 0, NULL
);
1516 ptr
= GlobalLock(h
);
1517 memcpy(ptr
, pBuffer
, size
);
1520 hr
= CoUnmarshalInterface(stm
, riid
, (void**)ppunk
);
1521 IStream_Release(stm
);
1523 if(hr
!= S_OK
) RaiseException(hr
, 0, 0, NULL
);
1525 return pBuffer
+ size
;
1528 /******************************************************************************
1529 * WdtpInterfacePointer_UserFree [OLE32.@]
1531 * Releases an unmarshaled interface pointer.
1534 * punk [I] Interface pointer to release.
1539 void WINAPI
WdtpInterfacePointer_UserFree(IUnknown
*punk
)
1541 TRACE("(%p)\n", punk
);
1542 if(punk
) IUnknown_Release(punk
);
1545 /******************************************************************************
1546 * STGMEDIUM_UserSize [OLE32.@]
1548 * Calculates the buffer size required to marshal an STGMEDIUM.
1551 * pFlags [I] Flags. See notes.
1552 * StartingSize [I] Starting size of the buffer. This value is added on to
1553 * the buffer size required for the clip format.
1554 * pStgMedium [I] STGMEDIUM to size.
1557 * The buffer size required to marshal an STGMEDIUM plus the starting size.
1560 * Even though the function is documented to take a pointer to a ULONG in
1561 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1562 * the first parameter is a ULONG.
1563 * This function is only intended to be called by the RPC runtime.
1565 ULONG __RPC_USER
STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, STGMEDIUM
*pStgMedium
)
1567 ULONG size
= StartingSize
;
1569 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pStgMedium
);
1571 ALIGN_LENGTH(size
, 3);
1573 size
+= 2 * sizeof(DWORD
);
1574 if (pStgMedium
->tymed
!= TYMED_NULL
)
1575 size
+= sizeof(DWORD
);
1577 switch (pStgMedium
->tymed
)
1580 TRACE("TYMED_NULL\n");
1583 TRACE("TYMED_HGLOBAL\n");
1584 if (pStgMedium
->u
.hGlobal
)
1585 size
= HGLOBAL_UserSize(pFlags
, size
, &pStgMedium
->u
.hGlobal
);
1588 TRACE("TYMED_FILE\n");
1589 if (pStgMedium
->u
.lpszFileName
)
1591 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1592 size
+= 3 * sizeof(DWORD
) +
1593 (strlenW(pStgMedium
->u
.lpszFileName
) + 1) * sizeof(WCHAR
);
1597 TRACE("TYMED_ISTREAM\n");
1598 if (pStgMedium
->u
.pstm
)
1601 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1602 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStream
);
1603 IUnknown_Release(unk
);
1606 case TYMED_ISTORAGE
:
1607 TRACE("TYMED_ISTORAGE\n");
1608 if (pStgMedium
->u
.pstg
)
1611 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1612 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, unk
, &IID_IStorage
);
1613 IUnknown_Release(unk
);
1617 TRACE("TYMED_GDI\n");
1618 if (pStgMedium
->u
.hBitmap
)
1620 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1624 TRACE("TYMED_MFPICT\n");
1625 if (pStgMedium
->u
.hMetaFilePict
)
1626 size
= HMETAFILEPICT_UserSize(pFlags
, size
, &pStgMedium
->u
.hMetaFilePict
);
1629 TRACE("TYMED_ENHMF\n");
1630 if (pStgMedium
->u
.hEnhMetaFile
)
1631 size
= HENHMETAFILE_UserSize(pFlags
, size
, &pStgMedium
->u
.hEnhMetaFile
);
1634 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1637 if (pStgMedium
->pUnkForRelease
)
1638 size
= WdtpInterfacePointer_UserSize(pFlags
, LOWORD(*pFlags
), size
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1643 /******************************************************************************
1644 * STGMEDIUM_UserMarshal [OLE32.@]
1646 * Marshals a STGMEDIUM into a buffer.
1649 * pFlags [I] Flags. See notes.
1650 * pBuffer [I] Buffer to marshal the clip format into.
1651 * pCF [I] STGMEDIUM to marshal.
1654 * The end of the marshaled data in the buffer.
1657 * Even though the function is documented to take a pointer to a ULONG in
1658 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1659 * the first parameter is a ULONG.
1660 * This function is only intended to be called by the RPC runtime.
1662 unsigned char * __RPC_USER
STGMEDIUM_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1664 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1666 ALIGN_POINTER(pBuffer
, 3);
1668 *(DWORD
*)pBuffer
= pStgMedium
->tymed
;
1669 pBuffer
+= sizeof(DWORD
);
1670 if (pStgMedium
->tymed
!= TYMED_NULL
)
1672 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->u
.pstg
;
1673 pBuffer
+= sizeof(DWORD
);
1675 *(DWORD
*)pBuffer
= (DWORD
)(DWORD_PTR
)pStgMedium
->pUnkForRelease
;
1676 pBuffer
+= sizeof(DWORD
);
1678 switch (pStgMedium
->tymed
)
1681 TRACE("TYMED_NULL\n");
1684 TRACE("TYMED_HGLOBAL\n");
1685 if (pStgMedium
->u
.hGlobal
)
1686 pBuffer
= HGLOBAL_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1689 TRACE("TYMED_FILE\n");
1690 if (pStgMedium
->u
.lpszFileName
)
1693 len
= strlenW(pStgMedium
->u
.lpszFileName
);
1695 *(DWORD
*)pBuffer
= len
+ 1;
1696 pBuffer
+= sizeof(DWORD
);
1698 *(DWORD
*)pBuffer
= 0;
1699 pBuffer
+= sizeof(DWORD
);
1701 *(DWORD
*)pBuffer
= len
+ 1;
1702 pBuffer
+= sizeof(DWORD
);
1704 TRACE("file name is %s\n", debugstr_w(pStgMedium
->u
.lpszFileName
));
1705 memcpy(pBuffer
, pStgMedium
->u
.lpszFileName
, (len
+ 1) * sizeof(WCHAR
));
1709 TRACE("TYMED_ISTREAM\n");
1710 if (pStgMedium
->u
.pstm
)
1713 IStream_QueryInterface(pStgMedium
->u
.pstm
, &IID_IUnknown
, (void**)&unk
);
1714 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStream
);
1715 IUnknown_Release(unk
);
1718 case TYMED_ISTORAGE
:
1719 TRACE("TYMED_ISTORAGE\n");
1720 if (pStgMedium
->u
.pstg
)
1723 IStorage_QueryInterface(pStgMedium
->u
.pstg
, &IID_IUnknown
, (void**)&unk
);
1724 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, unk
, &IID_IStorage
);
1725 IUnknown_Release(unk
);
1729 TRACE("TYMED_GDI\n");
1730 if (pStgMedium
->u
.hBitmap
)
1732 FIXME("not implemented for GDI object %p\n", pStgMedium
->u
.hBitmap
);
1736 TRACE("TYMED_MFPICT\n");
1737 if (pStgMedium
->u
.hMetaFilePict
)
1738 pBuffer
= HMETAFILEPICT_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
1741 TRACE("TYMED_ENHMF\n");
1742 if (pStgMedium
->u
.hEnhMetaFile
)
1743 pBuffer
= HENHMETAFILE_UserMarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
1746 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1749 if (pStgMedium
->pUnkForRelease
)
1750 pBuffer
= WdtpInterfacePointer_UserMarshal(pFlags
, LOWORD(*pFlags
), pBuffer
, pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1755 /******************************************************************************
1756 * STGMEDIUM_UserUnmarshal [OLE32.@]
1758 * Unmarshals a STGMEDIUM from a buffer.
1761 * pFlags [I] Flags. See notes.
1762 * pBuffer [I] Buffer to marshal the clip format from.
1763 * pStgMedium [O] Address that receive the unmarshaled STGMEDIUM.
1766 * The end of the marshaled data in the buffer.
1769 * Even though the function is documented to take a pointer to an ULONG in
1770 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1771 * the first parameter is an ULONG.
1772 * This function is only intended to be called by the RPC runtime.
1774 unsigned char * __RPC_USER
STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, STGMEDIUM
*pStgMedium
)
1779 ALIGN_POINTER(pBuffer
, 3);
1781 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags
), pBuffer
, pStgMedium
);
1783 pStgMedium
->tymed
= *(DWORD
*)pBuffer
;
1784 pBuffer
+= sizeof(DWORD
);
1785 if (pStgMedium
->tymed
!= TYMED_NULL
)
1787 content
= *(DWORD
*)pBuffer
;
1788 pBuffer
+= sizeof(DWORD
);
1790 releaseunk
= *(DWORD
*)pBuffer
;
1791 pBuffer
+= sizeof(DWORD
);
1793 switch (pStgMedium
->tymed
)
1796 TRACE("TYMED_NULL\n");
1799 TRACE("TYMED_HGLOBAL\n");
1801 pBuffer
= HGLOBAL_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hGlobal
);
1804 TRACE("TYMED_FILE\n");
1809 conformance
= *(DWORD
*)pBuffer
;
1810 pBuffer
+= sizeof(DWORD
);
1811 if (*(DWORD
*)pBuffer
!= 0)
1813 ERR("invalid offset %d\n", *(DWORD
*)pBuffer
);
1814 RpcRaiseException(RPC_S_INVALID_BOUND
);
1817 pBuffer
+= sizeof(DWORD
);
1818 variance
= *(DWORD
*)pBuffer
;
1819 pBuffer
+= sizeof(DWORD
);
1820 if (conformance
!= variance
)
1822 ERR("conformance (%d) and variance (%d) should be equal\n",
1823 conformance
, variance
);
1824 RpcRaiseException(RPC_S_INVALID_BOUND
);
1827 if (conformance
> 0x7fffffff)
1829 ERR("conformance 0x%x too large\n", conformance
);
1830 RpcRaiseException(RPC_S_INVALID_BOUND
);
1833 pStgMedium
->u
.lpszFileName
= CoTaskMemAlloc(conformance
* sizeof(WCHAR
));
1834 if (!pStgMedium
->u
.lpszFileName
) RpcRaiseException(ERROR_OUTOFMEMORY
);
1835 TRACE("unmarshalled file name is %s\n", debugstr_wn((const WCHAR
*)pBuffer
, variance
));
1836 memcpy(pStgMedium
->u
.lpszFileName
, pBuffer
, variance
* sizeof(WCHAR
));
1837 pBuffer
+= variance
* sizeof(WCHAR
);
1840 pStgMedium
->u
.lpszFileName
= NULL
;
1843 TRACE("TYMED_ISTREAM\n");
1846 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstm
, &IID_IStream
);
1849 pStgMedium
->u
.pstm
= NULL
;
1851 case TYMED_ISTORAGE
:
1852 TRACE("TYMED_ISTORAGE\n");
1855 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, (IUnknown
**)&pStgMedium
->u
.pstg
, &IID_IStorage
);
1858 pStgMedium
->u
.pstg
= NULL
;
1861 TRACE("TYMED_GDI\n");
1864 FIXME("not implemented for GDI object\n");
1867 pStgMedium
->u
.hBitmap
= NULL
;
1870 TRACE("TYMED_MFPICT\n");
1872 pBuffer
= HMETAFILEPICT_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hMetaFilePict
);
1874 pStgMedium
->u
.hMetaFilePict
= NULL
;
1877 TRACE("TYMED_ENHMF\n");
1879 pBuffer
= HENHMETAFILE_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->u
.hEnhMetaFile
);
1881 pStgMedium
->u
.hEnhMetaFile
= NULL
;
1884 RaiseException(DV_E_TYMED
, 0, 0, NULL
);
1887 pStgMedium
->pUnkForRelease
= NULL
;
1889 pBuffer
= WdtpInterfacePointer_UserUnmarshal(pFlags
, pBuffer
, &pStgMedium
->pUnkForRelease
, &IID_IUnknown
);
1894 /******************************************************************************
1895 * STGMEDIUM_UserFree [OLE32.@]
1897 * Frees an unmarshaled STGMEDIUM.
1900 * pFlags [I] Flags. See notes.
1901 * pStgmedium [I] STGMEDIUM to free.
1904 * The end of the marshaled data in the buffer.
1907 * Even though the function is documented to take a pointer to a ULONG in
1908 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1909 * which the first parameter is a ULONG.
1910 * This function is only intended to be called by the RPC runtime.
1912 void __RPC_USER
STGMEDIUM_UserFree(ULONG
*pFlags
, STGMEDIUM
*pStgMedium
)
1914 TRACE("(%s, %p\n", debugstr_user_flags(pFlags
), pStgMedium
);
1916 ReleaseStgMedium(pStgMedium
);
1919 ULONG __RPC_USER
ASYNC_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, ASYNC_STGMEDIUM
*pStgMedium
)
1922 return STGMEDIUM_UserSize(pFlags
, StartingSize
, pStgMedium
);
1925 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
1928 return STGMEDIUM_UserMarshal(pFlags
, pBuffer
, pStgMedium
);
1931 unsigned char * __RPC_USER
ASYNC_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, ASYNC_STGMEDIUM
*pStgMedium
)
1934 return STGMEDIUM_UserUnmarshal(pFlags
, pBuffer
, pStgMedium
);
1937 void __RPC_USER
ASYNC_STGMEDIUM_UserFree(ULONG
*pFlags
, ASYNC_STGMEDIUM
*pStgMedium
)
1940 STGMEDIUM_UserFree(pFlags
, pStgMedium
);
1943 ULONG __RPC_USER
FLAG_STGMEDIUM_UserSize(ULONG
*pFlags
, ULONG StartingSize
, FLAG_STGMEDIUM
*pStgMedium
)
1946 return StartingSize
;
1949 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserMarshal( ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
1955 unsigned char * __RPC_USER
FLAG_STGMEDIUM_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, FLAG_STGMEDIUM
*pStgMedium
)
1961 void __RPC_USER
FLAG_STGMEDIUM_UserFree(ULONG
*pFlags
, FLAG_STGMEDIUM
*pStgMedium
)
1966 ULONG __RPC_USER
SNB_UserSize(ULONG
*pFlags
, ULONG StartingSize
, SNB
*pSnb
)
1968 ULONG size
= StartingSize
;
1970 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags
), StartingSize
, pSnb
);
1972 ALIGN_LENGTH(size
, 3);
1974 /* two counters from RemSNB header, plus one more ULONG */
1975 size
+= 3*sizeof(ULONG
);
1977 /* now actual data length */
1980 WCHAR
**ptrW
= *pSnb
;
1984 size
+= (strlenW(*ptrW
) + 1)*sizeof(WCHAR
);
1999 unsigned char * __RPC_USER
SNB_UserMarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2001 struct SNB_wire
*wire
;
2004 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2006 ALIGN_POINTER(pBuffer
, 3);
2008 wire
= (struct SNB_wire
*)pBuffer
;
2009 wire
->charcnt
= wire
->strcnt
= 0;
2010 size
= 3*sizeof(ULONG
);
2014 WCHAR
**ptrW
= *pSnb
;
2015 WCHAR
*dataW
= wire
->data
;
2019 ULONG len
= strlenW(*ptrW
) + 1;
2022 wire
->charcnt
+= len
;
2023 memcpy(dataW
, *ptrW
, len
*sizeof(WCHAR
));
2026 size
+= len
*sizeof(WCHAR
);
2031 wire
->datalen
= wire
->charcnt
;
2032 return pBuffer
+ size
;
2035 unsigned char * __RPC_USER
SNB_UserUnmarshal(ULONG
*pFlags
, unsigned char *pBuffer
, SNB
*pSnb
)
2037 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2038 struct SNB_wire
*wire
;
2040 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags
), pBuffer
, pSnb
);
2042 wire
= (struct SNB_wire
*)pBuffer
;
2045 umcb
->pStubMsg
->pfnFree(*pSnb
);
2047 if (wire
->datalen
== 0)
2051 WCHAR
*src
= wire
->data
, *dest
;
2055 ptrW
= *pSnb
= umcb
->pStubMsg
->pfnAllocate((wire
->strcnt
+1)*sizeof(WCHAR
*) + wire
->datalen
*sizeof(WCHAR
));
2056 dest
= (WCHAR
*)(*pSnb
+ wire
->strcnt
+ 1);
2058 for (i
= 0; i
< wire
->strcnt
; i
++)
2060 ULONG len
= strlenW(src
);
2061 memcpy(dest
, src
, (len
+ 1)*sizeof(WCHAR
));
2070 return pBuffer
+ 3*sizeof(ULONG
) + wire
->datalen
*sizeof(WCHAR
);
2073 void __RPC_USER
SNB_UserFree(ULONG
*pFlags
, SNB
*pSnb
)
2075 USER_MARSHAL_CB
*umcb
= (USER_MARSHAL_CB
*)pFlags
;
2076 TRACE("(%p)\n", pSnb
);
2078 umcb
->pStubMsg
->pfnFree(*pSnb
);
2081 /* call_as/local stubs for unknwn.idl */
2083 HRESULT CALLBACK
IClassFactory_CreateInstance_Proxy(
2084 IClassFactory
* This
,
2085 IUnknown
*pUnkOuter
,
2089 TRACE("(%p, %s, %p)\n", pUnkOuter
, debugstr_guid(riid
), ppvObject
);
2093 ERR("aggregation is not allowed on remote objects\n");
2094 return CLASS_E_NOAGGREGATION
;
2096 return IClassFactory_RemoteCreateInstance_Proxy(This
, riid
,
2097 (IUnknown
**) ppvObject
);
2100 HRESULT __RPC_STUB
IClassFactory_CreateInstance_Stub(
2101 IClassFactory
* This
,
2103 IUnknown
**ppvObject
)
2105 TRACE("(%s, %p)\n", debugstr_guid(riid
), ppvObject
);
2106 return IClassFactory_CreateInstance(This
, NULL
, riid
, (void **) ppvObject
);
2109 HRESULT CALLBACK
IClassFactory_LockServer_Proxy(
2110 IClassFactory
* This
,
2117 HRESULT __RPC_STUB
IClassFactory_LockServer_Stub(
2118 IClassFactory
* This
,
2125 /* call_as/local stubs for objidl.idl */
2127 HRESULT CALLBACK
IEnumUnknown_Next_Proxy(
2131 ULONG
*pceltFetched
)
2134 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2135 if (!pceltFetched
) pceltFetched
= &fetched
;
2136 return IEnumUnknown_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2139 HRESULT __RPC_STUB
IEnumUnknown_Next_Stub(
2143 ULONG
*pceltFetched
)
2146 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2148 hr
= IEnumUnknown_Next(This
, celt
, rgelt
, pceltFetched
);
2149 if (hr
== S_OK
) *pceltFetched
= celt
;
2153 HRESULT CALLBACK
IBindCtx_SetBindOptions_Proxy(
2155 BIND_OPTS
*pbindopts
)
2161 HRESULT __RPC_STUB
IBindCtx_SetBindOptions_Stub(
2163 BIND_OPTS2
*pbindopts
)
2169 HRESULT CALLBACK
IBindCtx_GetBindOptions_Proxy(
2171 BIND_OPTS
*pbindopts
)
2177 HRESULT __RPC_STUB
IBindCtx_GetBindOptions_Stub(
2179 BIND_OPTS2
*pbindopts
)
2185 HRESULT CALLBACK
IEnumMoniker_Next_Proxy(
2189 ULONG
*pceltFetched
)
2192 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2193 if (!pceltFetched
) pceltFetched
= &fetched
;
2194 return IEnumMoniker_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2197 HRESULT __RPC_STUB
IEnumMoniker_Next_Stub(
2201 ULONG
*pceltFetched
)
2204 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2206 hr
= IEnumMoniker_Next(This
, celt
, rgelt
, pceltFetched
);
2207 if (hr
== S_OK
) *pceltFetched
= celt
;
2211 BOOL CALLBACK
IRunnableObject_IsRunning_Proxy(
2212 IRunnableObject
* This
)
2216 memset(&rv
, 0, sizeof rv
);
2220 HRESULT __RPC_STUB
IRunnableObject_IsRunning_Stub(
2221 IRunnableObject
* This
)
2227 HRESULT CALLBACK
IMoniker_BindToObject_Proxy(
2230 IMoniker
*pmkToLeft
,
2238 HRESULT __RPC_STUB
IMoniker_BindToObject_Stub(
2241 IMoniker
*pmkToLeft
,
2243 IUnknown
**ppvResult
)
2249 HRESULT CALLBACK
IMoniker_BindToStorage_Proxy(
2252 IMoniker
*pmkToLeft
,
2256 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2257 return IMoniker_RemoteBindToStorage_Proxy(This
, pbc
, pmkToLeft
, riid
, (IUnknown
**)ppvObj
);
2260 HRESULT __RPC_STUB
IMoniker_BindToStorage_Stub(
2263 IMoniker
*pmkToLeft
,
2267 TRACE("(%p)->(%p %p %s %p)\n", This
, pbc
, pmkToLeft
, debugstr_guid(riid
), ppvObj
);
2268 return IMoniker_BindToStorage(This
, pbc
, pmkToLeft
, riid
, (void**)ppvObj
);
2271 HRESULT CALLBACK
IEnumString_Next_Proxy(
2275 ULONG
*pceltFetched
)
2278 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2279 if (!pceltFetched
) pceltFetched
= &fetched
;
2280 return IEnumString_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2283 HRESULT __RPC_STUB
IEnumString_Next_Stub(
2287 ULONG
*pceltFetched
)
2290 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2292 hr
= IEnumString_Next(This
, celt
, rgelt
, pceltFetched
);
2293 if (hr
== S_OK
) *pceltFetched
= celt
;
2297 HRESULT CALLBACK
ISequentialStream_Read_Proxy(
2298 ISequentialStream
* This
,
2306 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2308 hr
= ISequentialStream_RemoteRead_Proxy(This
, pv
, cb
, &read
);
2309 if(pcbRead
) *pcbRead
= read
;
2314 HRESULT __RPC_STUB
ISequentialStream_Read_Stub(
2315 ISequentialStream
* This
,
2320 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbRead
);
2321 return ISequentialStream_Read(This
, pv
, cb
, pcbRead
);
2324 HRESULT CALLBACK
ISequentialStream_Write_Proxy(
2325 ISequentialStream
* This
,
2333 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2335 hr
= ISequentialStream_RemoteWrite_Proxy(This
, pv
, cb
, &written
);
2336 if(pcbWritten
) *pcbWritten
= written
;
2341 HRESULT __RPC_STUB
ISequentialStream_Write_Stub(
2342 ISequentialStream
* This
,
2347 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2348 return ISequentialStream_Write(This
, pv
, cb
, pcbWritten
);
2351 HRESULT CALLBACK
IStream_Seek_Proxy(
2353 LARGE_INTEGER dlibMove
,
2355 ULARGE_INTEGER
*plibNewPosition
)
2357 ULARGE_INTEGER newpos
;
2360 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2362 hr
= IStream_RemoteSeek_Proxy(This
, dlibMove
, dwOrigin
, &newpos
);
2363 if(plibNewPosition
) *plibNewPosition
= newpos
;
2368 HRESULT __RPC_STUB
IStream_Seek_Stub(
2370 LARGE_INTEGER dlibMove
,
2372 ULARGE_INTEGER
*plibNewPosition
)
2374 TRACE("(%p)->(%s, %d, %p)\n", This
, wine_dbgstr_longlong(dlibMove
.QuadPart
), dwOrigin
, plibNewPosition
);
2375 return IStream_Seek(This
, dlibMove
, dwOrigin
, plibNewPosition
);
2378 HRESULT CALLBACK
IStream_CopyTo_Proxy(
2382 ULARGE_INTEGER
*pcbRead
,
2383 ULARGE_INTEGER
*pcbWritten
)
2385 ULARGE_INTEGER read
, written
;
2388 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2390 hr
= IStream_RemoteCopyTo_Proxy(This
, pstm
, cb
, &read
, &written
);
2391 if(pcbRead
) *pcbRead
= read
;
2392 if(pcbWritten
) *pcbWritten
= written
;
2397 HRESULT __RPC_STUB
IStream_CopyTo_Stub(
2401 ULARGE_INTEGER
*pcbRead
,
2402 ULARGE_INTEGER
*pcbWritten
)
2404 TRACE("(%p)->(%p, %s, %p, %p)\n", This
, pstm
, wine_dbgstr_longlong(cb
.QuadPart
), pcbRead
, pcbWritten
);
2406 return IStream_CopyTo(This
, pstm
, cb
, pcbRead
, pcbWritten
);
2409 HRESULT CALLBACK
IEnumSTATSTG_Next_Proxy(
2413 ULONG
*pceltFetched
)
2416 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2417 if (!pceltFetched
) pceltFetched
= &fetched
;
2418 return IEnumSTATSTG_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2421 HRESULT __RPC_STUB
IEnumSTATSTG_Next_Stub(
2425 ULONG
*pceltFetched
)
2428 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2430 hr
= IEnumSTATSTG_Next(This
, celt
, rgelt
, pceltFetched
);
2431 if (hr
== S_OK
) *pceltFetched
= celt
;
2435 HRESULT CALLBACK
IStorage_OpenStream_Proxy(
2443 TRACE("(%p)->(%s, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), reserved1
, grfMode
, reserved2
, ppstm
);
2444 if(reserved1
) WARN("reserved1 %p\n", reserved1
);
2446 return IStorage_RemoteOpenStream_Proxy(This
, pwcsName
, 0, NULL
, grfMode
, reserved2
, ppstm
);
2449 HRESULT __RPC_STUB
IStorage_OpenStream_Stub(
2458 TRACE("(%p)->(%s, %d, %p, %08x, %d %p)\n", This
, debugstr_w(pwcsName
), cbReserved1
, reserved1
, grfMode
, reserved2
, ppstm
);
2459 if(cbReserved1
|| reserved1
) WARN("cbReserved1 %d reserved1 %p\n", cbReserved1
, reserved1
);
2461 return IStorage_OpenStream(This
, pwcsName
, NULL
, grfMode
, reserved2
, ppstm
);
2464 HRESULT CALLBACK
IStorage_EnumElements_Proxy(
2469 IEnumSTATSTG
**ppenum
)
2471 TRACE("(%p)->(%d, %p, %d, %p)\n", This
, reserved1
, reserved2
, reserved3
, ppenum
);
2472 if(reserved2
) WARN("reserved2 %p\n", reserved2
);
2474 return IStorage_RemoteEnumElements_Proxy(This
, reserved1
, 0, NULL
, reserved3
, ppenum
);
2477 HRESULT __RPC_STUB
IStorage_EnumElements_Stub(
2483 IEnumSTATSTG
**ppenum
)
2485 TRACE("(%p)->(%d, %d, %p, %d, %p)\n", This
, reserved1
, cbReserved2
, reserved2
, reserved3
, ppenum
);
2486 if(cbReserved2
|| reserved2
) WARN("cbReserved2 %d reserved2 %p\n", cbReserved2
, reserved2
);
2488 return IStorage_EnumElements(This
, reserved1
, NULL
, reserved3
, ppenum
);
2491 HRESULT CALLBACK
ILockBytes_ReadAt_Proxy(
2493 ULARGE_INTEGER ulOffset
,
2501 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2503 hr
= ILockBytes_RemoteReadAt_Proxy(This
, ulOffset
, pv
, cb
, &read
);
2504 if(pcbRead
) *pcbRead
= read
;
2509 HRESULT __RPC_STUB
ILockBytes_ReadAt_Stub(
2511 ULARGE_INTEGER ulOffset
,
2516 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbRead
);
2517 return ILockBytes_ReadAt(This
, ulOffset
, pv
, cb
, pcbRead
);
2520 HRESULT CALLBACK
ILockBytes_WriteAt_Proxy(
2522 ULARGE_INTEGER ulOffset
,
2530 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2532 hr
= ILockBytes_RemoteWriteAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2533 if(pcbWritten
) *pcbWritten
= written
;
2538 HRESULT __RPC_STUB
ILockBytes_WriteAt_Stub(
2540 ULARGE_INTEGER ulOffset
,
2545 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2546 return ILockBytes_WriteAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2549 HRESULT CALLBACK
IFillLockBytes_FillAppend_Proxy(
2550 IFillLockBytes
* This
,
2558 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2560 hr
= IFillLockBytes_RemoteFillAppend_Proxy(This
, pv
, cb
, &written
);
2561 if(pcbWritten
) *pcbWritten
= written
;
2566 HRESULT __RPC_STUB
IFillLockBytes_FillAppend_Stub(
2567 IFillLockBytes
* This
,
2572 TRACE("(%p)->(%p, %d, %p)\n", This
, pv
, cb
, pcbWritten
);
2573 return IFillLockBytes_FillAppend(This
, pv
, cb
, pcbWritten
);
2576 HRESULT CALLBACK
IFillLockBytes_FillAt_Proxy(
2577 IFillLockBytes
* This
,
2578 ULARGE_INTEGER ulOffset
,
2586 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2588 hr
= IFillLockBytes_RemoteFillAt_Proxy(This
, ulOffset
, pv
, cb
, &written
);
2589 if(pcbWritten
) *pcbWritten
= written
;
2594 HRESULT __RPC_STUB
IFillLockBytes_FillAt_Stub(
2595 IFillLockBytes
* This
,
2596 ULARGE_INTEGER ulOffset
,
2601 TRACE("(%p)->(%s, %p, %d, %p)\n", This
, wine_dbgstr_longlong(ulOffset
.QuadPart
), pv
, cb
, pcbWritten
);
2602 return IFillLockBytes_FillAt(This
, ulOffset
, pv
, cb
, pcbWritten
);
2605 HRESULT CALLBACK
IEnumFORMATETC_Next_Proxy(
2606 IEnumFORMATETC
* This
,
2609 ULONG
*pceltFetched
)
2612 if (!pceltFetched
) pceltFetched
= &fetched
;
2613 return IEnumFORMATETC_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2616 HRESULT __RPC_STUB
IEnumFORMATETC_Next_Stub(
2617 IEnumFORMATETC
* This
,
2620 ULONG
*pceltFetched
)
2624 hr
= IEnumFORMATETC_Next(This
, celt
, rgelt
, pceltFetched
);
2625 if (hr
== S_OK
) *pceltFetched
= celt
;
2629 HRESULT CALLBACK
IEnumSTATDATA_Next_Proxy(
2630 IEnumSTATDATA
* This
,
2633 ULONG
*pceltFetched
)
2636 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2637 if (!pceltFetched
) pceltFetched
= &fetched
;
2638 return IEnumSTATDATA_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2641 HRESULT __RPC_STUB
IEnumSTATDATA_Next_Stub(
2642 IEnumSTATDATA
* This
,
2645 ULONG
*pceltFetched
)
2648 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2650 hr
= IEnumSTATDATA_Next(This
, celt
, rgelt
, pceltFetched
);
2651 if (hr
== S_OK
) *pceltFetched
= celt
;
2655 void CALLBACK
IAdviseSink_OnDataChange_Proxy(
2657 FORMATETC
*pFormatetc
,
2660 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2661 IAdviseSink_RemoteOnDataChange_Proxy(This
, pFormatetc
, pStgmed
);
2664 HRESULT __RPC_STUB
IAdviseSink_OnDataChange_Stub(
2666 FORMATETC
*pFormatetc
,
2667 ASYNC_STGMEDIUM
*pStgmed
)
2669 TRACE("(%p)->(%p, %p)\n", This
, pFormatetc
, pStgmed
);
2670 IAdviseSink_OnDataChange(This
, pFormatetc
, pStgmed
);
2674 void CALLBACK
IAdviseSink_OnViewChange_Proxy(
2679 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2680 IAdviseSink_RemoteOnViewChange_Proxy(This
, dwAspect
, lindex
);
2683 HRESULT __RPC_STUB
IAdviseSink_OnViewChange_Stub(
2688 TRACE("(%p)->(%d, %d)\n", This
, dwAspect
, lindex
);
2689 IAdviseSink_OnViewChange(This
, dwAspect
, lindex
);
2693 void CALLBACK
IAdviseSink_OnRename_Proxy(
2697 TRACE("(%p)->(%p)\n", This
, pmk
);
2698 IAdviseSink_RemoteOnRename_Proxy(This
, pmk
);
2701 HRESULT __RPC_STUB
IAdviseSink_OnRename_Stub(
2705 TRACE("(%p)->(%p)\n", This
, pmk
);
2706 IAdviseSink_OnRename(This
, pmk
);
2710 void CALLBACK
IAdviseSink_OnSave_Proxy(
2713 TRACE("(%p)\n", This
);
2714 IAdviseSink_RemoteOnSave_Proxy(This
);
2717 HRESULT __RPC_STUB
IAdviseSink_OnSave_Stub(
2720 TRACE("(%p)\n", This
);
2721 IAdviseSink_OnSave(This
);
2725 void CALLBACK
IAdviseSink_OnClose_Proxy(
2728 TRACE("(%p)\n", This
);
2729 IAdviseSink_RemoteOnClose_Proxy(This
);
2732 HRESULT __RPC_STUB
IAdviseSink_OnClose_Stub(
2735 TRACE("(%p)\n", This
);
2736 IAdviseSink_OnClose(This
);
2740 void CALLBACK
IAdviseSink2_OnLinkSrcChange_Proxy(
2744 TRACE("(%p)->(%p)\n", This
, pmk
);
2745 IAdviseSink2_RemoteOnLinkSrcChange_Proxy(This
, pmk
);
2748 HRESULT __RPC_STUB
IAdviseSink2_OnLinkSrcChange_Stub(
2752 TRACE("(%p)->(%p)\n", This
, pmk
);
2753 IAdviseSink2_OnLinkSrcChange(This
, pmk
);
2757 HRESULT CALLBACK
IDataObject_GetData_Proxy(
2759 FORMATETC
*pformatetcIn
,
2762 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pmedium
);
2763 return IDataObject_RemoteGetData_Proxy(This
, pformatetcIn
, pmedium
);
2766 HRESULT __RPC_STUB
IDataObject_GetData_Stub(
2768 FORMATETC
*pformatetcIn
,
2769 STGMEDIUM
*pRemoteMedium
)
2771 TRACE("(%p)->(%p, %p)\n", This
, pformatetcIn
, pRemoteMedium
);
2772 return IDataObject_GetData(This
, pformatetcIn
, pRemoteMedium
);
2775 HRESULT CALLBACK
IDataObject_GetDataHere_Proxy(
2777 FORMATETC
*pformatetc
,
2780 TRACE("(%p)->(%p, %p)\n", This
, pformatetc
, pmedium
);
2781 return IDataObject_RemoteGetDataHere_Proxy(This
, pformatetc
, pmedium
);
2784 HRESULT __RPC_STUB
IDataObject_GetDataHere_Stub(
2786 FORMATETC
*pformatetc
,
2787 STGMEDIUM
*pRemoteMedium
)
2789 TRACE("(%p)->(%p, %p)\n", This
, pformatetc
, pRemoteMedium
);
2790 return IDataObject_GetDataHere(This
, pformatetc
, pRemoteMedium
);
2793 HRESULT CALLBACK
IDataObject_SetData_Proxy(
2795 FORMATETC
*pformatetc
,
2803 HRESULT __RPC_STUB
IDataObject_SetData_Stub(
2805 FORMATETC
*pformatetc
,
2806 FLAG_STGMEDIUM
*pmedium
,
2813 /* call_as/local stubs for oleidl.idl */
2815 HRESULT CALLBACK
IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
2816 IOleInPlaceActiveObject
* This
,
2819 TRACE("(%p %p)\n", This
, lpmsg
);
2820 return IOleInPlaceActiveObject_RemoteTranslateAccelerator_Proxy(This
);
2823 HRESULT __RPC_STUB
IOleInPlaceActiveObject_TranslateAccelerator_Stub(
2824 IOleInPlaceActiveObject
* This
)
2826 TRACE("(%p)\n", This
);
2830 HRESULT CALLBACK
IOleInPlaceActiveObject_ResizeBorder_Proxy(
2831 IOleInPlaceActiveObject
* This
,
2833 IOleInPlaceUIWindow
*pUIWindow
,
2840 HRESULT __RPC_STUB
IOleInPlaceActiveObject_ResizeBorder_Stub(
2841 IOleInPlaceActiveObject
* This
,
2844 IOleInPlaceUIWindow
*pUIWindow
,
2851 HRESULT CALLBACK
IOleCache2_UpdateCache_Proxy(
2853 LPDATAOBJECT pDataObject
,
2857 TRACE("(%p, %p, 0x%08x, %p)\n", This
, pDataObject
, grfUpdf
, pReserved
);
2858 return IOleCache2_RemoteUpdateCache_Proxy(This
, pDataObject
, grfUpdf
, (LONG_PTR
)pReserved
);
2861 HRESULT __RPC_STUB
IOleCache2_UpdateCache_Stub(
2863 LPDATAOBJECT pDataObject
,
2867 TRACE("(%p, %p, 0x%08x, %li)\n", This
, pDataObject
, grfUpdf
, pReserved
);
2868 return IOleCache2_UpdateCache(This
, pDataObject
, grfUpdf
, (void*)pReserved
);
2871 HRESULT CALLBACK
IEnumOLEVERB_Next_Proxy(
2875 ULONG
*pceltFetched
)
2878 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2879 if (!pceltFetched
) pceltFetched
= &fetched
;
2880 return IEnumOLEVERB_RemoteNext_Proxy(This
, celt
, rgelt
, pceltFetched
);
2883 HRESULT __RPC_STUB
IEnumOLEVERB_Next_Stub(
2887 ULONG
*pceltFetched
)
2890 TRACE("(%p)->(%d, %p, %p)\n", This
, celt
, rgelt
, pceltFetched
);
2892 hr
= IEnumOLEVERB_Next(This
, celt
, rgelt
, pceltFetched
);
2893 if (hr
== S_OK
) *pceltFetched
= celt
;
2897 HRESULT CALLBACK
IViewObject_Draw_Proxy(
2902 DVTARGETDEVICE
*ptd
,
2905 LPCRECTL lprcBounds
,
2906 LPCRECTL lprcWBounds
,
2907 BOOL (STDMETHODCALLTYPE
*pfnContinue
)(ULONG_PTR dwContinue
),
2908 ULONG_PTR dwContinue
)
2914 HRESULT __RPC_STUB
IViewObject_Draw_Stub(
2919 DVTARGETDEVICE
*ptd
,
2920 ULONG_PTR hdcTargetDev
,
2922 LPCRECTL lprcBounds
,
2923 LPCRECTL lprcWBounds
,
2924 IContinue
*pContinue
)
2930 HRESULT CALLBACK
IViewObject_GetColorSet_Proxy(
2935 DVTARGETDEVICE
*ptd
,
2937 LOGPALETTE
**ppColorSet
)
2943 HRESULT __RPC_STUB
IViewObject_GetColorSet_Stub(
2948 DVTARGETDEVICE
*ptd
,
2949 ULONG_PTR hicTargetDev
,
2950 LOGPALETTE
**ppColorSet
)
2956 HRESULT CALLBACK
IViewObject_Freeze_Proxy(
2967 HRESULT __RPC_STUB
IViewObject_Freeze_Stub(
2978 HRESULT CALLBACK
IViewObject_GetAdvise_Proxy(
2982 IAdviseSink
**ppAdvSink
)
2988 HRESULT __RPC_STUB
IViewObject_GetAdvise_Stub(
2992 IAdviseSink
**ppAdvSink
)