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
February 2022
----- 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
1495 discussions
Start a n
N
ew thread
Eric Pouech : comdlg32: Removed useless casts to long.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 0c0f80a33357bc670a4d4096473fc92d3a1b57a8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c0f80a33357bc670a4d4096…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:05:51 2022 +0100 comdlg32: Removed useless casts to long. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/colordlg.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index d5254736b24..1d459dd2d87 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -340,7 +340,7 @@ static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *ver HWND hwnd; POINT point; RECT rect; - long x,y; + int x,y; CONV_LPARAMTOPOINT(lParam, &point); ClientToScreen(hDlg, &point); @@ -353,10 +353,8 @@ static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *ver GetClientRect(hwnd, &rect); ScreenToClient(hwnd, &point); - x = (long) point.x * MAXHORI; - x /= rect.right; - y = (long) (rect.bottom - point.y) * MAXVERT; - y /= rect.bottom; + x = (point.x * MAXHORI) / rect.right; + y = ((rect.bottom - point.y) * MAXVERT) / rect.bottom; if (x < 0) x = 0; if (y < 0) y = 0; @@ -398,7 +396,6 @@ static BOOL CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) static int CC_CheckDigitsInEdit( HWND hwnd, int maxval ) { int i, k, m, result, value; - long editpos; char buffer[30]; GetWindowTextA(hwnd, buffer, ARRAY_SIZE(buffer)); @@ -425,7 +422,7 @@ static int CC_CheckDigitsInEdit( HWND hwnd, int maxval ) } if (result) { - editpos = SendMessageA(hwnd, EM_GETSEL, 0, 0); + LRESULT editpos = SendMessageA(hwnd, EM_GETSEL, 0, 0); SetWindowTextA(hwnd, buffer ); SendMessageA(hwnd, EM_SETSEL, 0, editpos); } @@ -465,7 +462,7 @@ static void CC_PaintSelectedColor(const CCPRIV *infoPtr) static void CC_PaintTriangle(CCPRIV *infoPtr) { HDC hDC; - long temp; + int temp; int w = LOWORD(GetDialogBaseUnits()) / 2; POINT points[3]; int height; @@ -485,9 +482,9 @@ static void CC_PaintTriangle(CCPRIV *infoPtr) ScreenToClient(infoPtr->hwndSelf, points); /* |< | */ oben = points[0].y; /* | \ | */ /* | \| */ - temp = (long)height * (long)infoPtr->l; + temp = height * infoPtr->l; points[0].x += 1; - points[0].y = oben + height - temp / (long)MAXVERT; + points[0].y = oben + height - temp / MAXVERT; points[1].y = points[0].y + w; points[2].y = points[0].y - w; points[2].x = points[1].x = points[0].x + w; @@ -536,8 +533,8 @@ static void CC_PaintCross(CCPRIV *infoPtr) SelectClipRgn(hDC, region); DeleteObject(region); - point.x = ((long)rect.right * (long)x) / (long)MAXHORI; - point.y = rect.bottom - ((long)rect.bottom * (long)y) / (long)MAXVERT; + point.x = (rect.right * x) / MAXHORI; + point.y = rect.bottom - (rect.bottom * y) / MAXVERT; if ( infoPtr->oldcross.left != infoPtr->oldcross.right ) BitBlt(hDC, infoPtr->oldcross.left, infoPtr->oldcross.top, infoPtr->oldcross.right - infoPtr->oldcross.left,
1
0
0
0
Eric Pouech : oledb32: Use correct integral type.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 8e3d491051dccccd512dae425d7d8f429e9bbdbd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e3d491051dccccd512dae42…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:05:33 2022 +0100 oledb32: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oledb32/convert.c | 2 +- dlls/oledb32/datainit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c index 81483dc0a09..9bd93b6ca66 100644 --- a/dlls/oledb32/convert.c +++ b/dlls/oledb32/convert.c @@ -313,7 +313,7 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, case DBTYPE_I4: { - signed int *d = dst; + LONG *d = dst; switch(src_type) { case DBTYPE_EMPTY: *d = 0; hr = S_OK; break; diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index ec26d0a11ee..08bc60bce92 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -677,7 +677,7 @@ HRESULT get_data_source(IUnknown *outer, DWORD clsctx, LPWSTR initstring, REFIID if (*datasource && prov) { DBPROPIDSET propidset; - enum DBPROPENUM prop; + DWORD prop; CLSID initprov; ULONG count;
1
0
0
0
Eric Pouech : oleaut32: Use correct integral type.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 23f9d01aa4ffb278b240050962bea2a006358bdd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23f9d01aa4ffb278b2400509…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:05:27 2022 +0100 oleaut32: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/typelib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 7dcc8d815a3..2a453a1f0e0 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -9890,7 +9890,7 @@ static DWORD WMSFT_compile_typeinfo_aux(ITypeInfoImpl *info, ++memid; } - name = (UINT*)memid; + name = (DWORD*)memid; for(i = 0; i < info->typeattr.cFuncs; ++i){ TLBFuncDesc *desc = &info->funcdescs[i]; if(desc->Name)
1
0
0
0
Eric Pouech : msxml3: Use correct integral type.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: a1add35412ce3f94bfd9d14f2a9e331476556a89 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a1add35412ce3f94bfd9d14f…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Jan 31 14:16:58 2022 +0100 msxml3: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/httprequest.c | 2 +- dlls/msxml3/mxwriter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 934d580064f..86e569f5dd8 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -687,7 +687,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback * BindStatusCallback *bsc; IBindCtx *pbc; HRESULT hr; - int size; + LONG size; hr = CreateBindCtx(0, &pbc); if (hr != S_OK) return hr; diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index e0dd0e3c6e0..084324797c7 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -336,7 +336,7 @@ static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len) { output_buffer *buffer = &writer->buffer; encoded_buffer *buff; - unsigned int written; + ULONG written; int src_len; if (!len || !*data)
1
0
0
0
Eric Pouech : mshtml: Use correct integral type.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 88e66e997417588ba30e0459ccc202787f701d6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=88e66e997417588ba30e0459…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:05:15 2022 +0100 mshtml: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/dispex.c | 2 +- dlls/mshtml/htmlevent.c | 16 ++++++++-------- dlls/mshtml/htmlinput.c | 4 ++-- dlls/mshtml/htmlnode.c | 2 +- dlls/mshtml/htmlselect.c | 2 +- dlls/mshtml/htmlwindow.c | 8 ++++---- dlls/mshtml/pluginhost.c | 6 +++--- dlls/mshtml/range.c | 2 +- dlls/mshtml/xmlhttprequest.c | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 2fff4d444b2..450bc8efe51 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -945,7 +945,7 @@ static HRESULT invoke_disp_value(DispatchEx *This, IDispatch *func_disp, LCID lc hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, lcid, flags, &new_dp, res, ei, caller); IDispatchEx_Release(dispex); }else { - ULONG err = 0; + UINT err = 0; hres = IDispatch_Invoke(func_disp, DISPID_VALUE, &IID_NULL, lcid, flags, &new_dp, res, ei, &err); } if(SUCCEEDED(hres)) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 7ed1dfd2adc..50ca4cbb168 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1198,7 +1198,7 @@ static HRESULT WINAPI DOMUIEvent_get_view(IDOMUIEvent *iface, IHTMLWindow2 **p) static HRESULT WINAPI DOMUIEvent_get_detail(IDOMUIEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMUIEvent(iface); - INT32 detail; + LONG detail; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1314,7 +1314,7 @@ static HRESULT WINAPI DOMMouseEvent_Invoke(IDOMMouseEvent *iface, DISPID dispIdM static HRESULT WINAPI DOMMouseEvent_get_screenX(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 screen_x; + LONG screen_x; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1330,7 +1330,7 @@ static HRESULT WINAPI DOMMouseEvent_get_screenX(IDOMMouseEvent *iface, LONG *p) static HRESULT WINAPI DOMMouseEvent_get_screenY(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 screen_y; + LONG screen_y; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1346,7 +1346,7 @@ static HRESULT WINAPI DOMMouseEvent_get_screenY(IDOMMouseEvent *iface, LONG *p) static HRESULT WINAPI DOMMouseEvent_get_clientX(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 client_x; + LONG client_x; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1362,7 +1362,7 @@ static HRESULT WINAPI DOMMouseEvent_get_clientX(IDOMMouseEvent *iface, LONG *p) static HRESULT WINAPI DOMMouseEvent_get_clientY(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 client_y; + LONG client_y; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1653,7 +1653,7 @@ static HRESULT WINAPI DOMMouseEvent_get_offsetY(IDOMMouseEvent *iface, LONG *p) static HRESULT WINAPI DOMMouseEvent_get_pageX(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 r; + LONG r; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1669,7 +1669,7 @@ static HRESULT WINAPI DOMMouseEvent_get_pageX(IDOMMouseEvent *iface, LONG *p) static HRESULT WINAPI DOMMouseEvent_get_pageY(IDOMMouseEvent *iface, LONG *p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - INT32 r; + LONG r; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -2375,7 +2375,7 @@ static HRESULT call_cp_func(IDispatch *disp, DISPID dispid, IHTMLEventObj *event { DISPPARAMS dp = {NULL,NULL,0,0}; VARIANT event_arg; - ULONG argerr; + UINT argerr; EXCEPINFO ei; TRACE("%p,%d,%p,%p\n", disp, dispid, event_obj, retv); diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index e9b53dadb92..c0f6db8dd3b 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1245,7 +1245,7 @@ static HRESULT WINAPI HTMLInputTextElement2_put_selectionStart(IHTMLInputTextEle static HRESULT WINAPI HTMLInputTextElement2_get_selectionStart(IHTMLInputTextElement2 *iface, LONG *p) { HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface); - INT32 selection_start; + LONG selection_start; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -1278,7 +1278,7 @@ static HRESULT WINAPI HTMLInputTextElement2_put_selectionEnd(IHTMLInputTextEleme static HRESULT WINAPI HTMLInputTextElement2_get_selectionEnd(IHTMLInputTextElement2 *iface, LONG *p) { HTMLInputElement *This = impl_from_IHTMLInputTextElement2(iface); - INT32 selection_end; + LONG selection_end; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 23ab7195aca..9918174fa41 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -107,7 +107,7 @@ static ULONG WINAPI HTMLDOMChildrenCollectionEnum_Release(IEnumVARIANT *iface) static ULONG get_enum_len(HTMLDOMChildrenCollectionEnum *This) { - ULONG len; + UINT32 len; nsresult nsres; nsres = nsIDOMNodeList_GetLength(This->col->nslist, &len); diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index b2c10f725bb..9400ee043b6 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -792,7 +792,7 @@ static HRESULT WINAPI HTMLSelectElement_put_size(IHTMLSelectElement *iface, LONG static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG *p) { HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface); - DWORD val; + UINT32 val; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 389552c3088..5aa2351f5f0 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2428,7 +2428,7 @@ static HRESULT WINAPI HTMLWindow7_get_performance(IHTMLWindow7 *iface, VARIANT * static HRESULT WINAPI HTMLWindow7_get_innerWidth(IHTMLWindow7 *iface, LONG *p) { HTMLWindow *This = impl_from_IHTMLWindow7(iface); - INT32 ret; + LONG ret; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -2446,7 +2446,7 @@ static HRESULT WINAPI HTMLWindow7_get_innerWidth(IHTMLWindow7 *iface, LONG *p) static HRESULT WINAPI HTMLWindow7_get_innerHeight(IHTMLWindow7 *iface, LONG *p) { HTMLWindow *This = impl_from_IHTMLWindow7(iface); - INT32 ret; + LONG ret; nsresult nsres; TRACE("(%p)->(%p)\n", This, p); @@ -2465,7 +2465,7 @@ static HRESULT WINAPI HTMLWindow7_get_pageXOffset(IHTMLWindow7 *iface, LONG *p) { HTMLWindow *This = impl_from_IHTMLWindow7(iface); nsresult nsres; - INT32 ret; + LONG ret; TRACE("(%p)->(%p)\n", This, p); @@ -2483,7 +2483,7 @@ static HRESULT WINAPI HTMLWindow7_get_pageYOffset(IHTMLWindow7 *iface, LONG *p) { HTMLWindow *This = impl_from_IHTMLWindow7(iface); nsresult nsres; - INT32 ret; + LONG ret; TRACE("(%p)->(%p)\n", This, p); diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index ad67db5548c..b6a2c57479c 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -378,7 +378,7 @@ static BOOL check_script_safety(PluginHost *host) DWORD policy_size, policy; struct CONFIRMSAFETY cs; BYTE *ppolicy; - ULONG err = 0; + UINT err = 0; VARIANT v; HRESULT hres; @@ -412,7 +412,7 @@ static void update_readystate(PluginHost *host) DISPPARAMS params = {NULL,NULL,0,0}; IDispatchEx *dispex; IDispatch *disp; - ULONG err = 0; + UINT err = 0; VARIANT v; HRESULT hres; @@ -643,7 +643,7 @@ static void notif_enabled(PluginHost *plugin_host) { DISPPARAMS args = {NULL, NULL, 0, 0}; IDispatch *disp; - ULONG err = 0; + UINT err = 0; VARIANT res; HRESULT hres; diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index bea5ac6b371..375f76de40c 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1389,7 +1389,7 @@ static HRESULT WINAPI HTMLTxtRange_setEndPoint(IHTMLTxtRange *iface, BSTR how, HTMLTxtRange *This = impl_from_IHTMLTxtRange(iface); HTMLTxtRange *src_range; nsIDOMNode *ref_node; - INT32 ref_offset; + LONG ref_offset; BOOL set_start; int how_type; INT16 cmp; diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 4cd47acd107..cd8ba65b5b8 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -395,7 +395,7 @@ static HRESULT WINAPI HTMLXMLHttpRequest_get_responseXML(IHTMLXMLHttpRequest *if static HRESULT WINAPI HTMLXMLHttpRequest_get_status(IHTMLXMLHttpRequest *iface, LONG *p) { HTMLXMLHttpRequest *This = impl_from_IHTMLXMLHttpRequest(iface); - DWORD val; + UINT32 val; nsresult nsres; TRACE("(%p)->(%p)\n", This, p);
1
0
0
0
Eric Pouech : jscript: Use correct integral type.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 679bbdf89d138dc4d70b605b97f7a2b5a2fef07f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=679bbdf89d138dc4d70b605b…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:05:03 2022 +0100 jscript: Use correct integral type. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/array.c | 24 ++++++++++++------------ dlls/jscript/engine.c | 8 ++++---- dlls/jscript/function.c | 2 +- dlls/jscript/jscript.h | 1 + dlls/jscript/jsregexp.c | 4 ++-- dlls/jscript/jsutils.c | 5 +++++ dlls/jscript/string.c | 2 +- dlls/jscript/vbarray.c | 17 +++++++++-------- 8 files changed, 35 insertions(+), 28 deletions(-) diff --git a/dlls/jscript/array.c b/dlls/jscript/array.c index 5f61f997a9b..56727f905f3 100644 --- a/dlls/jscript/array.c +++ b/dlls/jscript/array.c @@ -53,7 +53,7 @@ unsigned array_get_length(jsdisp_t *array) return array_from_jsdisp(array)->length; } -static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret) +static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, UINT32 *ret) { ArrayInstance *array; jsval_t val; @@ -314,7 +314,7 @@ static HRESULT Array_join(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigne jsval_t *r) { jsdisp_t *jsthis; - DWORD length; + UINT32 length; HRESULT hres; TRACE("\n"); @@ -346,7 +346,7 @@ static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned { jsdisp_t *jsthis; jsval_t val; - DWORD length; + UINT32 length; HRESULT hres; TRACE("\n"); @@ -395,7 +395,7 @@ static HRESULT Array_push(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigne jsval_t *r) { jsdisp_t *jsthis; - DWORD length = 0; + UINT32 length = 0; unsigned i; HRESULT hres; @@ -424,7 +424,7 @@ static HRESULT Array_reverse(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsi jsval_t *r) { jsdisp_t *jsthis; - DWORD length, k, l; + UINT32 length, k, l; jsval_t v1, v2; HRESULT hres1, hres2; @@ -479,7 +479,7 @@ static HRESULT Array_shift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsign jsval_t *r) { jsdisp_t *jsthis; - DWORD length = 0, i; + UINT32 length = 0, i; jsval_t v, ret; HRESULT hres; @@ -534,7 +534,7 @@ static HRESULT Array_slice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsign { jsdisp_t *arr, *jsthis; DOUBLE range; - DWORD length, start, end, idx; + UINT32 length, start, end, idx; HRESULT hres; TRACE("\n"); @@ -656,7 +656,7 @@ static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigne { jsdisp_t *jsthis, *cmp_func = NULL; jsval_t *vtab, **sorttab = NULL; - DWORD length; + UINT32 length; DWORD i; HRESULT hres = S_OK; @@ -800,7 +800,7 @@ static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigne static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - DWORD length, start=0, delete_cnt=0, i, add_args = 0; + UINT32 length, start=0, delete_cnt=0, i, add_args = 0; jsdisp_t *ret_array = NULL, *jsthis; jsval_t val; double d; @@ -1037,7 +1037,7 @@ static HRESULT Array_map(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned IDispatch *context_this = NULL, *callback; jsval_t callback_args[3], mapped_value; jsdisp_t *jsthis, *array; - DWORD length, k; + UINT32 length, k; HRESULT hres; TRACE("\n"); @@ -1100,7 +1100,7 @@ static HRESULT Array_reduce(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsig jsval_t callback_args[4], acc, new_acc; BOOL have_value = FALSE; jsdisp_t *jsthis; - DWORD length, k; + UINT32 length, k; HRESULT hres; TRACE("\n"); @@ -1168,7 +1168,7 @@ static HRESULT Array_unshift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsi { jsdisp_t *jsthis; WCHAR buf[14], *buf_end, *str; - DWORD i, length; + UINT32 i, length; jsval_t val; DISPID id; HRESULT hres; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 47b4e56e8e4..ae002fc56e8 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -147,7 +147,7 @@ static inline HRESULT stack_pop_int(script_ctx_t *ctx, INT *r) return to_int32(ctx, stack_pop(ctx), r); } -static inline HRESULT stack_pop_uint(script_ctx_t *ctx, DWORD *r) +static inline HRESULT stack_pop_uint(script_ctx_t *ctx, UINT32 *r) { return to_uint32(ctx, stack_pop(ctx), r); } @@ -2643,7 +2643,7 @@ static HRESULT interp_neg(script_ctx_t *ctx) /* ECMA-262 3rd Edition 11.7.1 */ static HRESULT interp_lshift(script_ctx_t *ctx) { - DWORD r; + UINT32 r; INT l; HRESULT hres; @@ -2661,7 +2661,7 @@ static HRESULT interp_lshift(script_ctx_t *ctx) /* ECMA-262 3rd Edition 11.7.2 */ static HRESULT interp_rshift(script_ctx_t *ctx) { - DWORD r; + UINT32 r; INT l; HRESULT hres; @@ -2679,7 +2679,7 @@ static HRESULT interp_rshift(script_ctx_t *ctx) /* ECMA-262 3rd Edition 11.7.3 */ static HRESULT interp_rshift2(script_ctx_t *ctx) { - DWORD r, l; + UINT32 r, l; HRESULT hres; hres = stack_pop_uint(ctx, &r); diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 3eef1aa2dd6..f24d53977bd 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -297,7 +297,7 @@ static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, unsigned *argc, jsval_t **ret) { jsval_t *argv, val; - DWORD length, i; + UINT32 length, i; HRESULT hres; hres = jsdisp_propget_name(arg_array, L"length", &val); diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index c192ec7c216..8ca2ea938af 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -366,6 +366,7 @@ HRESULT to_boolean(jsval_t,BOOL*) DECLSPEC_HIDDEN; HRESULT to_number(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN; HRESULT to_integer(script_ctx_t*,jsval_t,double*) DECLSPEC_HIDDEN; HRESULT to_int32(script_ctx_t*,jsval_t,INT*) DECLSPEC_HIDDEN; +HRESULT to_long(script_ctx_t*,jsval_t,LONG*) DECLSPEC_HIDDEN; HRESULT to_uint32(script_ctx_t*,jsval_t,UINT32*) DECLSPEC_HIDDEN; HRESULT to_string(script_ctx_t*,jsval_t,jsstr_t**) DECLSPEC_HIDDEN; HRESULT to_flat_string(script_ctx_t*,jsval_t,jsstr_t**,const WCHAR**) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index cb6c051176f..0dc4aa1806c 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -642,7 +642,7 @@ HRESULT create_regexp(script_ctx_t *ctx, jsstr_t *src, DWORD flags, jsdisp_t **r HRESULT create_regexp_var(script_ctx_t *ctx, jsval_t src_arg, jsval_t *flags_arg, jsdisp_t **ret) { - unsigned flags = 0; + DWORD flags = 0; const WCHAR *opt = NULL; jsstr_t *src; HRESULT hres = S_OK; @@ -695,7 +695,7 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *jsstr, jsv { RegExpInstance *regexp = regexp_from_jsdisp(re); match_result_t *match_result; - unsigned match_cnt, i; + DWORD match_cnt, i; const WCHAR *str; jsdisp_t *array; HRESULT hres; diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 3c3cd012490..d3a41facc6c 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -706,6 +706,11 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret) return S_OK; } +HRESULT to_long(script_ctx_t *ctx, jsval_t v, LONG *ret) +{ + return to_int32(ctx, v, (INT*)ret); +} + /* ECMA-262 3rd Edition 9.6 */ HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, UINT32 *ret) { diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 5958216b861..cca14cbbb95 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1596,7 +1596,7 @@ static HRESULT StringConstr_fromCharCode(script_ctx_t *ctx, vdisp_t *jsthis, WOR unsigned argc, jsval_t *argv, jsval_t *r) { WCHAR *ret_str; - DWORD i, code; + UINT32 i, code; jsstr_t *ret; HRESULT hres; diff --git a/dlls/jscript/vbarray.c b/dlls/jscript/vbarray.c index 41faa20ed79..74b9a29fc9c 100644 --- a/dlls/jscript/vbarray.c +++ b/dlls/jscript/vbarray.c @@ -63,7 +63,8 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un jsval_t *r) { VBArrayInstance *vbarray; - int i, *indexes; + unsigned i; + LONG *indexes; VARIANT out; HRESULT hres; @@ -76,12 +77,12 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un if(argc < SafeArrayGetDim(vbarray->safearray)) return JS_E_SUBSCRIPT_OUT_OF_RANGE; - indexes = heap_alloc(sizeof(int)*argc); + indexes = heap_alloc(sizeof(indexes[0])*argc); if(!indexes) return E_OUTOFMEMORY; for(i=0; i<argc; i++) { - hres = to_int32(ctx, argv[i], indexes+i); + hres = to_long(ctx, argv[i], indexes + i); if(FAILED(hres)) { heap_free(indexes); return hres; @@ -106,7 +107,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns jsval_t *r) { VBArrayInstance *vbarray; - int dim; + LONG dim; HRESULT hres; TRACE("\n"); @@ -116,7 +117,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns return JS_E_VBARRAY_EXPECTED; if(argc) { - hres = to_int32(ctx, argv[0], &dim); + hres = to_long(ctx, argv[0], &dim); if(FAILED(hres)) return hres; } else @@ -140,7 +141,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, un jsdisp_t *array; jsval_t val; VARIANT *v; - int i, size = 1, ubound, lbound; + LONG i, size = 1, ubound, lbound; HRESULT hres; TRACE("\n"); @@ -192,7 +193,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns jsval_t *r) { VBArrayInstance *vbarray; - int dim; + LONG dim; HRESULT hres; TRACE("\n"); @@ -202,7 +203,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, uns return JS_E_VBARRAY_EXPECTED; if(argc) { - hres = to_int32(ctx, argv[0], &dim); + hres = to_long(ctx, argv[0], &dim); if(FAILED(hres)) return hres; } else
1
0
0
0
Eric Pouech : dwrite: Use correct integral types.
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 04bb4424efacee1e183e8625f886141405fb3f37 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=04bb4424efacee1e183e8625…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 10:39:38 2022 +0300 dwrite: Use correct integral types. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 2 +- dlls/dwrite/main.c | 3 ++- dlls/dwrite/opentype.c | 5 +++-- dlls/dwrite/shape.c | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index cbc0434b72d..4b32bf1e0de 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -5084,7 +5084,7 @@ HRESULT get_eudc_fontcollection(IDWriteFactory7 *factory, IDWriteFontCollection3 struct dwrite_fontcollection *collection; WCHAR eudckeypathW[16]; HKEY eudckey; - DWORD index; + UINT32 index; BOOL exists; LONG retval; HRESULT hr; diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index ab53d5cb80d..26415201d91 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -1515,8 +1515,9 @@ static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory7 *if static HRESULT create_system_path_list(WCHAR ***ret, unsigned int *ret_count) { - unsigned int index = 0, value_size, name_count, max_name_count, type, data_size; + unsigned int index = 0, value_size, max_name_count; WCHAR **paths = NULL, *name, *value = NULL; + DWORD name_count, type, data_size; size_t capacity = 0, count = 0; HKEY hkey; LONG r; diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 452b00240b8..5bac32f9ee7 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4607,8 +4607,8 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex next_bit = global_bit_shift + 1; for (i = 0; i < features->count; ++i) { - unsigned int bits_needed; BOOL found = FALSE; + DWORD bits_needed; feature = &features->features[i]; @@ -5077,7 +5077,8 @@ static BOOL opentype_layout_apply_gsub_alt_substitution(struct scriptshaping_con if (format == 1) { const struct ot_gsub_altsubst_format1 *format1 = table_read_ensure(table, subtable_offset, sizeof(*format1)); - unsigned int shift, alt_index; + DWORD shift; + unsigned int alt_index; UINT16 set_offset; coverage = table_read_be_word(table, subtable_offset + FIELD_OFFSET(struct ot_gsub_altsubst_format1, coverage)); diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c index 177ad1d06fe..bf80d686052 100644 --- a/dlls/dwrite/shape.c +++ b/dlls/dwrite/shape.c @@ -67,10 +67,10 @@ void release_scriptshaping_cache(struct scriptshaping_cache *cache) free(cache); } -static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const DWORD *scripts, +static unsigned int shape_select_script(const struct scriptshaping_cache *cache, DWORD kind, const unsigned int *scripts, unsigned int *script_index) { - static const DWORD fallback_scripts[] = + static const unsigned int fallback_scripts[] = { DWRITE_MAKE_OPENTYPE_TAG('D','F','L','T'), DWRITE_MAKE_OPENTYPE_TAG('d','f','l','t'),
1
0
0
0
Eric Pouech : include/basetsd.h: Define PtrTo(Ul|L)ong to return a long (as SDK does).
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: c3e57fc3e47c33c90e7a0cfaa28a578533e3c7d5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c3e57fc3e47c33c90e7a0cfa…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Feb 1 14:04:51 2022 +0100 include/basetsd.h: Define PtrTo(Ul|L)ong to return a long (as SDK does). Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/basetsd.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/include/basetsd.h b/include/basetsd.h index 329db66c8f0..6a6a3945205 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -165,6 +165,17 @@ static inline long HandleToLong(const void *h) return (long)(LONG_PTR)h; } +static inline unsigned long PtrToUlong(const void *p) +{ + return (unsigned long)(ULONG_PTR)p; +} + +static inline long PtrToLong(const void *p) +{ + return (long)(LONG_PTR)p; +} + + #else static inline unsigned HandleToULong(const void *h) @@ -177,26 +188,27 @@ static inline int HandleToLong(const void *h) return (int)(LONG_PTR)h; } -#endif /* !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) */ - -static inline void *ULongToHandle(ULONG32 ul) +static inline unsigned PtrToUlong(const void *p) { - return (void *)(ULONG_PTR)ul; + return (unsigned)(ULONG_PTR)p; } -static inline void *LongToHandle(LONG32 l) +static inline int PtrToLong(const void *p) { - return (void *)(LONG_PTR)l; + return (int)(LONG_PTR)p; } -static inline ULONG32 PtrToUlong(const void *p) + +#endif /* !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) */ + +static inline void *ULongToHandle(ULONG32 ul) { - return (ULONG32)(ULONG_PTR)p; + return (void *)(ULONG_PTR)ul; } -static inline LONG32 PtrToLong(const void *p) +static inline void *LongToHandle(LONG32 l) { - return (LONG32)(LONG_PTR)p; + return (void *)(LONG_PTR)l; } static inline UINT32 PtrToUint(const void *p)
1
0
0
0
Paul Gofman : hnetcfg: Get control URL for WANIPConnection service in init_gateway_connection().
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: 42d12db0ee5c9d77a5be960c897bdff169341629 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42d12db0ee5c9d77a5be960c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:24 2022 +0300 hnetcfg: Get control URL for WANIPConnection service in init_gateway_connection(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/Makefile.in | 2 +- dlls/hnetcfg/port.c | 166 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 163 insertions(+), 5 deletions(-) diff --git a/dlls/hnetcfg/Makefile.in b/dlls/hnetcfg/Makefile.in index 8435de81f94..926eec4e476 100644 --- a/dlls/hnetcfg/Makefile.in +++ b/dlls/hnetcfg/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = hnetcfg.dll IMPORTS = oleaut32 ole32 advapi32 mpr uuid -DELAYIMPORTS = ws2_32 winhttp +DELAYIMPORTS = ws2_32 winhttp shcore xmllite EXTRADLLFLAGS = -Wb,--prefer-native C_SRCS = \ diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index b1d5398a01a..389e36f4d50 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -25,9 +25,12 @@ #include "winbase.h" #include "winuser.h" #include "string.h" +#include "initguid.h" #include "assert.h" #include "winsock2.h" #include "winhttp.h" +#include "shlwapi.h" +#include "xmllite.h" #include "ole2.h" #include "netfw.h" #include "natupnp.h" @@ -43,6 +46,9 @@ static struct BOOL winsock_initialized; WCHAR locationW[256]; HINTERNET session, connection; + WCHAR desc_urlpath[128]; + WCHAR control_url[256]; + unsigned int version; } upnp_gateway_connection; @@ -85,19 +91,99 @@ static BOOL parse_search_response( char *response, WCHAR *locationW, unsigned in return FALSE; } +static BOOL parse_desc_xml( const char *desc_xml ) +{ + static const WCHAR urn_wanipconnection[] = L"urn:schemas-upnp-org:service:WANIPConnection:"; + WCHAR control_url[ARRAY_SIZE(upnp_gateway_connection.control_url)]; + BOOL service_type_matches, control_url_found, found = FALSE; + unsigned int version = 0; + XmlNodeType node_type; + IXmlReader *reader; + const WCHAR *value; + BOOL ret = FALSE; + IStream *stream; + HRESULT hr; + + if (!(stream = SHCreateMemStream( (BYTE *)desc_xml, strlen( desc_xml ) + 1 ))) return FALSE; + if (FAILED(hr = CreateXmlReader( &IID_IXmlReader, (void **)&reader, NULL ))) + { + IStream_Release( stream ); + return FALSE; + } + if (FAILED(hr = IXmlReader_SetInput( reader, (IUnknown*)stream ))) goto done; + + while (SUCCEEDED(IXmlReader_Read( reader, &node_type )) && node_type != XmlNodeType_None) + { + if (node_type != XmlNodeType_Element) continue; + + if (FAILED(IXmlReader_GetLocalName( reader, &value, NULL ))) goto done; + if (wcsicmp( value, L"service" )) continue; + control_url_found = service_type_matches = FALSE; + while (SUCCEEDED(IXmlReader_Read( reader, &node_type ))) + { + if (node_type != XmlNodeType_Element && node_type != XmlNodeType_EndElement) continue; + if (FAILED(IXmlReader_GetLocalName( reader, &value, NULL ))) + { + WARN( "IXmlReader_GetLocalName failed.\n" ); + goto done; + } + if (node_type == XmlNodeType_EndElement) + { + if (!wcsicmp( value, L"service" )) break; + continue; + } + if (!wcsicmp( value, L"serviceType" )) + { + if (FAILED(IXmlReader_Read(reader, &node_type ))) goto done; + if (node_type != XmlNodeType_Text) goto done; + if (FAILED(IXmlReader_GetValue( reader, &value, NULL ))) goto done; + if (wcsnicmp( value, urn_wanipconnection, ARRAY_SIZE(urn_wanipconnection) - 1 )) break; + version = _wtoi( value + ARRAY_SIZE(urn_wanipconnection) - 1 ); + service_type_matches = version >= 1; + } + else if (!wcsicmp( value, L"controlURL" )) + { + if (FAILED(IXmlReader_Read(reader, &node_type ))) goto done; + if (node_type != XmlNodeType_Text) goto done; + if (FAILED(IXmlReader_GetValue( reader, &value, NULL ))) goto done; + if (wcslen( value ) + 1 > ARRAY_SIZE(control_url)) goto done; + wcscpy( control_url, value ); + control_url_found = TRUE; + } + } + if (service_type_matches && control_url_found) + { + if (found) + { + FIXME( "Found another WANIPConnection service, ignoring.\n" ); + continue; + } + found = TRUE; + wcscpy( upnp_gateway_connection.control_url, control_url ); + upnp_gateway_connection.version = version; + } + } + + ret = found; +done: + IXmlReader_Release( reader ); + IStream_Release( stream ); + return ret; +} + static BOOL open_gateway_connection(void) { static const int timeout = 3000; - WCHAR hostname[64], urlpath[128]; + WCHAR hostname[64]; URL_COMPONENTS url; memset( &url, 0, sizeof(url) ); url.dwStructSize = sizeof(url); url.lpszHostName = hostname; url.dwHostNameLength = ARRAY_SIZE(hostname); - url.lpszUrlPath = urlpath; - url.dwUrlPathLength = ARRAY_SIZE(urlpath); + url.lpszUrlPath = upnp_gateway_connection.desc_urlpath; + url.dwUrlPathLength = ARRAY_SIZE(upnp_gateway_connection.desc_urlpath); if (!WinHttpCrackUrl( upnp_gateway_connection.locationW, 0, 0, &url )) return FALSE; @@ -107,7 +193,8 @@ static BOOL open_gateway_connection(void) if (!WinHttpSetTimeouts( upnp_gateway_connection.session, timeout, timeout, timeout, timeout )) return FALSE; - TRACE( "hostname %s, urlpath %s, port %u.\n", debugstr_w(hostname), debugstr_w(urlpath), url.nPort ); + TRACE( "hostname %s, urlpath %s, port %u.\n", + debugstr_w(hostname), debugstr_w(upnp_gateway_connection.desc_urlpath), url.nPort ); upnp_gateway_connection.connection = WinHttpConnect ( upnp_gateway_connection.session, hostname, url.nPort, 0 ); if (!upnp_gateway_connection.connection) { @@ -117,6 +204,69 @@ static BOOL open_gateway_connection(void) return TRUE; } +static BOOL get_control_url(void) +{ + static const WCHAR *accept_types[] = + { + L"text/xml", + NULL + }; + unsigned int desc_xml_size, offset; + DWORD size, status = 0; + HINTERNET request; + char *desc_xml; + BOOL ret; + + request = WinHttpOpenRequest( upnp_gateway_connection.connection, NULL, upnp_gateway_connection.desc_urlpath, NULL, + WINHTTP_NO_REFERER, accept_types, 0 ); + if (!request) return FALSE; + + if (!WinHttpSendRequest( request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0 )) + { + WARN( "Error sending request %u.\n", GetLastError() ); + WinHttpCloseHandle( request ); + return FALSE; + } + if (!WinHttpReceiveResponse(request, NULL)) + { + WARN( "Error receiving response %u.\n", GetLastError() ); + WinHttpCloseHandle( request ); + return FALSE; + } + size = sizeof(status); + if (!WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, + NULL, &status, &size, NULL) || status != HTTP_STATUS_OK ) + { + WARN( "Error response from server, error %u, http status %u.\n", GetLastError(), status ); + WinHttpCloseHandle( request ); + return FALSE; + } + desc_xml_size = 1024; + desc_xml = malloc( desc_xml_size ); + offset = 0; + while (WinHttpReadData( request, desc_xml + offset, desc_xml_size - offset - 1, &size ) && size) + { + offset += size; + if (offset + 1 == desc_xml_size) + { + char *new; + + desc_xml_size *= 2; + if (!(new = realloc( desc_xml, desc_xml_size ))) + { + ERR( "No memory.\n" ); + break; + } + desc_xml = new; + } + } + desc_xml[offset] = 0; + WinHttpCloseHandle( request ); + ret = parse_desc_xml( desc_xml ); + free( desc_xml ); + return ret; +} + static void gateway_connection_cleanup(void) { TRACE( ".\n" ); @@ -205,6 +355,14 @@ static BOOL init_gateway_connection(void) return FALSE; } TRACE( "Opened gateway connection.\n" ); + if (!get_control_url()) + { + WARN( "Could not get_control URL.\n" ); + gateway_connection_cleanup(); + return FALSE; + } + TRACE( "control_url %s, version %u.\n", debugstr_w(upnp_gateway_connection.control_url), + upnp_gateway_connection.version ); return TRUE; }
1
0
0
0
Paul Gofman : hnetcfg: Open connection to gateway in init_gateway_connection().
by Alexandre Julliard
01 Feb '22
01 Feb '22
Module: wine Branch: master Commit: c091620889195e761854dfd1cbdfb9ff58548abd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c091620889195e761854dfd1…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Feb 1 13:49:23 2022 +0300 hnetcfg: Open connection to gateway in init_gateway_connection(). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hnetcfg/Makefile.in | 2 +- dlls/hnetcfg/port.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/dlls/hnetcfg/Makefile.in b/dlls/hnetcfg/Makefile.in index 8d1f1b27ffe..8435de81f94 100644 --- a/dlls/hnetcfg/Makefile.in +++ b/dlls/hnetcfg/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = hnetcfg.dll IMPORTS = oleaut32 ole32 advapi32 mpr uuid -DELAYIMPORTS = ws2_32 +DELAYIMPORTS = ws2_32 winhttp EXTRADLLFLAGS = -Wb,--prefer-native C_SRCS = \ diff --git a/dlls/hnetcfg/port.c b/dlls/hnetcfg/port.c index fa866d874c9..b1d5398a01a 100644 --- a/dlls/hnetcfg/port.c +++ b/dlls/hnetcfg/port.c @@ -42,6 +42,7 @@ static struct LONG refs; BOOL winsock_initialized; WCHAR locationW[256]; + HINTERNET session, connection; } upnp_gateway_connection; @@ -84,9 +85,43 @@ static BOOL parse_search_response( char *response, WCHAR *locationW, unsigned in return FALSE; } +static BOOL open_gateway_connection(void) +{ + static const int timeout = 3000; + + WCHAR hostname[64], urlpath[128]; + URL_COMPONENTS url; + + memset( &url, 0, sizeof(url) ); + url.dwStructSize = sizeof(url); + url.lpszHostName = hostname; + url.dwHostNameLength = ARRAY_SIZE(hostname); + url.lpszUrlPath = urlpath; + url.dwUrlPathLength = ARRAY_SIZE(urlpath); + + if (!WinHttpCrackUrl( upnp_gateway_connection.locationW, 0, 0, &url )) return FALSE; + + upnp_gateway_connection.session = WinHttpOpen( L"hnetcfg", WINHTTP_ACCESS_TYPE_NO_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0 ); + if (!upnp_gateway_connection.session) return FALSE; + if (!WinHttpSetTimeouts( upnp_gateway_connection.session, timeout, timeout, timeout, timeout )) + return FALSE; + + TRACE( "hostname %s, urlpath %s, port %u.\n", debugstr_w(hostname), debugstr_w(urlpath), url.nPort ); + upnp_gateway_connection.connection = WinHttpConnect ( upnp_gateway_connection.session, hostname, url.nPort, 0 ); + if (!upnp_gateway_connection.connection) + { + WARN( "WinHttpConnect error %u.\n", GetLastError() ); + return FALSE; + } + return TRUE; +} + static void gateway_connection_cleanup(void) { TRACE( ".\n" ); + WinHttpCloseHandle( upnp_gateway_connection.connection ); + WinHttpCloseHandle( upnp_gateway_connection.session ); if (upnp_gateway_connection.winsock_initialized) WSACleanup(); memset( &upnp_gateway_connection, 0, sizeof(upnp_gateway_connection) ); } @@ -164,6 +199,12 @@ static BOOL init_gateway_connection(void) return FALSE; } TRACE( "Gateway description location %s.\n", debugstr_w(upnp_gateway_connection.locationW) ); + if (!open_gateway_connection()) + { + WARN( "Error opening gateway connection.\n" ); + return FALSE; + } + TRACE( "Opened gateway connection.\n" ); return TRUE; }
1
0
0
0
← Newer
1
...
144
145
146
147
148
149
150
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200