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
October 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
614 discussions
Start a n
N
ew thread
Paul Gofman : d3dx9: Use check_texture_requirements() in D3DXCheckCubeTextureRequirements() with correct resource type.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: e50873f504b4693c9efcf7113afcb633155babbc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e50873f504b4693c9efcf711…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri Oct 25 20:30:57 2019 +0300 d3dx9: Use check_texture_requirements() in D3DXCheckCubeTextureRequirements() with correct resource type. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 57326f406a..9cd91789b1 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -450,7 +450,7 @@ HRESULT WINAPI D3DXCheckCubeTextureRequirements(struct IDirect3DDevice9 *device, if ((caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2) && (!is_pow2(s))) s = make_pow2(s); - hr = D3DXCheckTextureRequirements(device, &s, &s, miplevels, usage, format, pool); + hr = check_texture_requirements(device, &s, &s, miplevels, usage, format, pool, D3DRTYPE_CUBETEXTURE); if (!(caps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP)) {
1
0
0
0
Paul Gofman : d3dx9: Factor our check_texture_requirements() function.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: 92c8c0fc7fb95209fa9dec25234d16b1dbddcf2a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=92c8c0fc7fb95209fa9dec25…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon Oct 28 09:27:40 2019 +0300 d3dx9: Factor our check_texture_requirements() function. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/texture.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 736d11dfad..57326f406a 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -210,8 +210,8 @@ static D3DFORMAT get_replacement_format(D3DFORMAT format) return format; } -HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, - UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool) +static HRESULT check_texture_requirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, + UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool, D3DRESOURCETYPE resource_type) { UINT w = (width && *width) ? *width : 1; UINT h = (height && *height) ? *height : 1; @@ -223,8 +223,6 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN D3DFORMAT usedformat = D3DFMT_UNKNOWN; const struct pixel_format_desc *fmt; - TRACE("(%p, %p, %p, %p, %u, %p, %u)\n", device, width, height, miplevels, usage, format, pool); - if (!device) return D3DERR_INVALIDCALL; @@ -266,7 +264,7 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN fmt = get_format_info(usedformat); hr = IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, mode.Format, - usage, D3DRTYPE_TEXTURE, usedformat); + usage, resource_type, usedformat); if (FAILED(hr)) { BOOL allow_24bits; @@ -301,7 +299,7 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN continue; hr = IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, - mode.Format, usage, D3DRTYPE_TEXTURE, curfmt->format); + mode.Format, usage, resource_type, curfmt->format); if (FAILED(hr)) continue; @@ -422,6 +420,15 @@ cleanup: return D3D_OK; } +HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UINT *width, UINT *height, + UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool) +{ + TRACE("device %p, width %p, height %p, miplevels %p, usage %u, format %p, pool %u.\n", + device, width, height, miplevels, usage, format, pool); + + return check_texture_requirements(device, width, height, miplevels, usage, format, pool, D3DRTYPE_TEXTURE); +} + HRESULT WINAPI D3DXCheckCubeTextureRequirements(struct IDirect3DDevice9 *device, UINT *size, UINT *miplevels, DWORD usage, D3DFORMAT *format, D3DPOOL pool) {
1
0
0
0
Matteo Bruni : d3dx9: Return an error if no fallback format is found.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: fcdcd5d3cbb58a40894f661fd8a9285b81a55789 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fcdcd5d3cbb58a40894f661f…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Oct 30 10:24:39 2019 +0100 d3dx9: Return an error if no fallback format is found. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/texture.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 12cb2f3983..736d11dfad 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -323,6 +323,11 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN bestfmt = curfmt; } } + if (!bestfmt) + { + hr = D3DERR_NOTAVAILABLE; + goto cleanup; + } fmt = bestfmt; hr = D3D_OK; }
1
0
0
0
Paul Gofman : d3dx9: Don't pass usage flags for staging texture in D3DXCreateCubeTextureFromFileInMemoryEx().
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: a0840773f7ee00dc9373b4db825fec68d08ee53b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a0840773f7ee00dc9373b4db…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri Oct 25 20:30:54 2019 +0300 d3dx9: Don't pass usage flags for staging texture in D3DXCreateCubeTextureFromFileInMemoryEx(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47974
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/tests/texture.c | 17 ++++++++++++----- dlls/d3dx9_36/texture.c | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 3416a3318b..3e4d5e5df9 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -2061,8 +2061,14 @@ static void test_D3DXCreateCubeTextureFromFileInMemory(IDirect3DDevice9 *device) static void test_D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device) { - HRESULT hr; IDirect3DCubeTexture9 *cube_texture; + HRESULT hr; + + hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map, sizeof(dds_cube_map), D3DX_DEFAULT, + D3DX_DEFAULT, D3DUSAGE_RENDERTARGET, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT, + D3DX_DEFAULT, 0, NULL, NULL, &cube_texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DCubeTexture9_Release(cube_texture); if (!is_autogenmipmap_supported(device, D3DRTYPE_CUBETEXTURE)) { @@ -2070,10 +2076,11 @@ static void test_D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *devic return; } - hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map, sizeof(dds_cube_map), D3DX_DEFAULT, D3DX_DEFAULT, - D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &cube_texture); - ok(hr == D3D_OK, "D3DXCreateCubeTextureFromFileInMemoryEx returned %#x, expected %#x.\n", hr, D3D_OK); - if (SUCCEEDED(hr)) IDirect3DCubeTexture9_Release(cube_texture); + hr = D3DXCreateCubeTextureFromFileInMemoryEx(device, dds_cube_map, sizeof(dds_cube_map), D3DX_DEFAULT, + D3DX_DEFAULT, D3DUSAGE_DYNAMIC | D3DUSAGE_AUTOGENMIPMAP, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, + D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &cube_texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DCubeTexture9_Release(cube_texture); } static void test_D3DXCreateVolumeTextureFromFileInMemory(IDirect3DDevice9 *device) diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 6ee7d72e38..12cb2f3983 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -1481,7 +1481,7 @@ HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx(IDirect3DDevice9 *device, dynamic_texture = (caps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) && (usage & D3DUSAGE_DYNAMIC); if (pool == D3DPOOL_DEFAULT && !dynamic_texture) { - hr = D3DXCreateCubeTexture(device, size, mip_levels, usage, format, D3DPOOL_SYSTEMMEM, &buftex); + hr = D3DXCreateCubeTexture(device, size, mip_levels, 0, format, D3DPOOL_SYSTEMMEM, &buftex); tex = buftex; } else
1
0
0
0
Michael Stefaniuc : t2embed: Use a wchar string literal instead of a temp variable.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: 85925f69071efa02cf5fe4ecba32959369c72adf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85925f69071efa02cf5fe4ec…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Oct 30 00:41:35 2019 +0100 t2embed: Use a wchar string literal instead of a temp variable. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/t2embed/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/t2embed/main.c b/dlls/t2embed/main.c index e47884611c..1200564028 100644 --- a/dlls/t2embed/main.c +++ b/dlls/t2embed/main.c @@ -107,8 +107,6 @@ LONG WINAPI TTGetEmbeddingType(HDC hDC, ULONG *status) LONG WINAPI TTIsEmbeddingEnabledForFacename(LPCSTR facename, BOOL *enabled) { - static const WCHAR exclusionlistW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', - 'S','h','a','r','e','d',' ','T','o','o','l','s','\\','t','2','e','m','b','e','d',0}; DWORD index; HKEY hkey; LONG ret; @@ -122,7 +120,7 @@ LONG WINAPI TTIsEmbeddingEnabledForFacename(LPCSTR facename, BOOL *enabled) return E_PBENABLEDINVALID; *enabled = TRUE; - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, exclusionlistW, 0, GENERIC_READ, &hkey)) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Shared Tools\\t2embed", 0, GENERIC_READ, &hkey)) goto out; *enabled = TRUE;
1
0
0
0
Michael Stefaniuc : dmsynth: Use a wchar string literal instead of a temp variable.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: c547d8c9a4b73529607d20b81f36cb0762ea99b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c547d8c9a4b73529607d20b8…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Oct 29 22:58:11 2019 +0100 dmsynth: Use a wchar string literal instead of a temp variable. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmsynth/synth.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index ebc92afdf0..6d2c778a74 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -574,8 +574,6 @@ static const IKsControlVtbl DMSynthImpl_IKsControl_Vtbl = { /* for ClassFactory */ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) { - static const WCHAR descrW[] = {'M','i','c','r','o','s','o','f','t',' ', - 'S','y','n','t','h','e','s','i','z','e','r',0}; IDirectMusicSynth8Impl *obj; HRESULT hr; @@ -600,7 +598,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj) obj->pCaps.dwMaxVoices = 1000; obj->pCaps.dwMaxAudioChannels = 2; obj->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB; - lstrcpyW(obj->pCaps.wszDescription, descrW); + lstrcpyW(obj->pCaps.wszDescription, L"Microsoft Synthesizer"); DMSYNTH_LockModule(); hr = IDirectMusicSynth8_QueryInterface(&obj->IDirectMusicSynth8_iface, riid, ppobj);
1
0
0
0
Michael Stefaniuc : mfreadwrite: Use wchar string literals instead of temp variables.
by Alexandre Julliard
30 Oct '19
30 Oct '19
Module: wine Branch: master Commit: 7bc4e49f119ea67829d0efc469d125e9f1d4154e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7bc4e49f119ea67829d0efc4…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Oct 30 00:41:34 2019 +0100 mfreadwrite: Use wchar string literals instead of temp variables. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfreadwrite/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 6859af8d53..3467746bb8 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -1123,8 +1123,6 @@ static HRESULT bytestream_get_url_hint(IMFByteStream *stream, WCHAR const **url) static const UINT8 asfmagic[] = {0x30,0x26,0xb2,0x75,0x8e,0x66,0xcf,0x11,0xa6,0xd9,0x00,0xaa,0x00,0x62,0xce,0x6c}; static const UINT8 wavmagic[] = { 'R', 'I', 'F', 'F',0x00,0x00,0x00,0x00, 'W', 'A', 'V', 'E', 'f', 'm', 't', ' '}; static const UINT8 wavmask[] = {0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; - static const WCHAR asfW[] = {'.','a','s','f',0}; - static const WCHAR wavW[] = {'.','w','a','v',0}; static const struct stream_content_url_hint { const UINT8 *magic; @@ -1134,8 +1132,8 @@ static HRESULT bytestream_get_url_hint(IMFByteStream *stream, WCHAR const **url) } url_hints[] = { - { asfmagic, sizeof(asfmagic), asfW }, - { wavmagic, sizeof(wavmagic), wavW, wavmask }, + { asfmagic, sizeof(asfmagic), L".asf" }, + { wavmagic, sizeof(wavmagic), L".wav", wavmask }, }; UINT8 buffer[4 * sizeof(unsigned int)]; IMFAttributes *attributes;
1
0
0
0
Jacek Caban : vbscript: Add support for interpreting statements.
by Alexandre Julliard
29 Oct '19
29 Oct '19
Module: wine Branch: master Commit: e8b2f85bb1d37401f799eeb4a722052718bf8221 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e8b2f85bb1d37401f799eeb4…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Oct 29 19:01:23 2019 +0100 vbscript: Add support for interpreting statements. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 41 +++++++++++++++++++++++++++++++++++++++++ dlls/vbscript/interp.c | 20 ++++++++++++++++++++ dlls/vbscript/vbscript.h | 1 + dlls/vbscript/vbscript.rc | 1 + dlls/vbscript/vbscript_defs.h | 1 + 5 files changed, 64 insertions(+) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 2023261399..07279794c6 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -32,6 +32,7 @@ typedef struct _statement_ctx_t { unsigned while_end_label; unsigned for_end_label; + unsigned with_stack_offset; struct _statement_ctx_t *next; } statement_ctx_t; @@ -475,6 +476,21 @@ static HRESULT compile_call_expression(compile_ctx_t *ctx, call_expression_t *ex return push_instr_uint(ctx, ret_val ? OP_vcall : OP_vcallv, arg_cnt); } +static HRESULT compile_dot_expression(compile_ctx_t *ctx) +{ + statement_ctx_t *stat_ctx; + + for(stat_ctx = ctx->stat_ctx; stat_ctx; stat_ctx = stat_ctx->next) { + if(!stat_ctx->with_stack_offset) + continue; + + return push_instr_uint(ctx, OP_stack, stat_ctx->with_stack_offset - 1); + } + + WARN("dot expression outside with statement\n"); + return push_instr_uint(ctx, OP_stack, ~0); +} + static HRESULT compile_unary_expression(compile_ctx_t *ctx, unary_expression_t *expr, vbsop_t op) { HRESULT hres; @@ -518,6 +534,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_concat); case EXPR_DIV: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_div); + case EXPR_DOT: + return compile_dot_expression(ctx); case EXPR_DOUBLE: return push_instr_double(ctx, OP_double, ((double_expression_t*)expr)->value); case EXPR_EMPTY: @@ -858,6 +876,26 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st return S_OK; } +static HRESULT compile_with_statement(compile_ctx_t *ctx, with_statement_t *stat) +{ + statement_ctx_t with_ctx = { 1 }; + HRESULT hres; + + hres = compile_expression(ctx, stat->expr); + if(FAILED(hres)) + return hres; + + if(!emit_catch(ctx, 1)) + return E_OUTOFMEMORY; + + with_ctx.with_stack_offset = stack_offset(ctx) + 1; + hres = compile_statement(ctx, &with_ctx, stat->body); + if(FAILED(hres)) + return hres; + + return push_instr_uint(ctx, OP_pop, 1); +} + static HRESULT compile_select_statement(compile_ctx_t *ctx, select_statement_t *stat) { unsigned end_label, case_cnt = 0, *case_labels = NULL, i; @@ -1320,6 +1358,9 @@ static HRESULT compile_statement(compile_ctx_t *ctx, statement_ctx_t *stat_ctx, case STAT_WHILELOOP: hres = compile_while_statement(ctx, (while_statement_t*)stat); break; + case STAT_WITH: + hres = compile_with_statement(ctx, (with_statement_t*)stat); + break; case STAT_RETVAL: hres = compile_retval_statement(ctx, (retval_statement_t*)stat); break; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 60c4340d6e..2b681a0677 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1028,6 +1028,26 @@ static HRESULT interp_pop(exec_ctx_t *ctx) return S_OK; } +static HRESULT interp_stack(exec_ctx_t *ctx) +{ + const unsigned n = ctx->instr->arg1.uint; + VARIANT v; + HRESULT hres; + + TRACE("%#x\n", n); + + if(n == ~0) + return MAKE_VBSERROR(505); + assert(n < ctx->top); + + V_VT(&v) = VT_EMPTY; + hres = VariantCopy(&v, ctx->stack + n); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); +} + static HRESULT interp_deref(exec_ctx_t *ctx) { VARIANT copy, *v = stack_top(ctx, 0); diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 33eb1e8305..fefed63edb 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -267,6 +267,7 @@ typedef enum { X(retval, 1, 0, 0) \ X(set_ident, 1, ARG_BSTR, ARG_UINT) \ X(set_member, 1, ARG_BSTR, ARG_UINT) \ + X(stack, 1, ARG_UINT, 0) \ X(step, 0, ARG_ADDR, ARG_BSTR) \ X(stop, 1, 0, 0) \ X(string, 1, ARG_STR, 0) \ diff --git a/dlls/vbscript/vbscript.rc b/dlls/vbscript/vbscript.rc index 360b1006d6..0791c3b53f 100644 --- a/dlls/vbscript/vbscript.rc +++ b/dlls/vbscript/vbscript.rc @@ -54,6 +54,7 @@ STRINGTABLE VBSE_INVALID_DLL_FUNCTION_NAME "Specified DLL function not found" VBSE_INVALID_TYPELIB_VARIABLE "Variable uses an Automation type not supported in VBScript" VBSE_SERVER_NOT_FOUND "The remote server machine does not exist or is unavailable" + VBSE_UNQUALIFIED_REFERENCE "Invalid or unqualified reference" VBS_COMPILE_ERROR "Microsoft VBScript compilation error" VBS_RUNTIME_ERROR "Microsoft VBScript runtime error" diff --git a/dlls/vbscript/vbscript_defs.h b/dlls/vbscript/vbscript_defs.h index 44f005b640..139b71255a 100644 --- a/dlls/vbscript/vbscript_defs.h +++ b/dlls/vbscript/vbscript_defs.h @@ -267,6 +267,7 @@ #define VBSE_INVALID_DLL_FUNCTION_NAME 453 #define VBSE_INVALID_TYPELIB_VARIABLE 458 #define VBSE_SERVER_NOT_FOUND 462 +#define VBSE_UNQUALIFIED_REFERENCE 505 #define VBS_COMPILE_ERROR 4096 #define VBS_RUNTIME_ERROR 4097
1
0
0
0
Jacek Caban : vbscript/tests: Add with statement tests.
by Alexandre Julliard
29 Oct '19
29 Oct '19
Module: wine Branch: master Commit: 666f7501d03983f84833a7a1952e78fd0650fde6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=666f7501d03983f84833a7a1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Oct 29 19:01:35 2019 +0100 vbscript/tests: Add with statement tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/tests/error.vbs | 71 +++++++++++++++++++++++++++++++++++++++++++ dlls/vbscript/tests/lang.vbs | 15 +++++++++ dlls/vbscript/tests/run.c | 12 ++++++++ 3 files changed, 98 insertions(+) diff --git a/dlls/vbscript/tests/error.vbs b/dlls/vbscript/tests/error.vbs index 78314c3569..13f9a2072e 100644 --- a/dlls/vbscript/tests/error.vbs +++ b/dlls/vbscript/tests/error.vbs @@ -77,6 +77,13 @@ const CO_E_SERVER_EXEC_FAILURE = &h80080005& call ok(Err.Number = 0, "Err.Number = " & Err.Number) call ok(getVT(Err.Number) = "VT_I4", "getVT(Err.Number) = " & getVT(Err.Number)) +class emptyclass +end class + +class propclass + public prop +end class + dim calledFunc sub returnTrue @@ -313,6 +320,70 @@ end sub call testForEachError() +sub testWithError() + on error resume next + dim x + + err.clear + x = false + with throwInt(E_TESTERROR) + ok Err.Number = E_TESTERROR, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" + + err.clear + x = false + with throwInt(E_TESTERROR) + x = true + .prop = 1 + todo_wine_ok Err.Number = 424, "Err.Number = " & Err.Number + end with + ok x, "with statement body not executed" + + err.clear + x = false + with empty + .prop = 1 + todo_wine_ok Err.Number = 424, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" +end sub + +sub testWithError2() + on error resume next + dim x + + err.clear + x = false + with new emptyclass + .prop = 1 + ok Err.Number = 438, "Err.Number = " & Err.Number + x = true + end with + ok x, "with statement body not executed" + + 'dot expression can reference only inner-most with statement + err.clear + x = false + with new propclass + with new emptyclass + .prop = 1 + ok Err.Number = 438, "Err.Number = " & Err.Number + x = true + end with + end with + ok x, "with statement body not executed" + + err.clear + .prop + ok Err.Number = 505, "Err.Number = " & Err.Number & " description """ & err.description & """" +end sub + +call testWithError() +call testWithError2() + sub testHresMap(hres, code) on error resume next diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 8027264bf5..f7cdc92ec4 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1568,4 +1568,19 @@ call ok(x.getProp.prop.prop = 3, "x.getProp.prop.prop = " & x.getProp.prop.prop) ok getVT(x) = "VT_DISPATCH*", "getVT(x) = " & getVT(x) todo_wine_ok getVT(x()) = "VT_BSTR", "getVT(x()) = " & getVT(x()) +with nothing +end with + +set x = new TestPropSyntax +with x + .prop = 1 + ok .prop = 1, ".prop = "&.prop +end with +ok x.prop = 1, "x.prop = " & x.prop + +with new TestPropSyntax + .prop = 1 + ok .prop = 1, ".prop = "&.prop +end with + reportSuccess() diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 2c0ccdd25b..19b562852d 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2920,6 +2920,18 @@ static void run_tests(void) CHECK_CALLED(global_propargput1_d); CHECK_CALLED(global_propargput1_i); + SET_EXPECT(testobj_propget_d); + SET_EXPECT(testobj_propget_i); + parse_script_a("dim x\nwith testObj\nx=1+.propget\nend with"); + CHECK_CALLED(testobj_propget_d); + CHECK_CALLED(testobj_propget_i); + + SET_EXPECT(testobj_propput_d); + SET_EXPECT(testobj_propput_i); + parse_script_a("with testObj\n.propput = 1\nend with"); + CHECK_CALLED(testobj_propput_d); + CHECK_CALLED(testobj_propput_i); + parse_htmlscript_a("<!--"); parse_htmlscript_a(" -->"); parse_htmlscript_a("<!--\ndim x\nx=1\n-->\n");
1
0
0
0
Jacek Caban : vbscript: Add support for parsing with statement.
by Alexandre Julliard
29 Oct '19
29 Oct '19
Module: wine Branch: master Commit: 74ab018763337e27e785ffcec7e4cab0e0e80ddb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74ab018763337e27e785ffce…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Oct 29 19:01:14 2019 +0100 vbscript: Add support for parsing with statement. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/lex.c | 11 ++++++++++- dlls/vbscript/parse.h | 8 ++++++++ dlls/vbscript/parser.y | 22 ++++++++++++++++++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c index 6b20d1979d..d8c5ed3004 100644 --- a/dlls/vbscript/lex.c +++ b/dlls/vbscript/lex.c @@ -88,6 +88,7 @@ static const struct { {L"until", tUNTIL}, {L"wend", tWEND}, {L"while", tWHILE}, + {L"with", tWITH}, {L"xor", tXOR} }; @@ -379,9 +380,17 @@ static int parse_next_token(void *lval, parser_ctx_t *ctx) case '/': case '^': case '\\': - case '.': case '_': return *ctx->ptr++; + case '.': + /* + * We need to distinguish between '.' used as part of a member expression and + * a beginning of a dot expression (a member expression accessing with statement + * expression). + */ + c = ctx->ptr > ctx->code ? ctx->ptr[-1] : '\n'; + ctx->ptr++; + return is_identifier_char(c) || c == ')' ? '.' : tDOT; case '-': if(ctx->is_html && ctx->ptr[1] == '-' && ctx->ptr[2] == '>') return comment_line(ctx); diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index 7c333be30e..f4f8a5e5e2 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -24,6 +24,7 @@ typedef enum { EXPR_CALL, EXPR_CONCAT, EXPR_DIV, + EXPR_DOT, EXPR_DOUBLE, EXPR_EMPTY, EXPR_EQUAL, @@ -125,6 +126,7 @@ typedef enum { STAT_UNTIL, STAT_WHILE, STAT_WHILELOOP, + STAT_WITH, STAT_RETVAL } statement_type_t; @@ -255,6 +257,12 @@ typedef struct { case_clausule_t *case_clausules; } select_statement_t; +typedef struct { + statement_t stat; + expression_t *expr; + statement_t *body; +} with_statement_t; + typedef struct { statement_t stat; expression_t *expr; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index b577c2146e..ffa12b2c4e 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -59,6 +59,7 @@ static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*); static statement_t *new_onerror_statement(parser_ctx_t*,BOOL); static statement_t *new_const_statement(parser_ctx_t*,const_decl_t*); static statement_t *new_select_statement(parser_ctx_t*,expression_t*,case_clausule_t*); +static statement_t *new_with_statement(parser_ctx_t*,expression_t*,statement_t*); static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,BOOL,dim_list_t*); static dim_list_t *new_dim(parser_ctx_t*,unsigned,dim_list_t*); @@ -107,14 +108,14 @@ static statement_t *link_statements(statement_t*,statement_t*); %token tEXPRESSION tEOF tNL tEMPTYBRACKETS %token tLTEQ tGTEQ tNEQ -%token tSTOP tME tREM +%token tSTOP tME tREM tDOT %token <string> tTRUE tFALSE %token <string> tNOT tAND tOR tXOR tEQV tIMP %token <string> tIS tMOD %token <string> tCALL tDIM tSUB tFUNCTION tGET tLET tCONST %token <string> tIF tELSE tELSEIF tEND tTHEN tEXIT %token <string> tWHILE tWEND tDO tLOOP tUNTIL tFOR tTO tEACH tIN -%token <string> tSELECT tCASE +%token <string> tSELECT tCASE tWITH %token <string> tBYREF tBYVAL %token <string> tOPTION %token <string> tNOTHING tEMPTY tNULL @@ -221,10 +222,14 @@ SimpleStatement { $$ = new_foreach_statement(ctx, $3, $5, $7); } | tSELECT tCASE Expression StSep CaseClausules tEND tSELECT { $$ = new_select_statement(ctx, $3, $5); } + | tWITH Expression StSep StatementsNl_opt tEND tWITH + { $$ = new_with_statement(ctx, $2, $4); } MemberExpression : Identifier { $$ = new_member_expression(ctx, NULL, $1); CHECK_ERROR; } | CallExpression '.' DotIdentifier { $$ = new_member_expression(ctx, $1, $3); CHECK_ERROR; } + | tDOT DotIdentifier { expression_t *dot_expr = new_expression(ctx, EXPR_DOT, sizeof(*dot_expr)); CHECK_ERROR; + $$ = new_member_expression(ctx, dot_expr, $2); CHECK_ERROR; } DimDeclList : DimDecl { $$ = $1; } @@ -946,6 +951,19 @@ static statement_t *new_select_statement(parser_ctx_t *ctx, expression_t *expr, return &stat->stat; } +static statement_t *new_with_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *body) +{ + with_statement_t *stat; + + stat = new_statement(ctx, STAT_WITH, sizeof(*stat)); + if(!stat) + return NULL; + + stat->expr = expr; + stat->body = body; + return &stat->stat; +} + static case_clausule_t *new_case_clausule(parser_ctx_t *ctx, expression_t *expr, statement_t *stat, case_clausule_t *next) { case_clausule_t *ret;
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
62
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
Results per page:
10
25
50
100
200