Commit bf5155b6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Added IInternetPriority implementation to FileProtocol.

parent 24a3ae06
...@@ -33,15 +33,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); ...@@ -33,15 +33,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
typedef struct { typedef struct {
const IInternetProtocolVtbl *lpInternetProtocolVtbl; const IInternetProtocolVtbl *lpInternetProtocolVtbl;
const IInternetPriorityVtbl *lpInternetPriorityVtbl;
HANDLE file; HANDLE file;
LONG priority;
LONG ref; LONG ref;
} FileProtocol; } FileProtocol;
#define PROTOCOL_THIS(iface) DEFINE_THIS(FileProtocol, InternetProtocol, iface)
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define PROTOCOL_THIS(iface) DEFINE_THIS(FileProtocol, InternetProtocol, iface)
static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
{ {
...@@ -57,6 +60,9 @@ static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocol *iface, REFI ...@@ -57,6 +60,9 @@ static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocol *iface, REFI
}else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
*ppv = PROTOCOL(This); *ppv = PROTOCOL(This);
}else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
*ppv = PRIORITY(This);
} }
if(*ppv) { if(*ppv) {
...@@ -266,6 +272,57 @@ static const IInternetProtocolVtbl FileProtocolVtbl = { ...@@ -266,6 +272,57 @@ static const IInternetProtocolVtbl FileProtocolVtbl = {
FileProtocol_UnlockRequest FileProtocol_UnlockRequest
}; };
#define PRIORITY_THIS(iface) DEFINE_THIS(FileProtocol, InternetPriority, iface)
static HRESULT WINAPI FilePriority_QueryInterface(IInternetPriority *iface,
REFIID riid, void **ppv)
{
FileProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv);
}
static ULONG WINAPI FilePriority_AddRef(IInternetPriority *iface)
{
FileProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocol_AddRef(PROTOCOL(This));
}
static ULONG WINAPI FilePriority_Release(IInternetPriority *iface)
{
FileProtocol *This = PRIORITY_THIS(iface);
return IInternetProtocol_Release(PROTOCOL(This));
}
static HRESULT WINAPI FilePriority_SetPriority(IInternetPriority *iface, LONG nPriority)
{
FileProtocol *This = PRIORITY_THIS(iface);
TRACE("(%p)->(%ld)\n", This, nPriority);
This->priority = nPriority;
return S_OK;
}
static HRESULT WINAPI FilePriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
{
FileProtocol *This = PRIORITY_THIS(iface);
TRACE("(%p)->(%p)\n", This, pnPriority);
*pnPriority = This->priority;
return S_OK;
}
#undef PRIORITY_THIS
static const IInternetPriorityVtbl FilePriorityVtbl = {
FilePriority_QueryInterface,
FilePriority_AddRef,
FilePriority_Release,
FilePriority_SetPriority,
FilePriority_GetPriority
};
HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
{ {
FileProtocol *ret; FileProtocol *ret;
...@@ -277,7 +334,9 @@ HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ...@@ -277,7 +334,9 @@ HRESULT FileProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(FileProtocol)); ret = HeapAlloc(GetProcessHeap(), 0, sizeof(FileProtocol));
ret->lpInternetProtocolVtbl = &FileProtocolVtbl; ret->lpInternetProtocolVtbl = &FileProtocolVtbl;
ret->lpInternetPriorityVtbl = &FilePriorityVtbl;
ret->file = NULL; ret->file = NULL;
ret->priority = 0;
ret->ref = 1; ret->ref = 1;
*ppobj = PROTOCOL(ret); *ppobj = PROTOCOL(ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment