亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? umon.c

?? 這是一個開放源代碼的與WINNT/WIN2K/WIN2003兼容的操作系統
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
 * UrlMon
 *
 * Copyright 1999 Ulrich Czekalla for Corel Corporation
 * Copyright 2002 Huw D M Davies for CodeWeavers
 * Copyright 2005 Jacek Caban for CodeWeavers
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include <stdarg.h>
#include <stdio.h>

#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT

#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winternl.h"
#include "winuser.h"
#include "objbase.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "ole2.h"
#include "urlmon.h"
#include "wininet.h"
#include "shlwapi.h"
#include "urlmon_main.h"

WINE_DEFAULT_DEBUG_CHANNEL(urlmon);

/* native urlmon.dll uses this key, too */
static WCHAR BSCBHolder[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };

/*static BOOL registered_wndclass = FALSE;*/

typedef struct {
    const IBindingVtbl *lpVtbl;

    LONG ref;

    LPWSTR URLName;

    HWND hwndCallback;
    IBindCtx *pBC;
    HINTERNET hinternet, hconnect, hrequest;
    HANDLE hCacheFile;
    IUMCacheStream *pstrCache;
    IBindStatusCallback *pbscb;
    DWORD total_read, expected_size;
} Binding;

static HRESULT WINAPI Binding_QueryInterface(IBinding* iface, REFIID riid, void **ppvObject)
{
    Binding *This = (Binding*)iface;

    TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppvObject);

    if((This == NULL) || (ppvObject == NULL))
	return E_INVALIDARG;

    if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IBinding, riid)) {
        *ppvObject = iface;
        IBinding_AddRef(iface);
        return S_OK;
    }

    *ppvObject = NULL;
    return E_NOINTERFACE;
}

static ULONG WINAPI Binding_AddRef(IBinding* iface)
{
    Binding *This = (Binding*)iface;
    ULONG ref = InterlockedIncrement(&This->ref);

    TRACE("(%p) ref=%d\n", This, ref);

    return ref;
}

static ULONG WINAPI Binding_Release(IBinding* iface)
{
    Binding *This = (Binding*)iface;
    ULONG ref = InterlockedDecrement(&This->ref);

    TRACE("(%p) ref=%d\n",This, ref);

    if(!ref) {
        HeapFree(GetProcessHeap(), 0, This->URLName);
        if (This->hCacheFile)
            CloseHandle(This->hCacheFile);
        if (This->pstrCache)
        {
            UMCloseCacheFileStream(This->pstrCache);
            IStream_Release((IStream *)This->pstrCache);
        }
        if (This->pbscb)
            IBindStatusCallback_Release(This->pbscb);

        HeapFree(GetProcessHeap(), 0, This);

        URLMON_UnlockModule();
    }

    return ref;
}

static HRESULT WINAPI Binding_Abort(IBinding* iface)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p): stub\n", This);

    return E_NOTIMPL;
}

static HRESULT WINAPI Binding_GetBindResult(IBinding* iface, CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p)->(%p, %p, %p, %p): stub\n", This, pclsidProtocol, pdwResult, pszResult, pdwReserved);

    return E_NOTIMPL;
}

static HRESULT WINAPI Binding_GetPriority(IBinding* iface, LONG* pnPriority)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p)->(%p): stub\n", This, pnPriority);

    return E_NOTIMPL;
}

static HRESULT WINAPI Binding_Resume(IBinding* iface)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p): stub\n", This);

    return E_NOTIMPL;
}

static HRESULT WINAPI Binding_SetPriority(IBinding* iface, LONG nPriority)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p)->(%d): stub\n", This, nPriority);

    return E_NOTIMPL;
}

static HRESULT WINAPI Binding_Suspend(IBinding* iface)
{
    Binding *This = (Binding*)iface;

    FIXME("(%p): stub\n", This);

    return E_NOTIMPL;
}

static void Binding_CloseCacheDownload(Binding *This)
{
    CloseHandle(This->hCacheFile);
    This->hCacheFile = 0;
    UMCloseCacheFileStream(This->pstrCache);
    IStream_Release((IStream *)This->pstrCache);
    This->pstrCache = 0;
}

static HRESULT Binding_MoreCacheData(Binding *This, char *buf, DWORD dwBytes)
{
    DWORD written;

    if (WriteFile(This->hCacheFile, buf, dwBytes, &written, NULL) && written == dwBytes)
    {
	HRESULT hr;

	This->total_read += written;
        hr = IBindStatusCallback_OnProgress(This->pbscb,
					    This->total_read + written,
					    This->expected_size,
					    (This->total_read == written) ?
					        BINDSTATUS_BEGINDOWNLOADDATA :
					        BINDSTATUS_DOWNLOADINGDATA,
					    This->URLName);
	if (!hr)
	{
	    STGMEDIUM stg;
	    FORMATETC fmt;

            fmt.cfFormat = 0;
            fmt.ptd = NULL;
            fmt.dwAspect = 0;
            fmt.lindex = -1;
            fmt.tymed = TYMED_ISTREAM;

	    stg.tymed = TYMED_ISTREAM;
	    stg.u.pstm = (IStream *)This->pstrCache;
	    stg.pUnkForRelease = NULL;

            hr = IBindStatusCallback_OnDataAvailable(This->pbscb,
			    			     (This->total_read == written) ?
							 BSCF_FIRSTDATANOTIFICATION :
						         BSCF_INTERMEDIATEDATANOTIFICATION,
						     This->total_read + written,
                                                     &fmt,
						     &stg);
	}
	if (written < dwBytes)
	    return STG_E_MEDIUMFULL;
	else
	    return hr;
    }
    return HRESULT_FROM_WIN32(GetLastError());
}

static void Binding_FinishedDownload(Binding *This, HRESULT hr)
{
    STGMEDIUM stg;
    FORMATETC fmt;

    fmt.ptd = NULL;
    fmt.dwAspect = 0;
    fmt.lindex = -1;
    fmt.tymed = TYMED_ISTREAM;

    stg.tymed = TYMED_ISTREAM;
    stg.u.pstm = (IStream *)This->pstrCache;
    stg.pUnkForRelease = NULL;

    IBindStatusCallback_OnProgress(This->pbscb, This->total_read, This->expected_size,
                                   BINDSTATUS_ENDDOWNLOADDATA, This->URLName);
    IBindStatusCallback_OnDataAvailable(This->pbscb, BSCF_LASTDATANOTIFICATION, This->total_read, &fmt, &stg);
    if (hr)
    {
	WCHAR *pwchError = 0;

        FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM |
	                 FORMAT_MESSAGE_ALLOCATE_BUFFER,
                        NULL, (DWORD) hr,
		        0, (LPWSTR) &pwchError,
		        0, NULL);
	if (!pwchError)
	{
	    static const WCHAR achFormat[] = { '%', '0', '8', 'x', 0 };

	    pwchError =(WCHAR *) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * 9);
	    wsprintfW(pwchError, achFormat, hr);
	}
        IBindStatusCallback_OnStopBinding(This->pbscb, hr, pwchError);
	LocalFree(pwchError);
    }
    else
    {
        IBindStatusCallback_OnStopBinding(This->pbscb, hr, NULL);
    }
    IBindStatusCallback_Release(This->pbscb);
    This->pbscb = 0;
}

static const IBindingVtbl BindingVtbl =
{
    Binding_QueryInterface,
    Binding_AddRef,
    Binding_Release,
    Binding_Abort,
    Binding_Suspend,
    Binding_Resume,
    Binding_SetPriority,
    Binding_GetPriority,
    Binding_GetBindResult
};

/* filemoniker data structure */
typedef struct {

    const IMonikerVtbl* lpvtbl;  /* VTable relative to the IMoniker interface.*/

    LONG ref; /* reference counter for this object */

    LPOLESTR URLName; /* URL string identified by this URLmoniker */
} URLMonikerImpl;

/*******************************************************************************
 *        URLMoniker_QueryInterface
 *******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject)
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;

    TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppvObject);

    /* Perform a sanity check on the parameters.*/
    if ( (This==0) || (ppvObject==0) )
	return E_INVALIDARG;

    /* Initialize the return parameter */
    *ppvObject = 0;

    /* Compare the riid with the interface IDs implemented by this object.*/
    if (IsEqualIID(&IID_IUnknown, riid)      ||
        IsEqualIID(&IID_IPersist, riid)      ||
        IsEqualIID(&IID_IPersistStream,riid) ||
        IsEqualIID(&IID_IMoniker, riid)
       )
        *ppvObject = iface;

    /* Check that we obtained an interface.*/
    if ((*ppvObject)==0)
        return E_NOINTERFACE;

    /* Query Interface always increases the reference count by one when it is successful */
    IMoniker_AddRef(iface);

    return S_OK;
}

/******************************************************************************
 *        URLMoniker_AddRef
 ******************************************************************************/
