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
March 2022
----- 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
1138 discussions
Start a n
N
ew thread
Giovanni Mascellani : tests: Work around a rounding difference between NVIDIA and AMD.
by Alexandre Julliard
17 Mar '22
17 Mar '22
Module: vkd3d Branch: master Commit: 8efbd4de51566cca6025cdf9e7f969b8d991717e URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=8efbd4de51566cca6025cdf…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Thu Mar 17 14:35:50 2022 +0100 tests: Work around a rounding difference between NVIDIA and AMD. NVIDIA and AMD round differently the assignment of 0.5f to a UAV of type R16G16_UNORM. NVIDIA rounds to 0x7fff and AMD to 0x8000. According to both Vulkan and D3D12 specifications, both values are acceptable, but the discrepancy currently appears as a failure on NVIDIA cards. Work around the issue by using 0.25f instead of 0.5f, which is rounded as 0x4000 on both implementations. Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index 5067dd97..d17a1c32 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -4930,7 +4930,7 @@ static void test_clear_unordered_access_view_buffer(void) {DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE}, {0x1234, 0xabcd, 0, 0}, 0xabcd1234}, {DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE}, - {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, true}, + {0x3e800000 /* 0.25f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff4000, true}, {DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE}, {0x40000000 /* 2.0f */, 0 /* 0.0f */, 0, 0}, 0x0000ffff, true}, {DXGI_FORMAT_R16G16_UNORM, { 0, BUFFER_SIZE / sizeof(uint32_t), 0, 0, D3D12_BUFFER_UAV_FLAG_NONE}, @@ -5124,7 +5124,7 @@ static void test_clear_unordered_access_view_image(void) {DXGI_FORMAT_R11G11B10_FLOAT, 1, 1, 0, 0, 1, 0, {}, {1, 2, 3, 4}, 0x00c01001}, /* Test float clears with formats. */ {DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, 0, 1, 0, {}, - {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff8000, true}, + {0x3e800000 /* 0.25f */, 0x3f800000 /* 1.0f */, 0, 0}, 0xffff4000, true}, {DXGI_FORMAT_R16G16_FLOAT, 1, 1, 0, 0, 1, 0, {}, {0x3f000000 /* 0.5f */, 0x3f800000 /* 1.0f */, 0, 0}, 0x3c003800, true}, {DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, 0, 0, 1, 0, {}, @@ -34557,7 +34557,7 @@ static void test_bufinfo_instruction(void) uav_desc.Buffer.Flags = test->raw ? D3D12_BUFFER_UAV_FLAG_RAW : 0; uav_desc.Buffer.FirstElement = test->view_element_idx; uav_desc.Buffer.NumElements = test->view_element_count; - uav_desc.Buffer.StructureByteStride = test->buffer_structure_byte_stride;; + uav_desc.Buffer.StructureByteStride = test->buffer_structure_byte_stride; ID3D12Device_CreateUnorderedAccessView(device, buffer, NULL, &uav_desc, cpu_handle); } else
1
0
0
0
Jinoh Kang : comctl32: Pre-multiply static control bitmap image by alpha for GdiAlphaBlend.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 62df608d3ed84aac7ce517fd07ea13e48b49b08c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=62df608d3ed84aac7ce517fd…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Tue Mar 15 03:35:12 2022 +0900 comctl32: Pre-multiply static control bitmap image by alpha for GdiAlphaBlend. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/static.c | 11 +++++++++++ dlls/comctl32/tests/static.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c index 7a3ac958111..9b20e6a8b66 100644 --- a/dlls/comctl32/static.c +++ b/dlls/comctl32/static.c @@ -203,6 +203,17 @@ static HBITMAP create_alpha_bitmap( HBITMAP hbitmap ) DeleteObject( alpha ); alpha = 0; } + else + { + /* pre-multiply by alpha */ + for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4) + { + unsigned int alpha = ptr[3]; + ptr[0] = (ptr[0] * alpha + 127) / 255; + ptr[1] = (ptr[1] * alpha + 127) / 255; + ptr[2] = (ptr[2] * alpha + 127) / 255; + } + } } DeleteDC( hdc ); diff --git a/dlls/comctl32/tests/static.c b/dlls/comctl32/tests/static.c index b8f43142d6b..7b6ac679c92 100644 --- a/dlls/comctl32/tests/static.c +++ b/dlls/comctl32/tests/static.c @@ -165,7 +165,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph ok(bm.bmBits != NULL, "bmBits is NULL\n"); memcpy(bits, bm.bmBits, 4); if (is_premult) - todo_wine ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); else if (is_alpha) @@ -195,7 +194,6 @@ static void test_image(HBITMAP image, BOOL is_dib, BOOL is_premult, BOOL is_alph DeleteDC(hdc); if (is_premult) - todo_wine ok(bits[0] == 0x05 && bits[1] == 0x09 && bits[2] == 0x0e && bits[3] == 0x44, "bits: %02x %02x %02x %02x\n", bits[0], bits[1], bits[2], bits[3]); else if (is_alpha)
1
0
0
0
Jinoh Kang : user32: Fix rounding in premultiplied alpha conversion for cursors and icons.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: c4773e1823d4ed48e2f3918bf6a8753fcb2f645f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4773e1823d4ed48e2f3918b…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Tue Mar 15 03:14:17 2022 +0900 user32: Fix rounding in premultiplied alpha conversion for cursors and icons. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/cursoricon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index cab9fbde32e..abf3a5dac53 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -775,9 +775,9 @@ static HBITMAP create_alpha_bitmap( HBITMAP color, const BITMAPINFO *src_info, c for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4) { unsigned int alpha = ptr[3]; - ptr[0] = ptr[0] * alpha / 255; - ptr[1] = ptr[1] * alpha / 255; - ptr[2] = ptr[2] * alpha / 255; + ptr[0] = (ptr[0] * alpha + 127) / 255; + ptr[1] = (ptr[1] * alpha + 127) / 255; + ptr[2] = (ptr[2] * alpha + 127) / 255; } done:
1
0
0
0
Georg Lehmann : winevulkan: Update to VK spec version 1.3.208.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 0a4af87e7f411925d76659e81d65147be76c17af URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a4af87e7f411925d76659e8…
Author: Georg Lehmann <dadschoorse(a)gmail.com> Date: Tue Mar 15 20:11:41 2022 +0100 winevulkan: Update to VK spec version 1.3.208. Signed-off-by: Georg Lehmann <dadschoorse(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winevulkan/make_vulkan | 2 +- dlls/winevulkan/vulkan_thunks.c | 1 + dlls/winevulkan/winevulkan.json | 2 +- include/wine/vulkan.h | 10 +++++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 8838200403e..2a3129bacfe 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -64,7 +64,7 @@ from enum import Enum LOGGER = logging.Logger("vulkan") LOGGER.addHandler(logging.StreamHandler()) -VK_XML_VERSION = "1.3.207" +VK_XML_VERSION = "1.3.208" WINE_VK_VERSION = (1, 3) # Filenames to create. diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 719113d7e81..cb6a214b9f2 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -9820,6 +9820,7 @@ static const char * const vk_instance_extensions[] = "VK_KHR_external_semaphore_capabilities", "VK_KHR_get_physical_device_properties2", "VK_KHR_get_surface_capabilities2", + "VK_KHR_portability_enumeration", "VK_KHR_surface", "VK_KHR_win32_surface", }; diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json index f40c777e55d..5a4a1747626 100644 --- a/dlls/winevulkan/winevulkan.json +++ b/dlls/winevulkan/winevulkan.json @@ -2,6 +2,6 @@ "file_format_version": "1.0.0", "ICD": { "library_path": ".\\winevulkan.dll", - "api_version": "1.3.207" + "api_version": "1.3.208" } } diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index 60f434426ed..675f6cf12a5 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -483,6 +483,8 @@ #define VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME "VK_EXT_image_view_min_lod" #define VK_EXT_MULTI_DRAW_SPEC_VERSION 1 #define VK_EXT_MULTI_DRAW_EXTENSION_NAME "VK_EXT_multi_draw" +#define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1 +#define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration" #define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1 #define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" #define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 @@ -519,7 +521,7 @@ #define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0) #define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0) #define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0) -#define VK_HEADER_VERSION 207 +#define VK_HEADER_VERSION 208 #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) #define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; #define VK_USE_64_BIT_PTR_DEFINES 0 @@ -2371,6 +2373,12 @@ typedef enum VkIndirectStateFlagBitsNV VK_INDIRECT_STATE_FLAG_BITS_NV_MAX_ENUM = 0x7fffffff, } VkIndirectStateFlagBitsNV; +typedef enum VkInstanceCreateFlagBits +{ + VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001, + VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, +} VkInstanceCreateFlagBits; + typedef enum VkInternalAllocationType { VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0,
1
0
0
0
Bernhard Kölbl : windows.media.speech: Implement Completed event.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: c0910657669b47de4de9de375b547f208a0612de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0910657669b47de4de9de37…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Wed Mar 16 17:31:04 2022 +0100 windows.media.speech: Implement Completed event. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/recognizer.c | 14 ++++-- dlls/windows.media.speech/tests/speech.c | 85 ++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index 7f4c7429929..da219d6bd0a 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -34,6 +34,7 @@ struct session ISpeechContinuousRecognitionSession ISpeechContinuousRecognitionSession_iface; LONG ref; + struct list completed_handlers; struct list result_handlers; }; @@ -83,6 +84,7 @@ static ULONG WINAPI session_Release( ISpeechContinuousRecognitionSession *iface if (!ref) { + typed_event_handlers_clear(&impl->completed_handlers); typed_event_handlers_clear(&impl->result_handlers); free(impl); } @@ -162,14 +164,17 @@ static HRESULT WINAPI session_add_Completed( ISpeechContinuousRecognitionSession ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs *handler, EventRegistrationToken *token ) { - FIXME("iface %p, handler %p, token %p stub!\n", iface, handler, token); - return E_NOTIMPL; + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + TRACE("iface %p, handler %p, token %p.\n", iface, handler, token); + if (!handler) return E_INVALIDARG; + return typed_event_handlers_append(&impl->completed_handlers, (ITypedEventHandler_IInspectable_IInspectable *)handler, token); } static HRESULT WINAPI session_remove_Completed( ISpeechContinuousRecognitionSession *iface, EventRegistrationToken token ) { - FIXME("iface %p, token.value %#I64x stub!\n", iface, token.value); - return E_NOTIMPL; + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + TRACE("iface %p, token.value %#I64x.\n", iface, token.value); + return typed_event_handlers_remove(&impl->completed_handlers, &token); } static HRESULT WINAPI session_add_ResultGenerated( ISpeechContinuousRecognitionSession *iface, @@ -645,6 +650,7 @@ static HRESULT WINAPI recognizer_factory_Create( ISpeechRecognizerFactory *iface session->ISpeechContinuousRecognitionSession_iface.lpVtbl = &session_vtbl; session->ref = 1; + list_init(&session->completed_handlers); list_init(&session->result_handlers); impl->ISpeechRecognizer_iface.lpVtbl = &speech_recognizer_vtbl; diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 80e5d9af634..fc0a8d762c1 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -46,6 +46,12 @@ #define impl_from_IHandler_RecognitionResult impl_from_ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionResultGeneratedEventArgs #define IHandler_RecognitionResult_iface ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionResultGeneratedEventArgs_iface +#define IHandler_RecognitionCompleted ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs +#define IHandler_RecognitionCompletedVtbl ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgsVtbl +#define IID_IHandler_RecognitionCompleted IID_ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs +#define impl_from_IHandler_RecognitionCompleted impl_from_ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs +#define IHandler_RecognitionCompleted_iface ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs_iface + HRESULT WINAPI (*pDllGetActivationFactory)(HSTRING, IActivationFactory **); static BOOL is_win10_1507 = FALSE; @@ -86,6 +92,72 @@ static const char *debugstr_hstring(HSTRING hstr) return wine_dbgstr_wn(str, len); } +struct completed_event_handler +{ + IHandler_RecognitionCompleted IHandler_RecognitionCompleted_iface; + LONG ref; +}; + +static inline struct completed_event_handler *impl_from_IHandler_RecognitionCompleted( IHandler_RecognitionCompleted *iface ) +{ + return CONTAINING_RECORD(iface, struct completed_event_handler, IHandler_RecognitionCompleted_iface); +} + +HRESULT WINAPI completed_event_handler_QueryInterface( IHandler_RecognitionCompleted *iface, REFIID iid, void **out ) +{ + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IHandler_RecognitionCompleted)) + { + IUnknown_AddRef(iface); + *out = iface; + return S_OK; + } + + trace("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +ULONG WINAPI completed_event_handler_AddRef( IHandler_RecognitionCompleted *iface ) +{ + struct completed_event_handler *impl = impl_from_IHandler_RecognitionCompleted(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + return ref; +} + +ULONG WINAPI completed_event_handler_Release( IHandler_RecognitionCompleted *iface ) +{ + struct completed_event_handler *impl = impl_from_IHandler_RecognitionCompleted(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + return ref; +} + +HRESULT WINAPI completed_event_handler_Invoke( IHandler_RecognitionCompleted *iface, + ISpeechContinuousRecognitionSession *sender, + ISpeechContinuousRecognitionCompletedEventArgs *args ) +{ + trace("iface %p, sender %p, args %p.\n", iface, sender, args); + return S_OK; +} + +static const struct IHandler_RecognitionCompletedVtbl completed_event_handler_vtbl = +{ + /* IUnknown methods */ + completed_event_handler_QueryInterface, + completed_event_handler_AddRef, + completed_event_handler_Release, + /* ITypedEventHandler<SpeechContinuousRecognitionSession*, SpeechContinuousRecognitionCompletedEventArgs* > methods */ + completed_event_handler_Invoke +}; + +static HRESULT WINAPI completed_event_handler_create_static( struct completed_event_handler *impl ) +{ + impl->IHandler_RecognitionCompleted_iface.lpVtbl = &completed_event_handler_vtbl; + impl->ref = 1; + + return S_OK; +} + struct recognition_result_handler { IHandler_RecognitionResult IHandler_RecognitionResult_iface; @@ -651,6 +723,7 @@ static void test_SpeechRecognizer(void) IInspectable *inspectable = NULL; IClosable *closable = NULL; ILanguage *language = NULL; + struct completed_event_handler completed_handler; struct recognition_result_handler result_handler; EventRegistrationToken token = { .value = 0 }; HSTRING hstr, hstr_lang; @@ -728,6 +801,18 @@ static void test_SpeechRecognizer(void) check_refcount(session, 2); check_refcount(inspectable, 3); + hr = ISpeechContinuousRecognitionSession_add_Completed(session, NULL, &token); + ok(hr == E_INVALIDARG, "ISpeechContinuousRecognitionSession_add_ResultGenerated failed, hr %#lx.\n", hr); + + token.value = 0xdeadbeef; + completed_event_handler_create_static(&completed_handler); + hr = ISpeechContinuousRecognitionSession_add_Completed(session, &completed_handler.IHandler_RecognitionCompleted_iface, &token); + ok(hr == S_OK, "ISpeechContinuousRecognitionSession_add_ResultGenerated failed, hr %#lx.\n", hr); + ok(token.value != 0xdeadbeef, "Got unexpexted token: %#I64x.\n", token.value); + + hr = ISpeechContinuousRecognitionSession_remove_Completed(session, token); + ok(hr == S_OK, "ISpeechContinuousRecognitionSession_remove_ResultGenerated failed, hr %#lx.\n", hr); + hr = ISpeechContinuousRecognitionSession_add_ResultGenerated(session, NULL, &token); ok(hr == E_INVALIDARG, "ISpeechContinuousRecognitionSession_add_ResultGenerated failed, hr %#lx.\n", hr);
1
0
0
0
Bernhard Kölbl : windows.media.speech: Implement ResultGenerated event.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 3549bb80d085be36a10c9102d366ae90ed0520ae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3549bb80d085be36a10c9102…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Wed Mar 16 17:31:03 2022 +0100 windows.media.speech: Implement ResultGenerated event. Also add helpers to manage typed event handlers. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/Makefile.in | 1 + dlls/windows.media.speech/event_handlers.c | 108 +++++++++++++++++++++++++++++ dlls/windows.media.speech/private.h | 7 ++ dlls/windows.media.speech/recognizer.c | 17 +++-- dlls/windows.media.speech/tests/speech.c | 90 +++++++++++++++++++++++- include/windows.foundation.idl | 1 + 6 files changed, 218 insertions(+), 6 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=3549bb80d085be36a10c…
1
0
0
0
Bernhard Kölbl : windows.media.speech: Implement ISpeechRecognizer2_get_ContinuousRecognitionSession.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 0ff960b737d0a475e98e63ea9868f5d18a95a336 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0ff960b737d0a475e98e63ea…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Wed Mar 16 17:31:02 2022 +0100 windows.media.speech: Implement ISpeechRecognizer2_get_ContinuousRecognitionSession. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/recognizer.c | 6 ++++-- dlls/windows.media.speech/tests/speech.c | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index 8819a46d5ba..47c6e62f417 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -443,8 +443,10 @@ DEFINE_IINSPECTABLE(recognizer2, ISpeechRecognizer2, struct recognizer, ISpeechR static HRESULT WINAPI recognizer2_get_ContinuousRecognitionSession( ISpeechRecognizer2 *iface, ISpeechContinuousRecognitionSession **session ) { - FIXME("iface %p, session %p stub!\n", iface, session); - return E_NOTIMPL; + struct recognizer *impl = impl_from_ISpeechRecognizer2(iface); + TRACE("iface %p, session %p.\n", iface, session); + ISpeechContinuousRecognitionSession_QueryInterface(impl->session, &IID_ISpeechContinuousRecognitionSession, (void **)session); + return S_OK; } static HRESULT WINAPI recognizer2_get_State( ISpeechRecognizer2 *iface, SpeechRecognizerState *state ) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 66869a164d2..e22ab35928e 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -569,6 +569,7 @@ static void test_VoiceInformation(void) static void test_SpeechRecognizer(void) { static const WCHAR *speech_recognition_name = L"Windows.Media.SpeechRecognition.SpeechRecognizer"; + ISpeechContinuousRecognitionSession *session = NULL; ISpeechRecognizerFactory *sr_factory = NULL; ISpeechRecognizerStatics *sr_statics = NULL; ISpeechRecognizerStatics2 *sr_statics2 = NULL; @@ -648,6 +649,14 @@ static void test_SpeechRecognizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechRecognizer2, (void **)&recognizer2); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ISpeechRecognizer2_get_ContinuousRecognitionSession(recognizer2, &session); + ok(hr == S_OK, "ISpeechRecognizer2_get_ContinuousRecognitionSession failed, hr %#lx.\n", hr); + check_refcount(session, 2); + check_refcount(inspectable, 3); + + ref = ISpeechContinuousRecognitionSession_Release(session); + ok(ref == 1, "Got unexpected ref %lu.\n", ref); + hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
1
0
0
0
Bernhard Kölbl : windows.media.speech: Add SpeechContinousRecognitionSession stub.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: a03a4ee60e0efe43e083272573adf268df717bff URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a03a4ee60e0efe43e0832725…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Wed Mar 16 17:31:01 2022 +0100 windows.media.speech: Add SpeechContinousRecognitionSession stub. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/recognizer.c | 202 ++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 5 deletions(-) diff --git a/dlls/windows.media.speech/recognizer.c b/dlls/windows.media.speech/recognizer.c index 490493850c8..8819a46d5ba 100644 --- a/dlls/windows.media.speech/recognizer.c +++ b/dlls/windows.media.speech/recognizer.c @@ -23,6 +23,189 @@ WINE_DEFAULT_DEBUG_CHANNEL(speech); +/* + * + * SpeechContinuousRecognitionSession + * + */ + +struct session +{ + ISpeechContinuousRecognitionSession ISpeechContinuousRecognitionSession_iface; + LONG ref; +}; + +/* + * + * ISpeechContinuousRecognitionSession + * + */ + +static inline struct session *impl_from_ISpeechContinuousRecognitionSession( ISpeechContinuousRecognitionSession *iface ) +{ + return CONTAINING_RECORD(iface, struct session, ISpeechContinuousRecognitionSession_iface); +} + +static HRESULT WINAPI session_QueryInterface( ISpeechContinuousRecognitionSession *iface, REFIID iid, void **out ) +{ + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_ISpeechContinuousRecognitionSession)) + { + IInspectable_AddRef((*out = &impl->ISpeechContinuousRecognitionSession_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI session_AddRef( ISpeechContinuousRecognitionSession *iface ) +{ + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI session_Release( ISpeechContinuousRecognitionSession *iface ) +{ + struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + + if (!ref) + free(impl); + + return ref; +} + +static HRESULT WINAPI session_GetIids( ISpeechContinuousRecognitionSession *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_GetRuntimeClassName( ISpeechContinuousRecognitionSession *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_GetTrustLevel( ISpeechContinuousRecognitionSession *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_get_AutoStopSilenceTimeout( ISpeechContinuousRecognitionSession *iface, TimeSpan *value ) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_set_AutoStopSilenceTimeout( ISpeechContinuousRecognitionSession *iface, TimeSpan value ) +{ + FIXME("iface %p, value %#I64x stub!\n", iface, value.Duration); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_StartAsync( ISpeechContinuousRecognitionSession *iface, IAsyncAction **action ) +{ + FIXME("iface %p, action %p semi stub!\n", iface, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_StartWithModeAsync( ISpeechContinuousRecognitionSession *iface, + SpeechContinuousRecognitionMode mode, + IAsyncAction **action ) +{ + FIXME("iface %p, mode %u, action %p stub!\n", iface, mode, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_StopAsync( ISpeechContinuousRecognitionSession *iface, IAsyncAction **action ) +{ + FIXME("iface %p, action %p stub!\n", iface, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_CancelAsync( ISpeechContinuousRecognitionSession *iface, IAsyncAction **action ) +{ + FIXME("iface %p, action %p stub!\n", iface, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_PauseAsync( ISpeechContinuousRecognitionSession *iface, IAsyncAction **action ) +{ + FIXME("iface %p, action %p stub!\n", iface, action); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_Resume( ISpeechContinuousRecognitionSession *iface ) +{ + FIXME("iface %p stub!\n", iface); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_add_Completed( ISpeechContinuousRecognitionSession *iface, + ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionCompletedEventArgs *handler, + EventRegistrationToken *token ) +{ + FIXME("iface %p, handler %p, token %p stub!\n", iface, handler, token); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_remove_Completed( ISpeechContinuousRecognitionSession *iface, EventRegistrationToken token ) +{ + FIXME("iface %p, token.value %#I64x stub!\n", iface, token.value); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_add_ResultGenerated( ISpeechContinuousRecognitionSession *iface, + ITypedEventHandler_SpeechContinuousRecognitionSession_SpeechContinuousRecognitionResultGeneratedEventArgs *handler, + EventRegistrationToken *token) +{ + FIXME("iface %p, handler %p, token %p stub!\n", iface, handler, token); + return E_NOTIMPL; +} + +static HRESULT WINAPI session_remove_ResultGenerated( ISpeechContinuousRecognitionSession *iface, EventRegistrationToken token ) +{ + FIXME("iface %p, token.value %#I64x stub!\n", iface, token.value); + return E_NOTIMPL; +} + +static const struct ISpeechContinuousRecognitionSessionVtbl session_vtbl = +{ + /* IUnknown methods */ + session_QueryInterface, + session_AddRef, + session_Release, + /* IInspectable methods */ + session_GetIids, + session_GetRuntimeClassName, + session_GetTrustLevel, + /* ISpeechContinuousRecognitionSession methods */ + session_get_AutoStopSilenceTimeout, + session_set_AutoStopSilenceTimeout, + session_StartAsync, + session_StartWithModeAsync, + session_StopAsync, + session_CancelAsync, + session_PauseAsync, + session_Resume, + session_add_Completed, + session_remove_Completed, + session_add_ResultGenerated, + session_remove_ResultGenerated +}; + /* * * SpeechRecognizer @@ -35,6 +218,8 @@ struct recognizer IClosable IClosable_iface; ISpeechRecognizer2 ISpeechRecognizer2_iface; LONG ref; + + ISpeechContinuousRecognitionSession *session; }; /* @@ -96,7 +281,10 @@ static ULONG WINAPI recognizer_Release( ISpeechRecognizer *iface ) TRACE("iface %p, ref %lu.\n", iface, ref); if (!ref) + { + ISpeechContinuousRecognitionSession_Release(impl->session); free(impl); + } return ref; } @@ -433,21 +621,25 @@ DEFINE_IINSPECTABLE(recognizer_factory, ISpeechRecognizerFactory, struct recogni static HRESULT WINAPI recognizer_factory_Create( ISpeechRecognizerFactory *iface, ILanguage *language, ISpeechRecognizer **speechrecognizer ) { struct recognizer *impl; + struct session *session; TRACE("iface %p, language %p, speechrecognizer %p.\n", iface, language, speechrecognizer); - if (!(impl = calloc(1, sizeof(*impl)))) - { - *speechrecognizer = NULL; - return E_OUTOFMEMORY; - } + *speechrecognizer = NULL; + + if (!(impl = calloc(1, sizeof(*impl)))) return E_OUTOFMEMORY; + if (!(session = calloc(1, sizeof(*session)))) return E_OUTOFMEMORY; if (language) FIXME("language parameter unused. Stub!\n"); + session->ISpeechContinuousRecognitionSession_iface.lpVtbl = &session_vtbl; + session->ref = 1; + impl->ISpeechRecognizer_iface.lpVtbl = &speech_recognizer_vtbl; impl->IClosable_iface.lpVtbl = &closable_vtbl; impl->ISpeechRecognizer2_iface.lpVtbl = &speech_recognizer2_vtbl; + impl->session = &session->ISpeechContinuousRecognitionSession_iface; impl->ref = 1; TRACE("created SpeechRecognizer %p.\n", impl);
1
0
0
0
Bernhard Kölbl : windows.media.speech: Implement ISpeechRecognitionConstraint isEnabled.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: be725a5e0db5999c031a1b391e8d57b4d93615b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be725a5e0db5999c031a1b39…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Wed Mar 16 17:31:00 2022 +0100 windows.media.speech: Implement ISpeechRecognitionConstraint isEnabled. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/listconstraint.c | 14 ++++++++++---- dlls/windows.media.speech/tests/speech.c | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/windows.media.speech/listconstraint.c b/dlls/windows.media.speech/listconstraint.c index 33fe9d4ae51..d641902f4bc 100644 --- a/dlls/windows.media.speech/listconstraint.c +++ b/dlls/windows.media.speech/listconstraint.c @@ -34,6 +34,8 @@ struct list_constraint ISpeechRecognitionListConstraint ISpeechRecognitionListConstraint_iface; ISpeechRecognitionConstraint ISpeechRecognitionConstraint_iface; LONG ref; + + BOOLEAN enabled; }; /* @@ -142,14 +144,18 @@ DEFINE_IINSPECTABLE(constraint, ISpeechRecognitionConstraint, struct list_constr static HRESULT WINAPI constraint_get_IsEnabled( ISpeechRecognitionConstraint *iface, BOOLEAN *value ) { - FIXME("iface %p, value %p stub!\n", iface, value); - return E_NOTIMPL; + struct list_constraint *impl = impl_from_ISpeechRecognitionConstraint(iface); + TRACE("iface %p, value %p.\n", iface, value); + *value = impl->enabled; + return S_OK; } static HRESULT WINAPI constraint_put_IsEnabled( ISpeechRecognitionConstraint *iface, BOOLEAN value ) { - FIXME("iface %p, value %u stub!\n", iface, value); - return E_NOTIMPL; + struct list_constraint *impl = impl_from_ISpeechRecognitionConstraint(iface); + TRACE("iface %p, value %u.\n", iface, value); + impl->enabled = value; + return S_OK; } static HRESULT WINAPI constraint_get_Tag( ISpeechRecognitionConstraint *iface, HSTRING *value ) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index a88b8aae3d2..66869a164d2 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -797,13 +797,13 @@ static void test_SpeechRecognitionListConstraint(void) hr = WindowsDeleteString(tag_out); todo_wine ok(hr == S_OK, "WindowsDeleteString failed, hr %#lx.\n", hr); +skip_tests: hr = ISpeechRecognitionConstraint_put_IsEnabled(constraint, TRUE); - todo_wine ok(hr == S_OK, "ISpeechRecognitionConstraint_put_IsEnabled failed, hr %#lx.\n", hr); + ok(hr == S_OK, "ISpeechRecognitionConstraint_put_IsEnabled failed, hr %#lx.\n", hr); hr = ISpeechRecognitionConstraint_get_IsEnabled(constraint, &enabled); - todo_wine ok(hr == S_OK, "ISpeechRecognitionConstraint_get_IsEnabled failed, hr %#lx.\n", hr); - todo_wine ok(enabled, "ListConstraint didn't get enabled.\n"); + ok(hr == S_OK, "ISpeechRecognitionConstraint_get_IsEnabled failed, hr %#lx.\n", hr); + ok(enabled, "ListConstraint didn't get enabled.\n"); -skip_tests: ref = ISpeechRecognitionConstraint_Release(constraint); ok(ref == 1, "Got unexpected ref %lu.\n", ref);
1
0
0
0
Daniel Lehman : kernelbase: Check for invalid value in FileTimeToSystemTime.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: a5d14fa980542fcf26aeb5fa41e098b042f7b29d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a5d14fa980542fcf26aeb5fa…
Author: Daniel Lehman <dlehman(a)esri.com> Date: Tue Mar 15 10:15:13 2022 -0700 kernelbase: Check for invalid value in FileTimeToSystemTime. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/time.c | 2 -- dlls/kernelbase/file.c | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/time.c b/dlls/kernel32/tests/time.c index fdef78a4466..ee818a0e4a1 100644 --- a/dlls/kernel32/tests/time.c +++ b/dlls/kernel32/tests/time.c @@ -400,11 +400,9 @@ static void test_FileTimeToSystemTime(void) ft.dwLowDateTime = -1; SetLastError(0xdeadbeef); ret = FileTimeToSystemTime(&ft, &st); - todo_wine { ok(!ret, "expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); - } } static void test_FileTimeToLocalFileTime(void) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index c6dc904044a..a3a4b4f480b 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -3874,8 +3874,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH FileTimeToLocalFileTime( const FILETIME *utc, FILE BOOL WINAPI DECLSPEC_HOTPATCH FileTimeToSystemTime( const FILETIME *ft, SYSTEMTIME *systime ) { TIME_FIELDS tf; + const LARGE_INTEGER *li = (const LARGE_INTEGER *)ft; - RtlTimeToTimeFields( (const LARGE_INTEGER *)ft, &tf ); + if (li->QuadPart < 0) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + RtlTimeToTimeFields( li, &tf ); systime->wYear = tf.Year; systime->wMonth = tf.Month; systime->wDay = tf.Day;
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
114
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200