ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[cwittich] 45767: [JSCRIPT_WINETEST] sync jscript_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Mar 2 20:52:22 2010 New Revision: 45767 URL:
http://svn.reactos.org/svn/reactos?rev=45767&view=rev
Log: [JSCRIPT_WINETEST] sync jscript_winetest to wine 1.1.39 Added: trunk/rostests/winetests/jscript/activex.c (with props) Modified: trunk/rostests/winetests/jscript/api.js trunk/rostests/winetests/jscript/jscript.c trunk/rostests/winetests/jscript/jscript.rbuild trunk/rostests/winetests/jscript/lang.js trunk/rostests/winetests/jscript/regexp.js trunk/rostests/winetests/jscript/run.c trunk/rostests/winetests/jscript/testlist.c Added: trunk/rostests/winetests/jscript/activex.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/activex…
============================================================================== --- trunk/rostests/winetests/jscript/activex.c (added) +++ trunk/rostests/winetests/jscript/activex.c [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -1,0 +1,1096 @@ +/* + * Copyright 2009 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdio.h> + +#define COBJMACROS +#define CONST_VTABLE + +#include <ole2.h> +#include <dispex.h> +#include <activscp.h> +#include <objsafe.h> +#include <urlmon.h> +#include <mshtmhst.h> + +#include "wine/test.h" + +static const CLSID CLSID_JScript = + {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; + +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define SET_CALLED(func) \ + called_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(CreateInstance); +DEFINE_EXPECT(ProcessUrlAction); +DEFINE_EXPECT(QueryCustomPolicy); +DEFINE_EXPECT(reportSuccess); +DEFINE_EXPECT(Host_QS_SecMgr); +DEFINE_EXPECT(Caller_QS_SecMgr); +DEFINE_EXPECT(QI_IObjectWithSite); +DEFINE_EXPECT(SetSite); + +static const WCHAR testW[] = {'t','e','s','t',0}; + +static HRESULT QS_SecMgr_hres; +static HRESULT ProcessUrlAction_hres; +static DWORD ProcessUrlAction_policy; +static HRESULT CreateInstance_hres; +static HRESULT QueryCustomPolicy_hres; +static DWORD QueryCustomPolicy_psize; +static DWORD QueryCustomPolicy_policy; +static HRESULT QI_IDispatch_hres; +static HRESULT SetSite_hres; + +#define TESTOBJ_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80646}" + +static const GUID CLSID_TestObj = + {0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}}; + +/* Defined as extern in urlmon.idl, but not exported by uuid.lib */ +const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY = + {0x10200490,0xfa38,0x11d0,{0xac,0x0e,0x00,0xa0,0xc9,0xf,0xff,0xc0}}; + +#define DISPID_TEST_REPORTSUCCESS 0x1000 + +#define DISPID_GLOBAL_OK 0x2000 + +static const char *debugstr_guid(REFIID riid) +{ + static char buf[50]; + + sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], + riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], + riid->Data4[5], riid->Data4[6], riid->Data4[7]); + + return buf; +} + +static BSTR a2bstr(const char *str) +{ + BSTR ret; + int len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = SysAllocStringLen(NULL, len-1); + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + + return ret; +} + +static int strcmp_wa(LPCWSTR strw, const char *stra) +{ + CHAR buf[512]; + WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0); + return lstrcmpA(buf, stra); +} + +static HRESULT WINAPI ObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ULONG WINAPI ObjectWithSite_AddRef(IObjectWithSite *iface) +{ + return 2; +} + +static ULONG WINAPI ObjectWithSite_Release(IObjectWithSite *iface) +{ + return 1; +} + +static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite) +{ + IServiceProvider *sp; + HRESULT hres; + + + CHECK_EXPECT(SetSite); + ok(pUnkSite != NULL, "pUnkSite == NULL\n"); + + hres = IUnknown_QueryInterface(pUnkSite, &IID_IServiceProvider, (void**)&sp); + ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres); + IServiceProvider_Release(sp); + + return SetSite_hres; +} + +static HRESULT WINAPI ObjectWithSite_GetSite(IObjectWithSite *iface, REFIID riid, void **ppvSite) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IObjectWithSiteVtbl ObjectWithSiteVtbl = { + ObjectWithSite_QueryInterface, + ObjectWithSite_AddRef, + ObjectWithSite_Release, + ObjectWithSite_SetSite, + ObjectWithSite_GetSite +}; + +static IObjectWithSite ObjectWithSite = { &ObjectWithSiteVtbl }; + +static IObjectWithSite *object_with_site; + +static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(riid, &IID_IUnknown)) { + *ppv = iface; + }else if(IsEqualGUID(riid, &IID_IDispatch) || IsEqualGUID(riid, &IID_IDispatchEx)) { + if(FAILED(QI_IDispatch_hres)) + return QI_IDispatch_hres; + *ppv = iface; + }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) { + CHECK_EXPECT(QI_IObjectWithSite); + *ppv = object_with_site; + }else { + return E_NOINTERFACE; + } + + return *ppv ? S_OK : E_NOINTERFACE; +} + +static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface) +{ + return 2; +} + +static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface) +{ + return 1; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + if(!strcmp_wa(bstrName, "reportSuccess")) { + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_TEST_REPORTSUCCESS; + return S_OK; + } + + ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + switch(id) { + case DISPID_TEST_REPORTSUCCESS: + CHECK_EXPECT(reportSuccess); + + ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + break; + + default: + ok(0, "unexpected call\n"); + return E_NOTIMPL; + } + + return S_OK; +} + +static IDispatchExVtbl testObjVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + Test_GetDispID, + Test_InvokeEx, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; + +static IDispatchEx testObj = { &testObjVtbl }; + +static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + if(!strcmp_wa(bstrName, "ok")) { + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_GLOBAL_OK; + return S_OK; + } + + ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + switch(id) { + case DISPID_GLOBAL_OK: + ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg)); + ok(V_BOOL(pdp->rgvarg+1), "%s\n", wine_dbgstr_w(V_BSTR(pdp->rgvarg))); + break; + + default: + ok(0, "unexpected call\n"); + return E_NOTIMPL; + } + + return S_OK; +} + +static IDispatchExVtbl globalObjVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + Global_GetDispID, + Global_InvokeEx, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; + +static IDispatchEx globalObj = { &globalObjVtbl }; + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) { + *ppv = iface; + return S_OK; + } + + /* TODO: IClassFactoryEx */ + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) +{ + CHECK_EXPECT(CreateInstance); + + ok(!outer, "outer = %p\n", outer); + ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", debugstr_guid(riid)); + + if(SUCCEEDED(CreateInstance_hres)) + *ppv = &testObj; + return CreateInstance_hres; +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) +{ + ok(0, "unexpected call\n"); + return S_OK; +} + +static const IClassFactoryVtbl ClassFactoryVtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + ClassFactory_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory activex_cf = { &ClassFactoryVtbl }; + +static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI InternetHostSecurityManager_AddRef(IInternetHostSecurityManager *iface) +{ + return 2; +} + +static ULONG WINAPI InternetHostSecurityManager_Release(IInternetHostSecurityManager *iface) +{ + return 1; +} + +static HRESULT WINAPI InternetHostSecurityManager_GetSecurityId(IInternetHostSecurityManager *iface, BYTE *pbSecurityId, + DWORD *pcbSecurityId, DWORD_PTR dwReserved) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHostSecurityManager *iface, DWORD dwAction, + BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved) +{ + CHECK_EXPECT(ProcessUrlAction); + + ok(dwAction == URLACTION_ACTIVEX_RUN, "dwAction = %x\n", dwAction); + ok(pPolicy != NULL, "pPolicy == NULL\n"); + ok(cbPolicy == sizeof(DWORD), "cbPolicy = %d\n", cbPolicy); + ok(pContext != NULL, "pContext == NULL\n"); + ok(cbContext == sizeof(GUID), "cbContext = %d\n", cbContext); + ok(IsEqualGUID(pContext, &CLSID_TestObj), "pContext = %s\n", debugstr_guid((const IID*)pContext)); + ok(!dwFlags, "dwFlags = %x\n", dwFlags); + ok(!dwReserved, "dwReserved = %x\n", dwReserved); + + if(SUCCEEDED(ProcessUrlAction_hres)) + *(DWORD*)pPolicy = ProcessUrlAction_policy; + return ProcessUrlAction_hres; +} + +static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHostSecurityManager *iface, REFGUID guidKey, + BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved) +{ + const struct CONFIRMSAFETY *cs = (const struct CONFIRMSAFETY*)pContext; + DWORD *ret; + + CHECK_EXPECT(QueryCustomPolicy); + + ok(IsEqualGUID(&GUID_CUSTOM_CONFIRMOBJECTSAFETY, guidKey), "guidKey = %s\n", debugstr_guid(guidKey)); + + ok(ppPolicy != NULL, "ppPolicy == NULL\n"); + ok(pcbPolicy != NULL, "pcbPolicy == NULL\n"); + ok(pContext != NULL, "pContext == NULL\n"); + ok(cbContext == sizeof(struct CONFIRMSAFETY), "cbContext = %d\n", cbContext); + ok(!dwReserved, "dwReserved = %x\n", dwReserved); + + /* TODO: CLSID */ + ok(cs->pUnk != NULL, "cs->pUnk == NULL\n"); + ok(!cs->dwFlags, "dwFlags = %x\n", cs->dwFlags); + + if(FAILED(QueryCustomPolicy_hres)) + return QueryCustomPolicy_hres; + + ret = CoTaskMemAlloc(QueryCustomPolicy_psize); + *ppPolicy = (BYTE*)ret; + *pcbPolicy = QueryCustomPolicy_psize; + memset(ret, 0, QueryCustomPolicy_psize); + if(QueryCustomPolicy_psize >= sizeof(DWORD)) + *ret = QueryCustomPolicy_policy; + + return QueryCustomPolicy_hres; +} + +static const IInternetHostSecurityManagerVtbl InternetHostSecurityManagerVtbl = { + InternetHostSecurityManager_QueryInterface, + InternetHostSecurityManager_AddRef, + InternetHostSecurityManager_Release, + InternetHostSecurityManager_GetSecurityId, + InternetHostSecurityManager_ProcessUrlAction, + InternetHostSecurityManager_QueryCustomPolicy +}; + +static IInternetHostSecurityManager InternetHostSecurityManager = { &InternetHostSecurityManagerVtbl }; + +static IServiceProvider ServiceProvider; + +static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface) +{ + return 2; +} + +static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface) +{ + return 1; +} + +static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, + REFGUID guidService, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&SID_GetCaller, guidService)) + return E_NOINTERFACE; + + if(IsEqualGUID(&SID_SInternetHostSecurityManager, guidService)) { + if(iface == &ServiceProvider) + CHECK_EXPECT(Host_QS_SecMgr); + else + CHECK_EXPECT(Caller_QS_SecMgr); + ok(IsEqualGUID(&IID_IInternetHostSecurityManager, riid), "unexpected riid %s\n", debugstr_guid(riid)); + if(SUCCEEDED(QS_SecMgr_hres)) + *ppv = &InternetHostSecurityManager; + return QS_SecMgr_hres; + } + + ok(0, "unexpected service %s\n", debugstr_guid(guidService)); + return E_NOINTERFACE; +} + +static IServiceProviderVtbl ServiceProviderVtbl = { + ServiceProvider_QueryInterface, + ServiceProvider_AddRef, + ServiceProvider_Release, + ServiceProvider_QueryService +}; + +static IServiceProvider ServiceProvider = { &ServiceProviderVtbl }; +static IServiceProvider caller_sp = { &ServiceProviderVtbl }; + +static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = iface; + }else if(IsEqualGUID(&IID_IActiveScriptSite, riid)) { + *ppv = iface; + }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { + *ppv = &ServiceProvider; + }else { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface) +{ + return 2; +} + +static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface) +{ + return 1; +} + +static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid) +{ + *plcid = GetUserDefaultLCID(); + return S_OK; +} + +static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, + DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti) +{ + ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask); + ok(!ppti, "ppti != NULL\n"); + ok(!strcmp_wa(pstrName, "test"), "pstrName = %s\n", wine_dbgstr_w(pstrName)); + + *ppiunkItem = (IUnknown*)&globalObj; + return S_OK; +} + +static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, + const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface) +{ + return E_NOTIMPL; +} + +#undef ACTSCPSITE_THIS + +static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl = { + ActiveScriptSite_QueryInterface, + ActiveScriptSite_AddRef, + ActiveScriptSite_Release, + ActiveScriptSite_GetLCID, + ActiveScriptSite_GetItemInfo, + ActiveScriptSite_GetDocVersionString, + ActiveScriptSite_OnScriptTerminate, + ActiveScriptSite_OnStateChange, + ActiveScriptSite_OnScriptError, + ActiveScriptSite_OnEnterScript, + ActiveScriptSite_OnLeaveScript +}; + +static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }; + +static void set_safety_options(IUnknown *unk) +{ + IObjectSafety *safety; + DWORD supported, enabled; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety); + ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres); + if(FAILED(hres)) + return; + + hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, + INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER, + INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER); + ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres); + + supported = enabled = 0xdeadbeef; + hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled); + ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres); + ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), + "supported=%x\n", supported); + ok(enabled == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), + "enabled=%x\n", enabled); + + IObjectSafety_Release(safety); +} + +#define parse_script_a(p,s) _parse_script_a(__LINE__,p,s) +static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const char *script) +{ + BSTR str; + HRESULT hres; + + str = a2bstr(script); + hres = IActiveScriptParse64_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + SysFreeString(str); + ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres); +} + +static IActiveScriptParse *create_script(void) +{ + IActiveScriptParse *parser; + IActiveScript *script; + HRESULT hres; + + QS_SecMgr_hres = S_OK; + ProcessUrlAction_hres = S_OK; + ProcessUrlAction_policy = URLPOLICY_ALLOW; + CreateInstance_hres = S_OK; + QueryCustomPolicy_hres = S_OK; + QueryCustomPolicy_psize = sizeof(DWORD); + QueryCustomPolicy_policy = URLPOLICY_ALLOW; + QI_IDispatch_hres = S_OK; + SetSite_hres = S_OK; + + hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + &IID_IActiveScript, (void**)&script); + ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + if(FAILED(hres)) + return NULL; + + set_safety_options((IUnknown*)script); + + hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + + hres = IActiveScriptParse64_InitNew(parser); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + + hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + + hres = IActiveScript_AddNamedItem(script, testW, + SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); + ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + + IActiveScript_Release(script); + + parse_script_a(parser, + "function testException(func, type, number) {\n" + "try {\n" + " func();\n" + "}catch(e) {\n" + " ok(e.name === type, 'e.name = ' + e.name + ', expected ' + type)\n" + " ok(e.number === number, 'e.number = ' + e.number + ', expected ' + number);\n" + " return;\n" + "}" + "ok(false, 'exception expected');\n" + "}"); + + return parser; +} + +static IDispatchEx *parse_procedure_a(IActiveScriptParse *parser, const char *src) +{ + IActiveScriptParseProcedure2 *parse_proc; + IDispatchEx *dispex; + IDispatch *disp; + BSTR str; + HRESULT hres; + + hres = IUnknown_QueryInterface(parser, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc); + ok(hres == S_OK, "Coult not get IActiveScriptParseProcedure2: %08x\n", hres); + + str = a2bstr(src); + hres = IActiveScriptParseProcedure2_64_ParseProcedureText(parse_proc, str, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, &disp); + SysFreeString(str); + IUnknown_Release(parse_proc); + ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres); + ok(disp != NULL, "disp == NULL\n"); + + hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + IDispatch_Release(dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres); + + return dispex; +} + +#define call_procedure(p,c) _call_procedure(__LINE__,p,c) +static void _call_procedure(unsigned line, IDispatchEx *proc, IServiceProvider *caller) +{ + DISPPARAMS dp = {NULL,NULL,0,0}; + EXCEPINFO ei = {0}; + HRESULT hres; + + hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, NULL, &ei, caller); + ok_(__FILE__,line)(hres == S_OK, "InvokeEx failed: %08x\n", hres); + +} + +static void test_ActiveXObject(void) +{ + IActiveScriptParse *parser; + IDispatchEx *proc; + + parser = create_script(); + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(reportSuccess); + parse_script_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(reportSuccess); + + proc = parse_procedure_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); + + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(reportSuccess); + call_procedure(proc, NULL); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(reportSuccess); + + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(reportSuccess); + call_procedure(proc, &caller_sp); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(reportSuccess); + + IDispatchEx_Release(proc); + IUnknown_Release(parser); + + parser = create_script(); + proc = parse_procedure_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(reportSuccess); + call_procedure(proc, &caller_sp); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(reportSuccess); + + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.TestABC'); }, 'Error', -2146827859);"); + + IDispatchEx_Release(proc); + IUnknown_Release(parser); + + parser = create_script(); + QS_SecMgr_hres = E_NOINTERFACE; + + SET_EXPECT(Host_QS_SecMgr); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + + IUnknown_Release(parser); + + parser = create_script(); + ProcessUrlAction_hres = E_FAIL; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + + IUnknown_Release(parser); + + parser = create_script(); + ProcessUrlAction_policy = URLPOLICY_DISALLOW; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + + IUnknown_Release(parser); + + parser = create_script(); + CreateInstance_hres = E_FAIL; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + + IUnknown_Release(parser); + + parser = create_script(); + QueryCustomPolicy_hres = E_FAIL; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + + IUnknown_Release(parser); + + parser = create_script(); + QueryCustomPolicy_psize = 6; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(reportSuccess); + parse_script_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(reportSuccess); + + IUnknown_Release(parser); + + parser = create_script(); + QueryCustomPolicy_policy = URLPOLICY_DISALLOW; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + + QueryCustomPolicy_psize = 6; + + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + + QueryCustomPolicy_policy = URLPOLICY_ALLOW; + QueryCustomPolicy_psize = 3; + + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + + IUnknown_Release(parser); + + parser = create_script(); + object_with_site = &ObjectWithSite; + + SET_EXPECT(Host_QS_SecMgr); + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(SetSite); + SET_EXPECT(reportSuccess); + parse_script_a(parser, "(new ActiveXObject('Wine.Test')).reportSuccess();"); + CHECK_CALLED(Host_QS_SecMgr); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(SetSite); + CHECK_CALLED(reportSuccess); + + SetSite_hres = E_FAIL; + SET_EXPECT(ProcessUrlAction); + SET_EXPECT(CreateInstance); + SET_EXPECT(QueryCustomPolicy); + SET_EXPECT(QI_IObjectWithSite); + SET_EXPECT(SetSite); + parse_script_a(parser, "testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"); + CHECK_CALLED(ProcessUrlAction); + CHECK_CALLED(CreateInstance); + CHECK_CALLED(QueryCustomPolicy); + CHECK_CALLED(QI_IObjectWithSite); + CHECK_CALLED(SetSite); + + IUnknown_Release(parser); +} + +static BOOL init_key(const char *key_name, const char *def_value, BOOL init) +{ + HKEY hkey; + DWORD res; + + if(!init) { + RegDeleteKey(HKEY_CLASSES_ROOT, key_name); + return TRUE; + } + + res = RegCreateKeyA(HKEY_CLASSES_ROOT, key_name, &hkey); + if(res != ERROR_SUCCESS) + return FALSE; + + if(def_value) + res = RegSetValueA(hkey, NULL, REG_SZ, def_value, strlen(def_value)); + + RegCloseKey(hkey); + + return res == ERROR_SUCCESS; +} + +static BOOL init_registry(BOOL init) +{ + return init_key("Wine.Test\\CLSID", TESTOBJ_CLSID, init); +} + +static BOOL register_activex(void) +{ + DWORD regid; + HRESULT hres; + + if(!init_registry(TRUE)) { + init_registry(FALSE); + return FALSE; + } + + hres = CoRegisterClassObject(&CLSID_TestObj, (IUnknown *)&activex_cf, + CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®id); + ok(hres == S_OK, "Could not register screipt engine: %08x\n", hres); + + return TRUE; +} + +static BOOL check_jscript(void) +{ + IActiveScriptParse *parser; + BSTR str; + HRESULT hres; + + parser = create_script(); + if(!parser) + return FALSE; + + str = a2bstr("if(!('localeCompare' in String.prototype)) throw 1;"); + hres = IActiveScriptParse64_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + SysFreeString(str); + IUnknown_Release(parser); + + return hres == S_OK; +} + +START_TEST(activex) +{ + CoInitialize(NULL); + + if(check_jscript()) { + register_activex(); + + test_ActiveXObject(); + + init_registry(FALSE); + }else { + win_skip("Broken engine, probably too old\n"); + } + + CoUninitialize(); +} Propchange: trunk/rostests/winetests/jscript/activex.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
============================================================================== --- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -57,6 +57,47 @@ ok(tmp === "undefined", "encodeURI() = " + tmp); tmp = encodeURI("abc", "test"); ok(tmp === "abc", "encodeURI('abc') = " + tmp); + +tmp = encodeURIComponent("abc"); +ok(tmp === "abc", "encodeURIComponent('abc') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "abc", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("{abc}"); +ok(tmp === "%7Babc%7D", "encodeURIComponent('{abc}') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "{abc}", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent(""); +ok(tmp === "", "encodeURIComponent('') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("\01\02\03\04"); +ok(tmp === "%01%02%03%04", "encodeURIComponent('\\01\\02\\03\\04') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "\01\02\03\04", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("{#@}"); +ok(tmp === "%7B%23%40%7D", "encodeURIComponent('{#@}') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "{#@}", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("\xa1 "); +ok(tmp === "%C2%A1%20", "encodeURIComponent(\\xa1 ) = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "\xa1 ", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("\xffff"); +ok(tmp.length === 8, "encodeURIComponent('\\xffff').length = " + tmp.length); +dec = decodeURIComponent(tmp); +ok(dec === "\xffff", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent("abcABC123;/?:@&=+$,-_.!~*'()"); +ok(tmp === "abcABC123%3B%2F%3F%3A%40%26%3D%2B%24%2C-_.!~*'()", "encodeURIComponent('abcABC123;/?:@&=+$,-_.!~*'()') = " + tmp); +dec = decodeURIComponent(tmp); +ok(dec === "abcABC123;/?:@&=+$,-_.!~*'()", "decodeURIComponent('" + tmp + "') = " + dec); +tmp = encodeURIComponent(); +ok(tmp === "undefined", "encodeURIComponent() = " + tmp); +tmp = encodeURIComponent("abc", "test"); +ok(tmp === "abc", "encodeURIComponent('abc') = " + tmp); +dec = decodeURIComponent(); +ok(dec === "undefined", "decodeURIComponent() = " + dec); +dec = decodeURIComponent("abc", "test"); +ok(dec === "abc", "decodeURIComponent('abc') = " + dec); tmp = escape("abc"); ok(tmp === "abc", "escape('abc') = " + tmp); @@ -190,6 +231,8 @@ ok(tmp === "", "'abc',charAt(-1) = " + tmp); tmp = "abc".charAt(0,2); ok(tmp === "a", "'abc',charAt(0.2) = " + tmp); +tmp = "abc".charAt(NaN); +ok(tmp === "a", "'abc',charAt(NaN) = " + tmp); tmp = "abc".charCodeAt(0); ok(tmp === 0x61, "'abc'.charCodeAt(0) = " + tmp); @@ -575,6 +618,12 @@ ok(arr[8] === "b", "arr[8] != 'b'"); ok(arr.length === 10, "arr.length != 10"); +arr.pop = Array.prototype.pop; +ok(arr.pop() === false, "arr.pop() !== false"); +ok(arr[8] === "b", "arr[8] !== 'b'"); +ok(arr.pop() === 'b', "arr.pop() !== 'b'"); +ok(arr[8] === undefined, "arr[8] !== undefined"); + arr = [3,4,5]; tmp = arr.pop(); ok(arr.length === 2, "arr.length = " + arr.length); @@ -590,6 +639,11 @@ tmp = arr.pop(); ok(arr.length === 0, "arr.length = " + arr.length); ok(tmp === undefined, "tmp = " + tmp); +arr = new Object(); +arr.pop = Array.prototype.pop; +tmp = arr.pop(); +ok(arr.length === 0, "arr.length = " + arr.length); +ok(tmp === undefined, "tmp = " + tmp); arr = [,,,,,]; tmp = arr.pop(); ok(arr.length === 5, "arr.length = " + arr.length); @@ -611,6 +665,16 @@ tmp = arr.toString("test"); ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); +arr = new Object(); +arr.length = 3; +arr[0] = "aa"; +arr[2] = 2; +arr[7] = 3; +arr.join = Array.prototype.join; +tmp = arr.join(","); +ok(arr.length === 3, "arr.length = " + arr.length); +ok(tmp === "aa,,2", "tmp = " + tmp); + arr = [5,true,2,-1,3,false,"2.5"]; tmp = arr.sort(function(x,y) { return y-x; }); ok(tmp === arr, "tmp !== arr"); @@ -631,6 +695,15 @@ for(var i=0; i < arr.length; i++) ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]); +arr = new Object(); +arr.length = 3; +arr[0] = 1; +arr[2] = "aa"; +arr.sort = Array.prototype.sort; +tmp = arr.sort(); +ok(arr === tmp, "tmp !== arr"); +ok(arr[0]===1 && arr[1]==="aa" && arr[2]===undefined, "arr is sorted incorectly"); + arr = ["1", "2", "3"]; arr.length = 1; ok(arr.length === 1, "arr.length = " + arr.length); @@ -645,8 +718,33 @@ ok(arr === arr.valueOf(), "arr !== arr.valueOf"); arr = [1,2,3]; +tmp = arr.reverse(); +ok(tmp === arr, "tmp !== arr"); +ok(arr.length === 3, "arr.length = " + arr.length); +ok(arr.toString() === "3,2,1", "arr.toString() = " + arr.toString()); + +arr = []; +arr[3] = 5; +arr[5] = 1; +tmp = arr.reverse(); +ok(tmp === arr, "tmp !== arr"); +ok(arr.length === 6, "arr.length = " + arr.length); +ok(arr.toString() === "1,,5,,,", "arr.toString() = " + arr.toString()); + +arr = new Object(); +arr.length = 3; +arr[0] = "aa"; +arr[2] = 2; +arr[7] = 3; +arr.reverse = Array.prototype.reverse; +tmp = arr.reverse(); +ok(tmp === arr, "tmp !== arr"); +ok(arr.length === 3, "arr.length = " + arr.length); +ok(arr[0] === 2 && arr[1] === undefined && arr[2] === "aa", "unexpected array"); + +arr = [1,2,3]; tmp = arr.unshift(0); -ok(tmp === undefined, "[1,2,3].unshift(0) returned " +tmp); +ok(tmp === (invokeVersion < 2 ? undefined : 4), "[1,2,3].unshift(0) returned " +tmp); ok(arr.length === 4, "arr.length = " + arr.length); ok(arr.toString() === "0,1,2,3", "arr.toString() = " + arr.toString()); @@ -654,13 +752,13 @@ arr[0] = 1; arr[2] = 3; tmp = arr.unshift(-1,0); -ok(tmp === undefined, "unshift returned " +tmp); +ok(tmp === (invokeVersion < 2 ? undefined : 5), "unshift returned " +tmp); ok(arr.length === 5, "arr.length = " + arr.length); ok(arr.toString() === "-1,0,1,,3", "arr.toString() = " + arr.toString()); arr = [1,2,3]; tmp = arr.unshift(); -ok(tmp === undefined, "unshift returned " +tmp); +ok(tmp === (invokeVersion < 2 ? undefined : 3), "unshift returned " +tmp); ok(arr.length === 3, "arr.length = " + arr.length); ok(arr.toString() === "1,2,3", "arr.toString() = " + arr.toString()); @@ -669,7 +767,7 @@ arr[0] = 1; arr[1] = 2; tmp = Array.prototype.unshift.call(arr, 0); -ok(tmp === undefined, "unshift returned " +tmp); +ok(tmp === (invokeVersion < 2 ? undefined : 3), "unshift returned " +tmp); ok(arr.length === 3, "arr.length = " + arr.length); ok(arr[0] === 0 && arr[1] === 1 && arr[2] === 2, "unexpected array"); @@ -1374,13 +1472,64 @@ (function () { callTest2.apply(tmp, arguments); })(); function callTest3() { + testThis(this); ok(arguments.length === 0, "arguments.length = " + arguments.length + " expected 0"); } callTest3.call(); +callTest3.call(undefined); +callTest3.call(null); +callTest3.apply(); +callTest3.apply(undefined); +callTest3.apply(null); tmp = Number.prototype.toString.call(3); ok(tmp === "3", "Number.prototype.toString.call(3) = " + tmp); + +var func = new Function("return 3;"); + +tmp = func(); +ok(tmp === 3, "func() = " + tmp); +ok(func.call() === 3, "func.call() = " + tmp); +ok(func.length === 0, "func.length = " + func.length); +tmp = func.toString(); +ok(tmp === "function anonymous() {\nreturn 3;\n}", "func.toString() = " + tmp); + +func = new Function("x", "return x+2;"); +tmp = func(1); +ok(tmp === 3, "func(1) = " + tmp); +tmp = func.toString(); +ok(tmp === "function anonymous(x) {\nreturn x+2;\n}", "func.toString() = " + tmp); + +tmp = (new Function("x ", "return x+2;")).toString(); +ok(tmp === "function anonymous(x ) {\nreturn x+2;\n}", "func.toString() = " + tmp); + +func = new Function("x", "y", "return x+y"); +tmp = func(1,3); +ok(tmp === 4, "func(1,3) = " + tmp); +tmp = func.toString(); +ok(tmp === "function anonymous(x, y) {\nreturn x+y\n}", "func.toString() = " + tmp); + +func = new Function(" x, \ty", "\tz", "return x+y+z;"); +tmp = func(1,3,2); +ok(tmp === 6, "func(1,3,2) = " + tmp); +ok(func.length === 3, "func.length = " + func.length); +tmp = func.toString(); +ok(tmp === "function anonymous( x, \ty, \tz) {\nreturn x+y+z;\n}", "func.toString() = " + tmp); + +func = new Function(); +tmp = func(); +ok(tmp === undefined, "func() = " + tmp); +tmp = func.toString(); +ok(tmp == "function anonymous() {\n\n}", "func.toString() = " + tmp); + +func = (function() { + var tmp = 3; + return new Function("return tmp;"); + })(); +tmp = 2; +tmp = func(); +ok(tmp === 2, "func() = " + tmp); var date = new Date(); @@ -1566,7 +1715,7 @@ ok(err.name === "Error", "err.name = " + err.name); EvalError.prototype.message = "test"; ok(err.toString !== Object.prototype.toString, "err.toString === Object.prototype.toString"); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "Error"), "err.toString() = " + err.toString()); err = new EvalError(); ok(EvalError.prototype.name === "EvalError", "EvalError.prototype.name = " + EvalError.prototype.name); ok(err.name === "EvalError", "err.name = " + err.name); @@ -1574,37 +1723,67 @@ ok(err.message === "", "err.message != ''"); err.message = date; ok(err.message === date, "err.message != date"); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "EvalError: "+err.message), + "err.toString() = " + err.toString()); ok(err.toString !== Object.prototype.toString, "err.toString === Object.prototype.toString"); err = new RangeError(); ok(RangeError.prototype.name === "RangeError", "RangeError.prototype.name = " + RangeError.prototype.name); ok(err.name === "RangeError", "err.name = " + err.name); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "RangeError"), "err.toString() = " + err.toString()); err = new ReferenceError(); ok(ReferenceError.prototype.name === "ReferenceError", "ReferenceError.prototype.name = " + ReferenceError.prototype.name); ok(err.name === "ReferenceError", "err.name = " + err.name); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "ReferenceError"), "err.toString() = " + err.toString()); err = new SyntaxError(); ok(SyntaxError.prototype.name === "SyntaxError", "SyntaxError.prototype.name = " + SyntaxError.prototype.name); ok(err.name === "SyntaxError", "err.name = " + err.name); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "SyntaxError"), "err.toString() = " + err.toString()); err = new TypeError(); ok(TypeError.prototype.name === "TypeError", "TypeError.prototype.name = " + TypeError.prototype.name); ok(err.name === "TypeError", "err.name = " + err.name); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "TypeError"), "err.toString() = " + err.toString()); err = new URIError(); ok(URIError.prototype.name === "URIError", "URIError.prototype.name = " + URIError.prototype.name); ok(err.name === "URIError", "err.name = " + err.name); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "URIError"), "err.toString() = " + err.toString()); err = new Error("message"); ok(err.message === "message", "err.message !== 'message'"); -ok(err.toString() === "[object Error]", "err.toString() = " + err.toString()); +ok(err.toString() === (invokeVersion < 2 ? "[object Error]" : "Error: message"), "err.toString() = " + err.toString()); err = new Error(123); ok(err.number === 123, "err.number = " + err.number); err = new Error(0, "message"); ok(err.number === 0, "err.number = " + err.number); ok(err.message === "message", "err.message = " + err.message); ok(err.description === "message", "err.description = " + err.description); + +tmp = new Object(); +tmp.toString = function() { return "test"; }; + +tmp = Error.prototype.toString.call(tmp); +ok(tmp === "[object Error]", "Error.prototype.toString.call(tmp) = " + tmp); + +err = new Error(); +err.name = null; +ok(err.name === null, "err.name = " + err.name + " expected null"); +if(invokeVersion >= 2) + ok(err.toString() === "null", "err.toString() = " + err.toString()); + +err = new Error(); +err.message = false; +ok(err.message === false, "err.message = " + err.message + " expected false"); +if(invokeVersion >= 2) + ok(err.toString() === "Error: false", "err.toString() = " + err.toString()); + +err = new Error(); +err.message = new Object(); +err.message.toString = function() { return ""; }; +if(invokeVersion >= 2) + ok(err.toString() === "Error", "err.toString() = " + err.toString()); + +err = new Error(); +err.message = undefined; +if(invokeVersion >= 2) + ok(err.toString() === "Error", "err.toString() = " + err.toString()); function exception_test(func, type, number) { ret = ""; @@ -1648,6 +1827,7 @@ exception_test(function() {eval("'unterminated")}, "SyntaxError", -2146827273); exception_test(function() {eval("nonexistingfunc()")}, "TypeError", -2146823281); exception_test(function() {RegExp(/a/, "g");}, "RegExpError", -2146823271); +exception_test(function() {encodeURI('\udcaa');}, "URIError", -2146823264); function testThisExcept(func, number) { exception_test(function() {func.call(new Object())}, "TypeError", number); @@ -1729,6 +1909,10 @@ testArrayHostThis("slice"); testArrayHostThis("splice"); testArrayHostThis("unshift"); +testArrayHostThis("reverse"); +testArrayHostThis("join"); +testArrayHostThis("pop"); +testArrayHostThis("sort"); function testObjectInherit(obj, constr, ts, tls, vo) { ok(obj instanceof Object, "obj is not instance of Object"); @@ -1941,4 +2125,43 @@ ["toString", 0] ]); +ok(ActiveXObject.length == 1, "ActiveXObject.length = " + ActiveXObject.length); +ok(Array.length == 1, "Array.length = " + Array.length); +ok(Boolean.length == 1, "Boolean.length = " + Boolean.length); +ok(CollectGarbage.length == 0, "CollectGarbage.length = " + CollectGarbage.length); +//ok(Date.length == 7, "Date.length = " + Date.length); +ok(Enumerator.length == 7, "Enumerator.length = " + Enumerator.length); +ok(Error.length == 1, "Error.length = " + Error.length); +ok(EvalError.length == 1, "EvalError.length = " + EvalError.length); +ok(Function.length == 1, "Function.length = " + Function.length); +ok(GetObject.length == 2, "GetObject.length = " + GetObject.length); +ok(Number.length == 1, "Number.length = " + Number.length); +ok(Object.length == 0, "Object.length = " + Object.length); +ok(RangeError.length == 1, "RangeError.length = " + RangeError.length); +ok(ReferenceError.length == 1, "ReferenceError.length = " + ReferenceError.length); +ok(RegExp.length == 2, "RegExp.length = " + RegExp.length); +ok(ScriptEngine.length == 0, "ScriptEngine.length = " + ScriptEngine.length); +ok(ScriptEngineBuildVersion.length == 0, + "ScriptEngineBuildVersion.length = " + ScriptEngineBuildVersion.length); +ok(ScriptEngineMajorVersion.length == 0, + "ScriptEngineMajorVersion.length = " + ScriptEngineMajorVersion.length); +ok(ScriptEngineMinorVersion.length == 0, + "ScriptEngineMinorVersion.length = " + ScriptEngineMinorVersion.length); +//ok(String.length == 1, "String.length = " + String.length); +ok(SyntaxError.length == 1, "SyntaxError.length = " + SyntaxError.length); +ok(TypeError.length == 1, "TypeError.length = " + TypeError.length); +ok(URIError.length == 1, "URIError.length = " + URIError.length); +ok(VBArray.length == 1, "VBArray.length = " + VBArray.length); +ok(decodeURI.length == 1, "decodeURI.length = " + decodeURI.length); +ok(decodeURIComponent.length == 1, "decodeURIComponent.length = " + decodeURIComponent.length); +ok(encodeURI.length == 1, "encodeURI.length = " + encodeURI.length); +ok(encodeURIComponent.length == 1, "encodeURIComponent.length = " + encodeURIComponent.length); +ok(escape.length == 1, "escape.length = " + escape.length); +ok(eval.length == 1, "eval.length = " + eval.length); +ok(isFinite.length == 1, "isFinite.length = " + isFinite.length); +ok(isNaN.length == 1, "isNaN.length = " + isNaN.length); +ok(parseFloat.length == 1, "parseFloat.length = " + parseFloat.length); +ok(parseInt.length == 2, "parseInt.length = " + parseInt.length); +ok(unescape.length == 1, "unescape.length = " + unescape.length); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
============================================================================== --- trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -203,37 +203,70 @@ static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }; -static void test_script_dispatch(IActiveScript *script, BOOL initialized) -{ - IDispatchEx *dispex; - IDispatch *disp; +static void test_script_dispatch(IDispatchEx *dispex) +{ + DISPPARAMS dp = {NULL,NULL,0,0}; + EXCEPINFO ei; BSTR str; DISPID id; - HRESULT hres; - - disp = (void*)0xdeadbeef; - hres = IActiveScript_GetScriptDispatch(script, NULL, &disp); - if(!initialized) { - ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres); - ok(!disp, "disp != NULL\n"); - return; - } - - ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); - if(FAILED(hres)) - return; - - ok(disp != NULL, "disp == NULL\n"); - hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); - IDispatch_Release(disp); - ok(hres == S_OK, "Could not get IDispatchEx interface: %08x\n", hres); + VARIANT v; + HRESULT hres; str = a2bstr("ActiveXObject"); hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); SysFreeString(str); ok(hres == S_OK, "GetDispID failed: %08x\n", hres); - IDispatchEx_Release(dispex); + str = a2bstr("Math"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + + memset(&ei, 0, sizeof(ei)); + hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); + VariantClear(&v); + + str = a2bstr("String"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08x\n", hres); + + memset(&ei, 0, sizeof(ei)); + hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n"); + VariantClear(&v); +} + +static IDispatchEx *get_script_dispatch(IActiveScript *script) +{ + IDispatchEx *dispex; + IDispatch *disp; + HRESULT hres; + + disp = (void*)0xdeadbeef; + hres = IActiveScript_GetScriptDispatch(script, NULL, &disp); + ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + + IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); + IDispatch_Release(disp); + ok(hres == S_OK, "Could not get IDispatch iface: %08x\n", hres); + return dispex; +} + +static void test_no_script_dispatch(IActiveScript *script) +{ + IDispatch *disp; + HRESULT hres; + + disp = (void*)0xdeadbeef; + hres = IActiveScript_GetScriptDispatch(script, NULL, &disp); + ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres); + ok(!disp, "disp != NULL\n"); } static void test_safety(IUnknown *unk) @@ -295,10 +328,54 @@ IObjectSafety_Release(safety); } +static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *val) +{ + IActiveScriptProperty *script_prop; + HRESULT hres; + + hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty, + (void**)&script_prop); + ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08x\n", hres); + + hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val); + IActiveScriptProperty_Release(script_prop); + return hres; +} + +static void test_invoke_versioning(IActiveScript *script) +{ + VARIANT v; + HRESULT hres; + + V_VT(&v) = VT_NULL; + hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); + if(hres == E_NOTIMPL) { + win_skip("SCRIPTPROP_INVOKESTRING not supported\n"); + return; + } + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + + V_VT(&v) = VT_I2; + V_I2(&v) = 0; + hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + + V_VT(&v) = VT_I4; + V_I4(&v) = 16; + hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); + ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + + V_VT(&v) = VT_I4; + V_I4(&v) = 2; + hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); + ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); +} + static void test_jscript(void) { IActiveScriptParse *parse; IActiveScript *script; + IDispatchEx *dispex; IUnknown *unk; ULONG ref; HRESULT hres; @@ -322,6 +399,7 @@ test_state(script, SCRIPTSTATE_UNINITIALIZED); test_safety(unk); + test_invoke_versioning(script); hres = IActiveScriptParse64_InitNew(parse); ok(hres == S_OK, "InitNew failed: %08x\n", hres); @@ -333,7 +411,7 @@ ok(hres == E_POINTER, "SetScriptSite failed: %08x, expected E_POINTER\n", hres); test_state(script, SCRIPTSTATE_UNINITIALIZED); - test_script_dispatch(script, FALSE); + test_no_script_dispatch(script); SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); @@ -347,7 +425,8 @@ hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres); - test_script_dispatch(script, TRUE); + dispex = get_script_dispatch(script); + test_script_dispatch(dispex); SET_EXPECT(OnStateChange_STARTED); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); @@ -362,7 +441,9 @@ CHECK_CALLED(OnStateChange_CLOSED); test_state(script, SCRIPTSTATE_CLOSED); - test_script_dispatch(script, FALSE); + test_no_script_dispatch(script); + test_script_dispatch(dispex); + IDispatchEx_Release(dispex); IUnknown_Release(parse); IActiveScript_Release(script); @@ -430,7 +511,7 @@ CHECK_CALLED(OnStateChange_CLOSED); test_state(script, SCRIPTSTATE_CLOSED); - test_script_dispatch(script, FALSE); + test_no_script_dispatch(script); IUnknown_Release(parse); IActiveScript_Release(script); Modified: trunk/rostests/winetests/jscript/jscript.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
============================================================================== --- trunk/rostests/winetests/jscript/jscript.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/jscript.rbuild [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -3,13 +3,15 @@ <group> <module name="jscript_winetest" type="win32cui" installbase="bin" installname="jscript_winetest.exe" allowwarnings="true"> <include base="jscript_winetest">.</include> - <define name="__ROS_LONG64__" /> + <define name="__ROS_LONG64__" /> + <file>activex.c</file> <file>jscript.c</file> <file>run.c</file> <file>testlist.c</file> <file>rsrc.rc</file> <library>wine</library> <library>ole32</library> + <library>advapi32</library> <library>oleaut32</library> <library>ntdll</library> </module> Modified: trunk/rostests/winetests/jscript/lang.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/lang.js…
============================================================================== --- trunk/rostests/winetests/jscript/lang.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/lang.js [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -109,8 +109,14 @@ ok(testFunc1(true, "test") === true, "testFunc1 not returned true"); +tmp = (function() {1;})(); +ok(tmp === undefined, "tmp = " + tmp); +tmp = eval("1;"); +ok(tmp === 1, "tmp = " + tmp); + var obj1 = new Object(); ok(typeof(obj1) === "object", "typeof(obj1) is not object"); +ok(obj1.constructor === Object, "unexpected obj1.constructor"); obj1.test = true; obj1.func = function () { ok(this === obj1, "this is not obj1"); @@ -139,6 +145,7 @@ var obj2 = new testConstr1(true); ok(typeof(obj2) === "object", "typeof(obj2) is not object"); +ok(obj2.constructor === testConstr1, "unexpected obj2.constructor"); ok(obj2.pvar === 1, "obj2.pvar is not 1"); testConstr1.prototype.pvar = 2; @@ -147,6 +154,21 @@ obj2.pvar = 3; testConstr1.prototype.pvar = 1; ok(obj2.pvar === 3, "obj2.pvar is not 3"); + +obj1 = new Object(); +function testConstr3() { + return obj1; +} + +obj2 = new testConstr3(); +ok(obj1 === obj2, "obj1 != obj2"); + +function testConstr4() { + return 2; +} + +obj2 = new testConstr3(); +ok(typeof(obj2) === "object", "typeof(obj2) = " + typeof(obj2)); var obj3 = new Object; ok(typeof(obj3) === "object", "typeof(obj3) is not object"); @@ -189,6 +211,7 @@ var obj3 = { prop1: 1, prop2: typeof(false) }; ok(obj3.prop1 === 1, "obj3.prop1 is not 1"); ok(obj3.prop2 === "boolean", "obj3.prop2 is not \"boolean\""); +ok(obj3.constructor === Object, "unexpected obj3.constructor"); { var blockVar = 1; @@ -326,6 +349,15 @@ ok(tmp === -3, "-3.5 | 0 !== -3"); ok(getVT(tmp) === "VT_I4", "getVT(3.5|0) = " + getVT(tmp)); +tmp = 0 | NaN; +ok(tmp === 0, "0 | NaN = " + tmp); + +tmp = 0 | Infinity; +ok(tmp === 0, "0 | NaN = " + tmp); + +tmp = 0 | (-Infinity); +ok(tmp === 0, "0 | NaN = " + tmp); + tmp = 10; ok((tmp |= 0x10) === 26, "tmp(10) |= 0x10 !== 26"); ok(getVT(tmp) === "VT_I4", "getVT(tmp |= 10) = " + getVT(tmp)); @@ -359,6 +391,9 @@ tmp = -64 >>> 4; ok(tmp === 0x0ffffffc, "-64 >>> 4 = " + tmp); + +tmp = 4 >>> NaN; +ok(tmp === 4, "4 >>> NaN = " + tmp); tmp = 10; ok((tmp &= 8) === 8, "tmp(10) &= 8 !== 8"); @@ -390,8 +425,10 @@ tmp = new Number(1); ok(+tmp === 1, "+(new Number(1)) = " + (+tmp)); +ok(tmp.constructor === Number, "unexpected tmp.constructor"); tmp = new String("1"); ok(+tmp === 1, "+(new String('1')) = " + (+tmp)); +ok(tmp.constructor === String, "unexpected tmp.constructor"); ok("" + 0 === "0", "\"\" + 0 !== \"0\""); ok("" + 123 === "123", "\"\" + 123 !== \"123\""); @@ -831,6 +868,13 @@ obj = [1,2,3]; ok((1 in obj) === true, "1 is not in obj"); +obj = new Object(); +try { + obj.prop["test"]; + ok(false, "expected exception"); +}catch(e) {} +ok(!("prop" in obj), "prop in obj"); + ok(isNaN(NaN) === true, "isNaN(NaN) !== true"); ok(isNaN(0.5) === false, "isNaN(0.5) !== false"); ok(isNaN(Infinity) === false, "isNaN(Infinity) !== false"); @@ -933,6 +977,11 @@ var re = /=(\?|%3F)/g; ok(re.source === "=(\\?|%3F)", "re.source = " + re.source); + +tmp = new Array(); +for(var i=0; i<2; i++) + tmp[i] = /b/; +ok(tmp[0] != tmp[1], "tmp[0] == tmp [1]"); ok(createNullBSTR() === '', "createNullBSTR() !== ''"); @@ -969,4 +1018,10 @@ (function() { newValue = 1; })(); ok(newValue === 1, "newValue = " + newValue); +obj = {undefined: 3}; + +/* Keep this test in the end of file */ +undefined = 6; +ok(undefined === 6, "undefined = " + undefined); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/regexp.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/regexp.…
============================================================================== --- trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -17,7 +17,7 @@ */ -var m, re, b; +var m, re, b, i, obj; re = /a+/; ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); @@ -70,6 +70,11 @@ m = re.exec(); ok(m === null, "m is not null"); ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +m = /(a|b)+|(c)/.exec("aa"); +ok(m[0] === "aa", "m[0] = " + m[0]); +ok(m[1] === "a", "m[1] = " + m[1]); +ok(m[2] === "", "m[2] = " + m[2]); b = re.test(" a "); ok(b === true, "re.test(' a ') returned " + b); @@ -91,10 +96,12 @@ b = /a*/.test(); ok(b === true, "/a*/.test() returned " + b); -m = "abcabc".match(/ca/); +m = "abcabc".match(re = /ca/); ok(typeof(m) === "object", "typeof m is not object"); ok(m.length === 1, "m.length is not 1"); ok(m["0"] === "ca", "m[0] is not \"ca\""); +ok(m.constructor === Array, "unexpected m.constructor"); +ok(re.lastIndex === 4, "re.lastIndex = " + re.lastIndex); m = "abcabc".match(/ab/); ok(typeof(m) === "object", "typeof m is not object"); @@ -160,8 +167,9 @@ m = "abcabc".match(); ok(m === null, "m is not null"); -r = "- [test] -".replace(/\[([^\[]+)\]/g, "success"); +r = "- [test] -".replace(re = /\[([^\[]+)\]/g, "success"); ok(r === "- success -", "r = " + r + " expected '- success -'"); +ok(re.lastIndex === 8, "re.lastIndex = " + re.lastIndex); r = "[test] [test]".replace(/\[([^\[]+)\]/g, "aa"); ok(r === "aa aa", "r = " + r + "aa aa"); @@ -280,6 +288,41 @@ ok(r[0] === "1", "r[0] = " + r[0]); ok(r[1] === "2", "r[1] = " + r[1]); +re = /,+/; +r = "1,,2,".split(re); +ok(r.length === 2, "r.length = " + r.length); +ok(r[0] === "1", "r[0] = " + r[0]); +ok(r[1] === "2", "r[1] = " + r[1]); +ok(re.lastIndex === 5, "re.lastIndex = " + re.lastIndex); + +re = /,+/g; +r = "1,,2,".split(re); +ok(r.length === 2, "r.length = " + r.length); +ok(r[0] === "1", "r[0] = " + r[0]); +ok(r[1] === "2", "r[1] = " + r[1]); +ok(re.lastIndex === 5, "re.lastIndex = " + re.lastIndex); + +r = "1 12 \t3".split(re = /\s+/).join(";"); +ok(r === "1;12;3", "r = " + r); +ok(re.lastIndex === 6, "re.lastIndex = " + re.lastIndex); + +r = "123".split(re = /\s+/).join(";"); +ok(r === "123", "r = " + r); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +/* another standard violation */ +r = "1 12 \t3".split(re = /(\s)+/g).join(";"); +ok(r === "1;12;3", "r = " + r); +ok(re.lastIndex === 6, "re.lastIndex = " + re.lastIndex); + +re = /,+/; +re.lastIndex = 4; +r = "1,,2,".split(re); +ok(r.length === 2, "r.length = " + r.length); +ok(r[0] === "1", "r[0] = " + r[0]); +ok(r[1] === "2", "r[1] = " + r[1]); +ok(re.lastIndex === 5, "re.lastIndex = " + re.lastIndex); + re = /abc[^d]/g; ok(re.source === "abc[^d]", "re.source = '" + re.source + "', expected 'abc[^d]'"); @@ -298,4 +341,117 @@ re = /abc/; ok(re === RegExp(re, undefined, 1), "re !== RegExp(re, undefined, 1)"); +re = /a/g; +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex + " expected 0"); + +m = re.exec(" a "); +ok(re.lastIndex === 2, "re.lastIndex = " + re.lastIndex + " expected 2"); +ok(m.index === 1, "m.index = " + m.index + " expected 1"); + +m = re.exec(" a "); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex + " expected 0"); +ok(m === null, "m = " + m + " expected null"); + +re.lastIndex = 2; +m = re.exec(" a a "); +ok(re.lastIndex === 4, "re.lastIndex = " + re.lastIndex + " expected 4"); +ok(m.index === 3, "m.index = " + m.index + " expected 3"); + +re.lastIndex = "2"; +ok(re.lastIndex === "2", "re.lastIndex = " + re.lastIndex + " expected '2'"); +m = re.exec(" a a "); +ok(re.lastIndex === 4, "re.lastIndex = " + re.lastIndex + " expected 4"); +ok(m.index === 3, "m.index = " + m.index + " expected 3"); + +var li = 0; +var obj = new Object(); +obj.valueOf = function() { return li; }; + +re.lastIndex = obj; +ok(re.lastIndex === obj, "re.lastIndex = " + re.lastIndex + " expected obj"); +li = 2; +m = re.exec(" a a "); +ok(re.lastIndex === 2, "re.lastIndex = " + re.lastIndex + " expected 2"); +ok(m.index === 1, "m.index = " + m.index + " expected 1"); + +re.lastIndex = 3; +re.lastIndex = "test"; +ok(re.lastIndex === "test", "re.lastIndex = " + re.lastIndex + " expected 'test'"); +m = re.exec(" a a "); +ok(re.lastIndex === 2 || re.lastIndex === 0, "re.lastIndex = " + re.lastIndex + " expected 2 or 0"); +if(re.lastIndex != 0) + ok(m.index === 1, "m.index = " + m.index + " expected 1"); +else + ok(m === null, "m = " + m + " expected null"); + +re.lastIndex = 0; +re.lastIndex = 3.9; +ok(re.lastIndex === 3.9, "re.lastIndex = " + re.lastIndex + " expected 3.9"); +m = re.exec(" a a "); +ok(re.lastIndex === 4, "re.lastIndex = " + re.lastIndex + " expected 4"); +ok(m.index === 3, "m.index = " + m.index + " expected 3"); + +obj.valueOf = function() { throw 0; } +re.lastIndex = obj; +ok(re.lastIndex === obj, "unexpected re.lastIndex"); +m = re.exec(" a a "); +ok(re.lastIndex === 2, "re.lastIndex = " + re.lastIndex + " expected 2"); +ok(m.index === 1, "m.index = " + m.index + " expected 1"); + +re.lastIndex = -3; +ok(re.lastIndex === -3, "re.lastIndex = " + re.lastIndex + " expected -3"); +m = re.exec(" a a "); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex + " expected 0"); +ok(m === null, "m = " + m + " expected null"); + +re.lastIndex = -1; +ok(re.lastIndex === -1, "re.lastIndex = " + re.lastIndex + " expected -1"); +m = re.exec(" "); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex + " expected 0"); +ok(m === null, "m = " + m + " expected null"); + +re = /aa/g; +i = 'baacd'.search(re); +ok(i === 1, "'baacd'.search(re) = " + i); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); + +re.lastIndex = 2; +i = 'baacdaa'.search(re); +ok(i === 1, "'baacd'.search(re) = " + i); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); + +re = /aa/; +i = 'baacd'.search(re); +ok(i === 1, "'baacd'.search(re) = " + i); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); + +re.lastIndex = 2; +i = 'baacdaa'.search(re); +ok(i === 1, "'baacd'.search(re) = " + i); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); + +re = /d/g; +re.lastIndex = 1; +i = 'abc'.search(re); +ok(i === -1, "'abc'.search(/d/g) = " + i); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +i = 'abcdde'.search(/[df]/); +ok(i === 3, "'abc'.search(/[df]/) = " + i); + +i = 'abcdde'.search(/[df]/, "a"); +ok(i === 3, "'abc'.search(/[df]/) = " + i); + +i = 'abcdde'.search("[df]"); +ok(i === 3, "'abc'.search(/d*/) = " + i); + +obj = { + toString: function() { return "abc"; } +}; +i = String.prototype.search.call(obj, "b"); +ok(i === 1, "String.prototype.seatch.apply(obj, 'b') = " + i); + +i = " undefined ".search(); +ok(i === null, "' undefined '.search() = " + i); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/run.c?r…
============================================================================== --- trunk/rostests/winetests/jscript/run.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/run.c [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -81,6 +81,7 @@ #define DISPID_GLOBAL_NULL_DISP 0x1008 #define DISPID_GLOBAL_TESTTHIS 0x1009 #define DISPID_GLOBAL_TESTTHIS2 0x100a +#define DISPID_GLOBAL_INVOKEVERSION 0x100b #define DISPID_TESTOBJ_PROP 0x2000 @@ -92,6 +93,7 @@ static BOOL strict_dispid_check; static const char *test_name = "(null)"; static IDispatch *script_disp; +static int invoke_version; static BSTR a2bstr(const char *str) { @@ -110,6 +112,13 @@ CHAR buf[512]; WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0); return lstrcmpA(buf, stra); +} + +#define test_grfdex(a,b) _test_grfdex(__LINE__,a,b) +static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect) +{ + expect |= invoke_version << 28; + ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect); } static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -205,13 +214,13 @@ { if(!strcmp_wa(bstrName, "prop")) { CHECK_EXPECT(testobj_prop_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_TESTOBJ_PROP; return S_OK; } if(!strcmp_wa(bstrName, "noprop")) { CHECK_EXPECT(testobj_noprop_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); return DISP_E_UNKNOWNNAME; } @@ -250,7 +259,7 @@ CHECK_EXPECT(testobj_delete); ok(!strcmp_wa(bstrName, "deleteTest"), "unexpected name %s\n", wine_dbgstr_w(bstrName)); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); return S_OK; } @@ -277,40 +286,40 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!strcmp_wa(bstrName, "ok")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_OK; return S_OK; } if(!strcmp_wa(bstrName, "trace")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TRACE; return S_OK; } if(!strcmp_wa(bstrName, "reportSuccess")) { CHECK_EXPECT(global_success_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_REPORTSUCCESS; return S_OK; } if(!strcmp_wa(bstrName, "testPropGet")) { CHECK_EXPECT(global_propget_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TESTPROPGET; return S_OK; } if(!strcmp_wa(bstrName, "testPropPut")) { CHECK_EXPECT(global_propput_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TESTPROPPUT; return S_OK; } if(!strcmp_wa(bstrName, "getVT")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_GETVT; return S_OK; } if(!strcmp_wa(bstrName, "testObj")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TESTOBJ; return S_OK; } @@ -324,19 +333,25 @@ } if(!strcmp_wa(bstrName, "notExists")) { CHECK_EXPECT(global_notexists_d); - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); return DISP_E_UNKNOWNNAME; } if(!strcmp_wa(bstrName, "testThis")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TESTTHIS; return S_OK; } if(!strcmp_wa(bstrName, "testThis2")) { - ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_TESTTHIS2; + return S_OK; + } + + if(!strcmp_wa(bstrName, "invokeVersion")) { + test_grfdex(grfdex, fdexNameCaseSensitive); + *pid = DISPID_GLOBAL_INVOKEVERSION; return S_OK; } @@ -536,6 +551,23 @@ ok(V_DISPATCH(pdp->rgvarg) == script_disp, "disp != script_disp\n"); return S_OK; + + case DISPID_GLOBAL_INVOKEVERSION: + ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgvarg, "rgvarg != NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes != NULL, "pvarRes == NULL\n"); + ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); + ok(pei != NULL, "pei == NULL\n"); + + V_VT(pvarRes) = VT_I4; + V_I4(pvarRes) = invoke_version; + + return S_OK; + } ok(0, "unexpected call %x\n", id); @@ -657,19 +689,44 @@ static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }; +static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *val) +{ + IActiveScriptProperty *script_prop; + HRESULT hres; + + hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty, + (void**)&script_prop); + ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08x\n", hres); + + hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val); + IActiveScriptProperty_Release(script_prop); + + return hres; +} + static IActiveScript *create_script(void) { IActiveScript *script; + VARIANT v; HRESULT hres; hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&script); ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); + V_VT(&v) = VT_I4; + V_I4(&v) = invoke_version; + hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v); + ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres); + if(invoke_version && FAILED(hres)) { + IActiveScript_Release(script); + return NULL; + } + return script; } -static void parse_script(DWORD flags, BSTR script_str) +static HRESULT parse_script(DWORD flags, BSTR script_str) { IActiveScriptParse *parser; IActiveScript *engine; @@ -677,14 +734,14 @@ engine = create_script(); if(!engine) - return; + return S_OK; hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); if (FAILED(hres)) { IActiveScript_Release(engine); - return; + return hres; } hres = IActiveScriptParse64_InitNew(parser); @@ -706,11 +763,12 @@ ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n"); hres = IActiveScriptParse64_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); - ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); IDispatch_Release(script_disp); IActiveScript_Release(engine); IUnknown_Release(parser); + + return hres; } static HRESULT parse_htmlscript(BSTR script_str) @@ -756,9 +814,13 @@ static void parse_script_af(DWORD flags, const char *src) { - BSTR tmp = a2bstr(src); - parse_script(flags, tmp); + BSTR tmp; + HRESULT hres; + + tmp = a2bstr(src); + hres = parse_script(flags, tmp); SysFreeString(tmp); + ok(hres == S_OK, "parse_script failed: %08x\n", hres); } static void parse_script_a(const char *src) @@ -816,14 +878,17 @@ static void run_from_file(const char *filename) { - BSTR script_str = get_script_from_file(filename); + BSTR script_str; + HRESULT hres; + + script_str = get_script_from_file(filename); + if(!script_str) + return; strict_dispid_check = FALSE; - - if(script_str) - parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str); - + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str); SysFreeString(script_str); + ok(hres == S_OK, "parse_script failed: %08x\n", hres); } static void run_from_res(const char *name) @@ -832,6 +897,7 @@ DWORD size, len; BSTR str; HRSRC src; + HRESULT hres; strict_dispid_check = FALSE; test_name = name; @@ -848,10 +914,11 @@ SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); - parse_script(SCRIPTITEM_GLOBALMEMBERS, str); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, str); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); + ok(hres == S_OK, "parse_script failed: %08x\n", hres); SysFreeString(str); } @@ -911,6 +978,17 @@ static void run_tests(void) { HRESULT hres; + + if(invoke_version) { + IActiveScript *script; + + script = create_script(); + if(!script) { + win_skip("Could not create script\n"); + return; + } + IActiveScript_Release(script); + } strict_dispid_check = TRUE; @@ -1010,6 +1088,18 @@ ok(hres != S_OK, "ParseScriptText have not failed\n"); } +static BOOL check_jscript(void) +{ + BSTR str; + HRESULT hres; + + str = a2bstr("if(!('localeCompare' in String.prototype)) throw 1;"); + hres = parse_script(0, str); + SysFreeString(str); + + return hres == S_OK; +} + START_TEST(run) { int argc; @@ -1019,10 +1109,19 @@ CoInitialize(NULL); - if(argc > 2) + if(!check_jscript()) { + win_skip("Broken engine, probably too old\n"); + }else if(argc > 2) { run_from_file(argv[2]); - else + }else { + trace("invoke version 0\n"); + invoke_version = 0; run_tests(); + trace("invoke version 2\n"); + invoke_version = 2; + run_tests(); + } + CoUninitialize(); } Modified: trunk/rostests/winetests/jscript/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/testlis…
============================================================================== --- trunk/rostests/winetests/jscript/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/testlist.c [iso-8859-1] Tue Mar 2 20:52:22 2010 @@ -6,11 +6,13 @@ #define STANDALONE #include "wine/test.h" +extern void func_activex(void); extern void func_jscript(void); extern void func_run(void); const struct test winetest_testlist[] = { + { "activex", func_activex }, { "jscript", func_jscript }, { "run", func_run }, { 0, 0 }
14 years, 9 months
1
0
0
0
[cwittich] 45766: [PSDK] sync dispex.idl to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Mar 2 20:50:41 2010 New Revision: 45766 URL:
http://svn.reactos.org/svn/reactos?rev=45766&view=rev
Log: [PSDK] sync dispex.idl to wine 1.1.39 Modified: trunk/reactos/include/psdk/dispex.idl Modified: trunk/reactos/include/psdk/dispex.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dispex.idl?re…
============================================================================== --- trunk/reactos/include/psdk/dispex.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/dispex.idl [iso-8859-1] Tue Mar 2 20:50:41 2010 @@ -22,6 +22,9 @@ import "oaidl.idl"; import "servprov.idl"; #endif + +cpp_quote("DEFINE_GUID(SID_VariantConversion, 0x1f101481,0xbccd,0x11d0,0x93,0x36,0x00,0xa0,0xc9,0xd,0xca,0xa9);") +cpp_quote("DEFINE_GUID(SID_GetCaller, 0x4717cc40,0xbcb9,0x11d0,0x93,0x36,0x00,0xa0,0xc9,0xd,0xca,0xa9);") cpp_quote("#define fdexNameCaseSensitive 0x00000001L") cpp_quote("#define fdexNameEnsure 0x00000002L")
14 years, 9 months
1
0
0
0
[cwittich] 45765: [JSCRIPT] sync jscript to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Mar 2 20:46:01 2010 New Revision: 45765 URL:
http://svn.reactos.org/svn/reactos?rev=45765&view=rev
Log: [JSCRIPT] sync jscript to wine 1.1.39 Added: trunk/reactos/dll/win32/jscript/jscript_Ko.rc (with props) trunk/reactos/dll/win32/jscript/jscript_Ru.rc (with props) Modified: trunk/reactos/dll/win32/jscript/activex.c trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/date.c trunk/reactos/dll/win32/jscript/dispex.c trunk/reactos/dll/win32/jscript/engine.c trunk/reactos/dll/win32/jscript/engine.h trunk/reactos/dll/win32/jscript/error.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jscript.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/jscript.inf trunk/reactos/dll/win32/jscript/jscript_De.rc trunk/reactos/dll/win32/jscript/jscript_En.rc trunk/reactos/dll/win32/jscript/jscript_Fr.rc trunk/reactos/dll/win32/jscript/jscript_Lt.rc trunk/reactos/dll/win32/jscript/jsutils.c trunk/reactos/dll/win32/jscript/lex.c trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/parser.tab.c trunk/reactos/dll/win32/jscript/parser.tab.h trunk/reactos/dll/win32/jscript/parser.y trunk/reactos/dll/win32/jscript/regexp.c trunk/reactos/dll/win32/jscript/resource.h trunk/reactos/dll/win32/jscript/rsrc.rc trunk/reactos/dll/win32/jscript/string.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/jscript/activex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/activex.…
Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
Modified: trunk/reactos/dll/win32/jscript/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/date.c?r…
Modified: trunk/reactos/dll/win32/jscript/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/dispex.c…
Modified: trunk/reactos/dll/win32/jscript/engine.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.c…
Modified: trunk/reactos/dll/win32/jscript/engine.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.h…
Modified: trunk/reactos/dll/win32/jscript/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/error.c?…
Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
Modified: trunk/reactos/dll/win32/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Added: trunk/reactos/dll/win32/jscript/jscript_Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Added: trunk/reactos/dll/win32/jscript/jscript_Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsutils.…
Modified: trunk/reactos/dll/win32/jscript/lex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/lex.c?re…
Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.y…
Modified: trunk/reactos/dll/win32/jscript/regexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.c…
Modified: trunk/reactos/dll/win32/jscript/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/resource…
Modified: trunk/reactos/dll/win32/jscript/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/rsrc.rc?…
Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
14 years, 9 months
1
0
0
0
[cwittich] 45764: [SHDOCVW] sync shdocvw to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Mar 2 20:38:02 2010 New Revision: 45764 URL:
http://svn.reactos.org/svn/reactos?rev=45764&view=rev
Log: [SHDOCVW] sync shdocvw to wine 1.1.39 Modified: trunk/reactos/dll/win32/shdocvw/dochost.c trunk/reactos/dll/win32/shdocvw/intshcut.c trunk/reactos/dll/win32/shdocvw/oleobject.c trunk/reactos/dll/win32/shdocvw/shdocvw.h trunk/reactos/dll/win32/shdocvw/shdocvw.inf trunk/reactos/dll/win32/shdocvw/shdocvw_main.c trunk/reactos/dll/win32/shdocvw/webbrowser.c Modified: trunk/reactos/dll/win32/shdocvw/dochost.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/dochost.…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/dochost.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/dochost.c [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -362,6 +362,29 @@ This->document = NULL; } +void release_dochost_client(DocHost *This) +{ + if(This->hwnd) { + DestroyWindow(This->hwnd); + This->hwnd = NULL; + } + + if(This->hostui) { + IDocHostUIHandler_Release(This->hostui); + This->hostui = NULL; + } + + if(This->client_disp) { + IDispatch_Release(This->client_disp); + This->client_disp = NULL; + } + + if(This->frame) { + IOleInPlaceFrame_Release(This->frame); + This->frame = NULL; + } +} + #define OLECMD_THIS(iface) DEFINE_THIS(DocHost, OleCommandTarget, iface) static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface, @@ -387,8 +410,13 @@ const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) { DocHost *This = OLECMD_THIS(iface); + ULONG i= 0; FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText); + while (prgCmds && (cCmds > i)) { + FIXME("command_%u: %u, 0x%x\n", i, prgCmds[i].cmdID, prgCmds[i].cmdf); + i++; + } return E_NOTIMPL; } @@ -744,14 +772,10 @@ void DocHost_Release(DocHost *This) { - if(This->client_disp) - IDispatch_Release(This->client_disp); - if(This->frame) - IOleInPlaceFrame_Release(This->frame); - + release_dochost_client(This); DocHost_ClientSite_Release(This); ConnectionPointContainer_Destroy(&This->cps); - SysFreeString(This->url); -} + CoTaskMemFree(This->url); +} Modified: trunk/reactos/dll/win32/shdocvw/intshcut.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/intshcut…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/intshcut.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/intshcut.c [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -65,16 +65,51 @@ return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, persistFile)); } -static BOOL StartLinkProcessor(LPCOLESTR szLink) -{ - static const WCHAR szFormat[] = { - 'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e', - ' ','-','w',' ','-','u',' ','"','%','s','"',0 }; +static BOOL run_winemenubuilder( const WCHAR *args ) +{ + static const WCHAR menubuilder[] = {'\\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0}; LONG len; LPWSTR buffer; STARTUPINFOW si; PROCESS_INFORMATION pi; BOOL ret; + WCHAR app[MAX_PATH]; + + GetSystemDirectoryW( app, MAX_PATH - sizeof(menubuilder)/sizeof(WCHAR) ); + strcatW( app, menubuilder ); + + len = (strlenW( app ) + strlenW( args ) + 1) * sizeof(WCHAR); + buffer = heap_alloc( len ); + if( !buffer ) + return FALSE; + + strcpyW( buffer, app ); + strcatW( buffer, args ); + + TRACE("starting %s\n",debugstr_w(buffer)); + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + + ret = CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + + heap_free( buffer ); + + if (ret) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + + return ret; +} + +static BOOL StartLinkProcessor( LPCOLESTR szLink ) +{ + static const WCHAR szFormat[] = { ' ','-','w',' ','-','u',' ','"','%','s','"',0 }; + LONG len; + LPWSTR buffer; + BOOL ret; len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR); buffer = heap_alloc( len ); @@ -82,22 +117,8 @@ return FALSE; wsprintfW( buffer, szFormat, szLink ); - - TRACE("starting %s\n",debugstr_w(buffer)); - - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - - ret = CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); - - HeapFree( GetProcessHeap(), 0, buffer ); - - if (ret) - { - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - } - + ret = run_winemenubuilder( buffer ); + heap_free( buffer ); return ret; } Modified: trunk/reactos/dll/win32/shdocvw/oleobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/oleobjec…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/oleobject.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/oleobject.c [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -255,6 +255,36 @@ return S_OK; } +static void release_client_site(WebBrowser *This) +{ + release_dochost_client(&This->doc_host); + + if(This->shell_embedding_hwnd) { + DestroyWindow(This->shell_embedding_hwnd); + This->shell_embedding_hwnd = NULL; + } + + if(This->inplace) { + IOleInPlaceSite_Release(This->inplace); + This->inplace = NULL; + } + + if(This->container) { + IOleContainer_Release(This->container); + This->container = NULL; + } + + if(This->uiwindow) { + IOleInPlaceUIWindow_Release(This->uiwindow); + This->uiwindow = NULL; + } + + if(This->client) { + IOleClientSite_Release(This->client); + This->client = NULL; + } +} + /********************************************************************** * Implement the IOleObject interface for the WebBrowser control */ @@ -282,7 +312,9 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite) { WebBrowser *This = OLEOBJ_THIS(iface); + IDocHostUIHandler *hostui; IOleContainer *container; + IDispatch *disp; HRESULT hres; TRACE("(%p)->(%p)\n", This, pClientSite); @@ -290,29 +322,7 @@ if(This->client == pClientSite) return S_OK; - if(This->doc_host.hwnd) { - DestroyWindow(This->doc_host.hwnd); - This->doc_host.hwnd = NULL; - } - if(This->shell_embedding_hwnd) { - DestroyWindow(This->shell_embedding_hwnd); - This->shell_embedding_hwnd = NULL; - } - - if(This->inplace) { - IOleInPlaceSite_Release(This->inplace); - This->inplace = NULL; - } - - if(This->doc_host.hostui) { - IDocHostUIHandler_Release(This->doc_host.hostui); - This->doc_host.hostui = NULL; - } - - if(This->client) - IOleClientSite_Release(This->client); - - This->client = pClientSite; + release_client_site(This); if(!pClientSite) { if(This->doc_host.document) @@ -321,12 +331,17 @@ } IOleClientSite_AddRef(pClientSite); - - IOleClientSite_QueryInterface(This->client, &IID_IDispatch, - (void**)&This->doc_host.client_disp); - - IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler, - (void**)&This->doc_host.hostui); + This->client = pClientSite; + + hres = IOleClientSite_QueryInterface(This->client, &IID_IDispatch, + (void**)&disp); + if(SUCCEEDED(hres)) + This->doc_host.client_disp = disp; + + hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler, + (void**)&hostui); + if(SUCCEEDED(hres)) + This->doc_host.hostui = hostui; hres = IOleClientSite_GetContainer(This->client, &container); if(SUCCEEDED(hres)) { @@ -963,10 +978,5 @@ void WebBrowser_OleObject_Destroy(WebBrowser *This) { - if(This->client) - IOleObject_SetClientSite(OLEOBJ(This), NULL); - if(This->container) - IOleContainer_Release(This->container); - if(This->uiwindow) - IOleInPlaceUIWindow_Release(This->uiwindow); -} + release_client_site(This); +} Modified: trunk/reactos/dll/win32/shdocvw/shdocvw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw.…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/shdocvw.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/shdocvw.h [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -205,6 +205,7 @@ void DocHost_Init(DocHost*,IDispatch*); void DocHost_ClientSite_Init(DocHost*); void DocHost_Frame_Init(DocHost*); +void release_dochost_client(DocHost*); void DocHost_Release(DocHost*); void DocHost_ClientSite_Release(DocHost*); @@ -251,6 +252,8 @@ HRESULT register_class_object(BOOL); HRESULT get_typeinfo(ITypeInfo**); DWORD register_iexplore(BOOL); + +const char *debugstr_variant(const VARIANT*); /* memory allocation functions */ Modified: trunk/reactos/dll/win32/shdocvw/shdocvw.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw.…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/shdocvw.inf [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/shdocvw.inf [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -34,10 +34,10 @@ HKCR,"CLSID\%CLSID_SearchAssistantOC%\InProcServer32","ThreadingModel",,"Apartment" HKCR,"CLSID\%CLSID_SearchAssistantOC%\ProgID",,,"SearchAssistantOC.SearchAssistantOC.1" HKCR,"CLSID\%CLSID_SearchAssistantOC%\VersionIndependentProgID",,,"SearchAssistantOC.SearchAssistantOC" -HKCR,"SearchAssistantOC.SearchAssistantOC",,,"" +HKCR,"SearchAssistantOC.SearchAssistantOC",,,"SearchAssistantOC" HKCR,"SearchAssistantOC.SearchAssistantOC\CLSID",,,"%CLSID_SearchAssistantOC%" HKCR,"SearchAssistantOC.SearchAssistantOC\CurVer",,,"SearchAssistantOC.SearchAssistantOC.1" -HKCR,"SearchAssistantOC.SearchAssistantOC.1",,,"" +HKCR,"SearchAssistantOC.SearchAssistantOC.1",,,"SearchAssistantOC" HKCR,"SearchAssistantOC.SearchAssistantOC.1\CLSID",,,"%CLSID_SearchAssistantOC%" HKCR,"CLSID\%CLSID_ShellNameSpace%",,,"Shell Name Space" @@ -67,7 +67,7 @@ HKCR,"Shell.UIHelper",,,"Microsoft Shell UI Helper" HKCR,"Shell.UIHelper\CLSID",,,"%CLSID_ShellUIHelper%" HKCR,"Shell.UIHelper\CurVer",,,"Shell.UIHelper.2" -HKCR,"Shell.UIHelper.1",,,"" +HKCR,"Shell.UIHelper.1",,,"Microsoft Shell UI Helper" HKCR,"Shell.UIHelper.1\CLSID",,,"%CLSID_ShellUIHelper%" HKCR,"CLSID\%CLSID_Internet%\DefaultIcon",,,"shdoclc.dll,-190" @@ -86,7 +86,7 @@ HKCR,"Shell.Explorer",,,"Microsoft Web Browser" HKCR,"Shell.Explorer\CLSID",,,"%CLSID_WebBrowser%" HKCR,"Shell.Explorer\CurVer",,,"Shell.Explorer.2" -HKCR,"Shell.Explorer.2",,,"" +HKCR,"Shell.Explorer.2",,,"Microsoft Web Browser" HKCR,"Shell.Explorer.2\CLSID",,,"%CLSID_WebBrowser%" HKCR,"CLSID\%CLSID_ShellWindows%",,,"ShellWindows" @@ -108,14 +108,14 @@ HKCR,"CLSID\%CLSID_WebBrowser_V1%\InProcServer32","ThreadingModel",,"Apartment" HKCR,"CLSID\%CLSID_WebBrowser_V1%\ProgID",,,"Shell.Explorer.1" HKCR,"CLSID\%CLSID_WebBrowser_V1%\VersionIndependentProgID",,,"Shell.Explorer" -HKCR,"Shell.Explorer.1",,,"" +HKCR,"Shell.Explorer.1",,,"Microsoft Web Browser" HKCR,"Shell.Explorer.1\CLSID",,,"%CLSID_WebBrowser_V1%" HKCR,"CLSID\%CLSID_InternetShortcut%",,,"Internet Shortcut" HKCR,"CLSID\%CLSID_InternetShortcut%\InProcServer32",,,"%MODULE%" HKCR,"CLSID\%CLSID_InternetShortcut%\InProcServer32","ThreadingModel",,"Apartment" HKCR,"CLSID\%CLSID_InternetShortcut%\ProgID",,,"InternetShortcut" -HKCR,"CLSID\%CLSID_InternetShortcut%\shellex\MayChangeDefaultMenu",,, +HKCR,"CLSID\%CLSID_InternetShortcut%\shellex\MayChangeDefaultMenu",,16 HKCR,"InternetShortcut",,,"Internet Shortcut" HKCR,"InternetShortcut","EditFlags",2,"2" HKCR,"InternetShortcut","IsShortcut",, Modified: trunk/reactos/dll/win32/shdocvw/shdocvw_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw_…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -65,6 +65,31 @@ *typeinfo = wb_typeinfo; return hres; +} + +const char *debugstr_variant(const VARIANT *v) +{ + if(!v) + return "(null)"; + + switch(V_VT(v)) { + case VT_EMPTY: + return "{VT_EMPTY}"; + case VT_NULL: + return "{VT_NULL}"; + case VT_I4: + return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); + case VT_R8: + return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); + case VT_BSTR: + return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v))); + case VT_DISPATCH: + return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); + case VT_BOOL: + return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); + default: + return wine_dbg_sprintf("{vt %d}", V_VT(v)); + } } /************************************************************************* Modified: trunk/reactos/dll/win32/shdocvw/webbrowser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/webbrows…
============================================================================== --- trunk/reactos/dll/win32/shdocvw/webbrowser.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shdocvw/webbrowser.c [iso-8859-1] Tue Mar 2 20:38:02 2010 @@ -269,8 +269,9 @@ { WebBrowser *This = WEBBROWSER_THIS(iface); - TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags, TargetFrameName, - PostData, Headers); + TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(szUrl), debugstr_variant(Flags), + debugstr_variant(TargetFrameName), debugstr_variant(PostData), + debugstr_variant(Headers)); return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers); } @@ -285,7 +286,7 @@ static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%p)\n", This, Level); + FIXME("(%p)->(%s)\n", This, debugstr_variant(Level)); return E_NOTIMPL; } @@ -516,22 +517,28 @@ static HRESULT WINAPI WebBrowser_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty)); + FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(&vtValue)); return E_NOTIMPL; } static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue); + FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(pvtValue)); return E_NOTIMPL; } static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name) { - WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%p)\n", This, Name); - return E_NOTIMPL; + static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b', + ' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0}; + WebBrowser *This = WEBBROWSER_THIS(iface); + + TRACE("(%p)->(%p)\n", This, Name); + + *Name = SysAllocString(sName); + + return S_OK; } static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND) @@ -726,7 +733,8 @@ WebBrowser *This = WEBBROWSER_THIS(iface); LPCWSTR url; - TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName, PostData, Headers); + TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_variant(URL), debugstr_variant(Flags), + debugstr_variant(TargetFrameName), debugstr_variant(PostData), debugstr_variant(Headers)); if(!This->client) return E_FAIL; @@ -761,7 +769,7 @@ OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut); + FIXME("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt, debugstr_variant(pvaIn), pvaOut); return E_NOTIMPL; } @@ -769,7 +777,8 @@ VARIANT *pvarShow, VARIANT *pvarSize) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize); + FIXME("(%p)->(%s %s %s)\n", This, debugstr_variant(pvaClsid), debugstr_variant(pvarShow), + debugstr_variant(pvarSize)); return E_NOTIMPL; }
14 years, 9 months
1
0
0
0
[cwittich] 45763: [SHDOCLC] sync shdoclc to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Tue Mar 2 20:37:13 2010 New Revision: 45763 URL:
http://svn.reactos.org/svn/reactos?rev=45763&view=rev
Log: [SHDOCLC] sync shdoclc to wine 1.1.39 Added: trunk/reactos/dll/win32/shdoclc/Lt.rc (with props) trunk/reactos/dll/win32/shdoclc/Ro.rc (with props) trunk/reactos/dll/win32/shdoclc/Uk.rc (with props) Modified: trunk/reactos/dll/win32/shdoclc/Bg.rc trunk/reactos/dll/win32/shdoclc/Da.rc trunk/reactos/dll/win32/shdoclc/De.rc trunk/reactos/dll/win32/shdoclc/En.rc trunk/reactos/dll/win32/shdoclc/Es.rc trunk/reactos/dll/win32/shdoclc/Fi.rc trunk/reactos/dll/win32/shdoclc/Fr.rc trunk/reactos/dll/win32/shdoclc/Hu.rc trunk/reactos/dll/win32/shdoclc/Ko.rc trunk/reactos/dll/win32/shdoclc/Nl.rc trunk/reactos/dll/win32/shdoclc/No.rc trunk/reactos/dll/win32/shdoclc/Pt.rc trunk/reactos/dll/win32/shdoclc/Ru.rc trunk/reactos/dll/win32/shdoclc/Si.rc trunk/reactos/dll/win32/shdoclc/Sv.rc trunk/reactos/dll/win32/shdoclc/Tr.rc trunk/reactos/dll/win32/shdoclc/Zh.rc trunk/reactos/dll/win32/shdoclc/rsrc.rc trunk/reactos/dll/win32/shdoclc/shdoclc.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/shdoclc/Bg.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Bg.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Da.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/De.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/En.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Es.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Es.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Fi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Fi.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Fr.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Hu.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Hu.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Ko.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Ko.rc?re…
Added: trunk/reactos/dll/win32/shdoclc/Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Lt.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Nl.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/No.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/No.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Pt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Pt.rc?re…
Added: trunk/reactos/dll/win32/shdoclc/Ro.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Ro.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Ru.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Si.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Sv.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Tr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Tr.rc?re…
Added: trunk/reactos/dll/win32/shdoclc/Uk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Uk.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/Zh.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/Zh.rc?re…
Modified: trunk/reactos/dll/win32/shdoclc/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/rsrc.rc?…
Modified: trunk/reactos/dll/win32/shdoclc/shdoclc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdoclc/shdoclc.…
14 years, 9 months
1
0
0
0
[tkreuzer] 45762: [KDBG] - Fix attaching to processes (registers / backtraces)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Mar 2 20:04:15 2010 New Revision: 45762 URL:
http://svn.reactos.org/svn/reactos?rev=45762&view=rev
Log: [KDBG] - Fix attaching to processes (registers / backtraces) Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=45…
============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Tue Mar 2 20:04:15 2010 @@ -209,7 +209,7 @@ RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME)); StackPtr = (ULONG_PTR *) KernelStack; -#if _M_X86_ +#ifdef _M_IX86 KdbTrapFrame->Tf.Ebp = StackPtr[3]; KdbTrapFrame->Tf.Edi = StackPtr[4]; KdbTrapFrame->Tf.Esi = StackPtr[5];
14 years, 9 months
1
0
0
0
[dgorbachev] 45761: [Kernel32] Print maximum 128 frames. Some formatting changes.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Tue Mar 2 19:16:21 2010 New Revision: 45761 URL:
http://svn.reactos.org/svn/reactos?rev=45761&view=rev
Log: [Kernel32] Print maximum 128 frames. Some formatting changes. Modified: trunk/reactos/dll/win32/kernel32/except/except.c Modified: trunk/reactos/dll/win32/kernel32/except/except.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/except/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/except/except.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/except/except.c [iso-8859-1] Tue Mar 2 19:16:21 2010 @@ -204,6 +204,68 @@ return Ret; } +static VOID +PrintStackTrace(struct _EXCEPTION_POINTERS *ExceptionInfo) +{ + PVOID StartAddr; + CHAR szMod[128] = ""; + PEXCEPTION_RECORD ExceptionRecord = ExceptionInfo->ExceptionRecord; + PCONTEXT ContextRecord = ExceptionInfo->ContextRecord; + + /* Print a stack trace. */ + DbgPrint("Unhandled exception\n"); + DbgPrint("ExceptionCode: %8x\n", ExceptionRecord->ExceptionCode); + + if ((NTSTATUS)ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION && + ExceptionRecord->NumberParameters == 2) + { + DbgPrint("Faulting Address: %8x\n", ExceptionRecord->ExceptionInformation[1]); + } + + _dump_context (ContextRecord); + _module_name_from_addr(ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod)); + DbgPrint("Address:\n %8x+%-8x %s\n", + (PVOID)StartAddr, + (ULONG_PTR)ExceptionRecord->ExceptionAddress - (ULONG_PTR)StartAddr, + szMod); +#ifdef _M_IX86 + DbgPrint("Frames:\n"); + + _SEH2_TRY + { + UINT i; + PULONG Frame = (PULONG)ContextRecord->Ebp; + + for (i = 0; Frame[1] != 0 && Frame[1] != 0xdeadbeef && i < 128; i++) + { + if (IsBadReadPtr((PVOID)Frame[1], 4)) + { + DbgPrint(" %8x%9s %s\n", Frame[1], "<invalid address>"," "); + } + else + { + _module_name_from_addr((const void*)Frame[1], &StartAddr, + szMod, sizeof(szMod)); + DbgPrint(" %8x+%-8x %s\n", + (PVOID)StartAddr, + (ULONG_PTR)Frame[1] - (ULONG_PTR)StartAddr, + szMod); + } + + if (IsBadReadPtr((PVOID)Frame[0], sizeof(*Frame) * 2)) + break; + + Frame = (PULONG)Frame[0]; + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + DbgPrint("<error dumping stack trace: 0x%x>\n", _SEH2_GetExceptionCode()); + } + _SEH2_END; +#endif +} + /* * @implemented */ @@ -215,17 +277,18 @@ NTSTATUS ErrCode; ULONG ErrorParameters[4]; ULONG ErrorResponse; - - if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION && - ExceptionInfo->ExceptionRecord->NumberParameters >= 2) - { - switch(ExceptionInfo->ExceptionRecord->ExceptionInformation[0]) + PEXCEPTION_RECORD ExceptionRecord = ExceptionInfo->ExceptionRecord; + + if ((NTSTATUS)ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION && + ExceptionRecord->NumberParameters >= 2) + { + switch(ExceptionRecord->ExceptionInformation[0]) { case EXCEPTION_WRITE_FAULT: /* Change the protection on some write attempts, some InstallShield setups have this bug */ RetValue = BasepCheckForReadOnlyResource( - (PVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[1]); + (PVOID)ExceptionRecord->ExceptionInformation[1]); if (RetValue == EXCEPTION_CONTINUE_EXECUTION) return EXCEPTION_CONTINUE_EXECUTION; break; @@ -253,79 +316,30 @@ if (GlobalTopLevelExceptionFilter) { - LONG ret = GlobalTopLevelExceptionFilter( ExceptionInfo ); + LONG ret = GlobalTopLevelExceptionFilter(ExceptionInfo); if (ret != EXCEPTION_CONTINUE_SEARCH) return ret; } if ((GetErrorMode() & SEM_NOGPFAULTERRORBOX) == 0) - { -#ifdef _X86_ - PULONG Frame; -#endif - PVOID StartAddr; - CHAR szMod[128] = ""; - - /* Print a stack trace. */ - DbgPrint("Unhandled exception\n"); - DbgPrint("ExceptionCode: %8x\n", ExceptionInfo->ExceptionRecord->ExceptionCode); - if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION && - ExceptionInfo->ExceptionRecord->NumberParameters == 2) - { - DbgPrint("Faulting Address: %8x\n", ExceptionInfo->ExceptionRecord->ExceptionInformation[1]); - } - _dump_context ( ExceptionInfo->ContextRecord ); - _module_name_from_addr(ExceptionInfo->ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod)); - DbgPrint("Address:\n %8x+%-8x %s\n", - (PVOID)StartAddr, (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress - - (ULONG_PTR)StartAddr, szMod); - -#ifdef _X86_ - DbgPrint("Frames:\n"); - _SEH2_TRY - { - Frame = (PULONG)ExceptionInfo->ContextRecord->Ebp; - while (Frame[1] != 0 && Frame[1] != 0xdeadbeef) - { - if (IsBadReadPtr((PVOID)Frame[1], 4)) { - DbgPrint(" %8x%9s %s\n", Frame[1], "<invalid address>"," "); - } else { - _module_name_from_addr((const void*)Frame[1], &StartAddr, - szMod, sizeof(szMod)); - DbgPrint(" %8x+%-8x %s\n", - (PVOID)StartAddr, - (ULONG_PTR)Frame[1] - (ULONG_PTR)StartAddr, szMod); - } - if (IsBadReadPtr((PVOID)Frame[0], sizeof(*Frame) * 2)) { - break; - } - Frame = (PULONG)Frame[0]; - } - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - DbgPrint("<error dumping stack trace: 0x%x>\n", _SEH2_GetExceptionCode()); - } - _SEH2_END; -#endif - } + PrintStackTrace(ExceptionInfo); /* Save exception code and address */ - ErrorParameters[0] = (ULONG)ExceptionInfo->ExceptionRecord->ExceptionCode; - ErrorParameters[1] = (ULONG)ExceptionInfo->ExceptionRecord->ExceptionAddress; - - if ((NTSTATUS)ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION) + ErrorParameters[0] = (ULONG)ExceptionRecord->ExceptionCode; + ErrorParameters[1] = (ULONG)ExceptionRecord->ExceptionAddress; + + if ((NTSTATUS)ExceptionRecord->ExceptionCode == STATUS_ACCESS_VIOLATION) { /* get the type of operation that caused the access violation */ - ErrorParameters[2] = ExceptionInfo->ExceptionRecord->ExceptionInformation[0]; + ErrorParameters[2] = ExceptionRecord->ExceptionInformation[0]; } else { - ErrorParameters[2] = ExceptionInfo->ExceptionRecord->ExceptionInformation[2]; + ErrorParameters[2] = ExceptionRecord->ExceptionInformation[2]; } /* Save faulting address */ - ErrorParameters[3] = ExceptionInfo->ExceptionRecord->ExceptionInformation[1]; + ErrorParameters[3] = ExceptionRecord->ExceptionInformation[1]; /* Raise the harderror */ ErrCode = NtRaiseHardError(STATUS_UNHANDLED_EXCEPTION | 0x10000000,
14 years, 9 months
1
0
0
0
[janderwald] 45760: [PORTCLS] - Add support for IPort interface
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Mar 2 17:48:28 2010 New Revision: 45760 URL:
http://svn.reactos.org/svn/reactos?rev=45760&view=rev
Log: [PORTCLS] - Add support for IPort interface Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp [iso-8859-1] Tue Mar 2 17:48:28 2010 @@ -161,8 +161,9 @@ DPRINT("IPortWavePci_fnQueryInterface entered\n"); - if (IsEqualGUIDAligned(refiid, IID_IPortWavePci) || - IsEqualGUIDAligned(refiid, IID_IUnknown)) + if (IsEqualGUIDAligned(refiid, IID_IPortWavePci) || + IsEqualGUIDAligned(refiid, IID_IUnknown) || + IsEqualGUIDAligned(refiid, IID_IPort)) { *Output = PVOID(PPORTWAVEPCI(this)); PUNKNOWN(*Output)->AddRef(); @@ -171,7 +172,7 @@ else if (IsEqualGUIDAligned(refiid, IID_IServiceSink)) { *Output = PVOID(PSERVICESINK(this)); - PUNKNOWN(*Output)->AddRef(); + PUNKNOWN(*Output)->AddRef(); return STATUS_SUCCESS; } else if (IsEqualGUIDAligned(refiid, IID_IPortEvents)) @@ -183,7 +184,7 @@ else if (IsEqualGUIDAligned(refiid, IID_ISubdevice)) { *Output = PVOID(PSUBDEVICE(this)); - PUNKNOWN(*Output)->AddRef(); + PUNKNOWN(*Output)->AddRef(); return STATUS_SUCCESS; } else if (IsEqualGUIDAligned(refiid, IID_IPortClsVersion))
14 years, 9 months
1
0
0
0
[janderwald] 45759: [KSPROXY] - Implement IPersistPropertyBag interface - Implement IKsObject interface - Implement enumerating supported property/method/event set from driver and loading the corresponding ksproxy plugins
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Mar 2 17:27:50 2010 New Revision: 45759 URL:
http://svn.reactos.org/svn/reactos?rev=45759&view=rev
Log: [KSPROXY] - Implement IPersistPropertyBag interface - Implement IKsObject interface - Implement enumerating supported property/method/event set from driver and loading the corresponding ksproxy plugins Modified: trunk/reactos/dll/directx/ksproxy/basicaudio.cpp trunk/reactos/dll/directx/ksproxy/clockforward.cpp trunk/reactos/dll/directx/ksproxy/cvpconfig.cpp trunk/reactos/dll/directx/ksproxy/cvpvbiconfig.cpp trunk/reactos/dll/directx/ksproxy/datatype.cpp trunk/reactos/dll/directx/ksproxy/interface.cpp trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild trunk/reactos/dll/directx/ksproxy/precomp.h trunk/reactos/dll/directx/ksproxy/proxy.cpp trunk/reactos/dll/directx/ksproxy/qualityforward.cpp Modified: trunk/reactos/dll/directx/ksproxy/basicaudio.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/basica…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/basicaudio.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/basicaudio.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -8,8 +8,6 @@ */ #include "precomp.h" -const GUID IID_IBasicAudio = {0x56a868b3, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}}; - class CKsBasicAudio : public IBasicAudio, public IDistributorNotify { @@ -99,7 +97,7 @@ STDMETHODCALLTYPE CKsBasicAudio::Stop() { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -107,7 +105,7 @@ STDMETHODCALLTYPE CKsBasicAudio::Pause() { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -116,7 +114,7 @@ CKsBasicAudio::Run( REFERENCE_TIME tStart) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -125,7 +123,7 @@ CKsBasicAudio::SetSyncSource( IReferenceClock *pClock) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -133,7 +131,7 @@ STDMETHODCALLTYPE CKsBasicAudio::NotifyGraphChange() { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -146,7 +144,7 @@ CKsBasicAudio::GetTypeInfoCount( UINT *pctinfo) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -157,7 +155,7 @@ LCID lcid, ITypeInfo **ppTInfo) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -170,7 +168,7 @@ LCID lcid, DISPID *rgDispId) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -186,7 +184,7 @@ EXCEPINFO *pExcepInfo, UINT *puArgErr) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -199,7 +197,7 @@ CKsBasicAudio::put_Volume( long lVolume) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -209,7 +207,7 @@ CKsBasicAudio::get_Volume( long *plVolume) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -219,7 +217,7 @@ CKsBasicAudio::put_Balance( long lBalance) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -229,7 +227,7 @@ CKsBasicAudio::get_Balance( long *plBalance) { - OutputDebugString("UNIMPLEMENTED\n"); + OutputDebugStringW(L"UNIMPLEMENTED\n"); return E_NOTIMPL; } @@ -240,6 +238,8 @@ REFIID riid, LPVOID * ppv) { + OutputDebugStringW(L"CKsBasicAudio_Constructor\n"); + CKsBasicAudio * handler = new CKsBasicAudio(); if (!handler) Modified: trunk/reactos/dll/directx/ksproxy/clockforward.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/clockf…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/clockforward.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/clockforward.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -8,7 +8,6 @@ */ #include "precomp.h" -const GUID IID_IDistributorNotify = {0x56a868af, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}}; const GUID KSCATEGORY_CLOCK = {0x53172480, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; class CKsClockForwarder : public IDistributorNotify, @@ -158,6 +157,8 @@ HRESULT hr; HANDLE handle; + OutputDebugStringW(L"CKsClockForwarder_Constructor\n"); + // open default clock hr = KsOpenDefaultDevice(KSCATEGORY_CLOCK, GENERIC_READ | GENERIC_WRITE, &handle); Modified: trunk/reactos/dll/directx/ksproxy/cvpconfig.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/cvpcon…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/cvpconfig.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/cvpconfig.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -7,8 +7,6 @@ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) */ #include "precomp.h" - -const GUID IID_IVPConfig = {0xbc29a660, 0x30e3, 0x11d0, {0x9e, 0x69, 0x0, 0xc0, 0x4f, 0xd7, 0xc1, 0x5b}}; class CVPConfig : public IVPConfig, public IDistributorNotify @@ -302,6 +300,8 @@ REFIID riid, LPVOID * ppv) { + OutputDebugStringW(L"CVPConfig_Constructor\n"); + CVPConfig * handler = new CVPConfig(); if (!handler) Modified: trunk/reactos/dll/directx/ksproxy/cvpvbiconfig.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/cvpvbi…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/cvpvbiconfig.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/cvpvbiconfig.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -7,8 +7,6 @@ * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) */ #include "precomp.h" - -const GUID IID_IVPVBIConfig = {0xec529b00, 0x1a1f, 0x11d1, {0xba, 0xd9, 0x0, 0x60, 0x97, 0x44, 0x11, 0x1a}}; class CVPVBIConfig : public IVPVBIConfig, public IDistributorNotify @@ -274,6 +272,8 @@ REFIID riid, LPVOID * ppv) { + OutputDebugStringW(L"CVPVBIConfig_Constructor\n"); + CVPVBIConfig * handler = new CVPVBIConfig(); if (!handler) Modified: trunk/reactos/dll/directx/ksproxy/datatype.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/dataty…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/datatype.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/datatype.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -11,9 +11,6 @@ /* FIXME guid mess */ const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; const GUID IID_IClassFactory = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; -const GUID IID_IKsDataTypeHandler = {0x5FFBAA02, 0x49A3, 0x11D0, {0x9F, 0x36, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xA1}}; -const GUID MEDIATYPE_Audio = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}; - class CKsDataTypeHandler : public IKsDataTypeHandler { @@ -138,6 +135,8 @@ REFIID riid, LPVOID * ppv) { + OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n"); + CKsDataTypeHandler * handler = new CKsDataTypeHandler(); if (!handler) Modified: trunk/reactos/dll/directx/ksproxy/interface.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/interf…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/interface.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/interface.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -8,7 +8,6 @@ */ #include "precomp.h" -const GUID IID_IKsInterfaceHandler = {0xD3ABC7E0, 0x9A61, 0x11D0, {0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; const GUID IID_IKsObject = {0x423c13a2, 0x2070, 0x11d0, {0x9e, 0xf7, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}; class CKsInterfaceHandler : public IKsInterfaceHandler @@ -119,6 +118,8 @@ REFIID riid, LPVOID * ppv) { + OutputDebugStringW(L"CKsInterfaceHandler_Constructor\n"); + CKsInterfaceHandler * handler = new CKsInterfaceHandler(); if (!handler) Modified: trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/ksprox…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/ksproxy.rbuild [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -10,7 +10,7 @@ <library>ole32</library> <library>setupapi</library> <library>msvcrt</library> - + <library>strmiids</library> <group compilerset="gcc"> <compilerflag compiler="cxx">-fno-exceptions</compilerflag> <compilerflag compiler="cxx">-fno-rtti</compilerflag> Modified: trunk/reactos/dll/directx/ksproxy/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/precom…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/precomp.h [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -1,5 +1,6 @@ #pragma once +#define _FORCENAMELESSUNION #define BUILDING_KS #define _KSDDK_ #include <dshow.h> @@ -14,8 +15,8 @@ #include <dvp.h> #include <vptype.h> #include <vpconfig.h> - #include <setupapi.h> +#include <vector> //#include <debug.h> typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); Modified: trunk/reactos/dll/directx/ksproxy/proxy.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/proxy.…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -8,15 +8,20 @@ */ #include "precomp.h" +const GUID IID_IPersistPropertyBag = {0x37D84F60, 0x42CB, 0x11CE, {0x81, 0x35, 0x00, 0xAA, 0x00, 0x4B, 0xB8, 0x51}}; +const GUID GUID_NULL = {0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; + /* Needs IKsClock, IKsNotifyEvent */ class CKsProxy : public IBaseFilter, public IAMovieSetup, + public IPersistPropertyBag, + public IKsObject +/* public IPersistStream, public ISpecifyPropertyPages, - public IPersistPropertyBag, public IReferenceClock, public IMediaSeeking, public IKsObject, @@ -27,12 +32,490 @@ public IKsTopology, public IKsAggregateControl, public IAMDeviceRemoval -{ - - +*/ +{ +public: + typedef std::vector<IUnknown *>ProxyPluginVector; + + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + delete this; + return 0; + } + return m_Ref; + } + + // IBaseFilter methods + HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID); + HRESULT STDMETHODCALLTYPE Stop( void); + HRESULT STDMETHODCALLTYPE Pause( void); + HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME tStart); + HRESULT STDMETHODCALLTYPE GetState(DWORD dwMilliSecsTimeout, FILTER_STATE *State); + HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *pClock); + HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock **pClock); + HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins **ppEnum); + HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR Id, IPin **ppPin); + HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO *pInfo); + HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph *pGraph, LPCWSTR pName); + HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR *pVendorInfo); + + //IAMovieSetup methods + HRESULT STDMETHODCALLTYPE Register( void); + HRESULT STDMETHODCALLTYPE Unregister( void); + + // IPersistPropertyBag methods + HRESULT STDMETHODCALLTYPE InitNew( void); + HRESULT STDMETHODCALLTYPE Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog); + HRESULT STDMETHODCALLTYPE Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties); + + // IKsObject + HANDLE STDMETHODCALLTYPE KsGetObjectHandle(); + + CKsProxy() : m_Ref(0), m_pGraph(0), m_ReferenceClock(0), m_FilterState(State_Stopped), m_hDevice(0), m_Plugins(0) {}; + virtual ~CKsProxy() + { + if (m_hDevice) + CloseHandle(m_hDevice); + }; + + HRESULT STDMETHODCALLTYPE GetSupportedSets(LPGUID * pOutGuid, PULONG NumGuids); + HRESULT STDMETHODCALLTYPE LoadProxyPlugins(LPGUID pGuids, ULONG NumGuids); + +protected: + LONG m_Ref; + IFilterGraph *m_pGraph; + IReferenceClock * m_ReferenceClock; + FILTER_STATE m_FilterState; + HANDLE m_hDevice; + ProxyPluginVector m_Plugins; }; - +HRESULT +STDMETHODCALLTYPE +CKsProxy::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + *Output = NULL; + + if (IsEqualGUID(refiid, IID_IUnknown) || + IsEqualGUID(refiid, IID_IBaseFilter)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + else if (IsEqualGUID(refiid, IID_IPersistPropertyBag)) + { + *Output = (IPersistPropertyBag*)(this); + reinterpret_cast<IPersistPropertyBag*>(*Output)->AddRef(); + return NOERROR; + } + if (IsEqualGUID(refiid, IID_IKsObject)) + { + *Output = (IKsObject*)(this); + reinterpret_cast<IKsObject*>(*Output)->AddRef(); + return NOERROR; + } + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CKsProxy::QueryInterface: NoInterface for %s !!!\n", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IKsObject interface +// + +HANDLE +STDMETHODCALLTYPE +CKsProxy::KsGetObjectHandle() +{ + return m_hDevice; +} + +//------------------------------------------------------------------- +// IPersistPropertyBag interface +// +HRESULT +STDMETHODCALLTYPE +CKsProxy::InitNew( void) +{ + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::GetSupportedSets( + LPGUID * pOutGuid, + PULONG NumGuids) +{ + KSPROPERTY Property; + LPGUID pGuid; + ULONG NumProperty = 0; + ULONG NumMethods = 0; + ULONG NumEvents = 0; + ULONG Length; + ULONG BytesReturned; + HRESULT hr; + + Property.Set = GUID_NULL; + Property.Id = 0; + Property.Flags = KSPROPERTY_TYPE_SETSUPPORT; + + KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), NULL, 0, &NumProperty); + KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)&Property, sizeof(KSPROPERTY), NULL, 0, &NumMethods); + KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSPROPERTY), NULL, 0, &NumEvents); + + Length = NumProperty + NumMethods + NumEvents; + + // allocate guid buffer + pGuid = (LPGUID)CoTaskMemAlloc(Length); + if (!pGuid) + { + // failed + return E_OUTOFMEMORY; + } + + NumProperty /= sizeof(GUID); + NumMethods /= sizeof(GUID); + NumEvents /= sizeof(GUID); + + // get all properties + hr = KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)pGuid, Length, &BytesReturned); + if (FAILED(hr)) + { + CoTaskMemFree(pGuid); + return E_FAIL; + } + Length -= BytesReturned; + + // get all methods + if (Length) + { + hr = KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty], Length, &BytesReturned); + if (FAILED(hr)) + { + CoTaskMemFree(pGuid); + return E_FAIL; + } + Length -= BytesReturned; + } + + // get all events + if (Length) + { + hr = KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSPROPERTY), (PVOID)&pGuid[NumProperty+NumMethods], Length, &BytesReturned); + if (FAILED(hr)) + { + CoTaskMemFree(pGuid); + return E_FAIL; + } + Length -= BytesReturned; + } + +#ifdef KSPROXY_TRACE + WCHAR Buffer[200]; + swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents); + OutputDebugStringW(Buffer); +#endif + + *pOutGuid = pGuid; + *NumGuids = NumProperty+NumEvents+NumMethods; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::LoadProxyPlugins( + LPGUID pGuids, + ULONG NumGuids) +{ + ULONG Index; + LPOLESTR pStr; + HKEY hKey, hSubKey; + HRESULT hr; + IUnknown * pUnknown; + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\MediaInterfaces", 0, KEY_READ, &hKey) != ERROR_SUCCESS) + { + OutputDebugStringW(L"CKsProxy::LoadProxyPlugins failed to open MediaInterfaces key\n"); + return E_FAIL; + } + + // enumerate all sets + for(Index = 0; Index < NumGuids; Index++) + { + // convert to string + hr = StringFromCLSID(pGuids[Index], &pStr); + if (FAILED(hr)) + return E_FAIL; + + // now try open class key + if (RegOpenKeyExW(hKey, pStr, 0, KEY_READ, &hSubKey) != ERROR_SUCCESS) + { + // no plugin for that set exists + CoTaskMemFree(pStr); + continue; + } + + // try load plugin + hr = CoCreateInstance(pGuids[Index], (IBaseFilter*)this, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pUnknown); + if (SUCCEEDED(hr)) + { + // store plugin + m_Plugins.push_back(pUnknown); + } + // close key + RegCloseKey(hSubKey); + } + + // close media interfaces key + RegCloseKey(hKey); + return S_OK; +} + + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Load(IPropertyBag *pPropBag, IErrorLog *pErrorLog) +{ + HRESULT hr; + WCHAR Buffer[100]; + VARIANT varName; + LPGUID pGuid; + ULONG NumGuids = 0; + + // read device path + varName.vt = VT_BSTR; + hr = pPropBag->Read(L"DevicePath", &varName, pErrorLog); + + if (FAILED(hr)) + { + swprintf(Buffer, L"CKsProxy::Load Read %lx\n", hr); + OutputDebugStringW(Buffer); + return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); + } + + // open device + m_hDevice = CreateFileW(varName.bstrVal, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); + + if (m_hDevice == INVALID_HANDLE_VALUE) + { + // failed to open device + swprintf(Buffer, L"CKsProxy:: failed to open device with %lx\n", GetLastError()); + OutputDebugStringW(Buffer); + + return MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, GetLastError()); + } + + // get all supported sets + hr = GetSupportedSets(&pGuid, &NumGuids); + if (FAILED(hr)) + { + CloseHandle(m_hDevice); + m_hDevice = NULL; + return hr; + } + + // load all proxy plugins + hr = LoadProxyPlugins(pGuid, NumGuids); + + CloseHandle(m_hDevice); + m_hDevice = NULL; + + + return hr; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Save(IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties) +{ + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IBaseFilter interface +// + +HRESULT +STDMETHODCALLTYPE +CKsProxy::GetClassID( + CLSID *pClassID) +{ + OutputDebugStringW(L"CKsProxy::GetClassID : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Stop() +{ + OutputDebugStringW(L"CKsProxy::Stop : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Pause() +{ + OutputDebugStringW(L"CKsProxy::Pause : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Run( + REFERENCE_TIME tStart) +{ + OutputDebugStringW(L"CKsProxy::Run : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::GetState( + DWORD dwMilliSecsTimeout, + FILTER_STATE *State) +{ + *State = m_FilterState; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::SetSyncSource( + IReferenceClock *pClock) +{ + if (pClock) + { + pClock->AddRef(); + } + + if (m_ReferenceClock) + { + m_ReferenceClock->Release(); + } + + m_ReferenceClock = pClock; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::GetSyncSource( + IReferenceClock **pClock) +{ + if (!pClock) + return E_POINTER; + + if (m_ReferenceClock) + m_ReferenceClock->AddRef(); + + *pClock = m_ReferenceClock; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::EnumPins( + IEnumPins **ppEnum) +{ + OutputDebugStringW(L"CKsProxy::EnumPins : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::FindPin( + LPCWSTR Id, IPin **ppPin) +{ + OutputDebugStringW(L"CKsProxy::FindPin : NotImplemented\n"); + return E_NOTIMPL; +} + + +HRESULT +STDMETHODCALLTYPE +CKsProxy::QueryFilterInfo( + FILTER_INFO *pInfo) +{ + if (!pInfo) + return E_POINTER; + + pInfo->achName[0] = L'\0'; + pInfo->pGraph = m_pGraph; + + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::JoinFilterGraph( + IFilterGraph *pGraph, + LPCWSTR pName) +{ + if (pGraph) + { + // joining filter graph + m_pGraph = pGraph; + } + else + { + // leaving graph + m_pGraph = 0; + } + + OutputDebugStringW(L"CKsProxy::JoinFilterGraph\n"); + return S_OK; +} + + +HRESULT +STDMETHODCALLTYPE +CKsProxy::QueryVendorInfo( + LPWSTR *pVendorInfo) +{ + OutputDebugStringW(L"CKsProxy::QueryVendorInfo : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IAMovieSetup interface +// + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Register() +{ + OutputDebugStringW(L"CKsProxy::Register : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CKsProxy::Unregister() +{ + OutputDebugStringW(L"CKsProxy::Unregister : NotImplemented\n"); + return E_NOTIMPL; +} HRESULT WINAPI @@ -41,6 +524,23 @@ REFIID riid, LPVOID * ppv) { - OutputDebugString("CKsProxy_Constructor UNIMPLEMENTED\n"); - return E_NOTIMPL; -} + WCHAR Buffer[100]; + LPOLESTR pstr; + StringFromCLSID(riid, &pstr); + swprintf(Buffer, L"CKsProxy_Constructor pUnkOuter %p riid %s\n", pUnkOuter, pstr); + OutputDebugStringW(Buffer); + + CKsProxy * handler = new CKsProxy(); + + if (!handler) + return E_OUTOFMEMORY; + + if (FAILED(handler->QueryInterface(riid, ppv))) + { + /* not supported */ + delete handler; + return E_NOINTERFACE; + } + + return S_OK; +} Modified: trunk/reactos/dll/directx/ksproxy/qualityforward.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/qualit…
============================================================================== --- trunk/reactos/dll/directx/ksproxy/qualityforward.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/ksproxy/qualityforward.cpp [iso-8859-1] Tue Mar 2 17:27:50 2010 @@ -87,8 +87,6 @@ OutputDebugString("UNIMPLEMENTED\n"); } - - HRESULT WINAPI CKsQualityForwarder_Constructor( @@ -98,6 +96,8 @@ { HRESULT hr; HANDLE handle; + + OutputDebugStringW(L"CKsQualityForwarder_Constructor\n"); // open default clock hr = KsOpenDefaultDevice(KSCATEGORY_QUALITY, GENERIC_READ | GENERIC_WRITE, &handle);
14 years, 9 months
1
0
0
0
[akhaldi] 45758: - Move more stuff to wdm.h - Fix XMM_SAVE_AREA32 - Fix *PFN_* definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Mar 2 17:14:22 2010 New Revision: 45758 URL:
http://svn.reactos.org/svn/reactos?rev=45758&view=rev
Log: - Move more stuff to wdm.h - Fix XMM_SAVE_AREA32 - Fix *PFN_* definitions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Tue Mar 2 17:14:22 2010 @@ -971,6 +971,13 @@ #define DBG_STATUS_DEBUG_CONTROL 6 #define DBG_STATUS_WORKER 7 +#define KI_USER_SHARED_DATA 0xffdf0000 + +#define PAGE_SIZE 0x1000 +#define PAGE_SHIFT 12L + +#define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA) + typedef enum _TRACE_INFORMATION_CLASS { TraceIdClass, TraceHandleClass, @@ -1392,6 +1399,50 @@ INTERFACE_TYPE LegacyBusType; ULONG BusNumber; } PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION; + +typedef struct DECLSPEC_ALIGN(16) _M128A { + ULONGLONG Low; + LONGLONG High; +} M128A, *PM128A; + +typedef struct DECLSPEC_ALIGN(16) _XSAVE_FORMAT { + USHORT ControlWord; + USHORT StatusWord; + UCHAR TagWord; + UCHAR Reserved1; + USHORT ErrorOpcode; + ULONG ErrorOffset; + USHORT ErrorSelector; + USHORT Reserved2; + ULONG DataOffset; + USHORT DataSelector; + USHORT Reserved3; + ULONG MxCsr; + ULONG MxCsr_Mask; + M128A FloatRegisters[8]; + +#if defined(_WIN64) + + M128A XmmRegisters[16]; + UCHAR Reserved4[96]; + +#else + + M128A XmmRegisters[8]; + UCHAR Reserved4[192]; + + ULONG StackControl[7]; + ULONG Cr0NpxState; + +#endif + +} XSAVE_FORMAT, *PXSAVE_FORMAT; + +#ifdef _AMD64_ + +typedef XSAVE_FORMAT XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; + +#endif // _AMD64_ /****************************************************************************** * Memory manager Types * @@ -5935,11 +5986,11 @@ #define MAXIMUM_SUPPORTED_EXTENSION 512 +#if defined(_X86_) + typedef ULONG PFN_COUNT; +typedef LONG SPFN_NUMBER, *PSPFN_NUMBER; typedef ULONG PFN_NUMBER, *PPFN_NUMBER; -typedef LONG SPFN_NUMBER, *PSPFN_NUMBER; - -#if defined(_X86_) #define PASSIVE_LEVEL 0 #define LOW_LEVEL 0 @@ -5957,6 +6008,10 @@ #endif #if defined(_AMD64_) +typedef ULONG PFN_COUNT; +typedef LONG64 SPFN_NUMBER, *PSPFN_NUMBER; +typedef ULONG64 PFN_NUMBER, *PPFN_NUMBER; + #define PASSIVE_LEVEL 0 #define LOW_LEVEL 0 #define APC_LEVEL 1 @@ -5971,6 +6026,10 @@ #endif #if defined(_IA64_) + +typedef ULONG PFN_COUNT; +typedef LONG_PTR SPFN_NUMBER, *PSPFN_NUMBER; +typedef ULONG_PTR PFN_NUMBER, *PPFN_NUMBER; #define PASSIVE_LEVEL 0 #define LOW_LEVEL 0 Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Tue Mar 2 17:14:22 2010 @@ -1706,13 +1706,6 @@ return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number)); } -#define KI_USER_SHARED_DATA 0xffdf0000 - -#define PAGE_SIZE 0x1000 -#define PAGE_SHIFT 12L - -#define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA) - extern NTKERNELAPI PVOID MmHighestUserAddress; extern NTKERNELAPI PVOID MmSystemRangeStart; extern NTKERNELAPI ULONG_PTR MmUserProbeAddress; @@ -1744,30 +1737,6 @@ #define CONTEXT_EXCEPTION_REQUEST 0x40000000 #define CONTEXT_EXCEPTION_REPORTING 0x80000000 #endif - -typedef struct DECLSPEC_ALIGN(16) _M128A { - ULONGLONG Low; - LONGLONG High; -} M128A, *PM128A; - -typedef struct _XMM_SAVE_AREA32 { - USHORT ControlWord; - USHORT StatusWord; - UCHAR TagWord; - UCHAR Reserved1; - USHORT ErrorOpcode; - ULONG ErrorOffset; - USHORT ErrorSelector; - USHORT Reserved2; - ULONG DataOffset; - USHORT DataSelector; - USHORT Reserved3; - ULONG MxCsr; - ULONG MxCsr_Mask; - M128A FloatRegisters[8]; - M128A XmmRegisters[16]; - UCHAR Reserved4[96]; -} XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; typedef struct DECLSPEC_ALIGN(16) _CONTEXT { ULONG64 P1Home; @@ -1855,23 +1824,6 @@ ULONG64 LastExceptionToRip; ULONG64 LastExceptionFromRip; } CONTEXT; - -// -// Used to contain PFNs and PFN counts -// -typedef ULONG PFN_COUNT; -typedef ULONG64 PFN_NUMBER, *PPFN_NUMBER; -typedef LONG64 SPFN_NUMBER, *PSPFN_NUMBER; - -#define PASSIVE_LEVEL 0 -#define LOW_LEVEL 0 -#define APC_LEVEL 1 -#define DISPATCH_LEVEL 2 -#define CLOCK_LEVEL 13 -#define IPI_LEVEL 14 -#define POWER_LEVEL 14 -#define PROFILE_LEVEL 15 -#define HIGH_LEVEL 15 #define PAGE_SIZE 0x1000 #define PAGE_SHIFT 12L
14 years, 9 months
1
0
0
0
← Newer
1
...
84
85
86
87
88
89
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200