static ULONG WINAPI URLMonikerImpl_AddRef(IMoniker* iface)
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;
    ULONG refCount = InterlockedIncrement(&This->ref);

    TRACE("(%p) ref=%u\n",This, refCount);

    return refCount;
}

/******************************************************************************
 *        URLMoniker_Release
 ******************************************************************************/
static ULONG WINAPI URLMonikerImpl_Release(IMoniker* iface)
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;
    ULONG refCount = InterlockedDecrement(&This->ref);

    TRACE("(%p) ref=%u\n",This, refCount);

    /* destroy the object if there's no more reference on it */
    if (!refCount) {
        HeapFree(GetProcessHeap(),0,This->URLName);
        HeapFree(GetProcessHeap(),0,This);

        URLMON_UnlockModule();
    }

    return refCount;
}


/******************************************************************************
 *        URLMoniker_GetClassID
 ******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_GetClassID(IMoniker* iface,
						CLSID *pClassID)/* Pointer to CLSID of object */
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;

    TRACE("(%p,%p)\n",This,pClassID);

    if (pClassID==NULL)
        return E_POINTER;
    /* Windows always returns CLSID_StdURLMoniker */
    *pClassID = CLSID_StdURLMoniker;
    return S_OK;
}

/******************************************************************************
 *        URLMoniker_IsDirty
 ******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_IsDirty(IMoniker* iface)
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;
    /* Note that the OLE-provided implementations of the IPersistStream::IsDirty
       method in the OLE-provided moniker interfaces always return S_FALSE because
       their internal state never changes. */

    TRACE("(%p)\n",This);

    return S_FALSE;
}

