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
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
July 2022
----- 2025 -----
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
639 discussions
Start a n
N
ew thread
Georg Lehmann : winevulkan: Update to VK spec version 1.3.221.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: fa8c7a6e04b3d8292f741c8769fcc329eb3f16d0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fa8c7a6e04b3d8292f741c8769fcc3…
Author: Georg Lehmann <dadschoorse(a)gmail.com> Date: Thu Jul 14 16:09:58 2022 +0200 winevulkan: Update to VK spec version 1.3.221. Signed-off-by: Georg Lehmann <dadschoorse(a)gmail.com> --- dlls/winevulkan/make_vulkan | 2 +- dlls/winevulkan/vulkan_thunks.c | 17 ++++++++++++ dlls/winevulkan/winevulkan.json | 2 +- include/wine/vulkan.h | 60 +++++++++++++++++++++++++++++++++++++---- 4 files changed, 74 insertions(+), 7 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 52052f15bdd..d93d8958214 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.219" +VK_XML_VERSION = "1.3.221" WINE_VK_VERSION = (1, 3) # Filenames to create. diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 28f6107b83a..fa65a1af3f9 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -5002,6 +5002,22 @@ VkResult convert_VkDeviceCreateInfo_struct_chain(const void *pNext, VkDeviceCrea break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT: + { + const VkPhysicalDevicePipelineRobustnessFeaturesEXT *in = (const VkPhysicalDevicePipelineRobustnessFeaturesEXT *)in_header; + VkPhysicalDevicePipelineRobustnessFeaturesEXT *out; + + if (!(out = malloc(sizeof(*out)))) goto out_of_memory; + + out->sType = in->sType; + out->pNext = NULL; + out->pipelineRobustness = in->pipelineRobustness; + + out_header->pNext = (VkBaseOutStructure *)out; + out_header = out_header->pNext; + break; + } + default: FIXME("Application requested a linked structure of type %u.\n", in_header->sType); } @@ -9961,6 +9977,7 @@ static const char * const vk_device_extensions[] = "VK_EXT_pipeline_creation_cache_control", "VK_EXT_pipeline_creation_feedback", "VK_EXT_pipeline_properties", + "VK_EXT_pipeline_robustness", "VK_EXT_post_depth_coverage", "VK_EXT_primitive_topology_list_restart", "VK_EXT_primitives_generated_query", diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json index b0e1a8c23c6..0d148b75231 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.219" + "api_version": "1.3.221" } } diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index 8d7b6e1bcfc..164276e7ff8 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -136,6 +136,8 @@ #define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME "VK_EXT_texture_compression_astc_hdr" #define VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION 1 #define VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME "VK_EXT_astc_decode_mode" +#define VK_EXT_PIPELINE_ROBUSTNESS_SPEC_VERSION 1 +#define VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_pipeline_robustness" #define VK_KHR_MAINTENANCE1_SPEC_VERSION VK_KHR_MAINTENANCE_1_SPEC_VERSION #define VK_KHR_MAINTENANCE1_EXTENSION_NAME VK_KHR_MAINTENANCE_1_EXTENSION_NAME #define VK_KHR_MAINTENANCE_1_SPEC_VERSION 2 @@ -548,7 +550,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 219 +#define VK_HEADER_VERSION 221 #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 @@ -1743,8 +1745,8 @@ typedef enum VkFilter { VK_FILTER_NEAREST = 0, VK_FILTER_LINEAR = 1, - VK_FILTER_CUBIC_IMG = 1000015000, - VK_FILTER_CUBIC_EXT = VK_FILTER_CUBIC_IMG, + VK_FILTER_CUBIC_EXT = 1000015000, + VK_FILTER_CUBIC_IMG = VK_FILTER_CUBIC_EXT, VK_FILTER_MAX_ENUM = 0x7fffffff, } VkFilter; @@ -2069,7 +2071,7 @@ typedef enum VkFormatFeatureFlagBits VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 0x00004000, VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 0x00008000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000, @@ -2083,6 +2085,7 @@ typedef enum VkFormatFeatureFlagBits VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000, VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT, @@ -2093,7 +2096,6 @@ typedef enum VkFormatFeatureFlagBits VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG, VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, } VkFormatFeatureFlagBits; @@ -2796,6 +2798,24 @@ typedef enum VkPipelineLayoutCreateFlagBits VK_PIPELINE_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, } VkPipelineLayoutCreateFlagBits; +typedef enum VkPipelineRobustnessBufferBehaviorEXT +{ + VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT = 0, + VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT = 1, + VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT = 2, + VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT = 3, + VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_EXT_MAX_ENUM = 0x7fffffff, +} VkPipelineRobustnessBufferBehaviorEXT; + +typedef enum VkPipelineRobustnessImageBehaviorEXT +{ + VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT = 0, + VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT = 1, + VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT = 2, + VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT = 3, + VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_EXT_MAX_ENUM = 0x7fffffff, +} VkPipelineRobustnessImageBehaviorEXT; + typedef enum VkPipelineShaderStageCreateFlagBits { VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001, @@ -3492,6 +3512,9 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = 1000066000, VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = 1000067000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = 1000067001, + VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT = 1000068000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT = 1000068001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT = 1000068002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, @@ -7160,6 +7183,23 @@ typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT VkBool32 pipelinePropertiesIdentifier; } VkPhysicalDevicePipelinePropertiesFeaturesEXT; +typedef struct VkPhysicalDevicePipelineRobustnessFeaturesEXT +{ + VkStructureType sType; + void *pNext; + VkBool32 pipelineRobustness; +} VkPhysicalDevicePipelineRobustnessFeaturesEXT; + +typedef struct VkPhysicalDevicePipelineRobustnessPropertiesEXT +{ + VkStructureType sType; + void *pNext; + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers; + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers; + VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs; + VkPipelineRobustnessImageBehaviorEXT defaultRobustnessImages; +} VkPhysicalDevicePipelineRobustnessPropertiesEXT; + typedef struct VkPhysicalDevicePointClippingProperties { VkStructureType sType; @@ -8417,6 +8457,16 @@ typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV VkBool32 representativeFragmentTestEnable; } VkPipelineRepresentativeFragmentTestStateCreateInfoNV; +typedef struct VkPipelineRobustnessCreateInfoEXT +{ + VkStructureType sType; + const void *pNext; + VkPipelineRobustnessBufferBehaviorEXT storageBuffers; + VkPipelineRobustnessBufferBehaviorEXT uniformBuffers; + VkPipelineRobustnessBufferBehaviorEXT vertexInputs; + VkPipelineRobustnessImageBehaviorEXT images; +} VkPipelineRobustnessCreateInfoEXT; + typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT { VkStructureType sType;
1
0
0
0
Jeremy White : maintainers: Add trailing slashes to directories.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: dd86bd96b8cfecb621f3692378384dd4120c17b8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd86bd96b8cfecb621f3692378384d…
Author: Jeremy White <jwhite(a)codeweavers.com> Date: Thu Jul 14 10:34:32 2022 -0500 maintainers: Add trailing slashes to directories. The gitlab scripts operate without access to the wine tree. Requiring a trailing slash on patterns simplifies the logic to automatically assign reviewers to MRs. --- MAINTAINERS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index c5f560b2617..ec871697dbf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22,6 +22,7 @@ Descriptions of section entries used here: P: Other knowledgeable person. FullName <address@domain> F: Files and directories with wildcard patterns. One pattern per line. Multiple F: lines acceptable. + A trailing / implies /*. W: Link to additional information. Maintainers List @@ -272,12 +273,12 @@ F: dlls/winspool.drv/ Richedit M: Huw Davies <huw(a)codeweavers.com> -F: dlls/riched20 +F: dlls/riched20/ RPC Runtime P: Huw Davies <huw(a)codeweavers.com> P: Zebediah Figura <z.figura12(a)gmail.com> -F: dlls/rpcrt4 +F: dlls/rpcrt4/ Theming M: Zhiyi Zhang <zzhang(a)codeweavers.com> @@ -316,7 +317,7 @@ WIDL P: Huw Davies <huw(a)codeweavers.com> P: Rémi Bernon <rbernon(a)codeweavers.com> P: Zebediah Figura <z.figura12(a)gmail.com> -F: tools/widl +F: tools/widl/ Windows Imaging Component M: Esme Povirk <esme(a)codeweavers.com>
1
0
0
0
Zhiyi Zhang : opengl32/tests: Test wglCopyContext().
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: c0f4f31cdb26fcb12be71c32402474dd393f820d URL:
https://gitlab.winehq.org/wine/wine/-/commit/c0f4f31cdb26fcb12be71c32402474…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Apr 26 15:38:24 2022 +0800 opengl32/tests: Test wglCopyContext(). Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/opengl32/tests/opengl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index f05bb09d4b6..7d407a1d0b0 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -1875,6 +1875,26 @@ static void test_wglChoosePixelFormatARB(HDC hdc) } } +static void test_copy_context(HDC hdc) +{ + HGLRC ctx, ctx2; + BOOL ret; + + ctx = wglCreateContext(hdc); + ok(!!ctx, "Failed to create GL context, last error %#lx.\n", GetLastError()); + ctx2 = wglCreateContext(hdc); + ok(!!ctx2, "Failed to create GL context, last error %#lx.\n", GetLastError()); + + ret = wglCopyContext(ctx, ctx2, GL_ALL_ATTRIB_BITS); + todo_wine + ok(ret, "Failed to copy GL context, last error %#lx.\n", GetLastError()); + + ret = wglDeleteContext(ctx2); + ok(ret, "Failed to delete GL context, last error %#lx.\n", GetLastError()); + ret = wglDeleteContext(ctx); + ok(ret, "Failed to delete GL context, last error %#lx.\n", GetLastError()); +} + START_TEST(opengl) { HWND hwnd; @@ -1960,6 +1980,7 @@ START_TEST(opengl) test_getprocaddress(hdc); test_deletecontext(hwnd, hdc); test_makecurrent(hdc); + test_copy_context(hdc); /* The lack of wglGetExtensionsStringARB in general means broken software rendering or the lack of decent OpenGL support, skip tests in such cases */ if (!pwglGetExtensionsStringARB)
1
0
0
0
Jinoh Kang : riched20: Implement ITextDocument::Undo and ITextDocument::Redo.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: ded8227774570a1ea320dc34f2de0033f85b3ce7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ded8227774570a1ea320dc34f2de00…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Tue Jun 28 00:30:06 2022 +0900 riched20: Implement ITextDocument::Undo and ITextDocument::Redo. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53289
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/editor.c | 1 + dlls/riched20/editor.h | 2 ++ dlls/riched20/richole.c | 48 +++++++++++++++++++++++++++++++++++++++---- dlls/riched20/tests/richole.c | 30 +++++---------------------- dlls/riched20/undo.c | 14 +++++++++++++ 5 files changed, 66 insertions(+), 29 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index a1e0395f24d..108c37a7f30 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -3299,6 +3299,7 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam, } case EM_SETUNDOLIMIT: { + editor_enable_undo(editor); if ((int)wParam < 0) editor->nUndoLimit = STACK_SIZE_DEFAULT; else diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index d10ff225335..072d0f62782 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -393,6 +393,8 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor) DECLSPEC_HIDDEN; BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN; BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN; +void editor_disable_undo(ME_TextEditor *editor); +void editor_enable_undo(ME_TextEditor *editor); static inline BOOL editor_undo_ignored(ME_TextEditor *editor) { diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index afecd34dc2a..8190a4e2753 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -4245,15 +4245,55 @@ static HRESULT WINAPI ITextDocument2Old_fnEndEditCollection(ITextDocument2Old *i static HRESULT WINAPI ITextDocument2Old_fnUndo(ITextDocument2Old *iface, LONG Count, LONG *prop) { struct text_services *services = impl_from_ITextDocument2Old(iface); - FIXME("stub %p\n", services); - return E_NOTIMPL; + LONG actual_undo_count; + + if (prop) *prop = 0; + + switch (Count) + { + case tomFalse: + editor_disable_undo(services->editor); + return S_OK; + default: + if (Count > 0) break; + /* fallthrough */ + case tomTrue: + editor_enable_undo(services->editor); + return S_FALSE; + case tomSuspend: + if (services->editor->undo_ctl_state == undoActive) + { + services->editor->undo_ctl_state = undoSuspended; + } + return S_FALSE; + case tomResume: + services->editor->undo_ctl_state = undoActive; + return S_FALSE; + } + + for (actual_undo_count = 0; actual_undo_count < Count; actual_undo_count++) + { + if (!ME_Undo(services->editor)) break; + } + + if (prop) *prop = actual_undo_count; + return actual_undo_count == Count ? S_OK : S_FALSE; } static HRESULT WINAPI ITextDocument2Old_fnRedo(ITextDocument2Old *iface, LONG Count, LONG *prop) { struct text_services *services = impl_from_ITextDocument2Old(iface); - FIXME("stub %p\n", services); - return E_NOTIMPL; + LONG actual_redo_count; + + if (prop) *prop = 0; + + for (actual_redo_count = 0; actual_redo_count < Count; actual_redo_count++) + { + if (!ME_Redo(services->editor)) break; + } + + if (prop) *prop = actual_redo_count; + return actual_redo_count == Count ? S_OK : S_FALSE; } static HRESULT CreateITextRange(struct text_services *services, LONG start, LONG end, ITextRange** ppRange) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index a01f4e21db8..1ebc12a27ab 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -4940,8 +4940,8 @@ static void test_clipboard(void) ok(hr == S_OK, "Cut failed: 0x%08lx\n", hr); CLIPBOARD_RANGE_CONTAINS(range, 0, 4, "b\r\n c"); hr = ITextDocument_Undo(doc, 1, NULL); - todo_wine ok(hr == S_OK, "Undo failed: 0x%08lx\n", hr); - TODO_CLIPBOARD_RANGE_CONTAINS(range, 0, 5, "ab\r\n c"); + ok(hr == S_OK, "Undo failed: 0x%08lx\n", hr); + CLIPBOARD_RANGE_CONTAINS(range, 0, 5, "ab\r\n c"); /* Cannot cut when read-only */ SendMessageA(hwnd, EM_SETREADONLY, TRUE, 0); @@ -4986,26 +4986,23 @@ static void subtest_undo(const char *dummy_text) if (i != tomFalse && i != tomTrue) { hr = ITextDocument_Undo(doc, i, NULL); - todo_wine + todo_wine_if(i >= 1) ok(hr == (i >= 1 ? S_OK : S_FALSE), "(%ld@0) Undo: %#lx\n", i, hr); count = 0xcccccccc; hr = ITextDocument_Undo(doc, i, &count); - todo_wine + todo_wine_if(i >= 1) ok(hr == (i >= 1 ? S_OK : S_FALSE), "(%ld@0) Undo: %#lx\n", i, hr); - todo_wine + todo_wine_if(i >= 1) ok(count == (i >= 1 ? i : 0), "(%ld@0) Expected %ld, got %ld\n", i, i >= 0 ? i : 0, count); } hr = ITextDocument_Redo(doc, i, NULL); - todo_wine ok(hr == (i == 0 ? S_OK : S_FALSE), "(%ld@0) Redo: %#lx\n", i, hr); count = 0xcccccccc; hr = ITextDocument_Redo(doc, i, &count); - todo_wine ok(hr == (i == 0 ? S_OK : S_FALSE), "(%ld@0) Redo: %#lx\n", i, hr); - todo_wine ok(count == 0, "(%ld@0) got %ld\n", i, count); } @@ -5015,7 +5012,6 @@ static void subtest_undo(const char *dummy_text) if (dummy_text) { hr = ITextDocument_Undo(doc, tomSuspend, NULL); - todo_wine ok(hr == S_FALSE, "(@%ld) Undo: %#lx\n", stack_pos, hr); if (SUCCEEDED(hr)) { @@ -5024,7 +5020,6 @@ static void subtest_undo(const char *dummy_text) SendMessageA(hwnd, EM_SETSEL, 0, strlen(dummy_text)); SendMessageA(hwnd, EM_REPLACESEL, TRUE, (LPARAM)""); hr = ITextDocument_Undo(doc, tomResume, NULL); - todo_wine ok(hr == S_FALSE, "(@%ld) Undo: %#lx\n", stack_pos, hr); } } @@ -5038,7 +5033,6 @@ static void subtest_undo(const char *dummy_text) memset(buffer, 0, sizeof(buffer)); SendMessageA(hwnd, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer); - todo_wine_if(stack_pos != ARRAY_SIZE(text_seq) - 1) ok(strcmp(buffer, text_seq[stack_pos]) == 0, "Expected %s, got %s\n", wine_dbgstr_a(text_seq[stack_pos]), wine_dbgstr_a(buffer)); @@ -5049,18 +5043,14 @@ static void subtest_undo(const char *dummy_text) if (seq[i] < 0) { hr = ITextDocument_Undo(doc, -seq[i], &count); - todo_wine ok(hr == S_OK, "(%ld@%ld) Undo: %#lx\n", i, stack_pos, hr); - todo_wine ok(count == expect_count, "(%ld@%ld) Expected %ld, got %ld\n", i, stack_pos, expect_count, count); stack_pos -= count; } else { hr = ITextDocument_Redo(doc, seq[i], &count); - todo_wine ok(hr == (expect_count ? S_OK : S_FALSE), "(%ld@%ld) Redo: %#lx\n", i, stack_pos, hr); - todo_wine ok(count == expect_count, "(%ld@%ld) Expected %ld, got %ld\n", i, stack_pos, expect_count, count); stack_pos += count; } @@ -5145,7 +5135,6 @@ static HRESULT perform_editor_undo_state_action(struct undo_test *inst, enum edi else { hr = ITextDocument_Undo(inst->doc, tomTrue, count); - todo_wine ok(hr == S_FALSE, "Undo: %#lx\n", hr); } if (SUCCEEDED(hr)) @@ -5159,7 +5148,6 @@ static HRESULT perform_editor_undo_state_action(struct undo_test *inst, enum edi break; case undoActionDisable: hr = ITextDocument_Undo(inst->doc, tomFalse, count); - todo_wine ok(hr == S_OK, "Undo: %#lx\n", hr); if (SUCCEEDED(hr)) { @@ -5170,7 +5158,6 @@ static HRESULT perform_editor_undo_state_action(struct undo_test *inst, enum edi break; case undoActionSuspend: hr = ITextDocument_Undo(inst->doc, tomSuspend, count); - todo_wine ok(hr == S_FALSE, "Undo: %#lx\n", hr); if (SUCCEEDED(hr) && inst->undo_ctl_state == undoStateActive) { @@ -5179,7 +5166,6 @@ static HRESULT perform_editor_undo_state_action(struct undo_test *inst, enum edi break; case undoActionResume: hr = ITextDocument_Undo(inst->doc, tomResume, count); - todo_wine ok(hr == S_FALSE, "Undo: %#lx\n", hr); if (SUCCEEDED(hr)) { @@ -5193,7 +5179,6 @@ static HRESULT perform_editor_undo_state_action(struct undo_test *inst, enum edi if (count) { - todo_wine ok(*count == 0, "Got %ld\n", *count); } return hr; @@ -5221,7 +5206,6 @@ static HRESULT set_editor_undo_state(struct undo_test *inst, enum editorUndoStat break; } ok(inst->undo_ctl_state == state, "expected state %d, got %d\n", state, inst->undo_ctl_state); - todo_wine ok(SUCCEEDED(hr), "cannot set state to %d: %#lx\n", undoStateActive, hr); return hr; } @@ -5243,9 +5227,7 @@ static BOOL perform_undo_(struct undo_test *inst, BOOL can_undo, int line) { count = 0xcccccccc; hr = ITextDocument_Undo(inst->doc, 1, &count); - todo_wine ok_(__FILE__, line)(SUCCEEDED(hr), "got hr %#lx\n", hr); - todo_wine ok_(__FILE__, line)(count == (hr == S_OK), "expected count %d, got %ld\n", hr == S_OK, count); result = hr == S_OK && count > 0; } @@ -5279,9 +5261,7 @@ static BOOL perform_redo_(struct undo_test *inst, BOOL can_redo, int line) { count = 0xcccccccc; hr = ITextDocument_Redo(inst->doc, 1, &count); - todo_wine ok_(__FILE__, line)(SUCCEEDED(hr), "got hr %#lx\n", hr); - todo_wine ok_(__FILE__, line)(count == (hr == S_OK), "expected count %d, got %ld\n", hr == S_OK, count); result = hr == S_OK && count > 0; } diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index 607f90130d5..6e0c7c896ef 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -479,3 +479,17 @@ BOOL ME_Redo(ME_TextEditor *editor) ME_UpdateRepaint(editor, FALSE); return TRUE; } + +void editor_disable_undo(ME_TextEditor *editor) +{ + ME_EmptyUndoStack(editor); + editor->undo_ctl_state = undoDisabled; +} + +void editor_enable_undo(ME_TextEditor *editor) +{ + if (editor->undo_ctl_state == undoDisabled) + { + editor->undo_ctl_state = undoActive; + } +}
1
0
0
0
Jinoh Kang : riched20: Add undo control state variable to ME_TextEditor.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: 40c54854e61d8adfca21e2fa9260712e4f5453e9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/40c54854e61d8adfca21e2fa926071…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Tue Jun 28 00:26:31 2022 +0900 riched20: Add undo control state variable to ME_TextEditor. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/editor.c | 1 + dlls/riched20/editor.h | 2 +- dlls/riched20/editstr.h | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 3628e51ac9b..a1e0395f24d 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2973,6 +2973,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ed->nUndoStackSize = 0; ed->nUndoLimit = STACK_SIZE_DEFAULT; ed->nUndoMode = umAddToUndo; + ed->undo_ctl_state = undoActive; ed->nParagraphs = 1; ed->nLastSelStart = ed->nLastSelEnd = 0; ed->last_sel_start_para = ed->last_sel_end_para = ed->pCursors[0].para; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 4e8445c99aa..d10ff225335 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -396,7 +396,7 @@ void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN; static inline BOOL editor_undo_ignored(ME_TextEditor *editor) { - return editor->nUndoMode == umIgnore; + return editor->undo_ctl_state != undoActive || editor->nUndoMode == umIgnore; } /* txtsrv.c */ diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 3b166234f23..db219d7e4df 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -285,6 +285,12 @@ typedef enum { umAddBackToUndo } ME_UndoMode; +typedef enum { + undoActive, + undoSuspended, + undoDisabled +} ME_UndoControlState; + enum undo_type { undo_insert_run, @@ -402,6 +408,7 @@ typedef struct tagME_TextEditor int nUndoStackSize; int nUndoLimit; ME_UndoMode nUndoMode; + ME_UndoControlState undo_ctl_state; int nParagraphs; LONG nLastSelStart, nLastSelEnd; ME_Paragraph *last_sel_start_para, *last_sel_end_para;
1
0
0
0
Jinoh Kang : riched20: Factor out undo-ignored status check.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: 0cd86e010e41eebdc1a4c142f9cc6a4948554d0e URL:
https://gitlab.winehq.org/wine/wine/-/commit/0cd86e010e41eebdc1a4c142f9cc6a…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Tue Jun 28 00:23:44 2022 +0900 riched20: Factor out undo-ignored status check. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/editor.h | 5 +++++ dlls/riched20/undo.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 3028d9bdbd5..4e8445c99aa 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -394,6 +394,11 @@ BOOL ME_Undo(ME_TextEditor *editor) DECLSPEC_HIDDEN; BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN; +static inline BOOL editor_undo_ignored(ME_TextEditor *editor) +{ + return editor->nUndoMode == umIgnore; +} + /* txtsrv.c */ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10 ) DECLSPEC_HIDDEN; #ifdef __ASM_USE_THISCALL_WRAPPER diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c index d95ce121234..607f90130d5 100644 --- a/dlls/riched20/undo.c +++ b/dlls/riched20/undo.c @@ -53,7 +53,7 @@ static void empty_redo_stack(ME_TextEditor *editor) void ME_EmptyUndoStack(ME_TextEditor *editor) { struct undo_item *cursor, *cursor2; - if (editor->nUndoMode == umIgnore) + if (editor->nUndoMode == umIgnore) /* NOTE don't use editor_undo_ignored() here! */ return; TRACE("Emptying undo stack\n"); @@ -74,7 +74,7 @@ static struct undo_item *add_undo( ME_TextEditor *editor, enum undo_type type ) struct undo_item *undo, *item; struct list *head; - if (editor->nUndoMode == umIgnore) return NULL; + if (editor_undo_ignored(editor)) return NULL; if (editor->nUndoLimit == 0) return NULL; undo = heap_alloc( sizeof(*undo) ); @@ -229,7 +229,7 @@ void ME_CommitUndo(ME_TextEditor *editor) struct undo_item *item; struct list *head; - if (editor->nUndoMode == umIgnore) + if (editor_undo_ignored(editor)) return; assert(editor->nUndoMode == umAddToUndo); @@ -267,7 +267,7 @@ void ME_ContinueCoalescingTransaction(ME_TextEditor *editor) struct undo_item *item; struct list *head; - if (editor->nUndoMode == umIgnore) + if (editor_undo_ignored(editor)) return; assert(editor->nUndoMode == umAddToUndo); @@ -303,7 +303,7 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor) struct undo_item *item; struct list *head; - if (editor->nUndoMode == umIgnore) + if (editor_undo_ignored(editor)) return; assert(editor->nUndoMode == umAddToUndo); @@ -323,7 +323,7 @@ void ME_CommitCoalescingUndo(ME_TextEditor *editor) static void ME_PlayUndoItem(ME_TextEditor *editor, struct undo_item *undo) { - if (editor->nUndoMode == umIgnore) + if (editor_undo_ignored(editor)) return; TRACE("Playing undo/redo item, id=%d\n", undo->type); @@ -413,7 +413,7 @@ BOOL ME_Undo(ME_TextEditor *editor) struct list *head; struct undo_item *undo, *cursor2; - if (editor->nUndoMode == umIgnore) return FALSE; + if (editor_undo_ignored(editor)) return FALSE; assert(nMode == umAddToUndo || nMode == umIgnore); head = list_head( &editor->undo_stack ); @@ -453,7 +453,7 @@ BOOL ME_Redo(ME_TextEditor *editor) assert(nMode == umAddToUndo || nMode == umIgnore); - if (editor->nUndoMode == umIgnore) return FALSE; + if (editor_undo_ignored(editor)) return FALSE; head = list_head( &editor->redo_stack ); if (!head) return FALSE;
1
0
0
0
Zebediah Figura : server: Remove the no longer used sock_queue_async() function.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: 41d16358dc558c0544f3506a3a4c9dd464d6ceff URL:
https://gitlab.winehq.org/wine/wine/-/commit/41d16358dc558c0544f3506a3a4c9d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun May 29 16:56:16 2022 -0500 server: Remove the no longer used sock_queue_async() function. --- server/sock.c | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/server/sock.c b/server/sock.c index caa68dd213b..9f872c65637 100644 --- a/server/sock.c +++ b/server/sock.c @@ -237,7 +237,6 @@ static void sock_poll_event( struct fd *fd, int event ); static enum server_fd_type sock_get_fd_type( struct fd *fd ); static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); static void sock_cancel_async( struct fd *fd, struct async *async ); -static void sock_queue_async( struct fd *fd, struct async *async, int type, int count ); static void sock_reselect_async( struct fd *fd, struct async_queue *queue ); static int accept_into_socket( struct sock *sock, struct sock *acceptsock ); @@ -283,7 +282,7 @@ static const struct fd_ops sock_fd_ops = no_fd_get_volume_info, /* get_volume_info */ sock_ioctl, /* ioctl */ sock_cancel_async, /* cancel_async */ - sock_queue_async, /* queue_async */ + no_fd_queue_async, /* queue_async */ sock_reselect_async /* reselect_async */ }; @@ -1376,50 +1375,6 @@ static void sock_cancel_async( struct fd *fd, struct async *async ) async_terminate( async, STATUS_CANCELLED ); } -static void sock_queue_async( struct fd *fd, struct async *async, int type, int count ) -{ - struct sock *sock = get_fd_user( fd ); - struct async_queue *queue; - - assert( sock->obj.ops == &sock_ops ); - - switch (type) - { - case ASYNC_TYPE_READ: - if (sock->rd_shutdown) - { - set_error( STATUS_PIPE_DISCONNECTED ); - return; - } - queue = &sock->read_q; - break; - - case ASYNC_TYPE_WRITE: - if (sock->wr_shutdown) - { - set_error( STATUS_PIPE_DISCONNECTED ); - return; - } - queue = &sock->write_q; - break; - - default: - set_error( STATUS_INVALID_PARAMETER ); - return; - } - - if (sock->state != SOCK_CONNECTED) - { - set_error( STATUS_PIPE_DISCONNECTED ); - return; - } - - queue_async( queue, async ); - sock_reselect( sock ); - - set_error( STATUS_PENDING ); -} - static void sock_reselect_async( struct fd *fd, struct async_queue *queue ) { struct sock *sock = get_fd_user( fd );
1
0
0
0
Zebediah Figura : ntdll: Use the send_socket request for NtWriteFile() on a socket.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: cb8937801d42417c2b98cba15366ccc154c1cc40 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cb8937801d42417c2b98cba15366cc…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun May 29 16:51:00 2022 -0500 ntdll: Use the send_socket request for NtWriteFile() on a socket. send_socket does some extra bookkeeping that's currently missing from the register_async path. Instead of adding it to sock_queue_async(), let's just centralize all send requests so that they go through send_socket. --- dlls/ntdll/unix/file.c | 10 +++- dlls/ntdll/unix/socket.c | 111 ++++++++++++++++++++++++++--------------- dlls/ntdll/unix/unix_private.h | 2 + 3 files changed, 81 insertions(+), 42 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index f57532f55bf..738367dbb57 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -4768,7 +4768,7 @@ static BOOL async_write_proc( void *user, ULONG_PTR *info, NTSTATUS *status ) &needs_close, &type, NULL ))) break; - if (!fileio->count && (type == FD_TYPE_MAILSLOT || type == FD_TYPE_SOCKET)) + if (!fileio->count && type == FD_TYPE_MAILSLOT) result = send( fd, fileio->buffer, 0, 0 ); else result = write( fd, &fileio->buffer[fileio->already], fileio->count - fileio->already ); @@ -5498,11 +5498,17 @@ NTSTATUS WINAPI NtWriteFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, v goto done; } } + else if (type == FD_TYPE_SOCKET) + { + status = sock_write( handle, unix_handle, event, apc, apc_user, io, buffer, length ); + if (needs_close) close( unix_handle ); + return status; + } for (;;) { /* zero-length writes on sockets may not work with plain write(2) */ - if (!length && (type == FD_TYPE_MAILSLOT || type == FD_TYPE_SOCKET)) + if (!length && type == FD_TYPE_MAILSLOT) result = send( unix_handle, buffer, 0, 0 ); else result = write( unix_handle, (const char *)buffer + total, length - total ); diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 6abee680ee5..ef3c8494c3d 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -895,49 +895,13 @@ static BOOL async_send_proc( void *user, ULONG_PTR *info, NTSTATUS *status ) } static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, - IO_STATUS_BLOCK *io, int fd, const void *buffers_ptr, unsigned int count, - const struct WS_sockaddr *addr, unsigned int addr_len, int unix_flags, int force_async ) + IO_STATUS_BLOCK *io, int fd, struct async_send_ioctl *async, int force_async ) { - struct async_send_ioctl *async; + BOOL nonblocking, alerted; ULONG_PTR information; HANDLE wait_handle; - DWORD async_size; NTSTATUS status; - unsigned int i; ULONG options; - BOOL nonblocking, alerted; - - async_size = offsetof( struct async_send_ioctl, iov[count] ); - - if (!(async = (struct async_send_ioctl *)alloc_fileio( async_size, async_send_proc, handle ))) - return STATUS_NO_MEMORY; - - async->count = count; - if (in_wow64_call()) - { - const struct afd_wsabuf_32 *buffers = buffers_ptr; - - for (i = 0; i < count; ++i) - { - async->iov[i].iov_base = ULongToPtr( buffers[i].buf ); - async->iov[i].iov_len = buffers[i].len; - } - } - else - { - const WSABUF *buffers = buffers_ptr; - - for (i = 0; i < count; ++i) - { - async->iov[i].iov_base = buffers[i].buf; - async->iov[i].iov_len = buffers[i].len; - } - } - async->unix_flags = unix_flags; - async->addr = addr; - async->addr_len = addr_len; - async->iov_cursor = 0; - async->sent_len = 0; SERVER_START_REQ( send_socket ) { @@ -982,6 +946,72 @@ static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi return status; } +static NTSTATUS sock_ioctl_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, + IO_STATUS_BLOCK *io, int fd, const void *buffers_ptr, unsigned int count, + const struct WS_sockaddr *addr, unsigned int addr_len, int unix_flags, int force_async ) +{ + struct async_send_ioctl *async; + DWORD async_size; + unsigned int i; + + async_size = offsetof( struct async_send_ioctl, iov[count] ); + + if (!(async = (struct async_send_ioctl *)alloc_fileio( async_size, async_send_proc, handle ))) + return STATUS_NO_MEMORY; + + async->count = count; + if (in_wow64_call()) + { + const struct afd_wsabuf_32 *buffers = buffers_ptr; + + for (i = 0; i < count; ++i) + { + async->iov[i].iov_base = ULongToPtr( buffers[i].buf ); + async->iov[i].iov_len = buffers[i].len; + } + } + else + { + const WSABUF *buffers = buffers_ptr; + + for (i = 0; i < count; ++i) + { + async->iov[i].iov_base = buffers[i].buf; + async->iov[i].iov_len = buffers[i].len; + } + } + async->unix_flags = unix_flags; + async->addr = addr; + async->addr_len = addr_len; + async->iov_cursor = 0; + async->sent_len = 0; + + return sock_send( handle, event, apc, apc_user, io, fd, async, force_async ); +} + + +NTSTATUS sock_write( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, + void *apc_user, IO_STATUS_BLOCK *io, const void *buffer, ULONG length ) +{ + static const DWORD async_size = offsetof( struct async_send_ioctl, iov[1] ); + struct async_send_ioctl *async; + + if (!(async = (struct async_send_ioctl *)alloc_fileio( async_size, async_recv_proc, handle ))) + return STATUS_NO_MEMORY; + + async->count = 1; + async->iov[0].iov_base = (void *)buffer; + async->iov[0].iov_len = length; + async->unix_flags = 0; + async->addr = NULL; + async->addr_len = 0; + async->iov_cursor = 0; + async->sent_len = 0; + + return sock_send( handle, event, apc, apc_user, io, fd, async, 1 ); +} + + static ssize_t do_send( int fd, const void *buffer, size_t len, int flags ) { ssize_t ret; @@ -1420,8 +1450,9 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc WARN( "ignoring MSG_PARTIAL\n" ); if (params->ws_flags & ~(WS_MSG_OOB | WS_MSG_PARTIAL)) FIXME( "unknown flags %#x\n", params->ws_flags ); - status = sock_send( handle, event, apc, apc_user, io, fd, u64_to_user_ptr( params->buffers_ptr ), params->count, - u64_to_user_ptr( params->addr_ptr ), params->addr_len, unix_flags, params->force_async ); + status = sock_ioctl_send( handle, event, apc, apc_user, io, fd, u64_to_user_ptr( params->buffers_ptr ), + params->count, u64_to_user_ptr( params->addr_ptr ), params->addr_len, + unix_flags, params->force_async ); if (needs_close) close( fd ); return status; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 8d305bdada6..47f0f9c56a9 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -258,6 +258,8 @@ extern NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo ULONG code, void *in_buffer, ULONG in_size, void *out_buffer, ULONG out_size ) DECLSPEC_HIDDEN; extern NTSTATUS sock_read( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, void *buffer, ULONG length ) DECLSPEC_HIDDEN; +extern NTSTATUS sock_write( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, + IO_STATUS_BLOCK *io, const void *buffer, ULONG length ) DECLSPEC_HIDDEN; extern NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, ULONG code, void *in_buffer, ULONG in_size, void *out_buffer, ULONG out_size ) DECLSPEC_HIDDEN;
1
0
0
0
Zebediah Figura : ntdll: Use the recv_socket request for NtReadFile() on a socket.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: 9783e2e16c35586b5fa65ae27ac1f96c6260c534 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9783e2e16c35586b5fa65ae27ac1f9…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun May 29 16:40:36 2022 -0500 ntdll: Use the recv_socket request for NtReadFile() on a socket. recv_socket does some extra bookkeeping that's currently missing from the register_async path. Instead of adding it to sock_queue_async(), let's just centralize all recv requests so that they go through recv_socket. --- dlls/ntdll/unix/file.c | 6 ++ dlls/ntdll/unix/socket.c | 129 +++++++++++++++++++++++++---------------- dlls/ntdll/unix/unix_private.h | 2 + dlls/ws2_32/tests/afd.c | 2 +- 4 files changed, 89 insertions(+), 50 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index e09e8cafc82..f57532f55bf 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -5177,6 +5177,12 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo goto done; } } + else if (type == FD_TYPE_SOCKET) + { + status = sock_read( handle, unix_handle, event, apc, apc_user, io, buffer, length ); + if (needs_close) close( unix_handle ); + return status; + } if (type == FD_TYPE_SERIAL && async_read && length) { diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index 351028d4983..6abee680ee5 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -676,17 +676,67 @@ static BOOL async_recv_proc( void *user, ULONG_PTR *info, NTSTATUS *status ) } static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, - int fd, const void *buffers_ptr, unsigned int count, WSABUF *control, - struct WS_sockaddr *addr, int *addr_len, DWORD *ret_flags, int unix_flags, int force_async ) + int fd, struct async_recv_ioctl *async, int force_async ) { - struct async_recv_ioctl *async; + BOOL nonblocking, alerted; ULONG_PTR information; HANDLE wait_handle; - DWORD async_size; NTSTATUS status; unsigned int i; ULONG options; - BOOL nonblocking, alerted; + + for (i = 0; i < async->count; ++i) + { + if (!virtual_check_buffer_for_write( async->iov[i].iov_base, async->iov[i].iov_len )) + { + release_fileio( &async->io ); + return STATUS_ACCESS_VIOLATION; + } + } + + SERVER_START_REQ( recv_socket ) + { + req->force_async = force_async; + req->async = server_async( handle, &async->io, event, apc, apc_user, iosb_client_ptr(io) ); + req->oob = !!(async->unix_flags & MSG_OOB); + status = wine_server_call( req ); + wait_handle = wine_server_ptr_handle( reply->wait ); + options = reply->options; + nonblocking = reply->nonblocking; + } + SERVER_END_REQ; + + alerted = status == STATUS_ALERTED; + if (alerted) + { + status = try_recv( fd, async, &information ); + if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking)) + status = STATUS_PENDING; + } + + if (status != STATUS_PENDING) + { + if (!NT_ERROR(status) || (wait_handle && !alerted)) + { + io->Status = status; + io->Information = information; + } + release_fileio( &async->io ); + } + + if (alerted) set_async_direct_result( &wait_handle, status, information, FALSE ); + if (wait_handle) status = wait_async( wait_handle, options & FILE_SYNCHRONOUS_IO_ALERT ); + return status; +} + + +static NTSTATUS sock_ioctl_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, + int fd, const void *buffers_ptr, unsigned int count, WSABUF *control, + struct WS_sockaddr *addr, int *addr_len, DWORD *ret_flags, int unix_flags, int force_async ) +{ + struct async_recv_ioctl *async; + DWORD async_size; + unsigned int i; if (unix_flags & MSG_OOB) { @@ -728,48 +778,29 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi async->addr_len = addr_len; async->ret_flags = ret_flags; - for (i = 0; i < count; ++i) - { - if (!virtual_check_buffer_for_write( async->iov[i].iov_base, async->iov[i].iov_len )) - { - release_fileio( &async->io ); - return STATUS_ACCESS_VIOLATION; - } - } + return sock_recv( handle, event, apc, apc_user, io, fd, async, force_async ); +} - SERVER_START_REQ( recv_socket ) - { - req->force_async = force_async; - req->async = server_async( handle, &async->io, event, apc, apc_user, iosb_client_ptr(io) ); - req->oob = !!(unix_flags & MSG_OOB); - status = wine_server_call( req ); - wait_handle = wine_server_ptr_handle( reply->wait ); - options = reply->options; - nonblocking = reply->nonblocking; - } - SERVER_END_REQ; - alerted = status == STATUS_ALERTED; - if (alerted) - { - status = try_recv( fd, async, &information ); - if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking)) - status = STATUS_PENDING; - } +NTSTATUS sock_read( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, + void *apc_user, IO_STATUS_BLOCK *io, void *buffer, ULONG length ) +{ + static const DWORD async_size = offsetof( struct async_recv_ioctl, iov[1] ); + struct async_recv_ioctl *async; - if (status != STATUS_PENDING) - { - if (!NT_ERROR(status) || (wait_handle && !alerted)) - { - io->Status = status; - io->Information = information; - } - release_fileio( &async->io ); - } + if (!(async = (struct async_recv_ioctl *)alloc_fileio( async_size, async_recv_proc, handle ))) + return STATUS_NO_MEMORY; - if (alerted) set_async_direct_result( &wait_handle, status, information, FALSE ); - if (wait_handle) status = wait_async( wait_handle, options & FILE_SYNCHRONOUS_IO_ALERT ); - return status; + async->count = 1; + async->iov[0].iov_base = buffer; + async->iov[0].iov_len = length; + async->unix_flags = 0; + async->control = NULL; + async->addr = NULL; + async->addr_len = NULL; + async->ret_flags = NULL; + + return sock_recv( handle, event, apc, apc_user, io, fd, async, 1 ); } @@ -1334,8 +1365,8 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc unix_flags |= MSG_PEEK; if (params.msg_flags & AFD_MSG_WAITALL) FIXME( "MSG_WAITALL is not supported\n" ); - status = sock_recv( handle, event, apc, apc_user, io, fd, params.buffers, params.count, NULL, - NULL, NULL, NULL, unix_flags, !!(params.recv_flags & AFD_RECV_FORCE_ASYNC) ); + status = sock_ioctl_recv( handle, event, apc, apc_user, io, fd, params.buffers, params.count, NULL, + NULL, NULL, NULL, unix_flags, !!(params.recv_flags & AFD_RECV_FORCE_ASYNC) ); if (needs_close) close( fd ); return status; } @@ -1361,10 +1392,10 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc unix_flags |= MSG_PEEK; if (*ws_flags & WS_MSG_WAITALL) FIXME( "MSG_WAITALL is not supported\n" ); - status = sock_recv( handle, event, apc, apc_user, io, fd, u64_to_user_ptr(params->buffers_ptr), - params->count, u64_to_user_ptr(params->control_ptr), - u64_to_user_ptr(params->addr_ptr), u64_to_user_ptr(params->addr_len_ptr), - ws_flags, unix_flags, params->force_async ); + status = sock_ioctl_recv( handle, event, apc, apc_user, io, fd, u64_to_user_ptr(params->buffers_ptr), + params->count, u64_to_user_ptr(params->control_ptr), + u64_to_user_ptr(params->addr_ptr), u64_to_user_ptr(params->addr_len_ptr), + ws_flags, unix_flags, params->force_async ); if (needs_close) close( fd ); return status; } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 39b667ddd4a..8d305bdada6 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -256,6 +256,8 @@ extern NTSTATUS serial_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROU extern NTSTATUS serial_FlushBuffersFile( int fd ) DECLSPEC_HIDDEN; extern NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, ULONG code, void *in_buffer, ULONG in_size, void *out_buffer, ULONG out_size ) DECLSPEC_HIDDEN; +extern NTSTATUS sock_read( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, + IO_STATUS_BLOCK *io, void *buffer, ULONG length ) DECLSPEC_HIDDEN; extern NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user, IO_STATUS_BLOCK *io, ULONG code, void *in_buffer, ULONG in_size, void *out_buffer, ULONG out_size ) DECLSPEC_HIDDEN; diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c index 22ccdd0adeb..334c2c41be6 100644 --- a/dlls/ws2_32/tests/afd.c +++ b/dlls/ws2_32/tests/afd.c @@ -2645,7 +2645,7 @@ static void test_read_write(void) ret = WSAEnumNetworkEvents(client, event, &events); ok(!ret, "got error %lu\n", GetLastError()); - todo_wine ok(events.lNetworkEvents == FD_READ, "got events %#lx\n", events.lNetworkEvents); + ok(events.lNetworkEvents == FD_READ, "got events %#lx\n", events.lNetworkEvents); memset(buffer, 0xcc, sizeof(buffer)); ret = NtReadFile((HANDLE)client, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL);
1
0
0
0
Zebediah Figura : ws2_32/tests: Add some tests for NtReadFile() and NtWriteFile() on sockets.
by Alexandre Julliard
14 Jul '22
14 Jul '22
Module: wine Branch: master Commit: cc879c25d7347ceb58da48f6e6317f13268ea63c URL:
https://gitlab.winehq.org/wine/wine/-/commit/cc879c25d7347ceb58da48f6e6317f…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sun May 29 12:42:49 2022 -0500 ws2_32/tests: Add some tests for NtReadFile() and NtWriteFile() on sockets. --- dlls/ws2_32/tests/afd.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 151 insertions(+), 3 deletions(-) diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c index f84e7084a27..22ccdd0adeb 100644 --- a/dlls/ws2_32/tests/afd.c +++ b/dlls/ws2_32/tests/afd.c @@ -33,16 +33,16 @@ #define TIMEOUT_INFINITE _I64_MAX -static void tcp_socketpair(SOCKET *src, SOCKET *dst) +static void tcp_socketpair_flags(SOCKET *src, SOCKET *dst, DWORD flags) { SOCKET server = INVALID_SOCKET; struct sockaddr_in addr; int len, ret; - *src = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED); + *src = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, flags); ok(*src != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError()); - server = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED); + server = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, flags); ok(server != INVALID_SOCKET, "failed to create socket, error %u\n", WSAGetLastError()); memset(&addr, 0, sizeof(addr)); @@ -68,6 +68,11 @@ static void tcp_socketpair(SOCKET *src, SOCKET *dst) closesocket(server); } +static void tcp_socketpair(SOCKET *src, SOCKET *dst) +{ + tcp_socketpair_flags(src, dst, WSA_FLAG_OVERLAPPED); +} + static void set_blocking(SOCKET s, ULONG blocking) { int ret; @@ -2575,6 +2580,148 @@ static void test_async_thread_termination(void) closesocket(listener); } +static DWORD WINAPI sync_read_file_thread(void *arg) +{ + HANDLE server = arg; + IO_STATUS_BLOCK io; + char buffer[5]; + NTSTATUS ret; + + memset(buffer, 0xcc, sizeof(buffer)); + memset(&io, 0xcc, sizeof(io)); + ret = NtReadFile(server, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(!io.Status, "got status %#lx\n", io.Status); + ok(io.Information == 4, "got size %Iu\n", io.Information); + ok(!memcmp(buffer, "data", 4), "got data %s\n", debugstr_an(buffer, io.Information)); + + return 0; +} + +static void test_read_write(void) +{ + WSANETWORKEVENTS events; + IO_STATUS_BLOCK io, io2; + SOCKET client, server; + LARGE_INTEGER offset; + HANDLE event, thread; + char buffer[5]; + NTSTATUS ret; + + event = CreateEventA(NULL, TRUE, FALSE, NULL); + + tcp_socketpair_flags(&client, &server, 0); + set_blocking(server, FALSE); + + memset(&io, 0xcc, sizeof(io)); + ret = NtWriteFile((HANDLE)client, NULL, NULL, NULL, &io, "data", 4, NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(!io.Status, "got status %#lx\n", io.Status); + ok(io.Information == 4, "got size %Iu\n", io.Information); + + memset(buffer, 0xcc, sizeof(buffer)); + memset(&io, 0xcc, sizeof(io)); + ret = NtReadFile((HANDLE)server, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(!io.Status, "got status %#lx\n", io.Status); + ok(io.Information == 4, "got size %Iu\n", io.Information); + ok(!memcmp(buffer, "data", 4), "got data %s\n", debugstr_an(buffer, io.Information)); + + ret = send(server, "data", 4, 0); + ok(ret == 4, "got %ld\n", ret); + + ret = WSAEventSelect(client, event, FD_READ); + ok(!ret, "got error %lu\n", GetLastError()); + + ret = WSAEnumNetworkEvents(client, event, &events); + ok(!ret, "got error %lu\n", GetLastError()); + ok(events.lNetworkEvents == FD_READ, "got events %#lx\n", events.lNetworkEvents); + + memset(buffer, 0xcc, sizeof(buffer)); + ret = NtReadFile((HANDLE)client, NULL, NULL, NULL, &io, buffer, 1, NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(io.Information == 1, "got size %Iu\n", io.Information); + ok(buffer[0] == 'd', "got data %s\n", debugstr_an(buffer, io.Information)); + + ret = WSAEnumNetworkEvents(client, event, &events); + ok(!ret, "got error %lu\n", GetLastError()); + todo_wine ok(events.lNetworkEvents == FD_READ, "got events %#lx\n", events.lNetworkEvents); + + memset(buffer, 0xcc, sizeof(buffer)); + ret = NtReadFile((HANDLE)client, NULL, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(io.Information == 3, "got size %Iu\n", io.Information); + ok(!memcmp(buffer, "ata", 3), "got data %s\n", debugstr_an(buffer, io.Information)); + + /* NtReadFile always blocks, even when the socket is non-overlapped and nonblocking */ + + thread = CreateThread(NULL, 0, sync_read_file_thread, (void *)server, 0, NULL); + ret = WaitForSingleObject(thread, 100); + ok(ret == WAIT_TIMEOUT, "got %ld\n", ret); + + ret = NtWriteFile((HANDLE)client, NULL, NULL, NULL, &io, "data", 4, NULL, NULL); + ok(!ret, "got status %#lx\n", ret); + + ret = WaitForSingleObject(thread, 1000); + ok(!ret, "got %ld\n", ret); + CloseHandle(thread); + + closesocket(server); + closesocket(client); + + tcp_socketpair(&client, &server); + + ret = NtReadFile((HANDLE)server, event, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got status %#lx\n", ret); + if (ret == STATUS_PENDING) + { + CancelIo((HANDLE)server); + ret = WaitForSingleObject(event, 100); + ok(!ret, "wait timed out\n"); + } + + offset.QuadPart = -1; + ret = NtReadFile((HANDLE)server, event, NULL, NULL, &io, buffer, sizeof(buffer), &offset, NULL); + todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got status %#lx\n", ret); + if (ret == STATUS_PENDING) + { + CancelIo((HANDLE)server); + ret = WaitForSingleObject(event, 100); + ok(!ret, "wait timed out\n"); + } + + memset(buffer, 0xcc, sizeof(buffer)); + memset(&io, 0xcc, sizeof(io)); + offset.QuadPart = 1; + ret = NtReadFile((HANDLE)server, event, NULL, NULL, &io, buffer, sizeof(buffer), &offset, NULL); + ok(ret == STATUS_PENDING, "got status %#lx\n", ret); + + ret = NtWriteFile((HANDLE)client, NULL, NULL, NULL, &io2, "data", 4, NULL, NULL); + todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got status %#lx\n", ret); + + offset.QuadPart = -3; + ret = NtWriteFile((HANDLE)client, NULL, NULL, NULL, &io2, "data", 4, &offset, NULL); + todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got status %#lx\n", ret); + + memset(&io2, 0xcc, sizeof(io2)); + offset.QuadPart = 2; + ret = NtWriteFile((HANDLE)client, NULL, NULL, NULL, &io2, "data", 4, &offset, NULL); + ok(!ret, "got status %#lx\n", ret); + ok(!io2.Status, "got status %#lx\n", io2.Status); + ok(io2.Information == 4, "got size %Iu\n", io2.Information); + + ret = WaitForSingleObject(event, 1000); + ok(!ret, "wait timed out\n"); + ok(!io.Status, "got status %#lx\n", io.Status); + ok(io.Information == 4, "got size %Iu\n", io.Information); + ok(!memcmp(buffer, "data", 4), "got data %s\n", debugstr_an(buffer, io.Information)); + + closesocket(server); + closesocket(client); + + CloseHandle(event); +} + START_TEST(afd) { WSADATA data; @@ -2593,6 +2740,7 @@ START_TEST(afd) test_bind(); test_getsockname(); test_async_thread_termination(); + test_read_write(); WSACleanup(); }
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
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