Commit 8f108a0f authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Use platform-specific versions of IActiveScriptParse methods.

parent f3b93f26
...@@ -3,6 +3,7 @@ IMPORTLIB = winhttp ...@@ -3,6 +3,7 @@ IMPORTLIB = winhttp
IMPORTS = uuid user32 advapi32 IMPORTS = uuid user32 advapi32
DELAYIMPORTS = oleaut32 ole32 crypt32 DELAYIMPORTS = oleaut32 ole32 crypt32
EXTRALIBS = @SOCKETLIBS@ EXTRALIBS = @SOCKETLIBS@
EXTRADEFS = -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \ C_SRCS = \
cookie.c \ cookie.c \
......
...@@ -1828,6 +1828,16 @@ static BSTR include_pac_utils( BSTR script ) ...@@ -1828,6 +1828,16 @@ static BSTR include_pac_utils( BSTR script )
return ret; return ret;
} }
#ifdef _WIN64
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
#else
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
#endif
static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO *info ) static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO *info )
{ {
static const WCHAR jscriptW[] = {'J','S','c','r','i','p','t',0}; static const WCHAR jscriptW[] = {'J','S','c','r','i','p','t',0};
...@@ -1862,7 +1872,7 @@ static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO ...@@ -1862,7 +1872,7 @@ static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO
hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser ); hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser );
if (hr != S_OK) goto done; if (hr != S_OK) goto done;
hr = IActiveScriptParse64_InitNew( parser ); hr = IActiveScriptParse_InitNew( parser );
if (hr != S_OK) goto done; if (hr != S_OK) goto done;
hr = IActiveScript_SetScriptSite( engine, &script_site ); hr = IActiveScript_SetScriptSite( engine, &script_site );
...@@ -1873,7 +1883,7 @@ static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO ...@@ -1873,7 +1883,7 @@ static BOOL run_script( const BSTR script, const WCHAR *url, WINHTTP_PROXY_INFO
if (!(full_script = include_pac_utils( script ))) goto done; if (!(full_script = include_pac_utils( script ))) goto done;
hr = IActiveScriptParse64_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL ); hr = IActiveScriptParse_ParseScriptText( parser, full_script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL );
if (hr != S_OK) goto done; if (hr != S_OK) goto done;
hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED ); hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED );
...@@ -1910,7 +1920,7 @@ done: ...@@ -1910,7 +1920,7 @@ done:
SysFreeString( hostname ); SysFreeString( hostname );
SysFreeString( func ); SysFreeString( func );
if (dispatch) IDispatch_Release( dispatch ); if (dispatch) IDispatch_Release( dispatch );
if (parser) IUnknown_Release( parser ); if (parser) IActiveScriptParse_Release( parser );
if (engine) IActiveScript_Release( engine ); if (engine) IActiveScript_Release( engine );
if (SUCCEEDED( init )) CoUninitialize(); if (SUCCEEDED( init )) CoUninitialize();
if (!ret) set_last_error( ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT ); if (!ret) set_last_error( ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT );
......
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