Changes in crossover-wine-src-6.1.0 except for configure
[wine/hacks.git] / dlls / ole32 / usrmarshal.c
blob975874eaf9a1339d02c9225a2d73f930611bbe0b
1 /*
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
21 #include <stdio.h>
22 #include <stdarg.h>
23 #include <string.h>
25 #define COBJMACROS
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
33 #include "winerror.h"
35 #include "ole2.h"
36 #include "oleauto.h"
37 #include "rpcproxy.h"
39 #include "wine/unicode.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(ole);
44 #define ALIGNED_LENGTH(_Len, _Align) (((_Len)+(_Align))&~(_Align))
45 #define ALIGNED_POINTER(_Ptr, _Align) ((LPVOID)ALIGNED_LENGTH((ULONG_PTR)(_Ptr), _Align))
46 #define ALIGN_LENGTH(_Len, _Align) _Len = ALIGNED_LENGTH(_Len, _Align)
47 #define ALIGN_POINTER(_Ptr, _Align) _Ptr = ALIGNED_POINTER(_Ptr, _Align)
49 #define USER_MARSHAL_PTR_PREFIX \
50 ( (DWORD)'U' | ( (DWORD)'s' << 8 ) | \
51 ( (DWORD)'e' << 16 ) | ( (DWORD)'r' << 24 ) )
53 static const char* debugstr_user_flags(ULONG *pFlags)
55 char buf[12];
56 const char* loword;
57 switch (LOWORD(*pFlags))
59 case MSHCTX_LOCAL:
60 loword="MSHCTX_LOCAL";
61 break;
62 case MSHCTX_NOSHAREDMEM:
63 loword="MSHCTX_NOSHAREDMEM";
64 break;
65 case MSHCTX_DIFFERENTMACHINE:
66 loword="MSHCTX_DIFFERENTMACHINE";
67 break;
68 case MSHCTX_INPROC:
69 loword="MSHCTX_INPROC";
70 break;
71 default:
72 sprintf(buf, "%d", LOWORD(*pFlags));
73 loword=buf;
76 if (HIWORD(*pFlags) == NDR_LOCAL_DATA_REPRESENTATION)
77 return wine_dbg_sprintf("MAKELONG(NDR_LOCAL_REPRESENTATION, %s)", loword);
78 else
79 return wine_dbg_sprintf("MAKELONG(0x%04x, %s)", HIWORD(*pFlags), loword);
82 /******************************************************************************
83 * CLIPFORMAT_UserSize [OLE32.@]
85 * Calculates the buffer size required to marshal a clip format.
87 * PARAMS
88 * pFlags [I] Flags. See notes.
89 * StartingSize [I] Starting size of the buffer. This value is added on to
90 * the buffer size required for the clip format.
91 * pCF [I] Clip format to size.
93 * RETURNS
94 * The buffer size required to marshal a clip format plus the starting size.
96 * NOTES
97 * Even though the function is documented to take a pointer to an unsigned
98 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
99 * the first parameter is an unsigned long.
100 * This function is only intended to be called by the RPC runtime.
102 ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG StartingSize, CLIPFORMAT *pCF)
104 ULONG size = StartingSize;
106 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, pCF);
108 size += sizeof(userCLIPFORMAT);
110 /* only need to marshal the name if it is not a pre-defined type and
111 * we are going remote */
112 if ((*pCF >= 0xc000) && (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE))
114 WCHAR format[255];
115 INT ret;
116 size += 3 * sizeof(INT);
117 /* urg! this function is badly designed because it won't tell us how
118 * much space is needed without doing a dummy run of storing the
119 * name into a buffer */
120 ret = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1);
121 if (!ret)
122 RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL);
123 size += (ret + 1) * sizeof(WCHAR);
125 return size;
128 /******************************************************************************
129 * CLIPFORMAT_UserMarshal [OLE32.@]
131 * Marshals a clip format into a buffer.
133 * PARAMS
134 * pFlags [I] Flags. See notes.
135 * pBuffer [I] Buffer to marshal the clip format into.
136 * pCF [I] Clip format to marshal.
138 * RETURNS
139 * The end of the marshaled data in the buffer.
141 * NOTES
142 * Even though the function is documented to take a pointer to an unsigned
143 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
144 * the first parameter is an unsigned long.
145 * This function is only intended to be called by the RPC runtime.
147 unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, CLIPFORMAT *pCF)
149 wireCLIPFORMAT wirecf = (wireCLIPFORMAT)pBuffer;
151 TRACE("(%s, %p, &0x%04x\n", debugstr_user_flags(pFlags), pBuffer, *pCF);
153 wirecf->u.dwValue = *pCF;
154 pBuffer += sizeof(*wirecf);
156 /* only need to marshal the name if it is not a pre-defined type and
157 * we are going remote */
158 if ((*pCF >= 0xc000) && (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE))
160 WCHAR format[255];
161 INT len;
162 wirecf->fContext = WDT_REMOTE_CALL;
163 len = GetClipboardFormatNameW(*pCF, format, sizeof(format)/sizeof(format[0])-1);
164 if (!len)
165 RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL);
166 len += 1;
167 *(INT *)pBuffer = len;
168 pBuffer += sizeof(INT);
169 *(INT *)pBuffer = 0;
170 pBuffer += sizeof(INT);
171 *(INT *)pBuffer = len;
172 pBuffer += sizeof(INT);
173 TRACE("marshaling format name %s\n", debugstr_wn(format, len-1));
174 lstrcpynW((LPWSTR)pBuffer, format, len);
175 pBuffer += len * sizeof(WCHAR);
176 *(WCHAR *)pBuffer = '\0';
177 pBuffer += sizeof(WCHAR);
179 else
180 wirecf->fContext = WDT_INPROC_CALL;
182 return pBuffer;
185 /******************************************************************************
186 * CLIPFORMAT_UserUnmarshal [OLE32.@]
188 * Unmarshals a clip format from a buffer.
190 * PARAMS
191 * pFlags [I] Flags. See notes.
192 * pBuffer [I] Buffer to marshal the clip format from.
193 * pCF [O] Address that receive the unmarshaled clip format.
195 * RETURNS
196 * The end of the marshaled data in the buffer.
198 * NOTES
199 * Even though the function is documented to take a pointer to an unsigned
200 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
201 * the first parameter is an unsigned long.
202 * This function is only intended to be called by the RPC runtime.
204 unsigned char * __RPC_USER CLIPFORMAT_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, CLIPFORMAT *pCF)
206 wireCLIPFORMAT wirecf = (wireCLIPFORMAT)pBuffer;
208 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, pCF);
210 pBuffer += sizeof(*wirecf);
211 if (wirecf->fContext == WDT_INPROC_CALL)
212 *pCF = (CLIPFORMAT)wirecf->u.dwValue;
213 else if (wirecf->fContext == WDT_REMOTE_CALL)
215 CLIPFORMAT cf;
216 INT len = *(INT *)pBuffer;
217 pBuffer += sizeof(INT);
218 if (*(INT *)pBuffer != 0)
219 RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
220 pBuffer += sizeof(INT);
221 if (*(INT *)pBuffer != len)
222 RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
223 pBuffer += sizeof(INT);
224 if (((WCHAR *)pBuffer)[len] != '\0')
225 RaiseException(RPC_S_INVALID_BOUND, 0, 0, NULL);
226 TRACE("unmarshaling clip format %s\n", debugstr_w((LPCWSTR)pBuffer));
227 cf = RegisterClipboardFormatW((LPCWSTR)pBuffer);
228 pBuffer += (len + 1) * sizeof(WCHAR);
229 if (!cf)
230 RaiseException(DV_E_CLIPFORMAT, 0, 0, NULL);
231 *pCF = cf;
233 else
234 /* code not really appropriate, but nearest I can find */
235 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
236 return pBuffer;
239 /******************************************************************************
240 * CLIPFORMAT_UserFree [OLE32.@]
242 * Frees an unmarshaled clip format.
244 * PARAMS
245 * pFlags [I] Flags. See notes.
246 * pCF [I] Clip format to free.
248 * RETURNS
249 * The end of the marshaled data in the buffer.
251 * NOTES
252 * Even though the function is documented to take a pointer to an unsigned
253 * long in pFlags, it actually takes a pointer to a USER_MARSHAL_CB
254 * structure, of which the first parameter is an unsigned long.
255 * This function is only intended to be called by the RPC runtime.
257 void __RPC_USER CLIPFORMAT_UserFree(ULONG *pFlags, CLIPFORMAT *pCF)
259 /* there is no inverse of the RegisterClipboardFormat function,
260 * so nothing to do */
263 static ULONG __RPC_USER handle_UserSize(ULONG *pFlags, ULONG StartingSize, HANDLE *handle)
265 if (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE)
267 ERR("can't remote a local handle\n");
268 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
269 return StartingSize;
271 return StartingSize + sizeof(RemotableHandle);
274 static unsigned char * __RPC_USER handle_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HANDLE *handle)
276 RemotableHandle *remhandle = (RemotableHandle *)pBuffer;
277 if (LOWORD(*pFlags) == MSHCTX_DIFFERENTMACHINE)
279 ERR("can't remote a local handle\n");
280 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
281 return pBuffer;
283 remhandle->fContext = WDT_INPROC_CALL;
284 remhandle->u.hInproc = (LONG_PTR)*handle;
285 return pBuffer + sizeof(RemotableHandle);
288 static unsigned char * __RPC_USER handle_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HANDLE *handle)
290 RemotableHandle *remhandle = (RemotableHandle *)pBuffer;
291 if (remhandle->fContext != WDT_INPROC_CALL)
292 RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL);
293 *handle = (HANDLE)remhandle->u.hInproc;
294 return pBuffer + sizeof(RemotableHandle);
297 static void __RPC_USER handle_UserFree(ULONG *pFlags, HANDLE *phMenu)
299 /* nothing to do */
302 #define IMPL_WIREM_HANDLE(type) \
303 ULONG __RPC_USER type##_UserSize(ULONG *pFlags, ULONG StartingSize, type *handle) \
305 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, handle); \
306 return handle_UserSize(pFlags, StartingSize, (HANDLE *)handle); \
309 unsigned char * __RPC_USER type##_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \
311 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *handle); \
312 return handle_UserMarshal(pFlags, pBuffer, (HANDLE *)handle); \
315 unsigned char * __RPC_USER type##_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, type *handle) \
317 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, handle); \
318 return handle_UserUnmarshal(pFlags, pBuffer, (HANDLE *)handle); \
321 void __RPC_USER type##_UserFree(ULONG *pFlags, type *handle) \
323 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *handle); \
324 return handle_UserFree(pFlags, (HANDLE *)handle); \
327 IMPL_WIREM_HANDLE(HACCEL)
328 IMPL_WIREM_HANDLE(HMENU)
329 IMPL_WIREM_HANDLE(HWND)
331 /******************************************************************************
332 * HGLOBAL_UserSize [OLE32.@]
334 * Calculates the buffer size required to marshal an HGLOBAL.
336 * PARAMS
337 * pFlags [I] Flags. See notes.
338 * StartingSize [I] Starting size of the buffer. This value is added on to
339 * the buffer size required for the clip format.
340 * phGlobal [I] HGLOBAL to size.
342 * RETURNS
343 * The buffer size required to marshal an HGLOBAL plus the starting size.
345 * NOTES
346 * Even though the function is documented to take a pointer to a ULONG in
347 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
348 * the first parameter is a ULONG.
349 * This function is only intended to be called by the RPC runtime.
351 ULONG __RPC_USER HGLOBAL_UserSize(ULONG *pFlags, ULONG StartingSize, HGLOBAL *phGlobal)
353 ULONG size = StartingSize;
355 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, phGlobal);
357 ALIGN_LENGTH(size, 3);
359 size += sizeof(ULONG);
361 if (LOWORD(*pFlags == MSHCTX_INPROC))
362 size += sizeof(HGLOBAL);
363 else
365 size += sizeof(ULONG);
366 if (*phGlobal)
368 SIZE_T ret;
369 size += 3 * sizeof(ULONG);
370 ret = GlobalSize(*phGlobal);
371 size += (ULONG)ret;
375 return size;
378 /******************************************************************************
379 * HGLOBAL_UserMarshal [OLE32.@]
381 * Marshals an HGLOBAL into a buffer.
383 * PARAMS
384 * pFlags [I] Flags. See notes.
385 * pBuffer [I] Buffer to marshal the clip format into.
386 * phGlobal [I] HGLOBAL to marshal.
388 * RETURNS
389 * The end of the marshaled data in the buffer.
391 * NOTES
392 * Even though the function is documented to take a pointer to a ULONG in
393 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
394 * the first parameter is a ULONG.
395 * This function is only intended to be called by the RPC runtime.
397 unsigned char * __RPC_USER HGLOBAL_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HGLOBAL *phGlobal)
399 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *phGlobal);
401 ALIGN_POINTER(pBuffer, 3);
403 if (LOWORD(*pFlags == MSHCTX_INPROC))
405 if (sizeof(*phGlobal) == 8)
406 *(ULONG *)pBuffer = WDT_INPROC64_CALL;
407 else
408 *(ULONG *)pBuffer = WDT_INPROC_CALL;
409 pBuffer += sizeof(ULONG);
410 *(HGLOBAL *)pBuffer = *phGlobal;
411 pBuffer += sizeof(HGLOBAL);
413 else
415 *(ULONG *)pBuffer = WDT_REMOTE_CALL;
416 pBuffer += sizeof(ULONG);
417 *(ULONG *)pBuffer = (ULONG)*phGlobal;
418 pBuffer += sizeof(ULONG);
419 if (*phGlobal)
421 const unsigned char *memory;
422 SIZE_T size = GlobalSize(*phGlobal);
423 *(ULONG *)pBuffer = (ULONG)size;
424 pBuffer += sizeof(ULONG);
425 *(ULONG *)pBuffer = (ULONG)*phGlobal;
426 pBuffer += sizeof(ULONG);
427 *(ULONG *)pBuffer = (ULONG)size;
428 pBuffer += sizeof(ULONG);
430 memory = GlobalLock(*phGlobal);
431 memcpy(pBuffer, memory, size);
432 pBuffer += size;
433 GlobalUnlock(*phGlobal);
437 return pBuffer;
440 /******************************************************************************
441 * HGLOBAL_UserUnmarshal [OLE32.@]
443 * Unmarshals an HGLOBAL from a buffer.
445 * PARAMS
446 * pFlags [I] Flags. See notes.
447 * pBuffer [I] Buffer to marshal the clip format from.
448 * phGlobal [O] Address that receive the unmarshaled HGLOBAL.
450 * RETURNS
451 * The end of the marshaled data in the buffer.
453 * NOTES
454 * Even though the function is documented to take a pointer to an ULONG in
455 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
456 * the first parameter is an ULONG.
457 * This function is only intended to be called by the RPC runtime.
459 unsigned char * __RPC_USER HGLOBAL_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HGLOBAL *phGlobal)
461 ULONG fContext;
463 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *phGlobal);
465 ALIGN_POINTER(pBuffer, 3);
467 fContext = *(ULONG *)pBuffer;
468 pBuffer += sizeof(ULONG);
470 if (((fContext == WDT_INPROC_CALL) && (sizeof(*phGlobal) < 8)) ||
471 ((fContext == WDT_INPROC64_CALL) && (sizeof(*phGlobal) == 8)))
473 *phGlobal = *(HGLOBAL *)pBuffer;
474 pBuffer += sizeof(*phGlobal);
476 else if (fContext == WDT_REMOTE_CALL)
478 ULONG handle;
480 handle = *(ULONG *)pBuffer;
481 pBuffer += sizeof(ULONG);
483 if (handle)
485 ULONG size;
486 void *memory;
488 size = *(ULONG *)pBuffer;
489 pBuffer += sizeof(ULONG);
490 /* redundancy is bad - it means you have to check consistency like
491 * this: */
492 if (*(ULONG *)pBuffer != handle)
494 RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL);
495 return pBuffer;
497 pBuffer += sizeof(ULONG);
498 /* redundancy is bad - it means you have to check consistency like
499 * this: */
500 if (*(ULONG *)pBuffer != size)
502 RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL);
503 return pBuffer;
505 pBuffer += sizeof(ULONG);
507 /* FIXME: check size is not too big */
509 *phGlobal = GlobalAlloc(GMEM_MOVEABLE, size);
510 memory = GlobalLock(*phGlobal);
511 memcpy(memory, pBuffer, size);
512 pBuffer += size;
513 GlobalUnlock(*phGlobal);
515 else
516 *phGlobal = NULL;
518 else
519 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
521 return pBuffer;
524 /******************************************************************************
525 * HGLOBAL_UserFree [OLE32.@]
527 * Frees an unmarshaled HGLOBAL.
529 * PARAMS
530 * pFlags [I] Flags. See notes.
531 * phGlobal [I] HGLOBAL to free.
533 * RETURNS
534 * The end of the marshaled data in the buffer.
536 * NOTES
537 * Even though the function is documented to take a pointer to a ULONG in
538 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
539 * which the first parameter is a ULONG.
540 * This function is only intended to be called by the RPC runtime.
542 void __RPC_USER HGLOBAL_UserFree(ULONG *pFlags, HGLOBAL *phGlobal)
544 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *phGlobal);
546 if (LOWORD(*pFlags != MSHCTX_INPROC) && *phGlobal)
547 GlobalFree(*phGlobal);
550 /******************************************************************************
551 * HBITMAP_UserSize [OLE32.@]
553 * Calculates the buffer size required to marshal a bitmap.
555 * PARAMS
556 * pFlags [I] Flags. See notes.
557 * StartingSize [I] Starting size of the buffer. This value is added on to
558 * the buffer size required for the clip format.
559 * phBmp [I] Bitmap to size.
561 * RETURNS
562 * The buffer size required to marshal an bitmap plus the starting size.
564 * NOTES
565 * Even though the function is documented to take a pointer to a ULONG in
566 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
567 * the first parameter is a ULONG.
568 * This function is only intended to be called by the RPC runtime.
570 ULONG __RPC_USER HBITMAP_UserSize(ULONG *pFlags, ULONG StartingSize, HBITMAP *phBmp)
572 FIXME(":stub\n");
573 return StartingSize;
576 /******************************************************************************
577 * HBITMAP_UserMarshal [OLE32.@]
579 * Marshals a bitmap into a buffer.
581 * PARAMS
582 * pFlags [I] Flags. See notes.
583 * pBuffer [I] Buffer to marshal the clip format into.
584 * phBmp [I] Bitmap to marshal.
586 * RETURNS
587 * The end of the marshaled data in the buffer.
589 * NOTES
590 * Even though the function is documented to take a pointer to a ULONG in
591 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
592 * the first parameter is a ULONG.
593 * This function is only intended to be called by the RPC runtime.
595 unsigned char * __RPC_USER HBITMAP_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HBITMAP *phBmp)
597 FIXME(":stub\n");
598 return pBuffer;
601 /******************************************************************************
602 * HBITMAP_UserUnmarshal [OLE32.@]
604 * Unmarshals a bitmap from a buffer.
606 * PARAMS
607 * pFlags [I] Flags. See notes.
608 * pBuffer [I] Buffer to marshal the clip format from.
609 * phBmp [O] Address that receive the unmarshaled bitmap.
611 * RETURNS
612 * The end of the marshaled data in the buffer.
614 * NOTES
615 * Even though the function is documented to take a pointer to an ULONG in
616 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
617 * the first parameter is an ULONG.
618 * This function is only intended to be called by the RPC runtime.
620 unsigned char * __RPC_USER HBITMAP_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HBITMAP *phBmp)
622 FIXME(":stub\n");
623 return pBuffer;
626 /******************************************************************************
627 * HBITMAP_UserFree [OLE32.@]
629 * Frees an unmarshaled bitmap.
631 * PARAMS
632 * pFlags [I] Flags. See notes.
633 * phBmp [I] Bitmap to free.
635 * RETURNS
636 * The end of the marshaled data in the buffer.
638 * NOTES
639 * Even though the function is documented to take a pointer to a ULONG in
640 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
641 * which the first parameter is a ULONG.
642 * This function is only intended to be called by the RPC runtime.
644 void __RPC_USER HBITMAP_UserFree(ULONG *pFlags, HBITMAP *phBmp)
646 FIXME(":stub\n");
649 /******************************************************************************
650 * HDC_UserSize [OLE32.@]
652 * Calculates the buffer size required to marshal an HDC.
654 * PARAMS
655 * pFlags [I] Flags. See notes.
656 * StartingSize [I] Starting size of the buffer. This value is added on to
657 * the buffer size required for the clip format.
658 * phGlobal [I] HDC to size.
660 * RETURNS
661 * The buffer size required to marshal an HDC plus the starting size.
663 * NOTES
664 * Even though the function is documented to take a pointer to a ULONG in
665 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
666 * the first parameter is a ULONG.
667 * This function is only intended to be called by the RPC runtime.
669 ULONG __RPC_USER HDC_UserSize(ULONG *pFlags, ULONG StartingSize, HDC *phdc)
671 FIXME(":stub\n");
672 return StartingSize;
675 /******************************************************************************
676 * HDC_UserMarshal [OLE32.@]
678 * Marshals an HDC into a buffer.
680 * PARAMS
681 * pFlags [I] Flags. See notes.
682 * pBuffer [I] Buffer to marshal the clip format into.
683 * phdc [I] HDC to marshal.
685 * RETURNS
686 * The end of the marshaled data in the buffer.
688 * NOTES
689 * Even though the function is documented to take a pointer to a ULONG in
690 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
691 * the first parameter is a ULONG.
692 * This function is only intended to be called by the RPC runtime.
694 unsigned char * __RPC_USER HDC_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc)
696 FIXME(":stub\n");
697 return pBuffer;
700 /******************************************************************************
701 * HDC_UserUnmarshal [OLE32.@]
703 * Unmarshals an HDC from a buffer.
705 * PARAMS
706 * pFlags [I] Flags. See notes.
707 * pBuffer [I] Buffer to marshal the clip format from.
708 * phdc [O] Address that receive the unmarshaled HDC.
710 * RETURNS
711 * The end of the marshaled data in the buffer.
713 * NOTES
714 * Even though the function is documented to take a pointer to an ULONG in
715 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
716 * the first parameter is an ULONG.
717 * This function is only intended to be called by the RPC runtime.
719 unsigned char * __RPC_USER HDC_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HDC *phdc)
721 FIXME(":stub\n");
722 return pBuffer;
725 /******************************************************************************
726 * HDC_UserFree [OLE32.@]
728 * Frees an unmarshaled HDC.
730 * PARAMS
731 * pFlags [I] Flags. See notes.
732 * phdc [I] HDC to free.
734 * RETURNS
735 * The end of the marshaled data in the buffer.
737 * NOTES
738 * Even though the function is documented to take a pointer to a ULONG in
739 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
740 * which the first parameter is a ULONG.
741 * This function is only intended to be called by the RPC runtime.
743 void __RPC_USER HDC_UserFree(ULONG *pFlags, HDC *phdc)
745 FIXME(":stub\n");
748 /******************************************************************************
749 * HPALETTE_UserSize [OLE32.@]
751 * Calculates the buffer size required to marshal a palette.
753 * PARAMS
754 * pFlags [I] Flags. See notes.
755 * StartingSize [I] Starting size of the buffer. This value is added on to
756 * the buffer size required for the clip format.
757 * phPal [I] Palette to size.
759 * RETURNS
760 * The buffer size required to marshal a palette plus the starting size.
762 * NOTES
763 * Even though the function is documented to take a pointer to a ULONG in
764 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
765 * the first parameter is a ULONG.
766 * This function is only intended to be called by the RPC runtime.
768 ULONG __RPC_USER HPALETTE_UserSize(ULONG *pFlags, ULONG StartingSize, HPALETTE *phPal)
770 FIXME(":stub\n");
771 return StartingSize;
774 /******************************************************************************
775 * HPALETTE_UserMarshal [OLE32.@]
777 * Marshals a palette into a buffer.
779 * PARAMS
780 * pFlags [I] Flags. See notes.
781 * pBuffer [I] Buffer to marshal the clip format into.
782 * phPal [I] Palette to marshal.
784 * RETURNS
785 * The end of the marshaled data in the buffer.
787 * NOTES
788 * Even though the function is documented to take a pointer to a ULONG in
789 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
790 * the first parameter is a ULONG.
791 * This function is only intended to be called by the RPC runtime.
793 unsigned char * __RPC_USER HPALETTE_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HPALETTE *phPal)
795 FIXME(":stub\n");
796 return pBuffer;
799 /******************************************************************************
800 * HPALETTE_UserUnmarshal [OLE32.@]
802 * Unmarshals a palette from a buffer.
804 * PARAMS
805 * pFlags [I] Flags. See notes.
806 * pBuffer [I] Buffer to marshal the clip format from.
807 * phPal [O] Address that receive the unmarshaled palette.
809 * RETURNS
810 * The end of the marshaled data in the buffer.
812 * NOTES
813 * Even though the function is documented to take a pointer to an ULONG in
814 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
815 * the first parameter is an ULONG.
816 * This function is only intended to be called by the RPC runtime.
818 unsigned char * __RPC_USER HPALETTE_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HPALETTE *phPal)
820 FIXME(":stub\n");
821 return pBuffer;
824 /******************************************************************************
825 * HPALETTE_UserFree [OLE32.@]
827 * Frees an unmarshaled palette.
829 * PARAMS
830 * pFlags [I] Flags. See notes.
831 * phPal [I] Palette to free.
833 * RETURNS
834 * The end of the marshaled data in the buffer.
836 * NOTES
837 * Even though the function is documented to take a pointer to a ULONG in
838 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
839 * which the first parameter is a ULONG.
840 * This function is only intended to be called by the RPC runtime.
842 void __RPC_USER HPALETTE_UserFree(ULONG *pFlags, HPALETTE *phPal)
844 FIXME(":stub\n");
848 /******************************************************************************
849 * HMETAFILE_UserSize [OLE32.@]
851 * Calculates the buffer size required to marshal a metafile.
853 * PARAMS
854 * pFlags [I] Flags. See notes.
855 * StartingSize [I] Starting size of the buffer. This value is added on to
856 * the buffer size required for the clip format.
857 * phmf [I] Metafile to size.
859 * RETURNS
860 * The buffer size required to marshal a metafile plus the starting size.
862 * NOTES
863 * Even though the function is documented to take a pointer to a ULONG in
864 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
865 * the first parameter is a ULONG.
866 * This function is only intended to be called by the RPC runtime.
868 ULONG __RPC_USER HMETAFILE_UserSize(ULONG *pFlags, ULONG StartingSize, HMETAFILE *phmf)
870 ULONG size = StartingSize;
872 TRACE("(%s, %d, &%p\n", debugstr_user_flags(pFlags), StartingSize, *phmf);
874 ALIGN_LENGTH(size, 3);
876 size += sizeof(ULONG);
877 if (LOWORD(*pFlags) == MSHCTX_INPROC)
878 size += sizeof(ULONG_PTR);
879 else
881 size += sizeof(ULONG);
883 if (*phmf)
885 UINT mfsize;
887 size += 2 * sizeof(ULONG);
888 mfsize = GetMetaFileBitsEx(*phmf, 0, NULL);
889 size += mfsize;
893 return size;
896 /******************************************************************************
897 * HMETAFILE_UserMarshal [OLE32.@]
899 * Marshals a metafile into a buffer.
901 * PARAMS
902 * pFlags [I] Flags. See notes.
903 * pBuffer [I] Buffer to marshal the clip format into.
904 * phEmf [I] Metafile to marshal.
906 * RETURNS
907 * The end of the marshaled data in the buffer.
909 * NOTES
910 * Even though the function is documented to take a pointer to a ULONG in
911 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
912 * the first parameter is a ULONG.
913 * This function is only intended to be called by the RPC runtime.
915 unsigned char * __RPC_USER HMETAFILE_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HMETAFILE *phmf)
917 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *phmf);
919 ALIGN_POINTER(pBuffer, 3);
921 if (LOWORD(*pFlags) == MSHCTX_INPROC)
923 if (sizeof(*phmf) == 8)
924 *(ULONG *)pBuffer = WDT_INPROC64_CALL;
925 else
926 *(ULONG *)pBuffer = WDT_INPROC_CALL;
927 pBuffer += sizeof(ULONG);
928 *(HMETAFILE *)pBuffer = *phmf;
929 pBuffer += sizeof(HMETAFILE);
931 else
933 *(ULONG *)pBuffer = WDT_REMOTE_CALL;
934 pBuffer += sizeof(ULONG);
935 *(ULONG *)pBuffer = (ULONG)(ULONG_PTR)*phmf;
936 pBuffer += sizeof(ULONG);
938 if (*phmf)
940 UINT mfsize = GetMetaFileBitsEx(*phmf, 0, NULL);
942 *(ULONG *)pBuffer = mfsize;
943 pBuffer += sizeof(ULONG);
944 *(ULONG *)pBuffer = mfsize;
945 pBuffer += sizeof(ULONG);
946 GetMetaFileBitsEx(*phmf, mfsize, pBuffer);
947 pBuffer += mfsize;
951 return pBuffer;
954 /******************************************************************************
955 * HMETAFILE_UserUnmarshal [OLE32.@]
957 * Unmarshals a metafile from a buffer.
959 * PARAMS
960 * pFlags [I] Flags. See notes.
961 * pBuffer [I] Buffer to marshal the clip format from.
962 * phmf [O] Address that receive the unmarshaled metafile.
964 * RETURNS
965 * The end of the marshaled data in the buffer.
967 * NOTES
968 * Even though the function is documented to take a pointer to an ULONG in
969 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
970 * the first parameter is an ULONG.
971 * This function is only intended to be called by the RPC runtime.
973 unsigned char * __RPC_USER HMETAFILE_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HMETAFILE *phmf)
975 ULONG fContext;
977 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, phmf);
979 ALIGN_POINTER(pBuffer, 3);
981 fContext = *(ULONG *)pBuffer;
982 pBuffer += sizeof(ULONG);
984 if (((fContext == WDT_INPROC_CALL) && (sizeof(*phmf) < 8)) ||
985 ((fContext == WDT_INPROC64_CALL) && (sizeof(*phmf) == 8)))
987 *phmf = *(HMETAFILE *)pBuffer;
988 pBuffer += sizeof(*phmf);
990 else if (fContext == WDT_REMOTE_CALL)
992 ULONG handle;
994 handle = *(ULONG *)pBuffer;
995 pBuffer += sizeof(ULONG);
997 if (handle)
999 ULONG size;
1000 size = *(ULONG *)pBuffer;
1001 pBuffer += sizeof(ULONG);
1002 if (size != *(ULONG *)pBuffer)
1004 RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL);
1005 return pBuffer;
1007 pBuffer += sizeof(ULONG);
1008 *phmf = SetMetaFileBitsEx(size, pBuffer);
1009 pBuffer += size;
1011 else
1012 *phmf = NULL;
1014 else
1015 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
1017 return pBuffer;
1020 /******************************************************************************
1021 * HMETAFILE_UserFree [OLE32.@]
1023 * Frees an unmarshaled metafile.
1025 * PARAMS
1026 * pFlags [I] Flags. See notes.
1027 * phmf [I] Metafile to free.
1029 * RETURNS
1030 * The end of the marshaled data in the buffer.
1032 * NOTES
1033 * Even though the function is documented to take a pointer to a ULONG in
1034 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1035 * which the first parameter is a ULONG.
1036 * This function is only intended to be called by the RPC runtime.
1038 void __RPC_USER HMETAFILE_UserFree(ULONG *pFlags, HMETAFILE *phmf)
1040 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *phmf);
1042 if (LOWORD(*pFlags) != MSHCTX_INPROC)
1043 DeleteMetaFile(*phmf);
1046 /******************************************************************************
1047 * HENHMETAFILE_UserSize [OLE32.@]
1049 * Calculates the buffer size required to marshal an enhanced metafile.
1051 * PARAMS
1052 * pFlags [I] Flags. See notes.
1053 * StartingSize [I] Starting size of the buffer. This value is added on to
1054 * the buffer size required for the clip format.
1055 * phEmf [I] Enhanced metafile to size.
1057 * RETURNS
1058 * The buffer size required to marshal an enhanced metafile plus the starting size.
1060 * NOTES
1061 * Even though the function is documented to take a pointer to a ULONG in
1062 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1063 * the first parameter is a ULONG.
1064 * This function is only intended to be called by the RPC runtime.
1066 ULONG __RPC_USER HENHMETAFILE_UserSize(ULONG *pFlags, ULONG StartingSize, HENHMETAFILE *phEmf)
1068 ULONG size = StartingSize;
1070 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, *phEmf);
1072 size += sizeof(ULONG);
1073 if (LOWORD(*pFlags) == MSHCTX_INPROC)
1074 size += sizeof(ULONG_PTR);
1075 else
1077 size += sizeof(ULONG);
1079 if (*phEmf)
1081 UINT emfsize;
1083 size += 2 * sizeof(ULONG);
1084 emfsize = GetEnhMetaFileBits(*phEmf, 0, NULL);
1085 size += emfsize;
1089 return size;
1092 /******************************************************************************
1093 * HENHMETAFILE_UserMarshal [OLE32.@]
1095 * Marshals an enhance metafile into a buffer.
1097 * PARAMS
1098 * pFlags [I] Flags. See notes.
1099 * pBuffer [I] Buffer to marshal the clip format into.
1100 * phEmf [I] Enhanced metafile to marshal.
1102 * RETURNS
1103 * The end of the marshaled data in the buffer.
1105 * NOTES
1106 * Even though the function is documented to take a pointer to a ULONG in
1107 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1108 * the first parameter is a ULONG.
1109 * This function is only intended to be called by the RPC runtime.
1111 unsigned char * __RPC_USER HENHMETAFILE_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HENHMETAFILE *phEmf)
1113 TRACE("(%s, %p, &%p\n", debugstr_user_flags(pFlags), pBuffer, *phEmf);
1115 if (LOWORD(*pFlags) == MSHCTX_INPROC)
1117 if (sizeof(*phEmf) == 8)
1118 *(ULONG *)pBuffer = WDT_INPROC64_CALL;
1119 else
1120 *(ULONG *)pBuffer = WDT_INPROC_CALL;
1121 pBuffer += sizeof(ULONG);
1122 *(HENHMETAFILE *)pBuffer = *phEmf;
1123 pBuffer += sizeof(HENHMETAFILE);
1125 else
1127 *(ULONG *)pBuffer = WDT_REMOTE_CALL;
1128 pBuffer += sizeof(ULONG);
1129 *(ULONG *)pBuffer = (ULONG)(ULONG_PTR)*phEmf;
1130 pBuffer += sizeof(ULONG);
1132 if (*phEmf)
1134 UINT emfsize = GetEnhMetaFileBits(*phEmf, 0, NULL);
1136 *(ULONG *)pBuffer = emfsize;
1137 pBuffer += sizeof(ULONG);
1138 *(ULONG *)pBuffer = emfsize;
1139 pBuffer += sizeof(ULONG);
1140 GetEnhMetaFileBits(*phEmf, emfsize, pBuffer);
1141 pBuffer += emfsize;
1145 return pBuffer;
1148 /******************************************************************************
1149 * HENHMETAFILE_UserUnmarshal [OLE32.@]
1151 * Unmarshals an enhanced metafile from a buffer.
1153 * PARAMS
1154 * pFlags [I] Flags. See notes.
1155 * pBuffer [I] Buffer to marshal the clip format from.
1156 * phEmf [O] Address that receive the unmarshaled enhanced metafile.
1158 * RETURNS
1159 * The end of the marshaled data in the buffer.
1161 * NOTES
1162 * Even though the function is documented to take a pointer to an ULONG in
1163 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1164 * the first parameter is an ULONG.
1165 * This function is only intended to be called by the RPC runtime.
1167 unsigned char * __RPC_USER HENHMETAFILE_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HENHMETAFILE *phEmf)
1169 ULONG fContext;
1171 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, phEmf);
1173 fContext = *(ULONG *)pBuffer;
1174 pBuffer += sizeof(ULONG);
1176 if (((fContext == WDT_INPROC_CALL) && (sizeof(*phEmf) < 8)) ||
1177 ((fContext == WDT_INPROC64_CALL) && (sizeof(*phEmf) == 8)))
1179 *phEmf = *(HENHMETAFILE *)pBuffer;
1180 pBuffer += sizeof(*phEmf);
1182 else if (fContext == WDT_REMOTE_CALL)
1184 ULONG handle;
1186 handle = *(ULONG *)pBuffer;
1187 pBuffer += sizeof(ULONG);
1189 if (handle)
1191 ULONG size;
1192 size = *(ULONG *)pBuffer;
1193 pBuffer += sizeof(ULONG);
1194 if (size != *(ULONG *)pBuffer)
1196 RaiseException(RPC_X_BAD_STUB_DATA, 0, 0, NULL);
1197 return pBuffer;
1199 pBuffer += sizeof(ULONG);
1200 *phEmf = SetEnhMetaFileBits(size, pBuffer);
1201 pBuffer += size;
1203 else
1204 *phEmf = NULL;
1206 else
1207 RaiseException(RPC_S_INVALID_TAG, 0, 0, NULL);
1209 return pBuffer;
1212 /******************************************************************************
1213 * HENHMETAFILE_UserFree [OLE32.@]
1215 * Frees an unmarshaled enhanced metafile.
1217 * PARAMS
1218 * pFlags [I] Flags. See notes.
1219 * phEmf [I] Enhanced metafile to free.
1221 * RETURNS
1222 * The end of the marshaled data in the buffer.
1224 * NOTES
1225 * Even though the function is documented to take a pointer to a ULONG in
1226 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1227 * which the first parameter is a ULONG.
1228 * This function is only intended to be called by the RPC runtime.
1230 void __RPC_USER HENHMETAFILE_UserFree(ULONG *pFlags, HENHMETAFILE *phEmf)
1232 TRACE("(%s, &%p\n", debugstr_user_flags(pFlags), *phEmf);
1234 if (LOWORD(*pFlags) != MSHCTX_INPROC)
1235 DeleteEnhMetaFile(*phEmf);
1238 /******************************************************************************
1239 * HMETAFILEPICT_UserSize [OLE32.@]
1241 * Calculates the buffer size required to marshal an metafile pict.
1243 * PARAMS
1244 * pFlags [I] Flags. See notes.
1245 * StartingSize [I] Starting size of the buffer. This value is added on to
1246 * the buffer size required for the clip format.
1247 * phMfp [I] Metafile pict to size.
1249 * RETURNS
1250 * The buffer size required to marshal a metafile pict plus the starting size.
1252 * NOTES
1253 * Even though the function is documented to take a pointer to a ULONG in
1254 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1255 * the first parameter is a ULONG.
1256 * This function is only intended to be called by the RPC runtime.
1258 ULONG __RPC_USER HMETAFILEPICT_UserSize(ULONG *pFlags, ULONG StartingSize, HMETAFILEPICT *phMfp)
1260 ULONG size = StartingSize;
1262 TRACE("(%s, %d, &%p)\n", debugstr_user_flags(pFlags), StartingSize, *phMfp);
1264 size += sizeof(ULONG);
1265 size += sizeof(HMETAFILEPICT);
1267 if ((LOWORD(*pFlags) != MSHCTX_INPROC) && *phMfp)
1269 METAFILEPICT *mfpict = GlobalLock(*phMfp);
1271 /* FIXME: raise an exception if mfpict is NULL? */
1272 size += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
1273 size += sizeof(ULONG);
1275 size = HMETAFILE_UserSize(pFlags, size, &mfpict->hMF);
1277 GlobalUnlock(*phMfp);
1280 return size;
1283 /******************************************************************************
1284 * HMETAFILEPICT_UserMarshal [OLE32.@]
1286 * Marshals a metafile pict into a buffer.
1288 * PARAMS
1289 * pFlags [I] Flags. See notes.
1290 * pBuffer [I] Buffer to marshal the clip format into.
1291 * phMfp [I] Metafile pict to marshal.
1293 * RETURNS
1294 * The end of the marshaled data in the buffer.
1296 * NOTES
1297 * Even though the function is documented to take a pointer to a ULONG in
1298 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1299 * the first parameter is a ULONG.
1300 * This function is only intended to be called by the RPC runtime.
1302 unsigned char * __RPC_USER HMETAFILEPICT_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, HMETAFILEPICT *phMfp)
1304 TRACE("(%s, %p, &%p)\n", debugstr_user_flags(pFlags), pBuffer, *phMfp);
1306 if (LOWORD(*pFlags) == MSHCTX_INPROC)
1307 *(ULONG *)pBuffer = WDT_INPROC_CALL;
1308 else
1309 *(ULONG *)pBuffer = WDT_REMOTE_CALL;
1310 pBuffer += sizeof(ULONG);
1312 *(HMETAFILEPICT *)pBuffer = *phMfp;
1313 pBuffer += sizeof(HMETAFILEPICT);
1315 if ((LOWORD(*pFlags) != MSHCTX_INPROC) && *phMfp)
1317 METAFILEPICT *mfpict = GlobalLock(*phMfp);
1318 remoteMETAFILEPICT * remmfpict = (remoteMETAFILEPICT *)pBuffer;
1320 /* FIXME: raise an exception if mfpict is NULL? */
1321 remmfpict->mm = mfpict->mm;
1322 remmfpict->xExt = mfpict->xExt;
1323 remmfpict->yExt = mfpict->yExt;
1324 pBuffer += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
1325 *(ULONG *)pBuffer = USER_MARSHAL_PTR_PREFIX;
1326 pBuffer += sizeof(ULONG);
1328 pBuffer = HMETAFILE_UserMarshal(pFlags, pBuffer, &mfpict->hMF);
1330 GlobalUnlock(*phMfp);
1333 return pBuffer;
1336 /******************************************************************************
1337 * HMETAFILEPICT_UserUnmarshal [OLE32.@]
1339 * Unmarshals an metafile pict from a buffer.
1341 * PARAMS
1342 * pFlags [I] Flags. See notes.
1343 * pBuffer [I] Buffer to marshal the clip format from.
1344 * phMfp [O] Address that receive the unmarshaled metafile pict.
1346 * RETURNS
1347 * The end of the marshaled data in the buffer.
1349 * NOTES
1350 * Even though the function is documented to take a pointer to an ULONG in
1351 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1352 * the first parameter is an ULONG.
1353 * This function is only intended to be called by the RPC runtime.
1355 unsigned char * __RPC_USER HMETAFILEPICT_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, HMETAFILEPICT *phMfp)
1357 ULONG fContext;
1359 TRACE("(%s, %p, %p)\n", debugstr_user_flags(pFlags), pBuffer, phMfp);
1361 fContext = *(ULONG *)pBuffer;
1362 pBuffer += sizeof(ULONG);
1364 if ((fContext == WDT_INPROC_CALL) || !*(HMETAFILEPICT *)pBuffer)
1366 *phMfp = *(HMETAFILEPICT *)pBuffer;
1367 pBuffer += sizeof(HMETAFILEPICT);
1369 else
1371 METAFILEPICT *mfpict;
1372 const remoteMETAFILEPICT *remmfpict;
1373 ULONG user_marshal_prefix;
1375 pBuffer += sizeof(HMETAFILEPICT);
1376 remmfpict = (const remoteMETAFILEPICT *)pBuffer;
1378 *phMfp = GlobalAlloc(GMEM_MOVEABLE, sizeof(METAFILEPICT));
1379 if (!*phMfp)
1380 RpcRaiseException(E_OUTOFMEMORY);
1382 mfpict = GlobalLock(*phMfp);
1383 mfpict->mm = remmfpict->mm;
1384 mfpict->xExt = remmfpict->xExt;
1385 mfpict->yExt = remmfpict->yExt;
1386 pBuffer += FIELD_OFFSET(remoteMETAFILEPICT, hMF);
1387 user_marshal_prefix = *(ULONG *)pBuffer;
1388 pBuffer += sizeof(ULONG);
1390 if (user_marshal_prefix != USER_MARSHAL_PTR_PREFIX)
1391 RpcRaiseException(RPC_X_INVALID_TAG);
1393 pBuffer = HMETAFILE_UserUnmarshal(pFlags, pBuffer, &mfpict->hMF);
1395 GlobalUnlock(*phMfp);
1398 return pBuffer;
1401 /******************************************************************************
1402 * HMETAFILEPICT_UserFree [OLE32.@]
1404 * Frees an unmarshaled metafile pict.
1406 * PARAMS
1407 * pFlags [I] Flags. See notes.
1408 * phMfp [I] Metafile pict to free.
1410 * RETURNS
1411 * The end of the marshaled data in the buffer.
1413 * NOTES
1414 * Even though the function is documented to take a pointer to a ULONG in
1415 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1416 * which the first parameter is a ULONG.
1417 * This function is only intended to be called by the RPC runtime.
1419 void __RPC_USER HMETAFILEPICT_UserFree(ULONG *pFlags, HMETAFILEPICT *phMfp)
1421 TRACE("(%s, &%p)\n", debugstr_user_flags(pFlags), *phMfp);
1423 if ((LOWORD(*pFlags) == MSHCTX_INPROC) && *phMfp)
1425 METAFILEPICT *mfpict;
1427 mfpict = GlobalLock(*phMfp);
1428 /* FIXME: raise an exception if mfpict is NULL? */
1430 GlobalUnlock(*phMfp);
1434 /******************************************************************************
1435 * STGMEDIUM_UserSize [OLE32.@]
1437 * Calculates the buffer size required to marshal an STGMEDIUM.
1439 * PARAMS
1440 * pFlags [I] Flags. See notes.
1441 * StartingSize [I] Starting size of the buffer. This value is added on to
1442 * the buffer size required for the clip format.
1443 * pStgMedium [I] STGMEDIUM to size.
1445 * RETURNS
1446 * The buffer size required to marshal an STGMEDIUM plus the starting size.
1448 * NOTES
1449 * Even though the function is documented to take a pointer to a ULONG in
1450 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1451 * the first parameter is a ULONG.
1452 * This function is only intended to be called by the RPC runtime.
1454 ULONG __RPC_USER STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, STGMEDIUM *pStgMedium)
1456 ULONG size = StartingSize;
1458 TRACE("(%s, %d, %p\n", debugstr_user_flags(pFlags), StartingSize, pStgMedium);
1460 ALIGN_LENGTH(size, 3);
1462 size += 2 * sizeof(DWORD);
1463 if (pStgMedium->tymed != TYMED_NULL)
1464 size += sizeof(DWORD);
1466 switch (pStgMedium->tymed)
1468 case TYMED_NULL:
1469 TRACE("TYMED_NULL\n");
1470 break;
1471 case TYMED_HGLOBAL:
1472 TRACE("TYMED_HGLOBAL\n");
1473 if (pStgMedium->u.hGlobal)
1474 size = HGLOBAL_UserSize(pFlags, size, &pStgMedium->u.hGlobal);
1475 break;
1476 case TYMED_FILE:
1477 TRACE("TYMED_FILE\n");
1478 if (pStgMedium->u.lpszFileName)
1480 TRACE("file name is %s\n", debugstr_w(pStgMedium->u.lpszFileName));
1481 size += 3 * sizeof(DWORD) +
1482 (strlenW(pStgMedium->u.lpszFileName) + 1) * sizeof(WCHAR);
1484 break;
1485 case TYMED_ISTREAM:
1486 TRACE("TYMED_ISTREAM\n");
1487 if (pStgMedium->u.pstm)
1489 FIXME("not implemented for IStream %p\n", pStgMedium->u.pstm);
1491 break;
1492 case TYMED_ISTORAGE:
1493 TRACE("TYMED_ISTORAGE\n");
1494 if (pStgMedium->u.pstg)
1496 FIXME("not implemented for IStorage %p\n", pStgMedium->u.pstg);
1498 break;
1499 case TYMED_GDI:
1500 TRACE("TYMED_GDI\n");
1501 if (pStgMedium->u.hBitmap)
1503 FIXME("not implemented for GDI object %p\n", pStgMedium->u.hBitmap);
1505 break;
1506 case TYMED_MFPICT:
1507 TRACE("TYMED_MFPICT\n");
1508 if (pStgMedium->u.hMetaFilePict)
1509 size = HMETAFILEPICT_UserSize(pFlags, size, &pStgMedium->u.hMetaFilePict);
1510 break;
1511 case TYMED_ENHMF:
1512 TRACE("TYMED_ENHMF\n");
1513 if (pStgMedium->u.hEnhMetaFile)
1514 size = HENHMETAFILE_UserSize(pFlags, size, &pStgMedium->u.hEnhMetaFile);
1515 break;
1516 default:
1517 RaiseException(DV_E_TYMED, 0, 0, NULL);
1520 if (pStgMedium->pUnkForRelease)
1521 FIXME("buffer size pUnkForRelease\n");
1523 return size;
1526 /******************************************************************************
1527 * STGMEDIUM_UserMarshal [OLE32.@]
1529 * Marshals a STGMEDIUM into a buffer.
1531 * PARAMS
1532 * pFlags [I] Flags. See notes.
1533 * pBuffer [I] Buffer to marshal the clip format into.
1534 * pCF [I] STGMEDIUM to marshal.
1536 * RETURNS
1537 * The end of the marshaled data in the buffer.
1539 * NOTES
1540 * Even though the function is documented to take a pointer to a ULONG in
1541 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1542 * the first parameter is a ULONG.
1543 * This function is only intended to be called by the RPC runtime.
1545 unsigned char * __RPC_USER STGMEDIUM_UserMarshal(ULONG *pFlags, unsigned char *pBuffer, STGMEDIUM *pStgMedium)
1547 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, pStgMedium);
1549 ALIGN_POINTER(pBuffer, 3);
1551 *(DWORD *)pBuffer = pStgMedium->tymed;
1552 pBuffer += sizeof(DWORD);
1553 if (pStgMedium->tymed != TYMED_NULL)
1555 *(DWORD *)pBuffer = (DWORD)(DWORD_PTR)pStgMedium->u.pstg;
1556 pBuffer += sizeof(DWORD);
1558 *(DWORD *)pBuffer = (DWORD)(DWORD_PTR)pStgMedium->pUnkForRelease;
1559 pBuffer += sizeof(DWORD);
1561 switch (pStgMedium->tymed)
1563 case TYMED_NULL:
1564 TRACE("TYMED_NULL\n");
1565 break;
1566 case TYMED_HGLOBAL:
1567 TRACE("TYMED_HGLOBAL\n");
1568 if (pStgMedium->u.hGlobal)
1569 pBuffer = HGLOBAL_UserMarshal(pFlags, pBuffer, &pStgMedium->u.hGlobal);
1570 break;
1571 case TYMED_FILE:
1572 TRACE("TYMED_FILE\n");
1573 if (pStgMedium->u.lpszFileName)
1575 DWORD len;
1576 len = strlenW(pStgMedium->u.lpszFileName);
1577 /* conformance */
1578 *(DWORD *)pBuffer = len + 1;
1579 pBuffer += sizeof(DWORD);
1580 /* offset */
1581 *(DWORD *)pBuffer = 0;
1582 pBuffer += sizeof(DWORD);
1583 /* variance */
1584 *(DWORD *)pBuffer = len + 1;
1585 pBuffer += sizeof(DWORD);
1587 TRACE("file name is %s\n", debugstr_w(pStgMedium->u.lpszFileName));
1588 memcpy(pBuffer, pStgMedium->u.lpszFileName, (len + 1) * sizeof(WCHAR));
1590 break;
1591 case TYMED_ISTREAM:
1592 TRACE("TYMED_ISTREAM\n");
1593 if (pStgMedium->u.pstm)
1595 FIXME("not implemented for IStream %p\n", pStgMedium->u.pstm);
1597 break;
1598 case TYMED_ISTORAGE:
1599 TRACE("TYMED_ISTORAGE\n");
1600 if (pStgMedium->u.pstg)
1602 FIXME("not implemented for IStorage %p\n", pStgMedium->u.pstg);
1604 break;
1605 case TYMED_GDI:
1606 TRACE("TYMED_GDI\n");
1607 if (pStgMedium->u.hBitmap)
1609 FIXME("not implemented for GDI object %p\n", pStgMedium->u.hBitmap);
1611 break;
1612 case TYMED_MFPICT:
1613 TRACE("TYMED_MFPICT\n");
1614 if (pStgMedium->u.hMetaFilePict)
1615 pBuffer = HMETAFILEPICT_UserMarshal(pFlags, pBuffer, &pStgMedium->u.hMetaFilePict);
1616 break;
1617 case TYMED_ENHMF:
1618 TRACE("TYMED_ENHMF\n");
1619 if (pStgMedium->u.hEnhMetaFile)
1620 pBuffer = HENHMETAFILE_UserMarshal(pFlags, pBuffer, &pStgMedium->u.hEnhMetaFile);
1621 break;
1622 default:
1623 RaiseException(DV_E_TYMED, 0, 0, NULL);
1626 if (pStgMedium->pUnkForRelease)
1627 FIXME("marshal pUnkForRelease\n");
1629 return pBuffer;
1632 /******************************************************************************
1633 * STGMEDIUM_UserUnmarshal [OLE32.@]
1635 * Unmarshals a STGMEDIUM from a buffer.
1637 * PARAMS
1638 * pFlags [I] Flags. See notes.
1639 * pBuffer [I] Buffer to marshal the clip format from.
1640 * pStgMedium [O] Address that receive the unmarshaled STGMEDIUM.
1642 * RETURNS
1643 * The end of the marshaled data in the buffer.
1645 * NOTES
1646 * Even though the function is documented to take a pointer to an ULONG in
1647 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of which
1648 * the first parameter is an ULONG.
1649 * This function is only intended to be called by the RPC runtime.
1651 unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, STGMEDIUM *pStgMedium)
1653 DWORD content = 0;
1654 DWORD releaseunk;
1656 ALIGN_POINTER(pBuffer, 3);
1658 TRACE("(%s, %p, %p\n", debugstr_user_flags(pFlags), pBuffer, pStgMedium);
1660 pStgMedium->tymed = *(DWORD *)pBuffer;
1661 pBuffer += sizeof(DWORD);
1662 if (pStgMedium->tymed != TYMED_NULL)
1664 content = *(DWORD *)pBuffer;
1665 pBuffer += sizeof(DWORD);
1667 releaseunk = *(DWORD *)pBuffer;
1668 pBuffer += sizeof(DWORD);
1670 switch (pStgMedium->tymed)
1672 case TYMED_NULL:
1673 TRACE("TYMED_NULL\n");
1674 break;
1675 case TYMED_HGLOBAL:
1676 TRACE("TYMED_HGLOBAL\n");
1677 if (content)
1678 pBuffer = HGLOBAL_UserUnmarshal(pFlags, pBuffer, &pStgMedium->u.hGlobal);
1679 break;
1680 case TYMED_FILE:
1681 TRACE("TYMED_FILE\n");
1682 if (content)
1684 DWORD conformance;
1685 DWORD variance;
1686 conformance = *(DWORD *)pBuffer;
1687 pBuffer += sizeof(DWORD);
1688 if (*(DWORD *)pBuffer != 0)
1690 ERR("invalid offset %d\n", *(DWORD *)pBuffer);
1691 RpcRaiseException(RPC_S_INVALID_BOUND);
1692 return NULL;
1694 pBuffer += sizeof(DWORD);
1695 variance = *(DWORD *)pBuffer;
1696 pBuffer += sizeof(DWORD);
1697 if (conformance != variance)
1699 ERR("conformance (%d) and variance (%d) should be equal\n",
1700 conformance, variance);
1701 RpcRaiseException(RPC_S_INVALID_BOUND);
1702 return NULL;
1704 if (conformance > 0x7fffffff)
1706 ERR("conformance 0x%x too large\n", conformance);
1707 RpcRaiseException(RPC_S_INVALID_BOUND);
1708 return NULL;
1710 pStgMedium->u.lpszFileName = CoTaskMemAlloc(conformance * sizeof(WCHAR));
1711 if (!pStgMedium->u.lpszFileName) RpcRaiseException(ERROR_OUTOFMEMORY);
1712 TRACE("unmarshalled file name is %s\n", debugstr_wn((const WCHAR *)pBuffer, variance));
1713 memcpy(pStgMedium->u.lpszFileName, pBuffer, variance * sizeof(WCHAR));
1714 pBuffer += variance * sizeof(WCHAR);
1716 else
1717 pStgMedium->u.lpszFileName = NULL;
1718 break;
1719 case TYMED_ISTREAM:
1720 TRACE("TYMED_ISTREAM\n");
1721 if (content)
1723 FIXME("not implemented for IStream\n");
1725 else
1726 pStgMedium->u.pstm = NULL;
1727 break;
1728 case TYMED_ISTORAGE:
1729 TRACE("TYMED_ISTORAGE\n");
1730 if (content)
1732 FIXME("not implemented for IStorage\n");
1734 else
1735 pStgMedium->u.pstg = NULL;
1736 break;
1737 case TYMED_GDI:
1738 TRACE("TYMED_GDI\n");
1739 if (content)
1741 FIXME("not implemented for GDI object\n");
1743 else
1744 pStgMedium->u.hBitmap = NULL;
1745 break;
1746 case TYMED_MFPICT:
1747 TRACE("TYMED_MFPICT\n");
1748 if (content)
1749 pBuffer = HMETAFILEPICT_UserUnmarshal(pFlags, pBuffer, &pStgMedium->u.hMetaFilePict);
1750 else
1751 pStgMedium->u.hMetaFilePict = NULL;
1752 break;
1753 case TYMED_ENHMF:
1754 TRACE("TYMED_ENHMF\n");
1755 if (content)
1756 pBuffer = HENHMETAFILE_UserUnmarshal(pFlags, pBuffer, &pStgMedium->u.hEnhMetaFile);
1757 else
1758 pStgMedium->u.hEnhMetaFile = NULL;
1759 break;
1760 default:
1761 RaiseException(DV_E_TYMED, 0, 0, NULL);
1764 pStgMedium->pUnkForRelease = NULL;
1765 if (releaseunk)
1766 FIXME("unmarshal pUnkForRelease\n");
1768 return pBuffer;
1771 /******************************************************************************
1772 * STGMEDIUM_UserFree [OLE32.@]
1774 * Frees an unmarshaled STGMEDIUM.
1776 * PARAMS
1777 * pFlags [I] Flags. See notes.
1778 * pStgmedium [I] STGMEDIUM to free.
1780 * RETURNS
1781 * The end of the marshaled data in the buffer.
1783 * NOTES
1784 * Even though the function is documented to take a pointer to a ULONG in
1785 * pFlags, it actually takes a pointer to a USER_MARSHAL_CB structure, of
1786 * which the first parameter is a ULONG.
1787 * This function is only intended to be called by the RPC runtime.
1789 void __RPC_USER STGMEDIUM_UserFree(ULONG *pFlags, STGMEDIUM *pStgMedium)
1791 TRACE("(%s, %p\n", debugstr_user_flags(pFlags), pStgMedium);
1793 ReleaseStgMedium(pStgMedium);
1796 ULONG __RPC_USER ASYNC_STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, ASYNC_STGMEDIUM *pStgMedium)
1798 FIXME(":stub\n");
1799 return StartingSize;
1802 unsigned char * __RPC_USER ASYNC_STGMEDIUM_UserMarshal( ULONG *pFlags, unsigned char *pBuffer, ASYNC_STGMEDIUM *pStgMedium)
1804 FIXME(":stub\n");
1805 return pBuffer;
1808 unsigned char * __RPC_USER ASYNC_STGMEDIUM_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, ASYNC_STGMEDIUM *pStgMedium)
1810 FIXME(":stub\n");
1811 return pBuffer;
1814 void __RPC_USER ASYNC_STGMEDIUM_UserFree(ULONG *pFlags, ASYNC_STGMEDIUM *pStgMedium)
1816 FIXME(":stub\n");
1819 ULONG __RPC_USER FLAG_STGMEDIUM_UserSize(ULONG *pFlags, ULONG StartingSize, FLAG_STGMEDIUM *pStgMedium)
1821 FIXME(":stub\n");
1822 return StartingSize;
1825 unsigned char * __RPC_USER FLAG_STGMEDIUM_UserMarshal( ULONG *pFlags, unsigned char *pBuffer, FLAG_STGMEDIUM *pStgMedium)
1827 FIXME(":stub\n");
1828 return pBuffer;
1831 unsigned char * __RPC_USER FLAG_STGMEDIUM_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, FLAG_STGMEDIUM *pStgMedium)
1833 FIXME(":stub\n");
1834 return pBuffer;
1837 void __RPC_USER FLAG_STGMEDIUM_UserFree(ULONG *pFlags, FLAG_STGMEDIUM *pStgMedium)
1839 FIXME(":stub\n");
1842 ULONG __RPC_USER SNB_UserSize(ULONG *pFlags, ULONG StartingSize, SNB *pSnb)
1844 FIXME(":stub\n");
1845 return StartingSize;
1848 unsigned char * __RPC_USER SNB_UserMarshal( ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
1850 FIXME(":stub\n");
1851 return pBuffer;
1854 unsigned char * __RPC_USER SNB_UserUnmarshal(ULONG *pFlags, unsigned char *pBuffer, SNB *pSnb)
1856 FIXME(":stub\n");
1857 return pBuffer;
1860 void __RPC_USER SNB_UserFree(ULONG *pFlags, SNB *pSnb)
1862 FIXME(":stub\n");
1865 HRESULT STDMETHODCALLTYPE IClassFactory_CreateInstance_Proxy(
1866 IClassFactory * This,
1867 /* [unique][in] */ IUnknown *pUnkOuter,
1868 /* [in] */ REFIID riid,
1869 /* [iid_is][out] */ void **ppvObject)
1871 TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
1873 *ppvObject = NULL;
1875 if (pUnkOuter)
1877 ERR("aggregation not allowed on remote objects\n");
1878 return CLASS_E_NOAGGREGATION;
1880 return IClassFactory_RemoteCreateInstance_Proxy(This, riid, (IUnknown **)ppvObject);
1883 HRESULT STDMETHODCALLTYPE IClassFactory_CreateInstance_Stub(
1884 IClassFactory * This,
1885 /* [in] */ REFIID riid,
1886 /* [iid_is][out] */ IUnknown **ppvObject)
1888 TRACE("\n");
1889 return IClassFactory_CreateInstance(This, NULL, riid, (void **)ppvObject);
1892 HRESULT STDMETHODCALLTYPE IClassFactory_LockServer_Proxy(
1893 IClassFactory * This,
1894 /* [in] */ BOOL fLock)
1896 TRACE("(%s)\n", fLock ? "TRUE" : "FALSE");
1897 return S_OK; /* like native, ignore LockServer requests */
1900 HRESULT STDMETHODCALLTYPE IClassFactory_LockServer_Stub(
1901 IClassFactory * This,
1902 /* [in] */ BOOL fLock)
1904 TRACE("(%s)\n", fLock ? "TRUE" : "FALSE");
1905 return IClassFactory_LockServer(This, fLock);
1908 HRESULT STDMETHODCALLTYPE IOleInPlaceActiveObject_TranslateAccelerator_Proxy(
1909 IOleInPlaceActiveObject * This,
1910 /* [in] */ LPMSG lpmsg)
1912 WARN("(%p): doesn't work remotely\n", lpmsg);
1913 return S_OK; /* like native, this call isn't remotable */
1916 HRESULT STDMETHODCALLTYPE IOleInPlaceActiveObject_TranslateAccelerator_Stub(
1917 IOleInPlaceActiveObject * This)
1919 ERR("(): shouldn't be called\n");
1920 return S_OK;
1923 HRESULT STDMETHODCALLTYPE IOleInPlaceActiveObject_ResizeBorder_Proxy(
1924 IOleInPlaceActiveObject * This,
1925 /* [in] */ LPCRECT prcBorder,
1926 /* [unique][in] */ IOleInPlaceUIWindow *pUIWindow,
1927 /* [in] */ BOOL fFrameWindow)
1929 FIXME("(%p, %p, %d): stub\n", prcBorder, pUIWindow, fFrameWindow);
1930 return E_NOTIMPL;
1933 HRESULT STDMETHODCALLTYPE IOleInPlaceActiveObject_ResizeBorder_Stub(
1934 IOleInPlaceActiveObject * This,
1935 /* [in] */ LPCRECT prcBorder,
1936 /* [in] */ REFIID riid,
1937 /* [iid_is][unique][in] */ IOleInPlaceUIWindow *pUIWindow,
1938 /* [in] */ BOOL fFrameWindow)
1940 FIXME("(%p, %s, %p, %d): stub\n", prcBorder, debugstr_guid(riid), pUIWindow, fFrameWindow);
1941 return E_NOTIMPL;
1944 HRESULT STDMETHODCALLTYPE IOleCache2_UpdateCache_Proxy(
1945 IOleCache2 * This,
1946 /* [in] */ LPDATAOBJECT pDataObject,
1947 /* [in] */ DWORD grfUpdf,
1948 /* [in] */ LPVOID pReserved)
1950 FIXME("(%p, 0x%08x, %p): check me\n", pDataObject, grfUpdf, pReserved);
1951 return IOleCache2_RemoteUpdateCache_Proxy(This, pDataObject, grfUpdf, (LONG_PTR)pReserved);
1954 HRESULT STDMETHODCALLTYPE IOleCache2_UpdateCache_Stub(
1955 IOleCache2 * This,
1956 /* [in] */ LPDATAOBJECT pDataObject,
1957 /* [in] */ DWORD grfUpdf,
1958 /* [in] */ LONG_PTR pReserved)
1960 FIXME("(%p, 0x%08x, 0x%08lx): check me\n", pDataObject, grfUpdf, pReserved);
1961 return IOleCache2_UpdateCache(This, pDataObject, grfUpdf, (LPVOID)pReserved);
1964 HRESULT STDMETHODCALLTYPE IEnumOLEVERB_Next_Proxy(
1965 IEnumOLEVERB * This,
1966 /* [in] */ ULONG celt,
1967 /* [length_is][size_is][out] */ LPOLEVERB rgelt,
1968 /* [out] */ ULONG *pceltFetched)
1970 ULONG fetched;
1971 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
1972 if (!pceltFetched)
1973 pceltFetched = &fetched;
1974 return IEnumOLEVERB_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
1977 HRESULT STDMETHODCALLTYPE IEnumOLEVERB_Next_Stub(
1978 IEnumOLEVERB * This,
1979 /* [in] */ ULONG celt,
1980 /* [length_is][size_is][out] */ LPOLEVERB rgelt,
1981 /* [out] */ ULONG *pceltFetched)
1983 HRESULT hr;
1984 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
1985 *pceltFetched = 0;
1986 hr = IEnumOLEVERB_Next(This, celt, rgelt, pceltFetched);
1987 if (hr == S_OK) *pceltFetched = celt;
1988 return hr;
1991 HRESULT STDMETHODCALLTYPE IViewObject_Draw_Proxy(
1992 IViewObject * This,
1993 /* [in] */ DWORD dwDrawAspect,
1994 /* [in] */ LONG lindex,
1995 /* [unique][in] */ void *pvAspect,
1996 /* [unique][in] */ DVTARGETDEVICE *ptd,
1997 /* [in] */ HDC hdcTargetDev,
1998 /* [in] */ HDC hdcDraw,
1999 /* [in] */ LPCRECTL lprcBounds,
2000 /* [unique][in] */ LPCRECTL lprcWBounds,
2001 /* [in] */ BOOL ( STDMETHODCALLTYPE *pfnContinue )(
2002 ULONG_PTR dwContinue),
2003 /* [in] */ ULONG_PTR dwContinue)
2005 FIXME(": stub\n");
2006 return E_NOTIMPL;
2009 HRESULT STDMETHODCALLTYPE IViewObject_Draw_Stub(
2010 IViewObject * This,
2011 /* [in] */ DWORD dwDrawAspect,
2012 /* [in] */ LONG lindex,
2013 /* [in] */ ULONG_PTR pvAspect,
2014 /* [unique][in] */ DVTARGETDEVICE *ptd,
2015 /* [in] */ ULONG_PTR hdcTargetDev,
2016 /* [in] */ ULONG_PTR hdcDraw,
2017 /* [in] */ LPCRECTL lprcBounds,
2018 /* [unique][in] */ LPCRECTL lprcWBounds,
2019 /* [in] */ IContinue *pContinue)
2021 FIXME(": stub\n");
2022 return E_NOTIMPL;
2025 HRESULT STDMETHODCALLTYPE IViewObject_GetColorSet_Proxy(
2026 IViewObject * This,
2027 /* [in] */ DWORD dwDrawAspect,
2028 /* [in] */ LONG lindex,
2029 /* [unique][in] */ void *pvAspect,
2030 /* [unique][in] */ DVTARGETDEVICE *ptd,
2031 /* [in] */ HDC hicTargetDev,
2032 /* [out] */ LOGPALETTE **ppColorSet)
2034 FIXME(": stub\n");
2035 return E_NOTIMPL;
2038 HRESULT STDMETHODCALLTYPE IViewObject_GetColorSet_Stub(
2039 IViewObject * This,
2040 /* [in] */ DWORD dwDrawAspect,
2041 /* [in] */ LONG lindex,
2042 /* [in] */ ULONG_PTR pvAspect,
2043 /* [unique][in] */ DVTARGETDEVICE *ptd,
2044 /* [in] */ ULONG_PTR hicTargetDev,
2045 /* [out] */ LOGPALETTE **ppColorSet)
2047 FIXME(": stub\n");
2048 return E_NOTIMPL;
2051 HRESULT STDMETHODCALLTYPE IViewObject_Freeze_Proxy(
2052 IViewObject * This,
2053 /* [in] */ DWORD dwDrawAspect,
2054 /* [in] */ LONG lindex,
2055 /* [unique][in] */ void *pvAspect,
2056 /* [out] */ DWORD *pdwFreeze)
2058 FIXME(": stub\n");
2059 return E_NOTIMPL;
2062 HRESULT STDMETHODCALLTYPE IViewObject_Freeze_Stub(
2063 IViewObject * This,
2064 /* [in] */ DWORD dwDrawAspect,
2065 /* [in] */ LONG lindex,
2066 /* [in] */ ULONG_PTR pvAspect,
2067 /* [out] */ DWORD *pdwFreeze)
2069 FIXME(": stub\n");
2070 return E_NOTIMPL;
2073 HRESULT STDMETHODCALLTYPE IViewObject_GetAdvise_Proxy(
2074 IViewObject * This,
2075 /* [unique][out] */ DWORD *pAspects,
2076 /* [unique][out] */ DWORD *pAdvf,
2077 /* [out] */ IAdviseSink **ppAdvSink)
2079 FIXME(": stub\n");
2080 return E_NOTIMPL;
2083 HRESULT STDMETHODCALLTYPE IViewObject_GetAdvise_Stub(
2084 IViewObject * This,
2085 /* [out] */ DWORD *pAspects,
2086 /* [out] */ DWORD *pAdvf,
2087 /* [out] */ IAdviseSink **ppAdvSink)
2089 FIXME(": stub\n");
2090 return E_NOTIMPL;
2093 HRESULT STDMETHODCALLTYPE IEnumUnknown_Next_Proxy(
2094 IEnumUnknown * This,
2095 /* [in] */ ULONG celt,
2096 /* [out] */ IUnknown **rgelt,
2097 /* [out] */ ULONG *pceltFetched)
2099 ULONG fetched;
2100 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2101 if (!pceltFetched)
2102 pceltFetched = &fetched;
2103 return IEnumUnknown_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2106 HRESULT STDMETHODCALLTYPE IEnumUnknown_Next_Stub(
2107 IEnumUnknown * This,
2108 /* [in] */ ULONG celt,
2109 /* [length_is][size_is][out] */ IUnknown **rgelt,
2110 /* [out] */ ULONG *pceltFetched)
2112 HRESULT hr;
2113 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2114 *pceltFetched = 0;
2115 hr = IEnumUnknown_Next(This, celt, rgelt, pceltFetched);
2116 if (hr == S_OK) *pceltFetched = celt;
2117 return hr;
2120 HRESULT STDMETHODCALLTYPE IBindCtx_SetBindOptions_Proxy(
2121 IBindCtx * This,
2122 /* [in] */ BIND_OPTS *pbindopts)
2124 FIXME(": stub\n");
2125 return E_NOTIMPL;
2129 HRESULT STDMETHODCALLTYPE IBindCtx_SetBindOptions_Stub(
2130 IBindCtx * This,
2131 /* [in] */ BIND_OPTS2 *pbindopts)
2133 FIXME(": stub\n");
2134 return E_NOTIMPL;
2137 HRESULT STDMETHODCALLTYPE IBindCtx_GetBindOptions_Proxy(
2138 IBindCtx * This,
2139 /* [out][in] */ BIND_OPTS *pbindopts)
2141 FIXME(": stub\n");
2142 return E_NOTIMPL;
2146 HRESULT STDMETHODCALLTYPE IBindCtx_GetBindOptions_Stub(
2147 IBindCtx * This,
2148 /* [out][in] */ BIND_OPTS2 *pbindopts)
2150 FIXME(": stub\n");
2151 return E_NOTIMPL;
2154 HRESULT STDMETHODCALLTYPE IEnumMoniker_Next_Proxy(
2155 IEnumMoniker * This,
2156 /* [in] */ ULONG celt,
2157 /* [length_is][size_is][out] */ IMoniker **rgelt,
2158 /* [out] */ ULONG *pceltFetched)
2160 ULONG fetched;
2161 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2162 if (!pceltFetched)
2163 pceltFetched = &fetched;
2164 return IEnumMoniker_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2168 HRESULT STDMETHODCALLTYPE IEnumMoniker_Next_Stub(
2169 IEnumMoniker * This,
2170 /* [in] */ ULONG celt,
2171 /* [length_is][size_is][out] */ IMoniker **rgelt,
2172 /* [out] */ ULONG *pceltFetched)
2174 HRESULT hr;
2175 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2176 *pceltFetched = 0;
2177 hr = IEnumMoniker_Next(This, celt, rgelt, pceltFetched);
2178 if (hr == S_OK) *pceltFetched = celt;
2179 return hr;
2182 BOOL STDMETHODCALLTYPE IRunnableObject_IsRunning_Proxy(
2183 IRunnableObject * This)
2185 FIXME(": stub\n");
2186 return FALSE;
2190 HRESULT STDMETHODCALLTYPE IRunnableObject_IsRunning_Stub(
2191 IRunnableObject * This)
2193 FIXME(": stub\n");
2194 return E_NOTIMPL;
2197 HRESULT STDMETHODCALLTYPE IMoniker_BindToObject_Proxy(
2198 IMoniker * This,
2199 /* [unique][in] */ IBindCtx *pbc,
2200 /* [unique][in] */ IMoniker *pmkToLeft,
2201 /* [in] */ REFIID riidResult,
2202 /* [iid_is][out] */ void **ppvResult)
2204 FIXME(": stub\n");
2205 return E_NOTIMPL;
2208 HRESULT STDMETHODCALLTYPE IMoniker_BindToObject_Stub(
2209 IMoniker * This,
2210 /* [unique][in] */ IBindCtx *pbc,
2211 /* [unique][in] */ IMoniker *pmkToLeft,
2212 /* [in] */ REFIID riidResult,
2213 /* [iid_is][out] */ IUnknown **ppvResult)
2215 FIXME(": stub\n");
2216 return E_NOTIMPL;
2219 HRESULT STDMETHODCALLTYPE IMoniker_BindToStorage_Proxy(
2220 IMoniker * This,
2221 /* [unique][in] */ IBindCtx *pbc,
2222 /* [unique][in] */ IMoniker *pmkToLeft,
2223 /* [in] */ REFIID riid,
2224 /* [iid_is][out] */ void **ppvObj)
2226 FIXME(": stub\n");
2227 return E_NOTIMPL;
2230 HRESULT STDMETHODCALLTYPE IMoniker_BindToStorage_Stub(
2231 IMoniker * This,
2232 /* [unique][in] */ IBindCtx *pbc,
2233 /* [unique][in] */ IMoniker *pmkToLeft,
2234 /* [in] */ REFIID riid,
2235 /* [iid_is][out] */ IUnknown **ppvObj)
2237 FIXME(": stub\n");
2238 return E_NOTIMPL;
2241 HRESULT STDMETHODCALLTYPE IEnumString_Next_Proxy(
2242 IEnumString * This,
2243 /* [in] */ ULONG celt,
2244 /* [length_is][size_is][out] */ LPOLESTR *rgelt,
2245 /* [out] */ ULONG *pceltFetched)
2247 ULONG fetched;
2248 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2249 if (!pceltFetched)
2250 pceltFetched = &fetched;
2251 return IEnumString_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2254 HRESULT STDMETHODCALLTYPE IEnumString_Next_Stub(
2255 IEnumString * This,
2256 /* [in] */ ULONG celt,
2257 /* [length_is][size_is][out] */ LPOLESTR *rgelt,
2258 /* [out] */ ULONG *pceltFetched)
2260 HRESULT hr;
2261 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2262 *pceltFetched = 0;
2263 hr = IEnumString_Next(This, celt, rgelt, pceltFetched);
2264 if (hr == S_OK) *pceltFetched = celt;
2265 return hr;
2268 HRESULT STDMETHODCALLTYPE ISequentialStream_Read_Proxy(
2269 ISequentialStream * This,
2270 /* [length_is][size_is][out] */ void *pv,
2271 /* [in] */ ULONG cb,
2272 /* [out] */ ULONG *pcbRead)
2274 ULONG cbRead;
2275 HRESULT hr;
2277 TRACE("(%p, %d, %p)\n", pv, cb, pcbRead);
2278 hr = ISequentialStream_RemoteRead_Proxy(This, pv, cb, &cbRead);
2279 if (pcbRead)
2280 *pcbRead = cbRead;
2282 return hr;
2285 HRESULT STDMETHODCALLTYPE ISequentialStream_Read_Stub(
2286 ISequentialStream * This,
2287 /* [length_is][size_is][out] */ byte *pv,
2288 /* [in] */ ULONG cb,
2289 /* [out] */ ULONG *pcbRead)
2291 HRESULT hr;
2292 TRACE("(%p, %d, %p)\n", pv, cb, pcbRead);
2293 hr = ISequentialStream_Read(This, pv, cb, pcbRead);
2294 TRACE("hr = 0x%08x, *pcbRead = %d\n", hr, *pcbRead);
2295 return hr;
2298 HRESULT STDMETHODCALLTYPE ISequentialStream_Write_Proxy(
2299 ISequentialStream * This,
2300 /* [size_is][in] */ const void *pv,
2301 /* [in] */ ULONG cb,
2302 /* [out] */ ULONG *pcbWritten)
2304 ULONG cbWritten;
2305 HRESULT hr;
2307 TRACE("(%p, %d, %p)\n", pv, cb, pcbWritten);
2308 hr = ISequentialStream_RemoteWrite_Proxy(This, (byte *)pv, cb, &cbWritten);
2309 if (pcbWritten)
2310 *pcbWritten = cbWritten;
2312 return hr;
2315 HRESULT STDMETHODCALLTYPE ISequentialStream_Write_Stub(
2316 ISequentialStream * This,
2317 /* [size_is][in] */ const byte *pv,
2318 /* [in] */ ULONG cb,
2319 /* [out] */ ULONG *pcbWritten)
2321 TRACE("(%p, %d, %p)\n", pv, cb, pcbWritten);
2322 return ISequentialStream_Write(This, pv, cb, pcbWritten);
2325 HRESULT STDMETHODCALLTYPE IStream_Seek_Proxy(
2326 IStream * This,
2327 /* [in] */ LARGE_INTEGER dlibMove,
2328 /* [in] */ DWORD dwOrigin,
2329 /* [out] */ ULARGE_INTEGER *plibNewPosition)
2331 ULARGE_INTEGER dlibNewPosition;
2332 HRESULT hr;
2334 TRACE("(%s, 0x%x, %p)\n", wine_dbgstr_longlong(dlibMove.QuadPart), dwOrigin, plibNewPosition);
2336 hr = IStream_RemoteSeek_Proxy(This, dlibMove, dwOrigin, &dlibNewPosition);
2337 if (plibNewPosition)
2338 *plibNewPosition = dlibNewPosition;
2340 return hr;
2343 HRESULT STDMETHODCALLTYPE IStream_Seek_Stub(
2344 IStream * This,
2345 /* [in] */ LARGE_INTEGER dlibMove,
2346 /* [in] */ DWORD dwOrigin,
2347 /* [out] */ ULARGE_INTEGER *plibNewPosition)
2349 TRACE("(%s, 0x%x, %p)\n", wine_dbgstr_longlong(dlibMove.QuadPart), dwOrigin, plibNewPosition);
2351 plibNewPosition->QuadPart = 0;
2352 return IStream_Seek(This, dlibMove, dwOrigin, plibNewPosition);
2355 HRESULT STDMETHODCALLTYPE IStream_CopyTo_Proxy(
2356 IStream * This,
2357 /* [unique][in] */ IStream *pstm,
2358 /* [in] */ ULARGE_INTEGER cb,
2359 /* [out] */ ULARGE_INTEGER *pcbRead,
2360 /* [out] */ ULARGE_INTEGER *pcbWritten)
2362 ULARGE_INTEGER cbRead;
2363 ULARGE_INTEGER cbWritten;
2364 HRESULT hr;
2366 TRACE("(%p, %s, %p, %p)\n", pstm, wine_dbgstr_longlong(cb.QuadPart), pcbRead, pcbWritten);
2368 hr = IStream_RemoteCopyTo_Proxy(This, pstm, cb, &cbRead, &cbWritten);
2369 if (pcbRead)
2370 *pcbRead = cbRead;
2371 if (pcbWritten)
2372 *pcbWritten = cbWritten;
2374 return hr;
2377 HRESULT STDMETHODCALLTYPE IStream_CopyTo_Stub(
2378 IStream * This,
2379 /* [unique][in] */ IStream *pstm,
2380 /* [in] */ ULARGE_INTEGER cb,
2381 /* [out] */ ULARGE_INTEGER *pcbRead,
2382 /* [out] */ ULARGE_INTEGER *pcbWritten)
2384 TRACE("(%p, %s, %p, %p)\n", pstm, wine_dbgstr_longlong(cb.QuadPart), pcbRead, pcbWritten);
2386 pcbRead->QuadPart = 0;
2387 pcbWritten->QuadPart = 0;
2388 return IStream_CopyTo(This, pstm, cb, pcbRead, pcbWritten);
2391 HRESULT STDMETHODCALLTYPE IEnumSTATSTG_Next_Proxy(
2392 IEnumSTATSTG * This,
2393 /* [in] */ ULONG celt,
2394 /* [length_is][size_is][out] */ STATSTG *rgelt,
2395 /* [out] */ ULONG *pceltFetched)
2397 ULONG fetched;
2398 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2399 if (!pceltFetched)
2400 pceltFetched = &fetched;
2401 return IEnumSTATSTG_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2404 HRESULT STDMETHODCALLTYPE IEnumSTATSTG_Next_Stub(
2405 IEnumSTATSTG * This,
2406 /* [in] */ ULONG celt,
2407 /* [length_is][size_is][out] */ STATSTG *rgelt,
2408 /* [out] */ ULONG *pceltFetched)
2410 HRESULT hr;
2411 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2412 *pceltFetched = 0;
2413 hr = IEnumSTATSTG_Next(This, celt, rgelt, pceltFetched);
2414 if (hr == S_OK) *pceltFetched = celt;
2415 return hr;
2418 HRESULT STDMETHODCALLTYPE IStorage_OpenStream_Proxy(
2419 IStorage * This,
2420 /* [in] */ LPCOLESTR pwcsName,
2421 /* [unique][in] */ void *reserved1,
2422 /* [in] */ DWORD grfMode,
2423 /* [in] */ DWORD reserved2,
2424 /* [out] */ IStream **ppstm)
2426 TRACE("(%s, %p, 0x%x, 0x%x, %p)\n", debugstr_w(pwcsName), reserved1, grfMode, reserved2, ppstm);
2427 *ppstm = NULL;
2428 return IStorage_RemoteOpenStream_Proxy(This, pwcsName, 0, NULL, grfMode, reserved2, ppstm);
2431 HRESULT STDMETHODCALLTYPE IStorage_OpenStream_Stub(
2432 IStorage * This,
2433 /* [in] */ LPCOLESTR pwcsName,
2434 /* [in] */ unsigned long cbReserved1,
2435 /* [size_is][unique][in] */ byte *reserved1,
2436 /* [in] */ DWORD grfMode,
2437 /* [in] */ DWORD reserved2,
2438 /* [out] */ IStream **ppstm)
2440 TRACE("(%s, %p, 0x%x, 0x%x, %p)\n", debugstr_w(pwcsName), reserved1, grfMode, reserved2, ppstm);
2441 return IStorage_OpenStream(This, pwcsName, NULL, grfMode, reserved2, ppstm);
2444 HRESULT STDMETHODCALLTYPE IStorage_EnumElements_Proxy(
2445 IStorage * This,
2446 /* [in] */ DWORD reserved1,
2447 /* [size_is][unique][in] */ void *reserved2,
2448 /* [in] */ DWORD reserved3,
2449 /* [out] */ IEnumSTATSTG **ppenum)
2451 TRACE("(0x%x, %p, 0x%x, %p)\n", reserved1, reserved2, reserved3, ppenum);
2452 *ppenum = NULL;
2453 return IStorage_RemoteEnumElements_Proxy(This, reserved1, 0, NULL, reserved3, ppenum);
2456 HRESULT STDMETHODCALLTYPE IStorage_EnumElements_Stub(
2457 IStorage * This,
2458 /* [in] */ DWORD reserved1,
2459 /* [in] */ unsigned long cbReserved2,
2460 /* [size_is][unique][in] */ byte *reserved2,
2461 /* [in] */ DWORD reserved3,
2462 /* [out] */ IEnumSTATSTG **ppenum)
2464 TRACE("(0x%x, %p, 0x%x, %p)\n", reserved1, reserved2, reserved3, ppenum);
2465 return IStorage_EnumElements(This, reserved1, NULL, reserved3, ppenum);
2468 HRESULT STDMETHODCALLTYPE ILockBytes_ReadAt_Proxy(
2469 ILockBytes * This,
2470 /* [in] */ ULARGE_INTEGER ulOffset,
2471 /* [length_is][size_is][out] */ void *pv,
2472 /* [in] */ ULONG cb,
2473 /* [out] */ ULONG *pcbRead)
2475 FIXME(": stub\n");
2476 return E_NOTIMPL;
2479 HRESULT STDMETHODCALLTYPE ILockBytes_ReadAt_Stub(
2480 ILockBytes * This,
2481 /* [in] */ ULARGE_INTEGER ulOffset,
2482 /* [length_is][size_is][out] */ byte *pv,
2483 /* [in] */ ULONG cb,
2484 /* [out] */ ULONG *pcbRead)
2486 FIXME(": stub\n");
2487 return E_NOTIMPL;
2490 HRESULT STDMETHODCALLTYPE ILockBytes_WriteAt_Proxy(
2491 ILockBytes * This,
2492 /* [in] */ ULARGE_INTEGER ulOffset,
2493 /* [size_is][in] */ const void *pv,
2494 /* [in] */ ULONG cb,
2495 /* [out] */ ULONG *pcbWritten)
2497 FIXME(": stub\n");
2498 return E_NOTIMPL;
2501 HRESULT STDMETHODCALLTYPE ILockBytes_WriteAt_Stub(
2502 ILockBytes * This,
2503 /* [in] */ ULARGE_INTEGER ulOffset,
2504 /* [size_is][in] */ const byte *pv,
2505 /* [in] */ ULONG cb,
2506 /* [out] */ ULONG *pcbWritten)
2508 FIXME(": stub\n");
2509 return E_NOTIMPL;
2512 HRESULT STDMETHODCALLTYPE IFillLockBytes_FillAppend_Proxy(
2513 IFillLockBytes * This,
2514 /* [size_is][in] */ const void *pv,
2515 /* [in] */ ULONG cb,
2516 /* [out] */ ULONG *pcbWritten)
2518 FIXME(": stub\n");
2519 return E_NOTIMPL;
2522 HRESULT STDMETHODCALLTYPE IFillLockBytes_FillAppend_Stub(
2523 IFillLockBytes * This,
2524 /* [size_is][in] */ const byte *pv,
2525 /* [in] */ ULONG cb,
2526 /* [out] */ ULONG *pcbWritten)
2528 FIXME(": stub\n");
2529 return E_NOTIMPL;
2532 HRESULT STDMETHODCALLTYPE IFillLockBytes_FillAt_Proxy(
2533 IFillLockBytes * This,
2534 /* [in] */ ULARGE_INTEGER ulOffset,
2535 /* [size_is][in] */ const void *pv,
2536 /* [in] */ ULONG cb,
2537 /* [out] */ ULONG *pcbWritten)
2539 FIXME(": stub\n");
2540 return E_NOTIMPL;
2543 HRESULT STDMETHODCALLTYPE IFillLockBytes_FillAt_Stub(
2544 IFillLockBytes * This,
2545 /* [in] */ ULARGE_INTEGER ulOffset,
2546 /* [size_is][in] */ const byte *pv,
2547 /* [in] */ ULONG cb,
2548 /* [out] */ ULONG *pcbWritten)
2550 FIXME(": stub\n");
2551 return E_NOTIMPL;
2554 HRESULT STDMETHODCALLTYPE IEnumFORMATETC_Next_Proxy(
2555 IEnumFORMATETC * This,
2556 /* [in] */ ULONG celt,
2557 /* [length_is][size_is][out] */ FORMATETC *rgelt,
2558 /* [out] */ ULONG *pceltFetched)
2560 ULONG fetched;
2561 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2562 if (!pceltFetched)
2563 pceltFetched = &fetched;
2564 return IEnumFORMATETC_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2567 HRESULT STDMETHODCALLTYPE IEnumFORMATETC_Next_Stub(
2568 IEnumFORMATETC * This,
2569 /* [in] */ ULONG celt,
2570 /* [length_is][size_is][out] */ FORMATETC *rgelt,
2571 /* [out] */ ULONG *pceltFetched)
2573 HRESULT hr;
2574 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2575 *pceltFetched = 0;
2576 hr = IEnumFORMATETC_Next(This, celt, rgelt, pceltFetched);
2577 if (hr == S_OK) *pceltFetched = celt;
2578 return hr;
2581 HRESULT STDMETHODCALLTYPE IEnumSTATDATA_Next_Proxy(
2582 IEnumSTATDATA * This,
2583 /* [in] */ ULONG celt,
2584 /* [length_is][size_is][out] */ STATDATA *rgelt,
2585 /* [out] */ ULONG *pceltFetched)
2587 ULONG fetched;
2588 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2589 if (!pceltFetched)
2590 pceltFetched = &fetched;
2591 return IEnumSTATDATA_RemoteNext_Proxy(This, celt, rgelt, pceltFetched);
2594 HRESULT STDMETHODCALLTYPE IEnumSTATDATA_Next_Stub(
2595 IEnumSTATDATA * This,
2596 /* [in] */ ULONG celt,
2597 /* [length_is][size_is][out] */ STATDATA *rgelt,
2598 /* [out] */ ULONG *pceltFetched)
2600 HRESULT hr;
2601 TRACE("(%d, %p, %p)\n", celt, rgelt, pceltFetched);
2602 *pceltFetched = 0;
2603 hr = IEnumSTATDATA_Next(This, celt, rgelt, pceltFetched);
2604 if (hr == S_OK) *pceltFetched = celt;
2605 return hr;
2608 HRESULT STDMETHODCALLTYPE IDataObject_GetData_Proxy(
2609 IDataObject * This,
2610 /* [unique][in] */ FORMATETC *pformatetcIn,
2611 /* [out] */ STGMEDIUM *pmedium)
2613 TRACE("(%p, %p)\n", pformatetcIn, pmedium);
2614 return IDataObject_RemoteGetData_Proxy(This, pformatetcIn, pmedium);
2617 HRESULT STDMETHODCALLTYPE IDataObject_GetData_Stub(
2618 IDataObject * This,
2619 /* [unique][in] */ FORMATETC *pformatetcIn,
2620 /* [out] */ STGMEDIUM *pRemoteMedium)
2622 TRACE("(%p, %p)\n", pformatetcIn, pRemoteMedium);
2623 return IDataObject_GetData(This, pformatetcIn, pRemoteMedium);
2626 HRESULT STDMETHODCALLTYPE IDataObject_GetDataHere_Proxy(
2627 IDataObject * This,
2628 /* [unique][in] */ FORMATETC *pformatetc,
2629 /* [out][in] */ STGMEDIUM *pmedium)
2631 FIXME(": stub\n");
2632 return E_NOTIMPL;
2635 HRESULT STDMETHODCALLTYPE IDataObject_GetDataHere_Stub(
2636 IDataObject * This,
2637 /* [unique][in] */ FORMATETC *pformatetc,
2638 /* [out][in] */ STGMEDIUM *pRemoteMedium)
2640 FIXME(": stub\n");
2641 return E_NOTIMPL;
2644 HRESULT STDMETHODCALLTYPE IDataObject_SetData_Proxy(
2645 IDataObject * This,
2646 /* [unique][in] */ FORMATETC *pformatetc,
2647 /* [unique][in] */ STGMEDIUM *pmedium,
2648 /* [in] */ BOOL fRelease)
2650 FIXME(": stub\n");
2651 return E_NOTIMPL;
2654 HRESULT STDMETHODCALLTYPE IDataObject_SetData_Stub(
2655 IDataObject * This,
2656 /* [unique][in] */ FORMATETC *pformatetc,
2657 /* [unique][in] */ FLAG_STGMEDIUM *pmedium,
2658 /* [in] */ BOOL fRelease)
2660 FIXME(": stub\n");
2661 return E_NOTIMPL;
2665 void STDMETHODCALLTYPE IAdviseSink_OnDataChange_Proxy(
2666 IAdviseSink * This,
2667 /* [unique][in] */ FORMATETC *pFormatetc,
2668 /* [unique][in] */ STGMEDIUM *pStgmed)
2670 TRACE("(%p, %p)\n", pFormatetc, pStgmed);
2671 IAdviseSink_RemoteOnDataChange_Proxy(This, pFormatetc, pStgmed);
2675 HRESULT STDMETHODCALLTYPE IAdviseSink_OnDataChange_Stub(
2676 IAdviseSink * This,
2677 /* [unique][in] */ FORMATETC *pFormatetc,
2678 /* [unique][in] */ ASYNC_STGMEDIUM *pStgmed)
2680 TRACE("(%p, %p)\n", pFormatetc, pStgmed);
2681 IAdviseSink_OnDataChange(This, pFormatetc, pStgmed);
2682 return S_OK;
2685 void STDMETHODCALLTYPE IAdviseSink_OnViewChange_Proxy(
2686 IAdviseSink * This,
2687 /* [in] */ DWORD dwAspect,
2688 /* [in] */ LONG lindex)
2690 TRACE("(%d, %d)\n", dwAspect, lindex);
2691 IAdviseSink_RemoteOnViewChange_Proxy(This, dwAspect, lindex);
2695 HRESULT STDMETHODCALLTYPE IAdviseSink_OnViewChange_Stub(
2696 IAdviseSink * This,
2697 /* [in] */ DWORD dwAspect,
2698 /* [in] */ LONG lindex)
2700 TRACE("(%d, %d)\n", dwAspect, lindex);
2701 IAdviseSink_OnViewChange(This, dwAspect, lindex);
2702 return S_OK;
2705 void STDMETHODCALLTYPE IAdviseSink_OnRename_Proxy(
2706 IAdviseSink * This,
2707 /* [in] */ IMoniker *pmk)
2709 TRACE("(%p)\n", pmk);
2710 IAdviseSink_RemoteOnRename_Proxy(This, pmk);
2714 HRESULT STDMETHODCALLTYPE IAdviseSink_OnRename_Stub(
2715 IAdviseSink * This,
2716 /* [in] */ IMoniker *pmk)
2718 TRACE("(%p)\n", pmk);
2719 IAdviseSink_OnRename(This, pmk);
2720 return S_OK;
2723 void STDMETHODCALLTYPE IAdviseSink_OnSave_Proxy(
2724 IAdviseSink * This)
2726 TRACE("()\n");
2727 IAdviseSink_RemoteOnSave_Proxy(This);
2730 HRESULT STDMETHODCALLTYPE IAdviseSink_OnSave_Stub(
2731 IAdviseSink * This)
2733 TRACE("()\n");
2734 IAdviseSink_OnSave(This);
2735 return S_OK;
2738 void STDMETHODCALLTYPE IAdviseSink_OnClose_Proxy(
2739 IAdviseSink * This)
2741 TRACE("()\n");
2742 IAdviseSink_RemoteOnClose_Proxy(This);
2745 HRESULT STDMETHODCALLTYPE IAdviseSink_OnClose_Stub(
2746 IAdviseSink * This)
2748 TRACE("()\n");
2749 IAdviseSink_OnClose(This);
2750 return S_OK;
2753 void STDMETHODCALLTYPE IAdviseSink2_OnLinkSrcChange_Proxy(
2754 IAdviseSink2 * This,
2755 /* [unique][in] */ IMoniker *pmk)
2757 TRACE("(%p)\n", pmk);
2758 IAdviseSink2_RemoteOnLinkSrcChange_Proxy(This, pmk);
2761 HRESULT STDMETHODCALLTYPE IAdviseSink2_OnLinkSrcChange_Stub(
2762 IAdviseSink2 * This,
2763 /* [unique][in] */ IMoniker *pmk)
2765 TRACE("(%p)\n", pmk);
2766 IAdviseSink2_OnLinkSrcChange(This, pmk);
2767 return S_OK;