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

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

?? umon.c

?? ReactOS是一些高手根據Windows XP的內核編寫出的類XP。內核實現機理和API函數調用幾乎相同。甚至可以兼容XP的程序。喜歡研究系統內核的人可以看一看。
?? 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另类| 色先锋久久av资源部| 亚洲男人的天堂一区二区| 91在线播放网址| 久国产精品韩国三级视频| 欧美一级精品在线| 国产在线看一区| 久久久久久久久久看片| 粉嫩蜜臀av国产精品网站| 久久九九影视网| 91视频在线观看| 日韩中文字幕不卡| 欧美mv日韩mv亚洲| 国产在线不卡一区| 中文字幕一区二区三区av| 欧美亚洲综合一区| 国产麻豆精品在线| 亚洲女子a中天字幕| 日韩免费视频一区二区| 99久久婷婷国产综合精品| 日本欧美加勒比视频| 中文字幕+乱码+中文字幕一区| 色系网站成人免费| 奇米精品一区二区三区四区 | 一区二区三区在线看| 日韩一区二区在线观看| 国产69精品一区二区亚洲孕妇 | 日韩欧美亚洲一区二区| 波多野结衣欧美| 麻豆精品一区二区| 亚洲第一久久影院| 国产精品视频在线看| 精品国产欧美一区二区| 色婷婷亚洲精品| 成人av中文字幕| 国内外成人在线| 看电视剧不卡顿的网站| 亚洲成人手机在线| 一区二区三区中文字幕| 亚洲国产精品激情在线观看| 精品日韩99亚洲| 精品国产制服丝袜高跟| 69精品人人人人| 日韩片之四级片| 日韩午夜激情av| 91精品国产91久久久久久一区二区 | 欧美国产禁国产网站cc| 日韩在线一区二区| 日韩在线播放一区二区| 自拍偷拍亚洲激情| 884aa四虎影成人精品一区| 蜜桃av噜噜一区二区三区小说| 日韩一区二区精品| 欧美猛男男办公室激情| 天堂影院一区二区| 亚洲va欧美va国产va天堂影院| 一个色综合网站| 日本aⅴ精品一区二区三区 | 日韩一区二区免费在线观看| 精品乱人伦小说| 国产精品久久久久久久久免费相片 | 国产精品中文有码| 成人手机电影网| 在线精品观看国产| 7777精品伊人久久久大香线蕉超级流畅 | 成人精品国产免费网站| 欧美图片一区二区三区| 久久婷婷国产综合精品青草| 一色桃子久久精品亚洲| 秋霞午夜av一区二区三区| 国产99久久久国产精品潘金网站| 欧美最新大片在线看| 亚洲精品在线免费播放| 一区二区三区产品免费精品久久75| 久久国内精品视频| 欧美三级视频在线| 国产三级精品三级| 日韩avvvv在线播放| 一本久久a久久精品亚洲| 久久无码av三级| 美腿丝袜在线亚洲一区 | 国产精品一线二线三线精华| 欧美最猛黑人xxxxx猛交| 国产精品久久久久久妇女6080| 日韩经典中文字幕一区| 欧美午夜精品一区二区三区| 国产精品久久久久一区二区三区共| 青青草国产精品97视觉盛宴| 在线日韩国产精品| 亚洲五码中文字幕| 精品91自产拍在线观看一区| 亚洲一区二区3| 在线欧美小视频| 一区二区在线观看不卡| 91麻豆高清视频| 亚洲成人www| 宅男噜噜噜66一区二区66| 午夜精品一区在线观看| 欧美日韩一区视频| 美女视频一区在线观看| 欧美电影免费观看完整版| 久久99精品国产.久久久久久| 91麻豆精品国产91久久久使用方法 | 欧美成人三级电影在线| 国产一区二区三区观看| 国产亚洲精品福利| www.欧美色图| 亚洲成人自拍偷拍| 日韩欧美三级在线| av一二三不卡影片| 亚洲一二三级电影| 欧美草草影院在线视频| 高清在线不卡av| 午夜伊人狠狠久久| 国产网红主播福利一区二区| 成人av电影在线播放| 日韩av不卡一区二区| 国产精品嫩草影院av蜜臀| 欧美网站一区二区| 国产精品 日产精品 欧美精品| 亚洲免费观看高清完整| 日韩欧美一区二区视频| 日韩欧美国产一区二区三区| 色中色一区二区| 国产一区啦啦啦在线观看| 亚洲电影中文字幕在线观看| 国产日韩亚洲欧美综合| 色呦呦国产精品| 国产精品白丝av| 欧美aaa在线| 亚洲成人精品一区二区| 亚洲精品免费在线观看| 国产精品污污网站在线观看| 精品国产乱码久久久久久老虎| 欧美性受xxxx黑人xyx性爽| 国产成人精品免费网站| 韩国v欧美v亚洲v日本v| 日日骚欧美日韩| 天天av天天翘天天综合网色鬼国产| 亚洲色图丝袜美腿| 亚洲欧洲日韩av| 中文字幕av一区 二区| 国产精品福利一区| 国产精品国产三级国产普通话三级| 久久久久久电影| 国产精品天干天干在观线| 中文字幕欧美日韩一区| 国产精品久久久99| 亚洲人快播电影网| 日韩精品亚洲专区| 精品伊人久久久久7777人| 中文字幕一区二区三区在线不卡| 在线观看91精品国产麻豆| 懂色av一区二区夜夜嗨| 天堂一区二区在线| 欧美国产激情一区二区三区蜜月| 国产精品一区二区黑丝| 日韩 欧美一区二区三区| 激情图片小说一区| 国产很黄免费观看久久| 91小视频在线| 欧美午夜精品一区二区三区| 日韩一区二区在线观看视频| 久久久久国产精品人| 亚洲视频电影在线| 日本视频免费一区| 91在线观看成人| 日韩一区二区三区在线| 中文字幕一区二区三区四区不卡| 日本一区二区综合亚洲| 一区二区三区欧美| 国产剧情一区二区| 欧美老女人在线| 亚洲一区在线看| 日韩精品三区四区| 91网站在线观看视频| 久久婷婷国产综合精品青草| 亚洲综合色区另类av| 波多野结衣在线一区| 欧美成人性福生活免费看| 亚洲激情六月丁香| 成人黄色小视频| 久久久久高清精品| 精东粉嫩av免费一区二区三区| 在线看国产一区二区| 综合久久久久久久| www.欧美色图| 国产精品久久久久久久久久久免费看| 日韩极品在线观看| 欧美精品久久一区| 免费高清不卡av| 日韩精品在线一区| 久久99久久久欧美国产|