static HRESULT WINAPI ComponentFactory_CreateDecoder(IWICComponentFactory *iface, REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapDecoder **ppIDecoder) { IEnumUnknown *enumdecoders; IUnknown *unkdecoderinfo; IWICBitmapDecoderInfo *decoderinfo; IWICBitmapDecoder *decoder = NULL, *preferred_decoder = NULL; GUID vendor; HRESULT res; ULONG num_fetched; TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat), debugstr_guid(pguidVendor), ppIDecoder); if (!guidContainerFormat || !ppIDecoder) return E_INVALIDARG; res = CreateComponentEnumerator(WICDecoder, WICComponentEnumerateDefault, &enumdecoders); if (FAILED(res)) return res; while (!preferred_decoder) { res = IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched); if (res != S_OK) break; res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo, (void **)&decoderinfo); if (SUCCEEDED(res)) { GUID container_guid; res = IWICBitmapDecoderInfo_GetContainerFormat(decoderinfo, &container_guid); if (SUCCEEDED(res) && IsEqualIID(&container_guid, guidContainerFormat)) { IWICBitmapDecoder *new_decoder; res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &new_decoder); if (SUCCEEDED(res)) { if (pguidVendor) { res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor); if (SUCCEEDED(res) && IsEqualIID(&vendor, pguidVendor)) { preferred_decoder = new_decoder; new_decoder = NULL; } } if (new_decoder && !decoder) { decoder = new_decoder; new_decoder = NULL; } if (new_decoder) IWICBitmapDecoder_Release(new_decoder); } } IWICBitmapDecoderInfo_Release(decoderinfo); } IUnknown_Release(unkdecoderinfo); } IEnumUnknown_Release(enumdecoders); if (preferred_decoder) { *ppIDecoder = preferred_decoder; if (decoder) IWICBitmapDecoder_Release(decoder); return S_OK; } if (decoder) { *ppIDecoder = decoder; return S_OK; } *ppIDecoder = NULL; return WINCODEC_ERR_COMPONENTNOTFOUND; }
static HRESULT WINAPI BindProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv) { BindProtocol *This = impl_from_IInternetProtocolEx(iface); *ppv = NULL; if(IsEqualGUID(&IID_IUnknown, riid)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); *ppv = &This->IInternetProtocolEx_iface; }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); *ppv = &This->IInternetProtocolEx_iface; }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); *ppv = &This->IInternetProtocolEx_iface; }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) { TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv); *ppv = &This->IInternetProtocolEx_iface; }else if(IsEqualGUID(&IID_IInternetBindInfo, riid)) { TRACE("(%p)->(IID_IInternetBindInfo %p)\n", This, ppv); *ppv = &This->IInternetBindInfo_iface; }else if(IsEqualGUID(&IID_IInternetPriority, riid)) { TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv); *ppv = &This->IInternetPriority_iface; }else if(IsEqualGUID(&IID_IAuthenticate, riid)) { FIXME("(%p)->(IID_IAuthenticate %p)\n", This, ppv); }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv); *ppv = &This->IServiceProvider_iface; }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) { TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv); *ppv = &This->IInternetProtocolSink_iface; }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) { TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv); if(This->protocol) { IWinInetInfo *inet_info; HRESULT hres; hres = IInternetProtocol_QueryInterface(This->protocol, &IID_IWinInetInfo, (void**)&inet_info); if(SUCCEEDED(hres)) { *ppv = &This->IWinInetHttpInfo_iface; IWinInetInfo_Release(inet_info); } } }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) { TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv); if(This->protocol) { IWinInetHttpInfo *http_info; HRESULT hres; hres = IInternetProtocol_QueryInterface(This->protocol, &IID_IWinInetHttpInfo, (void**)&http_info); if(SUCCEEDED(hres)) { *ppv = &This->IWinInetHttpInfo_iface; IWinInetHttpInfo_Release(http_info); } } }else { WARN("not supported interface %s\n", debugstr_guid(riid)); } if(!*ppv) return E_NOINTERFACE; IUnknown_AddRef((IUnknown*)*ppv); return S_OK; }
static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize(IDirectSoundFullDuplex *iface, const GUID *capture_dev, const GUID *render_dev, const DSCBUFFERDESC *cbufdesc, const DSBUFFERDESC *bufdesc, HWND hwnd, DWORD level, IDirectSoundCaptureBuffer8 **dscb8, IDirectSoundBuffer8 **dsb8) { IDirectSoundFullDuplexImpl *This = impl_from_IDirectSoundFullDuplex(iface); IDirectSound8 *ds8 = NULL; IDirectSoundCapture8 *dsc8 = NULL; HRESULT hr; TRACE("(%p,%s,%s,%p,%p,%p,%x,%p,%p)\n", This, debugstr_guid(capture_dev), debugstr_guid(render_dev), cbufdesc, bufdesc, hwnd, level, dscb8, dsb8); if (!dscb8 || !dsb8) return E_INVALIDARG; *dscb8 = NULL; *dsb8 = NULL; if (This->ds8_unk || This->dsc8_unk) { WARN("already initialized\n"); return DSERR_ALREADYINITIALIZED; } hr = IDirectSoundImpl_Create(&This->IUnknown_iface, &IID_IUnknown, (void**)&This->ds8_unk, TRUE); if (SUCCEEDED(hr)) { IUnknown_QueryInterface(This->ds8_unk, &IID_IDirectSound8, (void**)&ds8); hr = IDirectSound8_Initialize(ds8, render_dev); } if (hr != DS_OK) { WARN("Creating/initializing IDirectSound8 failed\n"); goto error; } IDirectSound8_SetCooperativeLevel(ds8, hwnd, level); hr = IDirectSound8_CreateSoundBuffer(ds8, bufdesc, (IDirectSoundBuffer**)dsb8, NULL); if (hr != DS_OK) { WARN("IDirectSoundBuffer_Create() failed\n"); goto error; } hr = IDirectSoundCaptureImpl_Create(&This->IUnknown_iface, &IID_IUnknown, (void**)&This->dsc8_unk, TRUE); if (SUCCEEDED(hr)) { IUnknown_QueryInterface(This->dsc8_unk, &IID_IDirectSoundCapture8, (void**)&dsc8); hr = IDirectSoundCapture_Initialize(dsc8, capture_dev); } if (hr != DS_OK) { WARN("Creating/initializing IDirectSoundCapture8 failed\n"); goto error; } hr = IDirectSoundCapture_CreateCaptureBuffer(dsc8, cbufdesc, (IDirectSoundCaptureBuffer**)dscb8, NULL); if (hr != DS_OK) { WARN("IDirectSoundCapture_CreateCaptureBuffer() failed\n"); goto error; } IDirectSound8_Release(ds8); IDirectSoundCapture_Release(dsc8); return DS_OK; error: if (*dsb8) { IDirectSoundBuffer8_Release(*dsb8); *dsb8 = NULL; } if (ds8) IDirectSound8_Release(ds8); if (This->ds8_unk) { IUnknown_Release(This->ds8_unk); This->ds8_unk = NULL; } if (*dscb8) { IDirectSoundCaptureBuffer8_Release(*dscb8); *dscb8 = NULL; } if (dsc8) IDirectSoundCapture_Release(dsc8); if (This->dsc8_unk) { IUnknown_Release(This->dsc8_unk); This->dsc8_unk = NULL; } return hr; }
static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* stream_object, const MSPID* PurposeId, DWORD dwFlags, IMediaStream** ppNewStream) { IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface); HRESULT hr; IAMMediaStream* pStream; IAMMediaStream** pNewStreams; TRACE("(%p/%p)->(%p,%s,%x,%p)\n", This, iface, stream_object, debugstr_guid(PurposeId), dwFlags, ppNewStream); if (!IsEqualGUID(PurposeId, &MSPID_PrimaryVideo) && !IsEqualGUID(PurposeId, &MSPID_PrimaryAudio)) return MS_E_PURPOSEID; if (stream_object) FIXME("Specifying a stream object in params is not yet supported\n"); if (dwFlags & AMMSF_ADDDEFAULTRENDERER) { if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) { /* Default renderer not supported by video stream */ return MS_E_PURPOSEID; } else { IBaseFilter* dsoundrender_filter; /* Create the default renderer for audio */ hr = CoCreateInstance(&CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&dsoundrender_filter); if (SUCCEEDED(hr)) { hr = IGraphBuilder_AddFilter(This->pFilterGraph, dsoundrender_filter, NULL); IBaseFilter_Release(dsoundrender_filter); } /* No media stream created when the default renderer is used */ return hr; } } if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) hr = ddrawmediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); else hr = audiomediastream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); if (SUCCEEDED(hr)) { pNewStreams = CoTaskMemRealloc(This->pStreams, (This->nbStreams+1) * sizeof(IAMMediaStream*)); if (!pNewStreams) { IAMMediaStream_Release(pStream); return E_OUTOFMEMORY; } This->pStreams = pNewStreams; This->pStreams[This->nbStreams] = pStream; This->nbStreams++; if (ppNewStream) *ppNewStream = (IMediaStream*)pStream; } if (SUCCEEDED(hr)) { /* Add stream to the media stream filter */ IMediaStreamFilter_AddMediaStream(This->media_stream_filter, pStream); } return hr; }
static void test_AviMux(void) { test_filter source_filter, sink_filter; VIDEOINFOHEADER videoinfoheader; IPin *avimux_in, *avimux_out, *pin; AM_MEDIA_TYPE source_media_type; AM_MEDIA_TYPE *media_type; PIN_DIRECTION dir; IBaseFilter *avimux; IEnumPins *ep; IEnumMediaTypes *emt; HRESULT hr; init_test_filter(&source_filter, PINDIR_OUTPUT, SOURCE_FILTER); init_test_filter(&sink_filter, PINDIR_INPUT, SINK_FILTER); hr = CoCreateInstance(&CLSID_AviDest, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void**)&avimux); ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "couldn't create AVI Mux filter, hr = %08x\n", hr); if(hr != S_OK) { win_skip("AVI Mux filter is not registered\n"); return; } hr = IBaseFilter_EnumPins(avimux, &ep); ok(hr == S_OK, "EnumPins returned %x\n", hr); hr = IEnumPins_Next(ep, 1, &avimux_out, NULL); ok(hr == S_OK, "Next returned %x\n", hr); hr = IPin_QueryDirection(avimux_out, &dir); ok(hr == S_OK, "QueryDirection returned %x\n", hr); ok(dir == PINDIR_OUTPUT, "dir = %d\n", dir); hr = IEnumPins_Next(ep, 1, &avimux_in, NULL); ok(hr == S_OK, "Next returned %x\n", hr); hr = IPin_QueryDirection(avimux_in, &dir); ok(hr == S_OK, "QueryDirection returned %x\n", hr); ok(dir == PINDIR_INPUT, "dir = %d\n", dir); IEnumPins_Release(ep); hr = IPin_EnumMediaTypes(avimux_out, &emt); ok(hr == S_OK, "EnumMediaTypes returned %x\n", hr); hr = IEnumMediaTypes_Next(emt, 1, &media_type, NULL); ok(hr == S_OK, "Next returned %x\n", hr); ok(IsEqualIID(&media_type->majortype, &MEDIATYPE_Stream), "majortype = %s\n", debugstr_guid(&media_type->majortype)); ok(IsEqualIID(&media_type->subtype, &MEDIASUBTYPE_Avi), "subtype = %s\n", debugstr_guid(&media_type->subtype)); ok(media_type->bFixedSizeSamples, "bFixedSizeSamples = %x\n", media_type->bFixedSizeSamples); ok(!media_type->bTemporalCompression, "bTemporalCompression = %x\n", media_type->bTemporalCompression); ok(media_type->lSampleSize == 1, "lSampleSize = %d\n", media_type->lSampleSize); ok(IsEqualIID(&media_type->formattype, &GUID_NULL), "formattype = %s\n", debugstr_guid(&media_type->formattype)); ok(!media_type->pUnk, "pUnk = %p\n", media_type->pUnk); ok(!media_type->cbFormat, "cbFormat = %d\n", media_type->cbFormat); ok(!media_type->pbFormat, "pbFormat = %p\n", media_type->pbFormat); CoTaskMemFree(media_type); hr = IEnumMediaTypes_Next(emt, 1, &media_type, NULL); ok(hr == S_FALSE, "Next returned %x\n", hr); IEnumMediaTypes_Release(emt); hr = IPin_EnumMediaTypes(avimux_in, &emt); ok(hr == S_OK, "EnumMediaTypes returned %x\n", hr); hr = IEnumMediaTypes_Reset(emt); ok(hr == S_OK, "Reset returned %x\n", hr); hr = IEnumMediaTypes_Next(emt, 1, &media_type, NULL); ok(hr == S_FALSE, "Next returned %x\n", hr); IEnumMediaTypes_Release(emt); hr = IPin_ReceiveConnection(avimux_in, &source_filter.IPin_iface, NULL); ok(hr == E_POINTER, "ReceiveConnection returned %x\n", hr); current_calls_list = NULL; memset(&source_media_type, 0, sizeof(AM_MEDIA_TYPE)); memset(&videoinfoheader, 0, sizeof(VIDEOINFOHEADER)); source_media_type.majortype = MEDIATYPE_Video; source_media_type.subtype = MEDIASUBTYPE_RGB32; source_media_type.formattype = FORMAT_VideoInfo; source_media_type.bFixedSizeSamples = TRUE; source_media_type.lSampleSize = 40000; source_media_type.cbFormat = sizeof(VIDEOINFOHEADER); source_media_type.pbFormat = (BYTE*)&videoinfoheader; videoinfoheader.AvgTimePerFrame = 333333; videoinfoheader.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); videoinfoheader.bmiHeader.biWidth = 100; videoinfoheader.bmiHeader.biHeight = 100; videoinfoheader.bmiHeader.biPlanes = 1; videoinfoheader.bmiHeader.biBitCount = 32; videoinfoheader.bmiHeader.biSizeImage = 40000; videoinfoheader.bmiHeader.biClrImportant = 256; hr = IPin_ReceiveConnection(avimux_in, &source_filter.IPin_iface, &source_media_type); ok(hr == S_OK, "ReceiveConnection returned %x\n", hr); hr = IPin_ConnectedTo(avimux_in, &pin); ok(hr == S_OK, "ConnectedTo returned %x\n", hr); ok(pin == &source_filter.IPin_iface, "incorrect pin: %p, expected %p\n", pin, &source_filter.IPin_iface); hr = IPin_Connect(avimux_out, &source_filter.IPin_iface, NULL); todo_wine ok(hr == VFW_E_INVALID_DIRECTION, "Connect returned %x\n", hr); hr = IBaseFilter_JoinFilterGraph(avimux, (IFilterGraph*)&GraphBuilder, NULL); ok(hr == S_OK, "JoinFilterGraph returned %x\n", hr); SET_EXPECT(ReceiveConnection); SET_EXPECT(GetAllocatorRequirements); SET_EXPECT(NotifyAllocator); SET_EXPECT(Reconnect); hr = IPin_Connect(avimux_out, &sink_filter.IPin_iface, NULL); ok(hr == S_OK, "Connect returned %x\n", hr); CHECK_CALLED(ReceiveConnection); CHECK_CALLED(GetAllocatorRequirements); CHECK_CALLED(NotifyAllocator); CHECK_CALLED(Reconnect); hr = IPin_Disconnect(avimux_out); ok(hr == S_OK, "Disconnect returned %x\n", hr); IPin_Release(avimux_in); IPin_Release(avimux_out); IBaseFilter_Release(avimux); }
static HRESULT WINAPI regtasks_GetIDsOfNames(IRegisteredTaskCollection *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *dispid) { FIXME("%p,%s,%p,%u,%u,%p: stub\n", iface, debugstr_guid(riid), names, count, lcid, dispid); return E_NOTIMPL; }
TRACE("(%p %p %s)\n", pp, p, debugstr_guid(riid)); if (p) IUnknown_QueryInterface(p, riid, (void **)&new_p); if (*pp) IUnknown_Release(*pp); *pp = new_p; return new_p; } /*********************************************************************** * AtlInternalQueryInterface [atl100.@] */ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, void** ppvObject) { int i = 0; HRESULT rc = E_NOINTERFACE; TRACE("(%p, %p, %s, %p)\n",this, pEntries, debugstr_guid(iid), ppvObject); if (IsEqualGUID(iid,&IID_IUnknown)) { TRACE("Returning IUnknown\n"); *ppvObject = ((LPSTR)this+pEntries[0].dw); IUnknown_AddRef((IUnknown*)*ppvObject); return S_OK; } while (pEntries[i].pFunc != 0) { TRACE("Trying entry %i (%s %i %p)\n",i,debugstr_guid(pEntries[i].piid), pEntries[i].dw, pEntries[i].pFunc); if (!pEntries[i].piid || IsEqualGUID(iid,pEntries[i].piid))
/************************************************************************* * UuidEqual [RPCRT4.@] * * PARAMS * UUID *Uuid1 [I] Uuid to compare * UUID *Uuid2 [I] Uuid to compare * RPC_STATUS *Status [O] returns RPC_S_OK * * RETURNS * TRUE/FALSE */ int WINAPI UuidEqual(UUID *Uuid1, UUID *Uuid2, RPC_STATUS *Status) { TRACE("(%s,%s)\n", debugstr_guid(Uuid1), debugstr_guid(Uuid2)); return !UuidCompare(Uuid1, Uuid2, Status); }
/************************************************************************* * UuidIsNil [RPCRT4.@] * * PARAMS * UUID *Uuid [I] Uuid to compare * RPC_STATUS *Status [O] returns RPC_S_OK * * RETURNS * TRUE/FALSE */ int WINAPI UuidIsNil(UUID *Uuid, RPC_STATUS *Status) { TRACE("(%s)\n", debugstr_guid(Uuid)); if (!Uuid) return TRUE; return !UuidCompare(Uuid, &uuid_nil, Status); }
const char *debugstr_mshtml_guid(const GUID *iid) { #define X(x) if(IsEqualGUID(iid, &x)) return #x X(DIID_HTMLDocumentEvents); X(DIID_HTMLDocumentEvents2); X(DIID_HTMLTableEvents); X(DIID_HTMLTextContainerEvents); X(IID_HTMLPluginContainer); X(IID_IConnectionPoint); X(IID_IConnectionPointContainer); X(IID_ICustomDoc); X(IID_IDispatch); X(IID_IDispatchEx); X(IID_IDispatchJS); X(IID_UndocumentedScriptIface); X(IID_IEnumConnections); X(IID_IEnumVARIANT); X(IID_IHlinkTarget); X(IID_IHTMLDocument6); X(IID_IHTMLDocument7); X(IID_IHTMLEditServices); X(IID_IHTMLFramesCollection2); X(IID_IHTMLPrivateWindow); X(IID_IHtmlLoadOptions); X(IID_IInternetHostSecurityManager); X(IID_IMonikerProp); X(IID_IObjectIdentity); X(IID_IObjectSafety); X(IID_IObjectWithSite); X(IID_IOleContainer); X(IID_IOleCommandTarget); X(IID_IOleControl); X(IID_IOleDocument); X(IID_IOleDocumentView); X(IID_IOleInPlaceActiveObject); X(IID_IOleInPlaceFrame); X(IID_IOleInPlaceObject); X(IID_IOleInPlaceObjectWindowless); X(IID_IOleInPlaceUIWindow); X(IID_IOleObject); X(IID_IOleWindow); X(IID_IOptionArray); X(IID_IPersist); X(IID_IPersistFile); X(IID_IPersistHistory); X(IID_IPersistMoniker); X(IID_IPersistStreamInit); X(IID_IPropertyNotifySink); X(IID_IProvideClassInfo); X(IID_IServiceProvider); X(IID_ISupportErrorInfo); X(IID_ITargetContainer); X(IID_ITravelLogClient); X(IID_IUnknown); X(IID_IViewObject); X(IID_IViewObject2); X(IID_IViewObjectEx); X(IID_nsCycleCollectionISupports); X(IID_nsXPCOMCycleCollectionParticipant); #define XIID(x) X(IID_##x); #define XDIID(x) X(DIID_##x); TID_LIST #undef XIID #undef XDIID #undef X return debugstr_guid(iid); }
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **obj) { FIXME("(%s, %s, %p) stub!\n", debugstr_guid(rclsid), debugstr_guid(riid), obj); return CLASS_E_CLASSNOTAVAILABLE; }
static HRESULT WINAPI ComponentFactory_CreateMetadataWriterFromReader(IWICComponentFactory *iface, IWICMetadataReader *reader, const GUID *vendor, IWICMetadataWriter **writer) { FIXME("%p,%p,%s,%p: stub\n", iface, reader, debugstr_guid(vendor), writer); return E_NOTIMPL; }
static HRESULT WINAPI ComponentFactory_CreateMetadataWriter(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, DWORD options, IWICMetadataWriter **writer) { FIXME("%p,%s,%s,%x,%p: stub\n", iface, debugstr_guid(format), debugstr_guid(vendor), options, writer); return E_NOTIMPL; }
static HRESULT WINAPI ComponentFactory_CreateEncoder(IWICComponentFactory *iface, REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapEncoder **ppIEncoder) { static int fixme=0; IEnumUnknown *enumencoders; IUnknown *unkencoderinfo; IWICBitmapEncoderInfo *encoderinfo; IWICBitmapEncoder *encoder=NULL; HRESULT res=S_OK; ULONG num_fetched; GUID actual_containerformat; TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat), debugstr_guid(pguidVendor), ppIEncoder); if (pguidVendor && !fixme++) FIXME("ignoring vendor GUID\n"); res = CreateComponentEnumerator(WICEncoder, WICComponentEnumerateDefault, &enumencoders); if (FAILED(res)) return res; while (!encoder) { res = IEnumUnknown_Next(enumencoders, 1, &unkencoderinfo, &num_fetched); if (res == S_OK) { res = IUnknown_QueryInterface(unkencoderinfo, &IID_IWICBitmapEncoderInfo, (void**)&encoderinfo); if (SUCCEEDED(res)) { res = IWICBitmapEncoderInfo_GetContainerFormat(encoderinfo, &actual_containerformat); if (SUCCEEDED(res) && IsEqualGUID(guidContainerFormat, &actual_containerformat)) { res = IWICBitmapEncoderInfo_CreateInstance(encoderinfo, &encoder); if (FAILED(res)) encoder = NULL; } IWICBitmapEncoderInfo_Release(encoderinfo); } IUnknown_Release(unkencoderinfo); } else break; } IEnumUnknown_Release(enumencoders); if (encoder) { *ppIEncoder = encoder; return S_OK; } else { WARN("failed to create encoder\n"); *ppIEncoder = NULL; return WINCODEC_ERR_COMPONENTNOTFOUND; } }
static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid) { IInternetHostSecurityManager *secmgr = NULL; IObjectWithSite *obj_site; struct CONFIRMSAFETY cs; IClassFactoryEx *cfex; IClassFactory *cf; DWORD policy_size; BYTE *bpolicy; IUnknown *obj; DWORD policy; GUID guid; HRESULT hres; hres = CLSIDFromProgID(progid, &guid); if(FAILED(hres)) return NULL; TRACE("GUID %s\n", debugstr_guid(&guid)); if(ctx->safeopt & INTERFACE_USES_SECURITY_MANAGER) { secmgr = get_sec_mgr(ctx); if(!secmgr) return NULL; policy = 0; hres = IInternetHostSecurityManager_ProcessUrlAction(secmgr, URLACTION_ACTIVEX_RUN, (BYTE*)&policy, sizeof(policy), (BYTE*)&guid, sizeof(GUID), 0, 0); if(FAILED(hres) || policy != URLPOLICY_ALLOW) return NULL; } hres = CoGetClassObject(&guid, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER, NULL, &IID_IClassFactory, (void**)&cf); if(FAILED(hres)) return NULL; hres = IClassFactory_QueryInterface(cf, &IID_IClassFactoryEx, (void**)&cfex); if(SUCCEEDED(hres)) { FIXME("Use IClassFactoryEx\n"); IClassFactoryEx_Release(cfex); } hres = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj); if(FAILED(hres)) return NULL; if(secmgr) { cs.clsid = guid; cs.pUnk = obj; cs.dwFlags = 0; hres = IInternetHostSecurityManager_QueryCustomPolicy(secmgr, &GUID_CUSTOM_CONFIRMOBJECTSAFETY, &bpolicy, &policy_size, (BYTE*)&cs, sizeof(cs), 0); if(SUCCEEDED(hres)) { policy = policy_size >= sizeof(DWORD) ? *(DWORD*)bpolicy : URLPOLICY_DISALLOW; CoTaskMemFree(bpolicy); } if(FAILED(hres) || policy != URLPOLICY_ALLOW) { IUnknown_Release(obj); return NULL; } } hres = IUnknown_QueryInterface(obj, &IID_IObjectWithSite, (void**)&obj_site); if(SUCCEEDED(hres)) { IUnknown *ax_site; ax_site = create_ax_site(ctx); if(ax_site) { hres = IObjectWithSite_SetSite(obj_site, ax_site); IUnknown_Release(ax_site); } IObjectWithSite_Release(obj_site); if(!ax_site || FAILED(hres)) { IUnknown_Release(obj); return NULL; } } return obj; }
/************************************************************************* * UuidCreateSequential [RPCRT4.@] * * Creates a 128bit UUID. * * RETURNS * * RPC_S_OK if successful. * RPC_S_UUID_LOCAL_ONLY if UUID is only locally unique. * * FIXME: No compensation for changes across reloading * this dll or across reboots (e.g. clock going * backwards and swapped network cards). The RFC * suggests using NVRAM for storing persistent * values. */ RPC_STATUS WINAPI UuidCreateSequential(UUID *Uuid) { static BOOL initialised; static int count; ULONGLONG time; static ULONGLONG timelast; static WORD sequence; static DWORD status; static BYTE address[MAX_ADAPTER_ADDRESS_LENGTH]; EnterCriticalSection(&uuid_cs); if (!initialised) { RPC_UuidGetSystemTime(&timelast); count = TICKS_PER_CLOCK_TICK; sequence = ((rand() & 0xff) << 8) + (rand() & 0xff); sequence &= 0x1fff; status = RPC_UuidGetNodeAddress(address); initialised = TRUE; } /* Generate time element of the UUID. Account for going faster than our clock as well as the clock going backwards. */ while (1) { RPC_UuidGetSystemTime(&time); if (time > timelast) { count = 0; break; } if (time < timelast) { sequence = (sequence + 1) & 0x1fff; count = 0; break; } if (count < TICKS_PER_CLOCK_TICK) { count++; break; } } timelast = time; time += count; /* Pack the information into the UUID structure. */ Uuid->Data1 = (ULONG)(time & 0xffffffff); Uuid->Data2 = (unsigned short)((time >> 32) & 0xffff); Uuid->Data3 = (unsigned short)((time >> 48) & 0x0fff); /* This is a version 1 UUID */ Uuid->Data3 |= (1 << 12); Uuid->Data4[0] = sequence & 0xff; Uuid->Data4[1] = (sequence & 0x3f00) >> 8; Uuid->Data4[1] |= 0x80; memcpy(&Uuid->Data4[2], address, ADDRESS_BYTES_NEEDED); LeaveCriticalSection(&uuid_cs); TRACE("%s\n", debugstr_guid(Uuid)); return status; }
/********************************************************************** * RegisterPowerSettingNotification [USER32.@] */ HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE recipient, const GUID *guid, DWORD flags) { FIXME("(%p,%s,%x): stub\n", recipient, debugstr_guid(guid), flags); return (HPOWERNOTIFY)0xdeadbeef; }
static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput, JoystickImpl **pdev, unsigned short index) { DWORD i; JoystickImpl* newDevice; HRESULT hr; LPDIDATAFORMAT df = NULL; int idx = 0; TRACE("%s %p %p %hu\n", debugstr_guid(rguid), dinput, pdev, index); newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(JoystickImpl)); if (newDevice == 0) { WARN("out of memory\n"); *pdev = 0; return DIERR_OUTOFMEMORY; } newDevice->joydev = &joystick_devices[index]; newDevice->joyfd = -1; newDevice->generic.guidInstance = DInput_Wine_Joystick_GUID; newDevice->generic.guidInstance.Data3 = index; newDevice->generic.guidProduct = DInput_Wine_Joystick_GUID; newDevice->generic.joy_polldev = joy_polldev; newDevice->generic.name = newDevice->joydev->name; newDevice->generic.device_axis_count = newDevice->joydev->axis_count; newDevice->generic.devcaps.dwButtons = newDevice->joydev->button_count; if (newDevice->generic.devcaps.dwButtons > 128) { WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->generic.devcaps.dwButtons); newDevice->generic.devcaps.dwButtons = 128; } newDevice->generic.base.IDirectInputDevice8A_iface.lpVtbl = &JoystickAvt; newDevice->generic.base.IDirectInputDevice8W_iface.lpVtbl = &JoystickWvt; newDevice->generic.base.ref = 1; newDevice->generic.base.dinput = dinput; newDevice->generic.base.guid = *rguid; InitializeCriticalSection(&newDevice->generic.base.crit); newDevice->generic.base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JoystickImpl*->generic.base.crit"); /* setup_dinput_options may change these */ newDevice->generic.deadzone = 0; /* do any user specified configuration */ hr = setup_dinput_options(&newDevice->generic, newDevice->joydev->dev_axes_map); if (hr != DI_OK) goto FAILED1; /* Create copy of default data format */ if (!(df = HeapAlloc(GetProcessHeap(), 0, c_dfDIJoystick2.dwSize))) goto FAILED; memcpy(df, &c_dfDIJoystick2, c_dfDIJoystick2.dwSize); df->dwNumObjs = newDevice->generic.devcaps.dwAxes + newDevice->generic.devcaps.dwPOVs + newDevice->generic.devcaps.dwButtons; if (!(df->rgodf = HeapAlloc(GetProcessHeap(), 0, df->dwNumObjs * df->dwObjSize))) goto FAILED; for (i = 0; i < newDevice->generic.device_axis_count; i++) { int wine_obj = newDevice->generic.axis_map[i]; if (wine_obj < 0) continue; memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[wine_obj], df->dwObjSize); if (wine_obj < 8) df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(wine_obj) | DIDFT_ABSAXIS; else { df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(wine_obj - 8) | DIDFT_POV; i++; /* POV takes 2 axes */ } } for (i = 0; i < newDevice->generic.devcaps.dwButtons; i++) { memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize); df->rgodf[idx ].pguid = &GUID_Button; df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON; } newDevice->generic.base.data_format.wine_df = df; /* initialize default properties */ for (i = 0; i < c_dfDIJoystick2.dwNumObjs; i++) { newDevice->generic.props[i].lDevMin = -32767; newDevice->generic.props[i].lDevMax = +32767; newDevice->generic.props[i].lMin = 0; newDevice->generic.props[i].lMax = 0xffff; newDevice->generic.props[i].lDeadZone = newDevice->generic.deadzone; /* % * 1000 */ newDevice->generic.props[i].lSaturation = 0; } IDirectInput_AddRef(&newDevice->generic.base.dinput->IDirectInput7A_iface); EnterCriticalSection(&dinput->crit); list_add_tail(&dinput->devices_list, &newDevice->generic.base.entry); LeaveCriticalSection(&dinput->crit); newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps); newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED; if (newDevice->generic.base.dinput->dwVersion >= 0x0800) newDevice->generic.devcaps.dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8); else newDevice->generic.devcaps.dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8); newDevice->generic.devcaps.dwFFSamplePeriod = 0; newDevice->generic.devcaps.dwFFMinTimeResolution = 0; newDevice->generic.devcaps.dwFirmwareRevision = 0; newDevice->generic.devcaps.dwHardwareRevision = 0; newDevice->generic.devcaps.dwFFDriverVersion = 0; if (TRACE_ON(dinput)) { _dump_DIDATAFORMAT(newDevice->generic.base.data_format.wine_df); for (i = 0; i < (newDevice->generic.device_axis_count); i++) TRACE("axis_map[%d] = %d\n", i, newDevice->generic.axis_map[i]); _dump_DIDEVCAPS(&newDevice->generic.devcaps); } *pdev = newDevice; return DI_OK; FAILED: hr = DIERR_OUTOFMEMORY; FAILED1: if (df) HeapFree(GetProcessHeap(), 0, df->rgodf); HeapFree(GetProcessHeap(), 0, df); release_DataFormat(&newDevice->generic.base.data_format); HeapFree(GetProcessHeap(),0,newDevice->generic.axis_map); HeapFree(GetProcessHeap(),0,newDevice); *pdev = 0; return hr; }
BOOL WINAPI ApphelpCheckShellObject( REFCLSID clsid, BOOL shim, ULONGLONG *flags ) { TRACE("(%s, %d, %p)\n", debugstr_guid(clsid), shim, flags); if (flags) *flags = 0; return TRUE; }
HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv) { FORMATETC fmt; STGMEDIUM medium; HRESULT ret; TRACE("%p, %x, %s, %p\n", pdtobj, dwFlags, debugstr_guid(riid), ppv); if(!pdtobj) return E_INVALIDARG; fmt.cfFormat = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); fmt.ptd = NULL; fmt.dwAspect = DVASPECT_CONTENT; fmt.lindex = -1; fmt.tymed = TYMED_HGLOBAL; ret = IDataObject_GetData(pdtobj, &fmt, &medium); if(SUCCEEDED(ret)) { LPIDA pida = GlobalLock(medium.u.hGlobal); if((pida->cidl > 1 && !(dwFlags & DOGIF_ONLY_IF_ONE)) || pida->cidl == 1) { LPITEMIDLIST pidl; /* Get the first pidl (parent + child1) */ pidl = ILCombine((LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]), (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1])); ret = SHCreateItemFromIDList(pidl, riid, ppv); ILFree(pidl); } else { ret = E_FAIL; } GlobalUnlock(medium.u.hGlobal); GlobalFree(medium.u.hGlobal); } if(FAILED(ret) && !(dwFlags & DOGIF_NO_HDROP)) { TRACE("Attempting to fall back on CF_HDROP.\n"); fmt.cfFormat = CF_HDROP; fmt.ptd = NULL; fmt.dwAspect = DVASPECT_CONTENT; fmt.lindex = -1; fmt.tymed = TYMED_HGLOBAL; ret = IDataObject_GetData(pdtobj, &fmt, &medium); if(SUCCEEDED(ret)) { DROPFILES *df = GlobalLock(medium.u.hGlobal); LPBYTE files = (LPBYTE)df + df->pFiles; BOOL multiple_files = FALSE; ret = E_FAIL; if(!df->fWide) { WCHAR filename[MAX_PATH]; PCSTR first_file = (PCSTR)files; if(*(files + lstrlenA(first_file) + 1) != 0) multiple_files = TRUE; if( !(multiple_files && (dwFlags & DOGIF_ONLY_IF_ONE)) ) { MultiByteToWideChar(CP_ACP, 0, first_file, -1, filename, MAX_PATH); ret = SHCreateItemFromParsingName(filename, NULL, riid, ppv); } } else { PCWSTR first_file = (PCWSTR)files; if(*((PCWSTR)files + lstrlenW(first_file) + 1) != 0) multiple_files = TRUE; if( !(multiple_files && (dwFlags & DOGIF_ONLY_IF_ONE)) ) ret = SHCreateItemFromParsingName(first_file, NULL, riid, ppv); } GlobalUnlock(medium.u.hGlobal); GlobalFree(medium.u.hGlobal); } } if(FAILED(ret) && !(dwFlags & DOGIF_NO_URL)) { FIXME("Failed to create item, should try CF_URL.\n"); } return ret; }
/*********************************************************************** * RegisterDeviceNotificationW (USER32.@) */ HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE hnd, LPVOID notifyfilter, DWORD flags ) { FIXME_(win32)("(hwnd=%08x, filter=%p, flags=0x%08lx), semi-stub! Returning a fake handle\n", hnd, notifyfilter, flags); DEVTYP_UNION dev; DWORD devType; /* FIXME: currently we only send the WM_DEVICECHANGE messages to top level windows so report an error if someone is trying to register a child window for device notifications FIXME: Since we aren't using the name parameter in the notifyfilter structure, we don't bother doing the string conversion if this function is called from RegisterDeviceNotificationA() */ if (GetParent(hnd)) ERR_(win32)("This is a child window: right now it can't receive WM_DEVICECHANGE messages!\n"); if (notifyfilter) { dev.pVoid = notifyfilter; switch(dev.pHdr->dbch_devicetype) { case DBT_DEVTYP_OEM: FIXME_(win32)("Unimplemented support for: OEM Device 0x%x -- dbco_size: %d, dbco_identifier: %d, dbco_suppfunc: %d\n", dev.pVoid, dev.pOEM->dbco_size, dev.pOEM->dbco_identifier, dev.pOEM->dbco_suppfunc); break; case DBT_DEVTYP_VOLUME: FIXME_(win32)("Unimplemented support for: Volume 0x%x -- dbcv_size: %d, dbcv_unitmask: %d, dbcv_flags: %d\n", dev.pVoid, dev.pVol->dbcv_size, dev.pVol->dbcv_unitmask, dev.pVol->dbcv_flags); break; case DBT_DEVTYP_PORT: FIXME_(win32)("Unimplemented support for: Port Device 0x%x -- dbcp_size: %d, dbcp_name: %s\n", dev.pVoid, dev.pPort->dbcp_size, dev.pPort->dbcp_name); break; case DBT_DEVTYP_DEVICEINTERFACE: FIXME_(win32)("Class of devices 0x%x -- dbcc_size: %d, dbcc_guid: %s, dbcc_name: %s\n", dev.pVoid, dev.pDevInt->dbcc_size, debugstr_guid(&(dev.pDevInt->dbcc_classguid)), dev.pDevInt->dbcc_name); /*if (flags == DEVICE_NOTIFY_WINDOW_HANDLE) USER_Driver.pRegisterDeviceNotification(hnd, notifyfilter);*/ break; case DBT_DEVTYP_HANDLE: FIXME_(win32)("Unimplemented support for: File Handle 0x%x -- dbch_size: %d, dbch_handle: %d, dbch_hdevnotify: %d, dbch_eventguid: %s\n", dev.pVoid, dev.pHnd->dbch_size, dev.pHnd->dbch_handle, dev.pHnd->dbch_hdevnotify, debugstr_guid(&(dev.pHnd->dbch_eventguid))); break; default: FIXME_(win32)("Unknown device type\n"); break; } } /* used for debug output */ switch (flags) { case DEVICE_NOTIFY_WINDOW_HANDLE: TRACE_(win32)("Recipient is a window handle\n"); break; case DEVICE_NOTIFY_SERVICE_HANDLE: FIXME_(win32)("Unimplemented: Recipient is a service handle\n"); break; case DEVICE_NOTIFY_ALL_INTERFACE_CLASSES: FIXME_(win32)("Unimplemented: Recipient is all interface classes\n"); break; default: break; } HDEVNOTIFY result = (HDEVNOTIFY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(int)); return result; }
static HRESULT WINAPI sysinfo_GetIDsOfNames(IADsADSystemInfo *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *dispid) { FIXME("%p,%s,%p,%u,%u,%p: stub\n", iface, debugstr_guid(riid), names, count, lcid, dispid); return E_NOTIMPL; }
static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv) { ok(0, "unexpected service %s\n", debugstr_guid(guidService)); return E_NOINTERFACE; }
HRESULT WINAPI GetAssemblyMDImport(LPCWSTR szFileName, REFIID riid, IUnknown **ppIUnk) { FIXME("(%p %s, %s, %p): stub\n", szFileName, debugstr_w(szFileName), debugstr_guid(riid), *ppIUnk); return ERROR_CALL_NOT_IMPLEMENTED; }
*pccDisplayName = size; return S_OK; } static HRESULT WINAPI IAssemblyNameImpl_Reserved(IAssemblyName *iface, REFIID refIID, IUnknown *pUnkReserved1, IUnknown *pUnkReserved2, LPCOLESTR szReserved, LONGLONG llReserved, LPVOID pvReserved, DWORD cbReserved, LPVOID *ppReserved) { TRACE("(%p, %s, %p, %p, %s, %x%08x, %p, %d, %p)\n", iface, debugstr_guid(refIID), pUnkReserved1, pUnkReserved2, debugstr_w(szReserved), (DWORD)(llReserved >> 32), (DWORD)llReserved, pvReserved, cbReserved, ppReserved); return E_NOTIMPL; } static HRESULT WINAPI IAssemblyNameImpl_GetName(IAssemblyName *iface, LPDWORD lpcwBuffer, WCHAR *pwzName) { IAssemblyNameImpl *name = (IAssemblyNameImpl *)iface; TRACE("(%p, %p, %p)\n", iface, lpcwBuffer, pwzName); if (!name->name)
HRESULT WINAPI CreateInterface(REFCLSID clsid, REFIID riid, LPVOID *ppInterface) { TRACE("(%s,%s,%p)\n", debugstr_guid(clsid), debugstr_guid(riid), ppInterface); return CLRCreateInstance(clsid, riid, ppInterface); }
static HRESULT WINAPI StartMenu_IInitializeObject_QueryInterface(IInitializeObject *iface, REFIID iid, LPVOID *ppvOut) { StartMenu *This = impl_from_IInitializeObject(iface); TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), ppvOut); return StartMenu_QueryInterface((IMenuPopup *)This, iid, ppvOut); }
/*** IDirectXFile methods ***/ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT* ppEnumObj) { IDirectXFileImpl *This = impl_from_IDirectXFile(iface); IDirectXFileEnumObjectImpl* object; HRESULT hr; LPBYTE file_buffer; DWORD file_size; DWORD bytes_written; TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, pvSource, dwLoadOptions, ppEnumObj); if (!ppEnumObj) return DXFILEERR_BADVALUE; /* Only lowest 4 bits are relevant in DXFILELOADOPTIONS */ dwLoadOptions &= 0xF; hr = IDirectXFileEnumObjectImpl_Create(&object); if (FAILED(hr)) return hr; if (dwLoadOptions == DXFILELOAD_FROMFILE) { HANDLE hFile, file_mapping; TRACE("Open source file '%s'\n", (char*)pvSource); hFile = CreateFileA(pvSource, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hFile == INVALID_HANDLE_VALUE) { TRACE("File '%s' not found\n", (char*)pvSource); return DXFILEERR_FILENOTFOUND; } file_size = GetFileSize(hFile, NULL); file_mapping = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (!file_mapping) { hr = DXFILEERR_BADFILETYPE; goto error; } object->mapped_memory = MapViewOfFile(file_mapping, FILE_MAP_READ, 0, 0, 0); CloseHandle(file_mapping); if (!object->mapped_memory) { hr = DXFILEERR_BADFILETYPE; goto error; } file_buffer = object->mapped_memory; } else if (dwLoadOptions == DXFILELOAD_FROMRESOURCE) { HRSRC resource_info; HGLOBAL resource_data; LPDXFILELOADRESOURCE lpdxflr = pvSource; TRACE("Source in resource (module = %p, name = %s, type = %s)\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType)); resource_info = FindResourceA(lpdxflr->hModule, lpdxflr->lpName, lpdxflr->lpType); if (!resource_info) { hr = DXFILEERR_RESOURCENOTFOUND; goto error; } file_size = SizeofResource(lpdxflr->hModule, resource_info); resource_data = LoadResource(lpdxflr->hModule, resource_info); if (!resource_data) { hr = DXFILEERR_BADRESOURCE; goto error; } file_buffer = LockResource(resource_data); if (!file_buffer) { hr = DXFILEERR_BADRESOURCE; goto error; } } else if (dwLoadOptions == DXFILELOAD_FROMMEMORY) { LPDXFILELOADMEMORY lpdxflm = pvSource; TRACE("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize); file_buffer = lpdxflm->lpMemory; file_size = lpdxflm->dSize; } else { FIXME("Source type %d is not handled yet\n", dwLoadOptions); hr = DXFILEERR_NOTDONEYET; goto error; } TRACE("File size is %d bytes\n", file_size); if (TRACE_ON(d3dxof_dump)) { static USHORT num; char tmp[12]; HANDLE file; sprintf(tmp, "file%05u.x", num++); file = CreateFileA(tmp, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, NULL); if (file != INVALID_HANDLE_VALUE) { WriteFile(file, file_buffer, file_size, &bytes_written, NULL); CloseHandle(file); } } object->pDirectXFile = This; object->buf.pdxf = This; object->buf.token_present = FALSE; object->buf.buffer = file_buffer; object->buf.rem_bytes = file_size; hr = parse_header(&object->buf, &object->decomp_buffer); if (FAILED(hr)) goto error; /* Check if there are templates defined before the object */ if (!parse_templates(&object->buf, TRUE)) { hr = DXFILEERR_PARSEERROR; goto error; } if (TRACE_ON(d3dxof)) { ULONG i; TRACE("Registered templates (%d):\n", This->nb_xtemplates); for (i = 1; i < This->nb_xtemplates; i++) DPRINTF("%s - %s\n", This->xtemplates[i].name, debugstr_guid(&This->xtemplates[i].class_id)); } *ppEnumObj = &object->IDirectXFileEnumObject_iface; return DXFILE_OK; error: IDirectXFileEnumObject_Release(&object->IDirectXFileEnumObject_iface); *ppEnumObj = NULL; return hr; }
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDevice(IDXGISwapChain *iface, REFIID riid, void **device) { FIXME("iface %p, riid %s, device %p stub!\n", iface, debugstr_guid(riid), device); return E_NOTIMPL; }
static HRESULT WINAPI ComponentFactory_CreateComponentInfo(IWICComponentFactory *iface, REFCLSID clsidComponent, IWICComponentInfo **ppIInfo) { TRACE("(%p,%s,%p)\n", iface, debugstr_guid(clsidComponent), ppIInfo); return CreateComponentInfo(clsidComponent, ppIInfo); }