Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8c4ead4d
Commit
8c4ead4d
authored
Nov 09, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 09, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added implementation of IInternetPriority in HttpProtocol.
parent
2762486b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
2 deletions
+123
-2
http.c
dlls/urlmon/http.c
+64
-2
protocol.c
dlls/urlmon/tests/protocol.c
+59
-0
No files found.
dlls/urlmon/http.c
View file @
8c4ead4d
...
...
@@ -33,12 +33,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
typedef
struct
{
const
IInternetProtocolVtbl
*
lpInternetProtocolVtbl
;
const
IInternetPriorityVtbl
*
lpInternetPriorityVtbl
;
LONG
priority
;
LONG
ref
;
}
HttpProtocol
;
#define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, InternetProtocol, iface)
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, InternetProtocol, iface)
static
HRESULT
WINAPI
HttpProtocol_QueryInterface
(
IInternetProtocol
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
@@ -54,6 +59,9 @@ static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFI
}
else
if
(
IsEqualGUID
(
&
IID_IInternetProtocol
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetProtocol %p)
\n
"
,
This
,
ppv
);
*
ppv
=
PROTOCOL
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IInternetPriority
,
riid
))
{
TRACE
(
"(%p)->(IID_IInternetPriority %p)
\n
"
,
This
,
ppv
);
*
ppv
=
PRIORITY
(
This
);
}
if
(
*
ppv
)
{
...
...
@@ -167,6 +175,56 @@ static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocol *iface)
#undef PROTOCOL_THIS
#define PRIORITY_THIS(iface) DEFINE_THIS(HttpProtocol, InternetPriority, iface)
static
HRESULT
WINAPI
HttpPriority_QueryInterface
(
IInternetPriority
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HttpProtocol
*
This
=
PRIORITY_THIS
(
iface
);
return
IInternetProtocol_QueryInterface
(
PROTOCOL
(
This
),
riid
,
ppv
);
}
static
ULONG
WINAPI
HttpPriority_AddRef
(
IInternetPriority
*
iface
)
{
HttpProtocol
*
This
=
PRIORITY_THIS
(
iface
);
return
IInternetProtocol_AddRef
(
PROTOCOL
(
This
));
}
static
ULONG
WINAPI
HttpPriority_Release
(
IInternetPriority
*
iface
)
{
HttpProtocol
*
This
=
PRIORITY_THIS
(
iface
);
return
IInternetProtocol_Release
(
PROTOCOL
(
This
));
}
static
HRESULT
WINAPI
HttpPriority_SetPriority
(
IInternetPriority
*
iface
,
LONG
nPriority
)
{
HttpProtocol
*
This
=
PRIORITY_THIS
(
iface
);
TRACE
(
"(%p)->(%ld)
\n
"
,
This
,
nPriority
);
This
->
priority
=
nPriority
;
return
S_OK
;
}
static
HRESULT
WINAPI
HttpPriority_GetPriority
(
IInternetPriority
*
iface
,
LONG
*
pnPriority
)
{
HttpProtocol
*
This
=
PRIORITY_THIS
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pnPriority
);
*
pnPriority
=
This
->
priority
;
return
S_OK
;
}
#undef PRIORITY_THIS
static
const
IInternetPriorityVtbl
HttpPriorityVtbl
=
{
HttpPriority_QueryInterface
,
HttpPriority_AddRef
,
HttpPriority_Release
,
HttpPriority_SetPriority
,
HttpPriority_GetPriority
};
static
const
IInternetProtocolVtbl
HttpProtocolVtbl
=
{
HttpProtocol_QueryInterface
,
HttpProtocol_AddRef
,
...
...
@@ -194,8 +252,12 @@ HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HttpProtocol
));
ret
->
lpInternetProtocolVtbl
=
&
HttpProtocolVtbl
;
ret
->
lpInternetPriorityVtbl
=
&
HttpPriorityVtbl
;
ret
->
ref
=
1
;
ret
->
priority
=
0
;
*
ppobj
=
PROTOCOL
(
ret
);
return
S_OK
;
...
...
dlls/urlmon/tests/protocol.c
View file @
8c4ead4d
...
...
@@ -206,6 +206,31 @@ static IInternetBindInfoVtbl bind_info_vtbl = {
static
IInternetBindInfo
bind_info
=
{
&
bind_info_vtbl
};
static
void
test_priority
(
IInternetProtocol
*
protocol
)
{
IInternetPriority
*
priority
;
LONG
pr
;
HRESULT
hres
;
hres
=
IInternetProtocol_QueryInterface
(
protocol
,
&
IID_IInternetPriority
,
(
void
**
)
&
priority
);
ok
(
hres
==
S_OK
,
"QueryInterface(IID_IInternetPriority) failed: %08lx
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
hres
=
IInternetPriority_GetPriority
(
priority
,
&
pr
);
ok
(
hres
==
S_OK
,
"GetPriority failed: %08lx
\n
"
,
hres
);
ok
(
pr
==
0
,
"pr=%ld, expected 0
\n
"
,
pr
);
hres
=
IInternetPriority_SetPriority
(
priority
,
1
);
ok
(
hres
==
S_OK
,
"SetPriority failed: %08lx
\n
"
,
hres
);
hres
=
IInternetPriority_GetPriority
(
priority
,
&
pr
);
ok
(
hres
==
S_OK
,
"GetPriority failed: %08lx
\n
"
,
hres
);
ok
(
pr
==
1
,
"pr=%ld, expected 1
\n
"
,
pr
);
IInternetPriority_Release
(
priority
);
}
static
void
file_protocol_start
(
IInternetProtocol
*
protocol
,
LPCWSTR
url
,
BOOL
is_first
)
{
HRESULT
hres
;
...
...
@@ -414,11 +439,45 @@ static void test_file_protocol(void) {
IInternetProtocol_Release
(
protocol
);
}
static
void
test_http_protocol
(
void
)
{
IInternetProtocol
*
protocol
;
IInternetProtocolInfo
*
protocol_info
;
IClassFactory
*
factory
;
IUnknown
*
unk
;
HRESULT
hres
;
hres
=
CoGetClassObject
(
&
CLSID_HttpProtocol
,
CLSCTX_INPROC_SERVER
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hres
==
S_OK
,
"CoGetClassObject failed: %08lx
\n
"
,
hres
);
if
(
!
SUCCEEDED
(
hres
))
return
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
protocol_info
);
ok
(
hres
==
E_NOINTERFACE
,
"Could not get IInternetProtocolInfo interface: %08lx, expected E_NOINTERFACE
\n
"
,
hres
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IClassFactory
,
(
void
**
)
&
factory
);
ok
(
hres
==
S_OK
,
"Could not get IClassFactory interface
\n
"
);
IUnknown_Release
(
unk
);
if
(
FAILED
(
hres
))
return
;
hres
=
IClassFactory_CreateInstance
(
factory
,
NULL
,
&
IID_IInternetProtocol
,
(
void
**
)
&
protocol
);
ok
(
hres
==
S_OK
,
"Could not get IInternetProtocol: %08lx
\n
"
,
hres
);
test_priority
(
protocol
);
IInternetProtocol_Release
(
protocol
);
}
START_TEST
(
protocol
)
{
OleInitialize
(
NULL
);
test_file_protocol
();
test_http_protocol
();
OleUninitialize
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment