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
February 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
2 participants
915 discussions
Start a n
N
ew thread
Nikolay Sivov : mfplat/allocator: Improve initialization handling.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 14f6c095089f6943a0cf54067bb7391be35e069b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=14f6c095089f6943a0cf5406…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 10 13:32:28 2021 +0300 mfplat/allocator: Improve initialization handling. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/sample.c | 57 ++++++++++++++++++++++++++++++++++----- dlls/mfplat/tests/mfplat.c | 66 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 112 insertions(+), 11 deletions(-) diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c index acdc8836cc8..4ecce4fbe84 100644 --- a/dlls/mfplat/sample.c +++ b/dlls/mfplat/sample.c @@ -76,6 +76,7 @@ struct sample_allocator } frame_desc; IMFAttributes *attributes; + IMFMediaType *media_type; unsigned int free_sample_count; unsigned int cold_sample_count; @@ -1114,6 +1115,48 @@ static void sample_allocator_release_samples(struct sample_allocator *allocator) list_remove(&iter->entry); heap_free(iter); } + + allocator->free_sample_count = 0; + allocator->cold_sample_count = 0; +} + +static void sample_allocator_set_media_type(struct sample_allocator *allocator, IMFMediaType *media_type) +{ + UINT64 frame_size; + GUID subtype; + + if (!media_type) + { + if (allocator->media_type) + IMFMediaType_Release(allocator->media_type); + allocator->media_type = NULL; + return; + } + + /* Check if type is the same. */ + IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &frame_size); + IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &subtype); + + if (frame_size == ((UINT64) allocator->frame_desc.width << 32 | allocator->frame_desc.height) && + subtype.Data1 == allocator->frame_desc.d3d9_format) + { + return; + } + + if (allocator->media_type) + IMFMediaType_Release(allocator->media_type); + allocator->media_type = media_type; + if (allocator->media_type) + IMFMediaType_AddRef(allocator->media_type); +} + +static void sample_allocator_set_attributes(struct sample_allocator *allocator, IMFAttributes *attributes) +{ + if (allocator->attributes) + IMFAttributes_Release(allocator->attributes); + allocator->attributes = attributes; + if (allocator->attributes) + IMFAttributes_AddRef(allocator->attributes); } static ULONG WINAPI sample_allocator_Release(IMFVideoSampleAllocatorEx *iface) @@ -1133,6 +1176,8 @@ static ULONG WINAPI sample_allocator_Release(IMFVideoSampleAllocatorEx *iface) IMFDXGIDeviceManager_Release(allocator->dxgi_device_manager); if (allocator->attributes) IMFAttributes_Release(allocator->attributes); + sample_allocator_set_media_type(allocator, NULL); + sample_allocator_set_attributes(allocator, NULL); sample_allocator_release_samples(allocator); DeleteCriticalSection(&allocator->cs); heap_free(allocator); @@ -1190,7 +1235,9 @@ static HRESULT WINAPI sample_allocator_UninitializeSampleAllocator(IMFVideoSampl EnterCriticalSection(&allocator->cs); sample_allocator_release_samples(allocator); - allocator->free_sample_count = 0; + sample_allocator_set_media_type(allocator, NULL); + sample_allocator_set_attributes(allocator, NULL); + memset(&allocator->frame_desc, 0, sizeof(allocator->frame_desc)); LeaveCriticalSection(&allocator->cs); @@ -1348,16 +1395,14 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u if (sample_count > max_sample_count) return E_INVALIDARG; + sample_allocator_set_media_type(allocator, media_type); + sample_allocator_set_attributes(allocator, attributes); + sample_count = max(1, sample_count); max_sample_count = max(1, max_sample_count); if (attributes) - { - allocator->attributes = attributes; - IMFAttributes_AddRef(allocator->attributes); - IMFAttributes_GetUINT32(attributes, &MF_SA_BUFFERS_PER_SAMPLE, &allocator->frame_desc.buffer_count); - } allocator->frame_desc.d3d9_format = subtype.Data1; allocator->frame_desc.dxgi_format = MFMapDX9FormatToDXGIFormat(allocator->frame_desc.d3d9_format); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 0464293b37f..9e3a3da08ea 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6290,27 +6290,27 @@ static void test_dxgi_surface_buffer(void) static void test_sample_allocator(void) { IMFVideoSampleAllocatorNotify test_notify = { &test_notify_callback_vtbl }; + IMFMediaType *media_type, *video_type, *video_type2; IMFVideoSampleAllocatorCallback *allocator_cb; IMFVideoSampleAllocatorEx *allocatorex; - IMFMediaType *media_type, *video_type; + IDirect3DDeviceManager9 *d3d9_manager; IMFVideoSampleAllocator *allocator; + unsigned int buffer_count, token; + IDirect3DDevice9 *d3d9_device; IMFDXGIDeviceManager *manager; IMFSample *sample, *sample2; IMFDXGIBuffer *dxgi_buffer; IMFAttributes *attributes; D3D11_TEXTURE2D_DESC desc; - unsigned int buffer_count, token; ID3D11Texture2D *texture; IMFMediaBuffer *buffer; ID3D11Device *device; LONG refcount, count; + IDirect3D9 *d3d9; IUnknown *unk; HRESULT hr; BYTE *data; - IDirect3D9 *d3d9; HWND window; - IDirect3DDeviceManager9 *d3d9_manager; - IDirect3DDevice9 *d3d9_device; if (!pMFCreateVideoSampleAllocatorEx) { @@ -6366,6 +6366,7 @@ static void test_sample_allocator(void) ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); video_type = create_video_type(&MFVideoFormat_RGB32); + video_type2 = create_video_type(&MFVideoFormat_RGB32); hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); @@ -6374,11 +6375,42 @@ static void test_sample_allocator(void) hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFMediaType_SetUINT64(video_type2, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + EXPECT_REF(video_type, 1); hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 1, video_type); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(video_type, 2); + + hr = IMFMediaType_SetUINT64(video_type2, &IID_IUnknown, (UINT64) 320 << 32 | 240); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + /* Setting identical type does not replace it. */ + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 1, video_type2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(video_type, 2); + EXPECT_REF(video_type2, 1); + + hr = IMFMediaType_SetUINT64(video_type2, &MF_MT_FRAME_SIZE, (UINT64) 64 << 32 | 64); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 1, video_type2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(video_type2, 2); + EXPECT_REF(video_type, 1); + + /* Modify referenced type. */ + hr = IMFMediaType_SetUINT64(video_type2, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 64); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 1, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(video_type, 2); + EXPECT_REF(video_type2, 1); count = 0; hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); @@ -6401,6 +6433,7 @@ static void test_sample_allocator(void) hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample)); + EXPECT_REF(video_type, 2); hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); @@ -6426,6 +6459,18 @@ todo_wine IMFSample_Release(sample); + hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); +todo_wine + EXPECT_REF(video_type, 2); + + hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!count, "Unexpected count %d.\n", count); + + hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); + ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr); + IMFVideoSampleAllocatorCallback_Release(allocator_cb); IMFVideoSampleAllocator_Release(allocator); @@ -6468,6 +6513,15 @@ todo_wine hr = IMFVideoSampleAllocatorEx_AllocateSample(allocatorex, &sample2); ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr); + /* Reinitialize with already allocated samples. */ + hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(allocatorex, 0, 0, NULL, video_type); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(attributes, 1); + + hr = IMFVideoSampleAllocatorEx_AllocateSample(allocatorex, &sample2); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IMFSample_Release(sample2); + IMFSample_Release(sample); IMFVideoSampleAllocatorCallback_Release(allocator_cb); @@ -6490,8 +6544,10 @@ todo_wine hr = pMFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocator, (void **)&allocator); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(manager, 1); hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, (IUnknown *)manager); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + EXPECT_REF(manager, 2); hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
1
0
0
0
Nikolay Sivov : evr/tests: Add some more interface checks for the allocator.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: ffbb74bb166fd4324b911da8737f18071dcc26bc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ffbb74bb166fd4324b911da8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 10 13:32:27 2021 +0300 evr/tests: Add some more interface checks for the allocator. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/evr/tests/evr.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 31434bde43a..94bf327dd92 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -1422,17 +1422,14 @@ static void test_MFCreateVideoSampleAllocator(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(count == 4, "Unexpected count %d.\n", count); - hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); - - hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + check_interface(sample, &IID_IMFDesiredSample, TRUE); + check_interface(sample, &IID_IMFTrackedSample, TRUE); hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + check_interface(buffer, &IID_IMF2DBuffer, TRUE); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs); ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr); @@ -1444,10 +1441,6 @@ static void test_MFCreateVideoSampleAllocator(void) IMFGetService_Release(gs); } - hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); - IMFMediaBuffer_Release(buffer); IMFSample_Release(sample); @@ -1489,14 +1482,15 @@ static void test_MFCreateVideoSampleAllocator(void) hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + check_interface(sample, &IID_IMFTrackedSample, TRUE); + check_interface(sample, &IID_IMFDesiredSample, TRUE); + hr = IMFSample_GetBufferByIndex(sample, 0, &buffer); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); check_service_interface(buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, TRUE); - - hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); + check_interface(buffer, &IID_IMF2DBuffer, TRUE); + check_interface(buffer, &IID_IMF2DBuffer2, TRUE); hr = IMFMediaBuffer_Lock(buffer, &data, NULL, NULL); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
1
0
0
0
Alexandre Julliard : ntdll/tests: Add some tests for NtQueryVirtualMemory(MemorySectionName).
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 27b9a2c62140a45020e79254841c56e691a5874e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=27b9a2c62140a45020e79254…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 10 11:30:34 2021 +0100 ntdll/tests: Add some tests for NtQueryVirtualMemory(MemorySectionName). Partly based on a patch by Dmitry Timoshkov. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 405b628d712..c848248fae3 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -2196,7 +2196,7 @@ static void test_threadstack(void) static void test_queryvirtualmemory(void) { NTSTATUS status; - SIZE_T readcount; + SIZE_T readcount, prev; static const char teststring[] = "test string"; static char datatestbuf[42] = "abc"; static char rwtestbuf[42]; @@ -2204,6 +2204,8 @@ static void test_queryvirtualmemory(void) char stackbuf[42]; HMODULE module; void *user_shared_data = (void *)0x7ffe0000; + char buffer[1024]; + MEMORY_SECTION_NAME *name = (MEMORY_SECTION_NAME *)buffer; module = GetModuleHandleA( "ntdll.dll" ); status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); @@ -2286,6 +2288,82 @@ static void test_queryvirtualmemory(void) /* check error code when len is less than MEMORY_BASIC_INFORMATION size */ status = pNtQueryVirtualMemory(NtCurrentProcess(), GetProcessHeap(), MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION) - 1, &readcount); ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status); + + module = GetModuleHandleA( "ntdll.dll" ); + memset(buffer, 0xcc, sizeof(buffer)); + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemorySectionName, + name, sizeof(*name) + 16, &readcount); + ok(status == STATUS_BUFFER_OVERFLOW, "got %08x\n", status); + ok(name->SectionFileName.Length == 0xcccc || broken(!name->SectionFileName.Length), /* vista64 */ + "Wrong len %u\n", name->SectionFileName.Length); + ok(readcount > sizeof(*name), "Wrong count %lu\n", readcount); + + memset(buffer, 0xcc, sizeof(buffer)); + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName, + name, sizeof(buffer), &readcount); + ok(status == STATUS_SUCCESS, "got %08x\n", status); + ok(name->SectionFileName.Buffer == (WCHAR *)(name + 1), "Wrong ptr %p/%p\n", + name->SectionFileName.Buffer, name + 1 ); + ok(name->SectionFileName.Length != 0xcccc, "Wrong len %u\n", name->SectionFileName.Length); + ok(name->SectionFileName.MaximumLength == name->SectionFileName.Length + sizeof(WCHAR), + "Wrong maxlen %u/%u\n", name->SectionFileName.MaximumLength, name->SectionFileName.Length); + ok(readcount == sizeof(name->SectionFileName) + name->SectionFileName.MaximumLength, + "Wrong count %lu/%u\n", readcount, name->SectionFileName.MaximumLength); + ok( !name->SectionFileName.Buffer[name->SectionFileName.Length / sizeof(WCHAR)], + "buffer not null-terminated\n" ); + + memset(buffer, 0xcc, sizeof(buffer)); + status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName, + name, sizeof(buffer), NULL); + ok(status == STATUS_SUCCESS, "got %08x\n", status); + + status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 1234, MemorySectionName, + NULL, sizeof(buffer), NULL); + ok(status == STATUS_ACCESS_VIOLATION, "got %08x\n", status); + + memset(buffer, 0xcc, sizeof(buffer)); + prev = readcount; + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), (char *)module + 321, MemorySectionName, + name, sizeof(*name) - 1, &readcount); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "got %08x\n", status); + ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length); + ok(readcount == prev, "Wrong count %lu\n", readcount); + + memset(buffer, 0xcc, sizeof(buffer)); + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory((HANDLE)0xdead, (char *)module + 1234, MemorySectionName, + name, sizeof(buffer), &readcount); + ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status); + ok(readcount == 0xdeadbeef || broken(readcount == 1024 + sizeof(*name)), /* wow64 */ + "Wrong count %lu\n", readcount); + + memset(buffer, 0xcc, sizeof(buffer)); + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), buffer, MemorySectionName, + name, sizeof(buffer), &readcount); + ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status); + ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length); + ok(readcount == 0xdeadbeef || broken(readcount == 1024 + sizeof(*name)), /* wow64 */ + "Wrong count %lu\n", readcount); + + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemorySectionName, + name, sizeof(buffer), &readcount); + ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status); + ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length); + ok(readcount == 0xdeadbeef || broken(readcount == 1024 + sizeof(*name)), /* wow64 */ + "Wrong count %lu\n", readcount); + + readcount = 0xdeadbeef; + status = pNtQueryVirtualMemory(NtCurrentProcess(), (void *)0x1234, MemorySectionName, + name, sizeof(*name) - 1, &readcount); + ok(status == STATUS_INVALID_ADDRESS, "got %08x\n", status); + ok(name->SectionFileName.Length == 0xcccc, "Wrong len %u\n", name->SectionFileName.Length); + ok(readcount == 0xdeadbeef || broken(readcount == 15), /* wow64 */ + "Wrong count %lu\n", readcount); } static void test_affinity(void)
1
0
0
0
Alexandre Julliard : server: Implement NtQueryVirtualMemory(MemorySectionName).
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 3472387777289f9aa962dabb05fc9d55e05ee090 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3472387777289f9aa962dabb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 10 16:09:49 2021 +0100 server: Implement NtQueryVirtualMemory(MemorySectionName). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/virtual.c | 35 +++++++++++++++++++++++++++++++++-- dlls/psapi/tests/psapi_main.c | 8 +------- include/wine/server_protocol.h | 21 ++++++++++++++++++++- server/mapping.c | 32 ++++++++++++++++++++++++++++++++ server/protocol.def | 10 ++++++++++ server/request.h | 7 +++++++ server/trace.c | 16 ++++++++++++++++ 7 files changed, 119 insertions(+), 10 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=3472387777289f9aa962…
1
0
0
0
Zebediah Figura : server: Use a callback to free the accept_req structure.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 61abc500f557cbd5f732688963843dc2d238c9e2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=61abc500f557cbd5f7326889…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 8 17:40:42 2021 -0600 server: Use a callback to free the accept_req structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/async.c | 15 +++++++++++++++ server/file.h | 4 ++++ server/sock.c | 23 +++++++++++------------ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/server/async.c b/server/async.c index 6da61fd502c..1ac5117edb9 100644 --- a/server/async.c +++ b/server/async.c @@ -55,6 +55,8 @@ struct async struct completion *completion; /* completion associated with fd */ apc_param_t comp_key; /* completion key associated with fd */ unsigned int comp_flags; /* completion flags */ + async_completion_callback completion_callback; /* callback to be called on completion */ + void *completion_callback_private; /* argument to completion_callback */ }; static void async_dump( struct object *obj, int verbose ); @@ -247,6 +249,8 @@ struct async *create_async( struct fd *fd, struct thread *thread, const async_da async->direct_result = 0; async->completion = fd_get_completion( fd, &async->comp_key ); async->comp_flags = 0; + async->completion_callback = NULL; + async->completion_callback_private = NULL; if (iosb) async->iosb = (struct iosb *)grab_object( iosb ); else async->iosb = NULL; @@ -362,6 +366,13 @@ void async_set_timeout( struct async *async, timeout_t timeout, unsigned int sta async->timeout_status = status; } +/* set a callback to be notified when the async is completed */ +void async_set_completion_callback( struct async *async, async_completion_callback func, void *private ) +{ + async->completion_callback = func; + async->completion_callback_private = private; +} + static void add_async_completion( struct async *async, apc_param_t cvalue, unsigned int status, apc_param_t information ) { @@ -420,6 +431,10 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota async->signaled = 1; wake_up( &async->obj, 0 ); } + + if (async->completion_callback) + async->completion_callback( async->completion_callback_private ); + async->completion_callback = NULL; } } diff --git a/server/file.h b/server/file.h index b41a6c3f0c4..3b70799a3ec 100644 --- a/server/file.h +++ b/server/file.h @@ -212,6 +212,9 @@ extern int is_serial_fd( struct fd *fd ); extern struct object *create_serial( struct fd *fd ); /* async I/O functions */ + +typedef void (*async_completion_callback)( void *private ); + extern void free_async_queue( struct async_queue *queue ); extern struct async *create_async( struct fd *fd, struct thread *thread, const async_data_t *data, struct iosb *iosb ); extern struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const async_data_t *data ); @@ -219,6 +222,7 @@ extern obj_handle_t async_handoff( struct async *async, int success, data_size_t extern void queue_async( struct async_queue *queue, struct async *async ); extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ); extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total ); +extern void async_set_completion_callback( struct async *async, async_completion_callback func, void *private ); extern void set_async_pending( struct async *async, int signal ); extern int async_waiting( struct async_queue *queue ); extern void async_terminate( struct async *async, unsigned int status ); diff --git a/server/sock.c b/server/sock.c index 78b1578113b..3aed5494612 100644 --- a/server/sock.c +++ b/server/sock.c @@ -449,8 +449,9 @@ static inline int sock_error( struct fd *fd ) return optval; } -static void free_accept_req( struct accept_req *req ) +static void free_accept_req( void *private ) { + struct accept_req *req = private; list_remove( &req->entry ); if (req->acceptsock) { @@ -582,7 +583,7 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) LIST_FOR_EACH_ENTRY( req, &sock->accept_list, struct accept_req, entry ) { - if (!req->accepted) + if (req->iosb->status == STATUS_PENDING && !req->accepted) { complete_async_accept( sock, req ); if (get_error() != STATUS_PENDING) @@ -591,7 +592,7 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) } } - if (sock->accept_recv_req) + if (sock->accept_recv_req && sock->accept_recv_req->iosb->status == STATUS_PENDING) { complete_async_accept_recv( sock->accept_recv_req ); if (get_error() != STATUS_PENDING) @@ -626,9 +627,12 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) async_wake_up( &sock->write_q, status ); LIST_FOR_EACH_ENTRY_SAFE( req, next, &sock->accept_list, struct accept_req, entry ) - async_terminate( req->async, status ); + { + if (req->iosb->status == STATUS_PENDING) + async_terminate( req->async, status ); + } - if (sock->accept_recv_req) + if (sock->accept_recv_req && sock->accept_recv_req->iosb->status == STATUS_PENDING) async_terminate( sock->accept_recv_req->async, status ); } @@ -872,13 +876,6 @@ static void sock_queue_async( struct fd *fd, struct async *async, int type, int static void sock_reselect_async( struct fd *fd, struct async_queue *queue ) { struct sock *sock = get_fd_user( fd ); - struct accept_req *req, *next; - - LIST_FOR_EACH_ENTRY_SAFE( req, next, &sock->accept_list, struct accept_req, entry ) - { - if (req->iosb->status != STATUS_PENDING) - free_accept_req( req ); - } /* ignore reselect on ifchange queue */ if (&sock->ifchange_q != queue) @@ -1434,6 +1431,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (!(req = alloc_accept_req( sock, NULL, async, NULL ))) return 0; list_add_tail( &sock->accept_list, &req->entry ); + async_set_completion_callback( async, free_accept_req, req ); queue_async( &sock->accept_q, async ); sock_reselect( sock ); set_error( STATUS_PENDING ); @@ -1490,6 +1488,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) release_object( acceptsock ); acceptsock->wparam = params->accept_handle; + async_set_completion_callback( async, free_accept_req, req ); queue_async( &sock->accept_q, async ); sock_reselect( sock ); set_error( STATUS_PENDING );
1
0
0
0
Zebediah Figura : server: Hold a reference to both sockets in the accept_req structure.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 12783dabbcff59d31e4973b09d2e0b8442ed3931 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=12783dabbcff59d31e4973b0…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 8 17:40:41 2021 -0600 server: Hold a reference to both sockets in the accept_req structure. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/sock.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/server/sock.c b/server/sock.c index 6523418f779..78b1578113b 100644 --- a/server/sock.c +++ b/server/sock.c @@ -127,7 +127,7 @@ struct accept_req struct list entry; struct async *async; struct iosb *iosb; - struct sock *acceptsock; + struct sock *sock, *acceptsock; int accepted; unsigned int recv_len, local_len; }; @@ -452,9 +452,14 @@ static inline int sock_error( struct fd *fd ) static void free_accept_req( struct accept_req *req ) { list_remove( &req->entry ); - if (req->acceptsock) req->acceptsock->accept_recv_req = NULL; + if (req->acceptsock) + { + req->acceptsock->accept_recv_req = NULL; + release_object( req->acceptsock ); + } release_object( req->async ); release_object( req->iosb ); + release_object( req->sock ); free( req ); } @@ -1361,7 +1366,7 @@ static int sock_get_ntstatus( int err ) } } -static struct accept_req *alloc_accept_req( struct sock *acceptsock, struct async *async, +static struct accept_req *alloc_accept_req( struct sock *sock, struct sock *acceptsock, struct async *async, const struct afd_accept_into_params *params ) { struct accept_req *req = mem_alloc( sizeof(*req) ); @@ -1370,7 +1375,9 @@ static struct accept_req *alloc_accept_req( struct sock *acceptsock, struct asyn { req->async = (struct async *)grab_object( async ); req->iosb = async_get_iosb( async ); + req->sock = (struct sock *)grab_object( sock ); req->acceptsock = acceptsock; + if (acceptsock) grab_object( acceptsock ); req->accepted = 0; req->recv_len = 0; req->local_len = 0; @@ -1424,7 +1431,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (sock->state & FD_WINE_NONBLOCKING) return 0; if (get_error() != (0xc0010000 | WSAEWOULDBLOCK)) return 0; - if (!(req = alloc_accept_req( NULL, async, NULL ))) return 0; + if (!(req = alloc_accept_req( sock, NULL, async, NULL ))) return 0; list_add_tail( &sock->accept_list, &req->entry ); queue_async( &sock->accept_q, async ); @@ -1473,7 +1480,7 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return 0; } - if (!(req = alloc_accept_req( acceptsock, async, params ))) + if (!(req = alloc_accept_req( sock, acceptsock, async, params ))) { release_object( acceptsock ); return 0;
1
0
0
0
Zebediah Figura : server: Terminate accept asyncs when the last socket handle is closed.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 27db283449479180bd3f6ba37d3f34f1cda4d03b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=27db283449479180bd3f6ba3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 8 17:40:40 2021 -0600 server: Terminate accept asyncs when the last socket handle is closed. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/sock.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/server/sock.c b/server/sock.c index 4ec21fc73b3..6523418f779 100644 --- a/server/sock.c +++ b/server/sock.c @@ -165,6 +165,7 @@ struct sock static void sock_dump( struct object *obj, int verbose ); static int sock_signaled( struct object *obj, struct wait_queue_entry *entry ); static struct fd *sock_get_fd( struct object *obj ); +static int sock_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); static void sock_destroy( struct object *obj ); static struct object *sock_get_ifchange( struct sock *sock ); static void sock_release_ifchange( struct sock *sock ); @@ -201,7 +202,7 @@ static const struct object_ops sock_ops = NULL, /* unlink_name */ no_open_file, /* open_file */ no_kernel_obj_list, /* get_kernel_obj_list */ - fd_close_handle, /* close_handle */ + sock_close_handle, /* close_handle */ sock_destroy /* destroy */ }; @@ -885,11 +886,27 @@ static struct fd *sock_get_fd( struct object *obj ) return (struct fd *)grab_object( sock->fd ); } -static void sock_destroy( struct object *obj ) +static int sock_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) { struct sock *sock = (struct sock *)obj; struct accept_req *req, *next; + if (sock->obj.handle_count == 1) /* last handle */ + { + if (sock->accept_recv_req) + async_terminate( sock->accept_recv_req->async, STATUS_CANCELLED ); + + LIST_FOR_EACH_ENTRY_SAFE( req, next, &sock->accept_list, struct accept_req, entry ) + async_terminate( req->async, STATUS_CANCELLED ); + } + + return fd_close_handle( obj, process, handle ); +} + +static void sock_destroy( struct object *obj ) +{ + struct sock *sock = (struct sock *)obj; + assert( obj->ops == &sock_ops ); /* FIXME: special socket shutdown stuff? */ @@ -897,12 +914,6 @@ static void sock_destroy( struct object *obj ) if ( sock->deferred ) release_object( sock->deferred ); - if (sock->accept_recv_req) - async_terminate( sock->accept_recv_req->async, STATUS_CANCELLED ); - - LIST_FOR_EACH_ENTRY_SAFE( req, next, &sock->accept_list, struct accept_req, entry ) - async_terminate( req->async, STATUS_CANCELLED ); - async_wake_up( &sock->ifchange_q, STATUS_CANCELLED ); sock_release_ifchange( sock ); free_async_queue( &sock->read_q );
1
0
0
0
Zebediah Figura : server: Hold a reference to the iosb in the accept_req structure.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: d1270a27f0e392f98b3fda168347688a60ac474b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d1270a27f0e392f98b3fda16…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 8 17:40:39 2021 -0600 server: Hold a reference to the iosb in the accept_req structure. For convenience. Mirrors struct pipe_message. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/sock.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/server/sock.c b/server/sock.c index 5281c65e8b0..4ec21fc73b3 100644 --- a/server/sock.c +++ b/server/sock.c @@ -126,6 +126,7 @@ struct accept_req { struct list entry; struct async *async; + struct iosb *iosb; struct sock *acceptsock; int accepted; unsigned int recv_len, local_len; @@ -452,11 +453,13 @@ static void free_accept_req( struct accept_req *req ) list_remove( &req->entry ); if (req->acceptsock) req->acceptsock->accept_recv_req = NULL; release_object( req->async ); + release_object( req->iosb ); free( req ); } -static void fill_accept_output( struct accept_req *req, struct iosb *iosb ) +static void fill_accept_output( struct accept_req *req ) { + struct iosb *iosb = req->iosb; union unix_sockaddr unix_addr; struct WS_sockaddr *win_addr; unsigned int remote_len; @@ -527,20 +530,17 @@ static void complete_async_accept( struct sock *sock, struct accept_req *req ) { struct sock *acceptsock = req->acceptsock; struct async *async = req->async; - struct iosb *iosb; if (debug_level) fprintf( stderr, "completing accept request for socket %p\n", sock ); if (acceptsock) { if (!accept_into_socket( sock, acceptsock )) return; - - iosb = async_get_iosb( async ); - fill_accept_output( req, iosb ); - release_object( iosb ); + fill_accept_output( req ); } else { + struct iosb *iosb = req->iosb; obj_handle_t handle; if (!(acceptsock = accept_socket( sock ))) return; @@ -550,32 +550,22 @@ static void complete_async_accept( struct sock *sock, struct accept_req *req ) release_object( acceptsock ); if (!handle) return; - iosb = async_get_iosb( async ); - if (!(iosb->out_data = malloc( sizeof(handle) ))) - { - release_object( iosb ); - return; - } + if (!(iosb->out_data = malloc( sizeof(handle) ))) return; + iosb->status = STATUS_SUCCESS; iosb->out_size = sizeof(handle); memcpy( iosb->out_data, &handle, sizeof(handle) ); - release_object( iosb ); set_error( STATUS_ALERTED ); } } static void complete_async_accept_recv( struct accept_req *req ) { - struct async *async = req->async; - struct iosb *iosb; - if (debug_level) fprintf( stderr, "completing accept recv request for socket %p\n", req->acceptsock ); assert( req->recv_len ); - iosb = async_get_iosb( async ); - fill_accept_output( req, iosb ); - release_object( iosb ); + fill_accept_output( req ); } static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) @@ -880,10 +870,8 @@ static void sock_reselect_async( struct fd *fd, struct async_queue *queue ) LIST_FOR_EACH_ENTRY_SAFE( req, next, &sock->accept_list, struct accept_req, entry ) { - struct iosb *iosb = async_get_iosb( req->async ); - if (iosb->status != STATUS_PENDING) + if (req->iosb->status != STATUS_PENDING) free_accept_req( req ); - release_object( iosb ); } /* ignore reselect on ifchange queue */ @@ -1370,6 +1358,7 @@ static struct accept_req *alloc_accept_req( struct sock *acceptsock, struct asyn if (req) { req->async = (struct async *)grab_object( async ); + req->iosb = async_get_iosb( async ); req->acceptsock = acceptsock; req->accepted = 0; req->recv_len = 0;
1
0
0
0
David Koolhoven : ntdll: Don't try to convert module to 64-bit if it doesn't contain code.
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: 4f7a4146cd71c56fdb03412424ebbf1c91b69a94 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f7a4146cd71c56fdb034124…
Author: David Koolhoven <david(a)koolhoven-home.net> Date: Wed Feb 10 00:24:49 2021 -0500 ntdll: Don't try to convert module to 64-bit if it doesn't contain code. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50647
Signed-off-by: David Koolhoven <david(a)koolhoven-home.net> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 6b76c6f406e..40efd46d3c7 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1984,6 +1984,7 @@ static BOOL convert_to_pe64( HMODULE module, const SECTION_IMAGE_INFORMATION *in ULONG i, old_prot; if (nt->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) return TRUE; /* already 64-bit */ + if (!info->ImageContainsCode) return TRUE; /* no need to convert */ TRACE( "%p\n", module );
1
0
0
0
Henri Verbeet : wined3d: Construct a separate source box in wined3d_device_copy_resource().
by Alexandre Julliard
10 Feb '21
10 Feb '21
Module: wine Branch: master Commit: fb9ec02e0664c16de9846b15f95093c4cf66afc4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb9ec02e0664c16de9846b15…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 10 00:24:05 2021 +0100 wined3d: Construct a separate source box in wined3d_device_copy_resource(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 6 ++---- dlls/wined3d/device.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 21543cd224c..fddb7bfd218 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -28205,10 +28205,8 @@ static void test_compressed_format_compatibility(const D3D_FEATURE_LEVEL feature expected = texture_data[k]; else expected = initial_data[k]; - todo_wine_if(supported && (dst_format->block_edge != 1 - || k >= src_format->block_size / (sizeof(colour)))) - ok(colour == expected, "%#x -> %#x: Got unexpected colour 0x%08x at %u, expected 0x%08x.\n", - src_format->id, dst_format->id, colour, k, expected); + ok(colour == expected, "%#x -> %#x: Got unexpected colour 0x%08x at %u, expected 0x%08x.\n", + src_format->id, dst_format->id, colour, k, expected); if (colour != expected) break; } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index df0f9721e4a..a400221ee30 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4544,7 +4544,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, unsigned int src_row_block_count, dst_row_block_count; struct wined3d_texture *dst_texture, *src_texture; unsigned int src_row_count, dst_row_count; - struct wined3d_box box; + struct wined3d_box src_box, dst_box; unsigned int i, j; TRACE("device %p, dst_resource %p, src_resource %p.\n", device, dst_resource, src_resource); @@ -4591,9 +4591,9 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, if (dst_resource->type == WINED3D_RTYPE_BUFFER) { - wined3d_box_set(&box, 0, 0, src_resource->size, 1, 0, 1); - wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, 0, &box, - src_resource, 0, &box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); + wined3d_box_set(&src_box, 0, 0, src_resource->size, 1, 0, 1); + wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, 0, &src_box, + src_resource, 0, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); return; } @@ -4611,13 +4611,14 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, for (i = 0; i < dst_texture->level_count; ++i) { - wined3d_texture_get_level_box(dst_texture, i, &box); + wined3d_texture_get_level_box(src_texture, i, &src_box); + wined3d_texture_get_level_box(dst_texture, i, &dst_box); for (j = 0; j < dst_texture->layer_count; ++j) { unsigned int idx = j * dst_texture->level_count + i; - wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, idx, &box, - src_resource, idx, &box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); + wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, idx, &dst_box, + src_resource, idx, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); } } }
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
92
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
Results per page:
10
25
50
100
200