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
July
June
May
April
March
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
August 2021
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
1051 discussions
Start a n
N
ew thread
Nikolay Sivov : include: Add ID3DX10Font/ID3DX10Sprite definitions.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 022d2df036b95bf593770a476a5f0bcff8b950fe URL:
https://source.winehq.org/git/wine.git/?a=commit;h=022d2df036b95bf593770a47…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Aug 5 14:04:23 2021 +0300 include: Add ID3DX10Font/ID3DX10Sprite definitions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d3dx10core.h | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) diff --git a/include/d3dx10core.h b/include/d3dx10core.h index 053e3a9c072..d794fa028d7 100644 --- a/include/d3dx10core.h +++ b/include/d3dx10core.h @@ -18,8 +18,60 @@ #include "d3dx10.h" +DEFINE_GUID(IID_ID3DX10Font, 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); +DEFINE_GUID(IID_ID3DX10Sprite, 0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x06, 0x14); DEFINE_GUID(IID_ID3DX10ThreadPump, 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); +typedef enum _D3DX10_SPRITE_FLAG +{ + D3DX10_SPRITE_SORT_TEXTURE = 0x01, + D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02, + D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04, + D3DX10_SPRITE_SAVE_STATE = 0x08, + D3DX10_SPRITE_ADDREF_TEXTURES = 0x10, +} D3DX10_SPRITE_FLAG; + +typedef struct _D3DX10_SPRITE +{ + D3DXMATRIX matWorld; + D3DXVECTOR2 TexCoord; + D3DXVECTOR2 TexSize; + D3DXCOLOR ColorModulate; + ID3D10ShaderResourceView *pTexture; + UINT TextureIndex; +} D3DX10_SPRITE; + +typedef struct _D3DX10_FONT_DESCA +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + CHAR FaceName[LF_FACESIZE]; +} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA; + +typedef struct _D3DX10_FONT_DESCW +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + WCHAR FaceName[LF_FACESIZE]; +} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW; + +DECL_WINELIB_TYPE_AW(D3DX10_FONT_DESC) +DECL_WINELIB_TYPE_AW(LPD3DX10_FONT_DESC) + #define INTERFACE ID3DX10DataLoader DECLARE_INTERFACE(ID3DX10DataLoader) { @@ -106,6 +158,129 @@ DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown) #define ID3DX10ThreadPump_GetQueueStatus(p,a,b,c) (p)->GetQueueStatus(a,b,c) #endif +#define INTERFACE ID3DX10Sprite +DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /*** ID3DX10Sprite methods ***/ + STDMETHOD(Begin)(THIS_ UINT flags) PURE; + STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *sprites, UINT count) PURE; + STDMETHOD(Flush)(THIS) PURE; + STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *sprites, + UINT count, UINT size, UINT flags) PURE; + STDMETHOD(End)(THIS) PURE; + STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *transform) PURE; + STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *transform) PURE; + STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *transform) PURE; + STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *transform) PURE; + STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define ID3DX10Sprite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DX10Sprite_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DX10Sprite_Release(p) (p)->lpVtbl->Release(p) +/*** ID3DX10Sprite methods ***/ +#define ID3DX10Sprite_Begin(p,a) (p)->lpVtbl->Begin(p,a) +#define ID3DX10Sprite_DrawSpritesBuffered(p,a,b) (p)->lpVtbl->DrawSpritesBuffered(p,a,b) +#define ID3DX10Sprite_Flush(p) (p)->lpVtbl->Flush(p) +#define ID3DX10Sprite_DrawSpritesImmediate(p,a,b,c,d) (p)->lpVtbl->DrawSpritesImmediate(p,a,b,c,d) +#define ID3DX10Sprite_End(p) (p)->lpVtbl->End(p) +#define ID3DX10Sprite_GetViewTransform(p,a) (p)->lpVtbl->GetViewTransform(p,a) +#define ID3DX10Sprite_SetViewTransform(p,a) (p)->lpVtbl->SetViewTransform(p,a) +#define ID3DX10Sprite_GetProjectionTransform(p,a) (p)->lpVtbl->GetProjectionTransform(p,a) +#define ID3DX10Sprite_SetProjectionTransform(p,a) (p)->lpVtbl->SetProjectionTransform(p,a) +#define ID3DX10Sprite_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#else +/*** IUnknown methods ***/ +#define ID3DX10Sprite_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DX10Sprite_AddRef(p) (p)->AddRef() +#define ID3DX10Sprite_Release(p) (p)->Release() +/*** ID3DX10Sprite methods ***/ +#define ID3DX10Sprite_Begin(p,a) (p)->Begin(a) +#define ID3DX10Sprite_DrawSpritesBuffered(p,a,b) (p)->DrawSpritesBuffered(a,b) +#define ID3DX10Sprite_Flush(p) (p)->Flush() +#define ID3DX10Sprite_DrawSpritesImmediate(p,a,b,c,d) (p)->DrawSpritesImmediate(a,b,c,d) +#define ID3DX10Sprite_End(p) (p)->End() +#define ID3DX10Sprite_GetViewTransform(p,a) (p)->GetViewTransform(a) +#define ID3DX10Sprite_SetViewTransform(p,a) (p)->SetViewTransform(a) +#define ID3DX10Sprite_GetProjectionTransform(p,a) (p)->GetProjectionTransform(a) +#define ID3DX10Sprite_SetProjectionTransform(p,a) (p)->SetProjectionTransform(a) +#define ID3DX10Sprite_GetDevice(p,a) (p)->GetDevice(a) +#endif + +#define INTERFACE ID3DX10Font +DECLARE_INTERFACE_(ID3DX10Font, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /*** ID3DX10Font methods ***/ + STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE; + STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *desc) PURE; + STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *desc) PURE; + STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *metrics) PURE; + STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *metrics) PURE; + STDMETHOD_(HDC, GetDC)(THIS) PURE; + STDMETHOD(GetGlyphData)(THIS_ UINT glyph, ID3D10ShaderResourceView **texture, + RECT *blackbox, POINT *cellinc) PURE; + STDMETHOD(PreloadCharacters)(THIS_ UINT first, UINT last) PURE; + STDMETHOD(PreloadGlyphs)(THIS_ UINT first, UINT last) PURE; + STDMETHOD(PreloadTextA)(THIS_ const char *text, INT count) PURE; + STDMETHOD(PreloadTextW)(THIS_ const WCHAR *text, INT count) PURE; + STDMETHOD_(INT, DrawTextA)(THIS_ ID3DX10Sprite *sprite, const char *text, + INT count, RECT *rect, UINT format, D3DXCOLOR color) PURE; + STDMETHOD_(INT, DrawTextW)(THIS_ ID3DX10Sprite *sprite, const WCHAR *text, + INT count, RECT *rect, UINT format, D3DXCOLOR color) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define ID3DX10Font_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DX10Font_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DX10Font_Release(p) (p)->lpVtbl->Release(p) +/*** ID3DX10Font methods ***/ +#define ID3DX10Font_GetDevice(p,a) (p)->lpVtbl->Begin(p,a) +#define ID3DX10Font_GetDescA(p,a) (p)->lpVtbl->GetDescA(p,a) +#define ID3DX10Font_GetDescW(p,a) (p)->lpVtbl->GetDescW(p,a) +#define ID3DX10Font_GetTextMetricsA(p,a) (p)->lpVtbl->GetTextMetricsA(p,a) +#define ID3DX10Font_GetTextMetricsW(p,a) (p)->lpVtbl->GetTextMetricsW(p,a) +#define ID3DX10Font_GetDC(p) (p)->lpVtbl->GetDC(p) +#define ID3DX10Font_GetGlyphData(p,a,b,c,d) (p)->lpVtbl->GetGlyphData(p,a,b,c,d) +#define ID3DX10Font_PreloadCharacters(p,a,b) (p)->lpVtbl->PreloadCharacters(p,a,b) +#define ID3DX10Font_PreloadGlyphs(p,a,b) (p)->lpVtbl->PreloadGlyphs(p,a,b) +#define ID3DX10Font_PreloadTextA(p,a,b) (p)->lpVtbl->PreloadTextA(p,a,b) +#define ID3DX10Font_PreloadTextW(p,a,b) (p)->lpVtbl->PreloadTextW(p,a,b) +#define ID3DX10Font_DrawTextA(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextA(p,a,b,c,d,e,f) +#define ID3DX10Font_DrawTextW(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextW(p,a,b,c,d,e,f) +#else +/*** IUnknown methods ***/ +#define ID3DX10Font_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DX10Font_AddRef(p) (p)->AddRef() +#define ID3DX10Font_Release(p) (p)->Release() +/*** ID3DX10Font methods ***/ +#define ID3DX10Font_GetDevice(p,a) (p)->Begin(a) +#define ID3DX10Font_GetDescA(p,a) (p)->GetDescA(a) +#define ID3DX10Font_GetDescW(p,a) (p)->GetDescW(a) +#define ID3DX10Font_GetTextMetricsA(p,a) (p)->GetTextMetricsA(a) +#define ID3DX10Font_GetTextMetricsW(p,a) (p)->GetTextMetricsW(a) +#define ID3DX10Font_GetDC(p) (p)->GetDC() +#define ID3DX10Font_GetGlyphData(p,a,b,c,d) (p)->GetGlyphData(a,b,c,d) +#define ID3DX10Font_PreloadCharacters(p,a,b) (p)->PreloadCharacters(a,b) +#define ID3DX10Font_PreloadGlyphs(p,a,b) (p)->PreloadGlyphs(a,b) +#define ID3DX10Font_PreloadTextA(p,a,b) (p)->PreloadTextA(a,b) +#define ID3DX10Font_PreloadTextW(p,a,b) (p)->PreloadTextW(a,b) +#define ID3DX10Font_DrawTextA(p,a,b,c,d,e,f) (p)->DrawTextA(a,b,c,d,e,f) +#define ID3DX10Font_DrawTextW(p,a,b,c,d,e,f) (p)->DrawTextW(a,b,c,d,e,f) +#endif + HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device); HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, HMODULE swrast, unsigned int flags, ID3D10Device **device);
1
0
0
0
Nikolay Sivov : include: Use regular header for d3dx10core.idl.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 3ea09b7986f87ba73e67228999b6965b5516e716 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3ea09b7986f87ba73e672289…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Aug 5 14:04:22 2021 +0300 include: Use regular header for d3dx10core.idl. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/Makefile.in | 2 +- include/d3dx10core.h | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ include/d3dx10core.idl | 75 -------------------------------- 3 files changed, 117 insertions(+), 76 deletions(-) diff --git a/include/Makefile.in b/include/Makefile.in index 3dbfe6561f2..0163b9b0951 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -142,7 +142,7 @@ SOURCES = \ d3dvec.inl \ d3dx10.h \ d3dx10async.h \ - d3dx10core.idl \ + d3dx10core.h \ d3dx10math.h \ d3dx10tex.h \ d3dx11.h \ diff --git a/include/d3dx10core.h b/include/d3dx10core.h new file mode 100644 index 00000000000..053e3a9c072 --- /dev/null +++ b/include/d3dx10core.h @@ -0,0 +1,116 @@ +/* + * Copyright 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "d3dx10.h" + +DEFINE_GUID(IID_ID3DX10ThreadPump, 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#define INTERFACE ID3DX10DataLoader +DECLARE_INTERFACE(ID3DX10DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **data, SIZE_T *bytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** ID3DX10DataLoader methods ***/ +#define ID3DX10DataLoader_Load(p) (p)->lpVtbl->Load(p) +#define ID3DX10DataLoader_Decompress(p,a,b) (p)->lpVtbl->Decompress(p,a,b) +#define ID3DX10DataLoader_Destroy(p) (p)->lpVtbl->Destroy(p) +#else +/*** ID3DX10DataLoader methods ***/ +#define ID3DX10DataLoader_Load(p) (p)->Load() +#define ID3DX10DataLoader_Decompress(p,a,b) (p)->Decompress(a,b) +#define ID3DX10DataLoader_Destroy(p) (p)->Destroy() +#endif + +#define INTERFACE ID3DX10DataProcessor +DECLARE_INTERFACE(ID3DX10DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *data, SIZE_T bytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **dataobject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** ID3DX10DataProcessor methods ***/ +#define ID3DX10DataProcessor_Process(p,a,b) (p)->lpVtbl->Process(p,a,b) +#define ID3DX10DataProcessor_CreateDeviceObject(p,a) (p)->lpVtbl->CreateDeviceObject(p,a) +#define ID3DX10DataProcessor_Destroy(p) (p)->lpVtbl->Destroy(p) +#else +/*** ID3DX10DataProcessor methods ***/ +#define ID3DX10DataProcessor_Process(p,a,b) (p)->Process(a,b) +#define ID3DX10DataProcessor_CreateDeviceObject(p,a) (p)->CreateDeviceObject(a) +#define ID3DX10DataProcessor_Destroy(p) (p)->Destroy() +#endif + +#define INTERFACE ID3DX10ThreadPump +DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /*** ID3DX10ThreadPump methods ***/ + STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *loader, ID3DX10DataProcessor *processor, + HRESULT *result, void **object) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT count) PURE; + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *queue, UINT *processqueue, UINT *devicequeue) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define ID3DX10ThreadPump_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DX10ThreadPump_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DX10ThreadPump_Release(p) (p)->lpVtbl->Release(p) +/*** ID3DX10ThreadPump methods ***/ +#define ID3DX10ThreadPump_AddWorkItem(p,a,b,c,d) (p)->lpVtbl->AddWorkItem(p,a,b,c,d) +#define ID3DX10ThreadPump_GetWorkItemCount(p) (p)->lpVtbl->GetWorkItemCount(p) +#define ID3DX10ThreadPump_WaitForAllItems(p) (p)->lpVtbl->WaitForAllItems(p) +#define ID3DX10ThreadPump_ProcessDeviceWorkItems(p,a) (p)->lpVtbl->ProcessDeviceWorkItems(p,a) +#define ID3DX10ThreadPump_PurgeAllItems(p) (p)->lpVtbl->PurgeAllItems(p) +#define ID3DX10ThreadPump_GetQueueStatus(p,a,b,c) (p)->lpVtbl->GetQueueStatus(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define ID3DX10ThreadPump_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DX10ThreadPump_AddRef(p) (p)->AddRef() +#define ID3DX10ThreadPump_Release(p) (p)->Release() +/*** ID3DX10ThreadPump methods ***/ +#define ID3DX10ThreadPump_AddWorkItem(p,a,b,c,d) (p)->AddWorkItem(a,b,c,d) +#define ID3DX10ThreadPump_GetWorkItemCount(p) (p)->GetWorkItemCount() +#define ID3DX10ThreadPump_WaitForAllItems(p) (p)->WaitForAllItems() +#define ID3DX10ThreadPump_ProcessDeviceWorkItems(p,a) (p)->ProcessDeviceWorkItems(a) +#define ID3DX10ThreadPump_PurgeAllItems(p) (p)->PurgeAllItems() +#define ID3DX10ThreadPump_GetQueueStatus(p,a,b,c) (p)->GetQueueStatus(a,b,c) +#endif + +HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device); +HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, unsigned int flags, ID3D10Device **device); +HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain, + ID3D10Device **device); +typedef interface ID3D10Device1 ID3D10Device1; +HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1); diff --git a/include/d3dx10core.idl b/include/d3dx10core.idl deleted file mode 100644 index 88f13d07650..00000000000 --- a/include/d3dx10core.idl +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015 Alistair Leslie-Hughes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgi.idl"; -import "d3dcommon.idl"; - -[ - object, - local, - pointer_default(unique) -] -interface ID3DX10DataLoader -{ - HRESULT Load(); - HRESULT Decompress([out] void **data, [in] SIZE_T *bytes); - HRESULT Destroy(); -} - -[ - object, - local, - pointer_default(unique) -] -interface ID3DX10DataProcessor -{ - HRESULT Process([in] void *data, [in] SIZE_T bytes); - HRESULT CreateDeviceObject([out] void **dataobject); - HRESULT Destroy(); -} - - -[ - object, - local, - pointer_default(unique), - uuid(c93fecfa-6967-478a-abbc-402d90621fcb) -] -interface ID3DX10ThreadPump : IUnknown -{ - HRESULT AddWorkItem([in] ID3DX10DataLoader *loader, [in] ID3DX10DataProcessor *processor, - [in] HRESULT *result, [out] void **object); - UINT GetWorkItemCount(); - - HRESULT WaitForAllItems(); - HRESULT ProcessDeviceWorkItems([in] UINT count); - - HRESULT PurgeAllItems(); - HRESULT GetQueueStatus([in] UINT *queue, [in] UINT *processqueue, [in] UINT *devicequeue); -} - -cpp_quote("HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device);") -cpp_quote("HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") -cpp_quote(" HMODULE swrast, unsigned int flags, ID3D10Device **device);") -cpp_quote("HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") -cpp_quote(" HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain,") -cpp_quote(" ID3D10Device **device);") -interface ID3D10Device1; -cpp_quote("HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1);")
1
0
0
0
Nikolay Sivov : include: Add d3dx10 vector and matrix types.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 7ac3a7341ea9bf9d1440d9e6b652bcf3fdc999f0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7ac3a7341ea9bf9d1440d9e6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Aug 5 23:21:21 2021 +0200 include: Add d3dx10 vector and matrix types. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d3dx10math.h | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/include/d3dx10math.h b/include/d3dx10math.h index c8bcfd2ce4e..5790fbdf63b 100644 --- a/include/d3dx10math.h +++ b/include/d3dx10math.h @@ -24,6 +24,34 @@ #include <math.h> +#ifndef D3DVECTOR_DEFINED +#define D3DVECTOR_DEFINED +typedef struct _D3DVECTOR +{ + float x; + float y; + float z; +} D3DVECTOR; +#endif + +#ifndef D3DMATRIX_DEFINED +#define D3DMATRIX_DEFINED +typedef struct _D3DMATRIX +{ + union + { + struct + { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + }; + float m[4][4]; + }; +} D3DMATRIX; +#endif + typedef enum _D3DX_CPU_OPTIMIZATION { D3DX_NOT_OPTIMIZED, @@ -82,6 +110,142 @@ public: float r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; +typedef struct D3DXVECTOR2 +{ +#ifdef __cplusplus + D3DXVECTOR2() {}; + D3DXVECTOR2(const float *pf); + D3DXVECTOR2(float fx, float fy); + + operator float* (); + operator const float* () const; + + D3DXVECTOR2& operator += (const D3DXVECTOR2&); + D3DXVECTOR2& operator -= (const D3DXVECTOR2&); + D3DXVECTOR2& operator *= (float); + D3DXVECTOR2& operator /= (float); + + D3DXVECTOR2 operator + () const; + D3DXVECTOR2 operator - () const; + + D3DXVECTOR2 operator + (const D3DXVECTOR2&) const; + D3DXVECTOR2 operator - (const D3DXVECTOR2&) const; + D3DXVECTOR2 operator * (float) const; + D3DXVECTOR2 operator / (float) const; + + friend D3DXVECTOR2 operator * (float, const D3DXVECTOR2&); + + BOOL operator == (const D3DXVECTOR2&) const; + BOOL operator != (const D3DXVECTOR2&) const; +#endif /* __cplusplus */ + float x, y; +} D3DXVECTOR2, *LPD3DXVECTOR2; + +#ifdef __cplusplus +typedef struct D3DXVECTOR3 : public D3DVECTOR +{ + D3DXVECTOR3() {}; + D3DXVECTOR3(const float *pf); + D3DXVECTOR3(const D3DVECTOR& v); + D3DXVECTOR3(float fx, float fy, float fz); + + operator float* (); + operator const float* () const; + + D3DXVECTOR3& operator += (const D3DXVECTOR3&); + D3DXVECTOR3& operator -= (const D3DXVECTOR3&); + D3DXVECTOR3& operator *= (float); + D3DXVECTOR3& operator /= (float); + + D3DXVECTOR3 operator + () const; + D3DXVECTOR3 operator - () const; + + D3DXVECTOR3 operator + (const D3DXVECTOR3&) const; + D3DXVECTOR3 operator - (const D3DXVECTOR3&) const; + D3DXVECTOR3 operator * (float) const; + D3DXVECTOR3 operator / (float) const; + + friend D3DXVECTOR3 operator * (float, const struct D3DXVECTOR3&); + + BOOL operator == (const D3DXVECTOR3&) const; + BOOL operator != (const D3DXVECTOR3&) const; +} D3DXVECTOR3, *LPD3DXVECTOR3; +#else /* !__cplusplus */ +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; +#endif /* !__cplusplus */ + +typedef struct D3DXVECTOR4 +{ +#ifdef __cplusplus + D3DXVECTOR4() {}; + D3DXVECTOR4(const float *pf); + D3DXVECTOR4(float fx, float fy, float fz, float fw); + + operator float* (); + operator const float* () const; + + D3DXVECTOR4& operator += (const D3DXVECTOR4&); + D3DXVECTOR4& operator -= (const D3DXVECTOR4&); + D3DXVECTOR4& operator *= (float); + D3DXVECTOR4& operator /= (float); + + D3DXVECTOR4 operator + () const; + D3DXVECTOR4 operator - () const; + + D3DXVECTOR4 operator + (const D3DXVECTOR4&) const; + D3DXVECTOR4 operator - (const D3DXVECTOR4&) const; + D3DXVECTOR4 operator * (float) const; + D3DXVECTOR4 operator / (float) const; + + friend D3DXVECTOR4 operator * (float, const D3DXVECTOR4&); + + BOOL operator == (const D3DXVECTOR4&) const; + BOOL operator != (const D3DXVECTOR4&) const; +#endif /* __cplusplus */ + float x, y, z, w; +} D3DXVECTOR4, *LPD3DXVECTOR4; + +#ifdef __cplusplus +typedef struct D3DXMATRIX : public D3DMATRIX +{ + D3DXMATRIX() {}; + D3DXMATRIX(const float *pf); + D3DXMATRIX(const D3DMATRIX& mat); + D3DXMATRIX(float f11, float f12, float f13, float f14, + float f21, float f22, float f23, float f24, + float f31, float f32, float f33, float f34, + float f41, float f42, float f43, float f44); + + float& operator () (UINT row, UINT col); + float operator () (UINT row, UINT col) const; + + operator float* (); + operator const float* () const; + + D3DXMATRIX& operator *= (const D3DXMATRIX&); + D3DXMATRIX& operator += (const D3DXMATRIX&); + D3DXMATRIX& operator -= (const D3DXMATRIX&); + D3DXMATRIX& operator *= (float); + D3DXMATRIX& operator /= (float); + + D3DXMATRIX operator + () const; + D3DXMATRIX operator - () const; + + D3DXMATRIX operator * (const D3DXMATRIX&) const; + D3DXMATRIX operator + (const D3DXMATRIX&) const; + D3DXMATRIX operator - (const D3DXMATRIX&) const; + D3DXMATRIX operator * (float) const; + D3DXMATRIX operator / (float) const; + + friend D3DXMATRIX operator * (float, const D3DXMATRIX&); + + BOOL operator == (const D3DXMATRIX&) const; + BOOL operator != (const D3DXMATRIX&) const; +} D3DXMATRIX, *LPD3DXMATRIX; +#else /* !__cplusplus */ +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +#endif /* !__cplusplus */ + #ifdef __cplusplus extern "C" { #endif
1
0
0
0
Zebediah Figura : ws2_32: Do not use the WS_ prefix in PE code.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 815ac66558bfc035c03cb694cd7c36986c3150a4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=815ac66558bfc035c03cb694…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Aug 4 21:20:48 2021 -0500 ws2_32: Do not use the WS_ prefix in PE code. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/Makefile.in | 1 - dlls/ws2_32/async.c | 30 +- dlls/ws2_32/protocol.c | 269 +++++++------ dlls/ws2_32/socket.c | 870 +++++++++++++++++++++---------------------- dlls/ws2_32/unixlib.c | 1 + dlls/ws2_32/ws2_32.spec | 62 +-- dlls/ws2_32/ws2_32_private.h | 8 +- 7 files changed, 598 insertions(+), 643 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=815ac66558bfc035c03c…
1
0
0
0
Zebediah Figura : ws2_32: Build with msvcrt.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 0c81cc2782352d2b7bf88aef8ba5c86890e0556c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0c81cc2782352d2b7bf88aef…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Aug 4 21:20:47 2021 -0500 ws2_32: Build with msvcrt. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/Makefile.in | 2 + dlls/ws2_32/async.c | 3 -- dlls/ws2_32/protocol.c | 76 +++++++++++++++++-------------- dlls/ws2_32/socket.c | 40 ++++++++++------- dlls/ws2_32/unixlib.c | 34 ++++++++++++++ dlls/ws2_32/ws2_32_private.h | 103 ------------------------------------------- 6 files changed, 101 insertions(+), 157 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0c81cc2782352d2b7bf8…
1
0
0
0
Zebediah Figura : ws2_32: Read services from the etc/services file.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: d3138d711beedf3e06ac64f7ebad2d7f4d205c1a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d3138d711beedf3e06ac64f7…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Aug 4 21:20:46 2021 -0500 ws2_32: Read services from the etc/services file. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/protocol.c | 249 ++++++++++++++++++++++++++++--------------------- 1 file changed, 143 insertions(+), 106 deletions(-) diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c index c1789fb4c77..46b6a25fc69 100644 --- a/dlls/ws2_32/protocol.c +++ b/dlls/ws2_32/protocol.c @@ -29,8 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winsock); WINE_DECLARE_DEBUG_CHANNEL(winediag); -DECLARE_CRITICAL_SECTION(csWSgetXXXbyYYY); - static char *get_fqdn(void) { char *ret; @@ -949,39 +947,6 @@ int WINAPI GetHostNameW( WCHAR *name, int namelen ) } -static int list_size( char **list, int item_size ) -{ - int i, size = 0; - if (list) - { - for (i = 0; list[i]; i++) - size += (item_size ? item_size : strlen(list[i]) + 1); - size += (i + 1) * sizeof(char *); - } - return size; -} - -static int list_dup( char **src, char **dst, int item_size ) -{ - char *p; - int i; - - for (i = 0; src[i]; i++) - ; - p = (char *)(dst + i + 1); - - for (i = 0; src[i]; i++) - { - int count = item_size ? item_size : strlen(src[i]) + 1; - memcpy( p, src[i], count ); - dst[i] = p; - p += count; - } - dst[i] = NULL; - return p - (char *)dst; -} - - static char *read_etc_file( const WCHAR *filename, DWORD *ret_size ) { static const WCHAR key_pathW[] = {'S','y','s','t','e','m', @@ -1225,20 +1190,6 @@ struct WS_protoent * WINAPI WS_getprotobynumber( int number ) } -static char *strdup_lower( const char *str ) -{ - char *ret = HeapAlloc( GetProcessHeap(), 0, strlen(str) + 1 ); - int i; - - if (ret) - { - for (i = 0; str[i]; i++) ret[i] = tolower( str[i] ); - ret[i] = 0; - } - else SetLastError( WSAENOBUFS ); - return ret; -} - static struct WS_servent *get_servent_buffer( int size ) { struct per_thread_data *data = get_per_thread_data(); @@ -1253,31 +1204,120 @@ static struct WS_servent *get_servent_buffer( int size ) return data->se_buffer; } -static struct WS_servent *servent_from_unix( const struct servent *p_se ) +/* Parse the first valid line into a servent structure, returning NULL if + * there is no valid line. Updates cursor to point to the start of the next + * line or the end of the file. */ +static struct WS_servent *get_next_service( const char **cursor, const char *end ) { - char *p; - struct WS_servent *p_to; + const char *p = *cursor; - int size = (sizeof(*p_se) + - strlen(p_se->s_proto) + 1 + - strlen(p_se->s_name) + 1 + - list_size(p_se->s_aliases, 0)); + while (p < end) + { + const char *line_end, *next_line; + size_t needed_size, line_len; + unsigned int alias_count = 0; + struct WS_servent *serv; + const char *name; + int port; + char *q; - if (!(p_to = get_servent_buffer( size ))) return NULL; - p_to->s_port = p_se->s_port; + for (line_end = p; line_end < end && *line_end != '\n' && *line_end != '#'; ++line_end) + ; + TRACE( "parsing line %s\n", debugstr_an(p, line_end - p) ); - p = (char *)(p_to + 1); - p_to->s_name = p; - strcpy( p, p_se->s_name ); - p += strlen(p) + 1; + for (next_line = line_end; next_line < end && *next_line != '\n'; ++next_line) + ; + if (next_line < end) + ++next_line; /* skip over the newline */ - p_to->s_proto = p; - strcpy( p, p_se->s_proto ); - p += strlen(p) + 1; + p = next_non_space( p, line_end ); + if (p == line_end) + { + p = next_line; + continue; + } - p_to->s_aliases = (char **)p; - list_dup( p_se->s_aliases, p_to->s_aliases, 0 ); - return p_to; + /* parse the name */ + + name = p; + line_len = line_end - name; + + p = next_space( p, line_end ); + if (p == line_end) + { + p = next_line; + continue; + } + + p = next_non_space( p, line_end ); + + /* parse the port */ + + port = atoi( p ); + p = memchr( p, '/', line_end - p ); + if (!p) + { + p = next_line; + continue; + } + + p = next_space( p, line_end ); + p = next_non_space( p, line_end ); + + /* we will copy the entire line after the servent structure, then + * replace spaces with null bytes as necessary */ + + while (p < line_end) + { + ++alias_count; + + p = next_space( p, line_end ); + p = next_non_space( p, line_end ); + } + needed_size = sizeof(*serv) + line_len + 1 + (alias_count + 1) * sizeof(char *); + + if (!(serv = get_servent_buffer( needed_size ))) + { + SetLastError( WSAENOBUFS ); + return NULL; + } + + serv->s_port = htons( port ); + serv->s_aliases = (char **)(serv + 1); + serv->s_name = (char *)(serv->s_aliases + alias_count + 1); + + memcpy( serv->s_name, name, line_len ); + serv->s_name[line_len] = 0; + + line_end = serv->s_name + line_len; + + q = serv->s_name; + q = next_space( q, line_end ); + *q++ = 0; + q = next_non_space( q, line_end ); + /* skip over the number */ + q = memchr( q, '/', line_end - q ); + serv->s_proto = ++q; + q = next_space( q, line_end ); + if (q < line_end) *q++ = 0; + q = next_non_space( q, line_end ); + + alias_count = 0; + while (q < line_end) + { + serv->s_aliases[alias_count++] = q; + q = next_space( q, line_end ); + if (q < line_end) *q++ = 0; + q = next_non_space( q, line_end ); + } + serv->s_aliases[alias_count] = NULL; + + *cursor = next_line; + return serv; + } + + SetLastError( WSANO_DATA ); + return NULL; } @@ -1286,34 +1326,29 @@ static struct WS_servent *servent_from_unix( const struct servent *p_se ) */ struct WS_servent * WINAPI WS_getservbyname( const char *name, const char *proto ) { - struct WS_servent *retval = NULL; - struct servent *serv; - char *name_str; - char *proto_str = NULL; + static const WCHAR servicesW[] = {'s','e','r','v','i','c','e','s',0}; + struct WS_servent *serv; + const char *cursor; + char *file; + DWORD size; - if (!(name_str = strdup_lower( name ))) return NULL; + TRACE( "name %s, proto %s\n", debugstr_a(name), debugstr_a(proto) ); - if (proto && *proto) + if (!(file = read_etc_file( servicesW, &size ))) { - if (!(proto_str = strdup_lower( proto ))) - { - HeapFree( GetProcessHeap(), 0, name_str ); - return NULL; - } + SetLastError( WSANO_DATA ); + return NULL; } - EnterCriticalSection( &csWSgetXXXbyYYY ); - serv = getservbyname( name_str, proto_str ); - if (serv) - retval = servent_from_unix( serv ); - else - SetLastError( WSANO_DATA ); - LeaveCriticalSection( &csWSgetXXXbyYYY ); + cursor = file; + while ((serv = get_next_service( &cursor, file + size ))) + { + if (!strcasecmp( serv->s_name, name ) && (!proto || !strcasecmp( serv->s_proto, proto ))) + break; + } - HeapFree( GetProcessHeap(), 0, proto_str ); - HeapFree( GetProcessHeap(), 0, name_str ); - TRACE( "%s, %s ret %p\n", debugstr_a(name), debugstr_a(proto), retval ); - return retval; + HeapFree( GetProcessHeap(), 0, file ); + return serv; } @@ -1322,27 +1357,29 @@ struct WS_servent * WINAPI WS_getservbyname( const char *name, const char *proto */ struct WS_servent * WINAPI WS_getservbyport( int port, const char *proto ) { - struct WS_servent *retval = NULL; -#ifdef HAVE_GETSERVBYPORT - struct servent *serv; - char *proto_str = NULL; + static const WCHAR servicesW[] = {'s','e','r','v','i','c','e','s',0}; + struct WS_servent *serv; + const char *cursor; + char *file; + DWORD size; - if (proto && *proto) + TRACE( "port %d, proto %s\n", port, debugstr_a(proto) ); + + if (!(file = read_etc_file( servicesW, &size ))) { - if (!(proto_str = strdup_lower( proto ))) return NULL; + SetLastError( WSANO_DATA ); + return NULL; } - EnterCriticalSection( &csWSgetXXXbyYYY ); - if ((serv = getservbyport( port, proto_str ))) - retval = servent_from_unix( serv ); - else - SetLastError( WSANO_DATA ); - LeaveCriticalSection( &csWSgetXXXbyYYY ); + cursor = file; + while ((serv = get_next_service( &cursor, file + size ))) + { + if (serv->s_port == port && (!proto || !strcasecmp( serv->s_proto, proto ))) + break; + } - HeapFree( GetProcessHeap(), 0, proto_str ); -#endif - TRACE( "%d (i.e. port %d), %s ret %p\n", port, (int)ntohl(port), debugstr_a(proto), retval ); - return retval; + HeapFree( GetProcessHeap(), 0, file ); + return serv; }
1
0
0
0
Zebediah Figura : ws2_32: Read protocols from the etc/protocol file.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 8504e40d5b5e7076b998b36e6291515b863482cb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8504e40d5b5e7076b998b36e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Wed Aug 4 21:20:45 2021 -0500 ws2_32: Read protocols from the etc/protocol file. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/Makefile.in | 2 +- dlls/ws2_32/protocol.c | 262 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 198 insertions(+), 66 deletions(-) diff --git a/dlls/ws2_32/Makefile.in b/dlls/ws2_32/Makefile.in index 77983bba66f..691c8fe1d65 100644 --- a/dlls/ws2_32/Makefile.in +++ b/dlls/ws2_32/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DUSE_WS_PREFIX MODULE = ws2_32.dll IMPORTLIB = ws2_32 -DELAYIMPORTS = iphlpapi user32 +DELAYIMPORTS = advapi32 iphlpapi user32 EXTRALIBS = $(POLL_LIBS) C_SRCS = \ diff --git a/dlls/ws2_32/protocol.c b/dlls/ws2_32/protocol.c index 8b39d5c3274..c1789fb4c77 100644 --- a/dlls/ws2_32/protocol.c +++ b/dlls/ws2_32/protocol.c @@ -981,33 +981,64 @@ static int list_dup( char **src, char **dst, int item_size ) return p - (char *)dst; } -static const struct -{ - int prot; - const char *names[3]; -} -protocols[] = -{ - { 0, {"ip", "IP"}}, - { 1, {"icmp", "ICMP"}}, - { 3, {"ggp", "GGP"}}, - { 6, {"tcp", "TCP"}}, - { 8, {"egp", "EGP"}}, - {12, {"pup", "PUP"}}, - {17, {"udp", "UDP"}}, - {20, {"hmp", "HMP"}}, - {22, {"xns-idp", "XNS-IDP"}}, - {27, {"rdp", "RDP"}}, - {41, {"ipv6", "IPv6"}}, - {43, {"ipv6-route", "IPv6-Route"}}, - {44, {"ipv6-frag", "IPv6-Frag"}}, - {50, {"esp", "ESP"}}, - {51, {"ah", "AH"}}, - {58, {"ipv6-icmp", "IPv6-ICMP"}}, - {59, {"ipv6-nonxt", "IPv6-NoNxt"}}, - {60, {"ipv6-opts", "IPv6-Opts"}}, - {66, {"rvd", "RVD"}}, -}; + +static char *read_etc_file( const WCHAR *filename, DWORD *ret_size ) +{ + static const WCHAR key_pathW[] = {'S','y','s','t','e','m', + '\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t', + '\\','S','e','r','v','i','c','e','s', + '\\','t','c','p','i','p', + '\\','P','a','r','a','m','e','t','e','r','s',0}; + static const WCHAR databasepathW[] = {'D','a','t','a','b','a','s','e','P','a','t','h',0}; + static const WCHAR backslashW[] = {'\\',0}; + WCHAR path[MAX_PATH]; + DWORD size = sizeof(path); + HANDLE file; + char *data; + LONG ret; + + if ((ret = RegGetValueW( HKEY_LOCAL_MACHINE, key_pathW, databasepathW, RRF_RT_REG_SZ, NULL, path, &size ))) + { + ERR( "failed to get database path, error %u\n", ret ); + return NULL; + } + lstrcatW( path, backslashW ); + lstrcatW( path, filename ); + + file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); + if (file == INVALID_HANDLE_VALUE) + { + ERR( "failed to open %s, error %u\n", debugstr_w( path ), GetLastError() ); + return NULL; + } + + size = GetFileSize( file, NULL ); + if (!(data = HeapAlloc( GetProcessHeap(), 0, size )) || + !ReadFile( file, data, size, ret_size, NULL )) + { + WARN( "failed to read file, error %u\n", GetLastError() ); + HeapFree( GetProcessHeap(), 0, data ); + data = NULL; + } + CloseHandle( file ); + return data; +} + +/* returns "end" if there was no space */ +static char *next_space( const char *p, const char *end ) +{ + while (p < end && !isspace( *p )) + ++p; + return (char *)p; +} + +/* returns "end" if there was no non-space */ +static char *next_non_space( const char *p, const char *end ) +{ + while (p < end && isspace( *p )) + ++p; + return (char *)p; +} static struct WS_protoent *get_protoent_buffer( unsigned int size ) { @@ -1024,18 +1055,111 @@ static struct WS_protoent *get_protoent_buffer( unsigned int size ) return data->pe_buffer; } -static struct WS_protoent *create_protoent( const char *name, char **aliases, int prot ) +/* Parse the first valid line into a protoent structure, returning NULL if + * there is no valid line. Updates cursor to point to the start of the next + * line or the end of the file. */ +static struct WS_protoent *get_next_protocol( const char **cursor, const char *end ) { - struct WS_protoent *ret; - unsigned int size = sizeof(*ret) + strlen( name ) + sizeof(char *) + list_size( aliases, 0 ); + const char *p = *cursor; - if (!(ret = get_protoent_buffer( size ))) return NULL; - ret->p_proto = prot; - ret->p_name = (char *)(ret + 1); - strcpy( ret->p_name, name ); - ret->p_aliases = (char **)ret->p_name + strlen( name ) / sizeof(char *) + 1; - list_dup( aliases, ret->p_aliases, 0 ); - return ret; + while (p < end) + { + const char *line_end, *next_line; + size_t needed_size, line_len; + unsigned int alias_count = 0; + struct WS_protoent *proto; + const char *name; + int number; + char *q; + + for (line_end = p; line_end < end && *line_end != '\n' && *line_end != '#'; ++line_end) + ; + TRACE( "parsing line %s\n", debugstr_an(p, line_end - p) ); + + for (next_line = line_end; next_line < end && *next_line != '\n'; ++next_line) + ; + if (next_line < end) + ++next_line; /* skip over the newline */ + + p = next_non_space( p, line_end ); + if (p == line_end) + { + p = next_line; + continue; + } + + /* parse the name */ + + name = p; + line_len = line_end - name; + + p = next_space( p, line_end ); + if (p == line_end) + { + p = next_line; + continue; + } + + p = next_non_space( p, line_end ); + + /* parse the number */ + + number = atoi( p ); + + p = next_space( p, line_end ); + p = next_non_space( p, line_end ); + + /* we will copy the entire line after the protoent structure, then + * replace spaces with null bytes as necessary */ + + while (p < line_end) + { + ++alias_count; + + p = next_space( p, line_end ); + p = next_non_space( p, line_end ); + } + needed_size = sizeof(*proto) + line_len + 1 + (alias_count + 1) * sizeof(char *); + + if (!(proto = get_protoent_buffer( needed_size ))) + { + SetLastError( WSAENOBUFS ); + return NULL; + } + + proto->p_proto = number; + proto->p_aliases = (char **)(proto + 1); + proto->p_name = (char *)(proto->p_aliases + alias_count + 1); + + memcpy( proto->p_name, name, line_len ); + proto->p_name[line_len] = 0; + + line_end = proto->p_name + line_len; + + q = proto->p_name; + q = next_space( q, line_end ); + *q++ = 0; + q = next_non_space( q, line_end ); + /* skip over the number */ + q = next_space( q, line_end ); + q = next_non_space( q, line_end ); + + alias_count = 0; + while (q < line_end) + { + proto->p_aliases[alias_count++] = q; + q = next_space( q, line_end ); + if (q < line_end) *q++ = 0; + q = next_non_space( q, line_end ); + } + proto->p_aliases[alias_count] = NULL; + + *cursor = next_line; + return proto; + } + + SetLastError( WSANO_DATA ); + return NULL; } @@ -1044,25 +1168,29 @@ static struct WS_protoent *create_protoent( const char *name, char **aliases, in */ struct WS_protoent * WINAPI WS_getprotobyname( const char *name ) { - struct WS_protoent *retval = NULL; - unsigned int i; + static const WCHAR protocolW[] = {'p','r','o','t','o','c','o','l',0}; + struct WS_protoent *proto; + const char *cursor; + char *file; + DWORD size; - for (i = 0; i < ARRAY_SIZE(protocols); i++) + TRACE( "%s\n", debugstr_a(name) ); + + if (!(file = read_etc_file( protocolW, &size ))) { - if (!_strnicmp( protocols[i].names[0], name, -1 )) - { - retval = create_protoent( protocols[i].names[0], (char **)protocols[i].names + 1, - protocols[i].prot ); - break; - } + SetLastError( WSANO_DATA ); + return NULL; } - if (!retval) + + cursor = file; + while ((proto = get_next_protocol( &cursor, file + size ))) { - WARN( "protocol %s not found\n", debugstr_a(name) ); - SetLastError( WSANO_DATA ); + if (!strcasecmp( proto->p_name, name )) + break; } - TRACE( "%s ret %p\n", debugstr_a(name), retval ); - return retval; + + HeapFree( GetProcessHeap(), 0, file ); + return proto; } @@ -1071,25 +1199,29 @@ struct WS_protoent * WINAPI WS_getprotobyname( const char *name ) */ struct WS_protoent * WINAPI WS_getprotobynumber( int number ) { - struct WS_protoent *retval = NULL; - unsigned int i; + static const WCHAR protocolW[] = {'p','r','o','t','o','c','o','l',0}; + struct WS_protoent *proto; + const char *cursor; + char *file; + DWORD size; + + TRACE( "%d\n", number ); - for (i = 0; i < ARRAY_SIZE(protocols); i++) + if (!(file = read_etc_file( protocolW, &size ))) { - if (protocols[i].prot == number) - { - retval = create_protoent( protocols[i].names[0], (char **)protocols[i].names + 1, - protocols[i].prot ); - break; - } + SetLastError( WSANO_DATA ); + return NULL; } - if (!retval) + + cursor = file; + while ((proto = get_next_protocol( &cursor, file + size ))) { - WARN( "protocol %d not found\n", number ); - SetLastError( WSANO_DATA ); + if (proto->p_proto == number) + break; } - TRACE( "%d ret %p\n", number, retval ); - return retval; + + HeapFree( GetProcessHeap(), 0, file ); + return proto; }
1
0
0
0
Alex Henrie : include: Add remaining IPv6 socket options.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 8e1f149ecd7c6288979591b8602f478aa0da2c5b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8e1f149ecd7c6288979591b8…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Aug 5 23:26:26 2021 -0600 include: Add remaining IPv6 socket options. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/ws2ipdef.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index 0938db2db9f..d5a4dab6ce0 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -207,6 +207,17 @@ typedef struct WS(in6_pktinfo) { #define IPV6_UNICAST_IF 31 #define IPV6_RTHDR 32 #define IPV6_RECVRTHDR 38 +#define IPV6_TCLASS 39 +#define IPV6_RECVTCLASS 40 +#define IPV6_ECN 50 +#define IPV6_PKTINFO_EX 51 +#define IPV6_WFP_REDIRECT_RECORDS 60 +#define IPV6_WFP_REDIRECT_CONTEXT 70 +#define IPV6_MTU_DISCOVER 71 +#define IPV6_MTU 72 +#define IPV6_NRT_INTERFACE 74 +#define IPV6_RECVERR 75 +#define IPV6_USER_MTU 76 #else #define WS_IPV6_OPTIONS 1 #define WS_IPV6_HDRINCL 2 @@ -231,6 +242,17 @@ typedef struct WS(in6_pktinfo) { #define WS_IPV6_UNICAST_IF 31 #define WS_IPV6_RTHDR 32 #define WS_IPV6_RECVRTHDR 38 +#define WS_IPV6_TCLASS 39 +#define WS_IPV6_RECVTCLASS 40 +#define WS_IPV6_ECN 50 +#define WS_IPV6_PKTINFO_EX 51 +#define WS_IPV6_WFP_REDIRECT_RECORDS 60 +#define WS_IPV6_WFP_REDIRECT_CONTEXT 70 +#define WS_IPV6_MTU_DISCOVER 71 +#define WS_IPV6_MTU 72 +#define WS_IPV6_NRT_INTERFACE 74 +#define WS_IPV6_RECVERR 75 +#define WS_IPV6_USER_MTU 76 #endif /* USE_WS_PREFIX */ #ifndef USE_WS_PREFIX
1
0
0
0
Alex Henrie : ntdll: Add missing break to case IPV6_PKTINFO.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 21752cc9568de4e1c4219b43ca630c3528ca1a84 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=21752cc9568de4e1c4219b43…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Aug 5 23:26:25 2021 -0600 ntdll: Add missing break to case IPV6_PKTINFO. Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 4f1b9a468eb..35c846eb7ae 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -458,6 +458,7 @@ static int convert_control_headers(struct msghdr *hdr, WSABUF *control) ptr = fill_control_message( WS_IPPROTO_IPV6, WS_IPV6_PKTINFO, ptr, &ctlsize, (void *)&data_win, sizeof(data_win) ); if (!ptr) goto error; + break; } #endif /* IPV6_PKTINFO */
1
0
0
0
Gerald Pfeifer : nsiproxy: Include sys/types.h.
by Alexandre Julliard
06 Aug '21
06 Aug '21
Module: wine Branch: master Commit: 9ddc04c671525c3be62f32e1c07c20017a6124a8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9ddc04c671525c3be62f32e1…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Thu Aug 5 17:46:23 2021 +0200 nsiproxy: Include sys/types.h. Signed-off-by: Gerald Pfeifer <gerald(a)pfeifer.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/nsiproxy.sys/ip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index fa88b8e0819..cb98c6a5206 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -21,6 +21,10 @@ #include "config.h" #include <stdarg.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif
1
0
0
0
← Newer
1
...
82
83
84
85
86
87
88
...
106
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
Results per page:
10
25
50
100
200