4 * Implementation of OLE IPicture and related interfaces
6 * Copyright 2000 Huw D M Davies for CodeWeavers.
7 * Copyright 2001 Marcus Meissner
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Support PICTYPE_BITMAP and PICTYPE_ICON, altough only bitmaps very well..
26 * Lots of methods are just stubs.
29 * NOTES (or things that msdn doesn't tell you)
31 * The width and height properties are returned in HIMETRIC units (0.01mm)
32 * IPicture::Render also uses these to select a region of the src picture.
33 * A bitmap's size is converted into these units by using the screen resolution
34 * thus an 8x8 bitmap on a 96dpi screen has a size of 212x212 (8/96 * 2540).
46 /* Must be before wine includes, the header has things conflicting with
53 #define NONAMELESSUNION
54 #define NONAMELESSSTRUCT
62 #include "wine/obj_picture.h"
63 #include "wine/obj_connection.h"
65 #include "wine/debug.h"
67 #include "wine/wingdi16.h"
68 #include "cursoricon.h"
71 /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
73 #define UINT8 JPEG_UINT8
74 #define UINT16 JPEG_UINT16
81 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
83 /*************************************************************************
84 * Declaration of implementation class
87 typedef struct OLEPictureImpl
{
90 * IPicture handles IUnknown
93 ICOM_VTABLE(IPicture
) *lpvtbl1
;
94 ICOM_VTABLE(IDispatch
) *lpvtbl2
;
95 ICOM_VTABLE(IPersistStream
) *lpvtbl3
;
96 ICOM_VTABLE(IConnectionPointContainer
) *lpvtbl4
;
98 /* Object referenece count */
101 /* We own the object and must destroy it ourselves */
104 /* Picture description */
107 /* These are the pixel size of a bitmap */
111 /* And these are the size of the picture converted into HIMETRIC units */
112 OLE_XSIZE_HIMETRIC himetricWidth
;
113 OLE_YSIZE_HIMETRIC himetricHeight
;
115 IConnectionPoint
*pCP
;
126 * Macros to retrieve pointer to IUnknown (IPicture) from the other VTables.
128 #define ICOM_THIS_From_IDispatch(impl, name) \
129 impl *This = (impl*)(((char*)name)-sizeof(void*));
130 #define ICOM_THIS_From_IPersistStream(impl, name) \
131 impl *This = (impl*)(((char*)name)-2*sizeof(void*));
132 #define ICOM_THIS_From_IConnectionPointContainer(impl, name) \
133 impl *This = (impl*)(((char*)name)-3*sizeof(void*));
136 * Predeclare VTables. They get initialized at the end.
138 static ICOM_VTABLE(IPicture
) OLEPictureImpl_VTable
;
139 static ICOM_VTABLE(IDispatch
) OLEPictureImpl_IDispatch_VTable
;
140 static ICOM_VTABLE(IPersistStream
) OLEPictureImpl_IPersistStream_VTable
;
141 static ICOM_VTABLE(IConnectionPointContainer
) OLEPictureImpl_IConnectionPointContainer_VTable
;
143 /***********************************************************************
144 * Implementation of the OLEPictureImpl class.
147 static void OLEPictureImpl_SetBitmap(OLEPictureImpl
*This
) {
151 TRACE("bitmap handle %p\n", This
->desc
.u
.bmp
.hbitmap
);
152 if(GetObjectA(This
->desc
.u
.bmp
.hbitmap
, sizeof(bm
), &bm
) != sizeof(bm
)) {
153 ERR("GetObject fails\n");
156 This
->origWidth
= bm
.bmWidth
;
157 This
->origHeight
= bm
.bmHeight
;
158 /* The width and height are stored in HIMETRIC units (0.01 mm),
159 so we take our pixel width divide by pixels per inch and
160 multiply by 25.4 * 100 */
161 /* Should we use GetBitmapDimension if available? */
162 hdcRef
= CreateCompatibleDC(0);
163 This
->himetricWidth
=(bm
.bmWidth
*2540)/GetDeviceCaps(hdcRef
, LOGPIXELSX
);
164 This
->himetricHeight
=(bm
.bmHeight
*2540)/GetDeviceCaps(hdcRef
, LOGPIXELSY
);
168 /************************************************************************
169 * OLEPictureImpl_Construct
171 * This method will construct a new instance of the OLEPictureImpl
174 * The caller of this method must release the object when it's
177 static OLEPictureImpl
* OLEPictureImpl_Construct(LPPICTDESC pictDesc
, BOOL fOwn
)
179 OLEPictureImpl
* newObject
= 0;
182 TRACE("(%p) type = %d\n", pictDesc
, pictDesc
->picType
);
185 * Allocate space for the object.
187 newObject
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(OLEPictureImpl
));
193 * Initialize the virtual function table.
195 newObject
->lpvtbl1
= &OLEPictureImpl_VTable
;
196 newObject
->lpvtbl2
= &OLEPictureImpl_IDispatch_VTable
;
197 newObject
->lpvtbl3
= &OLEPictureImpl_IPersistStream_VTable
;
198 newObject
->lpvtbl4
= &OLEPictureImpl_IConnectionPointContainer_VTable
;
200 CreateConnectionPoint((IUnknown
*)newObject
,&IID_IPropertyNotifySink
,&newObject
->pCP
);
203 * Start with one reference count. The caller of this function
204 * must release the interface pointer when it is done.
207 newObject
->hDCCur
= 0;
209 newObject
->fOwn
= fOwn
;
211 /* dunno about original value */
212 newObject
->keepOrigFormat
= TRUE
;
215 if(pictDesc
->cbSizeofstruct
!= sizeof(PICTDESC
)) {
216 FIXME("struct size = %d\n", pictDesc
->cbSizeofstruct
);
218 memcpy(&newObject
->desc
, pictDesc
, sizeof(PICTDESC
));
221 switch(pictDesc
->picType
) {
223 OLEPictureImpl_SetBitmap(newObject
);
226 case PICTYPE_METAFILE
:
227 TRACE("metafile handle %p\n", pictDesc
->u
.wmf
.hmeta
);
228 newObject
->himetricWidth
= pictDesc
->u
.wmf
.xExt
;
229 newObject
->himetricHeight
= pictDesc
->u
.wmf
.yExt
;
233 /* not sure what to do here */
234 newObject
->himetricWidth
= newObject
->himetricHeight
= 0;
238 case PICTYPE_ENHMETAFILE
:
240 FIXME("Unsupported type %d\n", pictDesc
->picType
);
241 newObject
->himetricWidth
= newObject
->himetricHeight
= 0;
245 newObject
->desc
.picType
= PICTYPE_UNINITIALIZED
;
248 TRACE("returning %p\n", newObject
);
252 /************************************************************************
253 * OLEPictureImpl_Destroy
255 * This method is called by the Release method when the reference
256 * count goes down to 0. It will free all resources used by
258 static void OLEPictureImpl_Destroy(OLEPictureImpl
* Obj
)
260 TRACE("(%p)\n", Obj
);
262 if(Obj
->fOwn
) { /* We need to destroy the picture */
263 switch(Obj
->desc
.picType
) {
265 DeleteObject(Obj
->desc
.u
.bmp
.hbitmap
);
267 case PICTYPE_METAFILE
:
268 DeleteMetaFile(Obj
->desc
.u
.wmf
.hmeta
);
271 DestroyIcon(Obj
->desc
.u
.icon
.hicon
);
273 case PICTYPE_ENHMETAFILE
:
274 DeleteEnhMetaFile(Obj
->desc
.u
.emf
.hemf
);
277 FIXME("Unsupported type %d - unable to delete\n", Obj
->desc
.picType
);
281 if (Obj
->data
) HeapFree(GetProcessHeap(), 0, Obj
->data
);
282 HeapFree(GetProcessHeap(), 0, Obj
);
285 static ULONG WINAPI
OLEPictureImpl_AddRef(IPicture
* iface
);
287 /************************************************************************
288 * OLEPictureImpl_QueryInterface (IUnknown)
290 * See Windows documentation for more details on IUnknown methods.
292 static HRESULT WINAPI
OLEPictureImpl_QueryInterface(
297 ICOM_THIS(OLEPictureImpl
, iface
);
298 TRACE("(%p)->(%s, %p)\n", This
, debugstr_guid(riid
), ppvObject
);
301 * Perform a sanity check on the parameters.
303 if ( (This
==0) || (ppvObject
==0) )
307 * Initialize the return parameter.
312 * Compare the riid with the interface IDs implemented by this object.
314 if (memcmp(&IID_IUnknown
, riid
, sizeof(IID_IUnknown
)) == 0)
316 *ppvObject
= (IPicture
*)This
;
318 else if (memcmp(&IID_IPicture
, riid
, sizeof(IID_IPicture
)) == 0)
320 *ppvObject
= (IPicture
*)This
;
322 else if (memcmp(&IID_IDispatch
, riid
, sizeof(IID_IDispatch
)) == 0)
324 *ppvObject
= (IDispatch
*)&(This
->lpvtbl2
);
326 else if (memcmp(&IID_IPictureDisp
, riid
, sizeof(IID_IPictureDisp
)) == 0)
328 *ppvObject
= (IDispatch
*)&(This
->lpvtbl2
);
330 else if (memcmp(&IID_IPersistStream
, riid
, sizeof(IID_IPersistStream
)) == 0)
332 *ppvObject
= (IPersistStream
*)&(This
->lpvtbl3
);
334 else if (memcmp(&IID_IConnectionPointContainer
, riid
, sizeof(IID_IConnectionPointContainer
)) == 0)
336 *ppvObject
= (IConnectionPointContainer
*)&(This
->lpvtbl4
);
339 * Check that we obtained an interface.
343 FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid
));
344 return E_NOINTERFACE
;
348 * Query Interface always increases the reference count by one when it is
351 OLEPictureImpl_AddRef((IPicture
*)This
);
355 /***********************************************************************
356 * OLEPicture_SendNotify (internal)
358 * Sends notification messages of changed properties to any interested
361 static void OLEPicture_SendNotify(OLEPictureImpl
* this, DISPID dispID
)
363 IEnumConnections
*pEnum
;
366 if (IConnectionPoint_EnumConnections(this->pCP
, &pEnum
))
368 while(IEnumConnections_Next(pEnum
, 1, &CD
, NULL
) == S_OK
) {
369 IPropertyNotifySink
*sink
;
371 IUnknown_QueryInterface(CD
.pUnk
, &IID_IPropertyNotifySink
, (LPVOID
)&sink
);
372 IPropertyNotifySink_OnChanged(sink
, dispID
);
373 IPropertyNotifySink_Release(sink
);
374 IUnknown_Release(CD
.pUnk
);
376 IEnumConnections_Release(pEnum
);
380 /************************************************************************
381 * OLEPictureImpl_AddRef (IUnknown)
383 * See Windows documentation for more details on IUnknown methods.
385 static ULONG WINAPI
OLEPictureImpl_AddRef(
388 ICOM_THIS(OLEPictureImpl
, iface
);
389 TRACE("(%p)->(ref=%ld)\n", This
, This
->ref
);
395 /************************************************************************
396 * OLEPictureImpl_Release (IUnknown)
398 * See Windows documentation for more details on IUnknown methods.
400 static ULONG WINAPI
OLEPictureImpl_Release(
403 ICOM_THIS(OLEPictureImpl
, iface
);
404 TRACE("(%p)->(ref=%ld)\n", This
, This
->ref
);
407 * Decrease the reference count on this object.
412 * If the reference count goes down to 0, perform suicide.
416 OLEPictureImpl_Destroy(This
);
425 /************************************************************************
426 * OLEPictureImpl_get_Handle
428 static HRESULT WINAPI
OLEPictureImpl_get_Handle(IPicture
*iface
,
431 ICOM_THIS(OLEPictureImpl
, iface
);
432 TRACE("(%p)->(%p)\n", This
, phandle
);
433 switch(This
->desc
.picType
) {
435 *phandle
= (OLE_HANDLE
)This
->desc
.u
.bmp
.hbitmap
;
437 case PICTYPE_METAFILE
:
438 *phandle
= (OLE_HANDLE
)This
->desc
.u
.wmf
.hmeta
;
441 *phandle
= (OLE_HANDLE
)This
->desc
.u
.icon
.hicon
;
443 case PICTYPE_ENHMETAFILE
:
444 *phandle
= (OLE_HANDLE
)This
->desc
.u
.emf
.hemf
;
447 FIXME("Unimplemented type %d\n", This
->desc
.picType
);
450 TRACE("returning handle %08x\n", *phandle
);
454 /************************************************************************
455 * OLEPictureImpl_get_hPal
457 static HRESULT WINAPI
OLEPictureImpl_get_hPal(IPicture
*iface
,
460 ICOM_THIS(OLEPictureImpl
, iface
);
461 FIXME("(%p)->(%p): stub\n", This
, phandle
);
465 /************************************************************************
466 * OLEPictureImpl_get_Type
468 static HRESULT WINAPI
OLEPictureImpl_get_Type(IPicture
*iface
,
471 ICOM_THIS(OLEPictureImpl
, iface
);
472 TRACE("(%p)->(%p): type is %d\n", This
, ptype
, This
->desc
.picType
);
473 *ptype
= This
->desc
.picType
;
477 /************************************************************************
478 * OLEPictureImpl_get_Width
480 static HRESULT WINAPI
OLEPictureImpl_get_Width(IPicture
*iface
,
481 OLE_XSIZE_HIMETRIC
*pwidth
)
483 ICOM_THIS(OLEPictureImpl
, iface
);
484 TRACE("(%p)->(%p): width is %ld\n", This
, pwidth
, This
->himetricWidth
);
485 *pwidth
= This
->himetricWidth
;
489 /************************************************************************
490 * OLEPictureImpl_get_Height
492 static HRESULT WINAPI
OLEPictureImpl_get_Height(IPicture
*iface
,
493 OLE_YSIZE_HIMETRIC
*pheight
)
495 ICOM_THIS(OLEPictureImpl
, iface
);
496 TRACE("(%p)->(%p): height is %ld\n", This
, pheight
, This
->himetricHeight
);
497 *pheight
= This
->himetricHeight
;
501 /************************************************************************
502 * OLEPictureImpl_Render
504 static HRESULT WINAPI
OLEPictureImpl_Render(IPicture
*iface
, HDC hdc
,
505 long x
, long y
, long cx
, long cy
,
506 OLE_XPOS_HIMETRIC xSrc
,
507 OLE_YPOS_HIMETRIC ySrc
,
508 OLE_XSIZE_HIMETRIC cxSrc
,
509 OLE_YSIZE_HIMETRIC cySrc
,
512 ICOM_THIS(OLEPictureImpl
, iface
);
513 TRACE("(%p)->(%p, (%ld,%ld), (%ld,%ld) <- (%ld,%ld), (%ld,%ld), %p)\n",
514 This
, hdc
, x
, y
, cx
, cy
, xSrc
, ySrc
, cxSrc
, cySrc
, prcWBounds
);
516 TRACE("prcWBounds (%ld,%ld) - (%ld,%ld)\n", prcWBounds
->left
, prcWBounds
->top
,
517 prcWBounds
->right
, prcWBounds
->bottom
);
520 * While the documentation suggests this to be here (or after rendering?)
521 * it does cause an endless recursion in my sample app. -MM 20010804
522 OLEPicture_SendNotify(This,DISPID_PICT_RENDER);
525 switch(This
->desc
.picType
) {
531 /* Set a mapping mode that maps bitmap pixels into HIMETRIC units.
532 NB y-axis gets flipped */
534 hdcBmp
= CreateCompatibleDC(0);
535 SetMapMode(hdcBmp
, MM_ANISOTROPIC
);
536 SetWindowOrgEx(hdcBmp
, 0, 0, NULL
);
537 SetWindowExtEx(hdcBmp
, This
->himetricWidth
, This
->himetricHeight
, NULL
);
538 SetViewportOrgEx(hdcBmp
, 0, This
->origHeight
, NULL
);
539 SetViewportExtEx(hdcBmp
, This
->origWidth
, -This
->origHeight
, NULL
);
541 hbmpOld
= SelectObject(hdcBmp
, This
->desc
.u
.bmp
.hbitmap
);
543 StretchBlt(hdc
, x
, y
, cx
, cy
, hdcBmp
, xSrc
, ySrc
, cxSrc
, cySrc
, SRCCOPY
);
545 SelectObject(hdcBmp
, hbmpOld
);
550 FIXME("Not quite correct implementation of rendering icons...\n");
551 DrawIcon(hdc
,x
,y
,This
->desc
.u
.icon
.hicon
);
554 case PICTYPE_METAFILE
:
555 case PICTYPE_ENHMETAFILE
:
557 FIXME("type %d not implemented\n", This
->desc
.picType
);
563 /************************************************************************
564 * OLEPictureImpl_set_hPal
566 static HRESULT WINAPI
OLEPictureImpl_set_hPal(IPicture
*iface
,
569 ICOM_THIS(OLEPictureImpl
, iface
);
570 FIXME("(%p)->(%08x): stub\n", This
, hpal
);
571 OLEPicture_SendNotify(This
,DISPID_PICT_HPAL
);
575 /************************************************************************
576 * OLEPictureImpl_get_CurDC
578 static HRESULT WINAPI
OLEPictureImpl_get_CurDC(IPicture
*iface
,
581 ICOM_THIS(OLEPictureImpl
, iface
);
582 TRACE("(%p), returning %p\n", This
, This
->hDCCur
);
583 if (phdc
) *phdc
= This
->hDCCur
;
587 /************************************************************************
588 * OLEPictureImpl_SelectPicture
590 static HRESULT WINAPI
OLEPictureImpl_SelectPicture(IPicture
*iface
,
593 OLE_HANDLE
*phbmpOut
)
595 ICOM_THIS(OLEPictureImpl
, iface
);
596 TRACE("(%p)->(%p, %p, %p)\n", This
, hdcIn
, phdcOut
, phbmpOut
);
597 if (This
->desc
.picType
== PICTYPE_BITMAP
) {
598 SelectObject(hdcIn
,This
->desc
.u
.bmp
.hbitmap
);
601 *phdcOut
= This
->hDCCur
;
602 This
->hDCCur
= hdcIn
;
604 *phbmpOut
= (OLE_HANDLE
)This
->desc
.u
.bmp
.hbitmap
;
607 FIXME("Don't know how to select picture type %d\n",This
->desc
.picType
);
612 /************************************************************************
613 * OLEPictureImpl_get_KeepOriginalFormat
615 static HRESULT WINAPI
OLEPictureImpl_get_KeepOriginalFormat(IPicture
*iface
,
618 ICOM_THIS(OLEPictureImpl
, iface
);
619 TRACE("(%p)->(%p)\n", This
, pfKeep
);
622 *pfKeep
= This
->keepOrigFormat
;
626 /************************************************************************
627 * OLEPictureImpl_put_KeepOriginalFormat
629 static HRESULT WINAPI
OLEPictureImpl_put_KeepOriginalFormat(IPicture
*iface
,
632 ICOM_THIS(OLEPictureImpl
, iface
);
633 TRACE("(%p)->(%d)\n", This
, keep
);
634 This
->keepOrigFormat
= keep
;
635 /* FIXME: what DISPID notification here? */
639 /************************************************************************
640 * OLEPictureImpl_PictureChanged
642 static HRESULT WINAPI
OLEPictureImpl_PictureChanged(IPicture
*iface
)
644 ICOM_THIS(OLEPictureImpl
, iface
);
645 TRACE("(%p)->()\n", This
);
646 OLEPicture_SendNotify(This
,DISPID_PICT_HANDLE
);
650 /************************************************************************
651 * OLEPictureImpl_SaveAsFile
653 static HRESULT WINAPI
OLEPictureImpl_SaveAsFile(IPicture
*iface
,
658 ICOM_THIS(OLEPictureImpl
, iface
);
659 FIXME("(%p)->(%p, %d, %p), hacked stub.\n", This
, pstream
, SaveMemCopy
, pcbSize
);
660 return IStream_Write(pstream
,This
->data
,This
->datalen
,(ULONG
*)pcbSize
);
663 /************************************************************************
664 * OLEPictureImpl_get_Attributes
666 static HRESULT WINAPI
OLEPictureImpl_get_Attributes(IPicture
*iface
,
669 ICOM_THIS(OLEPictureImpl
, iface
);
670 TRACE("(%p)->(%p).\n", This
, pdwAttr
);
672 switch (This
->desc
.picType
) {
673 case PICTYPE_BITMAP
: break; /* not 'truely' scalable, see MSDN. */
674 case PICTYPE_ICON
: *pdwAttr
= PICTURE_TRANSPARENT
;break;
675 case PICTYPE_METAFILE
: *pdwAttr
= PICTURE_TRANSPARENT
|PICTURE_SCALABLE
;break;
676 default:FIXME("Unknown pictype %d\n",This
->desc
.picType
);break;
682 /************************************************************************
683 * IConnectionPointContainer
686 static HRESULT WINAPI
OLEPictureImpl_IConnectionPointContainer_QueryInterface(
687 IConnectionPointContainer
* iface
,
691 ICOM_THIS_From_IConnectionPointContainer(IPicture
,iface
);
693 return IPicture_QueryInterface(This
,riid
,ppvoid
);
696 static ULONG WINAPI
OLEPictureImpl_IConnectionPointContainer_AddRef(
697 IConnectionPointContainer
* iface
)
699 ICOM_THIS_From_IConnectionPointContainer(IPicture
, iface
);
701 return IPicture_AddRef(This
);
704 static ULONG WINAPI
OLEPictureImpl_IConnectionPointContainer_Release(
705 IConnectionPointContainer
* iface
)
707 ICOM_THIS_From_IConnectionPointContainer(IPicture
, iface
);
709 return IPicture_Release(This
);
712 static HRESULT WINAPI
OLEPictureImpl_EnumConnectionPoints(
713 IConnectionPointContainer
* iface
,
714 IEnumConnectionPoints
** ppEnum
716 ICOM_THIS_From_IConnectionPointContainer(IPicture
, iface
);
718 FIXME("(%p,%p), stub!\n",This
,ppEnum
);
722 static HRESULT WINAPI
OLEPictureImpl_FindConnectionPoint(
723 IConnectionPointContainer
* iface
,
725 IConnectionPoint
**ppCP
727 ICOM_THIS_From_IConnectionPointContainer(OLEPictureImpl
, iface
);
728 TRACE("(%p,%s,%p)\n",This
,debugstr_guid(riid
),ppCP
);
732 if (IsEqualGUID(riid
,&IID_IPropertyNotifySink
))
733 return IConnectionPoint_QueryInterface(This
->pCP
,&IID_IConnectionPoint
,(LPVOID
)ppCP
);
734 FIXME("tried to find connection point on %s?\n",debugstr_guid(riid
));
737 /************************************************************************
740 /************************************************************************
741 * OLEPictureImpl_IPersistStream_QueryInterface (IUnknown)
743 * See Windows documentation for more details on IUnknown methods.
745 static HRESULT WINAPI
OLEPictureImpl_IPersistStream_QueryInterface(
746 IPersistStream
* iface
,
750 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
752 return IPicture_QueryInterface(This
, riid
, ppvoid
);
755 /************************************************************************
756 * OLEPictureImpl_IPersistStream_AddRef (IUnknown)
758 * See Windows documentation for more details on IUnknown methods.
760 static ULONG WINAPI
OLEPictureImpl_IPersistStream_AddRef(
761 IPersistStream
* iface
)
763 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
765 return IPicture_AddRef(This
);
768 /************************************************************************
769 * OLEPictureImpl_IPersistStream_Release (IUnknown)
771 * See Windows documentation for more details on IUnknown methods.
773 static ULONG WINAPI
OLEPictureImpl_IPersistStream_Release(
774 IPersistStream
* iface
)
776 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
778 return IPicture_Release(This
);
781 /************************************************************************
782 * OLEPictureImpl_IPersistStream_GetClassID
784 static HRESULT WINAPI
OLEPictureImpl_GetClassID(
785 IPersistStream
* iface
,CLSID
* pClassID
)
787 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
788 FIXME("(%p),stub!\n",This
);
792 /************************************************************************
793 * OLEPictureImpl_IPersistStream_IsDirty
795 static HRESULT WINAPI
OLEPictureImpl_IsDirty(
796 IPersistStream
* iface
)
798 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
799 FIXME("(%p),stub!\n",This
);
804 /* for the jpeg decompressor source manager. */
805 static void _jpeg_init_source(j_decompress_ptr cinfo
) { }
807 static boolean
_jpeg_fill_input_buffer(j_decompress_ptr cinfo
) {
808 ERR("(), should not get here.\n");
812 static void _jpeg_skip_input_data(j_decompress_ptr cinfo
,long num_bytes
) {
813 ERR("(%ld), should not get here.\n",num_bytes
);
816 static boolean
_jpeg_resync_to_restart(j_decompress_ptr cinfo
, int desired
) {
817 ERR("(desired=%d), should not get here.\n",desired
);
820 static void _jpeg_term_source(j_decompress_ptr cinfo
) { }
821 #endif /* HAVE_LIBJPEG */
830 static int _gif_inputfunc(GifFileType
*gif
, GifByteType
*data
, int len
) {
831 struct gifdata
*gd
= (struct gifdata
*)gif
->UserData
;
833 if (len
+gd
->curoff
> gd
->len
) {
834 FIXME("Trying to read %d bytes, but only %d available.\n",len
, gd
->len
-gd
->curoff
);
835 len
= gd
->len
- gd
->curoff
;
837 memcpy(data
, gd
->data
+gd
->curoff
, len
);
843 /************************************************************************
844 * OLEPictureImpl_IPersistStream_Load (IUnknown)
846 * Loads the binary data from the IStream. Starts at current position.
847 * There appears to be an 2 DWORD header:
851 * Currently implemented: BITMAP, ICON, JPEG.
853 static HRESULT WINAPI
OLEPictureImpl_Load(IPersistStream
* iface
,IStream
*pStm
) {
860 ICOM_THIS_From_IPersistStream(OLEPictureImpl
, iface
);
862 TRACE("(%p,%p)\n",This
,pStm
);
864 /* Sometimes we have a header, sometimes we don't. Apply some guesses to find
867 hr
=IStream_Stat(pStm
,&statstg
,STATFLAG_NONAME
);
869 FIXME("Stat failed with hres %lx\n",hr
);
870 hr
=IStream_Read(pStm
,header
,8,&xread
);
871 if (hr
|| xread
!=8) {
872 FIXME("Failure while reading picture header (hr is %lx, nread is %ld).\n",hr
,xread
);
875 if (header
[1] > statstg
.cbSize
.QuadPart
) {/* Incorrect header, assume none. */
877 xbuf
= This
->data
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,statstg
.cbSize
.QuadPart
);
878 memcpy(xbuf
,&header
,8);
879 This
->datalen
= statstg
.cbSize
.QuadPart
;
880 while (xread
< This
->datalen
) {
882 hr
= IStream_Read(pStm
,xbuf
+xread
,This
->datalen
-xread
,&nread
);
887 if (xread
!= This
->datalen
)
888 FIXME("Could only read %ld of %d bytes in no-header case?\n",xread
,This
->datalen
);
891 xbuf
= This
->data
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,header
[1]);
892 This
->datalen
= header
[1];
893 while (xread
< header
[1]) {
895 hr
= IStream_Read(pStm
,xbuf
+xread
,header
[1]-xread
,&nread
);
900 if (xread
!= header
[1])
901 FIXME("Could only read %ld of %ld bytes?\n",xread
,header
[1]);
903 magic
= xbuf
[0] + (xbuf
[1]<<8);
905 case 0x4947: { /* GIF */
920 gif
= DGifOpen((void*)&gd
, _gif_inputfunc
);
921 ret
= DGifSlurp(gif
);
922 if (ret
== GIF_ERROR
) {
923 FIXME("Failed reading GIF using libgif.\n");
926 TRACE("screen height %d, width %d\n", gif
->SWidth
, gif
->SHeight
);
927 TRACE("color res %d, backgcolor %d\n", gif
->SColorResolution
, gif
->SBackGroundColor
);
928 TRACE("imgcnt %d\n", gif
->ImageCount
);
929 if (gif
->ImageCount
<1) {
930 FIXME("GIF stream does not have images inside?\n");
933 TRACE("curimage: %d x %d, on %dx%d, interlace %d\n",
934 gif
->Image
.Width
, gif
->Image
.Height
,
935 gif
->Image
.Left
, gif
->Image
.Top
,
939 bmi
= HeapAlloc(GetProcessHeap(),0,sizeof(BITMAPINFOHEADER
)+(1<<gif
->SColorResolution
)*sizeof(RGBQUAD
));
940 bytes
= HeapAlloc(GetProcessHeap(),0,gif
->SWidth
*gif
->SHeight
);
941 si
= gif
->SavedImages
+0;
942 gid
= &(si
->ImageDesc
);
944 if (!cm
) cm
= gif
->SColorMap
;
945 for (i
=0;i
<(1<<gif
->SColorResolution
);i
++) {
946 bmi
->bmiColors
[i
].rgbRed
= cm
->Colors
[i
].Red
;
947 bmi
->bmiColors
[i
].rgbGreen
= cm
->Colors
[i
].Green
;
948 bmi
->bmiColors
[i
].rgbBlue
= cm
->Colors
[i
].Blue
;
950 /* Map to in picture coordinates */
951 for (i
=0;i
<gid
->Height
;i
++)
952 for (j
=0;j
<gid
->Width
;j
++)
953 bytes
[(gid
->Top
+i
)*gif
->SWidth
+gid
->Left
+j
]=si
->RasterBits
[i
*gid
->Width
+j
];
954 bmi
->bmiHeader
.biSize
= sizeof(BITMAPINFOHEADER
);
955 bmi
->bmiHeader
.biWidth
= gif
->SWidth
;
956 bmi
->bmiHeader
.biHeight
= gif
->SHeight
;
957 bmi
->bmiHeader
.biPlanes
= 1;
958 bmi
->bmiHeader
.biBitCount
= 8;
959 bmi
->bmiHeader
.biCompression
= BI_RGB
;
960 bmi
->bmiHeader
.biSizeImage
= gif
->SWidth
*gif
->SHeight
;
961 bmi
->bmiHeader
.biXPelsPerMeter
= 0;
962 bmi
->bmiHeader
.biYPelsPerMeter
= 0;
963 bmi
->bmiHeader
.biClrUsed
= 1 << gif
->SColorResolution
;
964 bmi
->bmiHeader
.biClrImportant
= 0;
967 This
->desc
.u
.bmp
.hbitmap
=CreateDIBitmap(
976 This
->desc
.picType
= PICTYPE_BITMAP
;
977 OLEPictureImpl_SetBitmap(This
);
979 HeapFree(GetProcessHeap(),0,bytes
);
982 FIXME("Trying to load GIF, but no support for libgif/libungif compiled in.\n");
987 case 0xd8ff: { /* JPEG */
989 struct jpeg_decompress_struct jd
;
990 struct jpeg_error_mgr jerr
;
994 BITMAPINFOHEADER bmi
;
997 struct jpeg_source_mgr xjsm
;
999 /* This is basically so we can use in-memory data for jpeg decompression.
1000 * We need to have all the functions.
1002 xjsm
.next_input_byte
= xbuf
;
1003 xjsm
.bytes_in_buffer
= xread
;
1004 xjsm
.init_source
= _jpeg_init_source
;
1005 xjsm
.fill_input_buffer
= _jpeg_fill_input_buffer
;
1006 xjsm
.skip_input_data
= _jpeg_skip_input_data
;
1007 xjsm
.resync_to_restart
= _jpeg_resync_to_restart
;
1008 xjsm
.term_source
= _jpeg_term_source
;
1010 jd
.err
= jpeg_std_error(&jerr
);
1011 jpeg_create_decompress(&jd
);
1013 ret
=jpeg_read_header(&jd
,TRUE
);
1014 jpeg_start_decompress(&jd
);
1015 if (ret
!= JPEG_HEADER_OK
) {
1016 ERR("Jpeg image in stream has bad format, read header returned %d.\n",ret
);
1017 HeapFree(GetProcessHeap(),0,xbuf
);
1020 bits
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,(jd
.output_height
+1)*jd
.output_width
*jd
.output_components
);
1021 samprow
=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,jd
.output_width
*jd
.output_components
);
1022 while ( jd
.output_scanline
<jd
.output_height
) {
1023 x
= jpeg_read_scanlines(&jd
,&samprow
,1);
1025 FIXME("failed to read current scanline?\n");
1028 memcpy( bits
+jd
.output_scanline
*jd
.output_width
*jd
.output_components
,
1030 jd
.output_width
*jd
.output_components
1033 bmi
.biSize
= sizeof(bmi
);
1034 bmi
.biWidth
= jd
.output_width
;
1035 bmi
.biHeight
= -jd
.output_height
;
1037 bmi
.biBitCount
= jd
.output_components
<<3;
1038 bmi
.biCompression
= BI_RGB
;
1039 bmi
.biSizeImage
= jd
.output_height
*jd
.output_width
*jd
.output_components
;
1040 bmi
.biXPelsPerMeter
= 0;
1041 bmi
.biYPelsPerMeter
= 0;
1043 bmi
.biClrImportant
= 0;
1045 HeapFree(GetProcessHeap(),0,samprow
);
1046 jpeg_finish_decompress(&jd
);
1047 jpeg_destroy_decompress(&jd
);
1049 This
->desc
.u
.bmp
.hbitmap
=CreateDIBitmap(
1058 This
->desc
.picType
= PICTYPE_BITMAP
;
1059 OLEPictureImpl_SetBitmap(This
);
1061 HeapFree(GetProcessHeap(),0,bits
);
1063 ERR("Trying to load JPEG picture, but JPEG supported not compiled in.\n");
1068 case 0x4d42: { /* Bitmap */
1069 BITMAPFILEHEADER
*bfh
= (BITMAPFILEHEADER
*)xbuf
;
1070 BITMAPINFO
*bi
= (BITMAPINFO
*)(bfh
+1);
1073 /* Does not matter whether this is a coreheader or not, we only use
1074 * components which are in both
1077 This
->desc
.u
.bmp
.hbitmap
= CreateDIBitmap(
1081 xbuf
+bfh
->bfOffBits
,
1083 (bi
->bmiHeader
.biBitCount
<=8)?DIB_PAL_COLORS
:DIB_RGB_COLORS
1086 This
->desc
.picType
= PICTYPE_BITMAP
;
1087 OLEPictureImpl_SetBitmap(This
);
1091 case 0x0000: { /* ICON , first word is dwReserved */
1093 CURSORICONFILEDIR
*cifd
= (CURSORICONFILEDIR
*)xbuf
;
1097 FIXME("icon.idReserved=%d\n",cifd->idReserved);
1098 FIXME("icon.idType=%d\n",cifd->idType);
1099 FIXME("icon.idCount=%d\n",cifd->idCount);
1101 for (i=0;i<cifd->idCount;i++) {
1102 FIXME("[%d] width %d\n",i,cifd->idEntries[i].bWidth);
1103 FIXME("[%d] height %d\n",i,cifd->idEntries[i].bHeight);
1104 FIXME("[%d] bColorCount %d\n",i,cifd->idEntries[i].bColorCount);
1105 FIXME("[%d] bReserved %d\n",i,cifd->idEntries[i].bReserved);
1106 FIXME("[%d] xHotspot %d\n",i,cifd->idEntries[i].xHotspot);
1107 FIXME("[%d] yHotspot %d\n",i,cifd->idEntries[i].yHotspot);
1108 FIXME("[%d] dwDIBSize %d\n",i,cifd->idEntries[i].dwDIBSize);
1109 FIXME("[%d] dwDIBOffset %d\n",i,cifd->idEntries[i].dwDIBOffset);
1113 /* If we have more than one icon, try to find the best.
1114 * this currently means '32 pixel wide'.
1116 if (cifd
->idCount
!=1) {
1117 for (i
=0;i
<cifd
->idCount
;i
++) {
1118 if (cifd
->idEntries
[i
].bWidth
== 32)
1121 if (i
==cifd
->idCount
) i
=0;
1124 hicon
= CreateIconFromResourceEx(
1125 xbuf
+cifd
->idEntries
[i
].dwDIBOffset
,
1126 cifd
->idEntries
[i
].dwDIBSize
,
1129 cifd
->idEntries
[i
].bWidth
,
1130 cifd
->idEntries
[i
].bHeight
,
1134 FIXME("CreateIcon failed.\n");
1137 This
->desc
.picType
= PICTYPE_ICON
;
1138 This
->desc
.u
.icon
.hicon
= hicon
;
1139 This
->himetricWidth
= cifd
->idEntries
[i
].bWidth
;
1140 This
->himetricHeight
= cifd
->idEntries
[i
].bHeight
;
1148 FIXME("Unknown magic %04x, %ld read bytes:\n",magic
,xread
);
1150 for (i
=0;i
<xread
+8;i
++) {
1151 if (i
<8) MESSAGE("%02x ",((unsigned char*)&header
)[i
]);
1152 else MESSAGE("%02x ",xbuf
[i
-8]);
1153 if (i
% 10 == 9) MESSAGE("\n");
1160 /* FIXME: this notify is not really documented */
1162 OLEPicture_SendNotify(This
,DISPID_PICT_TYPE
);
1166 static HRESULT WINAPI
OLEPictureImpl_Save(
1167 IPersistStream
* iface
,IStream
*pStm
,BOOL fClearDirty
)
1169 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
1170 FIXME("(%p,%p,%d),stub!\n",This
,pStm
,fClearDirty
);
1174 static HRESULT WINAPI
OLEPictureImpl_GetSizeMax(
1175 IPersistStream
* iface
,ULARGE_INTEGER
*pcbSize
)
1177 ICOM_THIS_From_IPersistStream(IPicture
, iface
);
1178 FIXME("(%p,%p),stub!\n",This
,pcbSize
);
1182 /************************************************************************
1185 /************************************************************************
1186 * OLEPictureImpl_IDispatch_QueryInterface (IUnknown)
1188 * See Windows documentation for more details on IUnknown methods.
1190 static HRESULT WINAPI
OLEPictureImpl_IDispatch_QueryInterface(
1195 ICOM_THIS_From_IDispatch(IPicture
, iface
);
1197 return IPicture_QueryInterface(This
, riid
, ppvoid
);
1200 /************************************************************************
1201 * OLEPictureImpl_IDispatch_AddRef (IUnknown)
1203 * See Windows documentation for more details on IUnknown methods.
1205 static ULONG WINAPI
OLEPictureImpl_IDispatch_AddRef(
1208 ICOM_THIS_From_IDispatch(IPicture
, iface
);
1210 return IPicture_AddRef(This
);
1213 /************************************************************************
1214 * OLEPictureImpl_IDispatch_Release (IUnknown)
1216 * See Windows documentation for more details on IUnknown methods.
1218 static ULONG WINAPI
OLEPictureImpl_IDispatch_Release(
1221 ICOM_THIS_From_IDispatch(IPicture
, iface
);
1223 return IPicture_Release(This
);
1226 /************************************************************************
1227 * OLEPictureImpl_GetTypeInfoCount (IDispatch)
1229 * See Windows documentation for more details on IDispatch methods.
1231 static HRESULT WINAPI
OLEPictureImpl_GetTypeInfoCount(
1233 unsigned int* pctinfo
)
1240 /************************************************************************
1241 * OLEPictureImpl_GetTypeInfo (IDispatch)
1243 * See Windows documentation for more details on IDispatch methods.
1245 static HRESULT WINAPI
OLEPictureImpl_GetTypeInfo(
1249 ITypeInfo
** ppTInfo
)
1256 /************************************************************************
1257 * OLEPictureImpl_GetIDsOfNames (IDispatch)
1259 * See Windows documentation for more details on IDispatch methods.
1261 static HRESULT WINAPI
OLEPictureImpl_GetIDsOfNames(
1264 LPOLESTR
* rgszNames
,
1274 /************************************************************************
1275 * OLEPictureImpl_Invoke (IDispatch)
1277 * See Windows documentation for more details on IDispatch methods.
1279 static HRESULT WINAPI
OLEPictureImpl_Invoke(
1281 DISPID dispIdMember
,
1285 DISPPARAMS
* pDispParams
,
1286 VARIANT
* pVarResult
,
1287 EXCEPINFO
* pExepInfo
,
1290 FIXME("(dispid: %ld):Stub\n",dispIdMember
);
1292 VariantInit(pVarResult
);
1293 V_VT(pVarResult
) = VT_BOOL
;
1294 V_UNION(pVarResult
,boolVal
) = FALSE
;
1299 static ICOM_VTABLE(IPicture
) OLEPictureImpl_VTable
=
1301 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1302 OLEPictureImpl_QueryInterface
,
1303 OLEPictureImpl_AddRef
,
1304 OLEPictureImpl_Release
,
1305 OLEPictureImpl_get_Handle
,
1306 OLEPictureImpl_get_hPal
,
1307 OLEPictureImpl_get_Type
,
1308 OLEPictureImpl_get_Width
,
1309 OLEPictureImpl_get_Height
,
1310 OLEPictureImpl_Render
,
1311 OLEPictureImpl_set_hPal
,
1312 OLEPictureImpl_get_CurDC
,
1313 OLEPictureImpl_SelectPicture
,
1314 OLEPictureImpl_get_KeepOriginalFormat
,
1315 OLEPictureImpl_put_KeepOriginalFormat
,
1316 OLEPictureImpl_PictureChanged
,
1317 OLEPictureImpl_SaveAsFile
,
1318 OLEPictureImpl_get_Attributes
1321 static ICOM_VTABLE(IDispatch
) OLEPictureImpl_IDispatch_VTable
=
1323 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1324 OLEPictureImpl_IDispatch_QueryInterface
,
1325 OLEPictureImpl_IDispatch_AddRef
,
1326 OLEPictureImpl_IDispatch_Release
,
1327 OLEPictureImpl_GetTypeInfoCount
,
1328 OLEPictureImpl_GetTypeInfo
,
1329 OLEPictureImpl_GetIDsOfNames
,
1330 OLEPictureImpl_Invoke
1333 static ICOM_VTABLE(IPersistStream
) OLEPictureImpl_IPersistStream_VTable
=
1335 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1336 OLEPictureImpl_IPersistStream_QueryInterface
,
1337 OLEPictureImpl_IPersistStream_AddRef
,
1338 OLEPictureImpl_IPersistStream_Release
,
1339 OLEPictureImpl_GetClassID
,
1340 OLEPictureImpl_IsDirty
,
1341 OLEPictureImpl_Load
,
1342 OLEPictureImpl_Save
,
1343 OLEPictureImpl_GetSizeMax
1346 static ICOM_VTABLE(IConnectionPointContainer
) OLEPictureImpl_IConnectionPointContainer_VTable
=
1348 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1349 OLEPictureImpl_IConnectionPointContainer_QueryInterface
,
1350 OLEPictureImpl_IConnectionPointContainer_AddRef
,
1351 OLEPictureImpl_IConnectionPointContainer_Release
,
1352 OLEPictureImpl_EnumConnectionPoints
,
1353 OLEPictureImpl_FindConnectionPoint
1356 /***********************************************************************
1357 * OleCreatePictureIndirect (OLEAUT32.419)
1359 HRESULT WINAPI
OleCreatePictureIndirect(LPPICTDESC lpPictDesc
, REFIID riid
,
1360 BOOL fOwn
, LPVOID
*ppvObj
)
1362 OLEPictureImpl
* newPict
= NULL
;
1365 TRACE("(%p,%p,%d,%p)\n", lpPictDesc
, riid
, fOwn
, ppvObj
);
1376 * Try to construct a new instance of the class.
1378 newPict
= OLEPictureImpl_Construct(lpPictDesc
, fOwn
);
1380 if (newPict
== NULL
)
1381 return E_OUTOFMEMORY
;
1384 * Make sure it supports the interface required by the caller.
1386 hr
= IPicture_QueryInterface((IPicture
*)newPict
, riid
, ppvObj
);
1389 * Release the reference obtained in the constructor. If
1390 * the QueryInterface was unsuccessful, it will free the class.
1392 IPicture_Release((IPicture
*)newPict
);
1398 /***********************************************************************
1399 * OleLoadPicture (OLEAUT32.418)
1401 HRESULT WINAPI
OleLoadPicture( LPSTREAM lpstream
, LONG lSize
, BOOL fRunmode
,
1402 REFIID riid
, LPVOID
*ppvObj
)
1408 TRACE("(%p,%ld,%d,%s,%p), partially implemented.\n",
1409 lpstream
, lSize
, fRunmode
, debugstr_guid(riid
), ppvObj
);
1411 hr
= OleCreatePictureIndirect(NULL
,riid
,!fRunmode
,(LPVOID
*)&newpic
);
1414 hr
= IPicture_QueryInterface(newpic
,&IID_IPersistStream
, (LPVOID
*)&ps
);
1416 FIXME("Could not get IPersistStream iface from Ole Picture?\n");
1417 IPicture_Release(newpic
);
1421 IPersistStream_Load(ps
,lpstream
);
1422 IPersistStream_Release(ps
);
1423 hr
= IPicture_QueryInterface(newpic
,riid
,ppvObj
);
1425 FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid
));
1426 IPicture_Release(newpic
);
1430 /***********************************************************************
1431 * OleLoadPictureEx (OLEAUT32.401)
1433 HRESULT WINAPI
OleLoadPictureEx( LPSTREAM lpstream
, LONG lSize
, BOOL fRunmode
,
1434 REFIID riid
, DWORD xsiz
, DWORD ysiz
, DWORD flags
, LPVOID
*ppvObj
)
1440 FIXME("(%p,%ld,%d,%s,x=%ld,y=%ld,f=%lx,%p), partially implemented.\n",
1441 lpstream
, lSize
, fRunmode
, debugstr_guid(riid
), xsiz
, ysiz
, flags
, ppvObj
);
1443 hr
= OleCreatePictureIndirect(NULL
,riid
,!fRunmode
,(LPVOID
*)&newpic
);
1446 hr
= IPicture_QueryInterface(newpic
,&IID_IPersistStream
, (LPVOID
*)&ps
);
1448 FIXME("Could not get IPersistStream iface from Ole Picture?\n");
1449 IPicture_Release(newpic
);
1453 IPersistStream_Load(ps
,lpstream
);
1454 IPersistStream_Release(ps
);
1455 hr
= IPicture_QueryInterface(newpic
,riid
,ppvObj
);
1457 FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid
));
1458 IPicture_Release(newpic
);
1462 /*******************************************************************************
1463 * StdPic ClassFactory
1467 /* IUnknown fields */
1468 ICOM_VFIELD(IClassFactory
);
1470 } IClassFactoryImpl
;
1472 static HRESULT WINAPI
1473 SPCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
1474 ICOM_THIS(IClassFactoryImpl
,iface
);
1476 FIXME("(%p)->(%s,%p),stub!\n",This
,debugstr_guid(riid
),ppobj
);
1477 return E_NOINTERFACE
;
1481 SPCF_AddRef(LPCLASSFACTORY iface
) {
1482 ICOM_THIS(IClassFactoryImpl
,iface
);
1483 return ++(This
->ref
);
1486 static ULONG WINAPI
SPCF_Release(LPCLASSFACTORY iface
) {
1487 ICOM_THIS(IClassFactoryImpl
,iface
);
1488 /* static class, won't be freed */
1489 return --(This
->ref
);
1492 static HRESULT WINAPI
SPCF_CreateInstance(
1493 LPCLASSFACTORY iface
,LPUNKNOWN pOuter
,REFIID riid
,LPVOID
*ppobj
1497 FIXME("(%p,%p,%s,%p), creating stdpic with PICTYPE_NONE.\n",iface
,pOuter
,debugstr_guid(riid
),ppobj
);
1498 pd
.cbSizeofstruct
= sizeof(pd
);
1499 pd
.picType
= PICTYPE_NONE
;
1500 return OleCreatePictureIndirect(&pd
,riid
,TRUE
,ppobj
);
1504 static HRESULT WINAPI
SPCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
1505 ICOM_THIS(IClassFactoryImpl
,iface
);
1506 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
1510 static ICOM_VTABLE(IClassFactory
) SPCF_Vtbl
= {
1511 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1512 SPCF_QueryInterface
,
1515 SPCF_CreateInstance
,
1518 static IClassFactoryImpl STDPIC_CF
= {&SPCF_Vtbl
, 1 };
1520 void _get_STDPIC_CF(LPVOID
*ppv
) { *ppv
= (LPVOID
)&STDPIC_CF
; }