urlmon: Update existing session if user agent changes.
This commit is contained in:
parent
552d9f3631
commit
e385df0b8e
|
@ -302,6 +302,12 @@ HINTERNET get_internet_session(IInternetBindInfo *bind_info)
|
||||||
return internet_session;
|
return internet_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void update_user_agent(WCHAR *user_agent)
|
||||||
|
{
|
||||||
|
if(internet_session)
|
||||||
|
InternetSetOptionW(internet_session, INTERNET_OPTION_USER_AGENT, user_agent, strlenW(user_agent));
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT protocol_start(Protocol *protocol, IInternetProtocol *prot, IUri *uri,
|
HRESULT protocol_start(Protocol *protocol, IInternetProtocol *prot, IUri *uri,
|
||||||
IInternetProtocolSink *protocol_sink, IInternetBindInfo *bind_info)
|
IInternetProtocolSink *protocol_sink, IInternetBindInfo *bind_info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -718,6 +718,7 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
|
||||||
|
|
||||||
heap_free(user_agent);
|
heap_free(user_agent);
|
||||||
user_agent = new_user_agent;
|
user_agent = new_user_agent;
|
||||||
|
update_user_agent(user_agent);
|
||||||
|
|
||||||
LeaveCriticalSection(&session_cs);
|
LeaveCriticalSection(&session_cs);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -72,7 +72,8 @@ IInternetProtocol *get_mime_filter(LPCWSTR) DECLSPEC_HIDDEN;
|
||||||
BOOL is_registered_protocol(LPCWSTR) DECLSPEC_HIDDEN;
|
BOOL is_registered_protocol(LPCWSTR) DECLSPEC_HIDDEN;
|
||||||
HRESULT register_namespace(IClassFactory*,REFIID,LPCWSTR,BOOL) DECLSPEC_HIDDEN;
|
HRESULT register_namespace(IClassFactory*,REFIID,LPCWSTR,BOOL) DECLSPEC_HIDDEN;
|
||||||
HINTERNET get_internet_session(IInternetBindInfo*) DECLSPEC_HIDDEN;
|
HINTERNET get_internet_session(IInternetBindInfo*) DECLSPEC_HIDDEN;
|
||||||
LPWSTR get_useragent(void) DECLSPEC_HIDDEN;
|
WCHAR *get_useragent(void) DECLSPEC_HIDDEN;
|
||||||
|
void update_user_agent(WCHAR*) DECLSPEC_HIDDEN;
|
||||||
void free_session(void) DECLSPEC_HIDDEN;
|
void free_session(void) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT bind_to_storage(IUri*,IBindCtx*,REFIID,void**) DECLSPEC_HIDDEN;
|
HRESULT bind_to_storage(IUri*,IBindCtx*,REFIID,void**) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue