winehq.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
February
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2014
----- 2025 -----
February 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
814 discussions
Start a n
N
ew thread
Nikolay Sivov : scrrun: Implement IEnumVARIANT stub for folder collection.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 47e1ac9f98ddc158bb69ae8c6594dc598af9e99d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47e1ac9f98ddc158bb69ae8c6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 3 16:35:07 2014 +0400 scrrun: Implement IEnumVARIANT stub for folder collection. --- dlls/scrrun/filesystem.c | 132 +++++++++++++++++++++++++++++++++++++++- dlls/scrrun/tests/filesystem.c | 53 ++++++++++++++++- 2 files changed, 182 insertions(+), 3 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index c96ae6d..5459b7e 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -36,6 +36,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun); +struct enumdata { + union + { + struct + { + IFolderCollection *coll; + } foldercoll; + } u; +}; + +struct enumvariant { + IEnumVARIANT IEnumVARIANT_iface; + LONG ref; + + struct enumdata data; +}; + struct foldercollection { IFolderCollection IFolderCollection_iface; LONG ref; @@ -87,6 +104,11 @@ static inline struct foldercollection *impl_from_IFolderCollection(IFolderCollec return CONTAINING_RECORD(iface, struct foldercollection, IFolderCollection_iface); } +static inline struct enumvariant *impl_from_IEnumVARIANT(IEnumVARIANT *iface) +{ + return CONTAINING_RECORD(iface, struct enumvariant, IEnumVARIANT_iface); +} + static inline HRESULT create_error(DWORD err) { switch(err) { @@ -348,6 +370,107 @@ static HRESULT create_textstream(IOMode mode, ITextStream **ret) return S_OK; } +static HRESULT WINAPI enumvariant_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **obj) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + *obj = NULL; + + if (IsEqualIID( riid, &IID_IEnumVARIANT ) || + IsEqualIID( riid, &IID_IUnknown )) + { + *obj = iface; + IEnumVARIANT_AddRef(iface); + } + else + return E_NOINTERFACE; + + return S_OK; +} + +static ULONG WINAPI enumvariant_AddRef(IEnumVARIANT *iface) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI foldercoll_enumvariant_Release(IEnumVARIANT *iface) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) + { + IFolderCollection_Release(This->data.u.foldercoll.coll); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI foldercoll_enumvariant_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p)->(%d %p %p): stub\n", This, celt, var, fetched); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p)->(%d): stub\n", This, celt); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_enumvariant_Reset(IEnumVARIANT *iface) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p): stub\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_enumvariant_Clone(IEnumVARIANT *iface, IEnumVARIANT **pclone) +{ + struct enumvariant *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p)->(%p): stub\n", This, pclone); + return E_NOTIMPL; +} + +static const IEnumVARIANTVtbl foldercollenumvariantvtbl = { + enumvariant_QueryInterface, + enumvariant_AddRef, + foldercoll_enumvariant_Release, + foldercoll_enumvariant_Next, + foldercoll_enumvariant_Skip, + foldercoll_enumvariant_Reset, + foldercoll_enumvariant_Clone +}; + +static HRESULT create_foldercoll_enum(struct foldercollection *collection, IUnknown **newenum) +{ + struct enumvariant *This; + + *newenum = NULL; + + This = heap_alloc(sizeof(*This)); + if (!This) return E_OUTOFMEMORY; + + This->IEnumVARIANT_iface.lpVtbl = &foldercollenumvariantvtbl; + This->ref = 1; + This->data.u.foldercoll.coll = &collection->IFolderCollection_iface; + IFolderCollection_AddRef(This->data.u.foldercoll.coll); + + *newenum = (IUnknown*)&This->IEnumVARIANT_iface; + + return S_OK; +} + static HRESULT WINAPI foldercoll_QueryInterface(IFolderCollection *iface, REFIID riid, void **obj) { struct foldercollection *This = impl_from_IFolderCollection(iface); @@ -468,8 +591,13 @@ static HRESULT WINAPI foldercoll_get_Item(IFolderCollection *iface, VARIANT key, static HRESULT WINAPI foldercoll_get__NewEnum(IFolderCollection *iface, IUnknown **newenum) { struct foldercollection *This = impl_from_IFolderCollection(iface); - FIXME("(%p)->(%p): stub\n", This, newenum); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, newenum); + + if(!newenum) + return E_POINTER; + + return create_foldercoll_enum(This, newenum); } static HRESULT WINAPI foldercoll_get_Count(IFolderCollection *iface, LONG *count) diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index 23cbd2c..b373df4 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -33,6 +33,15 @@ static IFileSystem3 *fs3; +static inline ULONG get_refcount(IUnknown *iface) +{ + IUnknown_AddRef(iface); + return IUnknown_Release(iface); +} + +#define GET_REFCOUNT(iface) \ + get_refcount((IUnknown*)iface) + static void test_interfaces(void) { static const WCHAR nonexistent_dirW[] = { @@ -781,7 +790,9 @@ static void test_FolderCollection(void) static const WCHAR bW[] = {'\\','b',0}; IFolderCollection *folders; WCHAR buffW[MAX_PATH], pathW[MAX_PATH], path2W[MAX_PATH]; - LONG count, count2; + IEnumVARIANT *enumvar, *clone; + LONG count, count2, ref, ref2; + IUnknown *unk, *unk2; IFolder *folder; HRESULT hr; BSTR str; @@ -818,6 +829,46 @@ static void test_FolderCollection(void) ok(hr == S_OK, "got 0x%08x\n", hr); ok(count2 > count, "got %d, %d\n", count, count2); + hr = IFolderCollection_get__NewEnum(folders, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IFolderCollection_QueryInterface(folders, &IID_IEnumVARIANT, (void**)&unk); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + + /* NewEnum creates new instance each time it's called */ + ref = GET_REFCOUNT(folders); + + unk = NULL; + hr = IFolderCollection_get__NewEnum(folders, &unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + + ref2 = GET_REFCOUNT(folders); + ok(ref2 == ref + 1, "got %d, %d\n", ref2, ref); + + unk2 = NULL; + hr = IFolderCollection_get__NewEnum(folders, &unk2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(unk != unk2, "got %p, %p\n", unk2, unk); + IUnknown_Release(unk2); + + /* now get IEnumVARIANT */ + ref = GET_REFCOUNT(folders); + hr = IUnknown_QueryInterface(unk, &IID_IEnumVARIANT, (void**)&enumvar); + ok(hr == S_OK, "got 0x%08x\n", hr); + ref2 = GET_REFCOUNT(folders); + ok(ref2 == ref, "got %d, %d\n", ref2, ref); + + /* clone enumerator */ + hr = IEnumVARIANT_Clone(enumvar, &clone); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(clone != enumvar, "got %p, %p\n", enumvar, clone); + IEnumVARIANT_Release(clone); +} + IEnumVARIANT_Release(enumvar); + IUnknown_Release(unk); + RemoveDirectoryW(pathW); RemoveDirectoryW(path2W);
1
0
0
0
Nikolay Sivov : scrrun: Implement Count() property for folder collection.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 51f5ab19990b453efdb5013e576984039b306b51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51f5ab19990b453efdb5013e5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 3 16:34:44 2014 +0400 scrrun: Implement Count() property for folder collection. --- dlls/scrrun/filesystem.c | 42 ++++++++++++++++++++++++++++++++++++--- dlls/scrrun/tests/filesystem.c | 30 ++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 949173a..c96ae6d 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -39,6 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun); struct foldercollection { IFolderCollection IFolderCollection_iface; LONG ref; + BSTR path; }; struct folder { @@ -383,7 +384,10 @@ static ULONG WINAPI foldercoll_Release(IFolderCollection *iface) TRACE("(%p)->(%d)\n", This, ref); if (!ref) + { + SysFreeString(This->path); heap_free(This); + } return ref; } @@ -471,8 +475,32 @@ static HRESULT WINAPI foldercoll_get__NewEnum(IFolderCollection *iface, IUnknown static HRESULT WINAPI foldercoll_get_Count(IFolderCollection *iface, LONG *count) { struct foldercollection *This = impl_from_IFolderCollection(iface); - FIXME("(%p)->(%p): stub\n", This, count); - return E_NOTIMPL; + static const WCHAR allW[] = {'\\','*',0}; + WIN32_FIND_DATAW data; + WCHAR pathW[MAX_PATH]; + HANDLE handle; + + TRACE("(%p)->(%p)\n", This, count); + + if(!count) + return E_POINTER; + + *count = 0; + + strcpyW(pathW, This->path); + strcatW(pathW, allW); + handle = FindFirstFileW(pathW, &data); + if (handle == INVALID_HANDLE_VALUE) + return HRESULT_FROM_WIN32(GetLastError()); + + do + { + if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + *count += 1; + } while (FindNextFileW(handle, &data)); + FindClose(handle); + + return S_OK; } static const IFolderCollectionVtbl foldercollvtbl = { @@ -489,7 +517,7 @@ static const IFolderCollectionVtbl foldercollvtbl = { foldercoll_get_Count }; -static HRESULT create_foldercoll(IFolderCollection **folders) +static HRESULT create_foldercoll(BSTR path, IFolderCollection **folders) { struct foldercollection *This; @@ -500,6 +528,12 @@ static HRESULT create_foldercoll(IFolderCollection **folders) This->IFolderCollection_iface.lpVtbl = &foldercollvtbl; This->ref = 1; + This->path = SysAllocString(path); + if (!This->path) + { + heap_free(This); + return E_OUTOFMEMORY; + } *folders = &This->IFolderCollection_iface; @@ -744,7 +778,7 @@ static HRESULT WINAPI folder_get_SubFolders(IFolder *iface, IFolderCollection ** if(!folders) return E_POINTER; - return create_foldercoll(folders); + return create_foldercoll(This->path, folders); } static HRESULT WINAPI folder_get_Files(IFolder *iface, IFileCollection **files) diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index b5d2e1f..23cbd2c 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -777,13 +777,17 @@ static void test_GetFolder(void) static void test_FolderCollection(void) { + static const WCHAR aW[] = {'\\','a',0}; + static const WCHAR bW[] = {'\\','b',0}; IFolderCollection *folders; - WCHAR buffW[MAX_PATH]; + WCHAR buffW[MAX_PATH], pathW[MAX_PATH], path2W[MAX_PATH]; + LONG count, count2; IFolder *folder; HRESULT hr; BSTR str; - GetWindowsDirectoryW(buffW, MAX_PATH); + GetTempPathW(MAX_PATH, buffW); + str = SysAllocString(buffW); hr = IFileSystem3_GetFolder(fs3, str, &folder); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -792,9 +796,31 @@ static void test_FolderCollection(void) hr = IFolder_get_SubFolders(folder, NULL); ok(hr == E_POINTER, "got 0x%08x\n", hr); + lstrcpyW(pathW, buffW); + lstrcatW(pathW, aW); + CreateDirectoryW(pathW, NULL); + hr = IFolder_get_SubFolders(folder, &folders); ok(hr == S_OK, "got 0x%08x\n", hr); + count = 0; + hr = IFolderCollection_get_Count(folders, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count > 0, "got %d\n", count); + + lstrcpyW(path2W, buffW); + lstrcatW(path2W, bW); + CreateDirectoryW(path2W, NULL); + + /* every time property is requested it scans directory */ + count2 = 0; + hr = IFolderCollection_get_Count(folders, &count2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count2 > count, "got %d, %d\n", count, count2); + + RemoveDirectoryW(pathW); + RemoveDirectoryW(path2W); + IFolderCollection_Release(folders); IFolder_Release(folder); }
1
0
0
0
Nikolay Sivov : scrrun: Fix IFolder::QueryInterface() to respond to IDispatch query.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 0802e301ffcdc261eeb5be3b8dd89c7295a36dce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0802e301ffcdc261eeb5be3b8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 3 16:34:24 2014 +0400 scrrun: Fix IFolder::QueryInterface() to respond to IDispatch query. --- dlls/scrrun/filesystem.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 1d2beda..949173a 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -514,8 +514,9 @@ static HRESULT WINAPI folder_QueryInterface(IFolder *iface, REFIID riid, void ** *obj = NULL; - if (IsEqualGUID( riid, &IID_IFolder ) || - IsEqualGUID( riid, &IID_IUnknown)) + if (IsEqualIID( riid, &IID_IFolder ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown)) { *obj = iface; IFolder_AddRef(iface);
1
0
0
0
Nikolay Sivov : scrrun: Added IFolderCollection stub.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 2a3f1560bb403d387a67ef99aae6e2e56b2e476b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a3f1560bb403d387a67ef99a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 3 16:33:43 2014 +0400 scrrun: Added IFolderCollection stub. --- dlls/scrrun/filesystem.c | 178 +++++++++++++++++++++++++++++++++++++++- dlls/scrrun/scrrun.c | 1 + dlls/scrrun/scrrun_private.h | 1 + dlls/scrrun/tests/filesystem.c | 25 ++++++ 4 files changed, 203 insertions(+), 2 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 1254532..1d2beda 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -36,6 +36,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun); +struct foldercollection { + IFolderCollection IFolderCollection_iface; + LONG ref; +}; + struct folder { IFolder IFolder_iface; LONG ref; @@ -76,6 +81,11 @@ static inline struct textstream *impl_from_ITextStream(ITextStream *iface) return CONTAINING_RECORD(iface, struct textstream, ITextStream_iface); } +static inline struct foldercollection *impl_from_IFolderCollection(IFolderCollection *iface) +{ + return CONTAINING_RECORD(iface, struct foldercollection, IFolderCollection_iface); +} + static inline HRESULT create_error(DWORD err) { switch(err) { @@ -337,6 +347,165 @@ static HRESULT create_textstream(IOMode mode, ITextStream **ret) return S_OK; } +static HRESULT WINAPI foldercoll_QueryInterface(IFolderCollection *iface, REFIID riid, void **obj) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + *obj = NULL; + + if (IsEqualIID( riid, &IID_IFolderCollection ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown )) + { + *obj = iface; + IFolderCollection_AddRef(iface); + } + else + return E_NOINTERFACE; + + return S_OK; +} + +static ULONG WINAPI foldercoll_AddRef(IFolderCollection *iface) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI foldercoll_Release(IFolderCollection *iface) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI foldercoll_GetTypeInfoCount(IFolderCollection *iface, UINT *pctinfo) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + TRACE("(%p)->(%p)\n", This, pctinfo); + *pctinfo = 1; + return S_OK; +} + +static HRESULT WINAPI foldercoll_GetTypeInfo(IFolderCollection *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); + return get_typeinfo(IFolderCollection_tid, ppTInfo); +} + +static HRESULT WINAPI foldercoll_GetIDsOfNames(IFolderCollection *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + + hr = get_typeinfo(IFolderCollection_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); + ITypeInfo_Release(typeinfo); + } + + return hr; +} + +static HRESULT WINAPI foldercoll_Invoke(IFolderCollection *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, + DISPPARAMS *pDispParams, VARIANT *pVarResult, + EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + hr = get_typeinfo(IFolderCollection_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + ITypeInfo_Release(typeinfo); + } + + return hr; +} + +static HRESULT WINAPI foldercoll_Add(IFolderCollection *iface, BSTR name, IFolder **folder) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(name), folder); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_get_Item(IFolderCollection *iface, VARIANT key, IFolder **folder) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + FIXME("(%p)->(%p): stub\n", This, folder); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_get__NewEnum(IFolderCollection *iface, IUnknown **newenum) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + FIXME("(%p)->(%p): stub\n", This, newenum); + return E_NOTIMPL; +} + +static HRESULT WINAPI foldercoll_get_Count(IFolderCollection *iface, LONG *count) +{ + struct foldercollection *This = impl_from_IFolderCollection(iface); + FIXME("(%p)->(%p): stub\n", This, count); + return E_NOTIMPL; +} + +static const IFolderCollectionVtbl foldercollvtbl = { + foldercoll_QueryInterface, + foldercoll_AddRef, + foldercoll_Release, + foldercoll_GetTypeInfoCount, + foldercoll_GetTypeInfo, + foldercoll_GetIDsOfNames, + foldercoll_Invoke, + foldercoll_Add, + foldercoll_get_Item, + foldercoll_get__NewEnum, + foldercoll_get_Count +}; + +static HRESULT create_foldercoll(IFolderCollection **folders) +{ + struct foldercollection *This; + + *folders = NULL; + + This = heap_alloc(sizeof(struct foldercollection)); + if (!This) return E_OUTOFMEMORY; + + This->IFolderCollection_iface.lpVtbl = &foldercollvtbl; + This->ref = 1; + + *folders = &This->IFolderCollection_iface; + + return S_OK; +} + static HRESULT WINAPI folder_QueryInterface(IFolder *iface, REFIID riid, void **obj) { struct folder *This = impl_from_IFolder(iface); @@ -568,8 +737,13 @@ static HRESULT WINAPI folder_get_Size(IFolder *iface, VARIANT *size) static HRESULT WINAPI folder_get_SubFolders(IFolder *iface, IFolderCollection **folders) { struct folder *This = impl_from_IFolder(iface); - FIXME("(%p)->(%p): stub\n", This, folders); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, folders); + + if(!folders) + return E_POINTER; + + return create_foldercoll(folders); } static HRESULT WINAPI folder_get_Files(IFolder *iface, IFileCollection **files) diff --git a/dlls/scrrun/scrrun.c b/dlls/scrrun/scrrun.c index 3739e30..761e2d6 100644 --- a/dlls/scrrun/scrrun.c +++ b/dlls/scrrun/scrrun.c @@ -105,6 +105,7 @@ static REFIID tid_ids[] = { &IID_IDictionary, &IID_IFileSystem3, &IID_IFolder, + &IID_IFolderCollection, &IID_ITextStream, &IID_IFile }; diff --git a/dlls/scrrun/scrrun_private.h b/dlls/scrrun/scrrun_private.h index aa24dde..2c6aba5 100644 --- a/dlls/scrrun/scrrun_private.h +++ b/dlls/scrrun/scrrun_private.h @@ -27,6 +27,7 @@ typedef enum tid_t IDictionary_tid, IFileSystem3_tid, IFolder_tid, + IFolderCollection_tid, ITextStream_tid, IFile_tid, LAST_tid diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index a6c5980..b5d2e1f 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -775,6 +775,30 @@ static void test_GetFolder(void) IFolder_Release(folder); } +static void test_FolderCollection(void) +{ + IFolderCollection *folders; + WCHAR buffW[MAX_PATH]; + IFolder *folder; + HRESULT hr; + BSTR str; + + GetWindowsDirectoryW(buffW, MAX_PATH); + str = SysAllocString(buffW); + hr = IFileSystem3_GetFolder(fs3, str, &folder); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + hr = IFolder_get_SubFolders(folder, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IFolder_get_SubFolders(folder, &folders); + ok(hr == S_OK, "got 0x%08x\n", hr); + + IFolderCollection_Release(folders); + IFolder_Release(folder); +} + START_TEST(filesystem) { HRESULT hr; @@ -800,6 +824,7 @@ START_TEST(filesystem) test_CopyFolder(); test_BuildPath(); test_GetFolder(); + test_FolderCollection(); IFileSystem3_Release(fs3);
1
0
0
0
Nikolay Sivov : scrrun: Use DISPID_VALUE instead of 0 in private idl.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: c84189609da41c584fc395ced8213b81ce50ba7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c84189609da41c584fc395ced…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 3 14:26:01 2014 +0400 scrrun: Use DISPID_VALUE instead of 0 in private idl. --- dlls/scrrun/scrrun.idl | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/scrrun/scrrun.idl b/dlls/scrrun/scrrun.idl index 98bd8b9..73948b5 100644 --- a/dlls/scrrun/scrrun.idl +++ b/dlls/scrrun/scrrun.idl @@ -116,13 +116,13 @@ library Scripting ] interface IDictionary : IDispatch { - [id(00000000), propputref] + [id(DISPID_VALUE), propputref] HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem); - [id(00000000), propput] + [id(DISPID_VALUE), propput] HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem); - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT* Key, [out, retval] VARIANT* pRetItem); [id(0x00000001)] @@ -263,7 +263,7 @@ library Scripting oleautomation ] interface IDriveCollection : IDispatch { - [id(00000000)] + [id(DISPID_VALUE)] HRESULT Item([in] VARIANT Key, [out, retval] IDrive** ppdrive); [id(DISPID_NEWENUM), propget, restricted, hidden] @@ -283,7 +283,7 @@ library Scripting ] interface IDrive : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); [id(0x00002710), propget] @@ -333,7 +333,7 @@ library Scripting ] interface IFolder : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); [id(0x000003e8), propget] @@ -411,7 +411,7 @@ library Scripting [id(0x00000002)] HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder); - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder); [id(DISPID_NEWENUM), propget, restricted, hidden] @@ -431,7 +431,7 @@ library Scripting ] interface IFileCollection : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile); [id(DISPID_NEWENUM), propget, restricted, hidden] @@ -451,7 +451,7 @@ library Scripting ] interface IFile : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); [id(0x000003e8), propget] @@ -582,7 +582,7 @@ library Scripting ] interface IScriptEncoder : IDispatch { - [id(00000000)] + [id(DISPID_VALUE)] HRESULT EncodeScriptFile([in] BSTR szExt, [in] BSTR bstrStreamIn, [in] long cFlags, [in] BSTR bstrDefaultLang, [out, retval] BSTR* pbstrStreamOut); }
1
0
0
0
Francois Gouget : ddraw/tests: Fix compilation on systems that don' t support nameless unions.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 1f26451964e0c9fe8944f06a7186b1b5d24e61c7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f26451964e0c9fe8944f06a7…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Jan 3 10:22:51 2014 +0100 ddraw/tests: Fix compilation on systems that don't support nameless unions. --- dlls/ddraw/tests/ddraw4.c | 24 ++++++++++++------------ dlls/ddraw/tests/ddraw7.c | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index f215f12..df1a23c 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -5496,12 +5496,12 @@ static void test_user_memory_getdc(void) ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT; ddsd.dwWidth = 16; ddsd.dwHeight = 16; - ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; - U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; - U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; - U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); @@ -5555,12 +5555,12 @@ static void test_sysmem_overlay(void) ddsd.dwWidth = 16; ddsd.dwHeight = 16; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OVERLAY; - ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; - U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; - U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; - U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 18e1823..e36927e 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -5390,12 +5390,12 @@ static void test_user_memory_getdc(void) ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_PIXELFORMAT; ddsd.dwWidth = 16; ddsd.dwHeight = 16; - ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; - U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; - U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; - U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); @@ -5449,12 +5449,12 @@ static void test_sysmem_overlay(void) ddsd.dwWidth = 16; ddsd.dwHeight = 16; ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OVERLAY; - ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); - ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; - U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; - U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; - U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; - U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); + U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x000000ff; hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); ok(hr == DDERR_NOOVERLAYHW, "Got unexpected hr %#x.\n", hr);
1
0
0
0
Frédéric Delanoy : winedump: Use BOOL type where appropriate.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 201e49d4aa66cbc907841d8c6b94f9a40daf7984 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=201e49d4aa66cbc907841d8c6…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Jan 3 01:57:01 2014 +0100 winedump: Use BOOL type where appropriate. --- tools/winedump/main.c | 2 +- tools/winedump/search.c | 8 ++++---- tools/winedump/winedump.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/winedump/main.c b/tools/winedump/main.c index 9b076e1..ca2047b 100644 --- a/tools/winedump/main.c +++ b/tools/winedump/main.c @@ -447,7 +447,7 @@ int main (int argc, char *argv[]) int result = symbol_demangle (&symbol); if (result) - result = symbol_search (&symbol); + result = !symbol_search (&symbol); if (!result && symbol.function_name) /* Clean up the prototype */ diff --git a/tools/winedump/search.c b/tools/winedump/search.c index 7b3a98f..08aa8e1 100644 --- a/tools/winedump/search.c +++ b/tools/winedump/search.c @@ -36,7 +36,7 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg); * Call Patrik Stridvall's 'function_grep.pl' script to retrieve a * function prototype from include file(s) */ -int symbol_search (parsed_symbol *sym) +BOOL symbol_search (parsed_symbol *sym) { static const size_t MAX_RESULT_LEN = 1024; FILE *grep; @@ -47,7 +47,7 @@ int symbol_search (parsed_symbol *sym) assert (sym && sym->symbol); if (!symbol_is_valid_c (sym)) - return - 1; + return FALSE; if (!grep_buff) grep_buff = malloc (MAX_RESULT_LEN); @@ -137,7 +137,7 @@ int symbol_search (parsed_symbol *sym) { pclose (f_grep); pclose (grep); - return 0; /* OK */ + return TRUE; /* OK */ } if (VERBOSE) puts ("Failed, trying next"); @@ -152,7 +152,7 @@ int symbol_search (parsed_symbol *sym) attempt++; } - return -1; /* Not found */ + return FALSE; /* Not found */ } diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index ea7fc87..754a7d2 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -166,7 +166,7 @@ void symbol_init(parsed_symbol* symbol, const char* name); int symbol_demangle (parsed_symbol *symbol); -int symbol_search (parsed_symbol *symbol); +BOOL symbol_search (parsed_symbol *symbol); void symbol_clear(parsed_symbol *sym);
1
0
0
0
Martin Storsjo : ntdll: Improve handling of THUMB_MOV32 relocations.
by Alexandre Julliard
03 Jan '14
03 Jan '14
Module: wine Branch: master Commit: 48ae8f307007117f68ef1d40e5f3e4816e9e1802 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48ae8f307007117f68ef1d40e…
Author: Martin Storsjo <martin(a)martin.st> Date: Thu Jan 2 23:24:57 2014 +0200 ntdll: Improve handling of THUMB_MOV32 relocations. --- dlls/ntdll/loader.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index e0907e7..e25ba1f 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2230,19 +2230,19 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count DWORD inst = *(INT_PTR *)((char *)page + offset); DWORD imm16 = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) + ((inst >> 20) & 0x0700) + ((inst >> 16) & 0x00ff); + DWORD hi_delta; if ((inst & 0x8000fbf0) != 0x0000f240) ERR("wrong Thumb2 instruction %08x, expected MOVW\n", inst); imm16 += LOWORD(delta); - if (imm16 > 0xffff) - ERR("resulting immediate value won't fit: %08x\n", imm16); + hi_delta = HIWORD(delta) + HIWORD(imm16); *(INT_PTR *)((char *)page + offset) = (inst & 0x8f00fbf0) + ((imm16 >> 1) & 0x0400) + ((imm16 >> 12) & 0x000f) + ((imm16 << 20) & 0x70000000) + ((imm16 << 16) & 0xff0000); - if (delta > 0xffff) + if (hi_delta != 0) { inst = *(INT_PTR *)((char *)page + offset + 4); imm16 = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) + @@ -2251,7 +2251,7 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count if ((inst & 0x8000fbf0) != 0x0000f2c0) ERR("wrong Thumb2 instruction %08x, expected MOVT\n", inst); - imm16 += HIWORD(delta); + imm16 += hi_delta; if (imm16 > 0xffff) ERR("resulting immediate value won't fit: %08x\n", imm16); *(INT_PTR *)((char *)page + offset + 4) = (inst & 0x8f00fbf0) +
1
0
0
0
Nikolay Sivov : scrrun: Implement GetFolder().
by Alexandre Julliard
02 Jan '14
02 Jan '14
Module: wine Branch: master Commit: f76f34ca23990f02ba20e5957609ee0c2335b124 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f76f34ca23990f02ba20e5957…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 2 21:27:45 2014 +0400 scrrun: Implement GetFolder(). --- dlls/scrrun/filesystem.c | 19 ++++++++++++++++--- dlls/scrrun/tests/filesystem.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 2753ecc..1254532 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -1410,11 +1410,24 @@ static HRESULT WINAPI filesys_GetFile(IFileSystem3 *iface, BSTR FilePath, } static HRESULT WINAPI filesys_GetFolder(IFileSystem3 *iface, BSTR FolderPath, - IFolder **ppfolder) + IFolder **folder) { - FIXME("%p %s %p\n", iface, debugstr_w(FolderPath), ppfolder); + DWORD attrs; - return E_NOTIMPL; + TRACE("%p %s %p\n", iface, debugstr_w(FolderPath), folder); + + if(!folder) + return E_POINTER; + + *folder = NULL; + if(!FolderPath) + return E_INVALIDARG; + + attrs = GetFileAttributesW(FolderPath); + if((attrs == INVALID_FILE_ATTRIBUTES) || !(attrs & FILE_ATTRIBUTE_DIRECTORY)) + return CTL_E_PATHNOTFOUND; + + return create_folder(FolderPath, folder); } static HRESULT WINAPI filesys_GetSpecialFolder(IFileSystem3 *iface, diff --git a/dlls/scrrun/tests/filesystem.c b/dlls/scrrun/tests/filesystem.c index ba0ff37..a6c5980 100644 --- a/dlls/scrrun/tests/filesystem.c +++ b/dlls/scrrun/tests/filesystem.c @@ -739,6 +739,42 @@ static void test_BuildPath(void) } } +static void test_GetFolder(void) +{ + static const WCHAR dummyW[] = {'d','u','m','m','y',0}; + WCHAR buffW[MAX_PATH]; + IFolder *folder; + HRESULT hr; + BSTR str; + + folder = (void*)0xdeadbeef; + hr = IFileSystem3_GetFolder(fs3, NULL, &folder); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(folder == NULL, "got %p\n", folder); + + hr = IFileSystem3_GetFolder(fs3, NULL, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + /* something that doesn't exist */ + str = SysAllocString(dummyW); + + hr = IFileSystem3_GetFolder(fs3, str, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + folder = (void*)0xdeadbeef; + hr = IFileSystem3_GetFolder(fs3, str, &folder); + ok(hr == CTL_E_PATHNOTFOUND, "got 0x%08x\n", hr); + ok(folder == NULL, "got %p\n", folder); + SysFreeString(str); + + GetWindowsDirectoryW(buffW, MAX_PATH); + str = SysAllocString(buffW); + hr = IFileSystem3_GetFolder(fs3, str, &folder); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + IFolder_Release(folder); +} + START_TEST(filesystem) { HRESULT hr; @@ -763,6 +799,7 @@ START_TEST(filesystem) test_GetFile(); test_CopyFolder(); test_BuildPath(); + test_GetFolder(); IFileSystem3_Release(fs3);
1
0
0
0
Nikolay Sivov : scrrun: Store folder path.
by Alexandre Julliard
02 Jan '14
02 Jan '14
Module: wine Branch: master Commit: 2ca39611e1e6261771613f3ee312604ff774c014 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ca39611e1e6261771613f3ee…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 2 21:27:16 2014 +0400 scrrun: Store folder path. --- dlls/scrrun/filesystem.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index 0236492..2753ecc 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -39,6 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun); struct folder { IFolder IFolder_iface; LONG ref; + BSTR path; }; struct file { @@ -371,7 +372,10 @@ static ULONG WINAPI folder_Release(IFolder *iface) TRACE("(%p)->(%d)\n", This, ref); if (!ref) + { + SysFreeString(This->path); heap_free(This); + } return ref; } @@ -614,15 +618,23 @@ static const IFolderVtbl foldervtbl = { folder_CreateTextFile }; -static HRESULT create_folder(IFolder **folder) +static HRESULT create_folder(BSTR path, IFolder **folder) { struct folder *This; + *folder = NULL; + This = heap_alloc(sizeof(struct folder)); if (!This) return E_OUTOFMEMORY; This->IFolder_iface.lpVtbl = &foldervtbl; This->ref = 1; + This->path = SysAllocString(path); + if (!This->path) + { + heap_free(This); + return E_OUTOFMEMORY; + } *folder = &This->IFolder_iface; @@ -1790,7 +1802,7 @@ static HRESULT WINAPI filesys_CreateFolder(IFileSystem3 *iface, BSTR path, return HRESULT_FROM_WIN32(GetLastError()); } - return create_folder(folder); + return create_folder(path, folder); } static HRESULT WINAPI filesys_CreateTextFile(IFileSystem3 *iface, BSTR FileName,
1
0
0
0
← Newer
1
...
73
74
75
76
77
78
79
...
82
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
Results per page:
10
25
50
100
200