当前位置: 首页>>代码示例>>C++>>正文


C++ ValidateReadWritePtr函数代码示例

本文整理汇总了C++中ValidateReadWritePtr函数的典型用法代码示例。如果您正苦于以下问题:C++ ValidateReadWritePtr函数的具体用法?C++ ValidateReadWritePtr怎么用?C++ ValidateReadWritePtr使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ValidateReadWritePtr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ValidateReadWritePtr

// get the stream time at which this sample should start and finish.
STDMETHODIMP
CMediaSample::GetTime(
					  REFERENCE_TIME * pTimeStart,     // put time here
					  REFERENCE_TIME * pTimeEnd
					  )
{
	ValidateReadWritePtr(pTimeStart,sizeof(REFERENCE_TIME));
	ValidateReadWritePtr(pTimeEnd,sizeof(REFERENCE_TIME));

	if (!(m_dwFlags & Sample_StopValid)) {
		if (!(m_dwFlags & Sample_TimeValid)) {
			return VFW_E_SAMPLE_TIME_NOT_SET;
		} else {
			*pTimeStart = m_Start;

			//  Make sure old stuff works
			*pTimeEnd = m_Start + 1;
			return VFW_S_NO_STOP_TIME;
		}
	}

	*pTimeStart = m_Start;
	*pTimeEnd = m_End;
	return NOERROR;
}
开发者ID:EnoroF,项目名称:easygamelibs,代码行数:26,代码来源:MediaSample.cpp

示例2: CheckPointer

//----------------------------------------------------------------------------
//! @brief	  	要求するメモリの詳細を設定する。
//! @param		pRequest : バッファ要求を含む ALLOCATOR_PROPERTIES 構造体のポインタ
//! @param		pActual : 実際のバッファ プロパティを受け取る ALLOCATOR_PROPERTIES 構造体のポインタ
//! @return		エラーコード
//----------------------------------------------------------------------------
STDMETHODIMP TBufferRendererAllocator::SetProperties( ALLOCATOR_PROPERTIES* pRequest, ALLOCATOR_PROPERTIES* pActual )
{
	CheckPointer( pActual, E_POINTER );
	ValidateReadWritePtr( pActual, sizeof(ALLOCATOR_PROPERTIES) );
	CAutoLock	cObjectLock(this);

    ZeroMemory( pActual, sizeof(ALLOCATOR_PROPERTIES) );

	if( m_bCommitted == TRUE)
		return VFW_E_ALREADY_COMMITTED;

	if( m_lFree.GetCount() < m_lAllocated )	// m_lAllocatedが1個以上の時はエラーにした方がよい?
		return VFW_E_BUFFERS_OUTSTANDING;

	if( pRequest->cBuffers == 1 && pRequest->cbBuffer == m_pRenderer->GetBufferSize() &&
		pRequest->cbAlign == 1 && pRequest->cbPrefix == 0 )
	{
		*pActual = *pRequest;
		m_lSize = pRequest->cbBuffer;
		m_lCount = pRequest->cBuffers;
		m_lAlignment = pRequest->cbAlign;
		m_lPrefix = pRequest->cbPrefix;
		m_bChanged = TRUE;
		return S_OK;
	}

	return VFW_E_BADALIGN;
}
开发者ID:John-He-928,项目名称:krkrz,代码行数:34,代码来源:BufferRenderer.cpp

示例3: CheckPointer

STDMETHODIMP CTransInPlaceInputPin::GetAllocator(IMemAllocator ** ppAllocator)
{
    CheckPointer(ppAllocator,E_POINTER);
    ValidateReadWritePtr(ppAllocator,sizeof(IMemAllocator *));
    CAutoLock cObjectLock(m_pLock);

    HRESULT hr;

    if ( m_pTIPFilter->m_pOutput->IsConnected() ) {
        //  Store the allocator we got
        hr = m_pTIPFilter->OutputPin()->ConnectedIMemInputPin()
                                        ->GetAllocator( ppAllocator );
        if (SUCCEEDED(hr)) {
            m_pTIPFilter->OutputPin()->SetAllocator( *ppAllocator );
        }
    }
    else {
        //  Help upstream filter (eg TIP filter which is having to do a copy)
        //  by providing a temp allocator here - we'll never use
        //  this allocator because when our output is connected we'll
        //  reconnect this pin
        hr = CTransformInputPin::GetAllocator( ppAllocator );
    }
    return hr;

} // GetAllocator
开发者ID:DishBird,项目名称:VideoSuiteUtilities,代码行数:26,代码来源:transip.cpp

