winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
519 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Rename PROP_IDX to PROP_EXTERN.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 2d4e64d2f6c1d25d19b90dfeab204b02eed3bb6f URL:
https://gitlab.winehq.org/wine/wine/-/commit/2d4e64d2f6c1d25d19b90dfeab204b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 7 11:54:41 2024 +0200 jscript: Rename PROP_IDX to PROP_EXTERN. --- dlls/jscript/dispex.c | 26 +++++++++++++------------- dlls/jscript/engine.c | 8 ++++---- dlls/jscript/function.c | 8 ++++---- dlls/jscript/jscript.h | 4 ++-- dlls/jscript/string.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 72af7054570..ed1cf397927 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -36,7 +36,7 @@ typedef enum { PROP_PROTREF, PROP_ACCESSOR, PROP_DELETED, - PROP_IDX + PROP_EXTERN } prop_type_t; struct _dispex_prop_t { @@ -49,7 +49,7 @@ struct _dispex_prop_t { jsval_t val; const builtin_prop_t *p; DWORD ref; - unsigned idx; + unsigned id; struct { jsdisp_t *getter; jsdisp_t *setter; @@ -256,13 +256,13 @@ static HRESULT find_external_prop(jsdisp_t *This, const WCHAR *name, BOOL case_i idx = idx*10 + (*ptr-'0'); if(!*ptr && idx < This->builtin_info->idx_length(This)) { unsigned flags = PROPF_ENUMERABLE; - if(This->builtin_info->idx_put) + if(This->builtin_info->prop_put) flags |= PROPF_WRITABLE; - prop = alloc_prop(This, name, PROP_IDX, flags); + prop = alloc_prop(This, name, PROP_EXTERN, flags); if(!prop) return E_OUTOFMEMORY; - prop->u.idx = idx; + prop->u.id = idx; *ret = prop; return S_OK; } @@ -475,8 +475,8 @@ static HRESULT prop_get(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t *prop, hres = S_OK; } break; - case PROP_IDX: - hres = prop_obj->builtin_info->idx_get(prop_obj, prop->u.idx, r); + case PROP_EXTERN: + hres = prop_obj->builtin_info->prop_get(prop_obj, prop->u.id, r); break; default: ERR("type %d\n", prop->type); @@ -536,12 +536,12 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) return S_OK; } return jsdisp_call_value(prop->u.accessor.setter, jsval_obj(This), DISPATCH_METHOD, 1, &val, NULL); - case PROP_IDX: - if(!This->builtin_info->idx_put) { - TRACE("no put_idx\n"); + case PROP_EXTERN: + if(!This->builtin_info->prop_put) { + TRACE("no prop_put\n"); return S_OK; } - return This->builtin_info->idx_put(This, prop->u.idx, val); + return This->builtin_info->prop_put(This, prop->u.id, val); default: ERR("type %d\n", prop->type); return E_FAIL; @@ -583,7 +583,7 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t flags, argc, argv, r, caller); } case PROP_ACCESSOR: - case PROP_IDX: { + case PROP_EXTERN: { jsval_t val; hres = prop_get(This, jsthis ? jsthis : (IDispatch *)&This->IDispatchEx_iface, prop, &val); @@ -2976,7 +2976,7 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl switch(prop->type) { case PROP_BUILTIN: case PROP_JSVAL: - case PROP_IDX: + case PROP_EXTERN: desc->mask |= PROPF_WRITABLE; desc->explicit_value = TRUE; if(!flags_only) { diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 60b479fb83b..2e52bb5ed2f 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -485,14 +485,14 @@ static unsigned scope_idx_length(jsdisp_t *dispex) return scope->detached_vars->argc; } -static HRESULT scope_idx_get(jsdisp_t *dispex, unsigned idx, jsval_t *r) +static HRESULT scope_prop_get(jsdisp_t *dispex, unsigned idx, jsval_t *r) { scope_chain_t *scope = scope_from_dispex(dispex); return jsval_copy(scope->detached_vars->var[idx], r); } -static HRESULT scope_idx_put(jsdisp_t *dispex, unsigned idx, jsval_t val) +static HRESULT scope_prop_put(jsdisp_t *dispex, unsigned idx, jsval_t val) { scope_chain_t *scope = scope_from_dispex(dispex); jsval_t copy, *ref; @@ -547,8 +547,8 @@ static const builtin_info_t scope_info = { JSCLASS_NONE, .destructor = scope_destructor, .idx_length = scope_idx_length, - .idx_get = scope_idx_get, - .idx_put = scope_idx_put, + .prop_get = scope_prop_get, + .prop_put = scope_prop_put, .gc_traverse = scope_gc_traverse }; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 9c339b807f7..7f0779c2aff 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -132,7 +132,7 @@ static jsval_t *get_argument_ref(ArgumentsInstance *arguments, unsigned idx) return arguments->scope->detached_vars->var + idx; } -static HRESULT Arguments_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) +static HRESULT Arguments_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); @@ -141,7 +141,7 @@ static HRESULT Arguments_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) return jsval_copy(*get_argument_ref(arguments, idx), r); } -static HRESULT Arguments_idx_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) +static HRESULT Arguments_prop_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) { ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t copy, *ref; @@ -187,8 +187,8 @@ static const builtin_info_t Arguments_info = { .call = Arguments_value, .destructor = Arguments_destructor, .idx_length = Arguments_idx_length, - .idx_get = Arguments_idx_get, - .idx_put = Arguments_idx_put, + .prop_get = Arguments_prop_get, + .prop_put = Arguments_prop_put, .gc_traverse = Arguments_gc_traverse }; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 80641731006..7ee6949bdea 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -186,8 +186,8 @@ typedef struct { void (*destructor)(jsdisp_t*); void (*on_put)(jsdisp_t*,const WCHAR*); unsigned (*idx_length)(jsdisp_t*); - HRESULT (*idx_get)(jsdisp_t*,unsigned,jsval_t*); - HRESULT (*idx_put)(jsdisp_t*,unsigned,jsval_t); + HRESULT (*prop_get)(jsdisp_t*,unsigned,jsval_t*); + HRESULT (*prop_put)(jsdisp_t*,unsigned,jsval_t); HRESULT (*gc_traverse)(struct gc_ctx*,enum gc_traverse_op,jsdisp_t*); } builtin_info_t; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index ab7497912f2..9e1b7aff11c 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1515,7 +1515,7 @@ static unsigned String_idx_length(jsdisp_t *jsdisp) return string->dispex.ctx->version < 2 ? 0 : jsstr_length(string->str); } -static HRESULT String_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) +static HRESULT String_prop_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { StringInstance *string = string_from_jsdisp(jsdisp); jsstr_t *ret; @@ -1584,7 +1584,7 @@ static const builtin_info_t StringInst_info = { .props = StringInst_props, .destructor = String_destructor, .idx_length = String_idx_length, - .idx_get = String_idx_get, + .prop_get = String_prop_get, }; /* ECMA-262 3rd Edition 15.5.3.2 */
1
0
0
0
Jacek Caban : jscript: Factor out find_external_prop.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 4cf1b4fa3a5b75810db071f9521cc87807b8f0ac URL:
https://gitlab.winehq.org/wine/wine/-/commit/4cf1b4fa3a5b75810db071f9521cc8…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jul 6 18:18:21 2024 +0200 jscript: Factor out find_external_prop. --- dlls/jscript/dispex.c | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index a678421f0a3..72af7054570 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -244,6 +244,34 @@ static dispex_prop_t *alloc_protref(jsdisp_t *This, const WCHAR *name, DWORD ref return ret; } +static HRESULT find_external_prop(jsdisp_t *This, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) +{ + dispex_prop_t *prop; + + if(This->builtin_info->idx_length) { + const WCHAR *ptr; + unsigned idx = 0; + + for(ptr = name; is_digit(*ptr) && idx < 0x10000; ptr++) + idx = idx*10 + (*ptr-'0'); + if(!*ptr && idx < This->builtin_info->idx_length(This)) { + unsigned flags = PROPF_ENUMERABLE; + if(This->builtin_info->idx_put) + flags |= PROPF_WRITABLE; + prop = alloc_prop(This, name, PROP_IDX, flags); + if(!prop) + return E_OUTOFMEMORY; + + prop->u.idx = idx; + *ret = prop; + return S_OK; + } + } + + *ret = NULL; + return S_OK; +} + static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) { const builtin_prop_t *builtin; @@ -301,28 +329,7 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, return S_OK; } - if(This->builtin_info->idx_length) { - const WCHAR *ptr; - unsigned idx = 0; - - for(ptr = name; is_digit(*ptr) && idx < 0x10000; ptr++) - idx = idx*10 + (*ptr-'0'); - if(!*ptr && idx < This->builtin_info->idx_length(This)) { - unsigned flags = PROPF_ENUMERABLE; - if(This->builtin_info->idx_put) - flags |= PROPF_WRITABLE; - prop = alloc_prop(This, name, PROP_IDX, flags); - if(!prop) - return E_OUTOFMEMORY; - - prop->u.idx = idx; - *ret = prop; - return S_OK; - } - } - - *ret = NULL; - return S_OK; + return find_external_prop(This, name, case_insens, ret); } static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret)
1
0
0
0
Alex Henrie : advapi32/tests: Drop security test workarounds for Windows <= 2000.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 004eb16c1f667409d07c9152a635b4d54fb98237 URL:
https://gitlab.winehq.org/wine/wine/-/commit/004eb16c1f667409d07c9152a635b4…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Fri Jul 5 10:44:50 2024 -0600 advapi32/tests: Drop security test workarounds for Windows <= 2000. --- dlls/advapi32/tests/security.c | 585 +++++++++++++---------------------------- 1 file changed, 182 insertions(+), 403 deletions(-)
1
0
0
0
Hans Leidekker : msi: Avoid infinite recursion while processing the DrLocator table.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 89cebe8960d597f8574704633d4f0621abf08887 URL:
https://gitlab.winehq.org/wine/wine/-/commit/89cebe8960d597f8574704633d4f06…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Jul 8 13:39:38 2024 +0200 msi: Avoid infinite recursion while processing the DrLocator table. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56938
--- dlls/msi/appsearch.c | 134 +++++++++++++++++++++++++++++++++------------------ dlls/msi/msipriv.h | 11 +++++ dlls/msi/package.c | 1 + 3 files changed, 100 insertions(+), 46 deletions(-) diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 381e74317fe..070f31c5227 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -940,80 +940,122 @@ static UINT search_directory( MSIPACKAGE *package, struct signature *sig, const return rc; } +static UINT load_drlocator( MSIRECORD *row, void *param ) +{ + MSIPACKAGE *package = param; + MSIDRLOCATOR *locator; + + if (!(locator = calloc( 1, sizeof(MSIDRLOCATOR) ))) return ERROR_FUNCTION_FAILED; + + locator->Signature = msi_dup_record_field( row, 1 ); + + TRACE("Loading DrLocator %s\n", debugstr_w(locator->Signature)); + + locator->Parent = msi_dup_record_field( row, 2 ); + locator->Path = msi_dup_record_field( row, 3 ); + locator->Depth = MSI_RecordGetInteger( row,4 ); + list_add_tail( &package->drlocators, &locator->entry ); + return ERROR_SUCCESS; +} + +static UINT load_all_drlocators( MSIPACKAGE *package ) +{ + MSIQUERY *view; + UINT r; + + r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DrLocator`", &view ); + if (r != ERROR_SUCCESS) + return ERROR_SUCCESS; + + r = MSI_IterateRecords( view, NULL, load_drlocator, package ); + msiobj_release( &view->hdr ); + return r; +} + +static void free_drlocators( MSIPACKAGE *package ) +{ + struct list *item, *cursor; + + LIST_FOR_EACH_SAFE( item, cursor, &package->drlocators ) + { + MSIDRLOCATOR *locator = LIST_ENTRY( item, MSIDRLOCATOR, entry ); + + list_remove( &locator->entry ); + free( locator->Signature ); + free( locator->Parent ); + free( locator->Path ); + free( locator ); + } +} + static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, struct signature *, WCHAR ** ); -static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, struct signature *sig ) +static UINT search_dr( MSIPACKAGE *package, WCHAR **app_value, struct signature *sig ) { - LPWSTR parent = NULL; - LPCWSTR parentName; - WCHAR path[MAX_PATH]; - WCHAR expanded[MAX_PATH]; - MSIRECORD *row; - int depth; - DWORD sz, attr; + WCHAR path[MAX_PATH], expanded[MAX_PATH], *parent = NULL; + MSIDRLOCATOR *locator = NULL; + DWORD attr; UINT rc; TRACE("%s\n", debugstr_w(sig->Name)); - *appValue = NULL; + if ((rc = load_all_drlocators( package ))) return rc; - row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `DrLocator` WHERE `Signature_` = '%s'", sig->Name ); - if (!row) + *app_value = NULL; + + LIST_FOR_EACH_ENTRY( locator, &package->drlocators, MSIDRLOCATOR, entry ) { - TRACE("failed to query DrLocator for %s\n", debugstr_w(sig->Name)); - return ERROR_SUCCESS; + if (!wcscmp( sig->Name, locator->Signature )) break; } - /* check whether parent is set */ - parentName = MSI_RecordGetString(row, 2); - if (parentName) + if (!locator) { - struct signature parentSig; - - search_sig_name( package, parentName, &parentSig, &parent ); - free_signature( &parentSig ); - if (!parent) - { - msiobj_release(&row->hdr); - return ERROR_SUCCESS; - } + TRACE("failed to find DrLocator for %s\n", debugstr_w(sig->Name)); + goto done; + } + if (locator->Seen) + { + TRACE("DrLocator %s already seen\n", debugstr_w(sig->Name)); + goto done; } + locator->Seen = TRUE; - sz = MAX_PATH; - MSI_RecordGetStringW(row, 3, path, &sz); + if (locator->Parent) + { + struct signature parent_sig; - if (MSI_RecordIsNull(row,4)) - depth = 0; - else - depth = MSI_RecordGetInteger(row,4); + search_sig_name( package, locator->Parent, &parent_sig, &parent ); + free_signature( &parent_sig ); + if (!parent) return ERROR_SUCCESS; + } - if (sz) - expand_any_path( package, path, expanded, MAX_PATH ); + if (locator->Path) + expand_any_path( package, locator->Path, expanded, MAX_PATH ); else - lstrcpyW(expanded, path); + expanded[0] = 0; if (parent) { attr = msi_get_file_attributes( package, parent ); - if (attr != INVALID_FILE_ATTRIBUTES && - !(attr & FILE_ATTRIBUTE_DIRECTORY)) + if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) { - PathRemoveFileSpecW(parent); - PathAddBackslashW(parent); + PathRemoveFileSpecW( parent ); + PathAddBackslashW( parent ); } - lstrcpyW(path, parent); - lstrcatW(path, expanded); + wcscpy( path, parent ); + wcscat( path, expanded ); } - else if (sz) lstrcpyW(path, expanded); + else wcscpy( path, expanded ); - PathAddBackslashW(path); + PathAddBackslashW( path ); - rc = search_directory( package, sig, path, depth, appValue ); + rc = search_directory( package, sig, path, locator->Depth, app_value ); - free(parent); - msiobj_release(&row->hdr); - TRACE("returning %d\n", rc); +done: + free_drlocators( package ); + free( parent ); + TRACE("returning %u\n", rc); return rc; } diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index b7bc1e7b067..e5612331d60 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -406,6 +406,7 @@ typedef struct tagMSIPACKAGE struct list folders; struct list binaries; struct list cabinet_streams; + struct list drlocators; LPWSTR ActionFormat; LPWSTR LastAction; LPWSTR LastActionTemplate; @@ -715,6 +716,16 @@ struct tagMSIMIME MSICLASS *Class; }; +typedef struct +{ + struct list entry; + WCHAR *Signature; + WCHAR *Parent; + WCHAR *Path; + int Depth; + BOOL Seen; +} MSIDRLOCATOR; + #define SEQUENCE_UI 0x1 #define SEQUENCE_EXEC 0x2 diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 8c2168d9226..fb5463823e3 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -933,6 +933,7 @@ static MSIPACKAGE *alloc_package( void ) list_init( &package->patches ); list_init( &package->binaries ); list_init( &package->cabinet_streams ); + list_init( &package->drlocators ); } return package;
1
0
0
0
Alex Henrie : advapi32/tests: Test RegGetValue[AW] null termination.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 33874068b4640a01438d35fae6d52928e1b57198 URL:
https://gitlab.winehq.org/wine/wine/-/commit/33874068b4640a01438d35fae6d529…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Jul 7 21:23:29 2024 -0600 advapi32/tests: Test RegGetValue[AW] null termination. --- dlls/advapi32/tests/registry.c | 136 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 2afebb3365b..17085cb6b1c 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -911,7 +911,11 @@ static void test_get_value(void) /* Query REG_SZ using RRF_RT_REG_SZ on a zero-byte value (ok) */ strcpy(buf, sTestpath1); type = 0xdeadbeef; - size = sizeof(buf); + size = 0; + ret = pRegGetValueA(hkey_main, NULL, "TP1_ZB_SZ", RRF_RT_REG_SZ, &type, NULL, &size); + ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret); + todo_wine ok(size == 1, "size=%ld\n", size); + ok(type == REG_SZ, "type=%ld\n", type); ret = pRegGetValueA(hkey_main, NULL, "TP1_ZB_SZ", RRF_RT_REG_SZ, &type, buf, &size); ok(ret == ERROR_SUCCESS, "ret=%ld\n", ret); todo_wine ok(size == 1, "size=%ld\n", size); @@ -2210,6 +2214,135 @@ static void test_string_termination(void) debugstr_an((char*)buffer, outsize), outsize, string); ok(buffer[insize] == 0, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + /* RegGetValueA always adds the trailing '\0' */ + if (pRegGetValueA) + { + outsize = insize; + ret = pRegGetValueA(subkey, NULL, "stringtest", RRF_RT_REG_SZ, NULL, buffer, &outsize); + todo_wine ok(ret == ERROR_MORE_DATA, "RegGetValueA returned: %ld\n", ret); + todo_wine ok(outsize == insize + 1, "wrong size: %lu != %lu\n", outsize, insize + 1); + memset(buffer, 0xbd, sizeof(buffer)); + ret = pRegGetValueA(subkey, NULL, "stringtest", RRF_RT_REG_SZ, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegGetValueA returned: %ld\n", ret); + todo_wine ok(outsize == insize + 1, "wrong size: %lu != %lu\n", outsize, insize + 1); + ok(memcmp(buffer, string, insize) == 0, "bad string: %s/%lu != %s\n", + debugstr_an((char*)buffer, insize), insize, string); + todo_wine ok(buffer[insize] == 0, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + } + + RegDeleteKeyA(subkey, ""); + RegCloseKey(subkey); +} + +static void test_multistring_termination(void) +{ + HKEY subkey; + LSTATUS ret; + static const char multistring[] = "Aa\0Bb\0Cc\0"; + char name[sizeof("multistringtest")]; + BYTE buffer[sizeof(multistring)]; + DWORD insize, outsize, nsize; + + ret = RegCreateKeyA(hkey_main, "multistring_termination", &subkey); + ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", ret); + + /* Off-by-one RegSetValueExA -> only one trailing '\0' */ + insize = sizeof(multistring) - 1; + ret = RegSetValueExA(subkey, "multistringtest", 0, REG_SZ, (BYTE*)multistring, insize); + ok(ret == ERROR_SUCCESS, "RegSetValueExA failed: %ld\n", ret); + outsize = 0; + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, NULL, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %ld\n", ret); + ok(outsize == insize, "wrong size %lu != %lu\n", outsize, insize); + + /* Off-by-two RegSetValueExA -> adds a trailing '\0'! */ + insize = sizeof(multistring) - 2; + ret = RegSetValueExA(subkey, "multistringtest", 0, REG_SZ, (BYTE*)multistring, insize); + ok(ret == ERROR_SUCCESS, "RegSetValueExA failed: %ld\n", ret); + outsize = insize; + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_MORE_DATA, "RegQueryValueExA returned: %ld\n", ret); + + /* Off-by-three RegSetValueExA -> no trailing '\0' */ + insize = sizeof(multistring) - 3; + ret = RegSetValueExA(subkey, "multistringtest", 0, REG_SZ, (BYTE*)multistring, insize); + ok(ret == ERROR_SUCCESS, "RegSetValueExA failed: %ld\n", ret); + outsize = 0; + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, NULL, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %ld\n", ret); + ok(outsize == insize, "wrong size %lu != %lu\n", outsize, insize); + + /* RegQueryValueExA may return a multistring with no trailing '\0' */ + outsize = insize; + memset(buffer, 0xbd, sizeof(buffer)); + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %ld\n", ret); + ok(outsize == insize, "wrong size: %lu != %lu\n", outsize, insize); + ok(memcmp(buffer, multistring, outsize) == 0, "bad multistring: %s/%lu != %s\n", + debugstr_an((char*)buffer, outsize), outsize, multistring); + ok(buffer[insize] == 0xbd, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + + /* RegQueryValueExA adds one trailing '\0' if there is room */ + outsize = insize + 1; + memset(buffer, 0xbd, sizeof(buffer)); + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %ld\n", ret); + ok(outsize == insize, "wrong size: %lu != %lu\n", outsize, insize); + ok(memcmp(buffer, multistring, outsize) == 0, "bad multistring: %s/%lu != %s\n", + debugstr_an((char*)buffer, outsize), outsize, multistring); + ok(buffer[insize] == 0, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + + /* RegQueryValueExA doesn't add a second trailing '\0' even if there is room */ + outsize = insize + 2; + memset(buffer, 0xbd, sizeof(buffer)); + ret = RegQueryValueExA(subkey, "multistringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %ld\n", ret); + ok(outsize == insize, "wrong size: %lu != %lu\n", outsize, insize); + ok(memcmp(buffer, multistring, outsize) == 0, "bad multistring: %s/%lu != %s\n", + debugstr_an((char*)buffer, outsize), outsize, multistring); + ok(buffer[insize + 1] == 0xbd, "buffer overflow at %lu %02x\n", insize, buffer[insize + 1]); + + /* RegEnumValueA may return a multistring with no trailing '\0' */ + outsize = insize; + memset(buffer, 0xbd, sizeof(buffer)); + nsize = sizeof(name); + ret = RegEnumValueA(subkey, 0, name, &nsize, NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegEnumValueA failed: %ld\n", ret); + ok(strcmp(name, "multistringtest") == 0, "wrong name: %s\n", name); + ok(outsize == insize, "wrong size: %lu != %lu\n", outsize, insize); + ok(memcmp(buffer, multistring, outsize) == 0, "bad multistring: %s/%lu != %s\n", + debugstr_an((char*)buffer, outsize), outsize, multistring); + ok(buffer[insize] == 0xbd, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + + /* RegEnumValueA adds one trailing '\0' even if there's room for two */ + outsize = insize + 2; + memset(buffer, 0xbd, sizeof(buffer)); + nsize = sizeof(name); + ret = RegEnumValueA(subkey, 0, name, &nsize, NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegEnumValueA failed: %ld\n", ret); + ok(strcmp(name, "multistringtest") == 0, "wrong name: %s\n", name); + ok(outsize == insize, "wrong size: %lu != %lu\n", outsize, insize); + ok(memcmp(buffer, multistring, outsize) == 0, "bad multistring: %s/%lu != %s\n", + debugstr_an((char*)buffer, outsize), outsize, multistring); + ok(buffer[insize] == 0, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + ok(buffer[insize + 1] == 0xbd, "buffer overflow at %lu %02x\n", insize, buffer[insize]); + + /* RegGetValueA always adds one trailing '\0' even if there's room for two */ + if (pRegGetValueA) + { + outsize = insize; + ret = pRegGetValueA(subkey, NULL, "multistringtest", RRF_RT_REG_SZ, NULL, buffer, &outsize); + todo_wine ok(ret == ERROR_MORE_DATA, "RegGetValueA returned: %ld\n", ret); + todo_wine ok(outsize == insize + 1, "wrong size: %lu != %lu\n", outsize, insize + 1); + outsize = insize + 2; + memset(buffer, 0xbd, sizeof(buffer)); + ret = pRegGetValueA(subkey, NULL, "multistringtest", RRF_RT_REG_SZ, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegGetValueA returned: %ld\n", ret); + todo_wine ok(outsize == insize + 1, "wrong size: %lu != %lu\n", outsize, insize + 1); + ok(buffer[insize] == 0, "buffer overflow at %lu %02x\n", insize, buffer[insize + 1]); + ok(buffer[insize + 1] == 0xbd, "buffer overflow at %lu %02x\n", insize, buffer[insize + 1]); + } + RegDeleteKeyA(subkey, ""); RegCloseKey(subkey); } @@ -5007,6 +5140,7 @@ START_TEST(registry) test_reg_query_value(); test_reg_query_info(); test_string_termination(); + test_multistring_termination(); test_symlinks(); test_redirection(); test_classesroot();
1
0
0
0
Alexandre Julliard : wow64cpu: Simplify the Unix call thunk.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: a573860062b1117ec97c9e92fb82e1437fa1dd34 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a573860062b1117ec97c9e92fb82e1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 8 23:08:51 2024 +0200 wow64cpu: Simplify the Unix call thunk. Non-PE builds are no longer supported. --- dlls/wow64cpu/cpu.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c index c574315ec7d..6c6b2352bb6 100644 --- a/dlls/wow64cpu/cpu.c +++ b/dlls/wow64cpu/cpu.c @@ -43,14 +43,7 @@ struct thunk_32to64 struct thunk_opcodes { struct thunk_32to64 syscall_thunk; - struct - { - BYTE pushl; /* pushl $dispatcher_high */ - DWORD dispatcher_high; - BYTE pushl2; /* pushl $dispatcher_low */ - DWORD dispatcher_low; - struct thunk_32to64 t; - } unix_thunk; + struct thunk_32to64 unix_thunk; }; #include "poppack.h" @@ -60,6 +53,8 @@ static USHORT cs64_sel; static USHORT ds64_sel; static USHORT fs32_sel; +void **__wine_unix_call_dispatcher = NULL; + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst ); @@ -252,14 +247,14 @@ __ASM_GLOBAL_FUNC( unix_call_32to64, "movl %esi,0xa0(%r13)\n\t" /* context->Esi */ "movl %ebx,0xa4(%r13)\n\t" /* context->Ebx */ "movl %ebp,0xb4(%r13)\n\t" /* context->Ebp */ - "movl 8(%r14),%edx\n\t" + "movl (%r14),%edx\n\t" "movl %edx,0xb8(%r13)\n\t" /* context->Eip */ - "leaq 28(%r14),%rdx\n\t" + "leaq 20(%r14),%rdx\n\t" "movl %edx,0xc4(%r13)\n\t" /* context->Esp */ - "movq 12(%r14),%rcx\n\t" /* handle */ - "movl 20(%r14),%edx\n\t" /* code */ - "movl 24(%r14),%r8d\n\t" /* args */ - "callq *(%r14)\n\t" + "movq 4(%r14),%rcx\n\t" /* handle */ + "movl 12(%r14),%edx\n\t" /* code */ + "movl 16(%r14),%r8d\n\t" /* args */ + "callq *__wine_unix_call_dispatcher(%rip)\n\t" "btrl $0,-4(%r13)\n\t" /* cpu->Flags & WOW64_CPURESERVED_FLAG_RESET_STATE */ "jc .Lsyscall_32to64_return\n\t" "movl 0xb8(%r13),%edx\n\t" /* context->Eip */ @@ -316,6 +311,7 @@ NTSTATUS WINAPI BTCpuProcessInit(void) LdrGetDllHandle( NULL, 0, &str, &module ); p__wine_unix_call_dispatcher = RtlFindExportedRoutineByName( module, "__wine_unix_call_dispatcher" ); + __wine_unix_call_dispatcher = *p__wine_unix_call_dispatcher; RtlCaptureContext( &context ); cs64_sel = context.SegCs; @@ -328,15 +324,11 @@ NTSTATUS WINAPI BTCpuProcessInit(void) thunk->syscall_thunk.addr = PtrToUlong( syscall_32to64 ); thunk->syscall_thunk.cs = cs64_sel; - thunk->unix_thunk.pushl = 0x68; - thunk->unix_thunk.dispatcher_high = (ULONG_PTR)*p__wine_unix_call_dispatcher >> 32; - thunk->unix_thunk.pushl2 = 0x68; - thunk->unix_thunk.dispatcher_low = (ULONG_PTR)*p__wine_unix_call_dispatcher; - thunk->unix_thunk.t.ljmp = 0xff; - thunk->unix_thunk.t.modrm = 0x2d; - thunk->unix_thunk.t.op = PtrToUlong( &thunk->unix_thunk.t.addr ); - thunk->unix_thunk.t.addr = PtrToUlong( unix_call_32to64 ); - thunk->unix_thunk.t.cs = cs64_sel; + thunk->unix_thunk.ljmp = 0xff; + thunk->unix_thunk.modrm = 0x2d; + thunk->unix_thunk.op = PtrToUlong( &thunk->unix_thunk.addr ); + thunk->unix_thunk.addr = PtrToUlong( unix_call_32to64 ); + thunk->unix_thunk.cs = cs64_sel; NtProtectVirtualMemory( GetCurrentProcess(), (void **)&thunk, &size, PAGE_EXECUTE_READ, &old_prot ); return STATUS_SUCCESS;
1
0
0
0
Alexandre Julliard : wow64: Add NtReadFile CPU backend notifications.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: 77337f7dd3a4ffe80d9fabb7a5bea40913ed6f90 URL:
https://gitlab.winehq.org/wine/wine/-/commit/77337f7dd3a4ffe80d9fabb7a5bea4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 8 12:45:12 2024 +0200 wow64: Add NtReadFile CPU backend notifications. --- dlls/ntdll/tests/wow64.c | 2 -- dlls/wow64/file.c | 2 ++ dlls/wow64/syscall.c | 2 ++ dlls/wow64/wow64_private.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index fcd10df92a0..bae012fec0c 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -1818,14 +1818,12 @@ static void test_notifications( HMODULE module, CROSS_PROCESS_WORK_LIST *list ) reset_results( results ); status = NtReadFile( file, 0, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL ); ok( !status, "NtReadFile failed %lx\n", status ); - todo_wine expect_notifications( results, 2, expect ); status = NtReadFile( (HANDLE)0xdead, 0, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL ); ok( status == STATUS_INVALID_HANDLE, "NtReadFile failed %lx\n", status ); expect[0].args[0] = expect[1].args[0] = 0xdead; expect[1].args[4] = (ULONG)STATUS_INVALID_HANDLE; - todo_wine expect_notifications( results, 2, expect ); WriteProcessMemory( GetCurrentProcess(), ptr, old_code, sizeof(old_code), NULL ); diff --git a/dlls/wow64/file.c b/dlls/wow64/file.c index 5f7ab9539d4..bdc9f4f2b2c 100644 --- a/dlls/wow64/file.c +++ b/dlls/wow64/file.c @@ -657,8 +657,10 @@ NTSTATUS WINAPI wow64_NtReadFile( UINT *args ) IO_STATUS_BLOCK io; NTSTATUS status; + if (pBTCpuNotifyReadFile) pBTCpuNotifyReadFile( handle, buffer, len, FALSE, 0 ); status = NtReadFile( handle, event, apc_32to64( apc ), apc_param_32to64( apc, apc_param ), iosb_32to64( &io, io32 ), buffer, len, offset, key ); + if (pBTCpuNotifyReadFile) pBTCpuNotifyReadFile( handle, buffer, len, TRUE, status ); put_iosb( io32, &io ); return status; } diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index b4e8cf2a3e0..c436a2e1ea3 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -111,6 +111,7 @@ void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, BOOL, void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ) = NULL; void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; +void (WINAPI *pBTCpuNotifyReadFile)( HANDLE, void *, SIZE_T, BOOL, NTSTATUS ) = NULL; void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ) = NULL; NTSTATUS (WINAPI *pBTCpuResetToConsistentState)( EXCEPTION_POINTERS * ) = NULL; void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) = NULL; @@ -810,6 +811,7 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex GET_PTR( BTCpuNotifyMemoryDirty ); GET_PTR( BTCpuNotifyMemoryFree ); GET_PTR( BTCpuNotifyMemoryProtect ); + GET_PTR( BTCpuNotifyReadFile ); GET_PTR( BTCpuNotifyUnmapViewOfSection ); GET_PTR( BTCpuUpdateProcessorInformation ); GET_PTR( BTCpuThreadTerm ); diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index b55e847c04c..d6a8c740ba4 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -46,6 +46,7 @@ extern void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, extern void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ); extern void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); extern void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); +extern void (WINAPI *pBTCpuNotifyReadFile)( HANDLE, void *, SIZE_T, BOOL, NTSTATUS ); extern void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ); extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ); extern void (WINAPI *pBTCpuThreadTerm)( HANDLE );
1
0
0
0
Alexandre Julliard : ntdll: Always set the dll name pointer in the 32-bit TEB.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: ab6c14942ffd347b53a251e2cb73f40acc2d1e43 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ab6c14942ffd347b53a251e2cb73f4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 8 11:59:55 2024 +0200 ntdll: Always set the dll name pointer in the 32-bit TEB. --- dlls/ntdll/loader.c | 19 ++++--------------- dlls/ntdll/unix/virtual.c | 7 +++++++ dlls/wow64/virtual.c | 6 ++++++ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 5c59d102dd9..e7b724471e7 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3248,7 +3248,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl HANDLE mapping = 0; SECTION_IMAGE_INFORMATION image_info; NTSTATUS nts = STATUS_DLL_NOT_FOUND; - ULONG64 prev; + void *prev; TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) ); @@ -3274,16 +3274,8 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl if (nts && nts != STATUS_INVALID_IMAGE_NOT_MZ) goto done; - if (NtCurrentTeb64()) - { - prev = NtCurrentTeb64()->Tib.ArbitraryUserPointer; - NtCurrentTeb64()->Tib.ArbitraryUserPointer = (ULONG_PTR)(nt_name.Buffer + 4); - } - else - { - prev = (ULONG_PTR)NtCurrentTeb()->Tib.ArbitraryUserPointer; - NtCurrentTeb()->Tib.ArbitraryUserPointer = nt_name.Buffer + 4; - } + prev = NtCurrentTeb()->Tib.ArbitraryUserPointer; + NtCurrentTeb()->Tib.ArbitraryUserPointer = nt_name.Buffer + 4; switch (nts) { @@ -3296,10 +3288,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl break; } - if (NtCurrentTeb64()) - NtCurrentTeb64()->Tib.ArbitraryUserPointer = prev; - else - NtCurrentTeb()->Tib.ArbitraryUserPointer = (void *)(ULONG_PTR)prev; + NtCurrentTeb()->Tib.ArbitraryUserPointer = prev; done: if (nts == STATUS_SUCCESS) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index dce03c2c3b5..0d88315164a 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -3163,7 +3163,13 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P if (image_info) { SECTION_IMAGE_INFORMATION info; + ULONG64 prev = 0; + if (NtCurrentTeb64()) + { + prev = NtCurrentTeb64()->Tib.ArbitraryUserPointer; + NtCurrentTeb64()->Tib.ArbitraryUserPointer = PtrToUlong(NtCurrentTeb()->Tib.ArbitraryUserPointer); + } filename = (WCHAR *)(image_info + 1); /* check if we can replace that mapping with the builtin */ res = load_builtin( image_info, filename, machine, &info, @@ -3173,6 +3179,7 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P alloc_type, machine, image_info, filename, FALSE ); if (shared_file) NtClose( shared_file ); free( image_info ); + if (NtCurrentTeb64()) NtCurrentTeb64()->Tib.ArbitraryUserPointer = prev; return res; } diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index 7df14c9b23b..e9972168f3e 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -426,7 +426,9 @@ NTSTATUS WINAPI wow64_NtMapViewOfSection( UINT *args ) void *addr; SIZE_T size; NTSTATUS status; + void *prev = NtCurrentTeb()->Tib.ArbitraryUserPointer; + NtCurrentTeb()->Tib.ArbitraryUserPointer = ULongToPtr( NtCurrentTeb32()->Tib.ArbitraryUserPointer ); status = NtMapViewOfSection( handle, process, addr_32to64( &addr, addr32 ), get_zero_bits( zero_bits ), commit, offset, size_32to64( &size, size32 ), inherit, alloc, protect ); if (NT_SUCCESS(status)) @@ -443,6 +445,7 @@ NTSTATUS WINAPI wow64_NtMapViewOfSection( UINT *args ) put_addr( addr32, addr ); put_size( size32, size ); } + NtCurrentTeb()->Tib.ArbitraryUserPointer = prev; return status; } @@ -467,9 +470,11 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) MEM_EXTENDED_PARAMETER *params64; BOOL is_current = RtlIsCurrentProcess( process ); BOOL set_limit = (!*addr32 && is_current); + void *prev = NtCurrentTeb()->Tib.ArbitraryUserPointer; if ((status = mem_extended_parameters_32to64( ¶ms64, params32, &count, set_limit ))) return status; + NtCurrentTeb()->Tib.ArbitraryUserPointer = ULongToPtr( NtCurrentTeb32()->Tib.ArbitraryUserPointer ); status = NtMapViewOfSectionEx( handle, process, addr_32to64( &addr, addr32 ), offset, size_32to64( &size, size32 ), alloc, protect, params64, count ); if (NT_SUCCESS(status)) @@ -486,6 +491,7 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) put_addr( addr32, addr ); put_size( size32, size ); } + NtCurrentTeb()->Tib.ArbitraryUserPointer = prev; return status; }
1
0
0
0
Alexandre Julliard : wow64: Fix NtMapViewOfSection CPU backend notifications.
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: bffba4acb55b043f5af8e2f8bc14d4313cf94bd1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bffba4acb55b043f5af8e2f8bc14d4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 8 12:34:04 2024 +0200 wow64: Fix NtMapViewOfSection CPU backend notifications. --- dlls/ntdll/tests/wow64.c | 8 ++------ dlls/wow64/syscall.c | 20 ++++++++++---------- dlls/wow64/virtual.c | 38 ++++++++++++++++++++------------------ dlls/wow64/wow64_private.h | 20 ++++++++++---------- 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index 594a46d4d65..fcd10df92a0 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -1748,7 +1748,6 @@ static void test_notifications( HMODULE module, CROSS_PROCESS_WORK_LIST *list ) status = NtMapViewOfSection( mapping, GetCurrentProcess(), &addr, 0, 0, &offset, &size, ViewShare, 0, PAGE_READONLY ); ok( NT_SUCCESS(status), "NtMapViewOfSection failed %lx\n", status ); - todo_wine expect_notifications( results, 0, NULL ); NtUnmapViewOfSection( GetCurrentProcess(), addr ); @@ -1764,20 +1763,17 @@ static void test_notifications( HMODULE module, CROSS_PROCESS_WORK_LIST *list ) expect.args[1] = (ULONG_PTR)addr; expect.args[3] = size; expect.args[5] = PAGE_READONLY; - todo_wine expect_notifications( results, 1, &expect ); NtUnmapViewOfSection( GetCurrentProcess(), addr ); results[1] = 0xdeadbeef; status = NtMapViewOfSection( mapping, GetCurrentProcess(), &addr, 0, 0, &offset, &size, ViewShare, 0, PAGE_READONLY ); - todo_wine ok( status == 0xdeadbeef, "NtMapViewOfSection failed %lx\n", status ); expect.args[0] = results[2]; /* FIXME: first parameter unknown */ expect.args[1] = (ULONG_PTR)addr; expect.args[3] = size; expect.args[5] = PAGE_READONLY; - todo_wine expect_notifications( results, 1, &expect ); NtCurrentTeb()->Tib.ArbitraryUserPointer = NULL; @@ -1800,8 +1796,8 @@ static void test_notifications( HMODULE module, CROSS_PROCESS_WORK_LIST *list ) expect[1].args[1] = 1; expect_notifications( results, 2, expect ); - NtUnmapViewOfSection( GetCurrentProcess(), (char *)0x12345 ); - expect[0].args[0] = expect[1].args[0] = 0x12345; + NtUnmapViewOfSection( GetCurrentProcess(), (char *)0x1234 ); + expect[0].args[0] = expect[1].args[0] = 0x1234; expect[1].args[1] = 1; expect[1].args[2] = (ULONG)STATUS_NOT_MAPPED_VIEW; expect_notifications( results, 2, expect ); diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index dba95db8588..b4e8cf2a3e0 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -104,17 +104,17 @@ static void (WINAPI *pBTCpuThreadInit)(void); static void (WINAPI *pBTCpuSimulate)(void) __attribute__((used)); static void * (WINAPI *p__wine_get_unix_opcode)(void); static void * (WINAPI *pKiRaiseUserExceptionDispatcher)(void); -void (WINAPI *pBTCpuFlushInstructionCache2)( const void *, SIZE_T ) = NULL; -void (WINAPI *pBTCpuFlushInstructionCacheHeavy)( const void *, SIZE_T ) = NULL; -void (WINAPI *pBTCpuNotifyMapViewOfSection)( void * ) = NULL; -void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, BOOL, NTSTATUS ) = NULL; -void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ) = NULL; -void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; -void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; -void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ) = NULL; +void (WINAPI *pBTCpuFlushInstructionCache2)( const void *, SIZE_T ) = NULL; +void (WINAPI *pBTCpuFlushInstructionCacheHeavy)( const void *, SIZE_T ) = NULL; +NTSTATUS (WINAPI *pBTCpuNotifyMapViewOfSection)( void *, void *, void *, SIZE_T, ULONG, ULONG ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, BOOL, NTSTATUS ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; +void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ) = NULL; +void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ) = NULL; NTSTATUS (WINAPI *pBTCpuResetToConsistentState)( EXCEPTION_POINTERS * ) = NULL; -void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) = NULL; -void (WINAPI *pBTCpuThreadTerm)( HANDLE ) = NULL; +void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ) = NULL; +void (WINAPI *pBTCpuThreadTerm)( HANDLE ) = NULL; BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) { diff --git a/dlls/wow64/virtual.c b/dlls/wow64/virtual.c index e9972168f3e..ca362438340 100644 --- a/dlls/wow64/virtual.c +++ b/dlls/wow64/virtual.c @@ -407,6 +407,23 @@ NTSTATUS WINAPI wow64_NtLockVirtualMemory( UINT *args ) } +static void notify_map_view_of_section( HANDLE handle, void *addr, SIZE_T size, ULONG alloc, + ULONG protect, NTSTATUS *ret_status ) +{ + SECTION_IMAGE_INFORMATION info; + NTSTATUS status; + + if (!NtCurrentTeb()->Tib.ArbitraryUserPointer) return; + if (NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL )) return; + if (info.Machine != current_machine) return; + init_image_mapping( addr ); + if (!pBTCpuNotifyMapViewOfSection) return; + status = pBTCpuNotifyMapViewOfSection( NULL, addr, NULL, size, alloc, protect ); + if (NT_SUCCESS(status)) return; + NtUnmapViewOfSection( GetCurrentProcess(), addr ); + *ret_status = status; +} + /********************************************************************** * wow64_NtMapViewOfSection */ @@ -433,17 +450,10 @@ NTSTATUS WINAPI wow64_NtMapViewOfSection( UINT *args ) commit, offset, size_32to64( &size, size32 ), inherit, alloc, protect ); if (NT_SUCCESS(status)) { - SECTION_IMAGE_INFORMATION info; - - if (RtlIsCurrentProcess( process ) && - !NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL ) && - info.Machine == current_machine) - { - if (pBTCpuNotifyMapViewOfSection) pBTCpuNotifyMapViewOfSection( addr ); - init_image_mapping( addr ); - } put_addr( addr32, addr ); put_size( size32, size ); + if (RtlIsCurrentProcess( process )) + notify_map_view_of_section( handle, addr, size, alloc, protect, &status ); } NtCurrentTeb()->Tib.ArbitraryUserPointer = prev; return status; @@ -479,17 +489,9 @@ NTSTATUS WINAPI wow64_NtMapViewOfSectionEx( UINT *args ) size_32to64( &size, size32 ), alloc, protect, params64, count ); if (NT_SUCCESS(status)) { - SECTION_IMAGE_INFORMATION info; - - if (is_current && - !NtQuerySection( handle, SectionImageInformation, &info, sizeof(info), NULL ) && - info.Machine == current_machine) - { - if (pBTCpuNotifyMapViewOfSection) pBTCpuNotifyMapViewOfSection( addr ); - init_image_mapping( addr ); - } put_addr( addr32, addr ); put_size( size32, size ); + if (is_current) notify_map_view_of_section( handle, addr, size, alloc, protect, &status ); } NtCurrentTeb()->Tib.ArbitraryUserPointer = prev; return status; diff --git a/dlls/wow64/wow64_private.h b/dlls/wow64/wow64_private.h index 80604b0ad17..b55e847c04c 100644 --- a/dlls/wow64/wow64_private.h +++ b/dlls/wow64/wow64_private.h @@ -39,16 +39,16 @@ extern ULONG_PTR highest_user_address; extern ULONG_PTR default_zero_bits; extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock; -extern void (WINAPI *pBTCpuFlushInstructionCache2)( const void *, SIZE_T ); -extern void (WINAPI *pBTCpuFlushInstructionCacheHeavy)( const void *, SIZE_T ); -extern void (WINAPI *pBTCpuNotifyMapViewOfSection)( void * ); -extern void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, BOOL, NTSTATUS ); -extern void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ); -extern void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); -extern void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); -extern void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ); -extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ); -extern void (WINAPI *pBTCpuThreadTerm)( HANDLE ); +extern void (WINAPI *pBTCpuFlushInstructionCache2)( const void *, SIZE_T ); +extern void (WINAPI *pBTCpuFlushInstructionCacheHeavy)( const void *, SIZE_T ); +extern NTSTATUS (WINAPI *pBTCpuNotifyMapViewOfSection)( void *, void *, void *, SIZE_T, ULONG, ULONG ); +extern void (WINAPI *pBTCpuNotifyMemoryAlloc)( void *, SIZE_T, ULONG, ULONG, BOOL, NTSTATUS ); +extern void (WINAPI *pBTCpuNotifyMemoryDirty)( void *, SIZE_T ); +extern void (WINAPI *pBTCpuNotifyMemoryFree)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); +extern void (WINAPI *pBTCpuNotifyMemoryProtect)( void *, SIZE_T, ULONG, BOOL, NTSTATUS ); +extern void (WINAPI *pBTCpuNotifyUnmapViewOfSection)( void *, BOOL, NTSTATUS ); +extern void (WINAPI *pBTCpuUpdateProcessorInformation)( SYSTEM_CPU_INFORMATION * ); +extern void (WINAPI *pBTCpuThreadTerm)( HANDLE ); struct object_attr64 {
1
0
0
0
Paul Gofman : win32u: Use FT_LOAD_PEDANTIC on first load try in freetype_get_glyph_outline().
by Alexandre Julliard
08 Jul '24
08 Jul '24
Module: wine Branch: master Commit: aa1df5a5746e6b21fba948332de1c7d69e156ec0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/aa1df5a5746e6b21fba948332de1c7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri May 10 13:09:21 2024 -0600 win32u: Use FT_LOAD_PEDANTIC on first load try in freetype_get_glyph_outline(). --- dlls/win32u/freetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 3e640115ab7..9016f670bba 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -3469,7 +3469,7 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT if (matrices || format != GGO_BITMAP) load_flags |= FT_LOAD_NO_BITMAP; if (vertical_metrics) load_flags |= FT_LOAD_VERTICAL_LAYOUT; - err = pFT_Load_Glyph(ft_face, glyph, load_flags); + err = pFT_Load_Glyph(ft_face, glyph, load_flags & FT_LOAD_NO_HINTING ? load_flags : load_flags | FT_LOAD_PEDANTIC); if (err && !(load_flags & FT_LOAD_NO_HINTING)) { WARN("Failed to load glyph %#x, retrying without hinting. Error %#x.\n", glyph, err);
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
52
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
Results per page:
10
25
50
100
200