ReactOS.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
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
List overview
Download
Ros-diffs
January 2018
----- 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
ros-diffs@reactos.org
37 participants
372 discussions
Start a n
N
ew thread
01/01: [WSHOM_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=161232c08bd4272a345e8…
commit 161232c08bd4272a345e86c50644782cd6435f6b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 22:00:27 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 22:00:27 2018 +0100 [WSHOM_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/wshom/wshom.c | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/modules/rostests/winetests/wshom/wshom.c b/modules/rostests/winetests/wshom/wshom.c index 84c97fa4ec..5a9662078a 100644 --- a/modules/rostests/winetests/wshom/wshom.c +++ b/modules/rostests/winetests/wshom/wshom.c @@ -569,6 +569,54 @@ static void test_registry(void) IWshShell3_Release(sh3); } +static void test_popup(void) +{ + static const WCHAR textW[] = {'T','e','x','t',0}; + VARIANT timeout, type, title, optional; + IWshShell *sh; + int button; + HRESULT hr; + BSTR text; + + hr = CoCreateInstance(&CLSID_WshShell, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IWshShell, (void **)&sh); + ok(hr == S_OK, "Failed to create WshShell object, hr %#x.\n", hr); + + button = 123; + text = SysAllocString(textW); + + hr = IWshShell_Popup(sh, NULL, NULL, NULL, NULL, &button); + ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr); + ok(button == 123, "Unexpected button id %d.\n", button); + + hr = IWshShell_Popup(sh, text, NULL, NULL, NULL, &button); + ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr); + ok(button == 123, "Unexpected button id %d.\n", button); + + V_VT(&optional) = VT_ERROR; + V_ERROR(&optional) = DISP_E_PARAMNOTFOUND; + + V_VT(&timeout) = VT_I2; + V_I2(&timeout) = 1; + + V_VT(&type) = VT_I2; + V_I2(&type) = 1; + + V_VT(&title) = VT_BSTR; + V_BSTR(&title) = NULL; + + hr = IWshShell_Popup(sh, text, &timeout, &optional, &type, &button); + ok(hr == S_OK, "Unexpected retval %#x.\n", hr); + ok(button == -1, "Unexpected button id %d.\n", button); + + hr = IWshShell_Popup(sh, text, &timeout, &title, &optional, &button); + ok(hr == S_OK, "Unexpected retval %#x.\n", hr); + ok(button == -1, "Unexpected button id %d.\n", button); + + SysFreeString(text); + IWshShell_Release(sh); +} + START_TEST(wshom) { IUnknown *unk; @@ -586,6 +634,7 @@ START_TEST(wshom) test_wshshell(); test_registry(); + test_popup(); CoUninitialize(); }
6 years, 11 months
1
0
0
0
01/01: [WSHOM.OCX] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3672658e75586379477fd…
commit 3672658e75586379477fda5fc70d4de43590f4a9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:59:45 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:59:45 2018 +0100 [WSHOM.OCX] Sync with Wine 3.0. CORE-14225 --- dll/win32/wshom.ocx/shell.c | 78 ++++++++++++++++++++++++++++++++++++++++++--- media/doc/README.WINE | 2 +- 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/dll/win32/wshom.ocx/shell.c b/dll/win32/wshom.ocx/shell.c index 1641c6ed50..bdae7d9fcd 100644 --- a/dll/win32/wshom.ocx/shell.c +++ b/dll/win32/wshom.ocx/shell.c @@ -1272,11 +1272,81 @@ static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, } } -static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR Text, VARIANT* SecondsToWait, VARIANT *Title, VARIANT *Type, int *button) +struct popup_thread_param { - FIXME("(%s %s %s %s %p): stub\n", debugstr_w(Text), debugstr_variant(SecondsToWait), - debugstr_variant(Title), debugstr_variant(Type), button); - return E_NOTIMPL; + WCHAR *text; + VARIANT title; + VARIANT type; + INT button; +}; + +static DWORD WINAPI popup_thread_proc(void *arg) +{ + static const WCHAR defaulttitleW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0}; + struct popup_thread_param *param = (struct popup_thread_param *)arg; + + param->button = MessageBoxW(NULL, param->text, is_optional_argument(¶m->title) ? + defaulttitleW : V_BSTR(¶m->title), V_I4(¶m->type)); + return 0; +} + +static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, + VARIANT *type, int *button) +{ + struct popup_thread_param param; + DWORD tid, status; + VARIANT timeout; + HANDLE hthread; + HRESULT hr; + + TRACE("(%s %s %s %s %p)\n", debugstr_w(text), debugstr_variant(seconds_to_wait), debugstr_variant(title), + debugstr_variant(type), button); + + if (!seconds_to_wait || !title || !type || !button) + return E_POINTER; + + VariantInit(&timeout); + if (!is_optional_argument(seconds_to_wait)) + { + hr = VariantChangeType(&timeout, seconds_to_wait, 0, VT_I4); + if (FAILED(hr)) + return hr; + } + + VariantInit(¶m.type); + if (!is_optional_argument(type)) + { + hr = VariantChangeType(¶m.type, type, 0, VT_I4); + if (FAILED(hr)) + return hr; + } + + if (is_optional_argument(title)) + param.title = *title; + else + { + VariantInit(¶m.title); + hr = VariantChangeType(¶m.title, title, 0, VT_BSTR); + if (FAILED(hr)) + return hr; + } + + param.text = text; + param.button = -1; + hthread = CreateThread(NULL, 0, popup_thread_proc, ¶m, 0, &tid); + status = MsgWaitForMultipleObjects(1, &hthread, FALSE, V_I4(&timeout) ? V_I4(&timeout) * 1000: INFINITE, 0); + if (status == WAIT_TIMEOUT) + { + PostThreadMessageW(tid, WM_QUIT, 0, 0); + MsgWaitForMultipleObjects(1, &hthread, FALSE, INFINITE, 0); + param.button = -1; + } + *button = param.button; + + VariantClear(¶m.title); + CloseHandle(hthread); + + return S_OK; } static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch** Shortcut) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b661e3d685..f366990215 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -211,7 +211,7 @@ reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 reactos/dll/win32/wmvcore # Synced to Wine-3.0 -reactos/dll/win32/wshom.ocx # Synced to WineStaging-2.9 +reactos/dll/win32/wshom.ocx # Synced to Wine-3.0 reactos/dll/win32/wtsapi32 # Synced to WineStaging-2.9 reactos/dll/win32/wuapi # Synced to WineStaging-2.9 reactos/dll/win32/xinput1_1 # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [WMVCORE] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81b5ed93e13d13f2f6c48…
commit 81b5ed93e13d13f2f6c487cfa57361120046105b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:58:37 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:58:37 2018 +0100 [WMVCORE] Sync with Wine 3.0. CORE-14225 --- dll/win32/wmvcore/wmvcore_main.c | 2 +- media/doc/README.WINE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/wmvcore/wmvcore_main.c b/dll/win32/wmvcore/wmvcore_main.c index be07909730..ae8b486532 100644 --- a/dll/win32/wmvcore/wmvcore_main.c +++ b/dll/win32/wmvcore/wmvcore_main.c @@ -1490,7 +1490,7 @@ static HRESULT WINAPI headerinfo_AddScript(IWMHeaderInfo3 *iface, LPCWSTR_WMSDK_ LPCWSTR_WMSDK_TYPE_SAFE command, QWORD script_time) { WMReader *This = impl_from_IWMHeaderInfo3(iface); - FIXME("%p, %s, %p, %s\n", This, debugstr_w(type), debugstr_w(command), wine_dbgstr_longlong(script_time)); + FIXME("%p, %s, %s, %s\n", This, debugstr_w(type), debugstr_w(command), wine_dbgstr_longlong(script_time)); return E_NOTIMPL; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 7f10d52dea..b661e3d685 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -210,7 +210,7 @@ reactos/dll/win32/wintrust # Synced to WineStaging-2.16 reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 -reactos/dll/win32/wmvcore # Synced to WineStaging-2.16 +reactos/dll/win32/wmvcore # Synced to Wine-3.0 reactos/dll/win32/wshom.ocx # Synced to WineStaging-2.9 reactos/dll/win32/wtsapi32 # Synced to WineStaging-2.9 reactos/dll/win32/wuapi # Synced to WineStaging-2.9
6 years, 11 months
1
0
0
0
01/01: [WLDAP32_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d8772ec2ca6ff9e199307…
commit d8772ec2ca6ff9e19930769fa77ec1940aacb70f Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:57:40 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:57:40 2018 +0100 [WLDAP32_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/wldap32/parse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/rostests/winetests/wldap32/parse.c b/modules/rostests/winetests/wldap32/parse.c index 5c84929c34..c4c97e1157 100644 --- a/modules/rostests/winetests/wldap32/parse.c +++ b/modules/rostests/winetests/wldap32/parse.c @@ -123,6 +123,15 @@ static void test_ldap_set_optionW( LDAP *ld ) ok( !ret, "ldap_set_optionW failed 0x%08x\n", ret ); } +static void test_ldap_get_optionW( LDAP *ld ) +{ + ULONG ret, version; + + ret = ldap_get_optionW( ld, LDAP_OPT_PROTOCOL_VERSION, &version ); + ok( !ret, "ldap_get_optionW failed 0x%08x\n", ret ); + ok( version == LDAP_VERSION3, "got %u\n", version ); +} + START_TEST (parse) { LDAP *ld; @@ -132,6 +141,7 @@ START_TEST (parse) test_ldap_parse_sort_control( ld ); test_ldap_search_extW( ld ); + test_ldap_get_optionW( ld ); test_ldap_set_optionW( ld ); ldap_unbind( ld ); }
6 years, 11 months
1
0
0
0
01/01: [WLDAP32] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87c506bacaf7088c2b73b…
commit 87c506bacaf7088c2b73b9d31b972e56fca5fc38 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:57:04 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:57:04 2018 +0100 [WLDAP32] Sync with Wine 3.0. CORE-14225 --- dll/win32/wldap32/ber.c | 4 ++-- dll/win32/wldap32/init.c | 17 ++++++++++++++--- media/doc/README.WINE | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dll/win32/wldap32/ber.c b/dll/win32/wldap32/ber.c index 5d3ac648d4..6687fe11ed 100644 --- a/dll/win32/wldap32/ber.c +++ b/dll/win32/wldap32/ber.c @@ -323,7 +323,7 @@ ULONG CDECL WLDAP32_ber_skip_tag( BerElement *berelement, ULONG *len ) * berelement must have been allocated with ber_alloc_t. This function * can be called multiple times to append data. */ -INT CDECL WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... ) +INT WINAPIV WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... ) { #ifdef HAVE_LDAP __ms_va_list list; @@ -418,7 +418,7 @@ INT CDECL WLDAP32_ber_printf( BerElement *berelement, PCHAR fmt, ... ) * berelement must have been allocated with ber_init. This function * can be called multiple times to decode data. */ -INT CDECL WLDAP32_ber_scanf( BerElement *berelement, PCHAR fmt, ... ) +INT WINAPIV WLDAP32_ber_scanf( BerElement *berelement, PCHAR fmt, ... ) { #ifdef HAVE_LDAP __ms_va_list list; diff --git a/dll/win32/wldap32/init.c b/dll/win32/wldap32/init.c index ff6f3ced51..7b3e467ec8 100644 --- a/dll/win32/wldap32/init.c +++ b/dll/win32/wldap32/init.c @@ -189,6 +189,17 @@ static char *urlify_hostnames( const char *scheme, char *hostnames, ULONG port ) } #endif +#ifdef HAVE_LDAP +static LDAP *create_context( const char *url ) +{ + LDAP *ld; + int version = LDAP_VERSION3; + if (ldap_initialize( &ld, url ) != LDAP_SUCCESS) return NULL; + ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ); + return ld; +} +#endif + /*********************************************************************** * cldap_openA (WLDAP32.@) * @@ -259,7 +270,7 @@ WLDAP32_LDAP * CDECL cldap_openW( PWCHAR hostname, ULONG portnumber ) url = urlify_hostnames( "cldap://", hostnameU, portnumber ); if (!url) goto exit; - ldap_initialize( &ld, url ); + ld = create_context( url ); exit: strfreeU( hostnameU ); @@ -368,7 +379,7 @@ WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber ) url = urlify_hostnames( "ldap://", hostnameU, portnumber ); if (!url) goto exit; - ldap_initialize( &ld, url ); + ld = create_context( url ); exit: strfreeU( hostnameU ); @@ -450,7 +461,7 @@ WLDAP32_LDAP * CDECL ldap_openW( PWCHAR hostname, ULONG portnumber ) url = urlify_hostnames( "ldap://", hostnameU, portnumber ); if (!url) goto exit; - ldap_initialize( &ld, url ); + ld = create_context( url ); exit: strfreeU( hostnameU ); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 09843a93df..7f10d52dea 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -207,7 +207,7 @@ reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628 reactos/dll/win32/winscard # Synced to WineStaging-2.9 reactos/dll/win32/wintrust # Synced to WineStaging-2.16 -reactos/dll/win32/wldap32 # Synced to WineStaging-2.9 +reactos/dll/win32/wldap32 # Synced to Wine-3.0 reactos/dll/win32/wmi # Synced to WineStaging-2.9 reactos/dll/win32/wmiutils # Synced to WineStaging-2.9 reactos/dll/win32/wmvcore # Synced to WineStaging-2.16
6 years, 11 months
1
0
0
0
01/01: [WININET_WINETEST] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f40fd12dfde95783bc0dd…
commit f40fd12dfde95783bc0ddd2aa8eac3f05aaf325d Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:54:59 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:54:59 2018 +0100 [WININET_WINETEST] Sync with Wine 3.0. CORE-14225 --- modules/rostests/winetests/wininet/ftp.c | 2 + modules/rostests/winetests/wininet/http.c | 394 ++------------------------ modules/rostests/winetests/wininet/internet.c | 16 +- modules/rostests/winetests/wininet/url.c | 6 +- 4 files changed, 27 insertions(+), 391 deletions(-) diff --git a/modules/rostests/winetests/wininet/ftp.c b/modules/rostests/winetests/wininet/ftp.c index ab58071e15..d6040d7edd 100644 --- a/modules/rostests/winetests/wininet/ftp.c +++ b/modules/rostests/winetests/wininet/ftp.c @@ -115,6 +115,7 @@ static void test_connect(HINTERNET hInternet) ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError()); ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); + InternetCloseHandle(hFtp); SetLastError(0xdeadbeef); hFtp = InternetConnectA(hInternet, "
ftp.winehq.org
", INTERNET_DEFAULT_FTP_PORT, "", NULL, @@ -128,6 +129,7 @@ static void test_connect(HINTERNET hInternet) { ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); + InternetCloseHandle(hFtp); } } diff --git a/modules/rostests/winetests/wininet/http.c b/modules/rostests/winetests/wininet/http.c index 4699ef6373..e74e31bbe1 100644 --- a/modules/rostests/winetests/wininet/http.c +++ b/modules/rostests/winetests/wininet/http.c @@ -725,7 +725,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test) res = InternetQueryOptionA(hor,INTERNET_OPTION_URL,buffer,&length); ok(res, "InternetQueryOptionA(INTERNET_OPTION_URL) failed with error %d\n", GetLastError()); - length = sizeof(buffer)-1; + length = sizeof(buffer)-2; memset(buffer, 0x77, sizeof(buffer)); res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length,0x0); ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); @@ -749,7 +749,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test) ok(buffer[length2+1] == 0x77, "Expected 0x77, got %02X\n", buffer[length2+1]); ok(length2 == length, "Value should not have changed: %d != %d\n", length2, length); - length = sizeof(wbuffer)-sizeof(WCHAR); + length = sizeof(wbuffer)-2*sizeof(WCHAR); memset(wbuffer, 0x77, sizeof(wbuffer)); res = HttpQueryInfoW(hor, HTTP_QUERY_RAW_HEADERS, wbuffer, &length, 0x0); ok(res, "HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); @@ -2057,22 +2057,6 @@ static const char okmsg2[] = "Set-Cookie: two\r\n" "\r\n"; -static const char okmsg_cookie_path[] = -"HTTP/1.1 200 OK\r\n" -"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" -"Server: winetest\r\n" -"Content-Length: 0\r\n" -"Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" -"\r\n"; - -static const char okmsg_cookie[] = -"HTTP/1.1 200 OK\r\n" -"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" -"Server: winetest\r\n" -"Content-Length: 0\r\n" -"Set-Cookie: testcookie=testvalue\r\n" -"\r\n"; - static const char notokmsg[] = "HTTP/1.1 400 Bad Request\r\n" "Server: winetest\r\n" @@ -2116,12 +2100,6 @@ static const char ok_with_length2[] = "Content-Length: 19\r\n\r\n" "HTTP/1.1 211 OK\r\n\r\n"; -static const char redir_no_host[] = -"HTTP/1.1 302 Found\r\n" -"Location: http:///test1\r\n" -"Server: winetest\r\n" -"\r\n"; - struct server_info { HANDLE hEvent; int port; @@ -2297,7 +2275,7 @@ static DWORD CALLBACK server_thread(LPVOID param) } if (strstr(buffer, "/testC")) { - if (strstr(buffer, "cookie=biscuit")) + if (strstr(buffer, "Cookie: cookie=biscuit")) send(c, okmsg, sizeof okmsg-1, 0); else send(c, notokmsg, sizeof notokmsg-1, 0); @@ -2442,51 +2420,6 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof notokmsg-1, 0); } - if (strstr(buffer, "/test_cookie_path1")) - { - if (strstr(buffer, "subcookie=data")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } - if (strstr(buffer, "/test_cookie_path2")) - { - if (strstr(buffer, "subcookie2=data")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } - if (strstr(buffer, "/test_cookie_set_path")) - { - send(c, okmsg_cookie_path, sizeof okmsg_cookie_path-1, 0); - } - if (strstr(buffer, "/test_cookie_merge")) - { - if (strstr(buffer, "subcookie=data") && - !strstr(buffer, "manual_cookie=test")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } - if (strstr(buffer, "/test_cookie_set_host_override")) - { - send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); - } - if (strstr(buffer, "/test_cookie_check_host_override")) - { - if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } - if (strstr(buffer, "/test_cookie_check_different_host")) - { - if (!strstr(buffer, "foo") && - strstr(buffer, "cookie=biscuit")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, notokmsg, sizeof notokmsg-1, 0); - } if (strstr(buffer, "/test_host_override")) { if (strstr(buffer, host_header_override)) @@ -2518,24 +2451,6 @@ static DWORD CALLBACK server_thread(LPVOID param) { send(c, okmsg, sizeof(okmsg)-1, 0); } - if (strstr(buffer, "HEAD /test_auth_host1")) - { - if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzcw==")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, noauthmsg, sizeof noauthmsg-1, 0); - } - if (strstr(buffer, "HEAD /test_auth_host2")) - { - if (strstr(buffer, "Authorization: Basic dGVzdDE6cGFzczI=")) - send(c, okmsg, sizeof okmsg-1, 0); - else - send(c, noauthmsg, sizeof noauthmsg-1, 0); - } - if (strstr(buffer, "GET /test_redirect_no_host")) - { - send(c, redir_no_host, sizeof redir_no_host-1, 0); - } shutdown(c, 2); closesocket(c); c = -1; @@ -3231,152 +3146,6 @@ static void test_header_override(int port) test_status_code(req, 400); } - InternetCloseHandle(req); - InternetSetCookieA("
http://localhost
", "cookie", "biscuit"); - req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - InternetSetCookieA("
http://test.local
", "foo", "bar"); - req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); - InternetCloseHandle(ses); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL, "InternetOpenA failed\n"); - - con = InternetConnectA(ses, "localhost", port, "test1", "pass", INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); - - req = HttpOpenRequestA( con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); - - test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); - InternetCloseHandle(ses); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL, "InternetOpenA failed\n"); - - con = InternetConnectA( ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); - - req = HttpOpenRequestA(con, "HEAD", "/test_auth_host1", NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); - ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); - - test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); - InternetCloseHandle(ses); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL, "InternetOpenA failed\n"); - - con = InternetConnectA(ses, "localhost", port, "test1", "pass2", INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); - - req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); - - ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); - - test_status_code(req, 200); - - InternetCloseHandle(req); - InternetCloseHandle(con); - InternetCloseHandle(ses); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL, "InternetOpenA failed\n"); - - con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnectA failed %u\n", GetLastError()); - - req = HttpOpenRequestA(con, "HEAD", "/test_auth_host2", NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequestA failed %u\n", GetLastError()); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); - - test_status_code(req, 200); - InternetCloseHandle(req); InternetCloseHandle(con); InternetCloseHandle(ses); @@ -3927,68 +3696,6 @@ static void test_cache_read_gzipped(int port) InternetCloseHandle(con); InternetCloseHandle(ses); - /* Decompression doesn't work while reading from cache */ - test_cache_gzip = 0; - sprintf(cache_url, cache_url_fmt, port, get_gzip); - DeleteUrlCacheEntryA(cache_url); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL,"InternetOpen failed with error %u\n", GetLastError()); - - ret = TRUE; - ret = InternetSetOptionA(ses, INTERNET_OPTION_HTTP_DECODING, &ret, sizeof(ret)); - ok(ret, "InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n", GetLastError()); - - con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnect failed with error %u\n", GetLastError()); - - req = HttpOpenRequestA(con, NULL, get_gzip, NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, "Accept-Encoding: gzip", -1, NULL, 0); - ok(ret, "HttpSendRequest failed with error %u\n", GetLastError()); - size = 0; - while(InternetReadFile(req, buf+size, sizeof(buf)-1-size, &read) && read) - size += read; - ok(size == 10, "read %d bytes of data\n", size); - buf[size] = 0; - ok(!strncmp(buf, content, size), "incorrect page content: %s\n", buf); - InternetCloseHandle(req); - - InternetCloseHandle(con); - InternetCloseHandle(ses); - - /* Decompression doesn't work while reading from cache */ - test_cache_gzip = 0; - sprintf(cache_url, cache_url_fmt, port, get_gzip); - DeleteUrlCacheEntryA(cache_url); - - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); - ok(ses != NULL,"InternetOpen failed with error %u\n", GetLastError()); - - con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); - ok(con != NULL, "InternetConnect failed with error %u\n", GetLastError()); - - ret = TRUE; - ret = InternetSetOptionA(con, INTERNET_OPTION_HTTP_DECODING, &ret, sizeof(ret)); - ok(ret, "InternetSetOption(INTERNET_OPTION_HTTP_DECODING) failed: %d\n", GetLastError()); - - req = HttpOpenRequestA(con, NULL, get_gzip, NULL, NULL, NULL, 0, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, "Accept-Encoding: gzip", -1, NULL, 0); - ok(ret, "HttpSendRequest failed with error %u\n", GetLastError()); - size = 0; - while(InternetReadFile(req, buf+size, sizeof(buf)-1-size, &read) && read) - size += read; - ok(size == 10, "read %d bytes of data\n", size); - buf[size] = 0; - ok(!strncmp(buf, content, size), "incorrect page content: %s\n", buf); - InternetCloseHandle(req); - - InternetCloseHandle(con); - InternetCloseHandle(ses); - DeleteUrlCacheEntryA(cache_url); } @@ -4027,7 +3734,7 @@ static void test_cookie_header(int port) HINTERNET ses, con, req; DWORD size, error; BOOL ret; - char buffer[256]; + char buffer[64]; ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n"); @@ -4055,7 +3762,7 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!!strstr(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); + ok(!strcmp(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer); ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); @@ -4066,61 +3773,9 @@ static void test_cookie_header(int port) size = sizeof(buffer); ret = HttpQueryInfoA(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); - ok(!strstr(buffer, "cookie=not biscuit"), "'%s' should not contain \'cookie=not biscuit\'\n", buffer); - ok(!!strstr(buffer, "cookie=biscuit"), "'%s' should contain \'cookie=biscuit\'\n", buffer); + ok(!strcmp(buffer, "cookie=biscuit"), "got '%s' expected \'cookie=biscuit\'\n", buffer); InternetCloseHandle(req); - - InternetSetCookieA("
http://localhost/testCCCC
", "subcookie", "data"); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_path1", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_path1/abc", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_set_path", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_path2", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 400); - InternetCloseHandle(req); - - req = HttpOpenRequestA(con, NULL, "/test_cookie_merge", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); - ok(req != NULL, "HttpOpenRequest failed\n"); - - ret = HttpAddRequestHeadersA(req, "Cookie: manual_cookie=test\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD); - ok(ret, "HttpAddRequestHeaders failed: %u\n", GetLastError()); - - ret = HttpSendRequestA(req, NULL, 0, NULL, 0); - ok(ret, "HttpSendRequest failed\n"); - - test_status_code(req, 200); - InternetCloseHandle(req); - InternetCloseHandle(con); InternetCloseHandle(ses); } @@ -5798,27 +5453,6 @@ static void test_remove_dot_segments(int port) close_request(&req); } -static void test_redirect_no_host(int port) -{ - test_request_t req; - BOOL ret; - - open_simple_request(&req, "localhost", port, NULL, "/test_redirect_no_host"); - ret = HttpSendRequestA(req.request, NULL, 0, NULL, 0); - if (ret) - { - trace("Succeeded with status code 302\n"); - test_status_code(req.request, 302); - } - else - { - trace("Failed with error ERROR_INTERNET_INVALID_URL\n"); - ok(GetLastError() == ERROR_INTERNET_INVALID_URL, - "Expected error ERROR_INTERNET_INVALID_URL, got %u\n", GetLastError()); - } - close_request(&req); -} - static void test_http_connection(void) { struct server_info si; @@ -5834,7 +5468,10 @@ static void test_http_connection(void) r = WaitForSingleObject(si.hEvent, 10000); ok (r == WAIT_OBJECT_0, "failed to start wininet test server\n"); if (r != WAIT_OBJECT_0) + { + CloseHandle(hThread); return; + } test_basic_request(si.port, "GET", "/test1"); test_proxy_indirect(si.port); @@ -5885,7 +5522,6 @@ else } #endif test_remove_dot_segments(si.port); - test_redirect_no_host(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, "GET", "/quit"); @@ -5977,6 +5613,18 @@ static void _test_security_info(unsigned line, const char *urlc, DWORD error, DW ok_(__FILE__,line)(chain != NULL, "chain = NULL\n"); ok_(__FILE__,line)(flags == ex_flags, "flags = %x\n", flags); CertFreeCertificateChain(chain); + + SetLastError(0xdeadbeef); + res = pInternetGetSecurityInfoByURLA(url, NULL, NULL); + ok_(__FILE__,line)(!res && GetLastError() == ERROR_INVALID_PARAMETER, + "InternetGetSecurityInfoByURLA returned: %x(%u)\n", res, GetLastError()); + + res = pInternetGetSecurityInfoByURLA(url, &chain, NULL); + ok_(__FILE__,line)(res, "InternetGetSecurityInfoByURLA failed: %u\n", GetLastError()); + CertFreeCertificateChain(chain); + + res = pInternetGetSecurityInfoByURLA(url, NULL, &flags); + ok_(__FILE__,line)(res, "InternetGetSecurityInfoByURLA failed: %u\n", GetLastError()); }else { ok_(__FILE__,line)(!res && GetLastError() == error, "InternetGetSecurityInfoByURLA returned: %x(%u), expected %u\n", res, GetLastError(), error); diff --git a/modules/rostests/winetests/wininet/internet.c b/modules/rostests/winetests/wininet/internet.c index dd7b8978f6..a83583a8c1 100644 --- a/modules/rostests/winetests/wininet/internet.c +++ b/modules/rostests/winetests/wininet/internet.c @@ -566,7 +566,7 @@ static void test_cookie_attrs(void) DWORD size, state; BOOL ret; - if(!GetProcAddress(GetModuleHandleA("wininet.dll"), "InternetGetSecurityInfoByURLA")) { + if(!GetProcAddress(GetModuleHandleA("wininet.dll"), "DeleteWpadCacheForNetworks")) { win_skip("Skipping cookie attributes tests. Too old IE.\n"); return; } @@ -1166,20 +1166,6 @@ static void test_InternetSetOption(void) ok(ret == FALSE, "InternetSetOption should've failed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() = %x\n", GetLastError()); - ret = InternetSetOptionA(req, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); - ok(ret == TRUE, "InternetSetOption should've succeeded\n"); - - ret = InternetSetOptionA(ses, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0); - ok(ret == TRUE, "InternetSetOption should've succeeded\n"); - - ret = InternetSetOptionA(ses, INTERNET_OPTION_REFRESH, NULL, 0); - ok(ret == TRUE, "InternetSetOption should've succeeded\n"); - - SetLastError(0xdeadbeef); - ret = InternetSetOptionA(req, INTERNET_OPTION_REFRESH, NULL, 0); - todo_wine ok(ret == FALSE, "InternetSetOption should've failed\n"); - todo_wine ok(GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, "GetLastError() = %x\n", GetLastError()); - ret = InternetCloseHandle(req); ok(ret == TRUE, "InternetCloseHandle failed: 0x%08x\n", GetLastError()); ret = InternetCloseHandle(con); diff --git a/modules/rostests/winetests/wininet/url.c b/modules/rostests/winetests/wininet/url.c index 0e289f9e79..8b167d939e 100644 --- a/modules/rostests/winetests/wininet/url.c +++ b/modules/rostests/winetests/wininet/url.c @@ -816,9 +816,9 @@ static void InternetCrackUrlW_test(void) comp.lpszUrlPath = urlpart; comp.dwUrlPathLength = sizeof(urlpart)/sizeof(urlpart[0]); r = InternetCrackUrlW(url3, 0, ICU_DECODE, &comp); - ok(r, "InternetCrackUrlW failed unexpectedly\n"); - ok(!strcmp_wa(host, "x.org"), "host is %s, should be x.org\n", wine_dbgstr_w(host)); - todo_wine ok(urlpart[0] == 0, "urlpart should be empty\n"); + todo_wine ok(r, "InternetCrackUrlW failed unexpectedly\n"); + todo_wine ok(!strcmp_wa(host, "x.org"), "host is %s, should be x.org\n", wine_dbgstr_w(host)); + ok(urlpart[0] == 0, "urlpart should be empty\n"); } static void fill_url_components(URL_COMPONENTSA *lpUrlComponents)
6 years, 11 months
1
0
0
0
01/01: [WININET] Sync with Wine 3.0. CORE-14225
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c95e9203e633ec8ed5111…
commit c95e9203e633ec8ed5111769455ea88cdf55e115 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Sun Jan 21 21:53:54 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 21:53:54 2018 +0100 [WININET] Sync with Wine 3.0. CORE-14225 --- dll/win32/wininet/dialogs.c | 9 -- dll/win32/wininet/http.c | 209 ++++++++++++++++++++--------------------- dll/win32/wininet/internet.c | 62 +++--------- dll/win32/wininet/internet.h | 2 +- dll/win32/wininet/wininet.spec | 2 +- media/doc/README.WINE | 2 +- 6 files changed, 119 insertions(+), 167 deletions(-) diff --git a/dll/win32/wininet/dialogs.c b/dll/win32/wininet/dialogs.c index 6f2ff8261d..913a4ceaf5 100644 --- a/dll/win32/wininet/dialogs.c +++ b/dll/win32/wininet/dialogs.c @@ -554,15 +554,6 @@ BOOL WINAPI InternetShowSecurityInfoByURLW(LPCWSTR url, HWND window) return FALSE; } -/*********************************************************************** - * ParseX509EncodedCertificateForListBoxEntry (@) - */ -DWORD WINAPI ParseX509EncodedCertificateForListBoxEntry(LPBYTE cert, DWORD len, LPSTR szlistbox, LPDWORD listbox) -{ - FIXME("stub: %p %d %s %p\n", cert, len, debugstr_a(szlistbox), listbox); - return ERROR_CALL_NOT_IMPLEMENTED; -} - /*********************************************************************** * ShowX509EncodedCertificate (@) */ diff --git a/dll/win32/wininet/http.c b/dll/win32/wininet/http.c index 05f1ba2003..f9694ca454 100644 --- a/dll/win32/wininet/http.c +++ b/dll/win32/wininet/http.c @@ -253,7 +253,7 @@ server_t *get_server(substr_t name, INTERNET_PORT port, BOOL is_https, BOOL do_c EnterCriticalSection(&connection_pool_cs); LIST_FOR_EACH_ENTRY(iter, &connection_pool, server_t, entry) { - if(iter->port == port && name.len == strlenW(iter->name) && !strncmpW(iter->name, name.str, name.len) + if(iter->port == port && name.len == strlenW(iter->name) && !strncmpiW(iter->name, name.str, name.len) && iter->is_https == is_https) { server = iter; server_addref(server); @@ -742,18 +742,10 @@ static void HTTP_ProcessCookies( http_request_t *request ) int HeaderIndex; int numCookies = 0; LPHTTPHEADERW setCookieHeader; - WCHAR *path, *tmp; if(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) return; - path = heap_strdupW(request->path); - if (!path) - return; - - tmp = strrchrW(path, '/'); - if (tmp && tmp[1]) tmp[1] = 0; - EnterCriticalSection( &request->headers_section ); while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) @@ -772,11 +764,10 @@ static void HTTP_ProcessCookies( http_request_t *request ) name = substr(setCookieHeader->lpszValue, data - setCookieHeader->lpszValue); data++; - set_cookie(substrz(request->server->name), substrz(path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); + set_cookie(substrz(request->server->name), substrz(request->path), name, substrz(data), INTERNET_COOKIE_HTTPONLY); } LeaveCriticalSection( &request->headers_section ); - heap_free(path); } static void strip_spaces(LPWSTR start) @@ -1725,7 +1716,7 @@ static BOOL HTTP_DomainMatches(LPCWSTR server, substr_t domain) return FALSE; len = strlenW(dot + 1); - if(len <= domain.len - 2) + if(len < domain.len - 2) return FALSE; /* The server's domain is longer than the wildcard, so it @@ -2335,6 +2326,11 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer, if (!(req->session->appInfo->proxyPassword = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY; return ERROR_SUCCESS; + case INTERNET_OPTION_HTTP_DECODING: + if(size != sizeof(BOOL)) + return ERROR_INVALID_PARAMETER; + req->decoding = *(BOOL*)buffer; + return ERROR_SUCCESS; } return INET_SetOption(hdr, option, buffer, size); @@ -2904,7 +2900,7 @@ static DWORD set_content_length(http_request_t *request) request->contentLength = ~0u; } - if(request->hdr.decoding) { + if(request->decoding) { int encoding_idx; static const WCHAR deflateW[] = {'d','e','f','l','a','t','e',0}; @@ -3290,7 +3286,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, request->hdr.htype = WH_HHTTPREQ; request->hdr.dwFlags = dwFlags; request->hdr.dwContext = dwContext; - request->hdr.decoding = session->hdr.decoding; request->contentLength = ~0u; request->netconn_stream.data_stream.vtbl = &netconn_stream_vtbl; @@ -5798,7 +5793,6 @@ DWORD HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, session->hdr.dwFlags = dwFlags; session->hdr.dwContext = dwContext; session->hdr.dwInternalFlags |= dwInternalFlags; - session->hdr.decoding = hIC->hdr.decoding; WININET_AddRef( &hIC->hdr ); session->appInfo = hIC; @@ -6056,128 +6050,127 @@ static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer) static DWORD HTTP_ProcessHeader(http_request_t *request, LPCWSTR field, LPCWSTR value, DWORD dwModifier) { - LPHTTPHEADERW lphttpHdr; + LPHTTPHEADERW lphttpHdr = NULL; INT index; BOOL request_only = !!(dwModifier & HTTP_ADDHDR_FLAG_REQ); - DWORD res = ERROR_SUCCESS; + DWORD res = ERROR_HTTP_INVALID_HEADER; TRACE("--> %s: %s - 0x%08x\n", debugstr_w(field), debugstr_w(value), dwModifier); EnterCriticalSection( &request->headers_section ); - index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); + /* REPLACE wins out over ADD */ + if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) + dwModifier &= ~HTTP_ADDHDR_FLAG_ADD; + + if (dwModifier & HTTP_ADDHDR_FLAG_ADD) + index = -1; + else + index = HTTP_GetCustomHeaderIndex(request, field, 0, request_only); + if (index >= 0) { - lphttpHdr = &request->custHeaders[index]; - - /* replace existing header if FLAG_REPLACE is given */ - if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) + if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) { - HTTP_DeleteCustomHeader( request, index ); + LeaveCriticalSection( &request->headers_section ); + return ERROR_HTTP_INVALID_HEADER; + } + lphttpHdr = &request->custHeaders[index]; + } + else if (value) + { + HTTPHEADERW hdr; - if (value && value[0]) - { - HTTPHEADERW hdr; + hdr.lpszField = (LPWSTR)field; + hdr.lpszValue = (LPWSTR)value; + hdr.wFlags = hdr.wCount = 0; - hdr.lpszField = (LPWSTR)field; - hdr.lpszValue = (LPWSTR)value; - hdr.wFlags = hdr.wCount = 0; + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) + hdr.wFlags |= HDR_ISREQUEST; - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - hdr.wFlags |= HDR_ISREQUEST; + res = HTTP_InsertCustomHeader(request, &hdr); + LeaveCriticalSection( &request->headers_section ); + return res; + } + /* no value to delete */ + else + { + LeaveCriticalSection( &request->headers_section ); + return ERROR_SUCCESS; + } - res = HTTP_InsertCustomHeader( request, &hdr ); - } + if (dwModifier & HTTP_ADDHDR_FLAG_REQ) + lphttpHdr->wFlags |= HDR_ISREQUEST; + else + lphttpHdr->wFlags &= ~HDR_ISREQUEST; - goto out; - } + if (dwModifier & HTTP_ADDHDR_FLAG_REPLACE) + { + HTTP_DeleteCustomHeader( request, index ); - /* do not add new header if FLAG_ADD_IF_NEW is set */ - if (dwModifier & HTTP_ADDHDR_FLAG_ADD_IF_NEW) + if (value && value[0]) { - res = ERROR_HTTP_INVALID_HEADER; /* FIXME */ - goto out; - } + HTTPHEADERW hdr; - /* handle appending to existing header */ - if (dwModifier & COALESCEFLAGS) - { - LPWSTR lpsztmp; - WCHAR ch = 0; - INT len = 0; - INT origlen = strlenW(lphttpHdr->lpszValue); - INT valuelen = strlenW(value); + hdr.lpszField = (LPWSTR)field; + hdr.lpszValue = (LPWSTR)value; + hdr.wFlags = hdr.wCount = 0; - /* FIXME: Should it really clear HDR_ISREQUEST? */ if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - lphttpHdr->wFlags |= HDR_ISREQUEST; - else - lphttpHdr->wFlags &= ~HDR_ISREQUEST; - - if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) - { - ch = ','; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; - } - else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) - { - ch = ';'; - lphttpHdr->wFlags |= HDR_COMMADELIMITED; - } - - len = origlen + valuelen + ((ch > 0) ? 2 : 0); + hdr.wFlags |= HDR_ISREQUEST; - lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); - if (lpsztmp) - { - lphttpHdr->lpszValue = lpsztmp; - /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ - if (ch > 0) - { - lphttpHdr->lpszValue[origlen] = ch; - origlen++; - lphttpHdr->lpszValue[origlen] = ' '; - origlen++; - } - - memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); - lphttpHdr->lpszValue[len] = '\0'; - } - else - { - WARN("heap_realloc (%d bytes) failed\n",len+1); - res = ERROR_OUTOFMEMORY; - } - - goto out; + res = HTTP_InsertCustomHeader(request, &hdr); + LeaveCriticalSection( &request->headers_section ); + return res; } - } - /* FIXME: What about other combinations? */ - if ((dwModifier & ~HTTP_ADDHDR_FLAG_REQ) == HTTP_ADDHDR_FLAG_REPLACE) - { - res = ERROR_HTTP_HEADER_NOT_FOUND; - goto out; + LeaveCriticalSection( &request->headers_section ); + return ERROR_SUCCESS; } - - /* FIXME: What if value == ""? */ - if (value) + else if (dwModifier & COALESCEFLAGS) { - HTTPHEADERW hdr; + LPWSTR lpsztmp; + WCHAR ch = 0; + INT len = 0; + INT origlen = strlenW(lphttpHdr->lpszValue); + INT valuelen = strlenW(value); - hdr.lpszField = (LPWSTR)field; - hdr.lpszValue = (LPWSTR)value; - hdr.wFlags = hdr.wCount = 0; + if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_COMMA) + { + ch = ','; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; + } + else if (dwModifier & HTTP_ADDHDR_FLAG_COALESCE_WITH_SEMICOLON) + { + ch = ';'; + lphttpHdr->wFlags |= HDR_COMMADELIMITED; + } - if (dwModifier & HTTP_ADDHDR_FLAG_REQ) - hdr.wFlags |= HDR_ISREQUEST; + len = origlen + valuelen + ((ch > 0) ? 2 : 0); - res = HTTP_InsertCustomHeader( request, &hdr ); - goto out; - } + lpsztmp = heap_realloc(lphttpHdr->lpszValue, (len+1)*sizeof(WCHAR)); + if (lpsztmp) + { + lphttpHdr->lpszValue = lpsztmp; + /* FIXME: Increment lphttpHdr->wCount. Perhaps lpszValue should be an array */ + if (ch > 0) + { + lphttpHdr->lpszValue[origlen] = ch; + origlen++; + lphttpHdr->lpszValue[origlen] = ' '; + origlen++; + } - /* FIXME: What if value == NULL? */ -out: + memcpy(&lphttpHdr->lpszValue[origlen], value, valuelen*sizeof(WCHAR)); + lphttpHdr->lpszValue[len] = '\0'; + res = ERROR_SUCCESS; + } + else + { + WARN("heap_realloc (%d bytes) failed\n",len+1); + res = ERROR_OUTOFMEMORY; + } + } TRACE("<-- %d\n", res); LeaveCriticalSection( &request->headers_section ); return res; diff --git a/dll/win32/wininet/internet.c b/dll/win32/wininet/internet.c index 4cbda9beab..c3bf261572 100644 --- a/dll/win32/wininet/internet.c +++ b/dll/win32/wininet/internet.c @@ -1625,7 +1625,7 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF if (dwFlags & ICU_DECODE) { - WCHAR *url_tmp, *buffer; + WCHAR *url_tmp; DWORD len = dwUrlLength + 1; BOOL ret; @@ -1634,24 +1634,9 @@ BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwF SetLastError(ERROR_OUTOFMEMORY); return FALSE; } - - buffer = url_tmp; - ret = InternetCanonicalizeUrlW(url_tmp, buffer, &len, ICU_DECODE | ICU_NO_ENCODE); - if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - buffer = heap_alloc(len * sizeof(WCHAR)); - if (!buffer) - { - SetLastError(ERROR_OUTOFMEMORY); - heap_free(url_tmp); - return FALSE; - } - ret = InternetCanonicalizeUrlW(url_tmp, buffer, &len, ICU_DECODE | ICU_NO_ENCODE); - } + ret = InternetCanonicalizeUrlW(url_tmp, url_tmp, &len, ICU_DECODE | ICU_NO_ENCODE); if (ret) - ret = InternetCrackUrlW(buffer, len, dwFlags & ~ICU_DECODE, lpUC); - - if (buffer != url_tmp) heap_free(buffer); + ret = InternetCrackUrlW(url_tmp, len, dwFlags & ~ICU_DECODE, lpUC); heap_free(url_tmp); return ret; } @@ -2286,8 +2271,7 @@ static WCHAR *get_proxy_autoconfig_url(void) CFRelease( settings ); return ret; #else - static int once; - if (!once++) FIXME( "no support on this platform\n" ); + FIXME( "no support on this platform\n" ); return NULL; #endif } @@ -2837,21 +2821,10 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n"); break; case INTERNET_OPTION_HTTP_DECODING: - { - if (!lpwhh) - { - SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - return FALSE; - } - if (!lpBuffer || dwBufferLength != sizeof(BOOL)) - { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; - } - else - lpwhh->decoding = *(BOOL *)lpBuffer; + FIXME("INTERNET_OPTION_HTTP_DECODING; STUB\n"); + SetLastError(ERROR_INTERNET_INVALID_OPTION); + ret = FALSE; break; - } case INTERNET_OPTION_COOKIES_3RD_PARTY: FIXME("INTERNET_OPTION_COOKIES_3RD_PARTY; STUB\n"); SetLastError(ERROR_INTERNET_INVALID_OPTION); @@ -2938,12 +2911,6 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, ret = (res == ERROR_SUCCESS); break; } - case INTERNET_OPTION_SETTINGS_CHANGED: - FIXME("INTERNET_OPTION_SETTINGS_CHANGED; STUB\n"); - break; - case INTERNET_OPTION_REFRESH: - FIXME("INTERNET_OPTION_REFRESH; STUB\n"); - break; default: FIXME("Option %d STUB\n",dwOption); SetLastError(ERROR_INTERNET_INVALID_OPTION); @@ -4469,6 +4436,11 @@ BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT TRACE("(%s %p %p)\n", debugstr_w(lpszURL), ppCertChain, pdwSecureFlags); + if (!ppCertChain && !pdwSecureFlags) { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + url.dwHostNameLength = 1; res = InternetCrackUrlW(lpszURL, 0, 0, &url); if(!res || url.nScheme != INTERNET_SCHEME_HTTPS) { @@ -4483,15 +4455,11 @@ BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT } if(server->cert_chain) { - const CERT_CHAIN_CONTEXT *chain_dup; - - chain_dup = CertDuplicateCertificateChain(server->cert_chain); - if(chain_dup) { - *ppCertChain = chain_dup; + if(pdwSecureFlags) *pdwSecureFlags = server->security_flags & _SECURITY_ERROR_FLAGS_MASK; - }else { + + if(ppCertChain && !(*ppCertChain = CertDuplicateCertificateChain(server->cert_chain))) res = FALSE; - } }else { SetLastError(ERROR_INTERNET_ITEM_NOT_FOUND); res = FALSE; diff --git a/dll/win32/wininet/internet.h b/dll/win32/wininet/internet.h index a1a6a41f1e..23567364f4 100644 --- a/dll/win32/wininet/internet.h +++ b/dll/win32/wininet/internet.h @@ -357,7 +357,6 @@ struct _object_header_t ULONG ErrorMask; DWORD dwInternalFlags; LONG refs; - BOOL decoding; INTERNET_STATUS_CALLBACK lpfnStatusCB; struct list entry; struct list children; @@ -454,6 +453,7 @@ typedef struct DWORD read_size; /* valid data size in read_buf */ BYTE read_buf[READ_BUFFER_SIZE]; /* buffer for already read but not returned data */ + BOOL decoding; data_stream_t *data_stream; netconn_stream_t netconn_stream; } http_request_t; diff --git a/dll/win32/wininet/wininet.spec b/dll/win32/wininet/wininet.spec index 7ef28d6777..38fd03b770 100644 --- a/dll/win32/wininet/wininet.spec +++ b/dll/win32/wininet/wininet.spec @@ -216,7 +216,7 @@ @ stdcall IsUrlCacheEntryExpiredA(str long ptr) @ stdcall IsUrlCacheEntryExpiredW(wstr long ptr) @ stdcall LoadUrlCacheContent() -@ stdcall ParseX509EncodedCertificateForListBoxEntry(ptr long str ptr) +@ stdcall -stub ParseX509EncodedCertificateForListBoxEntry(ptr long str ptr) @ stdcall PrivacyGetZonePreferenceW(long long ptr ptr ptr) @ stdcall PrivacySetZonePreferenceW(long long long wstr) @ stdcall ReadUrlCacheEntryStream(ptr long ptr ptr long) diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 5f30683e42..09843a93df 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -201,7 +201,7 @@ reactos/dll/win32/windowscodecsext # Synced to WineStaging-2.9 reactos/dll/win32/winemp3.acm # Synced to Wine-3.0 reactos/dll/win32/wing32 # Synced to WineStaging-2.9 reactos/dll/win32/winhttp # Synced to Wine-3.0 -reactos/dll/win32/wininet # Synced to WineStaging-2.16 +reactos/dll/win32/wininet # Synced to Wine-3.0 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
6 years, 11 months
1
0
0
0
06/06: [APPSHIM_APITEST] Windows 10 test update
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eec2e288be0369451a896…
commit eec2e288be0369451a8961c762c86edf0533a0bc Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Jan 20 22:53:41 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Jan 21 21:13:08 2018 +0100 [APPSHIM_APITEST] Windows 10 test update --- modules/rostests/apitests/appshim/versionlie.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/rostests/apitests/appshim/versionlie.c b/modules/rostests/apitests/appshim/versionlie.c index b36bfe5cf7..aaac992c1e 100644 --- a/modules/rostests/apitests/appshim/versionlie.c +++ b/modules/rostests/apitests/appshim/versionlie.c @@ -333,8 +333,20 @@ BOOL LoadShimDLL(PCWSTR ShimDll, HMODULE* module, tGETHOOKAPIS* ppGetHookAPIs) dll = LoadLibraryW(buf); if (!dll) { - skip("Unable to load shim dll\n"); - return FALSE; + skip("Unable to load shim dll from AppPatch\n"); + GetSystemWindowsDirectoryW(buf, _countof(buf)); + + if (SUCCEEDED(StringCchCatW(buf, _countof(buf), L"\\System32\\")) && + SUCCEEDED(StringCchCatW(buf, _countof(buf), ShimDll))) + { + dll = LoadLibraryW(buf); + } + + if (!dll) + { + skip("Unable to load shim dll from System32 (Recent Win10)\n"); + return FALSE; + } } *module = dll; *ppGetHookAPIs = (tGETHOOKAPIS)GetProcAddress(dll, "GetHookAPIs");
6 years, 11 months
1
0
0
0
05/06: [APPHELP][APPHELP_APITEST] Fix SdbGetAppPatchDir prototype
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9395e92afe042726d666…
commit f9395e92afe042726d66630da93245e4da623829 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Jan 21 11:18:59 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Jan 21 21:13:08 2018 +0100 [APPHELP][APPHELP_APITEST] Fix SdbGetAppPatchDir prototype --- dll/appcompat/apphelp/apphelp.h | 2 +- dll/appcompat/apphelp/hsdb.c | 18 ++-- dll/appcompat/apphelp/shimeng.c | 2 +- modules/rostests/apitests/apphelp/apphelp.c | 102 ++++++++++++++++----- .../rostests/apitests/appshim/appshim_apitest.h | 2 +- modules/rostests/apitests/appshim/versionlie.c | 2 +- 6 files changed, 91 insertions(+), 37 deletions(-) diff --git a/dll/appcompat/apphelp/apphelp.h b/dll/appcompat/apphelp/apphelp.h index 0107d3e7ce..f2af2b0afc 100644 --- a/dll/appcompat/apphelp/apphelp.h +++ b/dll/appcompat/apphelp/apphelp.h @@ -87,7 +87,7 @@ LPCWSTR WINAPI SdbTagToString(TAG tag); PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type); void WINAPI SdbCloseDatabase(PDB); BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid); -BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size); +HRESULT WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size); LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid); TAGID WINAPI SdbFindFirstNamedTag(PDB pdb, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name); diff --git a/dll/appcompat/apphelp/hsdb.c b/dll/appcompat/apphelp/hsdb.c index ea61555539..903968d0d6 100644 --- a/dll/appcompat/apphelp/hsdb.c +++ b/dll/appcompat/apphelp/hsdb.c @@ -4,7 +4,7 @@ * PURPOSE: Shim matching / data (un)packing * COPYRIGHT: Copyright 2011 André Hentschel * Copyright 2013 Mislav Blaževic - * Copyright 2015-2017 Mark Jansen (mark.jansen(a)reactos.org) + * Copyright 2015-2018 Mark Jansen (mark.jansen(a)reactos.org) */ #define WIN32_NO_STATUS @@ -563,11 +563,11 @@ Cleanup: /** * Retrieves AppPatch directory. * - * @param [in] pdb Handle to the shim database. + * @param [in] pdb Handle to the shim database. * @param [out] path Pointer to memory in which path shall be written. * @param [in] size Size of the buffer in characters. */ -BOOL WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size) +HRESULT WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size) { static WCHAR* default_dir = NULL; static CONST WCHAR szAppPatch[] = {'\\','A','p','p','P','a','t','c','h',0}; @@ -579,6 +579,7 @@ BOOL WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size) if (!default_dir) { WCHAR* tmp; + HRESULT hr = E_FAIL; UINT len = GetSystemWindowsDirectoryW(NULL, 0) + SdbpStrlen(szAppPatch); tmp = SdbAlloc((len + 1)* sizeof(WCHAR)); if (tmp) @@ -586,7 +587,8 @@ BOOL WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size) UINT r = GetSystemWindowsDirectoryW(tmp, len+1); if (r && r < len) { - if (SUCCEEDED(StringCchCatW(tmp, len+1, szAppPatch))) + hr = StringCchCatW(tmp, len+1, szAppPatch); + if (SUCCEEDED(hr)) { if (InterlockedCompareExchangePointer((void**)&default_dir, tmp, NULL) == NULL) tmp = NULL; @@ -597,19 +599,19 @@ BOOL WINAPI SdbGetAppPatchDir(HSDB hsdb, LPWSTR path, DWORD size) } if (!default_dir) { - SHIM_ERR("Unable to obtain default AppPatch directory\n"); - return FALSE; + SHIM_ERR("Unable to obtain default AppPatch directory (0x%x)\n", hr); + return hr; } } if (!hsdb) { - return SUCCEEDED(StringCchCopyW(path, size, default_dir)); + return StringCchCopyW(path, size, default_dir); } else { SHIM_ERR("Unimplemented for hsdb != NULL\n"); - return FALSE; + return E_NOTIMPL; } } diff --git a/dll/appcompat/apphelp/shimeng.c b/dll/appcompat/apphelp/shimeng.c index 20f125a456..667af704ed 100644 --- a/dll/appcompat/apphelp/shimeng.c +++ b/dll/appcompat/apphelp/shimeng.c @@ -1040,7 +1040,7 @@ VOID SeiInit(PUNICODE_STRING ProcessImage, HSDB hsdb, SDBQUERYRESULT* pQuery) continue; } - if (!SdbGetAppPatchDir(NULL, FullNameBuffer, ARRAYSIZE(FullNameBuffer))) + if (!SUCCEEDED(SdbGetAppPatchDir(NULL, FullNameBuffer, ARRAYSIZE(FullNameBuffer)))) { SHIMENG_WARN("Failed to get the AppPatch dir\n"); continue; diff --git a/modules/rostests/apitests/apphelp/apphelp.c b/modules/rostests/apitests/apphelp/apphelp.c index 3fb27b21ac..4a300e3e5a 100644 --- a/modules/rostests/apitests/apphelp/apphelp.c +++ b/modules/rostests/apitests/apphelp/apphelp.c @@ -87,12 +87,13 @@ typedef struct tagATTRINFO { static HMODULE hdll; static BOOL (WINAPI *pApphelpCheckShellObject)(REFCLSID, BOOL, ULONGLONG *); -static LPCWSTR (WINAPI *pSdbTagToString)(TAG); -static BOOL (WINAPI *pSdbGUIDToString)(CONST GUID *, PCWSTR, SIZE_T); -static BOOL (WINAPI *pSdbIsNullGUID)(CONST GUID *); -static BOOL (WINAPI *pSdbGetStandardDatabaseGUID)(DWORD, GUID*); -static BOOL (WINAPI *pSdbGetFileAttributes)(LPCWSTR, PATTRINFO *, LPDWORD); -static BOOL (WINAPI *pSdbFreeFileAttributes)(PATTRINFO); +static LPCWSTR (WINAPI *pSdbTagToString)(TAG tag); +static BOOL (WINAPI *pSdbGUIDToString)(REFGUID Guid, PWSTR GuidString, SIZE_T Length); +static BOOL (WINAPI *pSdbIsNullGUID)(REFGUID Guid); +static BOOL (WINAPI *pSdbGetStandardDatabaseGUID)(DWORD Flags, GUID* Guid); +static BOOL (WINAPI *pSdbGetFileAttributes)(LPCWSTR wszPath, PATTRINFO *ppAttrInfo, LPDWORD pdwAttrCount); +static BOOL (WINAPI *pSdbFreeFileAttributes)(PATTRINFO AttrInfo); +static HRESULT (WINAPI* pSdbGetAppPatchDir)(PVOID hsdb, LPWSTR path, DWORD size); /* 'Known' database guids */ DEFINE_GUID(GUID_DATABASE_MSI,0xd8ff6d16,0x6a3a,0x468a,0x8b,0x44,0x01,0x71,0x4d,0xdc,0x49,0xea); @@ -869,34 +870,85 @@ static void test_ApplicationAttributes(void) DeleteFileA("testxx.exe"); } -START_TEST(apphelp) +/* Showing that SdbGetAppPatchDir returns HRESULT */ +static void test_SdbGetAppPatchDir(void) { - g_WinVersion = get_host_winver(); - trace("Detected version: 0x%x\n", g_WinVersion); - silence_debug_output(); + WCHAR Buffer[MAX_PATH]; + HRESULT hr, expect_hr; + int n; + + + _SEH2_TRY + { + hr = pSdbGetAppPatchDir(NULL, NULL, 0); + ok_hex(hr, S_FALSE); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Some versions accept it, some don't */ + trace("SdbGetAppPatchDir did not handle a NULL pointer very gracefully.\n"); + } + _SEH2_END; + + + + memset(Buffer, 0xbb, sizeof(Buffer)); + hr = pSdbGetAppPatchDir(NULL, Buffer, 0); + if (g_WinVersion < WINVER_WIN7) + expect_hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); + else if (g_WinVersion < WINVER_WIN10) + expect_hr = S_OK; + else + expect_hr = S_FALSE; + ok_hex(hr, expect_hr); + + if (g_WinVersion < WINVER_WIN7) + expect_hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); + else if (g_WinVersion < WINVER_WIN10) + expect_hr = S_OK; + else + expect_hr = TRUE; + memset(Buffer, 0xbb, sizeof(Buffer)); + hr = pSdbGetAppPatchDir(NULL, Buffer, 1); + ok_hex(hr, expect_hr); + + + for (n = 2; n < _countof(Buffer) - 1; ++n) + { + memset(Buffer, 0xbb, sizeof(Buffer)); + hr = pSdbGetAppPatchDir(NULL, Buffer, n); + ok(Buffer[n] == 0xbbbb, "Expected SdbGetAppPatchDir to leave WCHAR at %d untouched, was: %d\n", + n, Buffer[n]); + ok(hr == S_OK || hr == expect_hr, "Expected S_OK or 0x%x, was: 0x%x (at %d)\n", expect_hr, hr, n); + } +} +START_TEST(apphelp) +{ //SetEnvironmentVariable("SHIM_DEBUG_LEVEL", "4"); //SetEnvironmentVariable("DEBUGCHANNEL", "+apphelp"); - hdll = LoadLibraryA("apphelp.dll"); + silence_debug_output(); - pApphelpCheckShellObject = (void *) GetProcAddress(hdll, "ApphelpCheckShellObject"); - pSdbTagToString = (void *) GetProcAddress(hdll, "SdbTagToString"); - pSdbGUIDToString = (void *) GetProcAddress(hdll, "SdbGUIDToString"); - pSdbIsNullGUID = (void *) GetProcAddress(hdll, "SdbIsNullGUID"); - pSdbGetStandardDatabaseGUID = (void *) GetProcAddress(hdll, "SdbGetStandardDatabaseGUID"); - pSdbGetFileAttributes = (void *) GetProcAddress(hdll, "SdbGetFileAttributes"); - pSdbFreeFileAttributes = (void *) GetProcAddress(hdll, "SdbFreeFileAttributes"); + hdll = LoadLibraryA("apphelp.dll"); + g_WinVersion = get_module_version(hdll); + trace("Detected apphelp.dll version: 0x%x\n", g_WinVersion); + +#define RESOLVE(fnc) do { p##fnc = (void *) GetProcAddress(hdll, #fnc); ok(!!p##fnc, #fnc " not found.\n"); } while (0) + RESOLVE(ApphelpCheckShellObject); + RESOLVE(SdbTagToString); + RESOLVE(SdbGUIDToString); + RESOLVE(SdbIsNullGUID); + RESOLVE(SdbGetStandardDatabaseGUID); + RESOLVE(SdbGetFileAttributes); + RESOLVE(SdbFreeFileAttributes); + RESOLVE(SdbGetAppPatchDir); +#undef RESOLVE test_ApphelpCheckShellObject(); test_GuidFunctions(); test_ApplicationAttributes(); test_SdbTagToString(); -#ifdef __REACTOS__ - if (g_WinVersion < WINVER_WIN7) - { - g_WinVersion = WINVER_WIN7; - trace("Using version 0x%x for SdbTagToString tests\n", g_WinVersion); - } -#endif test_SdbTagToStringAllTags(); + if (pSdbGetAppPatchDir) + test_SdbGetAppPatchDir(); } diff --git a/modules/rostests/apitests/appshim/appshim_apitest.h b/modules/rostests/apitests/appshim/appshim_apitest.h index 1f3a0f6bb2..13f08f6b45 100644 --- a/modules/rostests/apitests/appshim/appshim_apitest.h +++ b/modules/rostests/apitests/appshim/appshim_apitest.h @@ -14,7 +14,7 @@ typedef struct tagHOOKAPI { PVOID Unk2; } HOOKAPI, *PHOOKAPI; -typedef BOOL (WINAPI* tSDBGETAPPPATCHDIR)(PVOID hsdb, LPWSTR path, DWORD size); +typedef HRESULT (WINAPI* tSDBGETAPPPATCHDIR)(PVOID hsdb, LPWSTR path, DWORD size); typedef PHOOKAPI (WINAPI* tGETHOOKAPIS)(LPCSTR szCommandLine, LPCWSTR wszShimName, PDWORD pdwHookCount); diff --git a/modules/rostests/apitests/appshim/versionlie.c b/modules/rostests/apitests/appshim/versionlie.c index 5322b8a03e..b36bfe5cf7 100644 --- a/modules/rostests/apitests/appshim/versionlie.c +++ b/modules/rostests/apitests/appshim/versionlie.c @@ -309,7 +309,7 @@ BOOL LoadShimDLL(PCWSTR ShimDll, HMODULE* module, tGETHOOKAPIS* ppGetHookAPIs) } } - if (!pSdbGetAppPatchDir || !pSdbGetAppPatchDir(NULL, buf, MAX_PATH)) + if (!pSdbGetAppPatchDir || !SUCCEEDED(pSdbGetAppPatchDir(NULL, buf, MAX_PATH))) { skip("Unable to retrieve AppPatch dir, building manually\n"); if (!GetSystemWindowsDirectoryW(buf, MAX_PATH))
6 years, 11 months
1
0
0
0
04/06: [APPSHIM_APITEST] Add test for shims in AcLayers
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4f4466ffd1efece8c6b7…
commit f4f4466ffd1efece8c6b7d42fe18986a143ed55c Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Mon Jan 8 22:58:42 2018 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Jan 21 21:13:08 2018 +0100 [APPSHIM_APITEST] Add test for shims in AcLayers --- modules/rostests/apitests/appshim/CMakeLists.txt | 1 + modules/rostests/apitests/appshim/layer_hooks.c | 128 +++++++++++++++++++++++ modules/rostests/apitests/appshim/testlist.c | 2 + 3 files changed, 131 insertions(+) diff --git a/modules/rostests/apitests/appshim/CMakeLists.txt b/modules/rostests/apitests/appshim/CMakeLists.txt index fa7a76527b..8884ce2606 100644 --- a/modules/rostests/apitests/appshim/CMakeLists.txt +++ b/modules/rostests/apitests/appshim/CMakeLists.txt @@ -4,6 +4,7 @@ add_definitions(-D__ROS_LONG64__) list(APPEND SOURCE dispmode.c genral_hooks.c + layer_hooks.c versionlie.c testlist.c appshim_apitest.h) diff --git a/modules/rostests/apitests/appshim/layer_hooks.c b/modules/rostests/apitests/appshim/layer_hooks.c new file mode 100644 index 0000000000..e47d9aad29 --- /dev/null +++ b/modules/rostests/apitests/appshim/layer_hooks.c @@ -0,0 +1,128 @@ +/* + * PROJECT: appshim_apitest + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Test to document the hooks used by various shims in AcLayers + * COPYRIGHT: Copyright 2018 Mark Jansen (mark.jansen(a)reactos.org) + */ + +#include <ntstatus.h> +#define WIN32_NO_STATUS +#include <windows.h> +#include <ndk/rtlfuncs.h> +#include <strsafe.h> +#include "wine/test.h" + +#include "appshim_apitest.h" + +static DWORD g_WinVersion; + + +typedef struct expect_shim_hook +{ + const char* Library; + const char* Function; +} expect_shim_hook; + +typedef struct expect_shim_data +{ + const WCHAR* ShimName; + DWORD MinVersion; + expect_shim_hook hooks[4]; +} expect_shim_data; + + +static expect_shim_data data[] = +{ + { + L"VerifyVersionInfoLite", + 0, + { + { "KERNEL32.DLL", "VerifyVersionInfoA" }, + { "KERNEL32.DLL", "VerifyVersionInfoW" }, + } + }, +}; + +static DWORD count_shims(expect_shim_data* data) +{ + DWORD num; + for (num = 0; num < _countof(data->hooks) && data->hooks[num].Library;) + { + ++num; + } + return num; +} + +static const char* safe_str(const char* ptr) +{ + static char buffer[2][30]; + static int index = 0; + if (HIWORD(ptr)) + return ptr; + + index ^= 1; + StringCchPrintfA(buffer[index], _countof(buffer[index]), "#%d", (int)ptr); + return buffer[index]; +} + +START_TEST(layer_hooks) +{ + RTL_OSVERSIONINFOEXW rtlinfo = {0}; + size_t n, h; + + tGETHOOKAPIS pGetHookAPIs = LoadShimDLL2(L"AcLayers.dll"); + if (!pGetHookAPIs) + return; + + rtlinfo.dwOSVersionInfoSize = sizeof(rtlinfo); + RtlGetVersion((PRTL_OSVERSIONINFOW)&rtlinfo); + g_WinVersion = (rtlinfo.dwMajorVersion << 8) | rtlinfo.dwMinorVersion; + + + + for (n = 0; n < _countof(data); ++n) + { + expect_shim_data* current = data + n; + DWORD num_shims = 0, expected_shims = count_shims(current); + + PHOOKAPI hook = pGetHookAPIs("", current->ShimName, &num_shims); + + if (current->MinVersion > g_WinVersion && !hook) + continue; + + ok(!!hook, "Expected a valid pointer, got nothing for %s\n", wine_dbgstr_w(current->ShimName)); + ok(num_shims == expected_shims, "Expected %u shims, got %u for %s\n", + expected_shims, num_shims, wine_dbgstr_w(current->ShimName)); + for (h = 0; h < min(num_shims, expected_shims); ++h) + { + expect_shim_hook* expect_hk = current->hooks + h; + PHOOKAPI got_hk = hook+h; + int lib = lstrcmpA(expect_hk->Library, got_hk->LibraryName); + int fn = lstrcmpA(safe_str(expect_hk->Function), safe_str(got_hk->FunctionName)); + ok(lib == 0, "Expected LibraryName to be %s, was: %s for %s\n", + expect_hk->Library, got_hk->LibraryName, wine_dbgstr_w(current->ShimName)); + ok(fn == 0, "Expected FunctionName to be %s, was: %s for %s\n", + safe_str(expect_hk->Function), safe_str(got_hk->FunctionName), wine_dbgstr_w(current->ShimName)); + } + if (num_shims > expected_shims) + { + for (h = expected_shims; h < num_shims; ++h) + { + PHOOKAPI got_hk = hook+h; + + ok(0, "Extra shim: %s!%s for %s\n", + got_hk->LibraryName, safe_str(got_hk->FunctionName), wine_dbgstr_w(current->ShimName)); + } + } + else + { + for (h = num_shims; h < expected_shims; ++h) + { + expect_shim_hook* expect_hk = current->hooks + h; + + ok(0, "Missing shim: %s!%s for %s\n", + expect_hk->Library, safe_str(expect_hk->Function), wine_dbgstr_w(current->ShimName)); + } + } + } +} diff --git a/modules/rostests/apitests/appshim/testlist.c b/modules/rostests/apitests/appshim/testlist.c index 2b2e692a3d..45275de5cd 100644 --- a/modules/rostests/apitests/appshim/testlist.c +++ b/modules/rostests/apitests/appshim/testlist.c @@ -5,12 +5,14 @@ extern void func_dispmode(void); extern void func_genral_hooks(void); +extern void func_layer_hooks(void); extern void func_versionlie(void); const struct test winetest_testlist[] = { { "dispmode", func_dispmode }, { "genral_hooks", func_genral_hooks }, + { "layer_hooks", func_layer_hooks }, { "versionlie", func_versionlie }, { 0, 0 } };
6 years, 11 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
38
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
Results per page:
10
25
50
100
200