示例4: CheckPointer

STDMETHODIMP
CTransformOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
    CheckPointer(ppv,E_POINTER);
    ValidateReadWritePtr(ppv,sizeof(PVOID));
    *ppv = NULL;

    if(riid == IID_IMediaPosition || riid == IID_IMediaSeeking) {

        // we should have an input pin by now

        ASSERT(m_pTransformFilter->m_pInput != NULL);

        if(m_pPosition == NULL) {

            HRESULT hr = CreatePosPassThru(GetOwner(),
                FALSE,
                (IPin *)m_pTransformFilter->m_pInput,
                &m_pPosition);
            if(FAILED(hr)) {
                return hr;
            }
        }
        return m_pPosition->QueryInterface(riid, ppv);
    }
    else {
        return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
    }
}
开发者ID:Ancaro,项目名称:stepmania,代码行数:28,代码来源:transfrm.cpp

示例5: CheckPointer

STDMETHODIMP CStreamSwitcherOutputPin::NonDelegatingQueryInterface(REFIID riid, void** ppv)
{
    CheckPointer(ppv, E_POINTER);
    ValidateReadWritePtr(ppv, sizeof(PVOID));
    *ppv = nullptr;

    if (riid == IID_IMediaPosition || riid == IID_IMediaSeeking) {
        if (m_pStreamSwitcherPassThru == nullptr) {
            HRESULT hr = S_OK;
            m_pStreamSwitcherPassThru = (IUnknown*)(INonDelegatingUnknown*)
                                        DEBUG_NEW CStreamSwitcherPassThru(GetOwner(), &hr, static_cast<CStreamSwitcherFilter*>(m_pFilter));

            if (!m_pStreamSwitcherPassThru) {
                return E_OUTOFMEMORY;
            }
            if (FAILED(hr)) {
                return hr;
            }
        }

        return m_pStreamSwitcherPassThru->QueryInterface(riid, ppv);
    }
    /*
        else if (riid == IID_IStreamBuilder)
        {
            return GetInterface((IStreamBuilder*)this, ppv);
        }
    */
    return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
}
开发者ID:EchoLiao,项目名称:mpc-hc,代码行数:30,代码来源:StreamSwitcher.cpp

示例6: CheckPointer

//
// FindPin
//
// If Id is In or Out then return the IPin* for that pin
// creating the pin if need be.  Otherwise return NULL with an error.
STDMETHODIMP CParserFilter::FindPin(LPCWSTR Id, IPin **ppPin) 
{
    CheckPointer(ppPin,E_POINTER);
    ValidateReadWritePtr(ppPin,sizeof(IPin *));

    if(0==lstrcmpW(Id,L"In")) {
        *ppPin = GetPin(0);
    }
    else if(0==lstrcmpW(Id,L"Out")) {
        *ppPin = GetPin(1);
    }
    else {
        *ppPin = NULL;
        return VFW_E_NOT_FOUND;
    }

    HRESULT hr = NOERROR;
    //  AddRef() returned pointer - but GetPin could fail if memory is low.
    if(*ppPin) {
        (*ppPin)->AddRef();
    }
    else {
        hr = E_OUTOFMEMORY;  // probably.  There's no pin anyway.
    }
    return hr;
}
开发者ID:guojerry,项目名称:cppxml,代码行数:31,代码来源:Parser.cpp

示例7: CheckPointer

STDMETHODIMP CAnalyzerWriterFilter::GetClassID(CLSID *pClsID)
{
    CheckPointer(pClsID,E_POINTER);
    ValidateReadWritePtr(pClsID,sizeof(CLSID));
    *pClsID = CLSID_FileWriter;
    return NOERROR;
}
开发者ID:perlinson,项目名称:graph-studio-next,代码行数:7,代码来源:filter_analyzer_writer.cpp

示例8: CheckPointer

