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
March 2020
----- 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
996 discussions
Start a n
N
ew thread
Jacek Caban : dbghelp: Introduce loader_ops to abstract platform-specific loader and use it to synchronize module list.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: fec0157585e9d8bd03a8a71d1ed9b9d7ca59cb56 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fec0157585e9d8bd03a8a71d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 24 01:54:07 2020 +0100 dbghelp: Introduce loader_ops to abstract platform-specific loader and use it to synchronize module list. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 4 ++-- dlls/dbghelp/dbghelp_private.h | 9 +++++++-- dlls/dbghelp/elf_module.c | 18 ++++++++++-------- dlls/dbghelp/macho_module.c | 18 ++++++++++-------- dlls/dbghelp/module.c | 23 ++++++++++++----------- 5 files changed, 41 insertions(+), 31 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index a8e04c7303..0372f90127 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -334,6 +334,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP pcs->handle = hProcess; pcs->is_64bit = (sizeof(void *) == 8 || wow64) && !child_wow64; + pcs->loader = &no_loader_ops; /* platform-specific initialization will override it if loader debug info can be found */ if (UserSearchPath) { @@ -379,8 +380,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP { if (fInvadeProcess) EnumerateLoadedModulesW64(hProcess, process_invade_cb, hProcess); - elf_synchronize_module_list(pcs); - macho_synchronize_module_list(pcs); + pcs->loader->synchronize_module_list(pcs); } else if (fInvadeProcess) { diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index ad6679a3d3..ab1644265f 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -387,10 +387,16 @@ struct module struct wine_rb_tree sources_offsets_tree; }; +struct loader_ops +{ + BOOL (*synchronize_module_list)(struct process* process); +}; + struct process { struct process* next; HANDLE handle; + const struct loader_ops* loader; WCHAR* search_path; PSYMBOL_REGISTERED_CALLBACK64 reg_cb; @@ -601,7 +607,6 @@ extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN; extern struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; -extern BOOL elf_synchronize_module_list(struct process* pcs) DECLSPEC_HIDDEN; struct elf_thunk_area; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; @@ -612,7 +617,6 @@ extern BOOL macho_load_debug_info(struct process *pcs, struct module* mo extern struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN; extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN; -extern BOOL macho_synchronize_module_list(struct process* pcs) DECLSPEC_HIDDEN; /* minidump.c */ void minidump_add_memory_block(struct dump_context* dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN; @@ -621,6 +625,7 @@ void minidump_add_memory_block(struct dump_context* dc, ULONG64 base, ULONG size extern const WCHAR S_ElfW[] DECLSPEC_HIDDEN; extern const WCHAR S_WineLoaderW[] DECLSPEC_HIDDEN; extern const WCHAR S_SlashW[] DECLSPEC_HIDDEN; +extern const struct loader_ops no_loader_ops DECLSPEC_HIDDEN; extern struct module* module_find_by_addr(const struct process* pcs, DWORD64 addr, diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 1c7a77650b..2a4b349c49 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -1623,7 +1623,7 @@ struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned * - if a module is in debuggee and not in pcs, it's loaded into pcs * - if a module is in pcs and not in debuggee, it's unloaded from pcs */ -BOOL elf_synchronize_module_list(struct process* pcs) +static BOOL elf_synchronize_module_list(struct process* pcs) { struct module* module; struct elf_load el; @@ -1704,6 +1704,11 @@ static BOOL elf_search_loader(struct process* pcs, struct elf_info* elf_info) return ret; } +static const struct loader_ops elf_loader_ops = +{ + elf_synchronize_module_list, +}; + /****************************************************************** * elf_read_wine_loader_dbg_info * @@ -1714,10 +1719,12 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) struct elf_info elf_info; elf_info.flags = ELF_INFO_DEBUG_HEADER | ELF_INFO_MODULE; - if (!elf_search_loader(pcs, &elf_info)) return FALSE; + if (!elf_search_loader(pcs, &elf_info) || !elf_info.dbg_hdr_addr) return FALSE; elf_info.module->format_info[DFI_ELF]->u.elf_info->elf_loader = 1; module_set_module(elf_info.module, S_WineLoaderW); - return (pcs->dbg_hdr_addr = elf_info.dbg_hdr_addr) != 0; + pcs->dbg_hdr_addr = elf_info.dbg_hdr_addr; + pcs->loader = &elf_loader_ops; + return TRUE; } #else /* !__ELF__ */ @@ -1727,11 +1734,6 @@ BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap) return FALSE; } -BOOL elf_synchronize_module_list(struct process* pcs) -{ - return FALSE; -} - BOOL elf_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) { diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 93135c71e7..071d7bed5c 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1694,7 +1694,7 @@ static BOOL macho_enum_sync_cb(const WCHAR* name, unsigned long addr, void* user * - if a module is in debuggee and not in pcs, it's loaded into pcs * - if a module is in pcs and not in debuggee, it's unloaded from pcs */ -BOOL macho_synchronize_module_list(struct process* pcs) +static BOOL macho_synchronize_module_list(struct process* pcs) { struct module* module; struct macho_sync ms; @@ -1908,6 +1908,11 @@ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_in return ret; } +static const struct loader_ops macho_loader_ops = +{ + macho_synchronize_module_list, +}; + /****************************************************************** * macho_read_wine_loader_dbg_info * @@ -1919,19 +1924,16 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) TRACE("(%p/%p)\n", pcs, pcs->handle); macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_MODULE; - if (!macho_search_loader(pcs, &macho_info)) return FALSE; + if (!macho_search_loader(pcs, &macho_info) || !macho_info.dbg_hdr_addr) return FALSE; macho_info.module->format_info[DFI_MACHO]->u.macho_info->is_loader = 1; module_set_module(macho_info.module, S_WineLoaderW); - return (pcs->dbg_hdr_addr = macho_info.dbg_hdr_addr) != 0; + pcs->dbg_hdr_addr = macho_info.dbg_hdr_addr; + pcs->loader = &macho_loader_ops; + return TRUE; } #else /* HAVE_MACH_O_LOADER_H */ -BOOL macho_synchronize_module_list(struct process* pcs) -{ - return FALSE; -} - BOOL macho_fetch_file_info(HANDLE process, const WCHAR* name, unsigned long load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum) { diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 74502a9d6b..5ff7e02905 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -529,15 +529,6 @@ enum module_type module_get_type_by_name(const WCHAR* name) return DMT_PE; } -/****************************************************************** - * refresh_module_list - */ -static BOOL refresh_module_list(struct process* pcs) -{ - /* force transparent ELF and Mach-O loading / unloading */ - return elf_synchronize_module_list(pcs) || macho_synchronize_module_list(pcs); -} - static BOOL image_check_debug_link(const WCHAR* file, struct image_file_map* fmap, DWORD link_crc) { DWORD read_bytes; @@ -875,7 +866,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam if (Flags & ~(SLMFLAG_VIRTUAL)) FIXME("Unsupported Flags %08x for %s\n", Flags, debugstr_w(wImageName)); - refresh_module_list(pcs); + pcs->loader->synchronize_module_list(pcs); /* this is a Wine extension to the API just to redo the synchronisation */ if (!wImageName && !hFile) return 0; @@ -1409,7 +1400,7 @@ BOOL WINAPI SymRefreshModuleList(HANDLE hProcess) if (!(pcs = process_find_by_handle(hProcess))) return FALSE; - return refresh_module_list(pcs); + return pcs->loader->synchronize_module_list(pcs); } /*********************************************************************** @@ -1434,3 +1425,13 @@ PVOID WINAPI SymFunctionTableAccess64(HANDLE hProcess, DWORD64 AddrBase) return dbghelp_current_cpu->find_runtime_function(module, AddrBase); } + +static BOOL native_synchronize_module_list(struct process* pcs) +{ + return FALSE; +} + +const struct loader_ops no_loader_ops = +{ + native_synchronize_module_list, +};
1
0
0
0
Jacek Caban : dbghelp: Move loader search functions to the end of module files.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: f30fdd1822462326d3339a21b838d28b623e6486 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f30fdd1822462326d3339a21…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 24 01:53:37 2020 +0100 dbghelp: Move loader search functions to the end of module files. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/elf_module.c | 116 ++++++++++++++-------------- dlls/dbghelp/macho_module.c | 181 ++++++++++++++++++++++---------------------- 2 files changed, 148 insertions(+), 149 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f30fdd1822462326d333…
1
0
0
0
Jacek Caban : dbghelp: Pass process struct to elf_enum_modules and macho_enum_modules.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: 724f433f39f71e8869c49a5960364c5669759b08 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=724f433f39f71e8869c49a59…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 24 01:53:23 2020 +0100 dbghelp: Pass process struct to elf_enum_modules and macho_enum_modules. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp_private.h | 4 ++-- dlls/dbghelp/elf_module.c | 12 ++++-------- dlls/dbghelp/macho_module.c | 13 ++++--------- dlls/dbghelp/minidump.c | 7 +++++-- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 733fc487fe..ad6679a3d3 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -594,7 +594,7 @@ extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN; typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user); /* elf_module.c */ -extern BOOL elf_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN; +extern BOOL elf_enum_modules(struct process*, enum_modules_cb, void*) DECLSPEC_HIDDEN; extern BOOL elf_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN; struct image_file_map; extern BOOL elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN; @@ -606,7 +606,7 @@ struct elf_thunk_area; extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN; /* macho_module.c */ -extern BOOL macho_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN; +extern BOOL macho_enum_modules(struct process*, enum_modules_cb, void*) DECLSPEC_HIDDEN; extern BOOL macho_fetch_file_info(HANDLE process, const WCHAR* name, unsigned long load_addr, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN; extern BOOL macho_load_debug_info(struct process *pcs, struct module* module) DECLSPEC_HIDDEN; extern struct module* diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 0b60524fc4..728025fa40 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -1561,21 +1561,17 @@ static BOOL elf_enum_modules_translate(const WCHAR* name, unsigned long load_add * This function doesn't require that someone has called SymInitialize * on this very process. */ -BOOL elf_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user) +BOOL elf_enum_modules(struct process* process, enum_modules_cb cb, void* user) { - struct process pcs; struct elf_info elf_info; BOOL ret; struct elf_enum_user eeu; - memset(&pcs, 0, sizeof(pcs)); - pcs.handle = hProc; elf_info.flags = ELF_INFO_DEBUG_HEADER | ELF_INFO_NAME; - if (!elf_search_loader(&pcs, &elf_info)) return FALSE; - pcs.dbg_hdr_addr = elf_info.dbg_hdr_addr; + elf_info.module_name = NULL; eeu.cb = cb; eeu.user = user; - ret = elf_enum_modules_internal(&pcs, elf_info.module_name, elf_enum_modules_translate, &eeu); + ret = elf_enum_modules_internal(process, elf_info.module_name, elf_enum_modules_translate, &eeu); HeapFree(GetProcessHeap(), 0, (char*)elf_info.module_name); return ret; } @@ -1747,7 +1743,7 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -BOOL elf_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user) +BOOL elf_enum_modules(struct process *process, enum_modules_cb cb, void* user) { return FALSE; } diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c index 193c97b001..a35ed5db73 100644 --- a/dlls/dbghelp/macho_module.c +++ b/dlls/dbghelp/macho_module.c @@ -1843,19 +1843,14 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) * This function doesn't require that someone has called SymInitialize * on this very process. */ -BOOL macho_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user) +BOOL macho_enum_modules(struct process* process, enum_modules_cb cb, void* user) { - struct process pcs; struct macho_info macho_info; BOOL ret; - TRACE("(%p, %p, %p)\n", hProc, cb, user); - memset(&pcs, 0, sizeof(pcs)); - pcs.handle = hProc; + TRACE("(%p, %p, %p)\n", process->handle, cb, user); macho_info.flags = MACHO_INFO_DEBUG_HEADER | MACHO_INFO_NAME; - if (!macho_search_loader(&pcs, &macho_info)) return FALSE; - pcs.dbg_hdr_addr = macho_info.dbg_hdr_addr; - ret = macho_enum_modules_internal(&pcs, macho_info.module_name, cb, user); + ret = macho_enum_modules_internal(process, macho_info.module_name, cb, user); HeapFree(GetProcessHeap(), 0, (char*)macho_info.module_name); return ret; } @@ -1949,7 +1944,7 @@ BOOL macho_read_wine_loader_dbg_info(struct process* pcs) return FALSE; } -BOOL macho_enum_modules(HANDLE hProc, enum_modules_cb cb, void* user) +BOOL macho_enum_modules(struct process *process, enum_modules_cb cb, void* user) { return FALSE; } diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index dcb09cfcac..c7c8561bf7 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -346,8 +346,11 @@ static void fetch_modules_info(struct dump_context* dc) * And it's always a good idea to have a trace of the loaded ELF modules for * a given application in a post mortem debugging condition. */ - elf_enum_modules(dc->process->handle, fetch_elf_module_info_cb, dc); - macho_enum_modules(dc->process->handle, fetch_macho_module_info_cb, dc); + if (dc->process->dbg_hdr_addr) + { + elf_enum_modules(dc->process, fetch_elf_module_info_cb, dc); + macho_enum_modules(dc->process, fetch_macho_module_info_cb, dc); + } } static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi)
1
0
0
0
Jacek Caban : dbghelp: Store process struct pointer in dump context.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: 6b3018d03da983050516821caa2aada2f4814678 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6b3018d03da983050516821c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 24 01:53:09 2020 +0100 dbghelp: Store process struct pointer in dump context. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/cpu_x86_64.c | 4 ++-- dlls/dbghelp/dbghelp_private.h | 2 +- dlls/dbghelp/minidump.c | 49 ++++++++++++++++++++++++++---------------- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/dlls/dbghelp/cpu_x86_64.c b/dlls/dbghelp/cpu_x86_64.c index 3c0b1d865e..676f18d00c 100644 --- a/dlls/dbghelp/cpu_x86_64.c +++ b/dlls/dbghelp/cpu_x86_64.c @@ -931,7 +931,7 @@ static BOOL x86_64_fetch_minidump_module(struct dump_context* dc, unsigned index const RUNTIME_FUNCTION* rtf; ULONG size; - if (!(pcs = process_find_by_handle(dc->hProcess)) || + if (!(pcs = process_find_by_handle(dc->process->handle)) || !(module = module_find_by_addr(pcs, dc->modules[index].base, DMT_UNKNOWN))) return FALSE; rtf = (const RUNTIME_FUNCTION*)pe_map_directory(module, IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size); @@ -949,7 +949,7 @@ static BOOL x86_64_fetch_minidump_module(struct dump_context* dc, unsigned index /* we need to read into the other process */ /* rtf = (RUNTIME_FUNCTION*)(module->module.BaseOfImage + (rtf->UnwindData & ~1)); */ } - if (ReadProcessMemory(dc->hProcess, + if (ReadProcessMemory(dc->process->handle, (void*)(dc->modules[index].base + rtf->UnwindData), &ui, sizeof(ui), NULL)) minidump_add_memory_block(dc, dc->modules[index].base + rtf->UnwindData, diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 9415881c57..733fc487fe 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -498,7 +498,7 @@ struct dump_thread struct dump_context { /* process & thread information */ - HANDLE hProcess; + struct process *process; DWORD pid; unsigned flags_out; /* thread information */ diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 9922d08032..dcb09cfcac 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -93,7 +93,7 @@ static void fetch_thread_stack(struct dump_context* dc, const void* teb_addr, NT_TIB tib; ADDRESS64 addr; - if (ReadProcessMemory(dc->hProcess, teb_addr, &tib, sizeof(tib), NULL) && + if (ReadProcessMemory(dc->process->handle, teb_addr, &tib, sizeof(tib), NULL) && dbghelp_current_cpu && dbghelp_current_cpu->get_addr(NULL /* FIXME */, ctx, cpu_addr_stack, &addr) && addr.Mode == AddrModeFlat) { @@ -170,9 +170,9 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx, { EXCEPTION_POINTERS ep; - ReadProcessMemory(dc->hProcess, except->ExceptionPointers, + ReadProcessMemory(dc->process->handle, except->ExceptionPointers, &ep, sizeof(ep), NULL); - ReadProcessMemory(dc->hProcess, ep.ContextRecord, + ReadProcessMemory(dc->process->handle, ep.ContextRecord, &lctx, sizeof(lctx), NULL); pctx = &lctx; } @@ -215,7 +215,7 @@ static BOOL add_module(struct dump_context* dc, const WCHAR* name, return FALSE; } if (is_elf || - !GetModuleFileNameExW(dc->hProcess, (HMODULE)(DWORD_PTR)base, + !GetModuleFileNameExW(dc->process->handle, (HMODULE)(DWORD_PTR)base, dc->modules[dc->num_modules].name, ARRAY_SIZE(dc->modules[dc->num_modules].name))) lstrcpynW(dc->modules[dc->num_modules].name, name, @@ -243,7 +243,7 @@ static BOOL WINAPI fetch_pe_module_info_cb(PCWSTR name, DWORD64 base, ULONG size if (!validate_addr64(base)) return FALSE; - if (pe_load_nt_header(dc->hProcess, base, &nth)) + if (pe_load_nt_header(dc->process->handle, base, &nth)) add_module(user, name, base, size, nth.FileHeader.TimeDateStamp, nth.OptionalHeader.CheckSum, FALSE); @@ -289,7 +289,7 @@ static BOOL fetch_macho_module_info_cb(const WCHAR* name, unsigned long base, /* NB: if we have a non-null base from the live-target use it. If we have * a null base, then grab its base address from Mach-O file. */ - if (!macho_fetch_file_info(dc->hProcess, name, base, &rbase, &size, &checksum)) + if (!macho_fetch_file_info(dc->process->handle, name, base, &rbase, &size, &checksum)) size = checksum = 0; add_module(dc, name, base ? base : rbase, size, 0 /* FIXME */, checksum, TRUE); return TRUE; @@ -323,7 +323,7 @@ static void fetch_memory64_info(struct dump_context* dc) MEMORY_BASIC_INFORMATION mbi; addr = 0; - while (VirtualQueryEx(dc->hProcess, (LPCVOID)addr, &mbi, sizeof(mbi)) != 0) + while (VirtualQueryEx(dc->process->handle, (LPCVOID)addr, &mbi, sizeof(mbi)) != 0) { /* Memory regions with state MEM_COMMIT will be added to the dump */ if (mbi.State == MEM_COMMIT) @@ -340,14 +340,14 @@ static void fetch_memory64_info(struct dump_context* dc) static void fetch_modules_info(struct dump_context* dc) { - EnumerateLoadedModulesW64(dc->hProcess, fetch_pe_module_info_cb, dc); + EnumerateLoadedModulesW64(dc->process->handle, fetch_pe_module_info_cb, dc); /* Since we include ELF modules in a separate stream from the regular PE ones, * we can always include those ELF modules (they don't eat lots of space) * And it's always a good idea to have a trace of the loaded ELF modules for * a given application in a post mortem debugging condition. */ - elf_enum_modules(dc->hProcess, fetch_elf_module_info_cb, dc); - macho_enum_modules(dc->hProcess, fetch_macho_module_info_cb, dc); + elf_enum_modules(dc->process->handle, fetch_elf_module_info_cb, dc); + macho_enum_modules(dc->process->handle, fetch_macho_module_info_cb, dc); } static void fetch_module_versioninfo(LPCWSTR filename, VS_FIXEDFILEINFO* ffi) @@ -447,11 +447,11 @@ static unsigned dump_exception_info(struct dump_context* dc, { EXCEPTION_POINTERS ep; - ReadProcessMemory(dc->hProcess, + ReadProcessMemory(dc->process->handle, except->ExceptionPointers, &ep, sizeof(ep), NULL); - ReadProcessMemory(dc->hProcess, + ReadProcessMemory(dc->process->handle, ep.ExceptionRecord, &rec, sizeof(rec), NULL); - ReadProcessMemory(dc->hProcess, + ReadProcessMemory(dc->process->handle, ep.ContextRecord, &ctx, sizeof(ctx), NULL); prec = &rec; pctx = &ctx; @@ -537,7 +537,7 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf) MINIDUMP_CALLBACK_OUTPUT cbout; cbin.ProcessId = dc->pid; - cbin.ProcessHandle = dc->hProcess; + cbin.ProcessHandle = dc->process->handle; cbin.CallbackType = ModuleCallback; cbin.u.Module.FullPath = ms->Buffer; @@ -782,7 +782,7 @@ static unsigned dump_threads(struct dump_context* dc, MINIDUMP_CALLBACK_OUTPUT cbout; cbin.ProcessId = dc->pid; - cbin.ProcessHandle = dc->hProcess; + cbin.ProcessHandle = dc->process->handle; cbin.CallbackType = ThreadCallback; cbin.u.Thread.ThreadId = dc->threads[i].tid; cbin.u.Thread.ThreadHandle = 0; /* FIXME */ @@ -859,7 +859,7 @@ static unsigned dump_memory_info(struct dump_context* dc) for (pos = 0; pos < dc->mem[i].size; pos += sizeof(tmp)) { len = min(dc->mem[i].size - pos, sizeof(tmp)); - if (ReadProcessMemory(dc->hProcess, + if (ReadProcessMemory(dc->process->handle, (void*)(DWORD_PTR)(dc->mem[i].base + pos), tmp, len, NULL)) WriteFile(dc->hFile, tmp, len, &written, NULL); @@ -917,7 +917,7 @@ static unsigned dump_memory64_info(struct dump_context* dc) for (pos = 0; pos < dc->mem64[i].size; pos += sizeof(tmp)) { len = min(dc->mem64[i].size - pos, sizeof(tmp)); - if (ReadProcessMemory(dc->hProcess, + if (ReadProcessMemory(dc->process->handle, (void*)(ULONG_PTR)(dc->mem64[i].base + pos), tmp, len, NULL)) WriteFile(dc->hFile, tmp, len, &written, NULL); @@ -960,8 +960,18 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile, MINIDUMP_DIRECTORY mdDir; DWORD i, nStreams, idx_stream; struct dump_context dc; + BOOL sym_initialized = FALSE; + + if (!(dc.process = process_find_by_handle(hProcess))) + { + if (!(sym_initialized = SymInitializeW(hProcess, NULL, TRUE))) + { + WARN("failed to initialize process\n"); + return FALSE; + } + dc.process = process_find_by_handle(hProcess); + } - dc.hProcess = hProcess; dc.hFile = hFile; dc.pid = pid; dc.modules = NULL; @@ -1097,6 +1107,9 @@ BOOL WINAPI MiniDumpWriteDump(HANDLE hProcess, DWORD pid, HANDLE hFile, for (i = idx_stream; i < nStreams; i++) writeat(&dc, mdHead.StreamDirectoryRva + i * sizeof(emptyDir), &emptyDir, sizeof(emptyDir)); + if (sym_initialized) + SymCleanup(hProcess); + HeapFree(GetProcessHeap(), 0, dc.mem); HeapFree(GetProcessHeap(), 0, dc.mem64); HeapFree(GetProcessHeap(), 0, dc.modules);
1
0
0
0
Alexandre Julliard : kernelbase: Open registry keys before looking for sort table.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: 375668e1222375462314a26e70f25cbf411b6204 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=375668e1222375462314a26e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Mar 24 12:39:28 2020 +0100 kernelbase: Open registry keys before looking for sort table. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/locale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 623cb01280..53e4e42da3 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -658,7 +658,7 @@ static const struct sortguid *get_language_sort( const WCHAR *locale ) const struct sortguid *ret; UNICODE_STRING str; GUID guid; - HKEY key; + HKEY key = 0; DWORD size, type; if (locale == LOCALE_NAME_USER_DEFAULT) @@ -734,8 +734,6 @@ void init_locale(void) RtlInitNlsTables( ansi_ptr, oem_ptr, sort.casemap, &nls_info ); RtlResetRtlTranslations( &nls_info ); - current_locale_sort = get_language_sort( LOCALE_NAME_USER_DEFAULT ); - RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\Nls", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &nls_key, NULL ); RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", @@ -743,6 +741,8 @@ void init_locale(void) RegCreateKeyExW( HKEY_CURRENT_USER, L"Control Panel\\International", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &intl_key, NULL ); + current_locale_sort = get_language_sort( LOCALE_NAME_USER_DEFAULT ); + if (GetDynamicTimeZoneInformation( &timezone ) != TIME_ZONE_ID_INVALID && !RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\TimeZoneInformation", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ))
1
0
0
0
Zebediah Figura : make_makefiles: Allow running from a separate worktree.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: f78fe960bc44deb8f85c6c3cb09954017eeecbc2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f78fe960bc44deb8f85c6c3c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Mar 23 11:58:50 2020 -0500 make_makefiles: Allow running from a separate worktree. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/make_makefiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make_makefiles b/tools/make_makefiles index 79b18778a5..c18fa90e2d 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -501,7 +501,7 @@ sub update_wine_inf() } my $git_dir = $ENV{GIT_DIR} || ".git"; -die "needs to be run from a git checkout" unless -d $git_dir; +die "needs to be run from a git checkout" unless -e $git_dir; my @all_files = split /\0/, `git ls-files -c -z`; map { $ignored_source_files{$_} = 1; } split /\0/, `git ls-files -d -z`;
1
0
0
0
Jeff Smith : jscript: Use wide-string literals in-place for object.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: d9a8485f000718dc794c0546a3268796ede5350e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d9a8485f000718dc794c0546…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Mon Mar 23 15:30:09 2020 -0500 jscript: Use wide-string literals in-place for object. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/object.c | 80 +++++++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 54 deletions(-) diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index 580e11833e..ef249e91a9 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -24,32 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); -static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; - -static const WCHAR createW[] = {'c','r','e','a','t','e',0}; -static const WCHAR getOwnPropertyDescriptorW[] = - {'g','e','t','O','w','n','P','r','o','p','e','r','t','y','D','e','s','c','r','i','p','t','o','r',0}; -static const WCHAR getPrototypeOfW[] = - {'g','e','t','P','r','o','t','o','t','y','p','e','O','f',0}; -static const WCHAR definePropertyW[] = {'d','e','f','i','n','e','P','r','o','p','e','r','t','y',0}; - -static const WCHAR definePropertiesW[] = {'d','e','f','i','n','e','P','r','o','p','e','r','t','i','e','s',0}; - -static const WCHAR default_valueW[] = {'[','o','b','j','e','c','t',' ','O','b','j','e','c','t',']',0}; - -static const WCHAR configurableW[] = {'c','o','n','f','i','g','u','r','a','b','l','e',0}; -static const WCHAR enumerableW[] = {'e','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR valueW[] = {'v','a','l','u','e',0}; -static const WCHAR writableW[] = {'w','r','i','t','a','b','l','e',0}; -static const WCHAR getW[] = {'g','e','t',0}; -static const WCHAR setW[] = {'s','e','t',0}; - static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -110,7 +84,7 @@ static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl return E_FAIL; } - return jsdisp_call_name(jsthis->u.jsdisp, toStringW, DISPATCH_METHOD, 0, NULL, r); + return jsdisp_call_name(jsthis->u.jsdisp, L"toString", DISPATCH_METHOD, 0, NULL, r); } static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, @@ -230,7 +204,7 @@ static HRESULT Object_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) TRACE("\n"); - ret = jsstr_alloc(default_valueW); + ret = jsstr_alloc(L"[object Object]"); if(!ret) return E_OUTOFMEMORY; @@ -244,12 +218,12 @@ static void Object_destructor(jsdisp_t *dispex) } static const builtin_prop_t Object_props[] = { - {hasOwnPropertyW, Object_hasOwnProperty, PROPF_METHOD|1}, - {isPrototypeOfW, Object_isPrototypeOf, PROPF_METHOD|1}, - {propertyIsEnumerableW, Object_propertyIsEnumerable, PROPF_METHOD|1}, - {toLocaleStringW, Object_toLocaleString, PROPF_METHOD}, - {toStringW, Object_toString, PROPF_METHOD}, - {valueOfW, Object_valueOf, PROPF_METHOD} + {L"hasOwnProperty", Object_hasOwnProperty, PROPF_METHOD|1}, + {L"isPrototypeOf", Object_isPrototypeOf, PROPF_METHOD|1}, + {L"propertyIsEnumerable", Object_propertyIsEnumerable, PROPF_METHOD|1}, + {L"toLocaleString", Object_toLocaleString, PROPF_METHOD}, + {L"toString", Object_toString, PROPF_METHOD}, + {L"valueOf", Object_valueOf, PROPF_METHOD} }; static const builtin_info_t Object_info = { @@ -289,7 +263,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro memset(desc, 0, sizeof(*desc)); desc->value = jsval_undefined(); - hres = jsdisp_get_id(attr_obj, enumerableW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"enumerable", 0, &id); if(SUCCEEDED(hres)) { desc->mask |= PROPF_ENUMERABLE; hres = jsdisp_propget(attr_obj, id, &v); @@ -305,7 +279,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro return hres; } - hres = jsdisp_get_id(attr_obj, configurableW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"configurable", 0, &id); if(SUCCEEDED(hres)) { desc->mask |= PROPF_CONFIGURABLE; hres = jsdisp_propget(attr_obj, id, &v); @@ -321,7 +295,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro return hres; } - hres = jsdisp_get_id(attr_obj, valueW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"value", 0, &id); if(SUCCEEDED(hres)) { hres = jsdisp_propget(attr_obj, id, &desc->value); if(FAILED(hres)) @@ -331,7 +305,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro return hres; } - hres = jsdisp_get_id(attr_obj, writableW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"writable", 0, &id); if(SUCCEEDED(hres)) { desc->mask |= PROPF_WRITABLE; hres = jsdisp_propget(attr_obj, id, &v); @@ -349,7 +323,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro return hres; } - hres = jsdisp_get_id(attr_obj, getW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"get", 0, &id); if(SUCCEEDED(hres)) { desc->explicit_getter = TRUE; hres = jsdisp_propget(attr_obj, id, &v); @@ -373,7 +347,7 @@ static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, pro return hres; } - hres = jsdisp_get_id(attr_obj, setW, 0, &id); + hres = jsdisp_get_id(attr_obj, L"set", 0, &id); if(SUCCEEDED(hres)) { desc->explicit_setter = TRUE; hres = jsdisp_propget(attr_obj, id, &v); @@ -561,22 +535,22 @@ static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthi return hres; if(prop_desc.explicit_getter || prop_desc.explicit_setter) { - hres = jsdisp_define_data_property(desc_obj, getW, PROPF_ALL, + hres = jsdisp_define_data_property(desc_obj, L"get", PROPF_ALL, prop_desc.getter ? jsval_obj(prop_desc.getter) : jsval_undefined()); if(SUCCEEDED(hres)) - hres = jsdisp_define_data_property(desc_obj, setW, PROPF_ALL, + hres = jsdisp_define_data_property(desc_obj, L"set", PROPF_ALL, prop_desc.setter ? jsval_obj(prop_desc.setter) : jsval_undefined()); }else { - hres = jsdisp_propput_name(desc_obj, valueW, prop_desc.value); + hres = jsdisp_propput_name(desc_obj, L"value", prop_desc.value); if(SUCCEEDED(hres)) - hres = jsdisp_define_data_property(desc_obj, writableW, PROPF_ALL, + hres = jsdisp_define_data_property(desc_obj, L"writable", PROPF_ALL, jsval_bool(!!(prop_desc.flags & PROPF_WRITABLE))); } if(SUCCEEDED(hres)) - hres = jsdisp_define_data_property(desc_obj, enumerableW, PROPF_ALL, + hres = jsdisp_define_data_property(desc_obj, L"enumerable", PROPF_ALL, jsval_bool(!!(prop_desc.flags & PROPF_ENUMERABLE))); if(SUCCEEDED(hres)) - hres = jsdisp_define_data_property(desc_obj, configurableW, PROPF_ALL, + hres = jsdisp_define_data_property(desc_obj, L"configurable", PROPF_ALL, jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE))); release_property_descriptor(&prop_desc); @@ -652,11 +626,11 @@ static HRESULT Object_getPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl } static const builtin_prop_t ObjectConstr_props[] = { - {createW, Object_create, PROPF_ES5|PROPF_METHOD|2}, - {definePropertiesW, Object_defineProperties, PROPF_ES5|PROPF_METHOD|2}, - {definePropertyW, Object_defineProperty, PROPF_ES5|PROPF_METHOD|2}, - {getOwnPropertyDescriptorW, Object_getOwnPropertyDescriptor, PROPF_ES5|PROPF_METHOD|2}, - {getPrototypeOfW, Object_getPrototypeOf, PROPF_ES5|PROPF_METHOD|1} + {L"create", Object_create, PROPF_ES5|PROPF_METHOD|2}, + {L"defineProperties", Object_defineProperties, PROPF_ES5|PROPF_METHOD|2}, + {L"defineProperty", Object_defineProperty, PROPF_ES5|PROPF_METHOD|2}, + {L"getOwnPropertyDescriptor", Object_getOwnPropertyDescriptor, PROPF_ES5|PROPF_METHOD|2}, + {L"getPrototypeOf", Object_getPrototypeOf, PROPF_ES5|PROPF_METHOD|1} }; static const builtin_info_t ObjectConstr_info = { @@ -717,9 +691,7 @@ static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags HRESULT create_object_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret) { - static const WCHAR ObjectW[] = {'O','b','j','e','c','t',0}; - - return create_builtin_constructor(ctx, ObjectConstr_value, ObjectW, &ObjectConstr_info, PROPF_CONSTR, + return create_builtin_constructor(ctx, ObjectConstr_value, L"Object", &ObjectConstr_info, PROPF_CONSTR, object_prototype, ret); }
1
0
0
0
Derek Lesho : mfreadwrite: Pass source samples through decoder as they arrive.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: 915e1c782e72f165b9c3b12ed600eabb4c5dd2c1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=915e1c782e72f165b9c3b12e…
Author: Derek Lesho <dlesho(a)codeweavers.com> Date: Mon Mar 23 12:03:00 2020 -0500 mfreadwrite: Pass source samples through decoder as they arrive. Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/main.c | 134 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 19 deletions(-) diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index d3c10a4d11..8c994273cb 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -366,6 +366,100 @@ static ULONG WINAPI source_reader_stream_events_callback_Release(IMFAsyncCallbac return IMFSourceReader_Release(&reader->IMFSourceReader_iface); } +static void source_reader_queue_sample(struct media_stream *stream, IMFSample *sample) +{ + struct sample *pending_sample; + + if (!sample) + return; + + pending_sample = heap_alloc(sizeof(*pending_sample)); + pending_sample->sample = sample; + IMFSample_AddRef(pending_sample->sample); + + list_add_tail(&stream->samples, &pending_sample->entry); +} + +static HRESULT source_reader_pull_stream_samples(struct media_stream *stream) +{ + MFT_OUTPUT_STREAM_INFO stream_info = { 0 }; + MFT_OUTPUT_DATA_BUFFER out_buffer; + IMFMediaBuffer *buffer; + DWORD status; + HRESULT hr; + + if (FAILED(hr = IMFTransform_GetOutputStreamInfo(stream->decoder, 0, &stream_info))) + { + WARN("Failed to get output stream info, hr %#x.\n", hr); + return hr; + } + + for (;;) + { + memset(&out_buffer, 0, sizeof(out_buffer)); + + if (!(stream_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES)) + { + if (FAILED(hr = MFCreateSample(&out_buffer.pSample))) + break; + + if (FAILED(hr = MFCreateAlignedMemoryBuffer(stream_info.cbSize, stream_info.cbAlignment, &buffer))) + { + IMFSample_Release(out_buffer.pSample); + break; + } + + IMFSample_AddBuffer(out_buffer.pSample, buffer); + IMFMediaBuffer_Release(buffer); + } + + if (FAILED(hr = IMFTransform_ProcessOutput(stream->decoder, 0, 1, &out_buffer, &status))) + { + if (out_buffer.pSample) + IMFSample_Release(out_buffer.pSample); + break; + } + + source_reader_queue_sample(stream, out_buffer.pSample); + if (out_buffer.pSample) + IMFSample_Release(out_buffer.pSample); + if (out_buffer.pEvents) + IMFCollection_Release(out_buffer.pEvents); + } + + return hr; +} + +static HRESULT source_reader_process_sample(struct media_stream *stream, IMFSample *sample) +{ + HRESULT hr; + + if (!stream->decoder) + { + source_reader_queue_sample(stream, sample); + return S_OK; + } + + /* It's assumed that decoder has 1 input and 1 output, both id's are 0. */ + + hr = source_reader_pull_stream_samples(stream); + if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) + { + if (FAILED(hr = IMFTransform_ProcessInput(stream->decoder, 0, sample, 0))) + { + WARN("Transform failed to process input, hr %#x.\n", hr); + return hr; + } + + if ((hr = source_reader_pull_stream_samples(stream)) == MF_E_TRANSFORM_NEED_MORE_INPUT) + return S_OK; + } + else + WARN("Transform failed to process output, hr %#x.\n", hr); + + return hr; +} + static HRESULT source_reader_media_sample_handler(struct source_reader *reader, IMFMediaStream *stream, IMFMediaEvent *event) { @@ -393,21 +487,14 @@ static HRESULT source_reader_media_sample_handler(struct source_reader *reader, { if (id == reader->streams[i].id) { - struct sample *pending_sample; - - if (!(pending_sample = heap_alloc(sizeof(*pending_sample)))) - { - hr = E_OUTOFMEMORY; - goto failed; - } + EnterCriticalSection(&reader->streams[i].cs); - pending_sample->sample = sample; - IMFSample_AddRef(pending_sample->sample); + hr = source_reader_process_sample(&reader->streams[i], sample); - EnterCriticalSection(&reader->streams[i].cs); - list_add_tail(&reader->streams[i].samples, &pending_sample->entry); LeaveCriticalSection(&reader->streams[i].cs); + /* FIXME: propagate processing errors? */ + WakeAllConditionVariable(&reader->streams[i].sample_event); break; @@ -417,7 +504,6 @@ static HRESULT source_reader_media_sample_handler(struct source_reader *reader, if (i == reader->stream_count) WARN("Stream with id %#x was not present in presentation descriptor.\n", id); -failed: IMFSample_Release(sample); return hr; @@ -438,26 +524,36 @@ static HRESULT source_reader_media_stream_state_handler(struct source_reader *re for (i = 0; i < reader->stream_count; ++i) { - if (id == reader->streams[i].id) + struct media_stream *stream = &reader->streams[i]; + + if (id == stream->id) { - EnterCriticalSection(&reader->streams[i].cs); + EnterCriticalSection(&stream->cs); switch (event) { case MEEndOfStream: - reader->streams[i].state = STREAM_STATE_EOS; + stream->state = STREAM_STATE_EOS; + + if (stream->decoder && SUCCEEDED(IMFTransform_ProcessMessage(stream->decoder, + MFT_MESSAGE_COMMAND_DRAIN, 0))) + { + if ((hr = source_reader_pull_stream_samples(stream)) != MF_E_TRANSFORM_NEED_MORE_INPUT) + WARN("Failed to pull pending samples, hr %#x.\n", hr); + } + break; case MEStreamSeeked: case MEStreamStarted: - reader->streams[i].state = STREAM_STATE_READY; + stream->state = STREAM_STATE_READY; break; default: ; } - LeaveCriticalSection(&reader->streams[i].cs); + LeaveCriticalSection(&stream->cs); - WakeAllConditionVariable(&reader->streams[i].sample_event); + WakeAllConditionVariable(&stream->sample_event); break; } @@ -1006,7 +1102,7 @@ static IMFSample *media_stream_pop_sample(struct media_stream *stream, DWORD *st heap_free(pending_sample); } - *stream_flags = stream->state == STREAM_STATE_EOS ? MF_SOURCE_READERF_ENDOFSTREAM : 0; + *stream_flags = (!ret && stream->state == STREAM_STATE_EOS) ? MF_SOURCE_READERF_ENDOFSTREAM : 0; return ret; }
1
0
0
0
Nikolay Sivov : comctl32/tests: Remove excessive error handling logic.
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: 111acb1597d950e19cd7a08f36d73e6c93cd1917 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=111acb1597d950e19cd7a08f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Mar 23 18:53:39 2020 +0300 comctl32/tests: Remove excessive error handling logic. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/imagelist.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 427ce1a84c..8cc3243323 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -1517,26 +1517,22 @@ static void test_ImageList_DrawIndirect(void) hbmMask = CreateBitmap(2, 1, 1, 1, &maskBits); ok(hbmMask != 0, "CreateBitmap failed\n"); - if(!hbmMask) goto cleanup; hbmInverseMask = CreateBitmap(2, 1, 1, 1, &inverseMaskBits); ok(hbmInverseMask != 0, "CreateBitmap failed\n"); - if(!hbmInverseMask) goto cleanup; himl = pImageList_Create(2, 1, ILC_COLOR32, 0, 1); ok(himl != 0, "ImageList_Create failed\n"); - if(!himl) goto cleanup; hr = pHIMAGELIST_QueryInterface(himl, &IID_IImageList, (void **) &imgl); ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr); /* Add a no-alpha image */ hbmImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_image); - if(!hbmImage) goto cleanup; + ok(hbmImage != NULL, "Failed to create test bitmap.\n"); iImage = pImageList_Add(himl, hbmImage, hbmMask); ok(iImage != -1, "ImageList_Add failed\n"); - if(iImage == -1) goto cleanup; hr = IImageList_GetItemFlags(imgl, 1000, &flags); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); @@ -1550,11 +1546,10 @@ static void test_ImageList_DrawIndirect(void) /* Add an alpha image */ hbmAlphaImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_alpha); - if(!hbmAlphaImage) goto cleanup; + ok(hbmAlphaImage != NULL, "Failed to create test bitmap.\n"); iAlphaImage = pImageList_Add(himl, hbmAlphaImage, hbmMask); ok(iAlphaImage != -1, "ImageList_Add failed\n"); - if(iAlphaImage == -1) goto cleanup; hr = IImageList_GetItemFlags(imgl, iAlphaImage, &flags); ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr); @@ -1562,11 +1557,10 @@ static void test_ImageList_DrawIndirect(void) /* Add a transparent alpha image */ hbmTransparentImage = create_test_bitmap(hdcDst, 2, 1, 32, bits_transparent); - if(!hbmTransparentImage) goto cleanup; + ok(hbmTransparentImage != NULL, "Failed to create test bitmap.\n"); iTransparentImage = pImageList_Add(himl, hbmTransparentImage, hbmMask); ok(iTransparentImage != -1, "ImageList_Add failed\n"); - if(iTransparentImage == -1) goto cleanup; hr = IImageList_GetItemFlags(imgl, iTransparentImage, &flags); ok(hr == S_OK, "Failed to get item flags, hr %#x.\n", hr); @@ -1576,8 +1570,6 @@ static void test_ImageList_DrawIndirect(void) bitmapInfo.bmiHeader.biBitCount = 32; hbmDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok (hbmDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n"); - if (!hbmDst || !bits) - goto cleanup; hbmOld = SelectObject(hdcDst, hbmDst); check_ImageList_DrawIndirect_fStyle(hdcDst, himl, bits, iImage, ILD_NORMAL, 0x00ABCDEF, __LINE__); @@ -1630,24 +1622,19 @@ static void test_ImageList_DrawIndirect(void) bitmapInfo.bmiHeader.biHeight = -4; hbmDst = CreateDIBSection(hdcDst, &bitmapInfo, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok (hbmDst && bits, "CreateDIBSection failed to return a valid bitmap and buffer\n"); - if (!hbmDst || !bits) goto cleanup; SelectObject(hdcDst, hbmDst); hbm4x4 = create_test_bitmap(hdcDst, 4, 4, 32, bits_4x4); - if (!hbm4x4) goto cleanup; + ok(hbm4x4 != NULL, "Failed to create a test bitmap.\n"); ret = pImageList_SetIconSize(himl, 4, 4); ok(ret, "ImageList_SetIconSize failed\n"); - if (!ret) goto cleanup; ret = pImageList_Add(himl, hbm4x4, NULL); ok(ret != -1, "ImageList_Add failed\n"); - if(ret == -1) goto cleanup; check_ImageList_DrawIndirect_grayscale(hdcDst, himl, bits, bits_4x4, 0, 4, 4, __LINE__); -cleanup: - if(hbmOld) SelectObject(hdcDst, hbmOld); if(hbmDst)
1
0
0
0
Dmitry Timoshkov : adsldp: Add support for multi-valued attributes to IADs::Get().
by Alexandre Julliard
24 Mar '20
24 Mar '20
Module: wine Branch: master Commit: fa4820c203eb6175d6fa030d8cb98bddc2391e15 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fa4820c203eb6175d6fa030d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Mar 23 21:14:53 2020 +0800 adsldp: Add support for multi-valued attributes to IADs::Get(). Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/adsldp/adsldp.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/dlls/adsldp/adsldp.c b/dlls/adsldp/adsldp.c index 7cc23438f1..03f7571afd 100644 --- a/dlls/adsldp/adsldp.c +++ b/dlls/adsldp/adsldp.c @@ -569,7 +569,7 @@ static HRESULT WINAPI ldapns_Get(IADs *iface, BSTR name, VARIANT *prop) { if (!wcsicmp(name, ldap->attrs[i].name)) { - ULONG count = ldap_count_valuesW(ldap->attrs[i].values); + LONG count = ldap_count_valuesW(ldap->attrs[i].values); if (!count) { V_BSTR(prop) = NULL; @@ -578,12 +578,45 @@ static HRESULT WINAPI ldapns_Get(IADs *iface, BSTR name, VARIANT *prop) } if (count > 1) - FIXME("attr %s has %u values\n", debugstr_w(ldap->attrs[i].name), count); - - V_BSTR(prop) = SysAllocString(ldap->attrs[i].values[0]); - if (!V_BSTR(prop)) return E_OUTOFMEMORY; - V_VT(prop) = VT_BSTR; - return S_OK; + { + SAFEARRAY *sa; + VARIANT item; + LONG idx; + + TRACE("attr %s has %u values\n", debugstr_w(ldap->attrs[i].name), count); + + sa = SafeArrayCreateVector(VT_VARIANT, 0, count); + if (!sa) return E_OUTOFMEMORY; + + for (idx = 0; idx < count; idx++) + { + V_VT(&item) = VT_BSTR; + V_BSTR(&item) = SysAllocString(ldap->attrs[i].values[idx]); + if (!V_BSTR(&item)) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = SafeArrayPutElement(sa, &idx, &item); + SysFreeString(V_BSTR(&item)); + if (hr != S_OK) goto fail; + } + + V_VT(prop) = VT_ARRAY | VT_VARIANT; + V_ARRAY(prop) = sa; + return S_OK; +fail: + SafeArrayDestroy(sa); + return hr; + } + else + { + V_BSTR(prop) = SysAllocString(ldap->attrs[i].values[0]); + if (!V_BSTR(prop)) return E_OUTOFMEMORY; + V_VT(prop) = VT_BSTR; + return S_OK; + } } }
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
100
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
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200