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
June 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
947 discussions
Start a n
N
ew thread
Alistair Leslie-Hughes : directmanipulation: Implement IDirectManipulationContent stub interface.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 7171a63f06c39b1ec5f5c2933290b8c78dd11745 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7171a63f06c39b1ec5f5c293…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sun Dec 22 19:35:25 2019 +1100 directmanipulation: Implement IDirectManipulationContent stub interface. Based on patch by Gijs Vermeulen. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/directmanipulation/directmanipulation.c | 110 ++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c index f901d58aa9..dd2fdda69a 100644 --- a/dlls/directmanipulation/directmanipulation.c +++ b/dlls/directmanipulation/directmanipulation.c @@ -177,10 +177,10 @@ static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj) return S_OK; } - struct primarycontext { IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface; + IDirectManipulationContent IDirectManipulationContent_iface; LONG ref; }; @@ -189,6 +189,11 @@ static inline struct primarycontext *impl_from_IDirectManipulationPrimaryContent return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationPrimaryContent_iface); } +static inline struct primarycontext *impl_from_IDirectManipulationContent(IDirectManipulationContent *iface) +{ + return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationContent_iface); +} + static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent *iface, REFIID riid, void **ppv) { struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); @@ -201,6 +206,12 @@ static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent * *ppv = &This->IDirectManipulationPrimaryContent_iface; return S_OK; } + else if(IsEqualGUID(riid, &IID_IDirectManipulationContent)) + { + IUnknown_AddRef(iface); + *ppv = &This->IDirectManipulationContent_iface; + return S_OK; + } FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); return E_NOINTERFACE; @@ -313,6 +324,102 @@ static const IDirectManipulationPrimaryContentVtbl primaryVtbl = primary_GetCenterPoint }; + +static HRESULT WINAPI content_QueryInterface(IDirectManipulationContent *iface, REFIID riid, void **ppv) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv); + + return IDirectManipulationPrimaryContent_QueryInterface(&This->IDirectManipulationPrimaryContent_iface, + riid, ppv); +} + +static ULONG WINAPI content_AddRef(IDirectManipulationContent *iface) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + return IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface); +} + +static ULONG WINAPI content_Release(IDirectManipulationContent *iface) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + return IDirectManipulationPrimaryContent_Release(&This->IDirectManipulationPrimaryContent_iface); +} + +static HRESULT WINAPI content_GetContentRect(IDirectManipulationContent *iface, RECT *size) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p\n", This, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_SetContentRect(IDirectManipulationContent *iface, const RECT *size) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p\n", This, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_GetViewport(IDirectManipulationContent *iface, REFIID riid, void **object) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %p\n", This, debugstr_guid(riid), object); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_GetTag(IDirectManipulationContent *iface, REFIID riid, void **object, UINT32 *id) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %p, %p\n", This, debugstr_guid(riid), object, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_SetTag(IDirectManipulationContent *iface, IUnknown *object, UINT32 id) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %d\n", This, object, id); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_GetOutputTransform(IDirectManipulationContent *iface, + float *matrix, DWORD count) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %d\n", This, matrix, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_GetContentTransform(IDirectManipulationContent *iface, + float *matrix, DWORD count) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %d\n", This, matrix, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI content_SyncContentTransform(IDirectManipulationContent *iface, + const float *matrix, DWORD count) +{ + struct primarycontext *This = impl_from_IDirectManipulationContent(iface); + FIXME("%p, %p, %d\n", This, matrix, count); + return E_NOTIMPL; +} + +static const IDirectManipulationContentVtbl contentVtbl = +{ + content_QueryInterface, + content_AddRef, + content_Release, + content_GetContentRect, + content_SetContentRect, + content_GetViewport, + content_GetTag, + content_SetTag, + content_GetOutputTransform, + content_GetContentTransform, + content_SyncContentTransform +}; + struct directviewport { IDirectManipulationViewport2 IDirectManipulationViewport2_iface; @@ -473,6 +580,7 @@ static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *i return E_OUTOFMEMORY; primary->IDirectManipulationPrimaryContent_iface.lpVtbl = &primaryVtbl; + primary->IDirectManipulationContent_iface.lpVtbl = &contentVtbl; primary->ref = 1; *object = &primary->IDirectManipulationPrimaryContent_iface;
1
0
0
0
Alistair Leslie-Hughes : directmanipulation: Implement IDirectManipulationPrimaryContent stub interface.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 302164c759dc42f25e1ed3501845ab86a899f714 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=302164c759dc42f25e1ed350…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Aug 23 11:34:16 2019 +1000 directmanipulation: Implement IDirectManipulationPrimaryContent stub interface. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/directmanipulation/directmanipulation.c | 155 ++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c index fac105a7cd..f901d58aa9 100644 --- a/dlls/directmanipulation/directmanipulation.c +++ b/dlls/directmanipulation/directmanipulation.c @@ -177,6 +177,142 @@ static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj) return S_OK; } + +struct primarycontext +{ + IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface; + LONG ref; +}; + +static inline struct primarycontext *impl_from_IDirectManipulationPrimaryContent(IDirectManipulationPrimaryContent *iface) +{ + return CONTAINING_RECORD(iface, struct primarycontext, IDirectManipulationPrimaryContent_iface); +} + +static HRESULT WINAPI primary_QueryInterface(IDirectManipulationPrimaryContent *iface, REFIID riid, void **ppv) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent)) + { + IDirectManipulationPrimaryContent_AddRef(&This->IDirectManipulationPrimaryContent_iface); + *ppv = &This->IDirectManipulationPrimaryContent_iface; + return S_OK; + } + + FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI primary_AddRef(IDirectManipulationPrimaryContent *iface) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + return ref; +} + +static ULONG WINAPI primary_Release(IDirectManipulationPrimaryContent *iface) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + if (!ref) + { + heap_free(This); + } + return ref; +} + +static HRESULT WINAPI primary_SetSnapInterval(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, + float interval, float offset) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d, %f, %f\n", This, motion, interval, offset); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetSnapPoints(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, + const float *points, DWORD count) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d, %p, %d\n", This, motion, points, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetSnapType(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, + DIRECTMANIPULATION_SNAPPOINT_TYPE type) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d, %d\n", This, motion, type); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetSnapCoordinate(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_MOTION_TYPES motion, + DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate, float origin) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d, %d, %f\n", This, motion, coordinate, origin); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetZoomBoundaries(IDirectManipulationPrimaryContent *iface, float minimum, float maximum) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %f, %f\n", This, minimum, maximum); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetHorizontalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d\n", This, alignment); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_SetVerticalAlignment(IDirectManipulationPrimaryContent *iface, DIRECTMANIPULATION_VERTICALALIGNMENT alignment) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %d\n", This, alignment); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_GetInertiaEndTransform(IDirectManipulationPrimaryContent *iface, float *matrix, DWORD count) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %p, %d\n", This, matrix, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI primary_GetCenterPoint(IDirectManipulationPrimaryContent *iface, float *x, float *y) +{ + struct primarycontext *This = impl_from_IDirectManipulationPrimaryContent(iface); + FIXME("%p, %p, %p\n", This, x, y); + return E_NOTIMPL; +} + +static const IDirectManipulationPrimaryContentVtbl primaryVtbl = +{ + primary_QueryInterface, + primary_AddRef, + primary_Release, + primary_SetSnapInterval, + primary_SetSnapPoints, + primary_SetSnapType, + primary_SetSnapCoordinate, + primary_SetZoomBoundaries, + primary_SetHorizontalAlignment, + primary_SetVerticalAlignment, + primary_GetInertiaEndTransform, + primary_GetCenterPoint +}; + struct directviewport { IDirectManipulationViewport2 IDirectManipulationViewport2_iface; @@ -327,7 +463,24 @@ static HRESULT WINAPI viewport_SyncDisplayTransform(IDirectManipulationViewport2 static HRESULT WINAPI viewport_GetPrimaryContent(IDirectManipulationViewport2 *iface, REFIID riid, void **object) { struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); - FIXME("%p, %s, %p\n", This, debugstr_guid(riid), object); + TRACE("%p, %s, %p\n", This, debugstr_guid(riid), object); + if(IsEqualGUID(riid, &IID_IDirectManipulationPrimaryContent)) + { + struct primarycontext *primary; + TRACE("IDirectManipulationPrimaryContent\n"); + primary = heap_alloc( sizeof(*primary)); + if(!primary) + return E_OUTOFMEMORY; + + primary->IDirectManipulationPrimaryContent_iface.lpVtbl = &primaryVtbl; + primary->ref = 1; + + *object = &primary->IDirectManipulationPrimaryContent_iface; + + return S_OK; + } + else + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); return E_NOTIMPL; }
1
0
0
0
Alistair Leslie-Hughes : directmanipulation: Implement IDirectManipulationViewport2 stub interface.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: b6ca6c2387f95e16625f53cd6c5c76a9c9b984bf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b6ca6c2387f95e16625f53cd…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Jul 26 09:51:05 2019 +1000 directmanipulation: Implement IDirectManipulationViewport2 stub interface. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/directmanipulation/directmanipulation.c | 341 ++++++++++++++++++++++++++- 1 file changed, 339 insertions(+), 2 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b6ca6c2387f95e16625f…
1
0
0
0
Alex Henrie : ntoskrnl: Provide a more realistic value for register CR0.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: f83f0e5f13a36a246e12d5838aa5bace3ebe5c3e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f83f0e5f13a36a246e12d583…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Jun 23 00:32:58 2020 -0600 ntoskrnl: Provide a more realistic value for register CR0. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48997
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/instr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c index 44f2ed4f51..f197570db0 100644 --- a/dlls/ntoskrnl.exe/instr.c +++ b/dlls/ntoskrnl.exe/instr.c @@ -35,6 +35,13 @@ #define KSHARED_USER_DATA_PAGE_SIZE 0x1000 +#define CR0_PE 0x00000001 /* Protected Mode */ +#define CR0_ET 0x00000010 /* Extension Type */ +#define CR0_NE 0x00000020 /* Numeric Error */ +#define CR0_WP 0x00010000 /* Write Protect */ +#define CR0_AM 0x00040000 /* Alignment Mask */ +#define CR0_PG 0x80000000 /* Paging */ + enum instr_op { INSTR_OP_MOV, @@ -350,7 +357,7 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) TRACE( "mov cr%u,%s at 0x%08x\n", reg, reg_names[instr[2] & 7], context->Eip ); switch (reg) { - case 0: *data = 0x10; break; /* FIXME: set more bits ? */ + case 0: *data = CR0_PE|CR0_ET|CR0_NE|CR0_WP|CR0_AM|CR0_PG; break; case 2: *data = 0; break; case 3: *data = 0; break; case 4: *data = 0; break;
1
0
0
0
Paul Gofman : ntoskrnl.exe: Add test for connection socket.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: dd26d6766123b9b26eb1b2ade3e66c2c65f74680 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dd26d6766123b9b26eb1b2ad…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 23 00:27:07 2020 +0300 ntoskrnl.exe: Add test for connection socket. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver.h | 1 + dlls/ntoskrnl.exe/tests/driver4.c | 83 ++++++++++++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/tests/ntoskrnl.c | 37 ++++++++++++----- 3 files changed, 112 insertions(+), 9 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/driver.h b/dlls/ntoskrnl.exe/tests/driver.h index 3bfc4bd80a..58a92d4838 100644 --- a/dlls/ntoskrnl.exe/tests/driver.h +++ b/dlls/ntoskrnl.exe/tests/driver.h @@ -57,3 +57,4 @@ static inline char *drv_strrchr( const char *str, char ch ) } #define SERVER_LISTEN_PORT 9374 +#define CLIENT_LISTEN_PORT 9375 diff --git a/dlls/ntoskrnl.exe/tests/driver4.c b/dlls/ntoskrnl.exe/tests/driver4.c index 5307674de3..dad1d6a04f 100644 --- a/dlls/ntoskrnl.exe/tests/driver4.c +++ b/dlls/ntoskrnl.exe/tests/driver4.c @@ -376,6 +376,88 @@ static void test_wsk_listen_socket(void) ExFreePool(buffer2); } +static void test_wsk_connect_socket(void) +{ + const WSK_PROVIDER_CONNECTION_DISPATCH *connect_dispatch; + struct socket_context context; + struct sockaddr_in addr; + LARGE_INTEGER timeout; + WSK_SOCKET *socket; + NTSTATUS status; + + timeout.QuadPart = -1000 * 10000; + + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + wsk_irp->IoStatus.Status = 0xdeadbeef; + wsk_irp->IoStatus.Information = 0xdeadbeef; + status = provider_npi.Dispatch->WskSocket(provider_npi.Client, AF_INET, SOCK_STREAM, IPPROTO_TCP, + WSK_FLAG_CONNECTION_SOCKET, &context, &connect_dispatch, NULL, NULL, NULL, wsk_irp); + ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(wsk_irp->IoStatus.Information, "Got zero Information.\n"); + + socket = (WSK_SOCKET *)wsk_irp->IoStatus.Information; + connect_dispatch = socket->Dispatch; + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(CLIENT_LISTEN_PORT); + addr.sin_addr.s_addr = htonl(0x7f000001); + + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + status = connect_dispatch->WskConnect(socket, (SOCKADDR *)&addr, 0, wsk_irp); + ok(status == STATUS_INVALID_DEVICE_STATE, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, &timeout); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_INVALID_DEVICE_STATE, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", + wsk_irp->IoStatus.Information); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + wsk_irp->IoStatus.Status = 0xdeadbeef; + wsk_irp->IoStatus.Information = 0xdeadbeef; + status = connect_dispatch->WskBind(socket, (SOCKADDR *)&addr, 0, wsk_irp); + ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", + wsk_irp->IoStatus.Information); + + addr.sin_port = htons(CLIENT_LISTEN_PORT); + addr.sin_addr.s_addr = htonl(0x7f000001); + + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + status = connect_dispatch->WskConnect(socket, (SOCKADDR *)&addr, 0, wsk_irp); + ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, &timeout); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", + wsk_irp->IoStatus.Information); + + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + wsk_irp->IoStatus.Status = 0xdeadbeef; + wsk_irp->IoStatus.Information = 0xdeadbeef; + status = connect_dispatch->Basic.WskCloseSocket(socket, wsk_irp); + ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", + wsk_irp->IoStatus.Information); +} + static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) { ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength; @@ -402,6 +484,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st netio_init(); test_wsk_get_address_info(); test_wsk_listen_socket(); + test_wsk_connect_socket(); if (winetest_debug) { diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 5555095bd2..b4ef9d0dcb 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -518,39 +518,58 @@ static DWORD WINAPI wsk_test_thread(void *parameter) { static const char test_send_string[] = "Client test string 1."; static const WORD version = MAKEWORD(2, 2); + SOCKET s_listen, s_accept, s_connect; struct sockaddr_in addr; char buffer[256]; int ret, err; WSADATA data; - SOCKET s; + int opt_val; ret = WSAStartup(version, &data); ok(!ret, "WSAStartup() failed, ret %u.\n", ret); - s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - ok(s != INVALID_SOCKET, "Error creating socket, WSAGetLastError() %u.\n", WSAGetLastError()); + s_connect = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + ok(s_connect != INVALID_SOCKET, "Error creating socket, WSAGetLastError() %u.\n", WSAGetLastError()); + + s_listen = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + ok(s_listen != INVALID_SOCKET, "Error creating socket, WSAGetLastError() %u.\n", WSAGetLastError()); + + opt_val = 1; + setsockopt(s_listen, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt_val, sizeof(opt_val)); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = htons(SERVER_LISTEN_PORT); + addr.sin_port = htons(CLIENT_LISTEN_PORT); addr.sin_addr.s_addr = htonl(0x7f000001); + ret = bind(s_listen, (struct sockaddr *)&addr, sizeof(addr)); + ok(!ret, "Got unexpected ret %d, WSAGetLastError() %u.\n", ret, WSAGetLastError()); + + ret = listen(s_listen, SOMAXCONN); + ok(!ret, "Got unexpected ret %d, WSAGetLastError() %u.\n", ret, WSAGetLastError()); - ret = connect(s, (struct sockaddr *)&addr, sizeof(addr)); + addr.sin_port = htons(SERVER_LISTEN_PORT); + + ret = connect(s_connect, (struct sockaddr *)&addr, sizeof(addr)); while (ret && ((err = WSAGetLastError()) == WSAECONNREFUSED || err == WSAECONNABORTED)) { SwitchToThread(); - ret = connect(s, (struct sockaddr *)&addr, sizeof(addr)); + ret = connect(s_connect, (struct sockaddr *)&addr, sizeof(addr)); } ok(!ret, "Error connecting, WSAGetLastError() %u.\n", WSAGetLastError()); - ret = send(s, test_send_string, sizeof(test_send_string), 0); + ret = send(s_connect, test_send_string, sizeof(test_send_string), 0); ok(ret == sizeof(test_send_string), "Got unexpected ret %d.\n", ret); - ret = recv(s, buffer, sizeof(buffer), 0); + ret = recv(s_connect, buffer, sizeof(buffer), 0); ok(ret == sizeof(buffer), "Got unexpected ret %d.\n", ret); ok(!strcmp(buffer, "Server test string 1."), "Received unexpected data.\n"); - closesocket(s); + s_accept = accept(s_listen, NULL, NULL); + ok(s_accept != INVALID_SOCKET, "Error creating socket, WSAGetLastError() %u.\n", WSAGetLastError()); + + closesocket(s_accept); + closesocket(s_connect); + closesocket(s_listen); return TRUE; }
1
0
0
0
Paul Gofman : netio.sys: Implement wsk_connect() function.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: af443d730e279a48ec6e37118dc95b51e369cc7a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=af443d730e279a48ec6e3711…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 23 00:27:06 2020 +0300 netio.sys: Implement wsk_connect() function. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/netio.sys/netio.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 90 insertions(+), 2 deletions(-) diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c index 64ea891087..09f09f1e98 100644 --- a/dlls/netio.sys/netio.c +++ b/dlls/netio.sys/netio.c @@ -53,6 +53,15 @@ struct listen_socket_callback_context SOCKET acceptor; }; +struct connect_socket_callback_context +{ + struct wsk_socket_internal *socket; + SOCKADDR *remote_address; + const void *client_dispatch; + void *client_context; + IRP *pending_irp; +}; + #define MAX_PENDING_IO 10 struct wsk_pending_io @@ -73,6 +82,7 @@ struct wsk_socket_internal ADDRESS_FAMILY address_family; USHORT socket_type; ULONG protocol; + BOOL bound; CRITICAL_SECTION cs_socket; @@ -86,6 +96,8 @@ struct wsk_socket_internal }; static LPFN_ACCEPTEX pAcceptEx; +static LPFN_CONNECTEX pConnectEx; + static const WSK_PROVIDER_CONNECTION_DISPATCH wsk_provider_connection_dispatch; static inline struct wsk_socket_internal *wsk_socket_internal_from_wsk_socket(WSK_SOCKET *wsk_socket) @@ -294,6 +306,9 @@ static NTSTATUS WINAPI wsk_bind(WSK_SOCKET *socket, SOCKADDR *local_address, ULO else status = STATUS_SUCCESS; + if (status == STATUS_SUCCESS) + s->bound = TRUE; + TRACE("status %#x.\n", status); irp->IoStatus.Information = 0; dispatch_irp(irp, status); @@ -468,11 +483,84 @@ static const WSK_PROVIDER_LISTEN_DISPATCH wsk_provider_listen_dispatch = wsk_get_local_address, }; +static void WINAPI connect_callback(TP_CALLBACK_INSTANCE *instance, void *socket_, TP_WAIT *wait, + TP_WAIT_RESULT wait_result) +{ + struct wsk_socket_internal *socket = socket_; + struct wsk_pending_io *io; + DWORD size; + + TRACE("instance %p, socket %p, wait %p, wait_result %#x.\n", instance, socket, wait, wait_result); + + lock_socket(socket); + io = find_pending_io(socket, wait); + + GetOverlappedResult((HANDLE)socket->s, &io->ovr, &size, FALSE); + dispatch_pending_io(io, io->ovr.Internal, 0); + unlock_socket(socket); +} + +static BOOL WINAPI init_connect_functions(INIT_ONCE *once, void *param, void **context) +{ + GUID connectex_guid = WSAID_CONNECTEX; + SOCKET s = (SOCKET)param; + DWORD size; + + if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &connectex_guid, sizeof(connectex_guid), + &pConnectEx, sizeof(pConnectEx), &size, NULL, NULL)) + { + ERR("Could not get AcceptEx address, error %u.\n", WSAGetLastError()); + return FALSE; + } + return TRUE; +} + static NTSTATUS WINAPI wsk_connect(WSK_SOCKET *socket, SOCKADDR *remote_address, ULONG flags, IRP *irp) { - FIXME("socket %p, remote_address %p, flags %#x, irp %p stub.\n", socket, remote_address, flags, irp); + struct wsk_socket_internal *s = wsk_socket_internal_from_wsk_socket(socket); + static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT; + struct wsk_pending_io *io; + int error; - return STATUS_NOT_IMPLEMENTED; + TRACE("socket %p, remote_address %p, flags %#x, irp %p.\n", + socket, remote_address, flags, irp); + + if (!irp) + return STATUS_INVALID_PARAMETER; + + if (!InitOnceExecuteOnce(&init_once, init_connect_functions, (void *)s->s, NULL)) + { + dispatch_irp(irp, STATUS_UNSUCCESSFUL); + return STATUS_PENDING; + } + + lock_socket(s); + + if (!(io = allocate_pending_io(s, connect_callback, irp))) + { + irp->IoStatus.Information = 0; + dispatch_irp(irp, STATUS_UNSUCCESSFUL); + unlock_socket(s); + return STATUS_PENDING; + } + + if (!s->bound) + { + dispatch_pending_io(io, STATUS_INVALID_DEVICE_STATE, 0); + unlock_socket(s); + return STATUS_INVALID_DEVICE_STATE; + } + + if (pConnectEx(s->s, remote_address, sizeof(*remote_address), NULL, 0, NULL, &io->ovr)) + dispatch_pending_io(io, STATUS_SUCCESS, 0); + else if ((error = WSAGetLastError()) == ERROR_IO_PENDING) + SetThreadpoolWait(io->tp_wait, io->ovr.hEvent, NULL); + else + dispatch_pending_io(io, sock_error_to_ntstatus(error), 0); + + unlock_socket(s); + + return STATUS_PENDING; } static NTSTATUS WINAPI wsk_get_remote_address(WSK_SOCKET *socket, SOCKADDR *remote_address, IRP *irp)
1
0
0
0
Paul Gofman : netio.sys: Check for callback address before reusing pending IO structure.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: c2eb5a0f396bed647362cbdac6653dcc4a812922 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c2eb5a0f396bed647362cbda…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 23 00:27:05 2020 +0300 netio.sys: Check for callback address before reusing pending IO structure. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/netio.sys/netio.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/dlls/netio.sys/netio.c b/dlls/netio.sys/netio.c index c9203f37ad..64ea891087 100644 --- a/dlls/netio.sys/netio.c +++ b/dlls/netio.sys/netio.c @@ -59,6 +59,7 @@ struct wsk_pending_io { OVERLAPPED ovr; TP_WAIT *tp_wait; + void *callback; IRP *irp; }; @@ -159,27 +160,41 @@ static struct wsk_pending_io *allocate_pending_io(struct wsk_socket_internal *so PTP_WAIT_CALLBACK socket_async_callback, IRP *irp) { struct wsk_pending_io *io = socket->pending_io; - unsigned int i; + unsigned int i, io_index; + io_index = ~0u; for (i = 0; i < ARRAY_SIZE(socket->pending_io); ++i) + { if (!io[i].irp) - break; + { + if (io[i].callback == socket_async_callback) + { + io[i].irp = irp; + return &io[i]; + } + + if (io_index == ~0u) + io_index = i; + } + } - if (i == ARRAY_SIZE(socket->pending_io)) + if (io_index == ~0u) { FIXME("Pending io requests count exceeds limit.\n"); return NULL; } - io[i].irp = irp; + io[io_index].irp = irp; - if (io[i].tp_wait) - return &io[i]; + if (io[io_index].tp_wait) + CloseThreadpoolWait(io[io_index].tp_wait); + else + io[io_index].ovr.hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); - io[i].ovr.hEvent = CreateEventA(NULL, FALSE, FALSE, NULL); - io[i].tp_wait = CreateThreadpoolWait(socket_async_callback, socket, NULL); + io[io_index].tp_wait = CreateThreadpoolWait(socket_async_callback, socket, NULL); + io[io_index].callback = socket_async_callback; - return &io[i]; + return &io[io_index]; } static struct wsk_pending_io *find_pending_io(struct wsk_socket_internal *socket, TP_WAIT *tp_wait)
1
0
0
0
Paul Gofman : ntoskrnl/tests: Retry bind if address is in use in test_wsk_listen_socket().
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 8f80ea670da76bca4b5f915d86b91575010e4979 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8f80ea670da76bca4b5f915d…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 23 00:27:04 2020 +0300 ntoskrnl/tests: Retry bind if address is in use in test_wsk_listen_socket(). Fixes test failures occuring when the tests using the same ports run closely one after another. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver4.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/driver4.c b/dlls/ntoskrnl.exe/tests/driver4.c index e11879e9e5..5307674de3 100644 --- a/dlls/ntoskrnl.exe/tests/driver4.c +++ b/dlls/ntoskrnl.exe/tests/driver4.c @@ -265,19 +265,25 @@ static void test_wsk_listen_socket(void) ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); - IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); - IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); - wsk_irp->IoStatus.Status = 0xdeadbeef; - wsk_irp->IoStatus.Information = 0xdeadbeef; - status = tcp_dispatch->WskBind(tcp_socket, (SOCKADDR *)&addr, 0, wsk_irp); - ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); - status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); - ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); - ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); - ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", - wsk_irp->IoStatus.Information); + do + { + IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); + IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); + wsk_irp->IoStatus.Status = 0xdeadbeef; + wsk_irp->IoStatus.Information = 0xdeadbeef; + status = tcp_dispatch->WskBind(tcp_socket, (SOCKADDR *)&addr, 0, wsk_irp); + ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); + status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); + ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); + ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS + || wsk_irp->IoStatus.Status == STATUS_ADDRESS_ALREADY_ASSOCIATED, + "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); + ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", + wsk_irp->IoStatus.Information); + } + while (wsk_irp->IoStatus.Status == STATUS_ADDRESS_ALREADY_ASSOCIATED); - timeout.QuadPart = -1000 * 10000; + timeout.QuadPart = -2000 * 10000; IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE);
1
0
0
0
Paul Gofman : ntoskrnl/tests: Use the same sin port as ws2_32 tests.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 5ead4e1e69c87806dbb4db5cab4ef75fa727a5eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5ead4e1e69c87806dbb4db5c…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 23 00:27:03 2020 +0300 ntoskrnl/tests: Use the same sin port as ws2_32 tests. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/tests/driver.h | 2 ++ dlls/ntoskrnl.exe/tests/driver4.c | 2 +- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/tests/driver.h b/dlls/ntoskrnl.exe/tests/driver.h index 4b70046b8e..3bfc4bd80a 100644 --- a/dlls/ntoskrnl.exe/tests/driver.h +++ b/dlls/ntoskrnl.exe/tests/driver.h @@ -55,3 +55,5 @@ static inline char *drv_strrchr( const char *str, char ch ) do { if (*str == ch) ret = (char *)(ULONG_PTR)str; } while (*str++); return ret; } + +#define SERVER_LISTEN_PORT 9374 diff --git a/dlls/ntoskrnl.exe/tests/driver4.c b/dlls/ntoskrnl.exe/tests/driver4.c index fedd5f25c2..e11879e9e5 100644 --- a/dlls/ntoskrnl.exe/tests/driver4.c +++ b/dlls/ntoskrnl.exe/tests/driver4.c @@ -243,7 +243,7 @@ static void test_wsk_listen_socket(void) memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = htons(12345); + addr.sin_port = htons(SERVER_LISTEN_PORT); IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index c53f97e9d1..5555095bd2 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -532,7 +532,7 @@ static DWORD WINAPI wsk_test_thread(void *parameter) memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = htons(12345); + addr.sin_port = htons(SERVER_LISTEN_PORT); addr.sin_addr.s_addr = htonl(0x7f000001); ret = connect(s, (struct sockaddr *)&addr, sizeof(addr));
1
0
0
0
Rémi Bernon : ntdll: Only raise EXCEPTION_INVALID_HANDLE if debugger is present.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: b7ccb9d06a897a384b71ccb959b431168ca07e03 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b7ccb9d06a897a384b71ccb9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 22 23:27:49 2020 +0200 ntdll: Only raise EXCEPTION_INVALID_HANDLE if debugger is present. CoD: WWII writes to PEB->BeingDebugged field, so we cannot completely trust it, but we can double check with ProcessDebugPort. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/om.c | 5 ++++- dlls/ntdll/tests/exception.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index aaed9abaa9..f14e969652 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -364,9 +364,12 @@ static LONG WINAPI invalid_handle_exception_handler( EXCEPTION_POINTERS *eptr ) /* Everquest 2 / Pirates of the Burning Sea hooks NtClose, so we need a wrapper */ NTSTATUS close_handle( HANDLE handle ) { + DWORD_PTR debug_port; NTSTATUS ret = unix_funcs->NtClose( handle ); - if (ret == STATUS_INVALID_HANDLE && handle && NtCurrentTeb()->Peb->BeingDebugged) + if (ret == STATUS_INVALID_HANDLE && handle && NtCurrentTeb()->Peb->BeingDebugged && + !NtQueryInformationProcess( NtCurrentProcess(), ProcessDebugPort, &debug_port, + sizeof(debug_port), NULL) && debug_port) { __TRY { diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index a5e6faa461..411439f180 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -3595,6 +3595,12 @@ START_TEST(exception) test_suspend_process(); test_unload_trace(); + /* Call of Duty WWII writes to BeingDebugged then closes an invalid handle, + * crashing the game if an exception is raised. */ + NtCurrentTeb()->Peb->BeingDebugged = 0x98; + test_closehandle(0, (HANDLE)0xdeadbeef); + NtCurrentTeb()->Peb->BeingDebugged = 0; + #elif defined(__x86_64__) #define X(f) p##f = (void*)GetProcAddress(hntdll, #f) @@ -3638,6 +3644,12 @@ START_TEST(exception) else skip( "Dynamic unwind functions not found\n" ); + /* Call of Duty WWII writes to BeingDebugged then closes an invalid handle, + * crashing the game if an exception is raised. */ + NtCurrentTeb()->Peb->BeingDebugged = 0x98; + test_closehandle(0, (HANDLE)0xdeadbeef); + NtCurrentTeb()->Peb->BeingDebugged = 0; + #endif VirtualFree(code_mem, 0, MEM_RELEASE);
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
95
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
Results per page:
10
25
50
100
200