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
May 2015
----- 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
428 discussions
Start a n
N
ew thread
Henri Verbeet : d3dcompiler: Rename "func" to "decl" in free_function_decl ().
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: bef432a19c9c2ae50b090ab9f01dd07ad5474f38 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bef432a19c9c2ae50b090ab9f…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 30 16:46:39 2015 +0200 d3dcompiler: Rename "func" to "decl" in free_function_decl(). Mostly just for consistency with other uses of struct hlsl_ir_function_decl. --- dlls/d3dcompiler_43/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 2d88975..83f815f 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -2445,12 +2445,12 @@ void free_instr(struct hlsl_ir_node *node) } } -static void free_function_decl(struct hlsl_ir_function_decl *func) +static void free_function_decl(struct hlsl_ir_function_decl *decl) { - d3dcompiler_free((void *)func->semantic); - d3dcompiler_free(func->parameters); - free_instr_list(func->body); - d3dcompiler_free(func); + d3dcompiler_free((void *)decl->semantic); + d3dcompiler_free(decl->parameters); + free_instr_list(decl->body); + d3dcompiler_free(decl); } static void free_function_decl_rb(struct wine_rb_entry *entry, void *context)
1
0
0
0
Henri Verbeet : d3dcompiler: Actually free the function in free_function() (Valgrind).
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: c05acba1687dc6c10e97f8b5611861af9375700a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c05acba1687dc6c10e97f8b56…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 30 16:46:38 2015 +0200 d3dcompiler: Actually free the function in free_function() (Valgrind). --- dlls/d3dcompiler_43/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 8de102f..2d88975 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -2462,6 +2462,7 @@ static void free_function(struct hlsl_ir_function *func) { wine_rb_destroy(&func->overloads, free_function_decl_rb, NULL); d3dcompiler_free((void *)func->name); + d3dcompiler_free(func); } void free_function_rb(struct wine_rb_entry *entry, void *context)
1
0
0
0
Henri Verbeet : d3dcompiler: Free the filename if we don' t store it in the HLSL preproc_directive rule (Valgrind).
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: 307cf703af34fe9c661890cbf368abb00fb68646 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=307cf703af34fe9c661890cbf…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Apr 30 16:46:37 2015 +0200 d3dcompiler: Free the filename if we don't store it in the HLSL preproc_directive rule (Valgrind). --- dlls/d3dcompiler_43/hlsl.y | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index f37e07e..80fe0e6 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1097,20 +1097,23 @@ hlsl_prog: /* empty */ preproc_directive: PRE_LINE STRING { + const char **new_array = NULL; + TRACE("Updating line information to file %s, line %u\n", debugstr_a($2), $1); hlsl_ctx.line_no = $1; if (strcmp($2, hlsl_ctx.source_file)) - { - const char **new_array; - - hlsl_ctx.source_file = $2; new_array = d3dcompiler_realloc(hlsl_ctx.source_files, sizeof(*hlsl_ctx.source_files) * hlsl_ctx.source_files_count + 1); - if (new_array) - { - hlsl_ctx.source_files = new_array; - hlsl_ctx.source_files[hlsl_ctx.source_files_count++] = $2; - } + + if (new_array) + { + hlsl_ctx.source_files = new_array; + hlsl_ctx.source_files[hlsl_ctx.source_files_count++] = $2; + hlsl_ctx.source_file = $2; + } + else + { + d3dcompiler_free($2); } }
1
0
0
0
Nikolay Sivov : explorer: Added stub IWebBrowser2 support for desktop shell window.
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: a74c56a3b942c1ef4ae3ce1e13f45d371bcfa9ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a74c56a3b942c1ef4ae3ce1e1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Apr 30 08:25:40 2015 +0300 explorer: Added stub IWebBrowser2 support for desktop shell window. --- dlls/shell32/tests/shelldispatch.c | 31 +- programs/explorer/desktop.c | 658 ++++++++++++++++++++++++++++++++++++- 2 files changed, 671 insertions(+), 18 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a74c56a3b942c1ef4ae3c…
1
0
0
0
Nikolay Sivov : shell32: Forward to CreateViewWindow3().
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: 06b60cc4d0874b301439b5cc1c6f8ab5ad7602af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06b60cc4d0874b301439b5cc1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 29 21:30:50 2015 +0300 shell32: Forward to CreateViewWindow3(). --- dlls/shell32/shlview.c | 127 ++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 70 deletions(-) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index d47e677..b26a2ce 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -1912,25 +1912,13 @@ static HRESULT WINAPI IShellView_fnRefresh(IShellView3 *iface) return S_OK; } -static HRESULT WINAPI IShellView_fnCreateViewWindow(IShellView3 *iface, IShellView *lpPrevView, - LPCFOLDERSETTINGS lpfs, IShellBrowser *psb, RECT *prcView, HWND *phWnd) +static HRESULT WINAPI IShellView_fnCreateViewWindow(IShellView3 *iface, IShellView *prev_view, + const FOLDERSETTINGS *settings, IShellBrowser *owner, RECT *rect, HWND *hWnd) { - HRESULT hr; - SV2CVW2_PARAMS view_params; - view_params.cbSize = sizeof(view_params); - view_params.psvPrev = lpPrevView; - view_params.pfs = lpfs; - view_params.psbOwner = psb; - view_params.prcView = prcView; - view_params.pvid = NULL; - view_params.hwndView = 0; - - TRACE("(%p) Forwarding to CreateViewWindow2\n", iface); - - hr = IShellView3_CreateViewWindow2(iface, &view_params); - *phWnd = view_params.hwndView; - - return hr; + IShellViewImpl *This = impl_from_IShellView3(iface); + TRACE("(%p)->(%p %p %p %p %p)\n", This, prev_view, settings, owner, rect, hWnd); + return IShellView3_CreateViewWindow3(iface, owner, prev_view, SV3CVW3_DEFAULT, + settings->fFlags, settings->fFlags, settings->ViewMode, NULL, rect, hWnd); } static HRESULT WINAPI IShellView_fnDestroyViewWindow(IShellView3 *iface) @@ -2041,51 +2029,74 @@ static HRESULT WINAPI IShellView2_fnGetView(IShellView3 *iface, SHELLVIEWID *vie static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView3 *iface, SV2CVW2_PARAMS *view_params) { IShellViewImpl *This = impl_from_IShellView3(iface); + TRACE("(%p)->(%p)\n", This, view_params); + return IShellView3_CreateViewWindow3(iface, view_params->psbOwner, view_params->psvPrev, + SV3CVW3_DEFAULT, view_params->pfs->fFlags, view_params->pfs->fFlags, + view_params->pfs->ViewMode, view_params->pvid, view_params->prcView, &view_params->hwndView); +} + +static HRESULT WINAPI IShellView2_fnHandleRename(IShellView3 *iface, LPCITEMIDLIST new_pidl) +{ + FIXME("(%p)->(new_pidl %p) stub!\n", iface, new_pidl); + return E_NOTIMPL; +} + +static HRESULT WINAPI IShellView2_fnSelectAndPositionItem(IShellView3 *iface, LPCITEMIDLIST item, + UINT flags, POINT *point) +{ + IShellViewImpl *This = impl_from_IShellView3(iface); + TRACE("(%p)->(item %p, flags %#x, point %p)\n", This, item, flags, point); + return IFolderView2_SelectAndPositionItems(&This->IFolderView2_iface, 1, &item, point, flags); +} + +static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShellBrowser *owner, + IShellView *prev_view, SV3CVW3_FLAGS view_flags, FOLDERFLAGS mask, FOLDERFLAGS flags, + FOLDERVIEWMODE mode, const SHELLVIEWID *view_id, const RECT *rect, HWND *hwnd) +{ + IShellViewImpl *This = impl_from_IShellView3(iface); INITCOMMONCONTROLSEX icex; WNDCLASSW wc; HRESULT hr; HWND wnd; - icex.dwSize = sizeof( icex ); - icex.dwICC = ICC_LISTVIEW_CLASSES; - InitCommonControlsEx( &icex ); + TRACE("(%p)->(%p %p 0x%08x 0x%08x 0x%08x %d %s %s %p)\n", This, owner, prev_view, view_flags, + mask, flags, mode, debugstr_guid(view_id), wine_dbgstr_rect(rect), hwnd); - TRACE("(%p)->(view_params %p)\n", iface, view_params); + icex.dwSize = sizeof(icex); + icex.dwICC = ICC_LISTVIEW_CLASSES; + InitCommonControlsEx(&icex); - if (view_params->cbSize != sizeof(*view_params)) - { - FIXME("Got unexpected cbSize %#x\n", view_params->cbSize); - return E_FAIL; - } + *hwnd = NULL; - TRACE("-- psvPrev %p, pfs %p, psbOwner %p, prcView %p\n", - view_params->psvPrev, view_params->pfs, view_params->psbOwner, view_params->prcView); - TRACE("-- vmode %#x, flags %#x, view %s\n", view_params->pfs->ViewMode, view_params->pfs->fFlags, wine_dbgstr_rect(view_params->prcView)); + if (!owner) + return E_UNEXPECTED; - if (!view_params->psbOwner) return E_UNEXPECTED; + if (view_flags != SV3CVW3_DEFAULT) + FIXME("unsupported view flags 0x%08x\n", view_flags); /* Set up the member variables */ - This->pShellBrowser = view_params->psbOwner; - This->FolderSettings = *view_params->pfs; + This->pShellBrowser = owner; + This->FolderSettings.ViewMode = mode; + This->FolderSettings.fFlags = mask & flags; - if (view_params->pvid) + if (view_id) { - if (IsEqualGUID(view_params->pvid, &VID_LargeIcons)) + if (IsEqualGUID(view_id, &VID_LargeIcons)) This->FolderSettings.ViewMode = FVM_ICON; - else if (IsEqualGUID(view_params->pvid, &VID_SmallIcons)) + else if (IsEqualGUID(view_id, &VID_SmallIcons)) This->FolderSettings.ViewMode = FVM_SMALLICON; - else if (IsEqualGUID(view_params->pvid, &VID_List)) + else if (IsEqualGUID(view_id, &VID_List)) This->FolderSettings.ViewMode = FVM_LIST; - else if (IsEqualGUID(view_params->pvid, &VID_Details)) + else if (IsEqualGUID(view_id, &VID_Details)) This->FolderSettings.ViewMode = FVM_DETAILS; - else if (IsEqualGUID(view_params->pvid, &VID_Thumbnails)) + else if (IsEqualGUID(view_id, &VID_Thumbnails)) This->FolderSettings.ViewMode = FVM_THUMBNAIL; - else if (IsEqualGUID(view_params->pvid, &VID_Tile)) + else if (IsEqualGUID(view_id, &VID_Tile)) This->FolderSettings.ViewMode = FVM_TILE; - else if (IsEqualGUID(view_params->pvid, &VID_ThumbStrip)) + else if (IsEqualGUID(view_id, &VID_ThumbStrip)) This->FolderSettings.ViewMode = FVM_THUMBSTRIP; else - FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_params->pvid)); + FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_id)); } /* Get our parent window */ @@ -2116,9 +2127,9 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView3 *iface, SV2CVW } wnd = CreateWindowExW(0, SV_CLASS_NAME, NULL, WS_CHILD | WS_TABSTOP, - view_params->prcView->left, view_params->prcView->top, - view_params->prcView->right - view_params->prcView->left, - view_params->prcView->bottom - view_params->prcView->top, + rect->left, rect->top, + rect->right - rect->left, + rect->bottom - rect->top, This->hWndParent, 0, shell32_hInstance, This); CheckToolbar(This); @@ -2132,35 +2143,11 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView3 *iface, SV2CVW SetWindowPos(wnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); UpdateWindow(wnd); - view_params->hwndView = wnd; + *hwnd = wnd; return S_OK; } -static HRESULT WINAPI IShellView2_fnHandleRename(IShellView3 *iface, LPCITEMIDLIST new_pidl) -{ - FIXME("(%p)->(new_pidl %p) stub!\n", iface, new_pidl); - return E_NOTIMPL; -} - -static HRESULT WINAPI IShellView2_fnSelectAndPositionItem(IShellView3 *iface, LPCITEMIDLIST item, - UINT flags, POINT *point) -{ - IShellViewImpl *This = impl_from_IShellView3(iface); - TRACE("(%p)->(item %p, flags %#x, point %p)\n", This, item, flags, point); - return IFolderView2_SelectAndPositionItems(&This->IFolderView2_iface, 1, &item, point, flags); -} - -static HRESULT WINAPI IShellView3_fnCreateViewWindow3(IShellView3 *iface, IShellBrowser *owner, - IShellView *prev_view, SV3CVW3_FLAGS view_flags, FOLDERFLAGS mask, FOLDERFLAGS flags, - FOLDERVIEWMODE mode, const SHELLVIEWID *view_id, const RECT *rect, HWND *hwnd) -{ - IShellViewImpl *This = impl_from_IShellView3(iface); - FIXME("(%p)->(%p %p 0x%08x 0x%08x 0x%08x %d %s %s %p): stub\n", This, owner, prev_view, view_flags, - mask, flags, mode, debugstr_guid(view_id), wine_dbgstr_rect(rect), hwnd); - return E_NOTIMPL; -} - static const IShellView3Vtbl shellviewvtbl = { IShellView_fnQueryInterface,
1
0
0
0
Nikolay Sivov : shell32: Update to IFolderView2.
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: e91dac5153cf8526fe39b7d8ef3d655f2720d698 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e91dac5153cf8526fe39b7d8e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 29 21:20:15 2015 +0300 shell32: Update to IFolderView2. --- dlls/actxprxy/usrmarshal.c | 18 ++ dlls/shell32/shlview.c | 380 ++++++++++++++++++++++++++++++++----------- dlls/shell32/tests/shlview.c | 6 + include/shobjidl.idl | 120 ++++++++++++++ 4 files changed, 431 insertions(+), 93 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e91dac5153cf8526fe39b…
1
0
0
0
Nikolay Sivov : dmime: COM cleanup for IDirectMusicAudioPath.
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: 02ab73beb19fa744cef03c05d845f1f1ead110f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02ab73beb19fa744cef03c05d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 27 10:49:11 2015 +0300 dmime: COM cleanup for IDirectMusicAudioPath. --- dlls/dmime/audiopath.c | 255 ++++++++++++++++++++++++++++--------------------- 1 file changed, 147 insertions(+), 108 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=02ab73beb19fa744cef03…
1
0
0
0
Hans Leidekker : wininet: Reuse cached basic authorization across sessions.
by Alexandre Julliard
01 May '15
01 May '15
Module: wine Branch: master Commit: 0b69c706b99edac1663e433e99699b51d1adf11c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b69c706b99edac1663e433e9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Apr 30 11:50:26 2015 +0200 wininet: Reuse cached basic authorization across sessions. --- dlls/wininet/http.c | 62 ++++++++++++++++++++++++++++++------------ dlls/wininet/tests/http.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 17 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 8a872e8..f91fd21 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -863,7 +863,7 @@ static void destroy_authinfo( struct HttpAuthInfo *authinfo ) heap_free(authinfo); } -static UINT retrieve_cached_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR *auth_data) +static UINT retrieve_cached_basic_authorization(const WCHAR *host, const WCHAR *realm, char **auth_data) { basicAuthorizationData *ad; UINT rc = 0; @@ -873,7 +873,7 @@ static UINT retrieve_cached_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR EnterCriticalSection(&authcache_cs); LIST_FOR_EACH_ENTRY(ad, &basicAuthorizationCache, basicAuthorizationData, entry) { - if (!strcmpiW(host,ad->host) && !strcmpW(realm,ad->realm)) + if (!strcmpiW(host, ad->host) && (!realm || !strcmpW(realm, ad->realm))) { TRACE("Authorization found in cache\n"); *auth_data = heap_alloc(ad->authorizationLen); @@ -1620,6 +1620,21 @@ static UINT HTTP_DecodeBase64( LPCWSTR base64, LPSTR bin ) return n; } +static WCHAR *encode_auth_data( const WCHAR *scheme, const char *data, UINT data_len ) +{ + WCHAR *ret; + UINT len, scheme_len = strlenW( scheme ); + + /* scheme + space + base64 encoded data (3/2/1 bytes data -> 4 bytes of characters) */ + len = scheme_len + 1 + ((data_len + 2) * 4) / 3; + if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL; + memcpy( ret, scheme, scheme_len * sizeof(WCHAR) ); + ret[scheme_len] = ' '; + HTTP_EncodeBase64( data, data_len, ret + scheme_len + 1 ); + return ret; +} + + /*********************************************************************** * HTTP_InsertAuthorization * @@ -1627,27 +1642,16 @@ static UINT HTTP_DecodeBase64( LPCWSTR base64, LPSTR bin ) */ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthInfo *pAuthInfo, LPCWSTR header ) { + static const WCHAR wszBasic[] = {'B','a','s','i','c',0}; + WCHAR *host, *authorization = NULL; + if (pAuthInfo) { - static const WCHAR wszSpace[] = {' ',0}; - static const WCHAR wszBasic[] = {'B','a','s','i','c',0}; - unsigned int len; - WCHAR *authorization = NULL; - if (pAuthInfo->auth_data_len) { - /* scheme + space + base64 encoded data (3/2/1 bytes data -> 4 bytes of characters) */ - len = strlenW(pAuthInfo->scheme)+1+((pAuthInfo->auth_data_len+2)*4)/3; - authorization = heap_alloc((len+1)*sizeof(WCHAR)); - if (!authorization) + if (!(authorization = encode_auth_data(pAuthInfo->scheme, pAuthInfo->auth_data, pAuthInfo->auth_data_len))) return FALSE; - strcpyW(authorization, pAuthInfo->scheme); - strcatW(authorization, wszSpace); - HTTP_EncodeBase64(pAuthInfo->auth_data, - pAuthInfo->auth_data_len, - authorization+strlenW(authorization)); - /* clear the data as it isn't valid now that it has been sent to the * server, unless it's Basic authentication which doesn't do * connection tracking */ @@ -1664,6 +1668,30 @@ static BOOL HTTP_InsertAuthorization( http_request_t *request, struct HttpAuthIn HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); heap_free(authorization); } + else if (!strcmpW(header, szAuthorization) && (host = get_host_header(request))) + { + UINT data_len; + char *data; + + if ((data_len = retrieve_cached_basic_authorization(host, NULL, &data))) + { + TRACE("Found cached basic authorization for %s\n", debugstr_w(host)); + + if (!(authorization = encode_auth_data(wszBasic, data, data_len))) + { + heap_free(data); + heap_free(host); + return FALSE; + } + + TRACE("Inserting authorization: %s\n", debugstr_w(authorization)); + + HTTP_ProcessHeader(request, header, authorization, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + heap_free(data); + heap_free(authorization); + } + heap_free(host); + } return TRUE; } diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 3e66a27..3b2f9a5 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2321,6 +2321,20 @@ static DWORD CALLBACK server_thread(LPVOID param) else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "HEAD /upload.txt")) + { + if (strstr(buffer, "Authorization: Basic dXNlcjpwd2Q=")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, noauthmsg, sizeof noauthmsg-1, 0); + } + if (strstr(buffer, "PUT /upload2.txt")) + { + if (strstr(buffer, "Authorization: Basic dXNlcjpwd2Q=")) + send(c, okmsg, sizeof okmsg-1, 0); + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } shutdown(c, 2); closesocket(c); c = -1; @@ -4212,6 +4226,59 @@ static void test_accept_encoding(int port) InternetCloseHandle(ses); } +static void test_basic_auth_credentials_reuse(int port) +{ + HINTERNET ses, con, req; + DWORD status, size; + BOOL ret; + + ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); + ok( ses != NULL, "InternetOpenA failed\n" ); + + con = InternetConnectA( ses, "localhost", port, "user", "pwd", + INTERNET_SERVICE_HTTP, 0, 0 ); + ok( con != NULL, "InternetConnectA failed %u\n", GetLastError() ); + + req = HttpOpenRequestA( con, "HEAD", "/upload.txt", 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() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); + ok( ret, "HttpQueryInfoA failed %u\n", GetLastError() ); + ok( status == 200, "got %u\n", status ); + + InternetCloseHandle( req ); + InternetCloseHandle( con ); + InternetCloseHandle( ses ); + + ses = InternetOpenA( "winetest", 0, 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, "PUT", "/upload2.txt", 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() ); + + status = 0xdeadbeef; + size = sizeof(status); + ret = HttpQueryInfoA( req, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); + ok( ret, "HttpQueryInfoA failed %u\n", GetLastError() ); + ok( status == 200, "got %u\n", status ); + + InternetCloseHandle( req ); + InternetCloseHandle( con ); + InternetCloseHandle( ses ); +} + static void test_http_connection(void) { struct server_info si; @@ -4259,6 +4326,7 @@ static void test_http_connection(void) test_head_request(si.port); test_request_content_length(si.port); test_accept_encoding(si.port); + test_basic_auth_credentials_reuse(si.port); /* send the basic request again to shutdown the server thread */ test_basic_request(si.port, "GET", "/quit");
1
0
0
0
← Newer
1
...
40
41
42
43
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
Results per page:
10
25
50
100
200