winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2017
----- 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
640 discussions
Start a n
N
ew thread
Huw Davies : comdlg32: Scale the control size limits with dpi.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: 6df0198a2b069eee907d551b109f06f8a29ffc25 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6df0198a2b069eee907d551b1…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 4 19:31:34 2017 +0100 comdlg32: Scale the control size limits with dpi. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/itemdlg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/comdlg32/itemdlg.c b/dlls/comdlg32/itemdlg.c index ccc9eb6..5d0c6e9 100644 --- a/dlls/comdlg32/itemdlg.c +++ b/dlls/comdlg32/itemdlg.c @@ -856,7 +856,7 @@ static inline customctrl *get_cctrl(FileDialogImpl *This, DWORD ctlid) static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multiline) { LPWSTR text; - UINT len, final_width; + UINT len, final_width, dpi; UINT lines, final_height; SIZE size; RECT rc; @@ -872,8 +872,12 @@ static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multili hdc = GetDC(hctrl); GetTextExtentPoint32W(hdc, text, lstrlenW(text), &size); + dpi = GetDeviceCaps(hdc, LOGPIXELSX); ReleaseDC(hctrl, hdc); + min_width = MulDiv(min_width, dpi, USER_DEFAULT_SCREEN_DPI); + max_width = MulDiv(max_width, dpi, USER_DEFAULT_SCREEN_DPI); + if(len && multiline) { /* FIXME: line-wrap */
1
0
0
0
Paul Gofman : d3dx9: Return shader functions in d3dx9_base_effect_get_pass_desc().
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: b7198efd42ad56ce587c8d608ea32068ea43fb72 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7198efd42ad56ce587c8d608…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri May 5 00:03:50 2017 +0200 d3dx9: Return shader functions in d3dx9_base_effect_get_pass_desc(). 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/effect.c | 210 +++++++++++++++++++++++++------------------ dlls/d3dx9_36/tests/effect.c | 9 +- 2 files changed, 125 insertions(+), 94 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b7198efd42ad56ce587c8…
1
0
0
0
Paul Gofman : d3dx9/tests: Add test for GetPassDesc() function.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: 911f8ffaaeedf966f47663bf999b950520ffcf0a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=911f8ffaaeedf966f47663bf9…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu May 4 01:33:46 2017 +0300 d3dx9/tests: Add test for GetPassDesc() 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/tests/effect.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index baa2a7a..8b2fb5d 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -6209,6 +6209,88 @@ static void test_effect_large_address_aware_flag(IDirect3DDevice9 *device) effect->lpVtbl->Release(effect); } +static void test_effect_get_pass_desc(IDirect3DDevice9 *device) +{ + unsigned int passes_count; + ID3DXEffect *effect; + D3DXPASS_DESC desc; + D3DXVECTOR4 fvect; + D3DXHANDLE pass; + HRESULT hr; + + hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob), + NULL, NULL, 0, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + pass = effect->lpVtbl->GetPass(effect, "tech0", 1); + ok(!!pass, "GetPass() failed.\n"); + + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, TRUE); + + fvect.x = fvect.y = fvect.w = 0.0f; + fvect.z = 0.0f; + hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n"); + + test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, TRUE); + + fvect.z = 3.0f; + hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + todo_wine + ok(hr == E_FAIL, "Got result %#x.\n", hr); + ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n"); + + /* Repeating call to confirm GetPassDesc() returns same error on the second call, + * as it is not the case sometimes for BeginPass() with out of bound access. */ + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + todo_wine + ok(hr == E_FAIL, "Got result %#x.\n", hr); + ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n"); + + hr = effect->lpVtbl->Begin(effect, &passes_count, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->BeginPass(effect, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 0, TRUE); + + fvect.z = 2.0f; + hr = effect->lpVtbl->SetVector(effect, "g_iVect", &fvect); + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + test_effect_preshader_compare_shader_bytecode(desc.pVertexShaderFunction, 0, 2, TRUE); + + effect->lpVtbl->Release(effect); + + hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob), + NULL, NULL, D3DXFX_NOT_CLONEABLE, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + pass = effect->lpVtbl->GetPass(effect, "tech0", 1); + ok(!!pass, "GetPass() failed.\n"); + + hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + ok(!desc.pVertexShaderFunction, "Unexpected non null desc.pVertexShaderFunction.\n"); + ok(!desc.pPixelShaderFunction, "Unexpected non null desc.pPixelShaderFunction.\n"); + + effect->lpVtbl->Release(effect); +} + START_TEST(effect) { HWND wnd; @@ -6259,6 +6341,7 @@ START_TEST(effect) test_cross_effect_handle(device); test_effect_shared_parameters(device); test_effect_large_address_aware_flag(device); + test_effect_get_pass_desc(device); count = IDirect3DDevice9_Release(device); ok(count == 0, "The device was not properly freed: refcount %u\n", count);
1
0
0
0
Paul Gofman : d3dx9/tests: Factor out test_effect_preshader_compare_shader_bytecode() function.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: f525c218967e116bf28c2858ec61c5eff17e8fe1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f525c218967e116bf28c2858e…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri May 5 00:03:48 2017 +0200 d3dx9/tests: Factor out test_effect_preshader_compare_shader_bytecode() 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/tests/effect.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 3e9d255..baa2a7a 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -3987,6 +3987,33 @@ static const DWORD test_effect_preshader_effect_blob[] = #define TEST_EFFECT_PRESHADER_VSHADER_POS 2710 #define TEST_EFFECT_PRESHADER_VSHADER_LEN 13 +#define test_effect_preshader_compare_shader_bytecode(a, b, c, d) \ + test_effect_preshader_compare_shader_bytecode_(__LINE__, a, b, c, d) +static void test_effect_preshader_compare_shader_bytecode_(unsigned int line, + const DWORD *bytecode, unsigned int bytecode_size, int expected_shader_index, BOOL todo) +{ + unsigned int i = 0; + + todo_wine_if(todo) + ok_(__FILE__, line)(!!bytecode, "NULL shader bytecode.\n"); + + if (!bytecode) + return; + + while (bytecode[i++] != 0x0000ffff) + ; + + if (!bytecode_size) + bytecode_size = i * sizeof(*bytecode); + else + ok(i * sizeof(*bytecode) == bytecode_size, "Unexpected byte code size %u.\n", bytecode_size); + + todo_wine_if(todo) + ok_(__FILE__, line)(!memcmp(bytecode, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS + + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], bytecode_size), + "Incorrect shader selected.\n"); +} + #define test_effect_preshader_compare_shader(a, b, c) \ test_effect_preshader_compare_shader_(__LINE__, a, b, c) static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDevice9 *device, @@ -4013,10 +4040,9 @@ static void test_effect_preshader_compare_shader_(unsigned int line, IDirect3DDe hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size); ok_(__FILE__, line)(hr == D3D_OK, "Got result %#x.\n", hr); - todo_wine_if(todo) - ok_(__FILE__, line)(!memcmp(byte_code, &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS - + expected_shader_index * TEST_EFFECT_PRESHADER_VSHADER_LEN], byte_code_size), - "Incorrect shader selected.\n"); + test_effect_preshader_compare_shader_bytecode_(line, byte_code, + byte_code_size, expected_shader_index, todo); + HeapFree(GetProcessHeap(), 0, byte_code); IDirect3DVertexShader9_Release(vshader); }
1
0
0
0
Michael Stefaniuc : dmime: Properly use SetCooperativeLevel() on the dsound ifaces we create.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: 9a90a3e8e505bb92ca80289c3896e28eff034dc0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a90a3e8e505bb92ca80289c3…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu May 4 17:17:01 2017 +0200 dmime: Properly use SetCooperativeLevel() on the dsound ifaces we create. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/performance.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 7e115bf..a0f70b0 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -256,10 +256,6 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init(IDirectMusicPerformance8 FIXME("(iface = %p, dmusic = %p, dsound = %p, hwnd = %p)\n", This, ppDirectMusic, pDirectSound, hWnd); if (This->pDirectMusic || This->pDirectSound) return DMUS_E_ALREADY_INITED; - - if (NULL == hWnd) { - hWnd = GetForegroundWindow(); - } if (NULL != pDirectSound) { This->pDirectSound = pDirectSound; @@ -268,12 +264,9 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init(IDirectMusicPerformance8 DirectSoundCreate8(NULL, (LPDIRECTSOUND8*) &This->pDirectSound, NULL); if (!This->pDirectSound) return DSERR_NODRIVER; - if (NULL != hWnd) { - IDirectSound8_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY); - } else { - /* how to get the ForeGround window handle ? */ - /*IDirectSound8_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY);*/ - } + if (!hWnd) + hWnd = GetForegroundWindow(); + IDirectSound_SetCooperativeLevel(This->pDirectSound, hWnd, DSSCL_PRIORITY); } if (NULL != ppDirectMusic && NULL != *ppDirectMusic) { @@ -917,6 +910,9 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_InitAudio(IDirectMusicPerform FIXME("return dsound(%p,%d)\n", dsound, hr); if (FAILED(hr) || !dsound) return DSERR_NODRIVER; + if (!hWnd) + hWnd = GetForegroundWindow(); + IDirectSound_SetCooperativeLevel(dsound, hWnd, DSSCL_PRIORITY); if (ppDirectSound) *ppDirectSound = dsound; }
1
0
0
0
Michael Stefaniuc : dmime/tests: Add more InitAudio() tests.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: f221298e610b334f02a30bcc86517c6e3dfb7dc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f221298e610b334f02a30bcc8…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu May 4 17:17:03 2017 +0200 dmime/tests: Add more InitAudio() tests. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/tests/Makefile.in | 2 +- dlls/dmime/tests/performance.c | 124 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 118 insertions(+), 8 deletions(-) diff --git a/dlls/dmime/tests/Makefile.in b/dlls/dmime/tests/Makefile.in index 4d4e718..f4c4703 100644 --- a/dlls/dmime/tests/Makefile.in +++ b/dlls/dmime/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = dmime.dll -IMPORTS = user32 ole32 +IMPORTS = user32 ole32 dsound C_SRCS = \ dmime.c \ diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c index 8531e38..0932cd9 100644 --- a/dlls/dmime/tests/performance.c +++ b/dlls/dmime/tests/performance.c @@ -31,13 +31,59 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); DEFINE_GUID(GUID_Bunk,0xFFFFFFFF,0xFFFF,0xFFFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF); +static void create_performance(IDirectMusicPerformance8 **performance, IDirectMusic **dmusic, + IDirectSound **dsound, BOOL set_cooplevel) +{ + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance8, (void **)performance); + ok(hr == S_OK, "DirectMusicPerformance create failed: %08x\n", hr); + if (dmusic) { + hr = CoCreateInstance(&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic8, + (void **)dmusic); + ok(hr == S_OK, "DirectMusic create failed: %08x\n", hr); + } + if (dsound) { + hr = DirectSoundCreate8(NULL, (IDirectSound8 **)dsound, NULL); + ok(hr == S_OK, "DirectSoundCreate failed: %08x\n", hr); + if (set_cooplevel) { + hr = IDirectSound_SetCooperativeLevel(*dsound, GetForegroundWindow(), DSSCL_PRIORITY); + ok(hr == S_OK, "SetCooperativeLevel failed: %08x\n", hr); + } + } +} + +static void destroy_performance(IDirectMusicPerformance8 *performance, IDirectMusic *dmusic, + IDirectSound *dsound) +{ + HRESULT hr; + + hr = IDirectMusicPerformance8_CloseDown(performance); + ok(hr == S_OK, "CloseDown failed: %08x\n", hr); + IDirectMusicPerformance8_Release(performance); + if (dmusic) + IDirectMusic_Release(dmusic); + if (dsound) + IDirectSound_Release(dsound); +} + +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + static HRESULT test_InitAudio(void) { IDirectMusicPerformance8 *performance; + IDirectMusic *dmusic; IDirectSound *dsound; IDirectMusicPort *port; IDirectMusicAudioPath *path; HRESULT hr; + ULONG ref; hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8, (void **)&performance); @@ -70,17 +116,81 @@ static HRESULT test_InitAudio(void) IDirectMusicPerformance8_Release(performance); - hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, - &IID_IDirectMusicPerformance8, (void**)&performance); - ok(hr == S_OK, "CoCreateInstance failed: %08x\n", hr); - + /* Auto generated dmusic and dsound */ + create_performance(&performance, NULL, NULL, FALSE); hr = IDirectMusicPerformance8_InitAudio(performance, NULL, NULL, NULL, 0, 64, 0, NULL); ok(hr == S_OK, "InitAudio failed: %08x\n", hr); + destroy_performance(performance, NULL, NULL); + + /* dsound without SetCooperativeLevel() */ + create_performance(&performance, NULL, &dsound, FALSE); + hr = IDirectMusicPerformance8_InitAudio(performance, NULL, &dsound, NULL, 0, 0, 0, NULL); + todo_wine ok(hr == DSERR_PRIOLEVELNEEDED, "InitAudio failed: %08x\n", hr); + destroy_performance(performance, NULL, dsound); + + /* Using the wrong CLSID_DirectSound */ + create_performance(&performance, NULL, NULL, FALSE); + hr = DirectSoundCreate(NULL, &dsound, NULL); + ok(hr == S_OK, "DirectSoundCreate failed: %08x\n", hr); + hr = IDirectMusicPerformance8_InitAudio(performance, NULL, &dsound, NULL, 0, 0, 0, NULL); + todo_wine ok(hr == E_NOINTERFACE, "InitAudio failed: %08x\n", hr); + destroy_performance(performance, NULL, dsound); + + /* Init() works with just a CLSID_DirectSound */ + create_performance(&performance, NULL, NULL, FALSE); + hr = DirectSoundCreate(NULL, &dsound, NULL); + ok(hr == S_OK, "DirectSoundCreate failed: %08x\n", hr); + hr = IDirectSound_SetCooperativeLevel(dsound, GetForegroundWindow(), DSSCL_PRIORITY); + ok(hr == S_OK, "SetCooperativeLevel failed: %08x\n", hr); + hr = IDirectMusicPerformance8_Init(performance, NULL, dsound, NULL); + ok(hr == S_OK, "Init failed: %08x\n", hr); + destroy_performance(performance, NULL, dsound); - hr = IDirectMusicPerformance8_CloseDown(performance); - ok(hr == S_OK, "CloseDown failed: %08x\n", hr); + /* Init() followed by InitAudio() */ + create_performance(&performance, NULL, &dsound, TRUE); + hr = IDirectMusicPerformance8_Init(performance, NULL, dsound, NULL); + ok(hr == S_OK, "Init failed: %08x\n", hr); + hr = IDirectMusicPerformance8_InitAudio(performance, NULL, &dsound, NULL, 0, 0, 0, NULL); + ok(hr == DMUS_E_ALREADY_INITED, "InitAudio failed: %08x\n", hr); + destroy_performance(performance, NULL, dsound); - IDirectMusicPerformance8_Release(performance); + /* Provided dmusic and dsound */ + create_performance(&performance, &dmusic, &dsound, TRUE); + hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, &dsound, NULL, 0, 64, 0, NULL); + ok(hr == S_OK, "InitAudio failed: %08x\n", hr); + ref = get_refcount(dsound); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ref = get_refcount(dmusic); + ok(ref == 2, "dmusic ref count got %d expected 2\n", ref); + destroy_performance(performance, dmusic, dsound); + + /* Provided dmusic initialized with SetDirectSound */ + create_performance(&performance, &dmusic, &dsound, TRUE); + IDirectMusic_SetDirectSound(dmusic, dsound, NULL); + ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, NULL, NULL, 0, 64, 0, NULL); + ok(hr == S_OK, "InitAudio failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ref = get_refcount(dmusic); + ok(ref == 2, "dmusic ref count got %d expected 2\n", ref); + destroy_performance(performance, dmusic, dsound); + + /* Provided dmusic and dsound, dmusic initialized with SetDirectSound */ + create_performance(&performance, &dmusic, &dsound, TRUE); + IDirectMusic_SetDirectSound(dmusic, dsound, NULL); + ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, &dsound, NULL, 0, 64, 0, NULL); + ok(hr == S_OK, "InitAudio failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ref = get_refcount(dmusic); + ok(ref == 2, "dmusic ref count got %d expected 2\n", ref); + destroy_performance(performance, dmusic, dsound); return S_OK; }
1
0
0
0
Michael Stefaniuc : dmime/tests: Use simpler variable names in test_InitAudio().
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: a306577803473fa5917b62ebd344c5cc0c6ed015 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a306577803473fa5917b62ebd…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu May 4 17:17:02 2017 +0200 dmime/tests: Use simpler variable names in test_InitAudio(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/tests/performance.c | 48 ++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c index 90fd6ee..8531e38 100644 --- a/dlls/dmime/tests/performance.c +++ b/dlls/dmime/tests/performance.c @@ -33,56 +33,54 @@ DEFINE_GUID(GUID_Bunk,0xFFFFFFFF,0xFFFF,0xFFFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF static HRESULT test_InitAudio(void) { - IDirectMusicPerformance8 *idmusicperformance; - IDirectSound *pDirectSound; - IDirectMusicPort *pDirectMusicPort; - IDirectMusicAudioPath *pDirectMusicAudioPath; + IDirectMusicPerformance8 *performance; + IDirectSound *dsound; + IDirectMusicPort *port; + IDirectMusicAudioPath *path; HRESULT hr; - hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, - CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8, (LPVOID *)&idmusicperformance); + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance8, (void **)&performance); if (hr != S_OK) { skip("Cannot create DirectMusicPerformance object (%x)\n", hr); CoUninitialize(); return hr; } - pDirectSound = NULL; - hr = IDirectMusicPerformance8_InitAudio(idmusicperformance ,NULL, - &pDirectSound, NULL, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL); + dsound = NULL; + hr = IDirectMusicPerformance8_InitAudio(performance, NULL, &dsound, NULL, + DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL); if(hr != S_OK) return hr; - pDirectMusicPort = NULL; - hr = IDirectMusicPerformance8_PChannelInfo(idmusicperformance, 0, &pDirectMusicPort, NULL, NULL); + port = NULL; + hr = IDirectMusicPerformance8_PChannelInfo(performance, 0, &port, NULL, NULL); ok(hr == S_OK, "Failed to call PChannelInfo (%x)\n", hr); - ok(pDirectMusicPort != NULL, "IDirectMusicPort not set\n"); - if (hr == S_OK && pDirectMusicPort != NULL) - IDirectMusicPort_Release(pDirectMusicPort); + ok(port != NULL, "IDirectMusicPort not set\n"); + if (hr == S_OK && port != NULL) + IDirectMusicPort_Release(port); - hr = IDirectMusicPerformance8_GetDefaultAudioPath(idmusicperformance, &pDirectMusicAudioPath); + hr = IDirectMusicPerformance8_GetDefaultAudioPath(performance, &path); ok(hr == S_OK, "Failed to call GetDefaultAudioPath (%x)\n", hr); if (hr == S_OK) - IDirectMusicAudioPath_Release(pDirectMusicAudioPath); + IDirectMusicAudioPath_Release(path); - hr = IDirectMusicPerformance8_CloseDown(idmusicperformance); + hr = IDirectMusicPerformance8_CloseDown(performance); ok(hr == S_OK, "Failed to call CloseDown (%x)\n", hr); - IDirectMusicPerformance8_Release(idmusicperformance); + IDirectMusicPerformance8_Release(performance); - hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, - CLSCTX_INPROC_SERVER, &IID_IDirectMusicPerformance8, - (void**)&idmusicperformance); + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance8, (void**)&performance); ok(hr == S_OK, "CoCreateInstance failed: %08x\n", hr); - hr = IDirectMusicPerformance8_InitAudio(idmusicperformance, NULL, NULL, - NULL, 0, 64, 0, NULL); + hr = IDirectMusicPerformance8_InitAudio(performance, NULL, NULL, NULL, 0, 64, 0, NULL); ok(hr == S_OK, "InitAudio failed: %08x\n", hr); - hr = IDirectMusicPerformance8_CloseDown(idmusicperformance); + hr = IDirectMusicPerformance8_CloseDown(performance); ok(hr == S_OK, "CloseDown failed: %08x\n", hr); - IDirectMusicPerformance8_Release(idmusicperformance); + IDirectMusicPerformance8_Release(performance); return S_OK; }
1
0
0
0
Piotr Caban : msvcr100: Add _invalid_parameter_noinfo_noreturn implementation.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: e76ea27ef681cd88996fa7b760875f1197f0d7b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e76ea27ef681cd88996fa7b76…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 4 14:36:33 2017 +0200 msvcr100: Add _invalid_parameter_noinfo_noreturn implementation. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- .../api-ms-win-crt-runtime-l1-1-0.spec | 2 +- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcrt/errno.c | 9 +++++++++ dlls/ucrtbase/ucrtbase.spec | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec index 57c5ecf..e9382cd 100644 --- a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec +++ b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec @@ -57,7 +57,7 @@ @ cdecl _initterm(ptr ptr) ucrtbase._initterm @ cdecl _initterm_e(ptr ptr) ucrtbase._initterm_e @ cdecl _invalid_parameter_noinfo() ucrtbase._invalid_parameter_noinfo -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() ucrtbase._invalid_parameter_noinfo_noreturn @ stub _invoke_watson @ stub _query_app_type @ cdecl _register_onexit_function(ptr ptr) ucrtbase._register_onexit_function diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 99bffe0..2f5bc4b 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -939,7 +939,7 @@ @ stub -arch=i386 _inpw(long) @ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter @ cdecl _invalid_parameter_noinfo() -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() @ stub _invoke_watson @ extern _iob MSVCRT__iob @ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index cb7a043..7bd7f75 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1285,7 +1285,7 @@ @ stub -arch=i386 _inpw(long) @ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter @ cdecl _invalid_parameter_noinfo() -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() @ stub _invoke_watson @ extern _iob MSVCRT__iob @ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index c2477e2..0c7e84d 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1285,7 +1285,7 @@ @ stub -arch=i386 _inpw(long) @ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter @ cdecl _invalid_parameter_noinfo() -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() @ stub _invoke_watson @ extern _iob MSVCRT__iob @ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 443eac8..520ef22 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1188,7 +1188,7 @@ @ cdecl _initterm_e(ptr ptr) msvcr120._initterm_e @ cdecl _invalid_parameter(wstr wstr wstr long long) msvcr120._invalid_parameter @ cdecl _invalid_parameter_noinfo() msvcr120._invalid_parameter_noinfo -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() msvcr120._invalid_parameter_noinfo_noreturn @ stub _invoke_watson @ extern _iob msvcr120._iob @ cdecl _isalnum_l(long ptr) msvcr120._isalnum_l diff --git a/dlls/msvcrt/errno.c b/dlls/msvcrt/errno.c index 893ed7b..45bc194 100644 --- a/dlls/msvcrt/errno.c +++ b/dlls/msvcrt/errno.c @@ -487,6 +487,15 @@ void CDECL _invalid_parameter_noinfo(void) } /********************************************************************* + * _invalid_parameter_noinfo_noreturn (MSVCR100.@) + */ +void CDECL _invalid_parameter_noinfo_noreturn(void) +{ + MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 ); + MSVCRT__exit( STATUS_INVALID_CRUNTIME_PARAMETER ); +} + +/********************************************************************* * _get_invalid_parameter_handler (MSVCR80.@) */ MSVCRT_invalid_parameter_handler CDECL _get_invalid_parameter_handler(void) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index dbc418c..78ae7d6 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -424,7 +424,7 @@ @ cdecl _initterm(ptr ptr) @ cdecl _initterm_e(ptr ptr) @ cdecl _invalid_parameter_noinfo() -@ stub _invalid_parameter_noinfo_noreturn +@ cdecl _invalid_parameter_noinfo_noreturn() @ stub _invoke_watson @ stub _is_exception_typeof @ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l
1
0
0
0
Owen Rudge : wsdapi: Implement WSD LinkedMemory functions.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: e8f37c7a5084d570b0e21ec4afa7e6d4f32d05c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8f37c7a5084d570b0e21ec4a…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Wed May 3 23:55:22 2017 +0100 wsdapi: Implement WSD LinkedMemory functions. Signed-off-by: Owen Rudge <orudge(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wsdapi/Makefile.in | 3 +- dlls/wsdapi/memory.c | 166 ++++++++++++++++++++++++++++++++++++++++++ dlls/wsdapi/tests/Makefile.in | 3 +- dlls/wsdapi/tests/memory.c | 74 +++++++++++++++++++ dlls/wsdapi/wsdapi.spec | 8 +- include/Makefile.in | 1 + include/wsdapi.h | 1 + include/wsdutil.h | 27 +++++++ 8 files changed, 277 insertions(+), 6 deletions(-) diff --git a/dlls/wsdapi/Makefile.in b/dlls/wsdapi/Makefile.in index 56912ee..7d63fe2 100644 --- a/dlls/wsdapi/Makefile.in +++ b/dlls/wsdapi/Makefile.in @@ -4,4 +4,5 @@ IMPORTS = kernel32 C_SRCS = \ discovery.c \ - main.c + main.c \ + memory.c diff --git a/dlls/wsdapi/memory.c b/dlls/wsdapi/memory.c new file mode 100644 index 0000000..89a6d2d --- /dev/null +++ b/dlls/wsdapi/memory.c @@ -0,0 +1,166 @@ +/* + * Web Services on Devices + * + * Copyright 2017 Owen Rudge for CodeWeavers + * + * 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 <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" +#include "wine/list.h" +#include "wsdapi.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wsdapi); + +#define MEMORY_ALLOCATION_MAGIC 0xB10C5EED + +#define ALIGNMENT (2 * sizeof(void*)) +#define ROUND_TO_ALIGNMENT(size) (((size) + ALIGNMENT - 1) & ~(ALIGNMENT - 1)) +#define MEMORY_ALLOCATION_SIZE ROUND_TO_ALIGNMENT(sizeof(struct memory_allocation)) + +struct memory_allocation +{ + int magic; + struct list entry; + + struct list children; +}; + +static struct memory_allocation *find_allocation(void *ptr) +{ + struct memory_allocation *allocation; + + if (ptr == NULL) + { + return NULL; + } + + allocation = (struct memory_allocation *)((char *)ptr - MEMORY_ALLOCATION_SIZE); + + if (allocation->magic != MEMORY_ALLOCATION_MAGIC) + { + return NULL; + } + + return allocation; +} + +static void free_allocation(struct memory_allocation *item) +{ + struct memory_allocation *child, *cursor; + + LIST_FOR_EACH_ENTRY_SAFE(child, cursor, &item->children, struct memory_allocation, entry) + { + free_allocation(child); + } + + list_remove(&item->entry); + item->magic = 0; + HeapFree(GetProcessHeap(), 0, item); +} + +void * WINAPI WSDAllocateLinkedMemory(void *pParent, SIZE_T cbSize) +{ + struct memory_allocation *allocation, *parent; + void *ptr; + + TRACE("(%p, %lu)\n", pParent, cbSize); + + ptr = HeapAlloc(GetProcessHeap(), 0, MEMORY_ALLOCATION_SIZE + cbSize); + + if (ptr == NULL) + { + return NULL; + } + + allocation = ptr; + allocation->magic = MEMORY_ALLOCATION_MAGIC; + + list_init(&allocation->children); + + /* See if we have a parent */ + parent = find_allocation(pParent); + + if (parent != NULL) + { + list_add_tail(&parent->children, &allocation->entry); + } + else + { + list_init(&allocation->entry); + } + + return (char *)ptr + MEMORY_ALLOCATION_SIZE; +} + +void WINAPI WSDAttachLinkedMemory(void *pParent, void *pChild) +{ + struct memory_allocation *parent, *child; + + TRACE("(%p, %p)\n", pParent, pChild); + + child = find_allocation(pChild); + parent = find_allocation(pParent); + + TRACE("child: %p, parent: %p\n", child, parent); + + if ((child == NULL) || (parent == NULL)) + { + return; + } + + list_remove(&child->entry); + list_add_tail(&parent->children, &child->entry); +} + +void WINAPI WSDDetachLinkedMemory(void *pVoid) +{ + struct memory_allocation *allocation; + + TRACE("(%p)\n", pVoid); + + allocation = find_allocation(pVoid); + + if (allocation == NULL) + { + TRACE("Memory allocation not found\n"); + return; + } + + list_remove(&allocation->entry); +} + +void WINAPI WSDFreeLinkedMemory(void *pVoid) +{ + struct memory_allocation *allocation; + + TRACE("(%p)\n", pVoid); + + allocation = find_allocation(pVoid); + + if (allocation == NULL) + { + TRACE("Memory allocation not found\n"); + return; + } + + free_allocation(allocation); +} diff --git a/dlls/wsdapi/tests/Makefile.in b/dlls/wsdapi/tests/Makefile.in index c351d10..2b20c63 100644 --- a/dlls/wsdapi/tests/Makefile.in +++ b/dlls/wsdapi/tests/Makefile.in @@ -2,4 +2,5 @@ TESTDLL = wsdapi.dll IMPORTS = wsdapi ole32 user32 C_SRCS = \ - discovery.c + discovery.c \ + memory.c diff --git a/dlls/wsdapi/tests/memory.c b/dlls/wsdapi/tests/memory.c new file mode 100644 index 0000000..9fb1a25 --- /dev/null +++ b/dlls/wsdapi/tests/memory.c @@ -0,0 +1,74 @@ +/* + * Web Services on Devices + * Memory tests + * + * Copyright 2017 Owen Rudge for CodeWeavers + * + * 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 + */ + +#define COBJMACROS + +#include <windows.h> + +#include "wine/test.h" +#include "wsdapi.h" + +#define ALIGNMENT (2 * sizeof(void*)) +#define NUM_ITERATIONS 100 + +static void AllocateLinkedMemory_tests(void) +{ + void *alloc1; + void *alloc2; + void *alloc_ptrs[NUM_ITERATIONS]; + int i; + + /* Test a parentless allocation */ + alloc1 = WSDAllocateLinkedMemory(NULL, 1024); + ok(alloc1 != NULL, "WSDAllocateLinkedMemory with null parent failed\n"); + + WSDFreeLinkedMemory(alloc1); + + /* Test a parented allocation */ + alloc1 = WSDAllocateLinkedMemory(NULL, 1024); + ok(alloc1 != NULL, "WSDAllocateLinkedMemory with null parent failed\n"); + + alloc2 = WSDAllocateLinkedMemory(alloc1, 1024); + ok(alloc2 != NULL, "WSDAllocateLinkedMemory with parent failed\n"); + + WSDFreeLinkedMemory(alloc1); + + /* Try allocating against the freed parent */ + alloc2 = WSDAllocateLinkedMemory(alloc1, 1024); + ok(alloc2 != NULL, "WSDAllocateLinkedMemory with parent failed\n"); + + /* Test that the returned pointers are aligned as expected */ + for (i = 0; i < NUM_ITERATIONS; i++) + { + alloc_ptrs[i] = WSDAllocateLinkedMemory(NULL, i); + ok(((UINT_PTR)alloc_ptrs[i] % ALIGNMENT) == 0, "WSDAllocateLinkedMemory returned pointer not aligned (size = %d).\n", i); + } + + for (i = 0; i < NUM_ITERATIONS; i++) + { + WSDFreeLinkedMemory(alloc_ptrs[i]); + } +} + +START_TEST(memory) +{ + AllocateLinkedMemory_tests(); +} diff --git a/dlls/wsdapi/wsdapi.spec b/dlls/wsdapi/wsdapi.spec index 3e1d2b6..7145f7d 100644 --- a/dlls/wsdapi/wsdapi.spec +++ b/dlls/wsdapi/wsdapi.spec @@ -4,8 +4,8 @@ @ stub WSDNotifyNetworkChange @ stub WSDRemoveFirewallCheck @ stub WSDXMLCompareNames -@ stub WSDAllocateLinkedMemory -@ stub WSDAttachLinkedMemory +@ stdcall WSDAllocateLinkedMemory(ptr long) +@ stdcall WSDAttachLinkedMemory(ptr ptr) @ stub WSDCompareEndpoints @ stub WSDCopyEndpoint @ stub WSDCreateDeviceHost2 @@ -26,8 +26,8 @@ @ stub WSDCreateUdpAddress @ stub WSDCreateUdpMessageParameters @ stub WSDCreateUdpTransport -@ stub WSDDetachLinkedMemory -@ stub WSDFreeLinkedMemory +@ stdcall WSDDetachLinkedMemory(ptr) +@ stdcall WSDFreeLinkedMemory(ptr) @ stub WSDGenerateFault @ stub WSDGenerateFaultEx @ stub WSDGenerateRandomDelay diff --git a/include/Makefile.in b/include/Makefile.in index 6f53728..497c76f 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -693,6 +693,7 @@ HEADER_SRCS = \ ws2tcpip.h \ wsdapi.h \ wsdtypes.h \ + wsdutil.h \ wsdxmldom.h \ wshisotp.h \ wsipx.h \ diff --git a/include/wsdapi.h b/include/wsdapi.h index dec0954..d71721e 100644 --- a/include/wsdapi.h +++ b/include/wsdapi.h @@ -24,5 +24,6 @@ #include <wsdxmldom.h> #include <wsdtypes.h> #include <wsddisco.h> +#include <wsdutil.h> #endif diff --git a/include/wsdutil.h b/include/wsdutil.h new file mode 100644 index 0000000..8a89eb1 --- /dev/null +++ b/include/wsdutil.h @@ -0,0 +1,27 @@ +/* + * Copyright 2017 Owen Rudge for CodeWeavers + * + * 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 + */ + +#ifndef WSDUTIL_H +#define WSDUTIL_H + +void * WINAPI WSDAllocateLinkedMemory(void *pParent, SIZE_T cbSize); +void WINAPI WSDAttachLinkedMemory(void *pParent, void *pChild); +void WINAPI WSDDetachLinkedMemory(void *pVoid); +void WINAPI WSDFreeLinkedMemory(void *pVoid); + +#endif
1
0
0
0
Daniel Lehman : dbghelp: Add support for char32_t type.
by Alexandre Julliard
04 May '17
04 May '17
Module: wine Branch: master Commit: 8d6cf80026c7bcd2e04ea20c20e82a5730d45ec8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d6cf80026c7bcd2e04ea20c2…
Author: Daniel Lehman <dlehman25(a)gmail.com> Date: Wed May 3 23:16:41 2017 -0700 dbghelp: Add support for char32_t type. Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 4 ++++ include/cvconst.h | 3 ++- include/wine/mscvpdb.h | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 5c474d8..eba2649 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -170,6 +170,7 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_RCHAR] = &symt_new_basic(module, btInt, "signed char", 1)->symt; cv_basic_types[T_WCHAR] = &symt_new_basic(module, btWChar, "wchar_t", 2)->symt; cv_basic_types[T_CHAR16] = &symt_new_basic(module, btChar16,"char16_t", 2)->symt; + cv_basic_types[T_CHAR32] = &symt_new_basic(module, btChar32,"char32_t", 4)->symt; cv_basic_types[T_INT2] = &symt_new_basic(module, btInt, "INT2", 2)->symt; cv_basic_types[T_UINT2] = &symt_new_basic(module, btUInt, "UINT2", 2)->symt; cv_basic_types[T_INT4] = &symt_new_basic(module, btInt, "INT4", 4)->symt; @@ -197,6 +198,7 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_32PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], 4)->symt; cv_basic_types[T_32PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], 4)->symt; cv_basic_types[T_32PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], 4)->symt; + cv_basic_types[T_32PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], 4)->symt; cv_basic_types[T_32PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], 4)->symt; cv_basic_types[T_32PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], 4)->symt; cv_basic_types[T_32PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], 4)->symt; @@ -224,6 +226,7 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_64PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], 8)->symt; cv_basic_types[T_64PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], 8)->symt; cv_basic_types[T_64PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], 8)->symt; + cv_basic_types[T_64PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], 8)->symt; cv_basic_types[T_64PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], 8)->symt; cv_basic_types[T_64PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], 8)->symt; cv_basic_types[T_64PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], 8)->symt; @@ -251,6 +254,7 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], sizeof(void*))->symt; cv_basic_types[T_PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], sizeof(void*))->symt; cv_basic_types[T_PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], sizeof(void*))->symt; + cv_basic_types[T_PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], sizeof(void*))->symt; cv_basic_types[T_PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], sizeof(void*))->symt; cv_basic_types[T_PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], sizeof(void*))->symt; cv_basic_types[T_PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], sizeof(void*))->symt; diff --git a/include/cvconst.h b/include/cvconst.h index 5580258..80b8e44 100644 --- a/include/cvconst.h +++ b/include/cvconst.h @@ -78,7 +78,8 @@ enum BasicType btBit = 29, btBSTR = 30, btHresult = 31, - btChar16 = 32 + btChar16 = 32, + btChar32 = 33 }; /* kind of UDT */ diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h index d053b69..2f0b479 100644 --- a/include/wine/mscvpdb.h +++ b/include/wine/mscvpdb.h @@ -872,6 +872,7 @@ union codeview_fieldtype #define T_INT8 0x0076 /* 64-bit signed int */ #define T_UINT8 0x0077 /* 64-bit unsigned int */ #define T_CHAR16 0x007a /* 16-bit unicode char */ +#define T_CHAR32 0x007b /* 32-bit unicode char */ /* near pointers to basic types */ #define T_PVOID 0x0103 /* near pointer to void */ @@ -905,6 +906,7 @@ union codeview_fieldtype #define T_PINT8 0x0176 /* Near pointer to 64-bit signed int */ #define T_PUINT8 0x0177 /* Near pointer to 64-bit unsigned int */ #define T_PCHAR16 0x017a /* Near pointer to 16-bit unicode char */ +#define T_PCHAR32 0x017b /* Near pointer to 32-bit unicode char */ /* far pointers to basic types */ #define T_PFVOID 0x0203 /* Far pointer to void */ @@ -938,6 +940,7 @@ union codeview_fieldtype #define T_PFINT8 0x0276 /* Far pointer to 64-bit signed int */ #define T_PFUINT8 0x0277 /* Far pointer to 64-bit unsigned int */ #define T_PFCHAR16 0x027a /* Far pointer to 16-bit unicode char */ +#define T_PFCHAR32 0x027b /* Far pointer to 32-bit unicode char */ /* huge pointers to basic types */ #define T_PHVOID 0x0303 /* Huge pointer to void */ @@ -971,6 +974,7 @@ union codeview_fieldtype #define T_PHINT8 0x0376 /* Huge pointer to 64-bit signed int */ #define T_PHUINT8 0x0377 /* Huge pointer to 64-bit unsigned int */ #define T_PHCHAR16 0x037a /* Huge pointer to 16-bit unicode char */ +#define T_PHCHAR32 0x037b /* Huge pointer to 32-bit unicode char */ /* 32-bit near pointers to basic types */ #define T_32PVOID 0x0403 /* 32-bit near pointer to void */ @@ -1005,6 +1009,7 @@ union codeview_fieldtype #define T_32PINT8 0x0476 /* 16:32 near pointer to 64-bit signed int */ #define T_32PUINT8 0x0477 /* 16:32 near pointer to 64-bit unsigned int */ #define T_32PCHAR16 0x047a /* 16:32 near pointer to 16-bit unicode char */ +#define T_32PCHAR32 0x047b /* 16:32 near pointer to 32-bit unicode char */ /* 32-bit far pointers to basic types */ #define T_32PFVOID 0x0503 /* 32-bit far pointer to void */ @@ -1039,6 +1044,7 @@ union codeview_fieldtype #define T_32PFINT8 0x0576 /* 16:32 far pointer to 64-bit signed int */ #define T_32PFUINT8 0x0577 /* 16:32 far pointer to 64-bit unsigned int */ #define T_32PFCHAR16 0x057a /* 16:32 far pointer to 16-bit unicode char */ +#define T_32PFCHAR32 0x057b /* 16:32 far pointer to 32-bit unicode char */ /* 64-bit near pointers to basic types */ #define T_64PVOID 0x0603 /* 64-bit near pointer to void */ @@ -1073,6 +1079,7 @@ union codeview_fieldtype #define T_64PINT8 0x0676 /* 64 near pointer to 64-bit signed int */ #define T_64PUINT8 0x0677 /* 64 near pointer to 64-bit unsigned int */ #define T_64PCHAR16 0x067a /* 64 near pointer to 16-bit unicode char */ +#define T_64PCHAR32 0x067b /* 64 near pointer to 32-bit unicode char */ /* counts, bit masks, and shift values needed to access various parts of the built-in type numbers */ #define T_MAXPREDEFINEDTYPE 0x0580 /* maximum type index for all built-in types */
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
64
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
Results per page:
10
25
50
100
200