/* Return the clock's clsid */
STDMETHODIMP
CSystemClock::GetClassID(__out CLSID *pClsID)
{
    CheckPointer(pClsID,E_POINTER);
    ValidateReadWritePtr(pClsID,sizeof(CLSID));
    *pClsID = CLSID_SystemClock;
    return NOERROR;
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:9,代码来源:sysclock.cpp

示例9: CheckPointer

STDMETHODIMP
CBaseDispatch::GetTypeInfoCount(UINT * pctinfo)
{
    CheckPointer(pctinfo,E_POINTER);
    ValidateReadWritePtr(pctinfo,sizeof(UINT *));
    *pctinfo = 1;
    return S_OK;
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:8,代码来源:ctlutil.cpp

示例10: ValidateReadWritePtr

STDMETHODIMP CAMMediaContent::NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv)
{
    ValidateReadWritePtr(ppv,sizeof(PVOID));
    if (riid == IID_IAMMediaContent) {
		return GetInterface((IAMMediaContent*)this, ppv);
    } else {
		return CUnknown::NonDelegatingQueryInterface(riid, ppv);
    }
}
开发者ID:vlakoff,项目名称:musepack,代码行数:9,代码来源:media_content.cpp

示例11: ValidateReadWritePtr

STDMETHODIMP
CMediaPosition::NonDelegatingQueryInterface(REFIID riid, void **ppv)
{
    ValidateReadWritePtr(ppv,sizeof(PVOID));
    if (riid == IID_IMediaPosition) {
	return GetInterface( (IMediaPosition *) this, ppv);
    } else {
	return CUnknown::NonDelegatingQueryInterface(riid, ppv);
    }
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:10,代码来源:ctlutil.cpp

示例12: CheckPointer

STDMETHODIMP
CBasePin::QueryDirection(
						 PIN_DIRECTION * pPinDir
						 )
{
	CheckPointer(pPinDir,E_POINTER);
	ValidateReadWritePtr(pPinDir,sizeof(PIN_DIRECTION));

	*pPinDir = m_dir;
	return NOERROR;
}
开发者ID:EnoroF,项目名称:easygamelibs,代码行数:11,代码来源:BasePin.cpp

示例13: CheckPointer

STDMETHODIMP CMVEADPCMDecompressor::NonDelegatingQueryInterface(REFIID riid, void **ppv)
{
	// Check and validate the pointer
	CheckPointer(ppv, E_POINTER);
	ValidateReadWritePtr(ppv, sizeof(PVOID));

	// Expose ISpecifyPropertyPages (and the base-class interfaces)
	if (riid == IID_ISpecifyPropertyPages)
		return GetInterface((ISpecifyPropertyPages*)this, ppv);
	else
		return CTransformFilter::NonDelegatingQueryInterface(riid, ppv);
}
开发者ID:ValeryAnisimovsky,项目名称:GameMediaFormatsCoreFilters,代码行数:12,代码来源:MVEADPCMDecompressor.cpp

示例14: CheckPointer

STDMETHODIMP CSubtitleSource::QueryFilterInfo(FILTER_INFO* pInfo)
{
	CheckPointer(pInfo, E_POINTER);
	ValidateReadWritePtr(pInfo, sizeof(FILTER_INFO));
	wcscpy_s(pInfo->achName, SubtitleSourceName);
	pInfo->pGraph = m_pGraph;
	if (m_pGraph) {
		m_pGraph->AddRef();
	}

	return S_OK;
}
开发者ID:Samangan,项目名称:mpc-hc,代码行数:12,代码来源:SubtitleSource.cpp

示例15: AMGetWideString

// Return a wide string - allocating memory for it
// Returns:
//    S_OK          - no error
//    E_POINTER     - ppszReturn == NULL
//    E_OUTOFMEMORY - can't allocate memory for returned string
STDAPI AMGetWideString(LPCWSTR psz, LPWSTR *ppszReturn)
{
    CheckPointer(ppszReturn, E_POINTER);
    ValidateReadWritePtr(ppszReturn, sizeof(LPWSTR));
    DWORD nameLen = sizeof(WCHAR) * (lstrlenW(psz)+1);
    *ppszReturn = (LPWSTR)CoTaskMemAlloc(nameLen);
    if (*ppszReturn == NULL) {
       return E_OUTOFMEMORY;
    }
    CopyMemory(*ppszReturn, psz, nameLen); /*ffdshow custom*/
    return NOERROR;
}
开发者ID:JERUKA9,项目名称:ffdshow-tryouts,代码行数:17,代码来源:wxutil.cpp


注:本文中的ValidateReadWritePtr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。