示例#1
0
STDMETHODIMP COlePropPage::XPropertySite::GetPageContainer(IUnknown **ppUnk)
{
	METHOD_PROLOGUE(COlePropPage, PropertySite);     // Creates a pThis pointer to 
	TRACE("COlePropPage::PropertySite::GetPageContainer()\n");
	
	return (HRESULT)E_NOTIMPL;   
}
STDMETHODIMP CoAuthServiceCall::XRenewCallback::raw_Terminate()
{
	METHOD_PROLOGUE(CoAuthServiceCall, RenewCallback)

	pThis->m_eState = Finish;
	return NOERROR;
}
示例#3
0
STDMETHODIMP CMuleBrowserControlSite::XInternetSecurityManager::ProcessUrlAction(
										LPCWSTR pwszUrl,
										DWORD dwAction,
										BYTE* /*pPolicy*/, DWORD /*cbPolicy*/,
										BYTE* /*pContext*/, DWORD /*cbContext*/,
										DWORD dwFlags, DWORD dwReserved)
{
	UNREFERENCED_PARAMETER(pwszUrl);
	UNREFERENCED_PARAMETER(dwAction);
	UNREFERENCED_PARAMETER(dwFlags);
	UNREFERENCED_PARAMETER(dwReserved);
	METHOD_PROLOGUE(CMuleBrowserControlSite, InternetSecurityManager);
	TRACE(_T("%hs: URL=%ls, Action=%u, Flags=0x%x, Reserved=%u\n"), "ProcessUrlAction", pwszUrl, dwAction, dwFlags, dwReserved);

#if 0
	DWORD dwPolicy = URLPOLICY_DISALLOW;
	if (cbPolicy >= sizeof(DWORD))
	{
		*(DWORD*)pPolicy = dwPolicy;
		return S_OK;
	} 
	return S_FALSE;
#else
	// Use the policy for the zone which was specified with 'MapUrlToZone'
	// If that particular policy setting is specified as 'Ask User', the control *WILL OPEN* a message box!
	return INET_E_DEFAULT_ACTION;
#endif
}
STDMETHODIMP CLibraryList::XGenericView::get_Name(BSTR FAR* psName)
{
	METHOD_PROLOGUE( CLibraryList, GenericView )
	CString strName( _T("CLibraryFileView") );
	strName.SetSysString( psName );
	return S_OK;
}
STDMETHODIMP CHtmlCollection::XView::Hover(BSTR sURN)
{
    METHOD_PROLOGUE(CHtmlCollection, View)
    CQuickLock oLock( Library.m_pSection );
    CLibraryCollectionView* pView = pThis->m_pView;

    if ( pView->m_bLockdown )
        return S_OK;

    if ( pView->m_pWebCtrl == NULL )
        return S_OK;

    if ( pView->GetFrame() == NULL )
        return S_OK;

    pView->m_nWebIndex = 0;

    if ( sURN && *sURN )	// wcslen
    {
        if ( CLibraryFile* pFile = LibraryMaps.LookupFileByURN( CString( sURN ) ) )
        {
            pView->m_nWebIndex = pFile->m_nIndex;
        }
    }

    if ( pView->m_nWebIndex != 0 )
        pView->GetToolTip()->Show( pView->m_nWebIndex, pView->m_pWebCtrl->GetSafeHwnd() );
    else
        pView->GetToolTip()->Hide();

    return S_OK;
}
STDMETHODIMP CHtmlCollection::XView::Enqueue(BSTR sURN, VARIANT_BOOL *pbResult)
{
    METHOD_PROLOGUE(CHtmlCollection, View)
    *pbResult = VARIANT_FALSE;
    CSingleLock oLock( &Library.m_pSection, TRUE );
    CLibraryCollectionView* pView = pThis->m_pView;

    if ( pView->m_bLockdown )
        return S_OK;

    if ( sURN && *sURN )
    {
        if ( pView->m_pCollection->FindByURN( CString( sURN ) ) != NULL )
        {
            if ( CLibraryFile* pFile = LibraryMaps.LookupFileByURN( CString( sURN ), FALSE, TRUE ) )
            {
                CString strPath = pFile->GetPath();
                oLock.Unlock();
                *pbResult = CFileExecutor::Enqueue( strPath ) ? VARIANT_TRUE : VARIANT_FALSE;
            }
        }
    }

    return S_OK;
}
示例#7
0
STDMETHODIMP Bookmark::XWSBookmark::get_Type(LONG* retval)
{
	METHOD_PROLOGUE(Bookmark, WSBookmark)

	TRY_DUAL(IID_IWSBookmark)
		*retval = pThis->GetType();
		return NOERROR;
	WORKSHARE_CATCH_ALL_DUAL
		
	//TRY_DUAL(IID_IWSBookmark)
	//	*retval = pThis->GetType();
	//	return NOERROR;
	//CATCH(COleException, e) 
	//{ 
	//	_hr = e->m_sc; 
	//}
	//AND_CATCH_ALL(e) 
	//{ 
	//	AFX_MANAGE_STATE(pThis->m_pModuleState); 
	//	_hr = DualHandleException(_riidSource, e); 
	//}}}
	//catch (...)
	//{ 
	//	LOG_WS_ERROR( "Unexpected exception from TER"); 
	//	_hr = E_FAIL; 
	//}}
	//return _hr;

}
STDMETHODIMP CoAuthServiceCall::XRenewCallback::raw_Continue()
{
	METHOD_PROLOGUE(CoAuthServiceCall, RenewCallback)

	HRESULT hr = E_FAIL;
	pThis->m_eState = RetryOnce;
	try
	{
		ATLTRACE2(atlTraceGeneral, 0, _T("  %ls: %ls (retry once)\n"), (BSTR)pThis->m_bstrMethod, (BSTR)pThis->m_bstrUrl);
		pThis->m_spRequest->open(pThis->m_bstrMethod, pThis->m_bstrUrl, VARIANT_TRUE); // hier laeuft schon der erste (synchrone) Callback (OnReadStateChange(READYSTATE_LOADING))
#ifdef AUTHORIZATION_SERVER_SUPPORT_JSON
		pThis->m_spRequest->setRequestHeader(L"Accept", L"application/json");
		// pThis->m_spRequest->setRequestHeader(L"Accept", L"application/json,application/xml");
#else

		pThis->m_spRequest->setRequestHeader(L"Accept", L"application/xml");
#endif
		pThis->m_spRequest->send();
		hr = E_PENDING;
	}
	catch (const _com_error& e) {
		hr = e.Error();
	}
	return hr;
}
示例#9
0
STDMETHODIMP CShellExt::XToolTipExt::GetInfoTip(DWORD dwFlags, LPWSTR *ppwszTip)
{
    METHOD_PROLOGUE(CShellExt, ToolTipExt);

    if ((_tcslen(pThis->m_szFile) == 0)||(!IsPathInAfs(pThis->m_szFile)))
    {
        *ppwszTip=NULL;
        return S_OK;
    }
    bool bIsSymlink = !!IsSymlink(pThis->m_szFile);
    bool bIsMountpoint = !!IsMountPoint(pThis->m_szFile);
    if ((!bIsSymlink) && (!bIsMountpoint))
    {
	*ppwszTip=NULL;
	return S_OK;
    }
    USES_CONVERSION;
    // dwFlags is currently unused.
    CString sInfo;
    if (bIsSymlink)
        sInfo = GetSymlink(pThis->m_szFile);
    else if (bIsMountpoint)
        sInfo = GetMountpoint(pThis->m_szFile);
    *ppwszTip = (WCHAR*) (pThis->m_pAlloc)->Alloc((1+sInfo.GetLength())*sizeof(WCHAR));
    if (*ppwszTip)
        wcscpy(*ppwszTip, (WCHAR*)T2COLE((LPCTSTR)sInfo));

    return S_OK;
}
示例#10
0
STDMETHODIMP	CShellExt::XPersistFileExt::Load(LPCOLESTR wszFile, DWORD dwMode)
{
    METHOD_PROLOGUE(CShellExt, PersistFileExt);
    USES_CONVERSION;
    _tcscpy(pThis->m_szFile, OLE2T((WCHAR*)wszFile));
    return S_OK;
}
示例#11
0
STDMETHODIMP CShellExt::XIconExt::GetOverlayInfo(LPWSTR pwszIconFile
	,int cchMax,int* pIndex,DWORD* pdwFlags)
{
    METHOD_PROLOGUE(CShellExt, IconExt);
    if(IsBadWritePtr(pIndex, sizeof(int)))
	return E_INVALIDARG;
    if(IsBadWritePtr(pdwFlags, sizeof(DWORD)))
	return E_INVALIDARG;

    // The icons must reside in the same path as this dll
    TCHAR szModule[MAX_PATH];
    GetModuleFileName(theApp.m_hInstance, szModule, MAX_PATH);
    TCHAR * slash = _tcsrchr(szModule, '\\');
    if (slash) {
        *slash = 0;
        switch (pThis->GetOverlayObject())
        {
            case 0:
                _tcscat(szModule, _T("\\link.ico"));
            break;
            case 1:
                _tcscat(szModule, _T("\\mount.ico"));
            break;
        }
    }
#ifndef UNICODE
    MultiByteToWideChar( CP_ACP,0,szModule,-1,pwszIconFile,cchMax);
#else
    _tcsncpy(pwszIconFile, szModule, cchMax);
#endif
    *pIndex = 0;
    *pdwFlags = ISIOI_ICONFILE;
    return S_OK;
}
示例#12
0
STDMETHODIMP_(void) CSpaceship::XVisual::Display()
{
    TRACE("CSpaceship::XVisual::Display\n");
    METHOD_PROLOGUE(CSpaceship, Visual)
    TRACE("m_nPosition = %d\n", pThis->m_nPosition);
    TRACE("m_nColor = %d\n", pThis->m_nColor);
}
示例#13
0
STDMETHODIMP COlePropPage::XPropertySite::TranslateAccelerator(MSG *pMsg)
{
	METHOD_PROLOGUE(COlePropPage, PropertySite);     // Creates a pThis pointer to 
	TRACE("COlePropPage::PropertySite::TranslateAccelerator()\n");
	
	return (HRESULT)E_NOTIMPL;   
}
示例#14
0
STDMETHODIMP COlePropPage::XPropertySite::GetLocaleID(LCID* pLocaleID)
{
	METHOD_PROLOGUE(COlePropPage, PropertySite);     // Creates a pThis pointer to 
	TRACE("COlePropPage::PropertySite::GetLocaleID()\n");
	*pLocaleID = ::GetThreadLocale();
	
	return (HRESULT)NOERROR;   
}
示例#15
0
STDMETHODIMP_(void) CSpaceship::XMotion::Fly()
{
    TRACE("CSpaceship::XMotion::Fly\n");
    METHOD_PROLOGUE(CSpaceship, Motion)
    TRACE("m_nPosition = %d\n", pThis->m_nPosition);
    TRACE("m_nAcceleration = %d\n", pThis->m_nAcceleration);
    return;
}
示例#16
0
STDMETHODIMP_(int&) CSpaceship::XMotion::GetPosition()
{
    TRACE("CSpaceship::XMotion::GetPosition\n");
    METHOD_PROLOGUE(CSpaceship, Motion)
    TRACE("m_nPosition = %d\n", pThis->m_nPosition);
    TRACE("m_nAcceleration = %d\n", pThis->m_nAcceleration);
    return pThis->m_nPosition;
}
示例#17
0
void CSpaceship::XMotion::Fly()
{
	TRACE("Entering CSpaceship::XMotion::Fly\n");

	METHOD_PROLOGUE(CSpaceship, Motion)
	TRACE("this: %p, pThis: %p\n", this, pThis);
	TRACE("m_nPosition: %d\n", pThis->m_nPosition);
	TRACE("m_nAcceleration: %d\n", pThis->m_nPosition);
}
示例#18
0
void CSpaceship::XVisual::Display()
{
	TRACE("Entering CSpaceship::XVisual::Display\n");

	METHOD_PROLOGUE(CSpaceship, Visual);
	TRACE("this: %p, pThis: %p\n", this, pThis);
	TRACE("m_nPosition: %d\n", pThis->m_nPosition);
	TRACE("m_nColor: %d\n", pThis->m_nColor);
}
示例#19
0
STDMETHODIMP COlePropPage::XPropertySite::OnStatusChange(DWORD dwFlags)
{
	METHOD_PROLOGUE(COlePropPage, PropertySite);     // Creates a pThis pointer to 
	TRACE("COlePropPage::PropertySite::OnStatusChange()\n");
	
	if (dwFlags & PROPPAGESTATUS_DIRTY)
		pThis->m_pPropPage->Apply();

	return (HRESULT)NOERROR;   
}
示例#20
0
int& CSpaceship::XMotion::GetPosition()
{
	TRACE("Entering CSpaceship::XMotion::GetPosition\n");
	
	METHOD_PROLOGUE(CSpaceship, Motion)
	TRACE("this: %p, pThis: %p\n", this, pThis);
	TRACE("m_nPosition: %d\n", pThis->m_nPosition);
	TRACE("m_nAcceleration: %d\n", pThis->m_nPosition);
	return pThis->m_nPosition;
}
STDMETHODIMP CHtmlCollection::XView::get_Application(IApplication **ppApplication)
{
    METHOD_PROLOGUE(CHtmlCollection, View)
    CLibraryCollectionView* pView = pThis->m_pView;

    if ( pView->m_bTrusted == TRI_UNKNOWN )
        pView->m_bTrusted = ( MsgBox( /*IDS_LIBRARY_COLLECTION_ACCESS*/_T("The collection has requested script access to the application. \nAllow this access?"), MB_ICONEXCLAMATION | MB_YESNO ) == IDYES ) ? TRI_TRUE : TRI_FALSE;

    return ( pView->m_bTrusted == TRI_TRUE ) ? CApplication::GetApp( ppApplication ) : E_ACCESSDENIED;
}
示例#22
0
HRESULT CCustomControlSite::XDocHostShowUI::ShowHelp(
								HWND hwnd,
								LPOLESTR pszHelpFile,
								UINT nCommand,
								DWORD dwData,
								POINT ptMouse,
								IDispatch* pDispatchObjectHit)
{
	METHOD_PROLOGUE(CCustomControlSite, DocHostShowUI);
	return S_OK;
}
示例#23
0
STDMETHODIMP CMuleBrowserControlSite::XInternetSecurityManager::GetZoneMappings(
										DWORD dwZone, 
										IEnumString** /*ppenumString*/, 
										DWORD dwFlags)
{
	UNREFERENCED_PARAMETER(dwZone);
	UNREFERENCED_PARAMETER(dwFlags);
	METHOD_PROLOGUE(CMuleBrowserControlSite, InternetSecurityManager);
	TRACE(_T("%hs: Zone=%d, Flags=0x%s\n"), "GetZoneMappings", dwZone, dwFlags);
	return INET_E_DEFAULT_ACTION;
}
示例#24
0
STDMETHODIMP CMuleBrowserControlSite::XInternetSecurityManager::GetSecurityId(
										LPCWSTR pwszUrl,
										BYTE* /*pbSecurityId*/, DWORD* /*pcbSecurityId*/, 
										DWORD dwReserved)
{
	UNREFERENCED_PARAMETER(pwszUrl);
	UNREFERENCED_PARAMETER(dwReserved);
	METHOD_PROLOGUE(CMuleBrowserControlSite, InternetSecurityManager);
	TRACE(_T("%hs: URL=%ls, Reserved=%u\n"), "GetSecurityId", pwszUrl, dwReserved);
	return INET_E_DEFAULT_ACTION;
}
示例#25
0
HRESULT CCustomControlSite::XDocHostShowUI::ShowMessage(
								HWND hwnd,
								LPOLESTR lpstrText,
								LPOLESTR lpstrCaption,
								DWORD dwType,
								LPOLESTR lpstrHelpFile,
								DWORD dwHelpContext,
								LRESULT * plResult)
{
	METHOD_PROLOGUE(CCustomControlSite, DocHostShowUI);
	return S_OK;
}
示例#26
0
STDMETHODIMP CMuleBrowserControlSite::XInternetSecurityManager::SetZoneMapping(
										DWORD dwZone, 
										LPCWSTR lpszPattern, 
										DWORD dwFlags)
{
	UNREFERENCED_PARAMETER(dwZone);
	UNREFERENCED_PARAMETER(lpszPattern);
	UNREFERENCED_PARAMETER(dwFlags);
	METHOD_PROLOGUE(CMuleBrowserControlSite, InternetSecurityManager);
	TRACE(_T("%hs: Zone=%d, Pattern=%ls, Flags=0x%x\n"), "SetZoneMapping", dwZone, lpszPattern, dwFlags);
	return INET_E_DEFAULT_ACTION;
}
示例#27
0
STDMETHODIMP CMuleBrowserControlSite::XInternetSecurityManager::QueryCustomPolicy(
										LPCWSTR pwszUrl,
										REFGUID /*guidKey*/,
										BYTE** /*ppPolicy*/, DWORD* /*pcbPolicy*/,
										BYTE* /*pContext*/, DWORD /*cbContext*/,
										DWORD /*dwReserved*/)
{
	UNREFERENCED_PARAMETER(pwszUrl);
	METHOD_PROLOGUE(CMuleBrowserControlSite, InternetSecurityManager);
	TRACE(_T("%hs: URL=%ls\n"), "QueryCustomPolicy", pwszUrl);
	return INET_E_DEFAULT_ACTION;
}
示例#28
0
STDMETHODIMP CMuleBrowserControlSite::XServiceProvider::QueryService(REFGUID guidService, REFIID riid, void** ppvObject)
{
	METHOD_PROLOGUE(CMuleBrowserControlSite, ServiceProvider);
	//DUMPIID(guidService, _T("guidService"));
	//DUMPIID(riid, _T("riid"));
	if (guidService == SID_SInternetSecurityManager && riid == IID_IInternetSecurityManager)
	{
		TRACE(_T("%hs\n"), "QueryService");
		return (HRESULT)pThis->ExternalQueryInterface(&riid, ppvObject);
	} 
	*ppvObject = NULL;
	return E_NOINTERFACE;
}
示例#29
0
STDMETHODIMP CWebCtrl::DocSite::XServiceProvider::QueryService(REFGUID guidService, REFIID riid, void **ppv)
{
	METHOD_PROLOGUE(CWebCtrl::DocSite, ServiceProvider)
	CWebCtrl* pCtrl = pThis->GetCtrl();

	if ( guidService == SID_SInternetSecurityManager && pCtrl->m_bSandbox )
	{
		if ( riid == IID_IInternetSecurityManager )
			return pThis->ExternalQueryInterface( &riid, ppv );
		return E_NOINTERFACE;
	}

	return E_UNEXPECTED;	// SVC_E_UNKNOWNSERVICE ?
}
STDMETHODIMP CHtmlCollection::XView::get_MissingCount(LONG *pnCount)
{
    METHOD_PROLOGUE(CHtmlCollection, View)
    *pnCount = 0;
    CQuickLock oLock( Library.m_pSection );
    CLibraryCollectionView* pView = pThis->m_pView;

    if ( pView->m_bLockdown )
        return S_OK;

    *pnCount = pView->m_pCollection->GetMissingCount();

    return S_OK;
}