winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
892 discussions
Start a n
N
ew thread
Hans Leidekker : msi: Downgrade a warning.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: d8b7a2099e696c9f479220aa440a9c03f2b1e594 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8b7a2099e696c9f479220aa4…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jul 22 11:47:30 2010 +0200 msi: Downgrade a warning. --- dlls/msi/classes.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c index 019ac06..30ee36b 100644 --- a/dlls/msi/classes.c +++ b/dlls/msi/classes.c @@ -1149,7 +1149,7 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package ) res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid->ProgID ); if (res != ERROR_SUCCESS) - WARN("Failed to delete progid key %d\n", res); + TRACE("Failed to delete progid key %d\n", res); uirow = MSI_CreateRecord( 1 ); MSI_RecordSetStringW( uirow, 1, progid->ProgID );
1
0
0
0
Hans Leidekker : msi: Make sure properties are updated after applying a patch.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 06afeec2a5cd7cf49842e9f245fc157835097a9a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06afeec2a5cd7cf49842e9f24…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Jul 22 11:47:13 2010 +0200 msi: Make sure properties are updated after applying a patch. --- dlls/msi/action.c | 3 ++ dlls/msi/msipriv.h | 1 + dlls/msi/package.c | 79 ++++++++++++++++++++++++++++++++++-------------- dlls/msi/tests/patch.c | 14 ++++++++- 4 files changed, 73 insertions(+), 24 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 702a92a..29071d0 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -7536,6 +7536,9 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, /* properties may have been added by a transform */ msi_clone_properties( package ); + + msi_parse_command_line( package, szCommandLine, FALSE ); + msi_adjust_allusers_property( package ); msi_set_context( package ); if (needs_ui_sequence( package)) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index bdb1884..0be3eb9 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -765,6 +765,7 @@ extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR); extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR); extern UINT msi_clone_properties(MSIPACKAGE *); extern UINT msi_set_context(MSIPACKAGE *); +extern void msi_adjust_allusers_property(MSIPACKAGE *); extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT); /* for deformating */ diff --git a/dlls/msi/package.c b/dlls/msi/package.c index bff1bb4..d332168 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -324,57 +324,85 @@ static UINT create_temp_property_table(MSIPACKAGE *package) UINT msi_clone_properties(MSIPACKAGE *package) { - MSIQUERY *view = NULL; + MSIQUERY *view_select = NULL; UINT rc; - static const WCHAR Query[] = { + static const WCHAR query_select[] = { 'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ','`','P','r','o','p','e','r','t','y','`',0}; - static const WCHAR Insert[] = { + static const WCHAR query_insert[] = { 'I','N','S','E','R','T',' ','i','n','t','o',' ', '`','_','P','r','o','p','e','r','t','y','`',' ', '(','`','_','P','r','o','p','e','r','t','y','`',',', '`','V','a','l','u','e','`',')',' ', 'V','A','L','U','E','S',' ','(','?',',','?',')',0}; + static const WCHAR query_update[] = { + 'U','P','D','A','T','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ', + 'S','E','T',' ','`','V','a','l','u','e','`',' ','=',' ','?',' ', + 'W','H','E','R','E',' ','`','_','P','r','o','p','e','r','t','y','`',' ','=',' ','?',0}; - /* clone the existing properties */ - rc = MSI_DatabaseOpenViewW(package->db, Query, &view); + rc = MSI_DatabaseOpenViewW( package->db, query_select, &view_select ); if (rc != ERROR_SUCCESS) return rc; - rc = MSI_ViewExecute(view, 0); + rc = MSI_ViewExecute( view_select, 0 ); if (rc != ERROR_SUCCESS) { - MSI_ViewClose(view); - msiobj_release(&view->hdr); + MSI_ViewClose( view_select ); + msiobj_release( &view_select->hdr ); return rc; } while (1) { - MSIRECORD *row; - MSIQUERY *view2; + MSIQUERY *view_insert, *view_update; + MSIRECORD *rec_select; - rc = MSI_ViewFetch(view, &row); + rc = MSI_ViewFetch( view_select, &rec_select ); if (rc != ERROR_SUCCESS) break; - rc = MSI_DatabaseOpenViewW(package->db, Insert, &view2); + rc = MSI_DatabaseOpenViewW( package->db, query_insert, &view_insert ); if (rc != ERROR_SUCCESS) { - msiobj_release(&row->hdr); + msiobj_release( &rec_select->hdr ); continue; } - MSI_ViewExecute(view2, row); - MSI_ViewClose(view2); - msiobj_release(&view2->hdr); - msiobj_release(&row->hdr); - } + rc = MSI_ViewExecute( view_insert, rec_select ); + MSI_ViewClose( view_insert ); + msiobj_release( &view_insert->hdr ); + if (rc != ERROR_SUCCESS) + { + MSIRECORD *rec_update; - MSI_ViewClose(view); - msiobj_release(&view->hdr); + TRACE("insert failed, trying update\n"); + + rc = MSI_DatabaseOpenViewW( package->db, query_update, &view_update ); + if (rc != ERROR_SUCCESS) + { + WARN("open view failed %u\n", rc); + msiobj_release( &rec_select->hdr ); + continue; + } + + rec_update = MSI_CreateRecord( 2 ); + MSI_RecordCopyField( rec_select, 1, rec_update, 2 ); + MSI_RecordCopyField( rec_select, 2, rec_update, 1 ); + rc = MSI_ViewExecute( view_update, rec_update ); + if (rc != ERROR_SUCCESS) + WARN("update failed %u\n", rc); + + MSI_ViewClose( view_update ); + msiobj_release( &view_update->hdr ); + msiobj_release( &rec_update->hdr ); + } + + msiobj_release( &rec_select->hdr ); + } + MSI_ViewClose( view_select ); + msiobj_release( &view_select->hdr ); return rc; } @@ -1014,7 +1042,7 @@ static UINT msi_load_admin_properties(MSIPACKAGE *package) return r; } -static void adjust_allusers_property( MSIPACKAGE *package ) +void msi_adjust_allusers_property( MSIPACKAGE *package ) { /* FIXME: this should depend on the user's privileges */ if (msi_get_property_int( package->db, szAllUsers, 0 ) == 2) @@ -1046,6 +1074,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) create_temp_property_table( package ); msi_clone_properties( package ); + msi_adjust_allusers_property( package ); package->ProductCode = msi_dup_property( package->db, szProductCode ); package->script = msi_alloc_zero( sizeof(MSISCRIPT) ); @@ -1065,8 +1094,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) if (package->WordCount & msidbSumInfoSourceTypeAdminImage) msi_load_admin_properties( package ); - - adjust_allusers_property( package ); } return package; @@ -1378,6 +1405,12 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) index++; } + if (index) + { + msi_clone_properties( package ); + msi_adjust_allusers_property( package ); + } + *pPackage = package; return ERROR_SUCCESS; } diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c index 6b4faf1..2453e99 100644 --- a/dlls/msi/tests/patch.c +++ b/dlls/msi/tests/patch.c @@ -681,7 +681,7 @@ static void test_simple_patch( void ) { UINT r; DWORD size; - char path[MAX_PATH], install_source[MAX_PATH]; + char path[MAX_PATH], install_source[MAX_PATH], buffer[32]; const char *query; MSIHANDLE hpackage, hdb, hview, hrec; @@ -753,6 +753,12 @@ static void test_simple_patch( void ) MsiViewClose( hview ); MsiCloseHandle( hview ); + buffer[0] = 0; + size = sizeof(buffer); + r = MsiGetProperty( hpackage, "PATCHNEWSUMMARYSUBJECT", buffer, &size ); + ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + ok( !strcmp( buffer, "Installer Database" ), "expected \'Installer Database\', got \'%s\'\n", buffer ); + MsiCloseHandle( hdb ); MsiCloseHandle( hpackage ); @@ -805,6 +811,12 @@ static void test_simple_patch( void ) MsiViewClose( hview ); MsiCloseHandle( hview ); + buffer[0] = 0; + size = sizeof(buffer); + r = MsiGetProperty( hpackage, "PATCHNEWSUMMARYSUBJECT", buffer, &size ); + ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + ok( !strcmp( buffer, "Installation Database" ), "expected \'Installation Database\', got \'%s\'\n", buffer ); + MsiCloseHandle( hdb ); MsiCloseHandle( hpackage );
1
0
0
0
Dmitry Timoshkov : comctl32: Make sure that the focus is set to an existing property sheet button.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 1bf5e12e9593b7c8cfd14a2c114c17371737f2c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1bf5e12e9593b7c8cfd14a2c1…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Jul 22 17:50:41 2010 +0900 comctl32: Make sure that the focus is set to an existing property sheet button. --- dlls/comctl32/propsheet.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 45c7fe3..3e313ba 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -3411,9 +3411,14 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) psInfo->hwnd = hwnd; SetWindowLongPtrW(hwnd, DWLP_USER, (DWORD_PTR)psInfo); - /* set up the Next and Back buttons by default */ - PROPSHEET_SetWizButtons(hwnd, PSWIZB_BACK|PSWIZB_NEXT); - SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); + if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) + { + /* set up the Next and Back buttons by default */ + PROPSHEET_SetWizButtons(hwnd, PSWIZB_BACK|PSWIZB_NEXT); + SetFocus(GetDlgItem(hwnd, IDC_NEXT_BUTTON)); + } + else + SetFocus(GetDlgItem(hwnd, IDOK)); /* Set up fonts */ SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
1
0
0
0
Piotr Caban : shlwapi: Improved UrlCanonicalizeW implementation.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: b7c68573ae5603ac28d268b52a78bc4b2093e5ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7c68573ae5603ac28d268b52…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jul 22 09:39:30 2010 +0200 shlwapi: Improved UrlCanonicalizeW implementation. --- dlls/shlwapi/tests/url.c | 4 +++ dlls/shlwapi/url.c | 50 +++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 52bba21..adaba9f 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -100,6 +100,8 @@ typedef struct _TEST_URL_CANONICALIZE { static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { {"
http://www.winehq.org/tests/../tests/../
..", 0, S_OK, "
http://www.winehq.org/
", TRUE}, + {"
http://www.winehq.org/
..", 0, S_OK, "
http://www.winehq.org/
..", FALSE}, + {"
http://www.winehq.org/tests/tests2/../../tests
", 0, S_OK, "
http://www.winehq.org/tests
", FALSE}, {"
http://www.winehq.org/tests/../tests
", 0, S_OK, "
http://www.winehq.org/tests
", FALSE}, {"
http://www.winehq.org/tests\n
", URL_WININET_COMPATIBILITY|URL_ESCAPE_SPACES_ONLY|URL_ESCAPE_UNSAFE, S_OK, "
http://www.winehq.org/tests
", FALSE}, {"
http://www.winehq.org/tests\r
", URL_WININET_COMPATIBILITY|URL_ESCAPE_SPACES_ONLY|URL_ESCAPE_UNSAFE, S_OK, "
http://www.winehq.org/tests
", FALSE}, @@ -158,6 +160,8 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { {"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_FILE_USE_PATHURL, S_OK, "res://c:\\tests/res\\foo%20bar/strange\\sth", FALSE}, {"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_UNESCAPE, S_OK, "res://c:\\tests/res\\foo bar/strange\\sth", FALSE}, {"A", 0, S_OK, "A", FALSE}, + {"../A", 0, S_OK, "../A", FALSE}, + {"A/../B", 0, S_OK, "B", TRUE}, {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/, {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, {"
http://localhost/test.html
", URL_FILE_USE_PATHURL, S_OK, "
http://localhost/test.html
"}, diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 7ca4cf7..2f09bc7 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -444,38 +444,38 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, *wk2++ = *wk1; wk1++; - if (*wk1 == '.') { + while (*wk1 == '.') { TRACE("found '/.'\n"); if (wk1[1] == '/' || wk1[1] == '\\') { /* case of /./ -> skip the ./ */ wk1 += 2; } - else if (wk1[1] == '.') { - /* found /.. look for next / */ - TRACE("found '/..'\n"); - if (wk1[2] == '/' || wk1[2] == '\\' ||wk1[2] == '?' - || wk1[2] == '#' || !wk1[2]) { - /* case /../ -> need to backup wk2 */ - TRACE("found '/../'\n"); - *(wk2-1) = '\0'; /* set end of string */ - mp = strrchrW(root, '/'); - mp2 = strrchrW(root, '\\'); - if(mp2 && (!mp || mp2 < mp)) - mp = mp2; - if (mp && (mp >= root)) { - /* found valid backup point */ - wk2 = mp + 1; - if(wk1[2] != '/' && wk1[2] != '\\') - wk1 += 2; - else - wk1 += 3; - } - else { - /* did not find point, restore '/' */ - *(wk2-1) = slash; - } + else if (wk1[1] == '.' && (wk1[2] == '/' + || wk1[2] == '\\' || wk1[2] == '?' + || wk1[2] == '#' || !wk1[2])) { + /* case /../ -> need to backup wk2 */ + TRACE("found '/../'\n"); + *(wk2-1) = '\0'; /* set end of string */ + mp = strrchrW(root, '/'); + mp2 = strrchrW(root, '\\'); + if(mp2 && (!mp || mp2 < mp)) + mp = mp2; + if (mp && (mp >= root)) { + /* found valid backup point */ + wk2 = mp + 1; + if(wk1[2] != '/' && wk1[2] != '\\') + wk1 += 2; + else + wk1 += 3; + } + else { + /* did not find point, restore '/' */ + *(wk2-1) = slash; + break; } } + else + break; } } *wk2 = '\0';
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUri_GetPassword.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 20017183d367063784b4b3964e7bcbe5bc143cfd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=20017183d367063784b4b3964…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sat Jun 19 23:53:37 2010 -0400 urlmon: Implemented IUri_GetPassword. --- dlls/urlmon/tests/uri.c | 64 +++++++++++++++++++++++----------------------- dlls/urlmon/uri.c | 28 +++++++++++++++----- 2 files changed, 53 insertions(+), 39 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=20017183d367063784b4b…
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUri_GetUserName.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 50db65a43f14f2a925f26a63c4ef14bc61ccf4a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=50db65a43f14f2a925f26a63c…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sat Jun 19 23:41:46 2010 -0400 urlmon: Implemented IUri_GetUserName. --- dlls/urlmon/tests/uri.c | 64 +++++++++++++++++++++++----------------------- dlls/urlmon/uri.c | 34 +++++++++++++++++++----- 2 files changed, 59 insertions(+), 39 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=50db65a43f14f2a925f26…
1
0
0
0
Thomas Mullaly : urlmon: Implemented IUri_GetUserInfo.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 152a1efdae7ca0d58f85a875e7038b66025d982c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=152a1efdae7ca0d58f85a875e…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Thu Jun 17 19:38:23 2010 -0400 urlmon: Implemented IUri_GetUserInfo. --- dlls/urlmon/tests/uri.c | 64 +++++++++++++++++++++++----------------------- dlls/urlmon/uri.c | 26 ++++++++++++++----- 2 files changed, 51 insertions(+), 39 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=152a1efdae7ca0d58f85a…
1
0
0
0
Thomas Mullaly : urlmon/tests: Added more test URI's.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 520902cb169c629c282f7faf85fd6e560e018e25 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=520902cb169c629c282f7faf8…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Thu Jun 17 19:26:53 2010 -0400 urlmon/tests: Added more test URI's. --- dlls/urlmon/tests/uri.c | 335 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 335 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=520902cb169c629c282f7…
1
0
0
0
Thomas Mullaly : urlmon: Implemented the canonicalization routine for the userinfo of a URI.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: eff59a51072d172f9d0c9c867a6f4d7c4ca772b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eff59a51072d172f9d0c9c867…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Thu Jun 17 15:58:17 2010 -0400 urlmon: Implemented the canonicalization routine for the userinfo of a URI. --- dlls/urlmon/uri.c | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 190 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 0942d8a..f8d99a8 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -38,6 +38,10 @@ typedef struct { INT scheme_start; DWORD scheme_len; URL_SCHEME scheme_type; + + INT userinfo_start; + DWORD userinfo_len; + INT userinfo_split; } Uri; typedef struct { @@ -61,6 +65,8 @@ typedef struct { INT userinfo_split; } parse_data; +static const CHAR hexDigits[] = "0123456789ABCDEF"; + /* List of scheme types/scheme names that are recognized by the IUri interface as of IE 7. */ static const struct { URL_SCHEME scheme; @@ -161,12 +167,64 @@ static inline BOOL is_auth_delim(WCHAR val, BOOL acceptSlash) { val == '\0' || (acceptSlash && val == '\\')); } +/* reserved = gen-delims / sub-delims */ +static inline BOOL is_reserved(WCHAR val) { + return (is_subdelim(val) || is_gendelim(val)); +} + static inline BOOL is_hexdigit(WCHAR val) { return ((val >= 'a' && val <= 'f') || (val >= 'A' && val <= 'F') || (val >= '0' && val <= '9')); } +/* Taken from dlls/jscript/lex.c */ +static int hex_to_int(WCHAR val) { + if(val >= '0' && val <= '9') + return val - '0'; + else if(val >= 'a' && val <= 'f') + return val - 'a' + 10; + else if(val >= 'A' && val <= 'F') + return val - 'A' + 10; + + return -1; +} + +/* Helper function for converting a percent encoded string + * representation of a WCHAR value into its actual WCHAR value. If + * the two characters following the '%' aren't valid hex values then + * this function returns the NULL character. + * + * Eg. + * "%2E" will result in '.' being returned by this function. + */ +static WCHAR decode_pct_val(const WCHAR *ptr) { + WCHAR ret = '\0'; + + if(*ptr == '%' && is_hexdigit(*(ptr + 1)) && is_hexdigit(*(ptr + 2))) { + INT a = hex_to_int(*(ptr + 1)); + INT b = hex_to_int(*(ptr + 2)); + + ret = a << 4; + ret += b; + } + + return ret; +} + +/* Helper function for percent encoding a given character + * and storing the encoded value into a given buffer (dest). + * + * It's up to the calling function to ensure that there is + * at least enough space in 'dest' for the percent encoded + * value to be stored (so dest + 3 spaces available). + */ +static inline void pct_encode_val(WCHAR val, WCHAR *dest) { + dest[0] = '%'; + dest[1] = hexDigits[(val >> 4) & 0xf]; + dest[2] = hexDigits[val & 0xf]; +} + /* Checks if the characters pointed to by 'ptr' are * a percent encoded data octet. * @@ -488,6 +546,126 @@ static BOOL parse_uri(parse_data *data, DWORD flags) { return TRUE; } +/* Canonicalizes the userinfo of the URI represented by the parse_data. + * + * Canonicalization of the userinfo is a simple process. If there are any percent + * encoded characters that fall in the "unreserved" character set, they are decoded + * to their actual value. If a character is not in the "unreserved" or "reserved" sets + * then it is percent encoded. Other than that the characters are copied over without + * change. + */ +static BOOL canonicalize_userinfo(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { + DWORD i = 0; + + uri->userinfo_start = uri->userinfo_split = -1; + uri->userinfo_len = 0; + + if(!data->userinfo) + /* URI doesn't have userinfo, so nothing to do here. */ + return TRUE; + + uri->userinfo_start = uri->canon_len; + + while(i < data->userinfo_len) { + if(data->userinfo[i] == ':' && uri->userinfo_split == -1) + /* Windows only considers the first ':' as the delimiter. */ + uri->userinfo_split = uri->canon_len - uri->userinfo_start; + else if(data->userinfo[i] == '%') { + /* Only decode % encoded values for known scheme types. */ + if(data->scheme_type != URL_SCHEME_UNKNOWN) { + /* See if the value really needs decoded. */ + WCHAR val = decode_pct_val(data->userinfo + i); + if(is_unreserved(val)) { + if(!computeOnly) + uri->canon_uri[uri->canon_len] = val; + + ++uri->canon_len; + + /* Move pass the hex characters. */ + i += 3; + continue; + } + } + } else if(!is_reserved(data->userinfo[i]) && !is_unreserved(data->userinfo[i]) && + data->userinfo[i] != '\\') { + /* Only percent encode forbidden characters if the NO_ENCODE_FORBIDDEN_CHARACTERS flag + * is NOT set. + */ + if(!(flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS)) { + if(!computeOnly) + pct_encode_val(data->userinfo[i], uri->canon_uri + uri->canon_len); + + uri->canon_len += 3; + ++i; + continue; + } + } + + if(!computeOnly) + /* Nothing special, so just copy the character over. */ + uri->canon_uri[uri->canon_len] = data->userinfo[i]; + + ++uri->canon_len; + ++i; + } + + uri->userinfo_len = uri->canon_len - uri->userinfo_start; + if(!computeOnly) + TRACE("(%p %p %x %d): Canonicalized userinfo, userinfo_start=%d, userinfo=%s, userinfo_split=%d userinfo_len=%d.\n", + data, uri, flags, computeOnly, uri->userinfo_start, debugstr_wn(uri->canon_uri + uri->userinfo_start, uri->userinfo_len), + uri->userinfo_split, uri->userinfo_len); + + /* Now insert the '@' after the userinfo. */ + if(!computeOnly) + uri->canon_uri[uri->canon_len] = '@'; + + ++uri->canon_len; + return TRUE; +} + +/* Canonicalizes the authority of the URI represented by the parse_data. */ +static BOOL canonicalize_authority(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { + if(!canonicalize_userinfo(data, uri, flags, computeOnly)) + return FALSE; + + /* TODO: canonicalize the host and port information. */ + + return TRUE; +} + +/* Determines how the URI represented by the parse_data should be canonicalized. + * + * Essentially, if the parse_data represents an hierarchical URI then it calls + * canonicalize_authority and the canonicalization functions for the path. If the + * URI is opaque it canonicalizes the path of the URI. + */ +static BOOL canonicalize_hierpart(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { + if(!data->is_opaque) { + /* "//" is only added for non-wildcard scheme types. */ + if(data->scheme_type != URL_SCHEME_WILDCARD) { + if(!computeOnly) { + INT pos = uri->canon_len; + + uri->canon_uri[pos] = '/'; + uri->canon_uri[pos+1] = '/'; + } + uri->canon_len += 2; + } + + if(!canonicalize_authority(data, uri, flags, computeOnly)) + return FALSE; + + /* TODO: Canonicalize the path of the URI. */ + + } else { + /* Opaque URI's don't have userinfo. */ + uri->userinfo_start = uri->userinfo_split = -1; + uri->userinfo_len = 0; + } + + return TRUE; +} + /* Canonicalizes the scheme information specified in the parse_data using the specified flags. */ static BOOL canonicalize_scheme(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { uri->scheme_start = -1; @@ -519,7 +697,7 @@ static BOOL canonicalize_scheme(const parse_data *data, Uri *uri, DWORD flags, B debugstr_wn(uri->canon_uri, uri->scheme_len), data->scheme_len); } - /* This happens in both compute only and non-compute only. */ + /* This happens in both computation modes. */ uri->canon_len += data->scheme_len + 1; uri->scheme_len = data->scheme_len; } @@ -545,6 +723,11 @@ static int compute_canonicalized_length(const parse_data *data, DWORD flags) { return -1; } + if(!canonicalize_hierpart(data, &uri, flags, TRUE)) { + ERR("(%p %x): Failed to compute URI hierpart length.\n", data, flags); + return -1; + } + TRACE("(%p %x): Finished computing canonicalized URI length. length=%d\n", data, flags, uri.canon_len); return uri.canon_len; @@ -585,6 +768,12 @@ static HRESULT canonicalize_uri(const parse_data *data, Uri *uri, DWORD flags) { } uri->scheme_type = data->scheme_type; + if(!canonicalize_hierpart(data, uri, flags, FALSE)) { + ERR("(%p %p %x): Unable to canonicalize the heirpart of the URI\n", data, uri, flags); + heap_free(uri->canon_uri); + return E_INVALIDARG; + } + uri->canon_uri[uri->canon_len] = '\0'; TRACE("(%p %p %x): finished canonicalizing the URI.\n", data, uri, flags);
1
0
0
0
Thomas Mullaly : urlmon: Implemented parser for the userinfo of a URI.
by Alexandre Julliard
22 Jul '10
22 Jul '10
Module: wine Branch: master Commit: 9590fef417b7f477dfa415b6bd6f2ef375c38169 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9590fef417b7f477dfa415b6b…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Wed Jun 16 19:48:23 2010 -0400 urlmon: Implemented parser for the userinfo of a URI. --- dlls/urlmon/tests/uri.c | 31 ++++++++++ dlls/urlmon/uri.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 178 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index d674925..c309d19 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -853,6 +853,37 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_UNKNOWN,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* Windows uses the first occurence of ':' to delimit the userinfo. */ + { "ftp://user:pass:word@winehq.org/", 0, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN| + Uri_HAS_HOST|Uri_HAS_PASSWORD|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI| + Uri_HAS_SCHEME_NAME|Uri_HAS_USER_INFO|Uri_HAS_USER_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_PORT| + Uri_HAS_SCHEME, + TRUE, + { + {"ftp://user:pass:word@winehq.org/",S_OK,TRUE}, + {"user:pass:word@winehq.org",S_OK,TRUE}, + {"
ftp://winehq.org/
",S_OK,TRUE}, + {"
winehq.org
",S_OK,TRUE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,TRUE}, + {"
winehq.org
",S_OK,TRUE}, + {"pass:word",S_OK,TRUE}, + {"/",S_OK,TRUE}, + {"/",S_OK,TRUE}, + {"",S_FALSE,TRUE}, + {"ftp://user:pass:word@winehq.org/",S_OK,FALSE}, + {"ftp",S_OK,FALSE}, + {"user:pass:word",S_OK,TRUE}, + {"user",S_OK,TRUE} + }, + { + {Uri_HOST_DNS,S_OK,TRUE}, + {21,S_OK,TRUE}, + {URL_SCHEME_FTP,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index d8ff2cb..0942d8a 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -55,6 +55,10 @@ typedef struct { const WCHAR *scheme; DWORD scheme_len; URL_SCHEME scheme_type; + + const WCHAR *userinfo; + DWORD userinfo_len; + INT userinfo_split; } parse_data; /* List of scheme types/scheme names that are recognized by the IUri interface as of IE 7. */ @@ -125,6 +129,71 @@ static BOOL check_hierarchical(const WCHAR **ptr) { return TRUE; } +/* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" */ +static inline BOOL is_unreserved(WCHAR val) { + return (is_alpha(val) || is_num(val) || val == '-' || val == '.' || + val == '_' || val == '~'); +} + +/* sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +static inline BOOL is_subdelim(WCHAR val) { + return (val == '!' || val == '$' || val == '&' || + val == '\'' || val == '(' || val == ')' || + val == '*' || val == '+' || val == ',' || + val == ';' || val == '='); +} + +/* gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" */ +static inline BOOL is_gendelim(WCHAR val) { + return (val == ':' || val == '/' || val == '?' || + val == '#' || val == '[' || val == ']' || + val == '@'); +} + +/* Characters that delimit the end of the authority + * section of a URI. Sometimes a '\\' is considered + * an authority delimeter. + */ +static inline BOOL is_auth_delim(WCHAR val, BOOL acceptSlash) { + return (val == '#' || val == '/' || val == '?' || + val == '\0' || (acceptSlash && val == '\\')); +} + +static inline BOOL is_hexdigit(WCHAR val) { + return ((val >= 'a' && val <= 'f') || + (val >= 'A' && val <= 'F') || + (val >= '0' && val <= '9')); +} + +/* Checks if the characters pointed to by 'ptr' are + * a percent encoded data octet. + * + * pct-encoded = "%" HEXDIG HEXDIG + */ +static BOOL check_pct_encoded(const WCHAR **ptr) { + const WCHAR *start = *ptr; + + if(**ptr != '%') + return FALSE; + + ++(*ptr); + if(!is_hexdigit(**ptr)) { + *ptr = start; + return FALSE; + } + + ++(*ptr); + if(!is_hexdigit(**ptr)) { + *ptr = start; + return FALSE; + } + + ++(*ptr); + return TRUE; +} + /* Tries to parse the scheme name of the URI. * * scheme = ALPHA *(ALPHA | NUM | '+' | '-' | '.') as defined by RFC 3896. @@ -259,6 +328,80 @@ static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags) { return TRUE; } +/* Parses the userinfo part of the URI (if it exists). The userinfo field of + * a URI can consist of "username:password@", or just "username@". + * + * RFC def: + * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) + * + * NOTES: + * 1) If there is more than one ':' in the userinfo part of the URI Windows + * uses the first occurence of ':' to delimit the username and password + * components. + * + * ex: + * ftp://user:pass:word@winehq.org + * + * Would yield, "user" as the username and "pass:word" as the password. + * + * 2) Windows allows any character to appear in the "userinfo" part of + * a URI, as long as it's not an authority delimeter character set. + */ +static void parse_userinfo(const WCHAR **ptr, parse_data *data, DWORD flags) { + data->userinfo = *ptr; + data->userinfo_split = -1; + + while(**ptr != '@') { + if(**ptr == ':' && data->userinfo_split == -1) + data->userinfo_split = *ptr - data->userinfo; + else if(**ptr == '%') { + /* If it's a known scheme type, it has to be a valid percent + * encoded value. + */ + if(!check_pct_encoded(ptr)) { + if(data->scheme_type != URL_SCHEME_UNKNOWN) { + *ptr = data->userinfo; + data->userinfo = NULL; + data->userinfo_split = -1; + + TRACE("(%p %p %x): URI contained no userinfo.\n", ptr, data, flags); + return; + } + } else + continue; + } else if(is_auth_delim(**ptr, data->scheme_type != URL_SCHEME_UNKNOWN)) + break; + + ++(*ptr); + } + + if(**ptr != '@') { + *ptr = data->userinfo; + data->userinfo = NULL; + data->userinfo_split = -1; + + TRACE("(%p %p %x): URI contained no userinfo.\n", ptr, data, flags); + return; + } + + data->userinfo_len = *ptr - data->userinfo; + TRACE("(%p %p %x): Found userinfo=%s userinfo_len=%d split=%d.\n", ptr, data, flags, + debugstr_wn(data->userinfo, data->userinfo_len), data->userinfo_len, data->userinfo_split); + ++(*ptr); +} + +/* Parses the authority information from the URI. + * + * authority = [ userinfo "@" ] host [ ":" port ] + */ +static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) { + parse_userinfo(ptr, data, flags); + + /* TODO: Parse host and port information. */ + + return TRUE; +} + /* Determines how the URI should be parsed after the scheme information. * * If the scheme is followed, by "//" then, it is treated as an hierarchical URI @@ -266,7 +409,7 @@ static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags) { * URI will be treated as an opaque URI which the authority information is not parsed * out. * - * RFC 3896 defenition of hier-part: + * RFC 3896 definition of hier-part: * * hier-part = "//" authority path-abempty * / path-absolute @@ -303,6 +446,9 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) { data->is_opaque = FALSE; /* TODO: Handle hierarchical URI's, parse authority then parse the path. */ + if(!parse_authority(ptr, data, flags)) + return FALSE; + return TRUE; } }
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200