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
Hans Leidekker : webservices: Accept empty namespace in attribute type mapping.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 6d5eef9c94b36f5bdfcbdef4c3fb705f9ebb780e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d5eef9c94b36f5bdfcbdef4…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Mar 27 15:47:39 2020 +0100 webservices: Accept empty namespace in attribute type mapping. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/reader.c | 21 ++++++++++++++++++--- dlls/webservices/tests/reader.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index 119043f705..4d37a38a8a 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -4343,9 +4343,24 @@ static HRESULT get_text( struct reader *reader, WS_TYPE_MAPPING mapping, const W { case WS_ATTRIBUTE_TYPE_MAPPING: { - ULONG index; - if (!(*found = find_attribute( reader, localname, ns, &index ))) return S_OK; - return get_attribute_text( reader, index, ret ); + ULONG i; + WS_XML_ELEMENT_NODE *elem = &reader->current->hdr; + + *found = FALSE; + for (i = 0; i < elem->attributeCount; i++) + { + const WS_XML_STRING *localname2 = elem->attributes[i]->localName; + const WS_XML_STRING *ns2 = elem->attributes[i]->ns; + + if (cmp_name( localname->bytes, localname->length, localname2->bytes, localname2->length )) continue; + if (!ns->length || !cmp_name( ns->bytes, ns->length, ns2->bytes, ns2->length )) + { + *found = TRUE; + break; + } + } + if (!*found) return S_OK; + return get_attribute_text( reader, i, ret ); } case WS_ELEMENT_TYPE_MAPPING: case WS_ELEMENT_CONTENT_TYPE_MAPPING: diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c index ef6fd8808e..733ebe3eb1 100644 --- a/dlls/webservices/tests/reader.c +++ b/dlls/webservices/tests/reader.c @@ -2556,7 +2556,8 @@ static void test_cdata(void) static void test_WsFindAttribute(void) { static const char test[] = "<t attr='value' attr2='value2'></t>"; - WS_XML_STRING ns = {0, NULL}, localname = {4, (BYTE *)"attr"}; + static const char test2[] = "<p:t attr='value' p:attr2='value2' xmlns:p=\"ns\"></t>"; + WS_XML_STRING ns = {0, NULL}, ns2 = {2, (BYTE *)"ns"}, localname = {4, (BYTE *)"attr"}; WS_XML_STRING localname2 = {5, (BYTE *)"attr2"}, localname3 = {5, (BYTE *)"attr3"}; WS_XML_READER *reader; ULONG index; @@ -2638,6 +2639,32 @@ static void test_WsFindAttribute(void) ok( hr == S_FALSE, "got %08x\n", hr ); ok( index == ~0u, "got %u\n", index ); + hr = set_input( reader, test2, sizeof(test2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + index = 0xdeadbeef; + hr = WsFindAttribute( reader, &localname, &ns, TRUE, &index, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !index, "got %u\n", index ); + + hr = WsFindAttribute( reader, &localname2, &ns2, TRUE, &index, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFindAttribute( reader, &localname2, &ns, TRUE, &index, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + hr = set_input( reader, test2, sizeof(test2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFindAttribute( reader, &localname, &ns2, TRUE, &index, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + WsFreeReader( reader ); }
1
0
0
0
Hans Leidekker : webservices: Read past XML declaration and opening bracket in WsReadStartElement.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 9d530346cc47b9d0600d26ff2fcfb2a97edcd84b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d530346cc47b9d0600d26ff…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Mar 27 15:47:38 2020 +0100 webservices: Read past XML declaration and opening bracket in WsReadStartElement. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/reader.c | 13 +++++++++-- dlls/webservices/tests/reader.c | 48 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index f1ce93b7d7..119043f705 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -2654,7 +2654,17 @@ static HRESULT read_node_text( struct reader * ); static HRESULT read_startelement_text( struct reader *reader ) { + HRESULT hr; + + if (read_cmp( reader, "<?", 2 ) == S_OK) + { + if ((hr = read_xmldecl( reader )) != S_OK) return hr; + } read_skip_whitespace( reader ); + if (read_cmp( reader, "<", 1 ) == S_OK) + { + if ((hr = read_element_text( reader )) != S_OK) return hr; + } if (read_cmp( reader, "/>", 2 ) == S_OK) { read_skip( reader, 2 ); @@ -3021,8 +3031,7 @@ static HRESULT read_node_text( struct reader *reader ) else if (reader->state == READER_STATE_CDATA) return read_endcdata( reader ); else if (read_cmp( reader, "<?", 2 ) == S_OK) { - hr = read_xmldecl( reader ); - if (FAILED( hr )) return hr; + if ((hr = read_xmldecl( reader )) != S_OK) return hr; } else if (read_cmp( reader, "</", 2 ) == S_OK) return read_endelement_text( reader ); else if (read_cmp( reader, "<![CDATA[", 9 ) == S_OK) return read_startcdata( reader ); diff --git a/dlls/webservices/tests/reader.c b/dlls/webservices/tests/reader.c index 5fb81b5dc8..ef6fd8808e 100644 --- a/dlls/webservices/tests/reader.c +++ b/dlls/webservices/tests/reader.c @@ -31,7 +31,7 @@ static const char data2[] = {0xef,0xbb,0xbf,'<','t','e','x','t','>','t','e','s','t','<','/','t','e','x','t','>',0}; static const char data3[] = - "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<?xml version=\"1.0\" encoding=\"utf-8\"?> " "<text>test</TEXT>"; static const char data4[] = @@ -928,6 +928,52 @@ static void test_WsReadStartElement(void) hr = WsReadEndElement( reader, NULL ); ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + hr = set_input( reader, data3, sizeof(data3) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadStartElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node; + ok( text->node.nodeType == WS_XML_NODE_TYPE_TEXT, "got %u\n", text->node.nodeType ); + ok( text->text != NULL, "text not set\n" ); + if (text->text) + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + ok( text->text->textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", text->text->textType ); + ok( utf8->value.length == 4, "got %u\n", utf8->value.length ); + ok( !memcmp( utf8->value.bytes, "test", 4 ), "wrong data\n" ); + } + } + + hr = set_input( reader, " <text>test</text>", sizeof(" <text>test</text>") - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadStartElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node; + ok( text->node.nodeType == WS_XML_NODE_TYPE_TEXT, "got %u\n", text->node.nodeType ); + ok( text->text != NULL, "text not set\n" ); + if (text->text) + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + ok( text->text->textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", text->text->textType ); + ok( utf8->value.length == 4, "got %u\n", utf8->value.length ); + ok( !memcmp( utf8->value.bytes, "test", 4 ), "wrong data\n" ); + } + } + WsFreeReader( reader ); }
1
0
0
0
Nikolay Sivov : mf: Fix returned session rates when pipeline objects don't support rate control.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 3e12d29c87ec8411bd8865d8843d96237c006db0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3e12d29c87ec8411bd8865d8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 27 17:17:33 2020 +0300 mf: Fix returned session rates when pipeline objects don't support rate control. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/session.c | 58 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 2147f70cc8..debb58de4d 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2805,28 +2805,41 @@ static ULONG WINAPI session_rate_support_Release(IMFRateSupport *iface) return IMFMediaSession_Release(&session->IMFMediaSession_iface); } -static void session_presentation_object_get_rate(IUnknown *object, MFRATE_DIRECTION direction, +static HRESULT session_presentation_object_get_rate(IUnknown *object, MFRATE_DIRECTION direction, BOOL thin, BOOL fastest, float *result) { IMFRateSupport *rate_support; float rate; + HRESULT hr; - if (SUCCEEDED(MFGetService(object, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateSupport, (void **)&rate_support))) + /* For objects that don't support rate control, it's assumed that only forward direction is allowed, at 1.0f. */ + + if (FAILED(hr = MFGetService(object, &MF_RATE_CONTROL_SERVICE, &IID_IMFRateSupport, (void **)&rate_support))) { - rate = 0.0f; - if (fastest) + if (direction == MFRATE_FORWARD) { - if (SUCCEEDED(IMFRateSupport_GetFastestRate(rate_support, direction, thin, &rate))) - *result = min(fabsf(rate), *result); + *result = 1.0f; + return S_OK; } else - { - if (SUCCEEDED(IMFRateSupport_GetSlowestRate(rate_support, direction, thin, &rate))) - *result = max(fabsf(rate), *result); - } + return MF_E_REVERSE_UNSUPPORTED; + } - IMFRateSupport_Release(rate_support); + rate = 0.0f; + if (fastest) + { + if (SUCCEEDED(hr = IMFRateSupport_GetFastestRate(rate_support, direction, thin, &rate))) + *result = min(fabsf(rate), *result); + } + else + { + if (SUCCEEDED(hr = IMFRateSupport_GetSlowestRate(rate_support, direction, thin, &rate))) + *result = max(fabsf(rate), *result); } + + IMFRateSupport_Release(rate_support); + + return hr; } static HRESULT session_get_presentation_rate(struct media_session *session, MFRATE_DIRECTION direction, @@ -2834,24 +2847,33 @@ static HRESULT session_get_presentation_rate(struct media_session *session, MFRA { struct media_source *source; struct media_sink *sink; + HRESULT hr = E_POINTER; *result = 0.0f; EnterCriticalSection(&session->cs); - LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) + if (session->presentation.topo_status != MF_TOPOSTATUS_INVALID) { - session_presentation_object_get_rate((IUnknown *)source->source, direction, thin, fastest, result); - } + LIST_FOR_EACH_ENTRY(source, &session->presentation.sources, struct media_source, entry) + { + if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)source->source, direction, thin, fastest, result))) + break; + } - LIST_FOR_EACH_ENTRY(sink, &session->presentation.sinks, struct media_sink, entry) - { - session_presentation_object_get_rate((IUnknown *)sink->sink, direction, thin, fastest, result); + if (SUCCEEDED(hr)) + { + LIST_FOR_EACH_ENTRY(sink, &session->presentation.sinks, struct media_sink, entry) + { + if (FAILED(hr = session_presentation_object_get_rate((IUnknown *)sink->sink, direction, thin, fastest, result))) + break; + } + } } LeaveCriticalSection(&session->cs); - return S_OK; + return hr; } static HRESULT WINAPI session_rate_support_GetSlowestRate(IMFRateSupport *iface, MFRATE_DIRECTION direction,
1
0
0
0
Nikolay Sivov : mfplat: Add remaining media type attributes guids.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 5ef6ecb3aae43a1df793dde974f1d236a59855ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5ef6ecb3aae43a1df793dde9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 27 17:16:14 2020 +0300 mfplat: Add remaining media type attributes guids. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 36 +++++++++++++++++++++++++++++++++++- include/mfapi.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5ef6ecb3aae43a1df793…
1
0
0
0
Alexandre Julliard : ntdll: Use wcslwr() instead of tolowerW().
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 59d0ad23c7cf7fcb5696e3893cbf7ab1746b0320 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=59d0ad23c7cf7fcb5696e389…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:44:03 2020 +0100 ntdll: Use wcslwr() instead of tolowerW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/directory.c | 10 ++++++---- dlls/ntdll/ntdll_misc.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index b8a23c4d4d..993a661015 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2344,7 +2344,7 @@ static NTSTATUS get_dos_device( const WCHAR *name, UINT name_len, ANSI_STRING *u strcat( unix_name, "/dosdevices/" ); dev = unix_name + strlen(unix_name); - for (i = 0; i < name_len; i++) dev[i] = (char)tolowerW(name[i]); + for (i = 0; i < name_len; i++) dev[i] = (name[i] >= 'A' && name[i] <= 'Z' ? name[i] + 32 : name[i]); dev[i] = 0; /* special case for drive devices */ @@ -2755,7 +2755,7 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI struct stat st; char *unix_name; int pos, ret, name_len, unix_len, prefix_len; - WCHAR prefix[MAX_DIR_ENTRY_LEN]; + WCHAR prefix[MAX_DIR_ENTRY_LEN + 1]; BOOLEAN is_unix = FALSE; name = nameW->Buffer; @@ -2784,8 +2784,10 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI if (pos == name_len) /* no subdir, plain DOS device */ return get_dos_device( name, name_len, unix_name_ret ); - for (prefix_len = 0; prefix_len < pos; prefix_len++) - prefix[prefix_len] = tolowerW(name[prefix_len]); + prefix_len = pos; + memcpy( prefix, name, prefix_len * sizeof(WCHAR) ); + prefix[prefix_len] = 0; + wcslwr( prefix ); name += prefix_len; name_len -= prefix_len; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 84493bc493..20feabf56b 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -298,6 +298,7 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base ); #define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2) #define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n) +#define wcslwr(s) NTDLL__wcslwr(s) #define wcsupr(s) NTDLL__wcsupr(s) /* convert from straight ASCII to Unicode without depending on the current codepage */
1
0
0
0
Alexandre Julliard : ntdll: Use wcsupr() instead of toupperW().
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: f599b2cf255353a7a406df8137b392117e0f6fe9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f599b2cf255353a7a406df81…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:43:20 2020 +0100 ntdll: Use wcsupr() instead of toupperW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/directory.c | 13 ++++++------- dlls/ntdll/ntdll_misc.h | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 53da0b0fc8..b8a23c4d4d 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1296,9 +1296,8 @@ BOOL DIR_is_hidden_file( const UNICODE_STRING *name ) /*********************************************************************** * hash_short_file_name * - * Transform a Unix file name into a hashed DOS name. If the name is a valid - * DOS name, it is converted to upper-case; otherwise it is replaced by a - * hashed version that fits in 8.3 format. + * Transform a Unix file name into a hashed DOS name. If the name is not a valid + * DOS name, it is replaced by a hashed version that fits in 8.3 format. * 'buffer' must be at least 12 characters long. * Returns length of short name in bytes; short name is NOT null-terminated. */ @@ -1334,7 +1333,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer ) for (i = 4, p = name->Buffer, dst = buffer; i > 0; i--, p++) { if (p == end || p == ext) break; - *dst++ = is_invalid_dos_char(*p) ? '_' : toupperW(*p); + *dst++ = is_invalid_dos_char(*p) ? '_' : *p; } /* Pad to 5 chars with '~' */ while (i-- >= 0) *dst++ = '~'; @@ -1349,7 +1348,7 @@ static ULONG hash_short_file_name( const UNICODE_STRING *name, LPWSTR buffer ) { *dst++ = '.'; for (i = 3, ext++; (i > 0) && ext < end; i--, ext++) - *dst++ = is_invalid_dos_char(*ext) ? '_' : toupperW(*ext); + *dst++ = is_invalid_dos_char(*ext) ? '_' : *ext; } return dst - buffer; } @@ -1446,7 +1445,7 @@ static BOOLEAN match_filename( const UNICODE_STRING *name_str, const UNICODE_STR static BOOL append_entry( struct dir_data *data, const char *long_name, const char *short_name, const UNICODE_STRING *mask ) { - int i, long_len, short_len; + int long_len, short_len; WCHAR long_nameW[MAX_DIR_ENTRY_LEN + 1]; WCHAR short_nameW[13]; UNICODE_STRING str; @@ -1463,7 +1462,6 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, { short_len = ntdll_umbstowcs( short_name, strlen(short_name), short_nameW, ARRAY_SIZE( short_nameW ) - 1 ); - for (i = 0; i < short_len; i++) short_nameW[i] = toupperW( short_nameW[i] ); } else /* generate a short name if necessary */ { @@ -1474,6 +1472,7 @@ static BOOL append_entry( struct dir_data *data, const char *long_name, short_len = hash_short_file_name( &str, short_nameW ); } short_nameW[short_len] = 0; + wcsupr( short_nameW ); TRACE( "long %s short %s mask %s\n", debugstr_w( long_nameW ), debugstr_w( short_nameW ), debugstr_us( mask )); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 953b29dfe5..84493bc493 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -298,6 +298,7 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base ); #define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2) #define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n) +#define wcsupr(s) NTDLL__wcsupr(s) /* convert from straight ASCII to Unicode without depending on the current codepage */ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
1
0
0
0
Alexandre Julliard : ntdll: Use the ascii_to_unicode() helper to compare relay module names.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 0d3ba59e138f97a52641093c0060e75b92efedb9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0d3ba59e138f97a52641093c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:40:37 2020 +0100 ntdll: Use the ascii_to_unicode() helper to compare relay module names. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 6 ------ dlls/ntdll/ntdll_misc.h | 6 ++++++ dlls/ntdll/relay.c | 28 +++++++++++++--------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index fbbd29a595..8f607409f5 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -185,12 +185,6 @@ static inline BOOL contains_path( LPCWSTR name ) return ((*name && (name[1] == ':')) || strchrW(name, '/') || strchrW(name, '\\')); } -/* convert from straight ASCII to Unicode without depending on the current codepage */ -static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) -{ - while (len--) *dst++ = (unsigned char)*src++; -} - #define RTL_UNLOAD_EVENT_TRACE_NUMBER 64 typedef struct _RTL_UNLOAD_EVENT_TRACE diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 45ca35442f..953b29dfe5 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -299,4 +299,10 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base ); #define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2) #define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n) +/* convert from straight ASCII to Unicode without depending on the current codepage */ +static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) +{ + while (len--) *dst++ = (unsigned char)*src++; +} + #endif diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index 9ebb973e9a..b4ea0a4dba 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -93,15 +93,6 @@ static inline int strcmpAW( const char *strA, const WCHAR *strW ) return (unsigned char)*strA - *strW; } -/* compare an ASCII and a Unicode string without depending on the current codepage */ -static inline int strncmpiAW( const char *strA, const WCHAR *strW, int n ) -{ - int ret = 0; - for ( ; n > 0; n--, strA++, strW++) - if ((ret = toupperW((unsigned char)*strA) - toupperW(*strW)) || !*strA) break; - return ret; -} - /*********************************************************************** * build_list * @@ -225,7 +216,7 @@ static DWORD WINAPI init_debug_lists( RTL_RUN_ONCE *once, void *param, void **co * * Check if a given module and function is in the list. */ -static BOOL check_list( const char *module, int ordinal, const char *func, const WCHAR *const *list ) +static BOOL check_list( const WCHAR *module, int ordinal, const char *func, const WCHAR *const *list ) { char ord_str[10]; @@ -236,7 +227,7 @@ static BOOL check_list( const char *module, int ordinal, const char *func, const if (p && p > *list) /* check module and function */ { int len = p - *list; - if (strncmpiAW( module, *list, len-1 ) || module[len]) continue; + if (wcsnicmp( module, *list, len - 1 ) || module[len]) continue; if (p[1] == '*' && !p[2]) return TRUE; if (!strcmpAW( ord_str, p + 1 )) return TRUE; if (func && !strcmpAW( func, p + 1 )) return TRUE; @@ -255,7 +246,7 @@ static BOOL check_list( const char *module, int ordinal, const char *func, const * * Check if a given function must be included in the relay output. */ -static BOOL check_relay_include( const char *module, int ordinal, const char *func ) +static BOOL check_relay_include( const WCHAR *module, int ordinal, const char *func ) { if (debug_relay_excludelist && check_list( module, ordinal, func, debug_relay_excludelist )) return FALSE; @@ -898,6 +889,7 @@ void RELAY_SetupDLL( HMODULE module ) DWORD size, entry_point_rva, old_prot; struct relay_descr *descr; struct relay_private_data *data; + WCHAR dllnameW[sizeof(data->dllname)]; const WORD *ordptr; void *func_base; SIZE_T func_size; @@ -923,6 +915,7 @@ void RELAY_SetupDLL( HMODULE module ) len = min( len, sizeof(data->dllname) - 1 ); memcpy( data->dllname, (char *)module + exports->Name, len ); data->dllname[len] = 0; + ascii_to_unicode( dllnameW, data->dllname, len + 1 ); /* fetch name pointer for all entry points and store them in the private structure */ @@ -944,7 +937,7 @@ void RELAY_SetupDLL( HMODULE module ) for (i = 0; i < exports->NumberOfFunctions; i++, funcs++) { if (!descr->entry_point_offsets[i]) continue; /* not a normal function */ - if (!check_relay_include( data->dllname, i + exports->Base, data->entry_points[i].name )) + if (!check_relay_include( dllnameW, i + exports->Base, data->entry_points[i].name )) continue; /* don't include this entry point */ data->entry_points[i].orig_func = (char *)module + *funcs; @@ -1035,9 +1028,14 @@ static SNOOP_RETURNENTRIES *firstrets; */ static BOOL SNOOP_ShowDebugmsgSnoop(const char *module, int ordinal, const char *func) { - if (debug_snoop_excludelist && check_list( module, ordinal, func, debug_snoop_excludelist )) + WCHAR moduleW[40]; + int len = strlen(module); + + if (len >= ARRAY_SIZE( moduleW )) return FALSE; + ascii_to_unicode( moduleW, module, len + 1 ); + if (debug_snoop_excludelist && check_list( moduleW, ordinal, func, debug_snoop_excludelist )) return FALSE; - if (debug_snoop_includelist && !check_list( module, ordinal, func, debug_snoop_includelist )) + if (debug_snoop_includelist && !check_list( moduleW, ordinal, func, debug_snoop_includelist )) return FALSE; return TRUE; }
1
0
0
0
Alexandre Julliard : ntdll: Use RtlCompareUnicodeStrings() instead of strncmpiW().
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 2f7cc584ce09448e8f5434191210f0d217b2e437 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2f7cc584ce09448e8f543419…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:39:44 2020 +0100 ntdll: Use RtlCompareUnicodeStrings() instead of strncmpiW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/directory.c | 6 +++--- dlls/ntdll/env.c | 18 ++++++++++++------ dlls/ntdll/loader.c | 8 +++++--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index c3da7347d7..53da0b0fc8 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2102,7 +2102,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i { ret = ntdll_umbstowcs( kde[1].d_name, strlen(kde[1].d_name), buffer, MAX_DIR_ENTRY_LEN ); - if (ret == length && !strncmpiW( buffer, name, length)) + if (ret == length && !RtlCompareUnicodeStrings( buffer, ret, name, ret, TRUE )) { strcpy( unix_name + pos, kde[1].d_name ); RtlLeaveCriticalSection( &dir_section ); @@ -2112,7 +2112,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i } ret = ntdll_umbstowcs( kde[0].d_name, strlen(kde[0].d_name), buffer, MAX_DIR_ENTRY_LEN ); - if (ret == length && !strncmpiW( buffer, name, length)) + if (ret == length && !RtlCompareUnicodeStrings( buffer, ret, name, ret, TRUE )) { strcpy( unix_name + pos, kde[1].d_name[0] ? kde[1].d_name : kde[0].d_name ); @@ -2146,7 +2146,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i while ((de = readdir( dir ))) { ret = ntdll_umbstowcs( de->d_name, strlen(de->d_name), buffer, MAX_DIR_ENTRY_LEN ); - if (ret == length && !strncmpiW( buffer, name, length )) + if (ret == length && !RtlCompareUnicodeStrings( buffer, ret, name, ret, TRUE )) { strcpy( unix_name + pos, de->d_name ); closedir( dir ); diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index c8098e2d59..833da58f35 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -903,16 +903,20 @@ NTSTATUS WINAPI RtlDestroyEnvironment(PWSTR env) static LPCWSTR ENV_FindVariable(PCWSTR var, PCWSTR name, unsigned namelen) { - for (; *var; var += strlenW(var) + 1) + while (*var) { /* match var names, but avoid setting a var with a name including a '=' * (a starting '=' is valid though) */ - if (strncmpiW(var, name, namelen) == 0 && var[namelen] == '=' && - strchrW(var + 1, '=') == var + namelen) + unsigned int len = strlenW( var ); + if (len > namelen && + var[namelen] == '=' && + !RtlCompareUnicodeStrings( var, namelen, name, namelen, TRUE ) && + strchrW(var + 1, '=') == var + namelen) { return var + namelen + 1; } + var += len + 1; } return NULL; } @@ -987,7 +991,7 @@ void WINAPI RtlSetCurrentEnvironment(PWSTR new_env, PWSTR* old_env) NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, PUNICODE_STRING value) { - INT len, old_size; + INT varlen, len, old_size; LPWSTR p, env; NTSTATUS nts = STATUS_VARIABLE_NOT_FOUND; @@ -1011,9 +1015,11 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, old_size = get_env_length( env ); /* Find a place to insert the string */ - for (p = env; *p; p += strlenW(p) + 1) + for (p = env; *p; p += varlen + 1) { - if (!strncmpiW(name->Buffer, p, len) && (p[len] == '=')) break; + varlen = strlenW(p); + if (varlen > len && p[len] == '=' && + !RtlCompareUnicodeStrings( name->Buffer, len, p, len, TRUE )) break; } if (!value && !*p) goto done; /* Value to remove doesn't exist */ diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 735a7d21fc..fbbd29a595 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2768,10 +2768,12 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) if ((p = strrchrW( info->lpAssemblyManifestPath, '\\' ))) { - DWORD dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR); - + DWORD len, dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR); p++; - if (!dirlen || strncmpiW( p, info->lpAssemblyDirectoryName, dirlen ) || wcsicmp( p + dirlen, dotManifestW )) + len = strlenW( p ); + if (!dirlen || len <= dirlen || + RtlCompareUnicodeStrings( p, dirlen, info->lpAssemblyDirectoryName, dirlen, TRUE ) || + wcsicmp( p + dirlen, dotManifestW )) { /* manifest name does not match directory name, so it's not a global * windows/winsxs manifest; use the manifest directory name instead */
1
0
0
0
Alexandre Julliard : ntdll: Use RtlEqualUnicodeString() instead of strcmpiW().
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: 4d93bafe961ed53488ff0fb4b44cb1ad085531fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d93bafe961ed53488ff0fb4…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:39:20 2020 +0100 ntdll: Use RtlEqualUnicodeString() instead of strcmpiW(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/actctx.c | 18 ++++++++++-------- dlls/ntdll/loader.c | 7 +++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 9f2d6ffeb0..d5f376f224 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -1002,7 +1002,7 @@ static void free_entity_array(struct entity_array *array) static BOOL is_matching_string( const WCHAR *str1, const WCHAR *str2 ) { if (!str1) return !str2; - return str2 && !strcmpiW( str1, str2 ); + return str2 && !RtlCompareUnicodeStrings( str1, strlenW(str1), str2, strlenW(str2), TRUE ); } static BOOL is_matching_identity( const struct assembly_identity *id1, @@ -1012,7 +1012,7 @@ static BOOL is_matching_identity( const struct assembly_identity *id1, if (!is_matching_string( id1->arch, id2->arch )) return FALSE; if (!is_matching_string( id1->public_key, id2->public_key )) return FALSE; - if (id1->language && id2->language && strcmpiW( id1->language, id2->language )) + if (id1->language && id2->language && !is_matching_string( id1->language, id2->language )) { if (strcmpW( wildcardW, id1->language ) && strcmpW( wildcardW, id2->language )) return FALSE; @@ -3479,6 +3479,7 @@ static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT* actctx, struct str static struct string_index *find_string_index(const struct strsection_header *section, const UNICODE_STRING *name) { struct string_index *iter, *index = NULL; + UNICODE_STRING str; ULONG hash = 0, i; RtlHashUnicodeString(name, TRUE, HASH_STRING_ALGORITHM_X65599, &hash); @@ -3488,9 +3489,9 @@ static struct string_index *find_string_index(const struct strsection_header *se { if (iter->hash == hash) { - const WCHAR *nameW = (WCHAR*)((BYTE*)section + iter->name_offset); - - if (!strcmpiW(nameW, name->Buffer)) + str.Buffer = (WCHAR *)((BYTE *)section + iter->name_offset); + str.Length = iter->name_len; + if (RtlEqualUnicodeString( &str, name, TRUE )) { index = iter; break; @@ -3724,6 +3725,7 @@ static NTSTATUS find_window_class(ACTIVATION_CONTEXT* actctx, const UNICODE_STRI { struct string_index *iter, *index = NULL; struct wndclass_redirect_data *class; + UNICODE_STRING str; ULONG hash; int i; @@ -3748,9 +3750,9 @@ static NTSTATUS find_window_class(ACTIVATION_CONTEXT* actctx, const UNICODE_STRI { if (iter->hash == hash) { - const WCHAR *nameW = (WCHAR*)((BYTE*)actctx->wndclass_section + iter->name_offset); - - if (!strcmpiW(nameW, name->Buffer)) + str.Buffer = (WCHAR *)((BYTE *)actctx->wndclass_section + iter->name_offset); + str.Length = iter->name_len; + if (RtlEqualUnicodeString( &str, name, TRUE )) { index = iter; break; diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 7aef68e39e..735a7d21fc 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -491,15 +491,18 @@ static WINE_MODREF *get_modref( HMODULE hmod ) static WINE_MODREF *find_basename_module( LPCWSTR name ) { PLIST_ENTRY mark, entry; + UNICODE_STRING name_str; + + RtlInitUnicodeString( &name_str, name ); - if (cached_modref && !strcmpiW( name, cached_modref->ldr.BaseDllName.Buffer )) + if (cached_modref && RtlEqualUnicodeString( &name_str, &cached_modref->ldr.BaseDllName, TRUE )) return cached_modref; mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { LDR_MODULE *mod = CONTAINING_RECORD(entry, LDR_MODULE, InLoadOrderModuleList); - if (!strcmpiW( name, mod->BaseDllName.Buffer )) + if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE )) { cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); return cached_modref;
1
0
0
0
Alexandre Julliard : ntdll: Use wcsnicmp() instead of strncmpiW() where possible.
by Alexandre Julliard
27 Mar '20
27 Mar '20
Module: wine Branch: master Commit: f831b3bd3d6b013893be7645df3a9cd05289c415 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f831b3bd3d6b013893be7645…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 27 13:38:33 2020 +0100 ntdll: Use wcsnicmp() instead of strncmpiW() where possible. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/actctx.c | 12 ++++++------ dlls/ntdll/directory.c | 4 ++-- dlls/ntdll/env.c | 4 ++-- dlls/ntdll/loadorder.c | 2 +- dlls/ntdll/locale.c | 2 +- dlls/ntdll/ntdll_misc.h | 1 + dlls/ntdll/path.c | 12 ++++++------ dlls/ntdll/process.c | 4 ++-- dlls/ntdll/relay.c | 2 +- 9 files changed, 22 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 236adf6c00..9f2d6ffeb0 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -759,7 +759,7 @@ static inline BOOL xmlstr_cmp(const xmlstr_t* xmlstr, const WCHAR *str) static inline BOOL xmlstr_cmpi(const xmlstr_t* xmlstr, const WCHAR *str) { - return !strncmpiW(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len]; + return !wcsnicmp(xmlstr->ptr, str, xmlstr->len) && !str[xmlstr->len]; } static BOOL xml_attr_cmp( const struct xml_attr *attr, const WCHAR *str ) @@ -1843,13 +1843,13 @@ static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity) start = str; while (*str != ',' && (i++ < value->len)) str++; - if (!strncmpiW(start, restrictedW, str-start)) + if (!wcsnicmp(start, restrictedW, str-start)) *flags |= LIBFLAG_FRESTRICTED; - else if (!strncmpiW(start, controlW, str-start)) + else if (!wcsnicmp(start, controlW, str-start)) *flags |= LIBFLAG_FCONTROL; - else if (!strncmpiW(start, hiddenW, str-start)) + else if (!wcsnicmp(start, hiddenW, str-start)) *flags |= LIBFLAG_FHIDDEN; - else if (!strncmpiW(start, hasdiskimageW, str-start)) + else if (!wcsnicmp(start, hasdiskimageW, str-start)) *flags |= LIBFLAG_FHASDISKIMAGE; else { @@ -3146,7 +3146,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) tmp = strchrW(tmp, '_') + 1; tmp = strchrW(tmp, '_') + 1; if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) && - !strncmpiW( tmp, wine_trailerW, ARRAY_SIZE( wine_trailerW ))) + !wcsnicmp( tmp, wine_trailerW, ARRAY_SIZE( wine_trailerW ))) { /* prefer a non-Wine manifest if we already have one */ /* we'll still load the builtin dll if specified through DllOverrides */ diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 7b0627cd3d..c3da7347d7 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2160,7 +2160,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i { WCHAR short_nameW[12]; ret = hash_short_file_name( &str, short_nameW ); - if (ret == length && !strncmpiW( short_nameW, name, length )) + if (ret == length && !wcsnicmp( short_nameW, name, length )) { strcpy( unix_name + pos, de->d_name ); closedir( dir ); @@ -2409,7 +2409,7 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name ) return ARRAY_SIZE( nt_prefixW ); if (name->Length >= sizeof(dosdev_prefixW) && - !strncmpiW( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) + !wcsnicmp( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW ))) return ARRAY_SIZE( dosdev_prefixW ); return 0; diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 9005544f55..c8098e2d59 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -144,7 +144,7 @@ static void set_registry_variables( WCHAR **env, HANDLE hkey, ULONG type ) } /* PATH is magic */ if (env_name.Length == sizeof(pathW) && - !strncmpiW( env_name.Buffer, pathW, ARRAY_SIZE( pathW )) && + !wcsnicmp( env_name.Buffer, pathW, ARRAY_SIZE( pathW )) && !RtlQueryEnvironmentVariable_U( *env, &env_name, &tmp )) { RtlAppendUnicodeToString( &tmp, sep ); @@ -662,7 +662,7 @@ static inline BOOL is_path_prefix( const WCHAR *prefix, const WCHAR *path, const { DWORD len = strlenW( prefix ); - if (strncmpiW( path, prefix, len )) return FALSE; + if (wcsnicmp( path, prefix, len )) return FALSE; while (path[len] == '\\') len++; return path + len == file; } diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c index 2d82b12a7a..8469f487d3 100644 --- a/dlls/ntdll/loadorder.c +++ b/dlls/ntdll/loadorder.c @@ -447,7 +447,7 @@ enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_n /* Strip path information if the module resides in the system directory */ - if (!strncmpiW( system_dir, path, strlenW( system_dir ))) + if (!wcsnicmp( system_dir, path, strlenW( system_dir ))) { const WCHAR *p = path + strlenW( system_dir ); while (*p == '\\' || *p == '/') p++; diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index ea629e8393..123b8985b1 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -1719,7 +1719,7 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags p = buf; while (*p) { - if (!strncmpiW( p, script, len ) && (!p[len] || p[len] == ';')) break; + if (!wcsnicmp( p, script, len ) && (!p[len] || p[len] == ';')) break; if (!(p = strchrW( p, ';'))) break; p++; } diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index c22b32a5b7..45ca35442f 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -297,5 +297,6 @@ LONG __cdecl NTDLL_wcstol( LPCWSTR s, LPWSTR *end, INT base ); ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base ); #define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2) +#define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n) #endif diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index adbfb4f526..65539fa018 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -306,13 +306,13 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name ) switch(end - start + 1) { case 3: - if (strncmpiW( start, auxW, 3 ) && - strncmpiW( start, conW, 3 ) && - strncmpiW( start, nulW, 3 ) && - strncmpiW( start, prnW, 3 )) break; + if (wcsnicmp( start, auxW, 3 ) && + wcsnicmp( start, conW, 3 ) && + wcsnicmp( start, nulW, 3 ) && + wcsnicmp( start, prnW, 3 )) break; return MAKELONG( 3 * sizeof(WCHAR), (start - dos_name) * sizeof(WCHAR) ); case 4: - if (strncmpiW( start, comW, 3 ) && strncmpiW( start, lptW, 3 )) break; + if (wcsnicmp( start, comW, 3 ) && wcsnicmp( start, lptW, 3 )) break; if (*end <= '0' || *end > '9') break; return MAKELONG( 4 * sizeof(WCHAR), (start - dos_name) * sizeof(WCHAR) ); default: /* can't match anything */ @@ -1045,7 +1045,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) if (size && ptr[size - 1] != '\\') ptr[size++] = '\\'; /* convert \??\UNC\ path to \\ prefix */ - if (size >= 4 && !strncmpiW(ptr, UncPfxW, 4)) + if (size >= 4 && !wcsnicmp(ptr, UncPfxW, 4)) { ptr += 2; size -= 2; diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 2290d5d186..0f24837884 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -1244,13 +1244,13 @@ static BOOL is_builtin_path( UNICODE_STRING *path, BOOL *is_64bit ) 's','y','s','w','o','w','6','4'}; *is_64bit = is_win64; - if (path->Length > sizeof(systemW) && !strncmpiW( path->Buffer, systemW, ARRAY_SIZE(systemW) )) + if (path->Length > sizeof(systemW) && !wcsnicmp( path->Buffer, systemW, ARRAY_SIZE(systemW) )) { if (is_wow64 && !ntdll_get_thread_data()->wow64_redir) *is_64bit = TRUE; return TRUE; } if ((is_win64 || is_wow64) && path->Length > sizeof(wow64W) && - !strncmpiW( path->Buffer, wow64W, ARRAY_SIZE(wow64W) )) + !wcsnicmp( path->Buffer, wow64W, ARRAY_SIZE(wow64W) )) { *is_64bit = FALSE; return TRUE; diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c index b5db930e12..9ebb973e9a 100644 --- a/dlls/ntdll/relay.c +++ b/dlls/ntdll/relay.c @@ -294,7 +294,7 @@ static BOOL check_from_module( const WCHAR **includelist, const WCHAR **excludel if (!wcsicmp( *listitem, module )) return !show; len = strlenW( *listitem ); - if (!strncmpiW( *listitem, module, len ) && !wcsicmp( module + len, dllW )) + if (!wcsnicmp( *listitem, module, len ) && !wcsicmp( module + len, dllW )) return !show; } return show;
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
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