本文整理汇总了C++中debugstr_guid函数的典型用法代码示例。如果您正苦于以下问题:C++ debugstr_guid函数的具体用法?C++ debugstr_guid怎么用?C++ debugstr_guid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugstr_guid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComponentFactory_CreateDecoder
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;
}
示例2: BindProtocol_QueryInterface
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;
}
示例3: IDirectSoundFullDuplexImpl_Initialize
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;
}
示例4: IAMMultiMediaStreamImpl_AddMediaStream
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;
}
示例5: test_AviMux
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);
//.........这里部分代码省略.........
示例6: regtasks_GetIDsOfNames
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;
}
示例7: TRACE
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 [[email protected]]
*/
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))
示例8: UuidEqual
/*************************************************************************
* UuidEqual [[email protected]]
*
* 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);
}
示例9: UuidIsNil
/*************************************************************************
* UuidIsNil [[email protected]]
*
* 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);
}
示例10: X
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);
}
示例11: DllGetClassObject
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;
}
示例12: ComponentFactory_CreateMetadataWriterFromReader
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;
}
示例13: ComponentFactory_CreateMetadataWriter
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;
}
示例14: ComponentFactory_CreateEncoder
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;
}
}
示例15: UuidCreateSequential
/*************************************************************************
* UuidCreateSequential [[email protected]]
*
* 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;
}