/******************************************************************************
 *        URLMoniker_Load
 *
 * NOTE
 *  Writes a ULONG containing length of unicode string, followed
 *  by that many unicode characters
 ******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_Load(IMoniker* iface,IStream* pStm)
{
    URLMonikerImpl *This = (URLMonikerImpl *)iface;
    
    HRESULT res;
    ULONG size;
    ULONG got;
    TRACE("(%p,%p)\n",This,pStm);

    if(!pStm)
        return E_INVALIDARG;

    res = IStream_Read(pStm, &size, sizeof(ULONG), &got);
    if(SUCCEEDED(res)) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av午夜在线观看| 欧美一区二区精美| 91精品国产高清一区二区三区| 2欧美一区二区三区在线观看视频| 亚洲裸体在线观看| 国产a视频精品免费观看| 制服丝袜国产精品| 亚洲国产精品一区二区久久恐怖片| 国产黄色91视频| 欧美激情一区不卡| 国产精品99久久久久| 日韩一区二区三区av| 五月婷婷另类国产| 欧美亚洲日本国产| 亚洲欧美二区三区| av一区二区三区在线| 国产视频在线观看一区二区三区| 久久不见久久见免费视频1| 欧美日韩大陆在线| 性感美女久久精品| 欧美中文字幕不卡| 亚洲福利视频导航| 欧美午夜免费电影| 视频一区在线播放| 日韩一区二区三区电影在线观看| 午夜影视日本亚洲欧洲精品| 色999日韩国产欧美一区二区| 亚洲天堂福利av| 一本一道综合狠狠老| 亚洲婷婷综合色高清在线| 9久草视频在线视频精品| 亚洲欧洲av一区二区三区久久| 99精品视频一区| 亚洲伊人色欲综合网| 在线国产电影不卡| 亚洲成人tv网| 欧美成人伊人久久综合网| 热久久国产精品| 久久综合五月天婷婷伊人| 国产精品综合二区| 中文字幕一区二区三区四区| 9i在线看片成人免费| 一区二区三区影院| 欧美一级在线免费| 国产黄色成人av| 亚洲欧美经典视频| 国产精品传媒视频| 色悠悠久久综合| 婷婷综合在线观看| 国产日韩欧美一区二区三区综合| 99国产精品国产精品久久| 亚洲v日本v欧美v久久精品| 日韩免费观看高清完整版| 国产成人丝袜美腿| 伊人婷婷欧美激情| 欧美r级电影在线观看| 成人精品免费看| 亚洲国产视频网站| 国产婷婷色一区二区三区四区| 91黄色免费看| 国产精品综合一区二区三区| 亚洲欧美一区二区不卡| 精品美女一区二区| 色综合视频在线观看| 乱一区二区av| 亚洲精品视频在线观看网站| 日韩免费电影一区| 91啪九色porn原创视频在线观看| 日本欧美一区二区在线观看| 国产欧美一区二区三区在线老狼| 欧美性色aⅴ视频一区日韩精品| 奇米影视一区二区三区| 中文字幕中文字幕一区二区| 69av一区二区三区| 日本精品一区二区三区高清 | 国产精品白丝av| 亚洲va韩国va欧美va精品| 国产夜色精品一区二区av| 欧美日韩色综合| a亚洲天堂av| 国产在线国偷精品免费看| 亚洲午夜电影网| 欧美韩国一区二区| 久久夜色精品国产噜噜av| 欧美日韩一区二区在线观看| 成人av午夜电影| 国产一区二区三区四区五区入口| 亚洲综合在线视频| 国产精品入口麻豆原神| 欧美精品一区二区精品网| 欧美日韩一卡二卡三卡 | 一区二区三区欧美激情| 国产天堂亚洲国产碰碰| 精品久久久久香蕉网| 日韩一区二区不卡| 欧美精品v国产精品v日韩精品 | 日本va欧美va瓶| 亚洲高清免费视频| 夜夜嗨av一区二区三区中文字幕| 欧美激情综合五月色丁香| 久久久久久亚洲综合影院红桃 | 国产在线视频一区二区三区| 亚洲成人免费电影| 亚洲午夜精品在线| 亚洲精品一二三| 亚洲视频狠狠干| 亚洲黄色性网站| 亚洲一卡二卡三卡四卡无卡久久| 亚洲天堂av老司机| 亚洲欧美日韩久久精品| 亚洲欧美日韩小说| 亚洲国产人成综合网站| 亚洲欧美日韩综合aⅴ视频| 美国三级日本三级久久99| 蜜桃av噜噜一区二区三区小说| 日日夜夜免费精品| 日本aⅴ亚洲精品中文乱码| 秋霞影院一区二区| 黄一区二区三区| 国产成人综合在线| hitomi一区二区三区精品| 91在线高清观看| 欧美亚洲综合在线| 日韩一本二本av| 久久亚洲二区三区| 国产精品久久午夜夜伦鲁鲁| 亚洲男人的天堂在线观看| 亚洲地区一二三色| 蜜臀久久99精品久久久久宅男| 狠狠v欧美v日韩v亚洲ⅴ| 成人天堂资源www在线| 91蝌蚪porny九色| 欧美日韩在线播放三区| 日韩精品在线网站| 欧美国产精品一区| 亚洲综合在线电影| 美女网站视频久久| 成人黄页毛片网站| 欧美日韩在线播放一区| 日韩精品一区二区三区老鸭窝| 久久久久亚洲综合| 亚洲综合另类小说| 精品一区二区在线视频| a美女胸又www黄视频久久| 欧美日韩视频第一区| 国产拍欧美日韩视频二区| 亚洲综合色区另类av| 国产一区二区三区免费看 | 欧美日韩国产影片| 久久精品水蜜桃av综合天堂| 最新成人av在线| 久久精品国产**网站演员| 一本久道久久综合中文字幕| 日韩欧美一区中文| 亚洲男女一区二区三区| 寂寞少妇一区二区三区| 欧美亚洲日本国产| 日精品一区二区| 成人18视频在线播放| 日韩午夜精品视频| 亚洲综合网站在线观看| 高清日韩电视剧大全免费| 制服丝袜亚洲播放| 亚洲美女视频在线| 懂色av一区二区三区免费看| 欧美一区在线视频| 亚洲人123区| 成人综合婷婷国产精品久久| 欧美一区二区三区四区五区 | 久久国产精品一区二区| 欧美探花视频资源| 成人欧美一区二区三区黑人麻豆 | 国产精品私房写真福利视频| 日韩福利视频导航| 91黄色免费版| 亚洲女与黑人做爰| 成人av影院在线| 国产人妖乱国产精品人妖| 美女久久久精品| 91精品啪在线观看国产60岁| 一区二区三区在线视频观看| 粉嫩蜜臀av国产精品网站| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产成人在线观看免费网站| 欧美zozo另类异族| 另类综合日韩欧美亚洲| 91精品国产综合久久久蜜臀图片| 亚洲一区二区三区免费视频| 色噜噜夜夜夜综合网| 亚洲乱码国产乱码精品精小说| 成人午夜av影视| 国产精品久久久久久一区二区三区 | 亚洲最大色网站| 在线这里只有精品| 一区二区三区波多野结衣在线观看 | 97se亚洲国产综合自在线观| 最新欧美精品一区二区三区| 91麻豆免费看片| 一区二区三区欧美久久| 日本韩国一区二区三区|