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
November 2019
----- 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
1 participants
895 discussions
Start a n
N
ew thread
Chip Davis : mountmgr: Populate HKLM\HARDWARE\DEVICEMAP\Scsi here instead of in kernel32.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 19549d11a72f63efe0d689374446a56a68264a1f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=19549d11a72f63efe0d68937…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Mon Nov 25 11:40:34 2019 -0600 mountmgr: Populate HKLM\HARDWARE\DEVICEMAP\Scsi here instead of in kernel32. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/Makefile.in | 1 - dlls/kernel32/oldconfig.c | 407 ------------------------------------------- dlls/kernel32/process.c | 1 - dlls/mountmgr.sys/dbus.c | 185 +++++++++++++++++++- dlls/mountmgr.sys/device.c | 153 +++++++++++++++- dlls/mountmgr.sys/diskarb.c | 2 +- dlls/mountmgr.sys/mountmgr.c | 8 +- dlls/mountmgr.sys/mountmgr.h | 36 +++- 8 files changed, 377 insertions(+), 416 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=19549d11a72f63efe0d6…
1
0
0
0
Alistair Leslie-Hughes : dmloader: Rewrite IDirectMusicLoader8 ReleaseObject using find_cache_object.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 8388ea840fedbb9b646213a26cd59ceb3a48680b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8388ea840fedbb9b646213a2…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Nov 25 21:22:08 2019 +0100 dmloader: Rewrite IDirectMusicLoader8 ReleaseObject using find_cache_object. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 87 +++++++++++++++----------------------------------- 1 file changed, 26 insertions(+), 61 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index c8d04927fd..42209def94 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -685,70 +685,35 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *if return DMUS_E_LOADER_OBJECTNOTFOUND; } -static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *iface, IDirectMusicObject *pObject) +static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *iface, + IDirectMusicObject *object) { - IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); - DMUS_OBJECTDESC Desc; - struct cache_entry *pObjectEntry; - HRESULT result = S_FALSE; + IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); + DMUS_OBJECTDESC desc; + struct cache_entry *entry; - TRACE("(%p, %p)\n", This, pObject); - - if(!pObject) return E_POINTER; + TRACE("(%p, %p)\n", This, object); - /* get descriptor */ - DM_STRUCT_INIT(&Desc); - IDirectMusicObject_GetDescriptor (pObject, &Desc); - - /* 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_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)) { - TRACE(": found it by object GUID\n"); - if (TRACE_ON(dmloader)) - dump_DMUS_OBJECTDESC(&pObjectEntry->Desc); - result = S_OK; - break; - } - else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_LOADED)) && - !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by fullpath filename\n"); - result = S_OK; - break; - } - else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY | DMUS_OBJ_LOADED)) && - !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) && - !wcsncmp (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { - TRACE(": found it by name and category\n"); - result = S_OK; - break; - } - else if ((Desc.dwValidData & DMUS_OBJ_NAME) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_LOADED)) && - !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) { - TRACE(": found it by name\n"); - result = S_OK; - break; - } - else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_LOADED)) && - !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by filename\n"); - result = S_OK; - break; - } - } - if (result == S_OK) { - /*TRACE(": releasing:\n%s - bInvalidDefaultDLS = %i\n - pObject = %p\n", debugstr_DMUS_OBJECTDESC(&pObjectEntry->Desc), pObjectEntry->bInvalidDefaultDLS, pObjectEntry->pObject); */ - IDirectMusicObject_Release (pObjectEntry->pObject); - pObjectEntry->pObject = NULL; - pObjectEntry->Desc.dwValidData &= ~DMUS_OBJ_LOADED; - } - return result; + if (!object) + return E_POINTER; + + DM_STRUCT_INIT(&desc); + IDirectMusicObject_GetDescriptor(object, &desc); + + TRACE("Looking for the object in cache\n"); + entry = find_cache_object(This, &desc); + if (entry) { + dump_DMUS_OBJECTDESC(&entry->Desc); + + if (entry->pObject && entry->Desc.dwValidData & DMUS_OBJ_LOADED) { + IDirectMusicObject_Release(entry->pObject); + entry->pObject = NULL; + entry->Desc.dwValidData &= ~DMUS_OBJ_LOADED; + return S_OK; + } + } + + return S_FALSE; } static HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache(IDirectMusicLoader8 *iface, REFGUID class)
1
0
0
0
Alistair Leslie-Hughes : dmloader: Rewrite IDirectMusicLoader8 CacheObject using find_cache_object.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: cc67ea6dfa83bb5e41d1fd4a7519714aa48c6a04 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cc67ea6dfa83bb5e41d1fd4a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Nov 25 21:22:07 2019 +0100 dmloader: Rewrite IDirectMusicLoader8 CacheObject using find_cache_object. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 101 +++++++++++++------------------------------------ 1 file changed, 26 insertions(+), 75 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 56d241dd1e..c8d04927fd 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -655,83 +655,34 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 * } while (1); } -static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *iface, IDirectMusicObject *pObject) +static HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject(IDirectMusicLoader8 *iface, + IDirectMusicObject *object) { - IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); - DMUS_OBJECTDESC Desc; - HRESULT result = DMUS_E_LOADER_OBJECTNOTFOUND; - struct cache_entry *pObjectEntry; + IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); + DMUS_OBJECTDESC desc; + struct cache_entry *entry; - TRACE("(%p, %p)\n", This, pObject); - - /* get descriptor */ - DM_STRUCT_INIT(&Desc); - IDirectMusicObject_GetDescriptor (pObject, &Desc); - - /* 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_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)) { - TRACE(": found it by object GUID\n"); - if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) - result = S_FALSE; - else - result = S_OK; - break; - } - else if ((Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && - !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by fullpath filename\n"); - if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) - result = S_FALSE; - else - result = S_OK; - break; - } - else if ((Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && - (pObjectEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && - !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME) && - !wcsncmp (Desc.wszCategory, pObjectEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { - TRACE(": found it by name and category\n"); - if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) - result = S_FALSE; - else - result = S_OK; - break; - } - else if ((Desc.dwValidData & DMUS_OBJ_NAME) && - (pObjectEntry->Desc.dwValidData & DMUS_OBJ_NAME) && - !wcsncmp (Desc.wszName, pObjectEntry->Desc.wszName, DMUS_MAX_NAME)) { - TRACE(": found it by name\n"); - if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) - result = S_FALSE; - else - result = S_OK; - break; - } - else if ((Desc.dwValidData & DMUS_OBJ_FILENAME) && - (pObjectEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) && - !wcsncmp (Desc.wszFileName, pObjectEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by filename\n"); - if ((pObjectEntry->Desc.dwValidData & DMUS_OBJ_LOADED) && pObjectEntry->pObject) - result = S_FALSE; - else - result = S_OK; - break; - } - } - - /* if we found such alias, then set everything */ - if (result == S_OK) { - pObjectEntry->Desc.dwValidData &= DMUS_OBJ_LOADED; - pObjectEntry->pObject = pObject; - IDirectMusicObject_AddRef (pObjectEntry->pObject); - } - - return result; + TRACE("(%p, %p)\n", This, object); + + DM_STRUCT_INIT(&desc); + IDirectMusicObject_GetDescriptor(object, &desc); + + /* Iterate through the list and check if we have an alias (without object), corresponding + to the descriptor of the input object */ + entry = find_cache_object(This, &desc); + if (entry) { + if ((entry->Desc.dwValidData & DMUS_OBJ_LOADED) && entry->pObject) { + TRACE("Object already laoded.\n"); + return S_FALSE; + } + + entry->Desc.dwValidData |= DMUS_OBJ_LOADED; + entry->pObject = object; + IDirectMusicObject_AddRef(entry->pObject); + return S_OK; + } + + return DMUS_E_LOADER_OBJECTNOTFOUND; } static HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject(IDirectMusicLoader8 *iface, IDirectMusicObject *pObject)
1
0
0
0
Alistair Leslie-Hughes : dmloader: Rewrite cache object lookup.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: d66b3ae922a864b74e0650ed96d86eeed0760424 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d66b3ae922a864b74e0650ed…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Mon Nov 25 21:22:06 2019 +0100 dmloader: Rewrite cache object lookup. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmloader/loader.c | 174 ++++++++++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 74 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 69a438765d..56d241dd1e 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -163,6 +163,85 @@ static ULONG WINAPI IDirectMusicLoaderImpl_Release(IDirectMusicLoader8 *iface) return ref; } +static struct cache_entry *find_cache_object(IDirectMusicLoaderImpl *This, DMUS_OBJECTDESC *desc) +{ + struct cache_entry *existing; + + /* + * The Object is looked for the the following order. + * 1. DMUS_OBJ_OBJECT + * 2. DMUS_OBJ_STREAM + * 3. DMUS_OBJ_MEMORY + * 4. DMUS_OBJ_FILENAME and DMUS_OBJ_FULLPATH + * 5. DMUS_OBJ_NAME and DMUS_OBJ_CATEGORY + * 6. DMUS_OBJ_NAME + * 7. DMUS_OBJ_FILENAME + */ + + if (desc->dwValidData & DMUS_OBJ_OBJECT) { + LIST_FOR_EACH_ENTRY(existing, &This->cache, struct cache_entry, entry) { + if (existing->Desc.dwValidData & DMUS_OBJ_OBJECT && + IsEqualGUID(&desc->guidObject, &existing->Desc.guidObject) ) { + TRACE("Found by DMUS_OBJ_OBJECT\n"); + return existing; + } + } + } + + if (desc->dwValidData & DMUS_OBJ_STREAM) + FIXME("Finding DMUS_OBJ_STREAM cached objects currently not supported.\n"); + + if (desc->dwValidData & DMUS_OBJ_MEMORY) + FIXME("Finding DMUS_OBJ_MEMORY cached objects currently not supported.\n"); + + if ((desc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) == + (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) { + LIST_FOR_EACH_ENTRY(existing, &This->cache, struct cache_entry, entry) { + if ((existing->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) == + (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH) && + !wcsncmp(desc->wszFileName, existing->Desc.wszFileName, DMUS_MAX_FILENAME)) { + TRACE("Found by DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH\n"); + return existing; + } + } + } + + if ((desc->dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) == + (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) { + LIST_FOR_EACH_ENTRY(existing, &This->cache, struct cache_entry, entry) { + if ((existing->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) == + (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY) && + !wcsncmp(desc->wszName, existing->Desc.wszName, DMUS_MAX_NAME) && + !wcsncmp(desc->wszCategory, existing->Desc.wszCategory, DMUS_MAX_CATEGORY)) { + TRACE("Found by DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY\n"); + return existing; + } + } + } + + if ((desc->dwValidData & DMUS_OBJ_NAME) == DMUS_OBJ_NAME) { + LIST_FOR_EACH_ENTRY(existing, &This->cache, struct cache_entry, entry) { + if ((existing->Desc.dwValidData & DMUS_OBJ_NAME) == DMUS_OBJ_NAME && + !wcsncmp(desc->wszName, existing->Desc.wszName, DMUS_MAX_NAME)) { + TRACE("Found by DMUS_OBJ_NAME\n"); + return existing; + } + } + } + + if ((desc->dwValidData & DMUS_OBJ_FILENAME) == DMUS_OBJ_FILENAME) { + LIST_FOR_EACH_ENTRY(existing, &This->cache, struct cache_entry, entry) { + if (((existing->Desc.dwValidData & DMUS_OBJ_FILENAME) == DMUS_OBJ_FILENAME) && + !wcsncmp(desc->wszFileName, existing->Desc.wszFileName, DMUS_MAX_FILENAME)) { + TRACE("Found by DMUS_OBJ_FILENAME\n"); + return existing; + } + } + } + + return NULL; +} + static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDESC *pDesc, REFIID riid, void **ppv) { IDirectMusicLoaderImpl *This = impl_from_IDirectMusicLoader8(iface); @@ -187,80 +266,27 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac *ppv = NULL; return DMUS_E_LOADER_NOCLASSID; } - - /* 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_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)) { - TRACE(": found it by object GUID\n"); - /* I suppose such stuff can happen only when GUID for object is given (GUID_DefaultGMCollection) */ - if (pExistingEntry->bInvalidDefaultDLS) { - TRACE(": found faulty default DLS collection... enabling M$ compliant behaviour\n"); - return DMUS_E_LOADER_NOFILENAME; - } - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { - TRACE(": already loaded\n"); - return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv); - } else { - TRACE(": not loaded yet\n"); - pObjectEntry = pExistingEntry; - } - break; - } - else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && - (pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) && - !wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by fullpath filename\n"); - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { - TRACE(": already loaded\n"); - return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv); - } else { - TRACE(": not loaded yet\n"); - pObjectEntry = pExistingEntry; - } - } - else if ((pDesc->dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && - (pExistingEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) && - !wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME) && - !wcsncmp (pDesc->wszCategory, pExistingEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) { - TRACE(": found it by name and category\n"); - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { - TRACE(": already loaded\n"); - return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv); - } else { - TRACE(": not loaded yet\n"); - pObjectEntry = pExistingEntry; - } - } - else if ((pDesc->dwValidData & DMUS_OBJ_NAME) && - (pExistingEntry->Desc.dwValidData & DMUS_OBJ_NAME) && - !wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME)) { - TRACE(": found it by name\n"); - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { - TRACE(": already loaded\n"); - return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv); - } else { - TRACE(": not loaded yet\n"); - pObjectEntry = pExistingEntry; - } - } - else if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) && - (pExistingEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) && - !wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) { - TRACE(": found it by filename\n"); - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { - TRACE(": already loaded\n"); - return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv); - } else { - TRACE(": not loaded yet\n"); - pObjectEntry = pExistingEntry; - } - } - } - + + /* 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"); + pExistingEntry = find_cache_object(This, pDesc); + if (pExistingEntry) { + + if (pExistingEntry->bInvalidDefaultDLS) { + TRACE(": found faulty default DLS collection... enabling M$ compliant behaviour\n"); + return DMUS_E_LOADER_NOFILENAME; + } + + if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { + TRACE(": already loaded\n"); + return IDirectMusicObject_QueryInterface(pExistingEntry->pObject, riid, ppv); + } + + TRACE(": not loaded yet\n"); + pObjectEntry = pExistingEntry; + } + /* basically, if we found alias, we use its descriptor to load... else we use info we were given */ if (pObjectEntry) {
1
0
0
0
Gijs Vermeulen : wineconsole: Add registry support for font pitch&family.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 228b9b7b520af15382841084482856ebf5553d9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=228b9b7b520af15382841084…
Author: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Date: Wed Nov 20 11:45:31 2019 +0100 wineconsole: Add registry support for font pitch&family. Signed-off-by: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/wineconsole/registry.c | 13 +++++++++++-- programs/wineconsole/winecon_private.h | 1 + programs/wineconsole/wineconsole.c | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c index 359034f838..6bcc096d93 100644 --- a/programs/wineconsole/registry.c +++ b/programs/wineconsole/registry.c @@ -38,6 +38,7 @@ static const WCHAR wszCursorVisible[] = {'C','u','r','s','o','r','V','i','s' static const WCHAR wszEditionMode[] = {'E','d','i','t','i','o','n','M','o','d','e',0}; static const WCHAR wszExitOnDie[] = {'E','x','i','t','O','n','D','i','e',0}; static const WCHAR wszFaceName[] = {'F','a','c','e','N','a','m','e',0}; +static const WCHAR wszFontPitchFamily[] = {'F','o','n','t','P','i','t','c','h','F','a','m','i','l','y',0}; static const WCHAR wszFontSize[] = {'F','o','n','t','S','i','z','e',0}; static const WCHAR wszFontWeight[] = {'F','o','n','t','W','e','i','g','h','t',0}; static const WCHAR wszHistoryBufferSize[] = {'H','i','s','t','o','r','y','B','u','f','f','e','r','S','i','z','e',0}; @@ -56,10 +57,10 @@ static const WCHAR color_name_fmt[] = {'%','s','%','0','2','d',0}; void WINECON_DumpConfig(const char* pfx, const struct config_data* cfg) { - WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x pop-up=%02x font=%s/%u hist=%u/%d flags=%c%c%c " + WINE_TRACE("%s cell=(%u,%u) cursor=(%d,%d) attr=%02x pop-up=%02x font=%s/%u/%u hist=%u/%d flags=%c%c%c " "msk=%08x sb=(%u,%u) win=(%u,%u)x(%u,%u) edit=%u registry=%s\n", pfx, cfg->cell_width, cfg->cell_height, cfg->cursor_size, cfg->cursor_visible, cfg->def_attr, - cfg->popup_attr, wine_dbgstr_w(cfg->face_name), cfg->font_weight, cfg->history_size, + cfg->popup_attr, wine_dbgstr_w(cfg->face_name), cfg->font_pitch_family, cfg->font_weight, cfg->history_size, cfg->history_nodup ? 1 : 2, cfg->insert_mode ? 'I' : 'i', cfg->quick_edit ? 'Q' : 'q', cfg->exit_on_die ? 'X' : 'x', cfg->menu_mask, cfg->sb_width, cfg->sb_height, cfg->win_pos.X, cfg->win_pos.Y, cfg->win_width, cfg->win_height, cfg->edition_mode, @@ -123,6 +124,10 @@ static void WINECON_RegLoadHelper(HKEY hConKey, struct config_data* cfg) count = sizeof(cfg->face_name); RegQueryValueExW(hConKey, wszFaceName, 0, &type, (LPBYTE)&cfg->face_name, &count); + count = sizeof(val); + if (!RegQueryValueExW(hConKey, wszFontPitchFamily, 0, &type, (LPBYTE)&val, &count)) + cfg->font_pitch_family = val; + count = sizeof(val); if (!RegQueryValueExW(hConKey, wszFontSize, 0, &type, (LPBYTE)&val, &count)) { @@ -211,6 +216,7 @@ void WINECON_RegLoad(const WCHAR* appname, struct config_data* cfg) cfg->cursor_visible = 1; cfg->exit_on_die = 1; memset(cfg->face_name, 0, sizeof(cfg->face_name)); + cfg->font_pitch_family = FIXED_PITCH | FF_DONTCARE; cfg->cell_height = MulDiv( 16, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); cfg->cell_width = MulDiv( 8, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); cfg->font_weight = FW_NORMAL; @@ -285,6 +291,9 @@ static void WINECON_RegSaveHelper(HKEY hConKey, const struct config_data* cfg) RegSetValueExW(hConKey, wszFaceName, 0, REG_SZ, (LPBYTE)&cfg->face_name, sizeof(cfg->face_name)); + val = cfg->font_pitch_family; + RegSetValueExW(hConKey, wszFontPitchFamily, 0, REG_DWORD, (LPBYTE)&val, sizeof(val)); + width = MulDiv( cfg->cell_width, USER_DEFAULT_SCREEN_DPI, GetDpiForSystem() ); height = MulDiv( cfg->cell_height, USER_DEFAULT_SCREEN_DPI, GetDpiForSystem() ); val = MAKELONG(width, height); diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h index d556299d62..54d8782a2a 100644 --- a/programs/wineconsole/winecon_private.h +++ b/programs/wineconsole/winecon_private.h @@ -35,6 +35,7 @@ struct config_data { DWORD def_attr; /* default fill attributes (screen colors) */ DWORD popup_attr; /* pop-up color attributes */ WCHAR face_name[32]; /* name of font (size is LF_FACESIZE) */ + DWORD font_pitch_family; DWORD font_weight; DWORD history_size; /* number of commands in history buffer */ DWORD history_nodup; /* TRUE if commands are not stored twice in buffer */ diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index ebcfce1011..4b65e68939 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -445,7 +445,8 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf data->curcfg.menu_mask = cfg->menu_mask; data->curcfg.quick_edit = cfg->quick_edit; if (strcmpiW(data->curcfg.face_name, cfg->face_name) || data->curcfg.cell_width != cfg->cell_width || - data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_weight != cfg->font_weight) + data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_pitch_family != cfg->font_pitch_family || + data->curcfg.font_weight != cfg->font_weight) { RECT r; data->fnSetFont(data, cfg->face_name, cfg->cell_height, cfg->font_weight); @@ -459,7 +460,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf req->font_width = cfg->cell_width; req->font_height = cfg->cell_height; req->font_weight = cfg->font_weight; - req->font_pitch_family = FIXED_PITCH | FF_DONTCARE; + req->font_pitch_family = cfg->font_pitch_family; wine_server_add_data( req, cfg->face_name, lstrlenW(cfg->face_name) * sizeof(WCHAR) ); wine_server_call( req ); }
1
0
0
0
Gijs Vermeulen : kernel32/tests: Add GetCurrentConsoleFontEx tests.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: a507126ac48e3a74300b6fb12a4118218cb99487 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a507126ac48e3a74300b6fb1…
Author: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Date: Wed Nov 20 11:45:30 2019 +0100 kernel32/tests: Add GetCurrentConsoleFontEx tests. Signed-off-by: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/console.c | 99 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 1ecb350673..5f8003760d 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2694,6 +2694,104 @@ static void test_GetCurrentConsoleFont(HANDLE std_output) "got %d, expected %d\n", cfi.dwFontSize.Y, csbi.dwMaximumWindowSize.Y); } +static void test_GetCurrentConsoleFontEx(HANDLE std_output) +{ + HANDLE hmod; + BOOL (WINAPI *pGetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); + CONSOLE_FONT_INFO cfi; + CONSOLE_FONT_INFOEX cfix; + BOOL ret; + HANDLE std_input = GetStdHandle(STD_INPUT_HANDLE); + + hmod = GetModuleHandleA("kernel32.dll"); + pGetCurrentConsoleFontEx = (void *)GetProcAddress(hmod, "GetCurrentConsoleFontEx"); + if (!pGetCurrentConsoleFontEx) + { + win_skip("GetCurrentConsoleFontEx is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + + cfix.cbSize = sizeof(CONSOLE_FONT_INFOEX); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(NULL, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, FALSE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_input, TRUE, &cfix); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, FALSE, &cfix); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); + ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n"); + + SetLastError(0xdeadbeef); + ret = pGetCurrentConsoleFontEx(std_output, TRUE, &cfix); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, TRUE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + + ok(cfix.dwFontSize.X == cfi.dwFontSize.X, "expected values to match\n"); + ok(cfix.dwFontSize.Y == cfi.dwFontSize.Y, "expected values to match\n"); +} + static void test_GetConsoleFontSize(HANDLE std_output) { COORD c; @@ -3294,6 +3392,7 @@ START_TEST(console) test_ReadConsoleOutputCharacterW(hConOut); test_ReadConsoleOutputAttribute(hConOut); test_GetCurrentConsoleFont(hConOut); + test_GetCurrentConsoleFontEx(hConOut); test_GetConsoleFontSize(hConOut); test_GetLargestConsoleWindowSize(hConOut); test_GetConsoleFontInfo(hConOut);
1
0
0
0
Gijs Vermeulen : kernel32: Implement GetCurrentConsoleFontEx.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: ec810c84ab906f22dc0d00e52ab1a77c9932aaa4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec810c84ab906f22dc0d00e5…
Author: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Date: Wed Nov 20 11:45:29 2019 +0100 kernel32: Implement GetCurrentConsoleFontEx. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47620
Signed-off-by: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/console.c | 42 ++++++++++++++++++++++++++++++++++++++++-- dlls/kernel32/kernel32.spec | 2 +- include/wine/server_protocol.h | 8 ++++++-- server/console.c | 17 +++++++++++++++-- server/protocol.def | 5 ++++- server/request.h | 4 +++- server/trace.c | 5 ++++- 7 files changed, 73 insertions(+), 10 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index a698e53efe..0842bb71a6 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1639,17 +1639,28 @@ BOOL WINAPI SetConsoleKeyShortcuts(BOOL set, BYTE keys, VOID *a, DWORD b) } -BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +BOOL WINAPI GetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *fontinfo) { BOOL ret; + struct + { + unsigned int color_map[16]; + WCHAR face_name[LF_FACESIZE]; + } data; - memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO)); + if (fontinfo->cbSize != sizeof(CONSOLE_FONT_INFOEX)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } SERVER_START_REQ(get_console_output_info) { req->handle = console_handle_unmap(hConsole); + wine_server_set_reply( req, &data, sizeof(data) - sizeof(WCHAR) ); if ((ret = !wine_server_call_err(req))) { + fontinfo->nFont = 0; if (maxwindow) { fontinfo->dwFontSize.X = min(reply->width, reply->max_width); @@ -1660,12 +1671,39 @@ BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FON fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1; fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1; } + if (wine_server_reply_size( reply ) > sizeof(data.color_map)) + { + data_size_t len = wine_server_reply_size( reply ) - sizeof(data.color_map); + memcpy( fontinfo->FaceName, data.face_name, len ); + fontinfo->FaceName[len / sizeof(WCHAR)] = 0; + } + else + fontinfo->FaceName[0] = 0; + fontinfo->FontFamily = reply->font_pitch_family; + fontinfo->FontWeight = reply->font_weight; } } SERVER_END_REQ; return ret; } +BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFO *fontinfo) +{ + BOOL ret; + CONSOLE_FONT_INFOEX res; + + res.cbSize = sizeof(CONSOLE_FONT_INFOEX); + + ret = GetCurrentConsoleFontEx(hConsole, maxwindow, &res); + if(ret) + { + fontinfo->nFont = res.nFont; + fontinfo->dwFontSize.X = res.dwFontSize.X; + fontinfo->dwFontSize.Y = res.dwFontSize.Y; + } + return ret; +} + static COORD get_console_font_size(HANDLE hConsole, DWORD index) { COORD c = {0,0}; diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index f6c40a9c42..367f5d2373 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -623,7 +623,7 @@ @ stdcall GetCurrencyFormatW(long long wstr ptr ptr long) @ stdcall -import GetCurrentActCtx(ptr) @ stdcall GetCurrentConsoleFont(long long ptr) -# @ stub GetCurrentConsoleFontEx +@ stdcall GetCurrentConsoleFontEx(long long ptr) @ stdcall -import GetCurrentDirectoryA(long ptr) @ stdcall -import GetCurrentDirectoryW(long ptr) @ stdcall GetCurrentPackageFamilyName(ptr ptr) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 3213f433d9..0712170c80 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2119,7 +2119,11 @@ struct get_console_output_info_reply short int max_height; short int font_width; short int font_height; - /* VARARG(colors,uints); */ + short int font_weight; + short int font_pitch_family; + /* VARARG(colors,uints,64); */ + /* VARARG(face_name,unicode_str); */ + char __pad_44[4]; }; @@ -6693,6 +6697,6 @@ union generic_reply struct resume_process_reply resume_process_reply; }; -#define SERVER_PROTOCOL_VERSION 590 +#define SERVER_PROTOCOL_VERSION 591 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/console.c b/server/console.c index 97d247c98e..59f8843a75 100644 --- a/server/console.c +++ b/server/console.c @@ -1756,6 +1756,8 @@ DECL_HANDLER(set_console_output_info) DECL_HANDLER(get_console_output_info) { struct screen_buffer *screen_buffer; + void *data; + data_size_t total; if ((screen_buffer = (struct screen_buffer *)get_handle_obj( current->process, req->handle, FILE_READ_PROPERTIES, &screen_buffer_ops))) @@ -1776,8 +1778,19 @@ DECL_HANDLER(get_console_output_info) reply->max_height = screen_buffer->max_height; reply->font_width = screen_buffer->font.width; reply->font_height = screen_buffer->font.height; - set_reply_data( screen_buffer->color_map, - min( sizeof(screen_buffer->color_map), get_reply_max_size() )); + reply->font_weight = screen_buffer->font.weight; + reply->font_pitch_family = screen_buffer->font.pitch_family; + total = min( sizeof(screen_buffer->color_map) + screen_buffer->font.face_len, get_reply_max_size() ); + if (total) + { + data = set_reply_data_size( total ); + memcpy( data, screen_buffer->color_map, min( total, sizeof(screen_buffer->color_map) )); + if (screen_buffer->font.face_len && total > sizeof(screen_buffer->color_map)) + { + memcpy( (char *)data + sizeof(screen_buffer->color_map), screen_buffer->font.face_name, + min( total - sizeof(screen_buffer->color_map), screen_buffer->font.face_len )); + } + } release_object( screen_buffer ); } } diff --git a/server/protocol.def b/server/protocol.def index 1b4085ecbf..c5c15ea1d7 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1669,7 +1669,10 @@ struct console_renderer_event short int max_height; short int font_width; /* font size (width x height) */ short int font_height; - VARARG(colors,uints); /* color table */ + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + VARARG(colors,uints,64); /* color table */ + VARARG(face_name,unicode_str); /* font face name */ @END /* Add input records to a console input queue */ diff --git a/server/request.h b/server/request.h index e7846b55b3..f0d2003cd7 100644 --- a/server/request.h +++ b/server/request.h @@ -1225,7 +1225,9 @@ C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_width) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_height) == 34 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_width) == 36 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_height) == 38 ); -C_ASSERT( sizeof(struct get_console_output_info_reply) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_weight) == 40 ); +C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_pitch_family) == 42 ); +C_ASSERT( sizeof(struct get_console_output_info_reply) == 48 ); C_ASSERT( FIELD_OFFSET(struct write_console_input_request, handle) == 12 ); C_ASSERT( sizeof(struct write_console_input_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct write_console_input_reply, written) == 8 ); diff --git a/server/trace.c b/server/trace.c index 94def43537..11df768755 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2162,7 +2162,10 @@ static void dump_get_console_output_info_reply( const struct get_console_output_ fprintf( stderr, ", max_height=%d", req->max_height ); fprintf( stderr, ", font_width=%d", req->font_width ); fprintf( stderr, ", font_height=%d", req->font_height ); - dump_varargs_uints( ", colors=", cur_size ); + fprintf( stderr, ", font_weight=%d", req->font_weight ); + fprintf( stderr, ", font_pitch_family=%d", req->font_pitch_family ); + dump_varargs_uints( ", colors=", min(cur_size,64) ); + dump_varargs_unicode_str( ", face_name=", cur_size ); } static void dump_write_console_input_request( const struct write_console_input_request *req )
1
0
0
0
Gijs Vermeulen : server: Add support for additional fields in set_console_output_info.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 6ca93646be4538564e25f4aa03456c6da8c2115a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6ca93646be4538564e25f4aa…
Author: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Date: Wed Nov 20 11:45:28 2019 +0100 server: Add support for additional fields in set_console_output_info. Signed-off-by: Gijs Vermeulen <gijsvrm(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wine/server_protocol.h | 8 +++++--- programs/wineconsole/wineconsole.c | 3 +++ server/console.c | 35 ++++++++++++++++++++++++++++++----- server/protocol.def | 5 ++++- server/request.h | 2 ++ server/trace.c | 5 ++++- tools/make_requests | 8 +++++++- 7 files changed, 55 insertions(+), 11 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index d8f9816422..3213f433d9 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2074,8 +2074,10 @@ struct set_console_output_info_request short int max_height; short int font_width; short int font_height; - /* VARARG(colors,uints); */ - char __pad_52[4]; + short int font_weight; + short int font_pitch_family; + /* VARARG(colors,uints,64); */ + /* VARARG(face_name,unicode_str); */ }; struct set_console_output_info_reply { @@ -6691,6 +6693,6 @@ union generic_reply struct resume_process_reply resume_process_reply; }; -#define SERVER_PROTOCOL_VERSION 589 +#define SERVER_PROTOCOL_VERSION 590 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 439099c37a..ebcfce1011 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -458,6 +458,9 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf req->max_height = (r.bottom - r.top - GetSystemMetrics(SM_CYCAPTION)) / cfg->cell_height; req->font_width = cfg->cell_width; req->font_height = cfg->cell_height; + req->font_weight = cfg->font_weight; + req->font_pitch_family = FIXED_PITCH | FF_DONTCARE; + wine_server_add_data( req, cfg->face_name, lstrlenW(cfg->face_name) * sizeof(WCHAR) ); wine_server_call( req ); } SERVER_END_REQ; diff --git a/server/console.c b/server/console.c index 7d1fc5d268..97d247c98e 100644 --- a/server/console.c +++ b/server/console.c @@ -131,6 +131,10 @@ struct font_info { short int width; short int height; + short int weight; + short int pitch_family; + WCHAR *face_name; + data_size_t face_len; }; struct screen_buffer @@ -433,6 +437,10 @@ static struct screen_buffer *create_console_output( struct console_input *consol screen_buffer->data = NULL; screen_buffer->font.width = 0; screen_buffer->font.height = 0; + screen_buffer->font.weight = FW_NORMAL; + screen_buffer->font.pitch_family = FIXED_PITCH | FF_DONTCARE; + screen_buffer->font.face_name = NULL; + screen_buffer->font.face_len = 0; memset( screen_buffer->color_map, 0, sizeof(screen_buffer->color_map) ); list_add_head( &screen_buffer_list, &screen_buffer->entry ); @@ -896,6 +904,8 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, const struct set_console_output_info_request *req ) { struct console_renderer_event evt; + data_size_t font_name_len, offset; + WCHAR *font_name; memset(&evt.u, 0, sizeof(evt.u)); if (req->mask & SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM) @@ -1039,15 +1049,29 @@ static int set_console_output_info( struct screen_buffer *screen_buffer, screen_buffer->max_width = req->max_width; screen_buffer->max_height = req->max_height; } + if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE) + { + memcpy( screen_buffer->color_map, get_req_data(), min( get_req_data_size(), sizeof(screen_buffer->color_map) )); + } if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT) { screen_buffer->font.width = req->font_width; screen_buffer->font.height = req->font_height; - } - if (req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE) - { - memcpy( screen_buffer->color_map, get_req_data(), - min( sizeof(screen_buffer->color_map), get_req_data_size() )); + screen_buffer->font.weight = req->font_weight; + screen_buffer->font.pitch_family = req->font_pitch_family; + offset = req->mask & SET_CONSOLE_OUTPUT_INFO_COLORTABLE ? sizeof(screen_buffer->color_map) : 0; + if (get_req_data_size() > offset) + { + font_name_len = (get_req_data_size() - offset) / sizeof(WCHAR) * sizeof(WCHAR); + font_name = mem_alloc( font_name_len ); + if (font_name) + { + memcpy( font_name, (char *)get_req_data() + offset, font_name_len ); + free( screen_buffer->font.face_name ); + screen_buffer->font.face_name = font_name; + screen_buffer->font.face_len = font_name_len; + } + } } return 1; @@ -1183,6 +1207,7 @@ static void screen_buffer_destroy( struct object *obj ) } if (screen_buffer->fd) release_object( screen_buffer->fd ); free( screen_buffer->data ); + free( screen_buffer->font.face_name ); } static struct fd *screen_buffer_get_fd( struct object *obj ) diff --git a/server/protocol.def b/server/protocol.def index 3a0df20bdb..1b4085ecbf 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1633,7 +1633,10 @@ struct console_renderer_event short int max_height; short int font_width; /* font size (width x height) */ short int font_height; - VARARG(colors,uints); /* color table */ + short int font_weight; /* font weight */ + short int font_pitch_family; /* font pitch & family */ + VARARG(colors,uints,64); /* color table */ + VARARG(face_name,unicode_str); /* font face name */ @END #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002 diff --git a/server/request.h b/server/request.h index 1303b35ef7..e7846b55b3 100644 --- a/server/request.h +++ b/server/request.h @@ -1204,6 +1204,8 @@ C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 44 C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 46 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_width) == 48 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_height) == 50 ); +C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_weight) == 52 ); +C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_pitch_family) == 54 ); C_ASSERT( sizeof(struct set_console_output_info_request) == 56 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_request, handle) == 12 ); C_ASSERT( sizeof(struct get_console_output_info_request) == 16 ); diff --git a/server/trace.c b/server/trace.c index 55d5e68962..94def43537 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2133,7 +2133,10 @@ static void dump_set_console_output_info_request( const struct set_console_outpu fprintf( stderr, ", max_height=%d", req->max_height ); fprintf( stderr, ", font_width=%d", req->font_width ); fprintf( stderr, ", font_height=%d", req->font_height ); - dump_varargs_uints( ", colors=", cur_size ); + fprintf( stderr, ", font_weight=%d", req->font_weight ); + fprintf( stderr, ", font_pitch_family=%d", req->font_pitch_family ); + dump_varargs_uints( ", colors=", min(cur_size,64) ); + dump_varargs_unicode_str( ", face_name=", cur_size ); } static void dump_get_console_output_info_request( const struct get_console_output_info_request *req ) diff --git a/tools/make_requests b/tools/make_requests index faeabe5852..4e39bb65a9 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -216,7 +216,13 @@ sub PARSE_REQUESTS() next; } - if (/^\s*VARARG\((\w+),(\w+),(\w+)\)/) + if (/^\s*VARARG\((\w+),(\w+),(\d+)\)/) + { + $var = $1; + $type = "dump_varargs_$2( \"%s\", min(cur_size,$3) )"; + s!(VARARG\(.*\)\s*;)!/* $1 */!; + } + elsif (/^\s*VARARG\((\w+),(\w+),(\w+)\)/) { $var = $1; $type = "dump_varargs_" . $2 . "( \"%s\", min(cur_size,req->" . $3 . ") )";
1
0
0
0
Francois Gouget : comctl32/tests: Trace the iteration counter when a tooltips test fails.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 8b2d5c7c5a1a4476df39618d5b4c468bb2e056c1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8b2d5c7c5a1a4476df39618d…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Nov 21 16:19:56 2019 +0100 comctl32/tests: Trace the iteration counter when a tooltips test fails. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tooltips.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 0cb7afd688..6156bffa13 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -197,7 +197,7 @@ static void test_customdraw(void) { 50, 50, 300, 300, NULL, NULL, NULL, 0); - ok(parent != NULL, "Creation of main window failed\n"); + ok(parent != NULL, "%d: Creation of main window failed\n", iterationNumber); /* Make it show */ ShowWindow(parent, SW_SHOWNORMAL); @@ -209,7 +209,7 @@ static void test_customdraw(void) { CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, GetModuleHandleA(NULL), 0); - ok(hwndTip != NULL, "Creation of tooltip window failed\n"); + ok(hwndTip != NULL, "%d: Creation of tooltip window failed\n", iterationNumber); /* Set up parms for the wndproc to handle */ CD_Stages = 0; @@ -230,7 +230,7 @@ static void test_customdraw(void) { toolInfo.lParam = 0xdeadbeef; GetClientRect (parent, &toolInfo.rect); ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo); - ok(ret, "Failed to add the tool.\n"); + ok(ret, "%d: Failed to add the tool.\n", iterationNumber); /* Make tooltip appear quickly */ SendMessageA(hwndTip, TTM_SETDELAYTIME, TTDT_INITIAL, MAKELPARAM(1,0)); @@ -245,23 +245,23 @@ static void test_customdraw(void) { /* Check CustomDraw results */ ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls || broken(CD_Stages == (expectedResults[iterationNumber].ExpectedCalls & ~TEST_CDDS_POSTPAINT)), /* nt4 */ - "CustomDraw run %d stages %x, expected %x\n", iterationNumber, CD_Stages, + "%d: CustomDraw stages %x, expected %x\n", iterationNumber, CD_Stages, expectedResults[iterationNumber].ExpectedCalls); } ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0); - ok(ret, "Failed to get current tool %#lx.\n", ret); + ok(ret, "%d: Failed to get current tool %#lx.\n", iterationNumber, ret); memset(&toolInfo, 0xcc, sizeof(toolInfo)); toolInfo.cbSize = sizeof(toolInfo); toolInfo.lpszText = NULL; toolInfo.lpReserved = (void *)0xdeadbeef; SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo); - ok(toolInfo.hwnd == parent, "Unexpected hwnd %p.\n", toolInfo.hwnd); - ok(toolInfo.hinst == GetModuleHandleA(NULL), "Unexpected hinst %p.\n", toolInfo.hinst); - ok(toolInfo.uId == 0x1234abcd, "Unexpected uId %lx.\n", toolInfo.uId); - ok(toolInfo.lParam == 0, "Unexpected lParam %lx.\n", toolInfo.lParam); - ok(toolInfo.lpReserved == (void *)0xdeadbeef, "Unexpected lpReserved %p.\n", toolInfo.lpReserved); + ok(toolInfo.hwnd == parent, "%d: Unexpected hwnd %p.\n", iterationNumber, toolInfo.hwnd); + ok(toolInfo.hinst == GetModuleHandleA(NULL), "%d: Unexpected hinst %p.\n", iterationNumber, toolInfo.hinst); + ok(toolInfo.uId == 0x1234abcd, "%d: Unexpected uId %lx.\n", iterationNumber, toolInfo.uId); + ok(toolInfo.lParam == 0, "%d: Unexpected lParam %lx.\n", iterationNumber, toolInfo.lParam); + ok(toolInfo.lpReserved == (void *)0xdeadbeef, "%d: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.lpReserved); /* Clean up */ DestroyWindow(hwndTip);
1
0
0
0
Chip Davis : winegcc: Pass through -fuse-ld= to the linker.
by Alexandre Julliard
25 Nov '19
25 Nov '19
Module: wine Branch: master Commit: 6c50dbd14ec1c652faecc5ca84d78dab74d89b64 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6c50dbd14ec1c652faecc5ca…
Author: Chip Davis <cdavis(a)codeweavers.com> Date: Sun Nov 24 20:13:31 2019 -0600 winegcc: Pass through -fuse-ld= to the linker. Signed-off-by: Chip Davis <cdavis(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 140ca07822..939c1e5c91 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -73,7 +73,7 @@ * object-file-name -llibrary -nostartfiles -nodefaultlibs * -nostdlib -s -static -static-libgcc -static-libstdc++ * -shared -shared-libgcc -symbolic -Wl,option - * -Xlinker option -u symbol --image-base + * -Xlinker option -u symbol --image-base -fuse-ld * * Directory Options * -Bprefix -Idir -I- -Ldir -specs=file @@ -1329,6 +1329,9 @@ static int is_linker_arg(const char* arg) case 'a': if (strcmp("-arch", arg) == 0) return 1; break; + case 'f': + if (strncmp("-fuse-ld=", arg, 9) == 0) return 1; + break; } for (j = 0; j < ARRAY_SIZE(link_switches); j++)
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200