winhttp: Use platform-specific versions of IActiveScriptParse methods.

This commit is contained in:
Hans Leidekker 2012-07-27 14:46:13 +02:00 committed by Alexandre Julliard
parent f3b93f2615
commit 8f108a0f4d
2 changed files with 14 additions and 3 deletions

View File

@ -3,6 +3,7 @@ IMPORTLIB = winhttp
IMPORTS = uuid user32 advapi32
DELAYIMPORTS = oleaut32 ole32 crypt32
EXTRALIBS = @SOCKETLIBS@
EXTRADEFS = -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
cookie.c \

View File

@ -1828,6 +1828,16 @@ static BSTR include_pac_utils( BSTR script )
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 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
hr = IActiveScript_QueryInterface( engine, &IID_IActiveScriptParse, (void **)&parser );
if (hr != S_OK) goto done;
hr = IActiveScriptParse64_InitNew( parser );
hr = IActiveScriptParse_InitNew( parser );
if (hr != S_OK) goto done;
hr = IActiveScript_SetScriptSite( engine, &script_site );
@ -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;
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;
hr = IActiveScript_SetScriptState( engine, SCRIPTSTATE_STARTED );
@ -1910,7 +1920,7 @@ done:
SysFreeString( hostname );
SysFreeString( func );
if (dispatch) IDispatch_Release( dispatch );
if (parser) IUnknown_Release( parser );
if (parser) IActiveScriptParse_Release( parser );
if (engine) IActiveScript_Release( engine );
if (SUCCEEDED( init )) CoUninitialize();
if (!ret) set_last_error( ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT );