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
July 2017
----- 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
2 participants
632 discussions
Start a n
N
ew thread
Rosanne DiMesio : Fix flat comment mode
by Jeremy Newman
26 Jul '17
26 Jul '17
Module: appdb Branch: master Commit: b5db619580757b3a93471701f020e6a8dca35c9e URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=b5db619580757b3a93471701…
Author: Rosanne DiMesio <dimesio(a)earthlink.net> Date: Wed Jul 26 08:46:59 2017 -0500 Fix flat comment mode Fixes bug 12927 and makes flat the default mode. Signed-off-by: Rosanne DiMesio <dimesio(a)earthlink.net> Signed-off-by: Jeremy Newman <jnewman(a)codeweavers.com> --- include/comment.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/include/comment.php b/include/comment.php index 3fb8b94..789dd19 100644 --- a/include/comment.php +++ b/include/comment.php @@ -673,17 +673,24 @@ class Comment { /** * display flat comments */ - public static function display_comments_flat($versionId) + public static function do_display_comments_flat($hResult) { - $hResult = Comment::grab_comments($versionId); - if ($hResult) + while($oRow = query_fetch_object($hResult)) { - while($oRow = query_fetch_object($hResult)) + Comment::view_app_comment($oRow); + $hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId); + if($hResult && query_num_rows($hResult2)) { - Comment::view_app_comment($oRow); + Comment::do_display_comments_flat($hResult2); } } } + + public static function display_comments_flat($versionId, $threadId) + { + $hResult = Comment::grab_comments($versionId, $threadId); + Comment::do_display_comments_flat($hResult); + } public static function view_app_comments($versionId, $threadId = 0) { @@ -731,9 +738,9 @@ class Comment { //hide or display depending on pref if ($_SESSION['current']->isLoggedIn()) - $mode = $_SESSION['current']->getPref("comments:mode", "threaded"); + $mode = $_SESSION['current']->getPref("comments:mode", "flat"); else - $mode = "threaded"; /* default non-logged in users to threaded comment display mode */ + $mode = "flat"; /* default non-logged in users to flat comment display mode */ if ( isset($aClean['sMode']) && $aClean['sMode']=="nested") $mode = "nested"; @@ -741,7 +748,7 @@ class Comment { switch ($mode) { case "flat": - Comment::display_comments_flat($versionId); + Comment::display_comments_flat($versionId, $threadId); break; case "nested": Comment::display_comments_nested($versionId, $threadId);
1
0
0
0
Michael Stefaniuc : dmloader: Get rid of two gratuitous typedefs.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: 4a70f67ffcc57e82c22cc349da01d3aa5db84c71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a70f67ffcc57e82c22cc349d…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:27 2017 +0200 dmloader: Get rid of two gratuitous typedefs. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 1f73697..4b76f32 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -38,12 +38,12 @@ static const GUID *classes[] = { }; /* cache/alias entry */ -typedef struct cache_entry { +struct cache_entry { struct list entry; DMUS_OBJECTDESC Desc; IDirectMusicObject *pObject; BOOL bInvalidDefaultDLS; /* workaround for enabling caching of "faulty" default dls collection */ -} WINE_LOADER_ENTRY, *LPWINE_LOADER_ENTRY; +}; typedef struct IDirectMusicLoaderImpl { IDirectMusicLoader8 IDirectMusicLoader8_iface; @@ -401,7 +401,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac bCache = is_cache_enabled(This, &pDesc->guidClass); if (bCache) { if (!pObjectEntry) { - pObjectEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(WINE_LOADER_ENTRY)); + pObjectEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(*pObjectEntry)); DM_STRUCT_INIT(&pObjectEntry->Desc); DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); pObjectEntry->pObject = pObject; @@ -431,7 +431,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac LPSTREAM pStream; LPDIRECTMUSICOBJECT pObject; DMUS_OBJECTDESC Desc; - LPWINE_LOADER_ENTRY pObjectEntry, pNewEntry; + struct cache_entry *pObjectEntry, *pNewEntry; HRESULT hr; TRACE("(%p)->(%p)\n", This, pDesc); @@ -544,7 +544,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac TRACE(": adding alias entry with following info:\n"); if (TRACE_ON(dmloader)) dump_DMUS_OBJECTDESC(pDesc); - pNewEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(WINE_LOADER_ENTRY)); + pNewEntry = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(*pNewEntry)); /* use this function instead of pure memcpy due to streams (memcpy just copies pointer), which is basically used further by app that called SetDescriptor... better safety than exception */ DMUSIC_CopyDescriptor (&pNewEntry->Desc, pDesc); @@ -652,7 +652,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DMUS_OBJECTDESC Desc; HRESULT result = DMUS_E_LOADER_OBJECTNOTFOUND; - LPWINE_LOADER_ENTRY pObjectEntry = NULL; + struct cache_entry *pObjectEntry; TRACE("(%p, %p)\n", This, pObject); @@ -730,7 +730,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 * { IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DMUS_OBJECTDESC Desc; - LPWINE_LOADER_ENTRY pObjectEntry = NULL; + struct cache_entry *pObjectEntry; HRESULT result = S_FALSE; TRACE("(%p, %p)\n", This, pObject); @@ -844,7 +844,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_EnumObject(IDirectMusicLoader8 *ifa { IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DWORD dwCount = 0; - LPWINE_LOADER_ENTRY pObjectEntry; + struct cache_entry *pObjectEntry; TRACE("(%p, %s, %d, %p)\n", This, debugstr_dmguid(rguidClass), dwIndex, pDesc); DM_STRUCT_INIT(pDesc); @@ -966,7 +966,7 @@ HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) { IDirectMusicLoaderImpl *obj; DMUS_OBJECTDESC Desc; - LPWINE_LOADER_ENTRY pDefaultDLSEntry; + struct cache_entry *dls; struct list *pEntry; TRACE("(%s, %p)\n", debugstr_dmguid(lpcGUID), ppobj); @@ -994,9 +994,9 @@ HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) DMUS_E_LOADER_NOFILENAME for all requests for it; basically, we check if out input guidObject was overwritten */ pEntry = list_head(&obj->cache); - pDefaultDLSEntry = LIST_ENTRY (pEntry, WINE_LOADER_ENTRY, entry); + dls = LIST_ENTRY(pEntry, struct cache_entry, entry); if (!IsEqualGUID(&Desc.guidObject, &GUID_DefaultGMCollection)) { - pDefaultDLSEntry->bInvalidDefaultDLS = TRUE; + dls->bInvalidDefaultDLS = TRUE; } lock_module();
1
0
0
0
Michael Stefaniuc : dmloader: Don't leak memory in the cache.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: ad0dbe3e02fab0e8586a2363c2b887761917f7f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ad0dbe3e02fab0e8586a2363c…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:26 2017 +0200 dmloader: Don't leak memory in the cache. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index bed8cd0..1f73697 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -172,9 +172,7 @@ static ULONG WINAPI IDirectMusicLoaderImpl_Release(IDirectMusicLoader8 *iface) if (!ref) { unsigned int i; - /* Firstly, release the cache */ IDirectMusicLoader8_ClearCache(iface, &GUID_DirectMusicAllTypes); - /* FIXME: Release all allocated entries */ for (i = 0; i < ARRAY_SIZE(classes); i++) HeapFree(GetProcessHeap(), 0, This->search_paths[i]); HeapFree(GetProcessHeap(), 0, This); @@ -806,6 +804,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *ifa (obj->Desc.dwValidData & DMUS_OBJ_LOADED)) { /* basically, wrap to ReleaseObject for each object found */ IDirectMusicLoader8_ReleaseObject(iface, obj->pObject); + list_remove(&obj->entry); + HeapFree(GetProcessHeap(), 0, obj); } }
1
0
0
0
Michael Stefaniuc : dmloader: Simplify the cache list handling.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: 3531e50c936de9387c108d0281789cad1cba0c46 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3531e50c936de9387c108d028…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:25 2017 +0200 dmloader: Simplify the cache list handling. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 69 +++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 52c2524..bed8cd0 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -50,8 +50,7 @@ typedef struct IDirectMusicLoaderImpl { LONG ref; WCHAR *search_paths[ARRAY_SIZE(classes)]; unsigned int cache_class; - /* simple cache */ - struct list *pObjects; + struct list cache; } IDirectMusicLoaderImpl; @@ -190,9 +189,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); HRESULT result = S_OK; HRESULT ret = S_OK; /* used at the end of function, to determine whether everything went OK */ - - struct list *pEntry; - LPWINE_LOADER_ENTRY pObjectEntry = NULL; + struct cache_entry *pExistingEntry, *pObjectEntry = NULL; LPSTREAM pStream; IPersistStream* pPersistStream = NULL; @@ -215,8 +212,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac /* OK, first we iterate through the list of objects we know about; these are either loaded (GetObject, LoadObjectFromFile) or set via SetObject; */ TRACE(": looking if we have object in the cache or if it can be found via alias\n"); - LIST_FOR_EACH(pEntry, This->pObjects) { - LPWINE_LOADER_ENTRY pExistingEntry = LIST_ENTRY(pEntry, WINE_LOADER_ENTRY, entry); + LIST_FOR_EACH_ENTRY(pExistingEntry, &This->cache, struct cache_entry, entry) { if ((pDesc->dwValidData & DMUS_OBJ_OBJECT) && (pExistingEntry->Desc.dwValidData & DMUS_OBJ_OBJECT) && IsEqualGUID (&pDesc->guidObject, &pExistingEntry->Desc.guidObject)) { @@ -412,7 +408,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); pObjectEntry->pObject = pObject; pObjectEntry->bInvalidDefaultDLS = FALSE; - list_add_head (This->pObjects, &pObjectEntry->entry); + list_add_head(&This->cache, &pObjectEntry->entry); } else { DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); pObjectEntry->pObject = pObject; @@ -437,7 +433,6 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac LPSTREAM pStream; LPDIRECTMUSICOBJECT pObject; DMUS_OBJECTDESC Desc; - struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry, pNewEntry; HRESULT hr; @@ -540,8 +535,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac /* sometimes it happens that twisted programs call SetObject for same object twice... in such cases, native loader returns S_OK and does nothing... a sound plan */ - LIST_FOR_EACH (pEntry, This->pObjects) { - pObjectEntry = LIST_ENTRY (pEntry, WINE_LOADER_ENTRY, entry); + LIST_FOR_EACH_ENTRY(pObjectEntry, &This->cache, struct cache_entry, entry) { if (!memcmp (&pObjectEntry->Desc, pDesc, sizeof(DMUS_OBJECTDESC))) { TRACE(": exactly same entry already exists\n"); return S_OK; @@ -556,7 +550,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac /* use this function instead of pure memcpy due to streams (memcpy just copies pointer), which is basically used further by app that called SetDescriptor... better safety than exception */ DMUSIC_CopyDescriptor (&pNewEntry->Desc, pDesc); - list_add_head (This->pObjects, &pNewEntry->entry); + list_add_head(&This->cache, &pNewEntry->entry); return S_OK; } @@ -660,7 +654,6 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DMUS_OBJECTDESC Desc; HRESULT result = DMUS_E_LOADER_OBJECTNOTFOUND; - struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry = NULL; TRACE("(%p, %p)\n", This, pObject); @@ -671,8 +664,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if /* now iterate through the list and check if we have an alias (without object), corresponding to the descriptor of the input object */ - LIST_FOR_EACH(pEntry, This->pObjects) { - pObjectEntry = LIST_ENTRY(pEntry, WINE_LOADER_ENTRY, entry); + LIST_FOR_EACH_ENTRY(pObjectEntry, &This->cache, struct cache_entry, entry) { if ((Desc.dwValidData & DMUS_OBJ_OBJECT) && (pObjectEntry->Desc.dwValidData & DMUS_OBJ_OBJECT) && IsEqualGUID (&Desc.guidObject, &pObjectEntry->Desc.guidObject)) { @@ -740,7 +732,6 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 * { IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DMUS_OBJECTDESC Desc; - struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry = NULL; HRESULT result = S_FALSE; @@ -754,8 +745,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 * /* iterate through the list of objects we know about; check only those with DMUS_OBJ_LOADED */ TRACE(": looking for the object in cache\n"); - LIST_FOR_EACH(pEntry, This->pObjects) { - pObjectEntry = LIST_ENTRY(pEntry, WINE_LOADER_ENTRY, entry); + LIST_FOR_EACH_ENTRY(pObjectEntry, &This->cache, struct cache_entry, entry) { if ((Desc.dwValidData & DMUS_OBJ_OBJECT) && (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_OBJECT | DMUS_OBJ_LOADED)) && IsEqualGUID (&Desc.guidObject, &pObjectEntry->Desc.guidObject)) { @@ -804,24 +794,22 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 * return result; } -static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *iface, REFGUID rguidClass) +static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *iface, REFGUID class) { - IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); - struct list *pEntry; - LPWINE_LOADER_ENTRY pObjectEntry; - TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidClass)); - - LIST_FOR_EACH (pEntry, This->pObjects) { - pObjectEntry = LIST_ENTRY (pEntry, WINE_LOADER_ENTRY, entry); - - if ((IsEqualGUID (rguidClass, &GUID_DirectMusicAllTypes) || IsEqualGUID (rguidClass, &pObjectEntry->Desc.guidClass)) && - (pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED)) { - /* basically, wrap to ReleaseObject for each object found */ - IDirectMusicLoader8_ReleaseObject (iface, pObjectEntry->pObject); - } - } - - return S_OK; + IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); + struct cache_entry *obj; + + TRACE("(%p, %s)\n", This, debugstr_dmguid(class)); + + LIST_FOR_EACH_ENTRY(obj, &This->cache, struct cache_entry, entry) { + if ((IsEqualGUID(class, &GUID_DirectMusicAllTypes) || IsEqualGUID(class, &obj->Desc.guidClass)) && + (obj->Desc.dwValidData & DMUS_OBJ_LOADED)) { + /* basically, wrap to ReleaseObject for each object found */ + IDirectMusicLoader8_ReleaseObject(iface, obj->pObject); + } + } + + return S_OK; } static HRESULT WINAPI IDirectMusicLoaderImpl_EnableCache(IDirectMusicLoader8 *iface, REFGUID class, @@ -856,15 +844,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_EnumObject(IDirectMusicLoader8 *ifa { IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); DWORD dwCount = 0; - struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry; TRACE("(%p, %s, %d, %p)\n", This, debugstr_dmguid(rguidClass), dwIndex, pDesc); DM_STRUCT_INIT(pDesc); - LIST_FOR_EACH (pEntry, This->pObjects) { - pObjectEntry = LIST_ENTRY (pEntry, WINE_LOADER_ENTRY, entry); - + LIST_FOR_EACH_ENTRY(pObjectEntry, &This->cache, struct cache_entry, entry) { if (IsEqualGUID (rguidClass, &GUID_DirectMusicAllTypes) || IsEqualGUID (rguidClass, &pObjectEntry->Desc.guidClass)) { if (dwCount == dwIndex) { *pDesc = pObjectEntry->Desc; @@ -992,9 +977,7 @@ HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) } obj->IDirectMusicLoader8_iface.lpVtbl = &DirectMusicLoader_Loader_Vtbl; obj->ref = 0; /* Will be inited with QueryInterface */ - /* init cache/alias list */ - obj->pObjects = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(struct list)); - list_init (obj->pObjects); + list_init(&obj->cache); /* Caching is enabled by default for all classes */ obj->cache_class = ~0; @@ -1010,7 +993,7 @@ HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) collection, loader treats it as "invalid" and returns DMUS_E_LOADER_NOFILENAME for all requests for it; basically, we check if out input guidObject was overwritten */ - pEntry = list_head (obj->pObjects); + pEntry = list_head(&obj->cache); pDefaultDLSEntry = LIST_ENTRY (pEntry, WINE_LOADER_ENTRY, entry); if (!IsEqualGUID(&Desc.guidObject, &GUID_DefaultGMCollection)) { pDefaultDLSEntry->bInvalidDefaultDLS = TRUE;
1
0
0
0
Michael Stefaniuc : dmloader: Remove some commented out debugging code.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: c2aa725356065f7a4860b654fe7cfa3efd302cfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2aa725356065f7a4860b654f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:24 2017 +0200 dmloader: Remove some commented out debugging code. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 581b781..52c2524 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -421,17 +421,6 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac TRACE(": filled in cache entry\n"); } else TRACE(": caching disabled\n"); -#if 0 - /* for debug purposes (e.g. to check if all files are cached) */ - TRACE("*** Loader's cache ***\n"); - int i = 0; - LIST_FOR_EACH (pEntry, This->pObjects) { - i++; - pObjectEntry = LIST_ENTRY(pEntry, WINE_LOADER_ENTRY, entry); - TRACE(": entry nr. %i:\n%s\n - bInvalidDefaultDLS = %i\n - pObject = %p\n", i, debugstr_DMUS_OBJECTDESC(&pObjectEntry->Desc), pObjectEntry->bInvalidDefaultDLS, pObjectEntry->pObject); - } -#endif - result = IDirectMusicObject_QueryInterface (pObject, riid, ppv); if (!bCache) IDirectMusicObject_Release (pObject); /* since loader's reference is not needed */ /* if there was trouble with loading, and if no other error occurred,
1
0
0
0
Michael Stefaniuc : dmloader: Simplify the search path handling.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: fd4cdf5df4d3e31602a1127963b5e44e088eee2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fd4cdf5df4d3e31602a112796…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:23 2017 +0200 dmloader: Simplify the search path handling. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/dmloader_private.h | 7 --- dlls/dmloader/loader.c | 113 ++++++++++++--------------------------- dlls/dmloader/tests/loader.c | 6 +-- 3 files changed, 36 insertions(+), 90 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=fd4cdf5df4d3e31602a11…
1
0
0
0
Michael Stefaniuc : dmloader: Move struct definitions to the files they are used in.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: a8900c9bbbde0132c7f6b2282992974774757c5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8900c9bbbde0132c7f6b2282…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:22 2017 +0200 dmloader: Move struct definitions to the files they are used in. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/container.c | 15 ++++++++++++++ dlls/dmloader/dmloader_private.h | 42 ---------------------------------------- dlls/dmloader/loader.c | 19 ++++++++++++++++++ 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index ab43c6b..c14a5bd 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -28,6 +28,21 @@ WINE_DECLARE_DEBUG_CHANNEL(dmdump); #define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR) #define DMUS_MAX_FILENAME_SIZE DMUS_MAX_FILENAME*sizeof(WCHAR) +typedef struct riff_chunk { + FOURCC fccID; + DWORD dwSize; +} WINE_CHUNK; + +/* contained object entry */ +typedef struct container_entry { + struct list entry; + DMUS_OBJECTDESC Desc; + BOOL bIsRIFF; + DWORD dwFlags; /* DMUS_CONTAINED_OBJF_KEEP: keep object in loader's cache, even when container is released */ + WCHAR *wszAlias; + IDirectMusicObject *pObject; /* needed when releasing from loader's cache on container release */ +} WINE_CONTAINER_ENTRY, *LPWINE_CONTAINER_ENTRY; + /***************************************************************************** * IDirectMusicContainerImpl implementation */ diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index 5e1044d..a3922a8 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -56,8 +56,6 @@ static inline void unlock_module(void) { InterlockedDecrement( &module_ref ); } typedef struct IDirectMusicLoaderCF IDirectMusicLoaderCF; typedef struct IDirectMusicContainerCF IDirectMusicContainerCF; -typedef struct IDirectMusicLoaderImpl IDirectMusicLoaderImpl; - typedef struct IDirectMusicLoaderFileStream IDirectMusicLoaderFileStream; typedef struct IDirectMusicLoaderResourceStream IDirectMusicLoaderResourceStream; typedef struct IDirectMusicLoaderGenericStream IDirectMusicLoaderGenericStream; @@ -71,14 +69,6 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj) D extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj) DECLSPEC_HIDDEN; -/* cache/alias entry */ -typedef struct _WINE_LOADER_ENTRY { - struct list entry; /* for listing elements */ - DMUS_OBJECTDESC Desc; - LPDIRECTMUSICOBJECT pObject; /* pointer to object */ - BOOL bInvalidDefaultDLS; /* my workaround for enabling caching of "faulty" default dls collection */ -} WINE_LOADER_ENTRY, *LPWINE_LOADER_ENTRY; - /* cache options, search paths for specific types of objects */ typedef struct _WINE_LOADER_OPTION { struct list entry; /* for listing elements */ @@ -87,29 +77,6 @@ typedef struct _WINE_LOADER_OPTION { } WINE_LOADER_OPTION, *LPWINE_LOADER_OPTION; /***************************************************************************** - * IDirectMusicLoaderImpl implementation structure - */ -struct IDirectMusicLoaderImpl { - IDirectMusicLoader8 IDirectMusicLoader8_iface; - LONG ref; - unsigned int cache_class; - /* simple cache (linked list) */ - struct list *pObjects; - /* settings for certain object classes */ - struct list *pClassSettings; -}; - -/* contained object entry */ -typedef struct _WINE_CONTAINER_ENTRY { - struct list entry; /* for listing elements */ - DMUS_OBJECTDESC Desc; - BOOL bIsRIFF; - DWORD dwFlags; /* DMUS_CONTAINED_OBJF_KEEP: keep object in loader's cache, even when container is released */ - WCHAR* wszAlias; - LPDIRECTMUSICOBJECT pObject; /* needed when releasing from loader's cache on container release */ -} WINE_CONTAINER_ENTRY, *LPWINE_CONTAINER_ENTRY; - -/***************************************************************************** * IDirectMusicLoaderFileStream implementation structure */ struct IDirectMusicLoaderFileStream { @@ -167,15 +134,6 @@ struct IDirectMusicLoaderGenericStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader) DECLSPEC_HIDDEN; -/***************************************************************************** - * Misc. - */ -/* for simpler reading */ -typedef struct _WINE_CHUNK { - FOURCC fccID; /* FOURCC ID of the chunk */ - DWORD dwSize; /* size of the chunk */ -} WINE_CHUNK, *LPWINE_CHUNK; - #include "debug.h" #endif /* __WINE_DMLOADER_PRIVATE_H */ diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 005fd77..0f4753b 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -37,6 +37,25 @@ static const GUID *classes[] = { &CLSID_DirectSoundWave }; +/* cache/alias entry */ +typedef struct cache_entry { + struct list entry; + DMUS_OBJECTDESC Desc; + IDirectMusicObject *pObject; + BOOL bInvalidDefaultDLS; /* workaround for enabling caching of "faulty" default dls collection */ +} WINE_LOADER_ENTRY, *LPWINE_LOADER_ENTRY; + +typedef struct IDirectMusicLoaderImpl { + IDirectMusicLoader8 IDirectMusicLoader8_iface; + LONG ref; + unsigned int cache_class; + /* simple cache */ + struct list *pObjects; + /* settings for certain object classes */ + struct list *pClassSettings; +} IDirectMusicLoaderImpl; + + static inline IDirectMusicLoaderImpl* impl_from_IDirectMusicLoader8(IDirectMusicLoader8 *iface) { return CONTAINING_RECORD(iface, IDirectMusicLoaderImpl, IDirectMusicLoader8_iface);
1
0
0
0
Michael Stefaniuc : dmloader: Use a bitfield to store the per class cache enable info.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: 8b9812666606a8a93a5ac7ee714e81f8d8475555 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b9812666606a8a93a5ac7ee7…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:21 2017 +0200 dmloader: Use a bitfield to store the per class cache enable info. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/dmloader_private.h | 3 +- dlls/dmloader/loader.c | 122 ++++++++++++++++++++++++--------------- dlls/dmloader/tests/loader.c | 12 ++-- 3 files changed, 84 insertions(+), 53 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8b9812666606a8a93a5ac…
1
0
0
0
Michael Stefaniuc : dmloader/tests: Add some EnableCache() tests.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: 693b40f7dcf2d14a8d4ef18762ebce241a8687ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=693b40f7dcf2d14a8d4ef1876…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:20 2017 +0200 dmloader/tests: Add some EnableCache() tests. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/tests/loader.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index 136b054..74d8e3c 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -107,6 +107,40 @@ static void test_directory(void) IDirectMusicLoader_Release(loader); } +static void test_caching(void) +{ + IDirectMusicLoader8 *loader = NULL; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, + (void**)&loader); + ok(hr == S_OK, "Couldn't create Loader %#x\n", hr); + + /* Invalid GUID */ + if (0) /* Crashes on Windows */ + IDirectMusicLoader_EnableCache(loader, NULL, TRUE); + hr = IDirectMusicLoader_EnableCache(loader, &IID_IDirectMusicLoader8, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + /* Caching is enabled by default */ + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, TRUE); + todo_wine ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + /* Disabling/enabling the cache for all types */ + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, FALSE); + ok(hr == S_OK, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, FALSE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &GUID_DirectMusicAllTypes, TRUE); + ok(hr == S_OK, "EnableCache failed with %#x\n", hr); + hr = IDirectMusicLoader_EnableCache(loader, &CLSID_DirectMusicContainer, TRUE); + ok(hr == S_FALSE, "EnableCache failed with %#x\n", hr); + + IDirectMusicLoader_Release(loader); +} + static void test_release_object(void) { HRESULT hr; @@ -362,6 +396,7 @@ START_TEST(loader) return; } test_directory(); + test_caching(); test_release_object(); test_simple_playing(); test_COM();
1
0
0
0
Michael Stefaniuc : dmloader/tests: Add more SetSearchDirectory() tests.
by Alexandre Julliard
25 Jul '17
25 Jul '17
Module: wine Branch: master Commit: d60aead138869d14ae2a72750df33bc9620cfb9f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d60aead138869d14ae2a72750…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jul 25 20:57:19 2017 +0200 dmloader/tests: Add more SetSearchDirectory() tests. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/tests/loader.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index b24b2e2..136b054 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -49,6 +49,7 @@ static void test_directory(void) HRESULT hr; WCHAR con[] = {'c', 'o', 'n', 0}; WCHAR path[MAX_PATH]; + WCHAR empty[] = {0}; WCHAR invalid_path[] = {'/', 'i', 'n', 'v', 'a', 'l', 'i', 'd', ' ', 'p', 'a', 't', 'h', 0}; hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, @@ -60,9 +61,16 @@ static void test_directory(void) ok(hr == S_FALSE, "ScanDirectory for \"con\" files failed with %#x\n", hr); /* SetSearchDirectory with invalid path */ + hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, NULL, 0); + ok(hr == E_POINTER, "SetSearchDirectory failed with %#x\n", hr); hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, invalid_path, 0); ok(hr == DMUS_E_LOADER_BADPATH, "SetSearchDirectory failed with %#x\n", hr); + /* SetSearchDirectory with the current directory */ + GetCurrentDirectoryW(ARRAY_SIZE(path), path); + hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, path, 0); + ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr); + /* Two consecutive SetSearchDirectory with the same path */ GetTempPathW(ARRAY_SIZE(path), path); hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, path, 0); @@ -74,11 +82,29 @@ static void test_directory(void) hr = IDirectMusicLoader_SetSearchDirectory(loader, &CLSID_DirectSoundWave, path, 0); ok(hr == S_FALSE, "Second SetSearchDirectory failed with %#x\n", hr); + /* Invalid GUIDs */ + if (0) + IDirectMusicLoader_SetSearchDirectory(loader, NULL, path, 0); /* Crashes on Windows */ + hr = IDirectMusicLoader_SetSearchDirectory(loader, &IID_IDirectMusicLoader8, path, 0); + todo_wine ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr); + /* NULL extension is not an error */ hr = IDirectMusicLoader_ScanDirectory(loader, &CLSID_DirectSoundWave, NULL, NULL); ok(hr == S_FALSE, "ScanDirectory for \"wav\" files failed, received %#x\n", hr); IDirectMusicLoader_Release(loader); + + /* An empty path is a valid path */ + hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, + (void**)&loader); + ok(hr == S_OK, "Couldn't create Loader %#x\n", hr); + hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, empty, 0); + todo_wine ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr); + hr = IDirectMusicLoader_SetSearchDirectory(loader, &GUID_DirectMusicAllTypes, empty, 0); + ok(hr == S_FALSE, "SetSearchDirectory failed with %#x\n", hr); + hr = IDirectMusicLoader_ScanDirectory(loader, &CLSID_DirectMusicContainer, con, NULL); + ok(hr == S_FALSE, "ScanDirectory for \"con\" files failed with %#x\n", hr); + IDirectMusicLoader_Release(loader); } static void test_release_object(void)
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
64
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
Results per page:
10
25
50
100
200