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
2025
January
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
April 2016
----- 2025 -----
January 2025
----- 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
13 participants
133 discussions
Start a n
N
ew thread
[tfaber] 71120: [COM_APITEST] - Test INamespaceWalk, INamespaceWalkCB and INamespaceWalkCB2 CORE-11093
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Apr 9 08:49:17 2016 New Revision: 71120 URL:
http://svn.reactos.org/svn/reactos?rev=71120&view=rev
Log: [COM_APITEST] - Test INamespaceWalk, INamespaceWalkCB and INamespaceWalkCB2 CORE-11093 Modified: trunk/rostests/apitests/com/com_apitest.c trunk/rostests/apitests/com/com_apitest.h trunk/rostests/apitests/com/shell32.c Modified: trunk/rostests/apitests/com/com_apitest.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/com_apitest.…
============================================================================== --- trunk/rostests/apitests/com/com_apitest.c [iso-8859-1] (original) +++ trunk/rostests/apitests/com/com_apitest.c [iso-8859-1] Sat Apr 9 08:49:17 2016 @@ -158,6 +158,9 @@ { ID_NAME(IID_IMultiQI), TRUE }, { ID_NAME(IID_INamespaceProxy), TRUE }, { ID_NAME(IID_INameSpaceTreeControl), TRUE }, + { ID_NAME(IID_INamespaceWalk), FALSE }, + { ID_NAME(IID_INamespaceWalkCB), FALSE }, + { ID_NAME(IID_INamespaceWalkCB2), FALSE }, { ID_NAME(IID_INetCfg), TRUE }, //{ ID_NAME(IID_INetCfgBindingInterface) }, //{ ID_NAME(IID_INetCfgBindingPath) }, Modified: trunk/rostests/apitests/com/com_apitest.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/com_apitest.…
============================================================================== --- trunk/rostests/apitests/com/com_apitest.h [iso-8859-1] (original) +++ trunk/rostests/apitests/com/com_apitest.h [iso-8859-1] Sat Apr 9 08:49:17 2016 @@ -131,6 +131,9 @@ DEFINE_GUID(IID_IHWEventHandler, 0xc1fb73d0, 0xec3a, 0x4ba2, 0xb5, 0x12, 0x8c, 0xdb, 0x91, 0x87, 0xb6, 0xd1); DEFINE_GUID(IID_IHWEventHandler2, 0xcfcc809f, 0x295d, 0x42e8, 0x9f, 0xfc, 0x42, 0x4b, 0x33, 0xc4, 0x87, 0xe6); DEFINE_GUID(IID_IMultiMonitorDockingSite, 0x03879de0, 0xa205, 0x11d0, 0x99, 0xcb, 0x00, 0xc0, 0x4f, 0xd6, 0x55, 0xe1); +DEFINE_GUID(IID_INamespaceWalk, 0x57ced8a7, 0x3f4a, 0x432c, 0x93, 0x50, 0x30, 0xf2, 0x44, 0x83, 0xf7, 0x4f); +DEFINE_GUID(IID_INamespaceWalkCB, 0xd92995f8, 0xcf5e, 0x4a76, 0xbf, 0x59, 0xea, 0xd3, 0x9e, 0xa2, 0xb9, 0x7e); +DEFINE_GUID(IID_INamespaceWalkCB2, 0x7ac7492b, 0xc38e, 0x438a, 0x87, 0xdb, 0x68, 0x73, 0x78, 0x44, 0xff, 0x70); DEFINE_GUID(IID_IPersistFreeThreadedObject,0xc7264bf0, 0xedb6, 0x11d1, 0x85, 0x46, 0x00, 0x60, 0x08, 0x05, 0x93, 0x68); DEFINE_GUID(IID_IPreviewHandler, 0x8895b1c6, 0xb41f, 0x4c1c, 0xa5, 0x62, 0x0d, 0x56, 0x42, 0x50, 0x83, 0x6f); DEFINE_GUID(IID_IPreviewHandlerFrame, 0xfec87aaf, 0x35f9, 0x447a, 0xad, 0xb7, 0x20, 0x23, 0x44, 0x91, 0x40, 0x1a); Modified: trunk/rostests/apitests/com/shell32.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/com/shell32.c?re…
============================================================================== --- trunk/rostests/apitests/com/shell32.c [iso-8859-1] (original) +++ trunk/rostests/apitests/com/shell32.c [iso-8859-1] Sat Apr 9 08:49:17 2016 @@ -25,6 +25,7 @@ { 0x20, &IID_IOleCommandTarget }, { 0x24, &IID_ICDBurn }, { 0x2c, &IID_IPersistPropertyBag }, + { 0x34, &IID_INamespaceWalkCB }, { 0x3c, &IID_IServiceProvider }, } },
8 years, 9 months
1
0
0
0
[tfaber] 71119: [OLE32] - Apply Wine commit 110665a3 (ole32: Don't call spy on IMalloc::Free(NULL)) by Nikolay Sivov. Fixes test failures in atl:CComHeapPtr CORE-11107 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Apr 9 08:31:49 2016 New Revision: 71119 URL:
http://svn.reactos.org/svn/reactos?rev=71119&view=rev
Log: [OLE32] - Apply Wine commit 110665a3 (ole32: Don't call spy on IMalloc::Free(NULL)) by Nikolay Sivov. Fixes test failures in atl:CComHeapPtr CORE-11107 #resolve Modified: trunk/reactos/dll/win32/ole32/ifs.c trunk/rostests/winetests/ole32/compobj.c Modified: trunk/reactos/dll/win32/ole32/ifs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ifs.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] Sat Apr 9 08:31:49 2016 @@ -241,6 +241,9 @@ TRACE("(%p)\n",pv); + if(!pv) + return; + if(Malloc32.pSpy) { EnterCriticalSection(&IMalloc32_SpyCS); fSpyed = RemoveMemoryLocation(pv); Modified: trunk/rostests/winetests/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c…
============================================================================== --- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Sat Apr 9 08:31:49 2016 @@ -2936,6 +2936,140 @@ CoUninitialize(); } + +static HRESULT WINAPI testspy_QI(IMallocSpy *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMallocSpy) || IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMallocSpy_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI testspy_AddRef(IMallocSpy *iface) +{ + return 2; +} + +static ULONG WINAPI testspy_Release(IMallocSpy *iface) +{ + return 1; +} + +static SIZE_T WINAPI testspy_PreAlloc(IMallocSpy *iface, SIZE_T cb) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static void* WINAPI testspy_PostAlloc(IMallocSpy *iface, void *ptr) +{ + ok(0, "unexpected call\n"); + return NULL; +} + +static void* WINAPI testspy_PreFree(IMallocSpy *iface, void *ptr, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return NULL; +} + +static void WINAPI testspy_PostFree(IMallocSpy *iface, BOOL spyed) +{ + ok(0, "unexpected call\n"); +} + +static SIZE_T WINAPI testspy_PreRealloc(IMallocSpy *iface, void *ptr, SIZE_T cb, void **newptr, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static void* WINAPI testspy_PostRealloc(IMallocSpy *iface, void *ptr, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return NULL; +} + +static void* WINAPI testspy_PreGetSize(IMallocSpy *iface, void *ptr, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return NULL; +} + +static SIZE_T WINAPI testspy_PostGetSize(IMallocSpy *iface, SIZE_T actual, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static void* WINAPI testspy_PreDidAlloc(IMallocSpy *iface, void *ptr, BOOL spyed) +{ + ok(0, "unexpected call\n"); + return NULL; +} + +static int WINAPI testspy_PostDidAlloc(IMallocSpy *iface, void *ptr, BOOL spyed, int actual) +{ + ok(0, "unexpected call\n"); + return 0; +} + +static void WINAPI testspy_PreHeapMinimize(IMallocSpy *iface) +{ + ok(0, "unexpected call\n"); +} + +static void WINAPI testspy_PostHeapMinimize(IMallocSpy *iface) +{ + ok(0, "unexpected call\n"); +} + +static const IMallocSpyVtbl testspyvtbl = +{ + testspy_QI, + testspy_AddRef, + testspy_Release, + testspy_PreAlloc, + testspy_PostAlloc, + testspy_PreFree, + testspy_PostFree, + testspy_PreRealloc, + testspy_PostRealloc, + testspy_PreGetSize, + testspy_PostGetSize, + testspy_PreDidAlloc, + testspy_PostDidAlloc, + testspy_PreHeapMinimize, + testspy_PostHeapMinimize +}; + +static IMallocSpy testspy = { &testspyvtbl }; + +static void test_IMallocSpy(void) +{ + IMalloc *imalloc; + HRESULT hr; + + hr = CoRegisterMallocSpy(&testspy); + ok(hr == S_OK, "got 0x%08x\n", hr); + + imalloc = NULL; + hr = CoGetMalloc(MEMCTX_TASK, &imalloc); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(imalloc != NULL, "got %p\n", imalloc); + + IMalloc_Free(imalloc, NULL); + + IMalloc_Release(imalloc); + + hr = CoRevokeMallocSpy(); + ok(hr == S_OK, "got 0x%08x\n", hr); +} + static void init_funcs(void) { HMODULE hOle32 = GetModuleHandleA("ole32"); @@ -3003,4 +3137,5 @@ test_CoGetMalloc(); test_OleRegGetUserType(); test_CoGetApartmentType(); -} + test_IMallocSpy(); +}
8 years, 9 months
1
0
0
0
[tfaber] 71118: [SHELL32] - Revert the delay-loading changes from r71114 since they break 2nd stage. ROSTESTS-209
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Apr 8 10:36:31 2016 New Revision: 71118 URL:
http://svn.reactos.org/svn/reactos?rev=71118&view=rev
Log: [SHELL32] - Revert the delay-loading changes from r71114 since they break 2nd stage. ROSTESTS-209 Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Fri Apr 8 10:36:31 2016 @@ -87,7 +87,7 @@ set_module_type(shell32 win32dll UNICODE) target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin) -add_delay_importlibs(shell32 uxtheme ole32 oleaut32 userenv version fmifs shdocvw comctl32 browseui shlwapi comdlg32) -add_importlibs(shell32 advapi32 gdi32 user32 powrprof devmgr winspool winmm mpr msvcrt kernel32 ntdll) +add_delay_importlibs(shell32 uxtheme ole32 oleaut32 userenv version fmifs) +add_importlibs(shell32 advapi32 browseui gdi32 user32 powrprof comctl32 comdlg32 shdocvw shlwapi devmgr winspool winmm mpr msvcrt kernel32 ntdll) add_pch(shell32 precomp.h SOURCE) add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all)
8 years, 9 months
1
0
0
0
[tfaber] 71117: [ATL] - Add a basic implementation for IDispatchImpl. Patch by Mark Jansen. CORE-11087
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Apr 8 08:38:48 2016 New Revision: 71117 URL:
http://svn.reactos.org/svn/reactos?rev=71117&view=rev
Log: [ATL] - Add a basic implementation for IDispatchImpl. Patch by Mark Jansen. CORE-11087 Modified: trunk/reactos/lib/atl/atlbase.h trunk/reactos/lib/atl/atlcom.h Modified: trunk/reactos/lib/atl/atlbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlbase.h?rev=7111…
============================================================================== --- trunk/reactos/lib/atl/atlbase.h [iso-8859-1] (original) +++ trunk/reactos/lib/atl/atlbase.h [iso-8859-1] Fri Apr 8 08:38:48 2016 @@ -395,9 +395,9 @@ class CAtlModule : public _ATL_MODULE { -protected: +public: static GUID m_libid; -public: + CAtlModule() { ATLASSERT(_pAtlModule == NULL); Modified: trunk/reactos/lib/atl/atlcom.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcom.h?rev=71117…
============================================================================== --- trunk/reactos/lib/atl/atlcom.h [iso-8859-1] (original) +++ trunk/reactos/lib/atl/atlcom.h [iso-8859-1] Fri Apr 8 08:38:48 2016 @@ -1434,4 +1434,91 @@ {offsetofclass(ATL::_ICPLocator<&iid>, _atl_conn_classtype) - \ offsetofclass(ATL::IConnectionPointContainerImpl<_atl_conn_classtype>, _atl_conn_classtype)}, + + +/* TODO: + - IDispatchImpl contains a static member of type CComTypeInfoHolder that manages the type information for the dual interface. + If you have multiple objects that implement the same dual interface, only one instance of CComTypeInfoHolder is used. + - By default, the IDispatchImpl class looks up the type information for T in the registry. + To implement an unregistered interface, you can use the IDispatchImpl class without accessing the registry by using a predefined version number. + If you create an IDispatchImpl object that has 0xFFFF as the value for wMajor and 0xFFFF as the value for wMinor, + the IDispatchImpl class retrieves the type library from the .dll file instead of the registry. +*/ +template<class T, const IID* piid /*= &__uuidof(T)*/, const GUID* plibid = &CAtlModule::m_libid, WORD wMajor = 1, WORD wMinor = 0> +class IDispatchImpl : + public T +{ +private: + CComPtr<ITypeInfo> m_pTypeInfo; + + STDMETHOD(EnsureTILoaded)(LCID lcid) + { + HRESULT hr = S_OK; + if (m_pTypeInfo != NULL) + return hr; + + if (IsEqualCLSID(CLSID_NULL, *plibid)) + OutputDebugStringA("IDispatchImpl: plibid is CLSID_NULL!\r\n"); + + // Should we assert here? + if (wMajor == 0xffff && wMinor == 0xffff) + OutputDebugStringA("IDispatchImpl: not fully implemented, missing functionality to load TLB from file!\r\n"); + + CComPtr<ITypeLib> spTypeLib; + hr = LoadRegTypeLib(*plibid, wMajor, wMinor, lcid, &spTypeLib); + if (SUCCEEDED(hr)) + { + hr = spTypeLib->GetTypeInfoOfGuid(*piid, &m_pTypeInfo); + } + return hr; + } + +public: + IDispatchImpl() + { + } + + + // *** IDispatch methods *** + STDMETHOD(GetTypeInfoCount)(UINT *pctinfo) + { + if (pctinfo == NULL) + return E_POINTER; + + *pctinfo = 1; + return S_OK; + } + + STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) + { + if (iTInfo != 0) + return DISP_E_BADINDEX; + if (ppTInfo == NULL) + return E_POINTER; + + HRESULT hr = EnsureTILoaded(lcid); + *ppTInfo = m_pTypeInfo; + if (*ppTInfo) + (*ppTInfo)->AddRef(); + + return hr; + } + + STDMETHOD(GetIDsOfNames)(REFIID /*riid*/, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) + { + HRESULT hr = EnsureTILoaded(lcid); + if (SUCCEEDED(hr)) + hr = m_pTypeInfo->GetIDsOfNames(rgszNames, cNames, rgDispId); + return hr; + } + + STDMETHOD(Invoke)(DISPID dispIdMember, REFIID /*riid*/, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) + { + HRESULT hr = EnsureTILoaded(lcid); + if (SUCCEEDED(hr)) + hr = m_pTypeInfo->Invoke(this, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + return hr; + } +}; + }; // namespace ATL
8 years, 9 months
1
0
0
0
[tfaber] 71116: [SHELL32] - Add stubs for the shell dispatch object, CShell, and its relatives. Patch by Mark Jansen. [SHELL32_WINETEST] - We no longer need to skip test_ParseName and test_Verbs th...
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Apr 8 08:30:09 2016 New Revision: 71116 URL:
http://svn.reactos.org/svn/reactos?rev=71116&view=rev
Log: [SHELL32] - Add stubs for the shell dispatch object, CShell, and its relatives. Patch by Mark Jansen. [SHELL32_WINETEST] - We no longer need to skip test_ParseName and test_Verbs thanks to Mark's work. CORE-6892 ROSTESTS-209 Added: trunk/reactos/dll/win32/shell32/CFolder.cpp (with props) trunk/reactos/dll/win32/shell32/CFolder.h (with props) trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp (with props) trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h (with props) trunk/reactos/dll/win32/shell32/CFolderItems.cpp (with props) trunk/reactos/dll/win32/shell32/CFolderItems.h (with props) trunk/reactos/dll/win32/shell32/CShell.cpp (with props) trunk/reactos/dll/win32/shell32/CShell.h (with props) trunk/reactos/dll/win32/shell32/res/rgs/shell.rgs (with props) Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt trunk/reactos/dll/win32/shell32/precomp.h trunk/reactos/dll/win32/shell32/rgs_res.rc trunk/reactos/dll/win32/shell32/shell32.cpp trunk/reactos/dll/win32/shell32/shresdef.h trunk/rostests/winetests/shell32/shelldispatch.c Added: trunk/reactos/dll/win32/shell32/CFolder.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolder.…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolder.cpp (added) +++ trunk/reactos/dll/win32/shell32/CFolder.cpp [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,186 @@ +/* + * Folder implementation + * + * Copyright 2015 Mark Jansen + * + * 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 "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + + +CFolder::CFolder() +{ +} + +CFolder::~CFolder() +{ +} + +void CFolder::Init(LPITEMIDLIST idlist) +{ + m_idlist.Attach(idlist); +} + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + + +// *** Folder methods *** +HRESULT STDMETHODCALLTYPE CFolder::get_Title(BSTR *pbs) +{ + TRACE("(%p, %p)\n", this, pbs); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::get_Parent(IDispatch **ppid) +{ + TRACE("(%p %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::get_ParentFolder(Folder **ppsf) +{ + TRACE("(%p, %p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::Items(FolderItems **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::ParseName(BSTR bName, FolderItem **ppid) +{ + TRACE("(%p, %s, %p)\n", this, wine_dbgstr_w(bName), ppid); + + CComPtr<IShellFolder> psfDesktop; + + HRESULT hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + CComPtr<IShellFolder> psfCurrent; + hr = psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, &psfCurrent)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + CComHeapPtr<ITEMIDLIST_RELATIVE> relativePidl; + hr = psfCurrent->ParseDisplayName(NULL, NULL, bName, NULL, &relativePidl, NULL); + if (!SUCCEEDED(hr)) + return S_FALSE; + + CFolderItem* item = new CComObject<CFolderItem>(); + item->AddRef(); + item->Init(ILCombine(m_idlist, relativePidl)); + *ppid = item; + return S_OK; +} + +HRESULT STDMETHODCALLTYPE CFolder::NewFolder(BSTR bName, VARIANT vOptions) +{ + TRACE("(%p, %s, %s)\n", this, wine_dbgstr_w(bName), wine_dbgstr_variant(&vOptions)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::MoveHere(VARIANT vItem, VARIANT vOptions) +{ + TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::CopyHere(VARIANT vItem, VARIANT vOptions) +{ + TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::GetDetailsOf(VARIANT vItem, int iColumn, BSTR *pbs) +{ + TRACE("(%p, %s, %i, %p)\n", this, wine_dbgstr_variant(&vItem), iColumn, pbs); + return E_NOTIMPL; +} + + +// *** Folder2 methods *** +HRESULT STDMETHODCALLTYPE CFolder::get_Self(FolderItem **ppfi) +{ + TRACE("(%p, %p)\n", this, ppfi); + if (!ppfi) + return E_POINTER; + CFolderItem* item = new CComObject<CFolderItem>(); + item->AddRef(); + item->Init(ILClone(m_idlist)); + *ppfi = item; + return S_OK; +} + +HRESULT STDMETHODCALLTYPE CFolder::get_OfflineStatus(LONG *pul) +{ + TRACE("(%p, %p)\n", this, pul); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::Synchronize() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::get_HaveToShowWebViewBarricade(VARIANT_BOOL *pbHaveToShowWebViewBarricade) +{ + TRACE("(%p, %p)\n", this, pbHaveToShowWebViewBarricade); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolder::DismissedWebViewBarricade() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + + Propchange: trunk/reactos/dll/win32/shell32/CFolder.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CFolder.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolder.…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolder.h (added) +++ trunk/reactos/dll/win32/shell32/CFolder.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,77 @@ +/* + * Folder implementation + * + * Copyright 2015 Mark Jansen + * + * 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 + */ + +#ifndef _FOLDER_H_ +#define _FOLDER_H_ + + +class CFolder: + public CComCoClass<CFolder>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public Folder2 +{ +private: + CComHeapPtr<ITEMIDLIST> m_idlist; + +public: + CFolder(); + ~CFolder(); + + void Init(LPITEMIDLIST idlist); + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + + // *** Folder methods *** + virtual HRESULT STDMETHODCALLTYPE get_Title(BSTR *pbs); + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_ParentFolder(Folder **ppsf); + virtual HRESULT STDMETHODCALLTYPE Items(FolderItems **ppid); + virtual HRESULT STDMETHODCALLTYPE ParseName(BSTR bName, FolderItem **ppid); + virtual HRESULT STDMETHODCALLTYPE NewFolder(BSTR bName, VARIANT vOptions); + virtual HRESULT STDMETHODCALLTYPE MoveHere(VARIANT vItem, VARIANT vOptions); + virtual HRESULT STDMETHODCALLTYPE CopyHere(VARIANT vItem, VARIANT vOptions); + virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(VARIANT vItem, int iColumn, BSTR *pbs); + + // *** Folder2 methods *** + virtual HRESULT STDMETHODCALLTYPE get_Self(FolderItem **ppfi); + virtual HRESULT STDMETHODCALLTYPE get_OfflineStatus(LONG *pul); + virtual HRESULT STDMETHODCALLTYPE Synchronize(); + virtual HRESULT STDMETHODCALLTYPE get_HaveToShowWebViewBarricade(VARIANT_BOOL *pbHaveToShowWebViewBarricade); + virtual HRESULT STDMETHODCALLTYPE DismissedWebViewBarricade(); + +DECLARE_NOT_AGGREGATABLE(CFolder) +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFolder) + COM_INTERFACE_ENTRY_IID(IID_Folder2, Folder2) + COM_INTERFACE_ENTRY_IID(IID_Folder, Folder) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) +END_COM_MAP() + +}; + + +#endif Propchange: trunk/reactos/dll/win32/shell32/CFolder.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderI…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp (added) +++ trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,181 @@ +/* + * FolderItemVerb(s) implementation + * + * Copyright 2015 Mark Jansen + * + * 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 "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + + +CFolderItemVerb::CFolderItemVerb() +{ +} + +CFolderItemVerb::~CFolderItemVerb() +{ +} + +//void CFolderItemVerb::Init(LPITEMIDLIST idlist) +//{ +// m_idlist.Attach(idlist); +//} + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CFolderItemVerb::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +// *** FolderItemVerb methods *** + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::get_Name(BSTR *pbs) +{ + TRACE("(%p, %p)\n", this, pbs); + if (!pbs) + return E_POINTER; + // Terminating item: + *pbs = SysAllocString(L""); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerb::DoIt() +{ + TRACE("(%p, %p)\n", this); + return E_NOTIMPL; +} + + + + + + +CFolderItemVerbs::CFolderItemVerbs() +{ +} + +CFolderItemVerbs::~CFolderItemVerbs() +{ +} + +//void CFolderItemVerbs::Init(LPITEMIDLIST idlist) +//{ +// m_idlist.Attach(idlist); +//} + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +// *** FolderItemVerbs methods *** +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Count(LONG *plCount) +{ + TRACE("(%p, %p)\n", this, plCount); + if (!plCount) + return E_POINTER; + *plCount = 0; + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::Item(VARIANT index, FolderItemVerb **ppid) +{ + TRACE("(%p, %s, %p)\n", this, wine_dbgstr_variant(&index), ppid); + if (!ppid) + return E_POINTER; + + /* FIXME! */ + CFolderItemVerb* verb = new CComObject<CFolderItemVerb>(); + verb->AddRef(); + *ppid = verb; + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItemVerbs::_NewEnum(IUnknown **ppunk) +{ + TRACE("(%p, %p)\n", this, ppunk); + return E_NOTIMPL; +} + + Propchange: trunk/reactos/dll/win32/shell32/CFolderItemVerbs.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderI…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h (added) +++ trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,97 @@ +/* + * FolderItemVerb(s) implementation + * + * Copyright 2015 Mark Jansen + * + * 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 + */ + +#ifndef _FOLDERITEMVERBS_H_ +#define _FOLDERITEMVERBS_H_ + +class CFolderItemVerb: + public CComCoClass<CFolderItemVerb>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public FolderItemVerb +{ +private: + +public: + CFolderItemVerb(); + ~CFolderItemVerb(); + + //void Init(LPITEMIDLIST idlist); + + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** FolderItemVerb methods *** + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR *pbs); + virtual HRESULT STDMETHODCALLTYPE DoIt(); + + +DECLARE_NOT_AGGREGATABLE(CFolderItemVerb) +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFolderItemVerb) + COM_INTERFACE_ENTRY_IID(IID_FolderItemVerb, FolderItemVerb) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) +END_COM_MAP() +}; + + +class CFolderItemVerbs: + public CComCoClass<CFolderItemVerbs>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public FolderItemVerbs +{ +private: + +public: + CFolderItemVerbs(); + ~CFolderItemVerbs(); + + //void Init(LPITEMIDLIST idlist); + + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** FolderItemVerbs methods *** + virtual HRESULT STDMETHODCALLTYPE get_Count(LONG *plCount); + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE Item(VARIANT index, FolderItemVerb **ppid); + virtual HRESULT STDMETHODCALLTYPE _NewEnum(IUnknown **ppunk); + +DECLARE_NOT_AGGREGATABLE(CFolderItemVerbs) +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFolderItemVerbs) + COM_INTERFACE_ENTRY_IID(IID_FolderItemVerbs, FolderItemVerbs) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) +END_COM_MAP() +}; + +#endif Propchange: trunk/reactos/dll/win32/shell32/CFolderItemVerbs.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CFolderItems.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderI…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolderItems.cpp (added) +++ trunk/reactos/dll/win32/shell32/CFolderItems.cpp [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,250 @@ +/* + * FolderItem(s) implementation + * + * Copyright 2015 Mark Jansen + * + * 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 "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + + +CFolderItem::CFolderItem() +{ +} + +CFolderItem::~CFolderItem() +{ +} + +void CFolderItem::Init(LPITEMIDLIST idlist) +{ + m_idlist.Attach(idlist); +} + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CFolderItem::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +// *** FolderItem methods *** +HRESULT STDMETHODCALLTYPE CFolderItem::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_Name(BSTR *pbs) +{ + TRACE("(%p, %p)\n", this, pbs); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::put_Name(BSTR bs) +{ + TRACE("(%p, %s)\n", this, wine_dbgstr_w(bs)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_Path(BSTR *pbs) +{ + CComPtr<IShellFolder> psfDesktop; + + HRESULT hr = SHGetDesktopFolder(&psfDesktop); + if (!SUCCEEDED(hr)) + return hr; + + STRRET strret; + hr = psfDesktop->GetDisplayNameOf(m_idlist, SHGDN_FORPARSING, &strret); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + return StrRetToBSTR(&strret, NULL, pbs); +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_GetLink(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_GetFolder(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_IsLink(VARIANT_BOOL *pb) +{ + TRACE("(%p, %p)\n", this, pb); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_IsFolder(VARIANT_BOOL *pb) +{ + TRACE("(%p, %p)\n", this, pb); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_IsFileSystem(VARIANT_BOOL *pb) +{ + TRACE("(%p, %p)\n", this, pb); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_IsBrowsable(VARIANT_BOOL *pb) +{ + TRACE("(%p, %p)\n", this, pb); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_ModifyDate(DATE *pdt) +{ + TRACE("(%p, %p)\n", this, pdt); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::put_ModifyDate(DATE dt) +{ + TRACE("(%p, %f)\n", this, dt); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_Size(LONG *pul) +{ + TRACE("(%p, %p)\n", this, pul); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::get_Type(BSTR *pbs) +{ + TRACE("(%p, %p)\n", this, pbs); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::Verbs(FolderItemVerbs **ppfic) +{ + if(!ppfic) + return E_POINTER; + CFolderItemVerbs* verbs = new CComObject<CFolderItemVerbs>(); + verbs->AddRef(); + *ppfic = verbs; + return S_OK; +} + +HRESULT STDMETHODCALLTYPE CFolderItem::InvokeVerb(VARIANT vVerb) +{ + TRACE("(%p, %s)\n", this, wine_dbgstr_variant(&vVerb)); + return E_NOTIMPL; +} + + + + + +CFolderItems::CFolderItems() +{ +} + +CFolderItems::~CFolderItems() +{ +} + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CFolderItems::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +// *** FolderItems methods *** +HRESULT STDMETHODCALLTYPE CFolderItems::get_Count(long *plCount) +{ + TRACE("(%p, %p)\n", this, plCount); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::Item(VARIANT index, FolderItem **ppid) +{ + TRACE("(%p, %s, %p)\n", this, wine_dbgstr_variant(&index), ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CFolderItems::_NewEnum(IUnknown **ppunk) +{ + TRACE("(%p, %p)\n", this, ppunk); + return E_NOTIMPL; +} + Propchange: trunk/reactos/dll/win32/shell32/CFolderItems.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CFolderItems.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderI…
============================================================================== --- trunk/reactos/dll/win32/shell32/CFolderItems.h (added) +++ trunk/reactos/dll/win32/shell32/CFolderItems.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,108 @@ +/* + * FolderItem(s) implementation + * + * Copyright 2015 Mark Jansen + * + * 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 + */ + +#ifndef _FOLDERITEM_H_ +#define _FOLDERITEM_H_ + + +class CFolderItem: + public CComCoClass<CFolderItem>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public FolderItem +{ +private: + CComHeapPtr<ITEMIDLIST> m_idlist; + +public: + CFolderItem(); + ~CFolderItem(); + + void Init(LPITEMIDLIST idlist); + + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** FolderItem methods *** + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Name(BSTR *pbs); + virtual HRESULT STDMETHODCALLTYPE put_Name(BSTR bs); + virtual HRESULT STDMETHODCALLTYPE get_Path(BSTR *pbs); + virtual HRESULT STDMETHODCALLTYPE get_GetLink(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_GetFolder(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_IsLink(VARIANT_BOOL *pb); + virtual HRESULT STDMETHODCALLTYPE get_IsFolder(VARIANT_BOOL *pb); + virtual HRESULT STDMETHODCALLTYPE get_IsFileSystem(VARIANT_BOOL *pb); + virtual HRESULT STDMETHODCALLTYPE get_IsBrowsable(VARIANT_BOOL *pb); + virtual HRESULT STDMETHODCALLTYPE get_ModifyDate(DATE *pdt); + virtual HRESULT STDMETHODCALLTYPE put_ModifyDate(DATE dt); + virtual HRESULT STDMETHODCALLTYPE get_Size(LONG *pul); + virtual HRESULT STDMETHODCALLTYPE get_Type(BSTR *pbs); + virtual HRESULT STDMETHODCALLTYPE Verbs(FolderItemVerbs **ppfic); + virtual HRESULT STDMETHODCALLTYPE InvokeVerb(VARIANT vVerb); + + +DECLARE_NOT_AGGREGATABLE(CFolderItem) +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFolderItem) + COM_INTERFACE_ENTRY_IID(IID_FolderItem, FolderItem) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) +END_COM_MAP() +}; + +class CFolderItems: + public CComCoClass<CFolderItems>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public FolderItems +{ +private: + +public: + CFolderItems(); + ~CFolderItems(); + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** FolderItems methods *** + virtual HRESULT STDMETHODCALLTYPE get_Count(long *plCount); + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE Item(VARIANT index, FolderItem **ppid); + virtual HRESULT STDMETHODCALLTYPE _NewEnum(IUnknown **ppunk); + +DECLARE_NOT_AGGREGATABLE(CFolderItems) +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CFolderItems) + COM_INTERFACE_ENTRY_IID(IID_FolderItems, FolderItems) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) +END_COM_MAP() +}; + +#endif Propchange: trunk/reactos/dll/win32/shell32/CFolderItems.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -58,6 +58,10 @@ CDefaultContextMenu.cpp COpenWithMenu.cpp CNewMenu.cpp + CShell.cpp + CFolder.cpp + CFolderItems.cpp + CFolderItemVerbs.cpp precomp.h) add_library(shell32 SHARED @@ -83,7 +87,7 @@ set_module_type(shell32 win32dll UNICODE) target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin) -add_delay_importlibs(shell32 uxtheme ole32 userenv version fmifs shdocvw comctl32 browseui shlwapi comdlg32) +add_delay_importlibs(shell32 uxtheme ole32 oleaut32 userenv version fmifs shdocvw comctl32 browseui shlwapi comdlg32) add_importlibs(shell32 advapi32 gdi32 user32 powrprof devmgr winspool winmm mpr msvcrt kernel32 ntdll) add_pch(shell32 precomp.h SOURCE) add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all) Added: trunk/reactos/dll/win32/shell32/CShell.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CShell.c…
============================================================================== --- trunk/reactos/dll/win32/shell32/CShell.cpp (added) +++ trunk/reactos/dll/win32/shell32/CShell.cpp [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,344 @@ +/* + * IShellDispatch implementation + * + * Copyright 2015 Mark Jansen + * + * 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 "precomp.h" + +WINE_DEFAULT_DEBUG_CHANNEL(shell); + + +CShell::CShell() +{ +} + +CShell::~CShell() +{ +} + + +// *** IDispatch methods *** +HRESULT STDMETHODCALLTYPE CShell::GetTypeInfoCount(UINT *pctinfo) +{ + TRACE("(%p, %p)\n", this, pctinfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember, wine_dbgstr_guid(&riid), lcid, (DWORD)wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + + +// *** IShellDispatch methods *** +HRESULT STDMETHODCALLTYPE CShell::get_Application(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::get_Parent(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT VariantToIdlist(VARIANT* var, LPITEMIDLIST* idlist) +{ + HRESULT hr = S_FALSE; + if(V_VT(var) == VT_I4) + { + hr = SHGetSpecialFolderLocation(NULL, V_I4(var), idlist); + } + else if(V_VT(var) == VT_BSTR) + { + hr = SHILCreateFromPathW(V_BSTR(var), idlist, NULL); + } + return hr; +} + +HRESULT STDMETHODCALLTYPE CShell::NameSpace(VARIANT vDir, Folder **ppsdf) +{ + TRACE("(%p, %s, %p)\n", this, debugstr_variant(&vDir), ppsdf); + if (!ppsdf) + return E_POINTER; + *ppsdf = NULL; + LPITEMIDLIST idlist = NULL; + HRESULT hr = VariantToIdlist(&vDir, &idlist); + if (!SUCCEEDED(hr) || !idlist) + return S_FALSE; + CFolder* fld = new CComObject<CFolder>(); + fld->Init(idlist); + *ppsdf = fld; + fld->AddRef(); + return hr; +} + +HRESULT STDMETHODCALLTYPE CShell::BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf) +{ + TRACE("(%p, %lu, %ls, %lu, %s, %p)\n", this, Hwnd, Title, Options, debugstr_variant(&RootFolder), ppsdf); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Windows(IDispatch **ppid) +{ + TRACE("(%p, %p)\n", this, ppid); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Open(VARIANT vDir) +{ + TRACE("(%p, %s)\n", this, debugstr_variant(&vDir)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Explore(VARIANT vDir) +{ + TRACE("(%p, %s)\n", this, debugstr_variant(&vDir)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::MinimizeAll() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::UndoMinimizeALL() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FileRun() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::CascadeWindows() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TileVertically() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TileHorizontally() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShutdownWindows() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Suspend() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::EjectPC() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::SetTime() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::TrayProperties() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::Help() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindFiles() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindComputer() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::RefreshMenu() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ControlPanelItem(BSTR szDir) +{ + TRACE("(%p, %ls)\n", this, szDir); + return E_NOTIMPL; +} + + +// *** IShellDispatch2 methods *** +HRESULT STDMETHODCALLTYPE CShell::IsRestricted(BSTR group, BSTR restriction, LONG *value) +{ + TRACE("(%p, %ls, %ls, %p)\n", this, group, restriction, value); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show) +{ + TRACE("(%p, %ls, %s, %s, %s, %s)\n", this, file, debugstr_variant(&args), debugstr_variant(&dir), debugstr_variant(&op), debugstr_variant(&show)); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::FindPrinter(BSTR name, BSTR location, BSTR model) +{ + TRACE("(%p, %ls, %ls, %ls)\n", this, name, location, model); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSystemInformation(BSTR name, VARIANT *ret) +{ + TRACE("(%p, %ls, %p)\n", this, name, ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::IsServiceRunning(BSTR service, VARIANT *running) +{ + TRACE("(%p, %ls, %p)\n", this, service, running); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::CanStartStopService(BSTR service, VARIANT *ret) +{ + TRACE("(%p, %ls, %p)\n", this, service, ret); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret) +{ + TRACE("(%p, %ls, %s, %p)\n", this, clsid, wine_dbgstr_variant(&show), ret); + return E_NOTIMPL; +} + + +// *** IShellDispatch3 methods *** +HRESULT STDMETHODCALLTYPE CShell::AddToRecent(VARIANT file, BSTR category) +{ + TRACE("(%p, %s, %ls)\n", this, wine_dbgstr_variant(&file), category); + return E_NOTIMPL; +} + + +// *** IShellDispatch4 methods *** +HRESULT STDMETHODCALLTYPE CShell::WindowsSecurity() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ToggleDesktop() +{ + TRACE("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::ExplorerPolicy(BSTR policy, VARIANT *value) +{ + TRACE("(%p, %ls, %p)\n", this, policy, value); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSetting(LONG setting, VARIANT_BOOL *result) +{ + TRACE("(%p, %lu, %p)\n", this, setting, result); + return E_NOTIMPL; +} + + +// *** IObjectSafety methods *** +HRESULT STDMETHODCALLTYPE CShell::GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) +{ + TRACE("(%p, %s, %p, %p)\n", this, wine_dbgstr_guid(&riid), pdwSupportedOptions, pdwEnabledOptions); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) +{ + TRACE("(%p, %s, %lu, %lu)\n", this, wine_dbgstr_guid(&riid), dwOptionSetMask, dwEnabledOptions); + return E_NOTIMPL; +} + + +// *** IObjectWithSite methods *** +HRESULT STDMETHODCALLTYPE CShell::SetSite(IUnknown *pUnkSite) +{ + TRACE("(%p, %p)\n", this, pUnkSite); + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE CShell::GetSite(REFIID riid, PVOID *ppvSite) +{ + TRACE("(%p, %s, %p)\n", this, wine_dbgstr_guid(&riid), ppvSite); + return E_NOTIMPL; +} + + Propchange: trunk/reactos/dll/win32/shell32/CShell.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shell32/CShell.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CShell.h…
============================================================================== --- trunk/reactos/dll/win32/shell32/CShell.h (added) +++ trunk/reactos/dll/win32/shell32/CShell.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,115 @@ +/* + * IShellDispatch implementation + * + * Copyright 2015 Mark Jansen + * + * 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 + */ + +#ifndef _SHELL_H_ +#define _SHELL_H_ + +#undef ShellExecute + +class CShell: + public CComCoClass<CShell, &CLSID_Shell>, + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IShellDispatch4, + public IObjectSafety, + public IObjectWithSite +{ +private: + +public: + CShell(); + ~CShell(); + + // *** IDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + // *** IShellDispatch methods *** + virtual HRESULT STDMETHODCALLTYPE get_Application(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE NameSpace(VARIANT vDir, Folder **ppsdf); + virtual HRESULT STDMETHODCALLTYPE BrowseForFolder(LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf); + virtual HRESULT STDMETHODCALLTYPE Windows(IDispatch **ppid); + virtual HRESULT STDMETHODCALLTYPE Open(VARIANT vDir); + virtual HRESULT STDMETHODCALLTYPE Explore(VARIANT vDir); + virtual HRESULT STDMETHODCALLTYPE MinimizeAll(); + virtual HRESULT STDMETHODCALLTYPE UndoMinimizeALL(); + virtual HRESULT STDMETHODCALLTYPE FileRun(); + virtual HRESULT STDMETHODCALLTYPE CascadeWindows(); + virtual HRESULT STDMETHODCALLTYPE TileVertically(); + virtual HRESULT STDMETHODCALLTYPE TileHorizontally(); + virtual HRESULT STDMETHODCALLTYPE ShutdownWindows(); + virtual HRESULT STDMETHODCALLTYPE Suspend(); + virtual HRESULT STDMETHODCALLTYPE EjectPC(); + virtual HRESULT STDMETHODCALLTYPE SetTime(); + virtual HRESULT STDMETHODCALLTYPE TrayProperties(); + virtual HRESULT STDMETHODCALLTYPE Help(); + virtual HRESULT STDMETHODCALLTYPE FindFiles(); + virtual HRESULT STDMETHODCALLTYPE FindComputer(); + virtual HRESULT STDMETHODCALLTYPE RefreshMenu(); + virtual HRESULT STDMETHODCALLTYPE ControlPanelItem(BSTR szDir); + + // *** IShellDispatch2 methods *** + virtual HRESULT STDMETHODCALLTYPE IsRestricted(BSTR group, BSTR restriction, LONG *value); + virtual HRESULT STDMETHODCALLTYPE ShellExecute(BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show); + virtual HRESULT STDMETHODCALLTYPE FindPrinter(BSTR name, BSTR location, BSTR model); + virtual HRESULT STDMETHODCALLTYPE GetSystemInformation(BSTR name, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ServiceStart(BSTR service, VARIANT persistent, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ServiceStop(BSTR service, VARIANT persistent, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE IsServiceRunning(BSTR service, VARIANT *running); + virtual HRESULT STDMETHODCALLTYPE CanStartStopService(BSTR service, VARIANT *ret); + virtual HRESULT STDMETHODCALLTYPE ShowBrowserBar(BSTR clsid, VARIANT show, VARIANT *ret); + + // *** IShellDispatch3 methods *** + virtual HRESULT STDMETHODCALLTYPE AddToRecent(VARIANT file, BSTR category); + + // *** IShellDispatch4 methods *** + virtual HRESULT STDMETHODCALLTYPE WindowsSecurity(); + virtual HRESULT STDMETHODCALLTYPE ToggleDesktop(); + virtual HRESULT STDMETHODCALLTYPE ExplorerPolicy(BSTR policy, VARIANT *value); + virtual HRESULT STDMETHODCALLTYPE GetSetting(LONG setting, VARIANT_BOOL *result); + + // *** IObjectSafety methods *** + virtual HRESULT STDMETHODCALLTYPE GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions); + virtual HRESULT STDMETHODCALLTYPE SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions); + + // *** IObjectWithSite methods *** + virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite); + virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite); + + +DECLARE_REGISTRY_RESOURCEID(IDR_SHELL) +DECLARE_NOT_AGGREGATABLE(CShell) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CShell) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch4, IShellDispatch4) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch3, IShellDispatch3) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch2, IShellDispatch2) + COM_INTERFACE_ENTRY_IID(IID_IShellDispatch, IShellDispatch) + COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch) + COM_INTERFACE_ENTRY_IID(IID_IObjectSafety, IObjectSafety) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) +END_COM_MAP() +}; + +#endif /* _SHELL_H_ */ Propchange: trunk/reactos/dll/win32/shell32/CShell.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/precomp.…
============================================================================== --- trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/precomp.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -30,6 +30,7 @@ #include <atlwin.h> #include <powrprof.h> #include <winnetwk.h> +#include <objsafe.h> #include <comctl32_undoc.h> #include <shlguid_undoc.h> @@ -49,6 +50,10 @@ #include "shfldr.h" #include "CShellItem.h" #include "CShellLink.h" +#include "CFolderItemVerbs.h" +#include "CFolderItems.h" +#include "CFolder.h" +#include "CShell.h" #include "CDropTargetHelper.h" #include "folders/CFSFolder.h" #include "folders/CDrivesFolder.h" Added: trunk/reactos/dll/win32/shell32/res/rgs/shell.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/res/rgs/shell.rgs (added) +++ trunk/reactos/dll/win32/shell32/res/rgs/shell.rgs [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {13709620-C279-11CE-A49E-444553540000} = s 'Shell Automation Service' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} Propchange: trunk/reactos/dll/win32/shell32/res/rgs/shell.rgs ------------------------------------------------------------------------------ svn:eol-style = CRLF Modified: trunk/reactos/dll/win32/shell32/rgs_res.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/rgs_res.…
============================================================================== --- trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/rgs_res.rc [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -26,3 +26,4 @@ IDR_EXEDROPHANDLER REGISTRY "res/rgs/exedrophandler.rgs" IDR_MERGEDFOLDER REGISTRY "res/rgs/mergedfolder.rgs" IDR_REBARBANDSITE REGISTRY "res/rgs/rebarbandsite.rgs" +IDR_SHELL REGISTRY "res/rgs/shell.rgs" Modified: trunk/reactos/dll/win32/shell32/shell32.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -196,6 +196,7 @@ OBJECT_ENTRY(CLSID_ShellDesktop, CDesktopFolder) OBJECT_ENTRY(CLSID_ShellItem, CShellItem) OBJECT_ENTRY(CLSID_ShellLink, CShellLink) + OBJECT_ENTRY(CLSID_Shell, CShell) OBJECT_ENTRY(CLSID_DragDropHelper, CDropTargetHelper) OBJECT_ENTRY(CLSID_ControlPanel, CControlPanelFolder) OBJECT_ENTRY(CLSID_MyDocuments, CMyDocsFolder) Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
============================================================================== --- trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -649,3 +649,4 @@ #define IDR_QUERYASSOCIATIONS 152 #define IDR_MERGEDFOLDER 153 #define IDR_REBARBANDSITE 154 +#define IDR_SHELL 155 Modified: trunk/rostests/winetests/shell32/shelldispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shelldi…
============================================================================== --- trunk/rostests/winetests/shell32/shelldispatch.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shell32/shelldispatch.c [iso-8859-1] Fri Apr 8 08:30:09 2016 @@ -880,16 +880,19 @@ init_function_pointers(); test_namespace(); test_service(); - +#ifdef __REACTOS__ if (!winetest_interactive) - skip("ROSTESTS-209: Skipping test_ShellFolderViewDual(), test_ShellWindows(), test_ParseName() and test_Verbs().\n"); + skip("ROSTESTS-209: Skipping test_ShellFolderViewDual() and test_ShellWindows().\n"); else { - test_ShellFolderViewDual(); - test_ShellWindows(); - test_ParseName(); - test_Verbs(); - } +#endif + test_ShellFolderViewDual(); + test_ShellWindows(); +#ifdef __REACTOS__ + } +#endif + test_ParseName(); + test_Verbs(); test_ShellExecute();
8 years, 9 months
1
0
0
0
[tfaber] 71115: [SHELL32] - Explicitly use -W version of ShellExecute. Patch by Mark Jansen. ROSTESTS-209
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Apr 8 07:56:22 2016 New Revision: 71115 URL:
http://svn.reactos.org/svn/reactos?rev=71115&view=rev
Log: [SHELL32] - Explicitly use -W version of ShellExecute. Patch by Mark Jansen. ROSTESTS-209 Modified: trunk/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp Modified: trunk/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/droptarg…
============================================================================== --- trunk/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp [iso-8859-1] Fri Apr 8 07:56:22 2016 @@ -83,7 +83,7 @@ } } - ShellExecute(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL); + ShellExecuteW(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL); return S_OK; }
8 years, 9 months
1
0
0
0
[tfaber] 71114: [SHELL32] - Delay-import some libraries. Patch by Mark Jansen. ROSTESTS-209
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Apr 8 07:55:32 2016 New Revision: 71114 URL:
http://svn.reactos.org/svn/reactos?rev=71114&view=rev
Log: [SHELL32] - Delay-import some libraries. Patch by Mark Jansen. ROSTESTS-209 Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Fri Apr 8 07:55:32 2016 @@ -83,7 +83,7 @@ set_module_type(shell32 win32dll UNICODE) target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin) -add_delay_importlibs(shell32 uxtheme ole32 userenv version fmifs) -add_importlibs(shell32 advapi32 browseui gdi32 user32 powrprof comctl32 comdlg32 shdocvw shlwapi devmgr winspool winmm msvcrt kernel32 ntdll mpr) +add_delay_importlibs(shell32 uxtheme ole32 userenv version fmifs shdocvw comctl32 browseui shlwapi comdlg32) +add_importlibs(shell32 advapi32 gdi32 user32 powrprof devmgr winspool winmm mpr msvcrt kernel32 ntdll) add_pch(shell32 precomp.h SOURCE) add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all)
8 years, 9 months
1
0
0
0
[akhaldi] 71113: [WINTRUST] Import Wine Staging commit bdb15cf by Mark Jansen: Verify image hash in WinVerifyTrust. CORE-10923
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Apr 7 14:23:55 2016 New Revision: 71113 URL:
http://svn.reactos.org/svn/reactos?rev=71113&view=rev
Log: [WINTRUST] Import Wine Staging commit bdb15cf by Mark Jansen: Verify image hash in WinVerifyTrust. CORE-10923 Modified: trunk/reactos/dll/win32/wintrust/softpub.c Modified: trunk/reactos/dll/win32/wintrust/softpub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wintrust/softpub…
============================================================================== --- trunk/reactos/dll/win32/wintrust/softpub.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wintrust/softpub.c [iso-8859-1] Thu Apr 7 14:23:55 2016 @@ -1,5 +1,6 @@ /* * Copyright 2007 Juan Lang + * Copyright 2016 Mark Jansen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -198,6 +199,170 @@ TRACE("returning %d\n", err); return err; } + +/* See
https://www.cs.auckland.ac.nz/~pgut001/pubs/authenticode.txt
+ * for details about the hashing. + */ +static BOOL SOFTPUB_HashPEFile(BYTE *file, LARGE_INTEGER *size, HCRYPTHASH hash) +{ + IMAGE_DOS_HEADER *dosheader = (IMAGE_DOS_HEADER *)file; + IMAGE_NT_HEADERS *ntheader; + IMAGE_DATA_DIRECTORY *security_dir; + DWORD *checksum; + + if (sizeof(dosheader) > size->QuadPart) + return FALSE; + + if (dosheader->e_magic != IMAGE_DOS_SIGNATURE) + { + ERR("Unrecognized IMAGE_DOS_HEADER magic %04x\n", dosheader->e_magic); + return FALSE; + } + + if (dosheader->e_lfanew >= 256 * 1024 * 1024) /* see RtlImageNtHeaderEx */ + return FALSE; + if (dosheader->e_lfanew + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader.MajorLinkerVersion) > size->QuadPart) + return FALSE; + + ntheader = (IMAGE_NT_HEADERS *)(file + dosheader->e_lfanew); + if (ntheader->Signature != IMAGE_NT_SIGNATURE) + { + ERR("Unrecognized IMAGE_NT_HEADERS signature %08x\n", ntheader->Signature); + return FALSE; + } + + if (ntheader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + IMAGE_NT_HEADERS32 *nt32 = (IMAGE_NT_HEADERS32 *)ntheader; + if (dosheader->e_lfanew + sizeof(nt32) > size->QuadPart) + return FALSE; + + checksum = &nt32->OptionalHeader.CheckSum; + security_dir = &nt32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + } + else if (ntheader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) + { + IMAGE_NT_HEADERS64 *nt64 = (IMAGE_NT_HEADERS64 *)ntheader; + if (dosheader->e_lfanew + sizeof(nt64) > size->QuadPart) + return FALSE; + + checksum = &nt64->OptionalHeader.CheckSum; + security_dir = &nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; + } + else + { + ERR("Unrecognized OptionalHeader magic %04x\n", ntheader->OptionalHeader.Magic); + return FALSE; + } + + if (security_dir->VirtualAddress < (BYTE *)(security_dir + 1) - file) + return FALSE; + if (security_dir->VirtualAddress > size->QuadPart) + return FALSE; + if (security_dir->VirtualAddress + security_dir->Size != size->QuadPart) + return FALSE; + + /* Hash until checksum. */ + if (!CryptHashData(hash, file, (BYTE *)checksum - file, 0)) + return FALSE; + + /* Hash until the DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] entry. */ + if (!CryptHashData(hash, (BYTE *)(checksum + 1), (BYTE *)security_dir - (BYTE *)(checksum + 1), 0)) + return FALSE; + + /* Hash until the end of the file. */ + if (!CryptHashData(hash, (BYTE *)(security_dir + 1), + file + security_dir->VirtualAddress - (BYTE *)(security_dir + 1), 0)) + return FALSE; + + return TRUE; +} + +static DWORD SOFTPUB_VerifyImageHash(CRYPT_PROVIDER_DATA *data, HANDLE file) +{ + SPC_INDIRECT_DATA_CONTENT *indirect = (SPC_INDIRECT_DATA_CONTENT *)data->u.pPDSip->psIndirectData; + DWORD err, hash_size, length; + BYTE *hash_data, *file_map = NULL; + LARGE_INTEGER file_size; + BOOL release_prov = FALSE; + HCRYPTPROV prov = data->hProv; + HCRYPTHASH hash = 0; + ALG_ID algID; + HANDLE map = NULL; + + if (((ULONG_PTR)indirect->Data.pszObjId >> 16) == 0 || + strcmp(indirect->Data.pszObjId, SPC_PE_IMAGE_DATA_OBJID)) + { + FIXME("Cannot verify hash for pszObjId=%s\n", debugstr_a(indirect->Data.pszObjId)); + return ERROR_SUCCESS; + } + + if (!(algID = CertOIDToAlgId(indirect->DigestAlgorithm.pszObjId))) + return TRUST_E_SYSTEM_ERROR; /* FIXME */ + + if (!prov) + { + if (!CryptAcquireContextW(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) + return GetLastError(); + release_prov = TRUE; + } + + if (!CryptCreateHash(prov, algID, 0, 0, &hash)) + { + err = GetLastError(); + goto done; + } + + if (!GetFileSizeEx(file, &file_size) || + !(map = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL)) || + !(file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0))) + { + err = GetLastError(); + goto done; + } + + if (!SOFTPUB_HashPEFile(file_map, &file_size, hash)) + { + err = TRUST_E_NOSIGNATURE; + goto done; + } + + length = sizeof(hash_size); + if (!CryptGetHashParam(hash, HP_HASHSIZE, (BYTE *)&hash_size, &length, 0)) + { + err = GetLastError(); + goto done; + } + + if (!(hash_data = data->psPfns->pfnAlloc(hash_size))) + { + err = ERROR_OUTOFMEMORY; + goto done; + } + + if (!CryptGetHashParam(hash, HP_HASHVAL, hash_data, &hash_size, 0)) + { + err = GetLastError(); + data->psPfns->pfnFree(hash_data); + goto done; + } + + err = (hash_size == indirect->Digest.cbData && + !memcmp(hash_data, indirect->Digest.pbData, hash_size)) ? S_OK : TRUST_E_BAD_DIGEST; + data->psPfns->pfnFree(hash_data); + +done: + if (file_map) + UnmapViewOfFile(file_map); + if (map) + CloseHandle(map); + if (hash) + CryptDestroyHash(hash); + if (release_prov) + CryptReleaseContext(prov, 0); + return err; +} + static DWORD SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) { @@ -362,6 +527,9 @@ if (err) goto error; err = SOFTPUB_DecodeInnerContent(data); + if (err) + goto error; + err = SOFTPUB_VerifyImageHash(data, data->pWintrustData->u.pFile->hFile); error: if (err && data->fOpenedFile && data->pWintrustData->u.pFile)
8 years, 9 months
1
0
0
0
[akhaldi] 71112: [DBGHELP] Stub dbghelp. CORE-2990
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Apr 7 13:58:19 2016 New Revision: 71112 URL:
http://svn.reactos.org/svn/reactos?rev=71112&view=rev
Log: [DBGHELP] Stub dbghelp. CORE-2990 Modified: trunk/reactos/dll/win32/dbghelp/dbghelp.spec Modified: trunk/reactos/dll/win32/dbghelp/dbghelp.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dbghelp.…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/dbghelp.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/dbghelp.spec [iso-8859-1] Thu Apr 7 13:58:19 2016 @@ -192,7 +192,7 @@ @ stdcall WinDbgExtensionDllInit(ptr long long) #@ stdcall block #@ stdcall chksym -#@ stdcall dbghelp +@ stdcall -stub dbghelp(ptr ptr) #@ stdcall dh #@ stdcall fptr #@ stdcall homedir
8 years, 9 months
1
0
0
0
[tfaber] 71111: [NTOS:IO] - Do not leak ServiceName in IopInitializeBuiltinDriver CORE-11084 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Apr 6 20:10:09 2016 New Revision: 71111 URL:
http://svn.reactos.org/svn/reactos?rev=71111&view=rev
Log: [NTOS:IO] - Do not leak ServiceName in IopInitializeBuiltinDriver CORE-11084 #resolve Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Wed Apr 6 20:10:09 2016 @@ -919,6 +919,7 @@ NULL, &ServiceName, &DeviceNode); + RtlFreeUnicodeString(&ServiceName); if (!NT_SUCCESS(Status)) { DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status);
8 years, 9 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Results per page:
10
25
50
100
200