Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
09af64cb
Commit
09af64cb
authored
Apr 28, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlink: Implement IExtensionServices.
parent
f4625d1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
18 deletions
+123
-18
extserv.c
dlls/hlink/extserv.c
+99
-18
hlguids.h
include/hlguids.h
+2
-0
hlink.idl
include/hlink.idl
+22
-0
No files found.
dlls/hlink/extserv.c
View file @
09af64cb
...
@@ -26,9 +26,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(hlink);
...
@@ -26,9 +26,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(hlink);
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
typedef
struct
{
typedef
struct
{
const
IUnknownVtbl
*
lpIUnknownVtbl
;
const
IUnknownVtbl
*
lpIUnknownVtbl
;
const
IAuthenticateVtbl
*
lpIAuthenticateVtbl
;
const
IAuthenticateVtbl
*
lpIAuthenticateVtbl
;
const
IHttpNegotiateVtbl
*
lpIHttpNegotiateVtbl
;
const
IHttpNegotiateVtbl
*
lpIHttpNegotiateVtbl
;
const
IExtensionServicesVtbl
*
lpIExtensionServicesVtbl
;
LONG
ref
;
LONG
ref
;
IUnknown
*
outer
;
IUnknown
*
outer
;
...
@@ -42,6 +43,7 @@ typedef struct {
...
@@ -42,6 +43,7 @@ typedef struct {
#define EXTSERVUNK(x) ((IUnknown*) &(x)->lpIUnknownVtbl)
#define EXTSERVUNK(x) ((IUnknown*) &(x)->lpIUnknownVtbl)
#define AUTHENTICATE(x) ((IAuthenticate*) &(x)->lpIAuthenticateVtbl)
#define AUTHENTICATE(x) ((IAuthenticate*) &(x)->lpIAuthenticateVtbl)
#define HTTPNEGOTIATE(x) ((IHttpNegotiate*) &(x)->lpIHttpNegotiateVtbl)
#define HTTPNEGOTIATE(x) ((IHttpNegotiate*) &(x)->lpIHttpNegotiateVtbl)
#define EXTENSIONSERVICES(x) ((IExtensionServices*) &(x)->lpIExtensionServicesVtbl)
#define EXTSERVUNK_THIS(iface) DEFINE_THIS(ExtensionService, IUnknown, iface)
#define EXTSERVUNK_THIS(iface) DEFINE_THIS(ExtensionService, IUnknown, iface)
...
@@ -60,6 +62,9 @@ static HRESULT WINAPI ExtServUnk_QueryInterface(IUnknown *iface, REFIID riid, vo
...
@@ -60,6 +62,9 @@ static HRESULT WINAPI ExtServUnk_QueryInterface(IUnknown *iface, REFIID riid, vo
}
else
if
(
IsEqualGUID
(
&
IID_IHttpNegotiate
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IHttpNegotiate
,
riid
))
{
TRACE
(
"(%p)->(IID_IHttpNegotiate %p)
\n
"
,
This
,
ppv
);
TRACE
(
"(%p)->(IID_IHttpNegotiate %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTTPNEGOTIATE
(
This
);
*
ppv
=
HTTPNEGOTIATE
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IExtensionServices
,
riid
))
{
TRACE
(
"(%p)->(IID_IExtensionServices %p)
\n
"
,
This
,
ppv
);
*
ppv
=
EXTENSIONSERVICES
(
This
);
}
}
if
(
*
ppv
)
{
if
(
*
ppv
)
{
...
@@ -209,6 +214,90 @@ static const IHttpNegotiateVtbl HttpNegotiateVtbl = {
...
@@ -209,6 +214,90 @@ static const IHttpNegotiateVtbl HttpNegotiateVtbl = {
HttpNegotiate_OnResponse
HttpNegotiate_OnResponse
};
};
#define EXTENSIONSERVICES_THIS(iface) DEFINE_THIS(ExtensionService, IExtensionServices, iface)
static
HRESULT
WINAPI
ExtServ_QueryInterface
(
IExtensionServices
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
ExtensionService
*
This
=
EXTENSIONSERVICES_THIS
(
iface
);
return
IUnknown_QueryInterface
(
This
->
outer
,
riid
,
ppv
);
}
static
ULONG
WINAPI
ExtServ_AddRef
(
IExtensionServices
*
iface
)
{
ExtensionService
*
This
=
EXTENSIONSERVICES_THIS
(
iface
);
return
IUnknown_AddRef
(
This
->
outer
);
}
static
ULONG
WINAPI
ExtServ_Release
(
IExtensionServices
*
iface
)
{
ExtensionService
*
This
=
EXTENSIONSERVICES_THIS
(
iface
);
return
IUnknown_Release
(
This
->
outer
);
}
static
HRESULT
ExtServ_ImplSetAdditionalHeaders
(
ExtensionService
*
This
,
LPCWSTR
pwzAdditionalHeaders
)
{
int
len
=
0
;
heap_free
(
This
->
headers
);
This
->
headers
=
NULL
;
if
(
!
pwzAdditionalHeaders
)
return
S_OK
;
len
=
strlenW
(
pwzAdditionalHeaders
);
if
(
len
&&
pwzAdditionalHeaders
[
len
-
1
]
!=
'\n'
&&
pwzAdditionalHeaders
[
len
-
1
]
!=
'\r'
)
{
static
const
WCHAR
endlW
[]
=
{
'\r'
,
'\n'
,
0
};
This
->
headers
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
+
sizeof
(
endlW
));
memcpy
(
This
->
headers
,
pwzAdditionalHeaders
,
len
*
sizeof
(
WCHAR
));
memcpy
(
This
->
headers
+
len
,
endlW
,
sizeof
(
endlW
));
}
else
{
This
->
headers
=
hlink_strdupW
(
pwzAdditionalHeaders
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
ExtServ_SetAdditionalHeaders
(
IExtensionServices
*
iface
,
LPCWSTR
pwzAdditionalHeaders
)
{
ExtensionService
*
This
=
EXTENSIONSERVICES_THIS
(
iface
);
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
pwzAdditionalHeaders
));
return
ExtServ_ImplSetAdditionalHeaders
(
This
,
pwzAdditionalHeaders
);
}
static
HRESULT
ExtServ_ImplSetAuthenticateData
(
ExtensionService
*
This
,
HWND
phwnd
,
LPCWSTR
pwzUsername
,
LPCWSTR
pwzPassword
)
{
heap_free
(
This
->
username
);
heap_free
(
This
->
password
);
This
->
hwnd
=
phwnd
;
This
->
username
=
hlink_strdupW
(
pwzUsername
);
This
->
password
=
hlink_strdupW
(
pwzPassword
);
return
S_OK
;
}
static
HRESULT
WINAPI
ExtServ_SetAuthenticateData
(
IExtensionServices
*
iface
,
HWND
phwnd
,
LPCWSTR
pwzUsername
,
LPCWSTR
pwzPassword
)
{
ExtensionService
*
This
=
EXTENSIONSERVICES_THIS
(
iface
);
TRACE
(
"(%p)->(%p %s %s)
\n
"
,
This
,
phwnd
,
debugstr_w
(
pwzUsername
),
debugstr_w
(
pwzPassword
));
return
ExtServ_ImplSetAuthenticateData
(
This
,
phwnd
,
pwzUsername
,
pwzPassword
);
}
#undef EXTENSIONSERVICES_THIS
static
const
IExtensionServicesVtbl
ExtServVtbl
=
{
ExtServ_QueryInterface
,
ExtServ_AddRef
,
ExtServ_Release
,
ExtServ_SetAdditionalHeaders
,
ExtServ_SetAuthenticateData
};
/***********************************************************************
/***********************************************************************
* HlinkCreateExtensionServices (HLINK.@)
* HlinkCreateExtensionServices (HLINK.@)
*/
*/
...
@@ -217,7 +306,6 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
...
@@ -217,7 +306,6 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
IUnknown
*
punkOuter
,
REFIID
riid
,
void
**
ppv
)
IUnknown
*
punkOuter
,
REFIID
riid
,
void
**
ppv
)
{
{
ExtensionService
*
ret
;
ExtensionService
*
ret
;
int
len
=
0
;
HRESULT
hres
=
S_OK
;
HRESULT
hres
=
S_OK
;
TRACE
(
"%s %p %s %s %p %s %p
\n
"
,
debugstr_w
(
pwzAdditionalHeaders
),
TRACE
(
"%s %p %s %s %p %s %p
\n
"
,
debugstr_w
(
pwzAdditionalHeaders
),
...
@@ -229,22 +317,15 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
...
@@ -229,22 +317,15 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
ret
->
lpIUnknownVtbl
=
&
ExtServUnkVtbl
;
ret
->
lpIUnknownVtbl
=
&
ExtServUnkVtbl
;
ret
->
lpIAuthenticateVtbl
=
&
AuthenticateVtbl
;
ret
->
lpIAuthenticateVtbl
=
&
AuthenticateVtbl
;
ret
->
lpIHttpNegotiateVtbl
=
&
HttpNegotiateVtbl
;
ret
->
lpIHttpNegotiateVtbl
=
&
HttpNegotiateVtbl
;
ret
->
lpIExtensionServicesVtbl
=
&
ExtServVtbl
;
ret
->
ref
=
1
;
ret
->
ref
=
1
;
ret
->
hwnd
=
phwnd
;
ret
->
headers
=
NULL
;
ret
->
username
=
hlink_strdupW
(
pszUsername
);
ret
->
hwnd
=
NULL
;
ret
->
password
=
hlink_strdupW
(
pszPassword
);
ret
->
username
=
NULL
;
ret
->
password
=
NULL
;
if
(
pwzAdditionalHeaders
)
len
=
strlenW
(
pwzAdditionalHeaders
);
if
(
len
&&
pwzAdditionalHeaders
[
len
-
1
]
!=
'\n'
&&
pwzAdditionalHeaders
[
len
-
1
]
!=
'\r'
)
{
ExtServ_ImplSetAuthenticateData
(
ret
,
phwnd
,
pszUsername
,
pszPassword
);
static
const
WCHAR
endlW
[]
=
{
'\r'
,
'\n'
,
0
};
ExtServ_ImplSetAdditionalHeaders
(
ret
,
pwzAdditionalHeaders
);
ret
->
headers
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
+
sizeof
(
endlW
));
memcpy
(
ret
->
headers
,
pwzAdditionalHeaders
,
len
*
sizeof
(
WCHAR
));
memcpy
(
ret
->
headers
+
len
,
endlW
,
sizeof
(
endlW
));
}
else
{
ret
->
headers
=
hlink_strdupW
(
pwzAdditionalHeaders
);
}
if
(
!
punkOuter
)
{
if
(
!
punkOuter
)
{
ret
->
outer
=
EXTSERVUNK
(
ret
);
ret
->
outer
=
EXTSERVUNK
(
ret
);
...
...
include/hlguids.h
View file @
09af64cb
...
@@ -25,5 +25,7 @@ DEFINE_GUID(CLSID_StdHlink,
...
@@ -25,5 +25,7 @@ DEFINE_GUID(CLSID_StdHlink,
0x79eac9d0
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
0x79eac9d0
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
DEFINE_GUID
(
CLSID_StdHlinkBrowseContext
,
DEFINE_GUID
(
CLSID_StdHlinkBrowseContext
,
0x79eac9d1
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
0x79eac9d1
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
DEFINE_GUID
(
CLSID_IID_IExtensionServices
,
0x79eac9cb
,
0xbaf9
,
0x11ce
,
0x8c
,
0x82
,
0x00
,
0xaa
,
0x00
,
0x4b
,
0xa9
,
0x0b
);
#endif
#endif
include/hlink.idl
View file @
09af64cb
...
@@ -416,3 +416,25 @@ interface IHlinkFrame : IUnknown
...
@@ -416,3 +416,25 @@ interface IHlinkFrame : IUnknown
[
in
,
unique
]
LPCWSTR
pwzLocation
,
[
in
,
unique
]
LPCWSTR
pwzLocation
,
[
in
,
unique
]
LPCWSTR
pwzFriendlyName
)
;
[
in
,
unique
]
LPCWSTR
pwzFriendlyName
)
;
}
}
/*****************************************************************************
*
IExtensionServices
interface
*/
[
object
,
uuid
(
79
eac9cb
-
baf9
-
11
ce
-
8
c82
-
00
aa004ba90b
),
pointer_default
(
unique
)
]
interface
IExtensionServices
:
IUnknown
{
typedef
IExtensionServices
*
LPEXTENSIONSERVICES
;
HRESULT
SetAdditionalHeaders
(
[
in
]
LPCWSTR
pwzAdditionalHeaders
)
;
HRESULT
SetAuthenticateData
(
[
in
]
HWND
phwnd
,
[
in
]
LPCWSTR
pwzUsername
,
[
in
]
LPCWSTR
pwzPassword
)
;
}
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