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 2018
----- 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
785 discussions
Start a n
N
ew thread
Józef Kucia : winevulkan: Simplify vkEnumerateDeviceExtensionProperties().
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: 1585b50fea761637cc415eccae94c62b7294ac7c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1585b50fea761637cc415ecc…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 29 14:53:51 2018 +0200 winevulkan: Simplify vkEnumerateDeviceExtensionProperties(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winevulkan/vulkan.c | 41 ++++++++++------------------------------ dlls/winevulkan/vulkan_private.h | 4 ++-- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 7294383..8e04e88 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -54,7 +54,7 @@ static void wine_vk_physical_device_free(struct VkPhysicalDevice_T *phys_dev) if (!phys_dev) return; - heap_free(phys_dev->properties); + heap_free(phys_dev->extensions); heap_free(phys_dev); } @@ -115,10 +115,9 @@ static struct VkPhysicalDevice_T *wine_vk_physical_device_alloc(struct VkInstanc TRACE("Host supported extensions %u, Wine supported extensions %u\n", num_host_properties, num_properties); - object->properties = heap_calloc(num_properties, sizeof(*object->properties)); - if (!object->properties) + if (!(object->extensions = heap_calloc(num_properties, sizeof(*object->extensions)))) { - ERR("Failed to allocate memory for device properties!\n"); + ERR("Failed to allocate memory for device extensions!\n"); goto err; } @@ -126,11 +125,11 @@ static struct VkPhysicalDevice_T *wine_vk_physical_device_alloc(struct VkInstanc { if (wine_vk_device_extension_supported(host_properties[i].extensionName)) { - memcpy(&object->properties[j], &host_properties[i], sizeof(*object->properties)); + object->extensions[j] = host_properties[i]; j++; } } - object->num_properties = num_properties; + object->extension_count = num_properties; heap_free(host_properties); return object; @@ -672,9 +671,6 @@ void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallba VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice phys_dev, const char *layer_name, uint32_t *count, VkExtensionProperties *properties) { - VkResult res; - unsigned int i, num_copies; - TRACE("%p, %p, %p, %p\n", phys_dev, layer_name, count, properties); /* This shouldn't get called with layer_name set, the ICD loader prevents it. */ @@ -686,32 +682,15 @@ VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice phys_ if (!properties) { - *count = phys_dev->num_properties; + *count = phys_dev->extension_count; return VK_SUCCESS; } - if (*count < phys_dev->num_properties) - { - /* Incomplete is a type of success used to signal the application - * that not all devices got copied. - */ - num_copies = *count; - res = VK_INCOMPLETE; - } - else - { - num_copies = phys_dev->num_properties; - res = VK_SUCCESS; - } - - for (i = 0; i < num_copies; i++) - { - memcpy(&properties[i], &phys_dev->properties[i], sizeof(phys_dev->properties[i])); - } - *count = num_copies; + *count = min(*count, phys_dev->extension_count); + memcpy(properties, phys_dev->extensions, *count * sizeof(*properties)); - TRACE("Result %d, extensions copied %u\n", res, num_copies); - return res; + TRACE("Returning %u extensions.\n", *count); + return *count < phys_dev->extension_count ? VK_INCOMPLETE : VK_SUCCESS; } VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index 419e6ac..7f2f242 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -86,8 +86,8 @@ struct VkPhysicalDevice_T struct wine_vk_base base; struct VkInstance_T *instance; /* parent */ - uint32_t num_properties; - VkExtensionProperties *properties; + uint32_t extension_count; + VkExtensionProperties *extensions; VkPhysicalDevice phys_dev; /* native physical device */ };
1
0
0
0
Józef Kucia : winex11: Return Wine Vulkan driver device functions from vkGetInstanceProcAddr().
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: efddcedd162c869ca6a3f72bb7e57084b00ffd61 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=efddcedd162c869ca6a3f72b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 29 14:53:50 2018 +0200 winex11: Return Wine Vulkan driver device functions from vkGetInstanceProcAddr(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/vulkan.c | 62 ++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 6dce7ae..f881b0f 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -480,6 +480,35 @@ static const struct vulkan_funcs vulkan_funcs = X11DRV_vkQueuePresentKHR, }; +static void *get_vulkan_driver_device_proc_addr(const struct vulkan_funcs *vulkan_funcs, + const char *name) +{ + if (!name || name[0] != 'v' || name[1] != 'k') + return NULL; + + name += 2; + + if (!strcmp(name, "AcquireNextImageKHR")) + return vulkan_funcs->p_vkAcquireNextImageKHR; + if (!strcmp(name, "CreateSwapchainKHR")) + return vulkan_funcs->p_vkCreateSwapchainKHR; + if (!strcmp(name, "DestroySwapchainKHR")) + return vulkan_funcs->p_vkDestroySwapchainKHR; + if (!strcmp(name, "GetDeviceProcAddr")) + return vulkan_funcs->p_vkGetDeviceProcAddr; + if (!strcmp(name, "GetSwapchainImagesKHR")) + return vulkan_funcs->p_vkGetSwapchainImagesKHR; + if (!strcmp(name, "QueuePresentKHR")) + return vulkan_funcs->p_vkQueuePresentKHR; + + return NULL; +} + +static void *X11DRV_get_vk_device_proc_addr(const char *name) +{ + return get_vulkan_driver_device_proc_addr(&vulkan_funcs, name); +} + static void *get_vulkan_driver_instance_proc_addr(const struct vulkan_funcs *vulkan_funcs, VkInstance instance, const char *name) { @@ -515,7 +544,9 @@ static void *get_vulkan_driver_instance_proc_addr(const struct vulkan_funcs *vul if (!strcmp(name, "GetPhysicalDeviceWin32PresentationSupportKHR")) return vulkan_funcs->p_vkGetPhysicalDeviceWin32PresentationSupportKHR; - return NULL; + name -= 2; + + return get_vulkan_driver_device_proc_addr(vulkan_funcs, name); } static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *name) @@ -523,35 +554,6 @@ static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *n return get_vulkan_driver_instance_proc_addr(&vulkan_funcs, instance, name); } -static void *get_vulkan_driver_device_proc_addr(const struct vulkan_funcs *vulkan_funcs, - const char *name) -{ - if (!name || name[0] != 'v' || name[1] != 'k') - return NULL; - - name += 2; - - if (!strcmp(name, "AcquireNextImageKHR")) - return vulkan_funcs->p_vkAcquireNextImageKHR; - if (!strcmp(name, "CreateSwapchainKHR")) - return vulkan_funcs->p_vkCreateSwapchainKHR; - if (!strcmp(name, "DestroySwapchainKHR")) - return vulkan_funcs->p_vkDestroySwapchainKHR; - if (!strcmp(name, "GetDeviceProcAddr")) - return vulkan_funcs->p_vkGetDeviceProcAddr; - if (!strcmp(name, "GetSwapchainImagesKHR")) - return vulkan_funcs->p_vkGetSwapchainImagesKHR; - if (!strcmp(name, "QueuePresentKHR")) - return vulkan_funcs->p_vkQueuePresentKHR; - - return NULL; -} - -static void *X11DRV_get_vk_device_proc_addr(const char *name) -{ - return get_vulkan_driver_device_proc_addr(&vulkan_funcs, name); -} - const struct vulkan_funcs *get_vulkan_driver(UINT version) { if (version != WINE_VULKAN_DRIVER_VERSION)
1
0
0
0
Józef Kucia : winex11: Get rid of wine_vk_load_instance_extensions().
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: 45cea4b4595c50d72121aeb3321abc3351066359 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=45cea4b4595c50d72121aeb3…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 29 14:53:49 2018 +0200 winex11: Get rid of wine_vk_load_instance_extensions(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/vulkan.c | 73 +++++++++++++---------------------------------- 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 108ef19..6dce7ae 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -80,50 +80,9 @@ static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); static void *X11DRV_get_vk_device_proc_addr(const char *name); static void *X11DRV_get_vk_instance_proc_addr(VkInstance instance, const char *name); -static struct VkExtensionProperties *winex11_vk_instance_extensions = NULL; -static unsigned int winex11_vk_instance_extensions_count = 0; - -static void wine_vk_load_instance_extensions(void) +static inline struct wine_vk_surface *surface_from_handle(VkSurfaceKHR handle) { - uint32_t num_properties; - VkExtensionProperties *properties; - unsigned int i; - - pvkEnumerateInstanceExtensionProperties(NULL, &num_properties, NULL); - - properties = heap_calloc(num_properties, sizeof(*properties)); - if (!properties) - return; - - /* We will return the same number of instance extensions reported by the host back to - * winevulkan. Along the way we may replace xlib extensions with their win32 equivalents. - * Winevulkan will perform more detailed filtering as it knows whether it has thunks - * for a particular extension. - */ - pvkEnumerateInstanceExtensionProperties(NULL, &num_properties, properties); - for (i = 0; i < num_properties; i++) - { - /* For now the only x11 extension we need to fixup. Long-term we may need an array. */ - if (!strcmp(properties[i].extensionName, "VK_KHR_xlib_surface")) - { - TRACE("Substituting VK_KHR_xlib_surface for VK_KHR_win32_surface\n"); - - memset(properties[i].extensionName, 0, sizeof(properties[i].extensionName)); - snprintf(properties[i].extensionName, sizeof(properties[i].extensionName), "VK_KHR_win32_surface"); - properties[i].specVersion = 6; /* Revision as of 4/24/2017 */ - } - - TRACE("Loaded extension: %s\n", properties[i].extensionName); - } - - winex11_vk_instance_extensions = properties; - winex11_vk_instance_extensions_count = num_properties; -} - -/* Helper function to convert VkSurfaceKHR (uint64_t) to a surface pointer. */ -static inline struct wine_vk_surface * surface_from_handle(VkSurfaceKHR handle) -{ - return ((struct wine_vk_surface *)(uintptr_t)handle); + return (struct wine_vk_surface *)(uintptr_t)handle; } static BOOL wine_vk_init(void) @@ -160,8 +119,6 @@ static BOOL wine_vk_init(void) LOAD_FUNCPTR(vkQueuePresentKHR) #undef LOAD_FUNCPTR - wine_vk_load_instance_extensions(); - return TRUE; } @@ -376,6 +333,7 @@ static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_ uint32_t *count, VkExtensionProperties* properties) { unsigned int i; + VkResult res; TRACE("layer_name %p, count %p, properties %p\n", debugstr_a(layer_name), count, properties); @@ -386,20 +344,29 @@ static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_ return VK_ERROR_LAYER_NOT_PRESENT; } - if (!properties) - { - *count = winex11_vk_instance_extensions_count; - return VK_SUCCESS; - } + /* We will return the same number of instance extensions reported by the host back to + * winevulkan. Along the way we may replace xlib extensions with their win32 equivalents. + * Winevulkan will perform more detailed filtering as it knows whether it has thunks + * for a particular extension. + */ + res = pvkEnumerateInstanceExtensionProperties(layer_name, count, properties); + if (!properties || res < 0) + return res; - *count = min(*count, winex11_vk_instance_extensions_count); for (i = 0; i < *count; i++) { - properties[i] = winex11_vk_instance_extensions[i]; + /* For now the only x11 extension we need to fixup. Long-term we may need an array. */ + if (!strcmp(properties[i].extensionName, "VK_KHR_xlib_surface")) + { + TRACE("Substituting VK_KHR_xlib_surface for VK_KHR_win32_surface\n"); + + snprintf(properties[i].extensionName, sizeof(properties[i].extensionName), "VK_KHR_win32_surface"); + properties[i].specVersion = 6; /* Revision as of 4/24/2017 */ + } } TRACE("Returning %u extensions.\n", *count); - return *count < winex11_vk_instance_extensions_count ? VK_INCOMPLETE : VK_SUCCESS; + return res; } static void *X11DRV_vkGetDeviceProcAddr(VkDevice device, const char *name)
1
0
0
0
Józef Kucia : winex11: Print error message when libvulkan cannot be loaded.
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: 1fab177c07f230409db749def137e03f60334d05 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1fab177c07f230409db749de…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 29 14:53:48 2018 +0200 winex11: Print error message when libvulkan cannot be loaded. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/vulkan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index c633579..108ef19 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -134,7 +134,11 @@ static BOOL wine_vk_init(void) if (init_done) return (vulkan_handle != NULL); init_done = TRUE; - if (!(vulkan_handle = wine_dlopen(SONAME_LIBVULKAN, RTLD_NOW, NULL, 0))) return FALSE; + if (!(vulkan_handle = wine_dlopen(SONAME_LIBVULKAN, RTLD_NOW, NULL, 0))) + { + ERR("Failed to load %s\n", SONAME_LIBVULKAN); + return FALSE; + } #define LOAD_FUNCPTR(f) if ((p##f = wine_dlsym(vulkan_handle, #f, NULL, 0)) == NULL) return FALSE; LOAD_FUNCPTR(vkAcquireNextImageKHR)
1
0
0
0
Austin English : wininet: Add ParseX509EncodedCertificateForListBoxEntry stub.
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: c8861df6d11343d4742afed32b7a9fc5a50e2ccc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8861df6d11343d4742afed3…
Author: Austin English <austinenglish(a)gmail.com> Date: Wed Mar 28 03:20:02 2018 +0000 wininet: Add ParseX509EncodedCertificateForListBoxEntry stub. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wininet/dialogs.c | 9 +++++++++ dlls/wininet/wininet.spec | 2 +- include/winineti.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c index 938daa8..b13b566 100644 --- a/dlls/wininet/dialogs.c +++ b/dlls/wininet/dialogs.c @@ -574,6 +574,15 @@ BOOL WINAPI InternetShowSecurityInfoByURLW(LPCWSTR url, HWND window) } /*********************************************************************** + * ParseX509EncodedCertificateForListBoxEntry (@) + */ +DWORD WINAPI ParseX509EncodedCertificateForListBoxEntry(LPBYTE cert, DWORD len, LPSTR szlistbox, LPDWORD listbox) +{ + FIXME("stub: %p %d %s %p\n", cert, len, debugstr_a(szlistbox), listbox); + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/*********************************************************************** * ShowX509EncodedCertificate (@) */ DWORD WINAPI ShowX509EncodedCertificate(HWND parent, LPBYTE cert, DWORD len) diff --git a/dlls/wininet/wininet.spec b/dlls/wininet/wininet.spec index e4337a2..7ef28d6 100644 --- a/dlls/wininet/wininet.spec +++ b/dlls/wininet/wininet.spec @@ -216,7 +216,7 @@ @ stdcall IsUrlCacheEntryExpiredA(str long ptr) @ stdcall IsUrlCacheEntryExpiredW(wstr long ptr) @ stdcall LoadUrlCacheContent() -@ stub ParseX509EncodedCertificateForListBoxEntry +@ stdcall ParseX509EncodedCertificateForListBoxEntry(ptr long str ptr) @ stdcall PrivacyGetZonePreferenceW(long long ptr ptr ptr) @ stdcall PrivacySetZonePreferenceW(long long long wstr) @ stdcall ReadUrlCacheEntryStream(ptr long ptr ptr long) diff --git a/include/winineti.h b/include/winineti.h index 5b6f15f..5e38424 100644 --- a/include/winineti.h +++ b/include/winineti.h @@ -120,6 +120,7 @@ BOOL WINAPI InternetQueryFortezzaStatus(DWORD*,DWORD_PTR); BOOL WINAPI IsUrlCacheEntryExpiredA(LPCSTR,DWORD,FILETIME*); BOOL WINAPI IsUrlCacheEntryExpiredW(LPCWSTR,DWORD,FILETIME*); #define IsUrlCacheEntryExpired WINELIB_NAME_AW(IsUrlCacheEntryExpired) +DWORD WINAPI ParseX509EncodedCertificateForListBoxEntry(LPBYTE,DWORD,LPSTR,LPDWORD); BOOL WINAPI SetUrlCacheConfigInfoA(LPINTERNET_CACHE_CONFIG_INFOA,DWORD); BOOL WINAPI SetUrlCacheConfigInfoW(LPINTERNET_CACHE_CONFIG_INFOW,DWORD); #define SetUrlCacheConfigInfo WINELIB_NAME_AW(SetUrlCacheConfigInfo)
1
0
0
0
Alexandre Julliard : user32: Forward more system metrics to SystemParametersInfoW.
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: c2e0ae5bfd084d9b34c46517507e5d31d61494e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c2e0ae5bfd084d9b34c46517…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 29 17:23:37 2018 +0200 user32: Forward more system metrics to SystemParametersInfoW. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 85 +++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 9467163..34e0a37 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -2381,6 +2381,8 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam, INT WINAPI GetSystemMetrics( INT index ) { NONCLIENTMETRICSW ncm; + MINIMIZEDMETRICS mm; + ICONMETRICSW im; UINT ret; HDC hdc; @@ -2399,10 +2401,13 @@ INT WINAPI GetSystemMetrics( INT index ) return ret; case SM_CXVSCROLL: case SM_CYHSCROLL: - get_entry( &entry_SCROLLWIDTH, 0, &ret ); - return max( 8, ret ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iScrollWidth; case SM_CYCAPTION: - return GetSystemMetrics( SM_CYSIZE ) + 1; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iCaptionHeight + 1; case SM_CXBORDER: case SM_CYBORDER: /* SM_C{X,Y}BORDER always returns 1 regardless of 'BorderWidth' value in registry */ @@ -2414,8 +2419,9 @@ INT WINAPI GetSystemMetrics( INT index ) case SM_CXHTHUMB: case SM_CYVSCROLL: case SM_CXHSCROLL: - get_entry( &entry_SCROLLHEIGHT, 0, &ret ); - return max( 8, ret ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iScrollHeight; case SM_CXICON: case SM_CYICON: return MulDiv( 32, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); @@ -2426,7 +2432,9 @@ INT WINAPI GetSystemMetrics( INT index ) if (ret >= 48) return 48; return 32; case SM_CYMENU: - return GetSystemMetrics(SM_CYMENUSIZE) + 1; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iMenuHeight + 1; case SM_CXFULLSCREEN: /* see the remark for SM_CXMAXIMIZED, at least this formulation is * correct */ @@ -2459,18 +2467,21 @@ INT WINAPI GetSystemMetrics( INT index ) case SM_CYMIN: return GetSystemMetrics( SM_CYCAPTION) + 2 * GetSystemMetrics( SM_CYFRAME); case SM_CXSIZE: - get_entry( &entry_CAPTIONWIDTH, 0, &ret ); - return max( 8, ret ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iCaptionWidth; case SM_CYSIZE: ncm.cbSize = sizeof(ncm); SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iCaptionHeight; case SM_CXFRAME: - get_entry( &entry_BORDER, 0, &ret ); - return GetSystemMetrics(SM_CXDLGFRAME) + max( 1, ret ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return GetSystemMetrics(SM_CXDLGFRAME) + ncm.iBorderWidth; case SM_CYFRAME: - get_entry( &entry_BORDER, 0, &ret ); - return GetSystemMetrics(SM_CYDLGFRAME) + max( 1, ret ); + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return GetSystemMetrics(SM_CYDLGFRAME) + ncm.iBorderWidth; case SM_CXMINTRACK: return GetSystemMetrics(SM_CXMIN); case SM_CYMINTRACK: @@ -2482,13 +2493,15 @@ INT WINAPI GetSystemMetrics( INT index ) get_entry( &entry_DOUBLECLKHEIGHT, 0, &ret ); return ret; case SM_CXICONSPACING: - get_entry( &entry_ICONHORIZONTALSPACING, 0, &ret ); - return ret; + im.cbSize = sizeof(im); + SystemParametersInfoW( SPI_GETICONMETRICS, sizeof(im), &im, 0 ); + return im.iHorzSpacing; case SM_CYICONSPACING: - get_entry( &entry_ICONVERTICALSPACING, 0, &ret ); - return ret; + im.cbSize = sizeof(im); + SystemParametersInfoW( SPI_GETICONMETRICS, sizeof(im), &im, 0 ); + return im.iVertSpacing; case SM_MENUDROPALIGNMENT: - get_entry( &entry_MENUDROPALIGNMENT, 0, &ret ); + SystemParametersInfoW( SPI_GETMENUDROPALIGNMENT, 0, &ret, 0 ); return ret; case SM_PENWINDOWS: return 0; @@ -2507,38 +2520,48 @@ INT WINAPI GetSystemMetrics( INT index ) case SM_CYEDGE: return GetSystemMetrics(SM_CYBORDER) + 1; case SM_CXMINSPACING: - get_entry( &entry_MINHORZGAP, 0, &ret ); - return GetSystemMetrics(SM_CXMINIMIZED) + max( 0, (INT)ret ); + mm.cbSize = sizeof(mm); + SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0 ); + return GetSystemMetrics(SM_CXMINIMIZED) + mm.iHorzGap; case SM_CYMINSPACING: - get_entry( &entry_MINVERTGAP, 0, &ret ); - return GetSystemMetrics(SM_CYMINIMIZED) + max( 0, (INT)ret ); + mm.cbSize = sizeof(mm); + SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0 ); + return GetSystemMetrics(SM_CYMINIMIZED) + mm.iVertGap; case SM_CXSMICON: case SM_CYSMICON: return MulDiv( 16, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ) & ~1; case SM_CYSMCAPTION: - return GetSystemMetrics(SM_CYSMSIZE) + 1; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iSmCaptionHeight + 1; case SM_CXSMSIZE: - get_entry( &entry_SMCAPTIONWIDTH, 0, &ret ); - return ret; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iSmCaptionWidth; case SM_CYSMSIZE: ncm.cbSize = sizeof(ncm); SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iSmCaptionHeight; case SM_CXMENUSIZE: - get_entry( &entry_MENUWIDTH, 0, &ret ); - return ret; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iMenuWidth; case SM_CYMENUSIZE: ncm.cbSize = sizeof(ncm); SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); return ncm.iMenuHeight; case SM_ARRANGE: - get_entry( &entry_MINARRANGE, 0, &ret ); - return ret & 0x0f; + mm.cbSize = sizeof(mm); + SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0 ); + return mm.iArrange; case SM_CXMINIMIZED: - get_entry( &entry_MINWIDTH, 0, &ret ); - return max( 0, (INT)ret ) + 6; + mm.cbSize = sizeof(mm); + SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0 ); + return mm.iWidth + 6; case SM_CYMINIMIZED: - return GetSystemMetrics( SM_CYSIZE ) + 6; + ncm.cbSize = sizeof(ncm); + SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 ); + return ncm.iCaptionHeight + 6; case SM_CXMAXTRACK: return GetSystemMetrics(SM_CXVIRTUALSCREEN) + 4 + 2 * GetSystemMetrics(SM_CXFRAME); case SM_CYMAXTRACK:
1
0
0
0
Alexandre Julliard : user32: Add a stub for GetDpiForWindow().
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: 79916de39723c76a63775233ae8a17483d4d6b42 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=79916de39723c76a63775233…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 29 15:01:22 2018 +0200 user32: Add a stub for GetDpiForWindow(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 9 +++++++++ dlls/user32/user32.spec | 1 + include/winuser.h | 1 + 3 files changed, 11 insertions(+) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 454d58c..9467163 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -2955,6 +2955,15 @@ UINT WINAPI GetDpiForSystem(void) return display_dpi; } +/*********************************************************************** + * GetDpiForWindow (USER32.@) + */ +UINT WINAPI GetDpiForWindow( HWND hwnd ) +{ + FIXME( "stub: %p\n", hwnd ); + return GetDpiForSystem(); +} + /********************************************************************** * SetThreadDpiAwarenessContext (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 05bdae4..e0fdd3a 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -293,6 +293,7 @@ @ stdcall GetDlgItemTextW(long long ptr long) @ stdcall GetDoubleClickTime() @ stdcall GetDpiForSystem() +@ stdcall GetDpiForWindow(long) @ stdcall GetFocus() @ stdcall GetForegroundWindow() @ stdcall GetGestureConfig(long long long ptr ptr long) diff --git a/include/winuser.h b/include/winuser.h index 18a6e3a..ece0109 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3675,6 +3675,7 @@ WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND,INT,LPSTR,INT); WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND,INT,LPWSTR,INT); #define GetDlgItemText WINELIB_NAME_AW(GetDlgItemText) WINUSERAPI UINT WINAPI GetDoubleClickTime(void); +WINUSERAPI UINT WINAPI GetDpiForWindow(HWND); WINUSERAPI UINT WINAPI GetDpiForSystem(void); WINUSERAPI HWND WINAPI GetFocus(void); WINUSERAPI HWND WINAPI GetForegroundWindow(void);
1
0
0
0
Alexandre Julliard : user32: Implement GetDpiForSystem().
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: ca878114cb5eadf3f6f4c9cb727dff04b659ad03 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ca878114cb5eadf3f6f4c9cb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 29 14:54:08 2018 +0200 user32: Implement GetDpiForSystem(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/sysparams.c | 64 ++++++++++++++++++++++--------------------------- dlls/user32/user32.spec | 1 + include/winuser.h | 1 + 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 4824ad2..454d58c 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -625,19 +625,6 @@ void release_display_dc( HDC hdc ) LeaveCriticalSection( &display_dc_section ); } -static inline int get_display_dpi(void) -{ - static int display_dpi; - HDC hdc; - if (!display_dpi) - { - hdc = get_display_dc(); - display_dpi = GetDeviceCaps( hdc, LOGPIXELSY ); - release_display_dc( hdc ); - } - return display_dpi; -} - static INT CALLBACK real_fontname_proc(const LOGFONTW *lf, const TEXTMETRICW *ntm, DWORD type, LPARAM lparam) { const ENUMLOGFONTW *elf = (const ENUMLOGFONTW *)lf; @@ -768,7 +755,7 @@ static BOOL get_twips_entry( union sysparam_all_entry *entry, UINT int_param, vo * Technical Reference to the Windows 2000 Registry -> * HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics */ - if (val < 0) val = (-val * get_display_dpi() + 720) / 1440; + if (val < 0) val = (-val * GetDpiForSystem() + 720) / 1440; entry->uint.val = val; } } @@ -952,13 +939,13 @@ static BOOL get_font_entry( union sysparam_all_entry *entry, UINT int_param, voi { case sizeof(font): if (font.lfHeight > 0) /* positive height value means points ( inch/72 ) */ - font.lfHeight = -MulDiv( font.lfHeight, get_display_dpi(), 72 ); + font.lfHeight = -MulDiv( font.lfHeight, GetDpiForSystem(), 72 ); entry->font.val = font; break; case sizeof(LOGFONT16): /* win9x-winME format */ SYSPARAMS_LogFont16To32W( (LOGFONT16 *)&font, &entry->font.val ); if (entry->font.val.lfHeight > 0) - entry->font.val.lfHeight = -MulDiv( entry->font.val.lfHeight, get_display_dpi(), 72 ); + entry->font.val.lfHeight = -MulDiv( entry->font.val.lfHeight, GetDpiForSystem(), 72 ); break; default: WARN( "Unknown format in key %s value %s\n", @@ -1509,9 +1496,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, ret = get_entry( &entry_ICONHORIZONTALSPACING, uiParam, pvParam ); else { - int min_val = 32; - if (IsProcessDPIAware()) - min_val = MulDiv( min_val, get_display_dpi(), USER_DEFAULT_SCREEN_DPI ); + int min_val = MulDiv( 32, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); ret = set_entry( &entry_ICONHORIZONTALSPACING, max( min_val, uiParam ), pvParam, fWinIni ); } break; @@ -1552,9 +1537,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, ret = get_entry( &entry_ICONVERTICALSPACING, uiParam, pvParam ); else { - int min_val = 32; - if (IsProcessDPIAware()) - min_val = MulDiv( min_val, get_display_dpi(), USER_DEFAULT_SCREEN_DPI ); + int min_val = MulDiv( 32, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); ret = set_entry( &entry_ICONVERTICALSPACING, max( min_val, uiParam ), pvParam, fWinIni ); } break; @@ -2435,18 +2418,12 @@ INT WINAPI GetSystemMetrics( INT index ) return max( 8, ret ); case SM_CXICON: case SM_CYICON: - ret = 32; - if (IsProcessDPIAware()) - ret = MulDiv( ret, get_display_dpi(), USER_DEFAULT_SCREEN_DPI ); - return ret; + return MulDiv( 32, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); case SM_CXCURSOR: case SM_CYCURSOR: - if (IsProcessDPIAware()) - { - ret = MulDiv( 32, get_display_dpi(), USER_DEFAULT_SCREEN_DPI ); - if (ret >= 64) return 64; - if (ret >= 48) return 48; - } + ret = MulDiv( 32, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ); + if (ret >= 64) return 64; + if (ret >= 48) return 48; return 32; case SM_CYMENU: return GetSystemMetrics(SM_CYMENUSIZE) + 1; @@ -2537,10 +2514,7 @@ INT WINAPI GetSystemMetrics( INT index ) return GetSystemMetrics(SM_CYMINIMIZED) + max( 0, (INT)ret ); case SM_CXSMICON: case SM_CYSMICON: - ret = 16; - if (IsProcessDPIAware()) - ret = MulDiv( ret, get_display_dpi(), USER_DEFAULT_SCREEN_DPI ) & ~1; - return ret; + return MulDiv( 16, GetDpiForSystem(), USER_DEFAULT_SCREEN_DPI ) & ~1; case SM_CYSMCAPTION: return GetSystemMetrics(SM_CYSMSIZE) + 1; case SM_CXSMSIZE: @@ -2963,6 +2937,24 @@ BOOL WINAPI IsProcessDPIAware(void) return TRUE; } +/*********************************************************************** + * GetDpiForSystem (USER32.@) + */ +UINT WINAPI GetDpiForSystem(void) +{ + static int display_dpi; + + if (!IsProcessDPIAware()) return USER_DEFAULT_SCREEN_DPI; + + if (!display_dpi) + { + HDC hdc = get_display_dc(); + display_dpi = GetDeviceCaps( hdc, LOGPIXELSY ); + release_display_dc( hdc ); + } + return display_dpi; +} + /********************************************************************** * SetThreadDpiAwarenessContext (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 1bcdf2c..05bdae4 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -292,6 +292,7 @@ @ stdcall GetDlgItemTextA(long long ptr long) @ stdcall GetDlgItemTextW(long long ptr long) @ stdcall GetDoubleClickTime() +@ stdcall GetDpiForSystem() @ stdcall GetFocus() @ stdcall GetForegroundWindow() @ stdcall GetGestureConfig(long long long ptr ptr long) diff --git a/include/winuser.h b/include/winuser.h index d587859..18a6e3a 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3675,6 +3675,7 @@ WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND,INT,LPSTR,INT); WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND,INT,LPWSTR,INT); #define GetDlgItemText WINELIB_NAME_AW(GetDlgItemText) WINUSERAPI UINT WINAPI GetDoubleClickTime(void); +WINUSERAPI UINT WINAPI GetDpiForSystem(void); WINUSERAPI HWND WINAPI GetFocus(void); WINUSERAPI HWND WINAPI GetForegroundWindow(void); WINUSERAPI BOOL WINAPI GetGestureConfig(HWND,DWORD,DWORD,UINT*,GESTURECONFIG*,UINT);
1
0
0
0
Matteo Bruni : include: Define and check _D3D11_CONSTANTS define.
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: e9000b4e8bc4b162cf56bdce78dc653ff772f4b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e9000b4e8bc4b162cf56bdce…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 28 21:05:17 2018 +0200 include: Define and check _D3D11_CONSTANTS define. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/d3d11.idl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/d3d11.idl b/include/d3d11.idl index 8de2056..b4cc3be 100644 --- a/include/d3d11.idl +++ b/include/d3d11.idl @@ -32,6 +32,9 @@ interface ID3D11ClassLinkage; interface ID3D11Resource; interface ID3D11VideoProcessorInputView; +cpp_quote("#ifndef _D3D11_CONSTANTS") +cpp_quote("#define _D3D11_CONSTANTS") + const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = 14; const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS = 4; const UINT D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT = 32; @@ -255,9 +258,6 @@ const UINT D3D11_STANDARD_VECTOR_SIZE = 4; const UINT D3D11_STANDARD_VERTEX_ELEMENT_COUNT = 32; const UINT D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT = 64; -cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") -cpp_quote("struct CD3D11_DEFAULT {};") -cpp_quote("extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT;") cpp_quote("#endif") cpp_quote("#ifndef _D3D11_1_CONSTANTS") @@ -270,6 +270,11 @@ cpp_quote("#define _D3D11_2_CONSTANTS") const UINT D3D11_2_TILED_RESOURCE_TILE_SIZE_IN_BYTES = 0x10000; cpp_quote("#endif") +cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") +cpp_quote("struct CD3D11_DEFAULT {};") +cpp_quote("extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT;") +cpp_quote("#endif") + typedef enum D3D11_BLEND { D3D11_BLEND_ZERO = 1,
1
0
0
0
Matteo Bruni : ddraw/tests: Port test_viewport() to ddraw7.
by Alexandre Julliard
30 Mar '18
30 Mar '18
Module: wine Branch: master Commit: 3f6ab8f58b404a8c2e573267b0975cc7d4415c39 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3f6ab8f58b404a8c2e573267…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Mar 28 21:05:16 2018 +0200 ddraw/tests: Port test_viewport() to ddraw7. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw7.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 3f433a6..fb14409 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -280,6 +280,45 @@ static D3DCOLOR get_surface_color(IDirectDrawSurface7 *surface, UINT x, UINT y) return color; } +static void check_rect(IDirectDrawSurface7 *surface, RECT r, const char *message) +{ + LONG x_coords[2][2] = + { + {r.left - 1, r.left + 1}, + {r.right + 1, r.right - 1}, + }; + LONG y_coords[2][2] = + { + {r.top - 1, r.top + 1}, + {r.bottom + 1, r.bottom - 1} + }; + unsigned int i, j, x_side, y_side; + DWORD color; + LONG x, y; + + for (i = 0; i < 2; ++i) + { + for (j = 0; j < 2; ++j) + { + for (x_side = 0; x_side < 2; ++x_side) + { + for (y_side = 0; y_side < 2; ++y_side) + { + DWORD expected = (x_side == 1 && y_side == 1) ? 0x00ffffff : 0x00000000; + + x = x_coords[i][x_side]; + y = y_coords[j][y_side]; + if (x < 0 || x >= 640 || y < 0 || y >= 480) + continue; + color = get_surface_color(surface, x, y); + ok(color == expected, "%s: Pixel (%d, %d) has color %08x, expected %08x.\n", + message, x, y, color, expected); + } + } + } + } +} + static HRESULT CALLBACK enum_z_fmt(DDPIXELFORMAT *format, void *ctx) { DDPIXELFORMAT *z_fmt = ctx; @@ -14095,6 +14134,143 @@ static void test_enum_surfaces(void) IDirectDraw7_Release(ddraw); } +static void test_viewport(void) +{ + static struct + { + D3DVIEWPORT7 vp; + RECT expected_rect; + const char *message; + } + tests[] = + { + {{ 0, 0, 640, 480}, { 0, 120, 479, 359}, "Viewport (0, 0) - (640, 480)"}, + {{ 0, 0, 320, 240}, { 0, 60, 239, 179}, "Viewport (0, 0) - (320, 240)"}, + {{ 0, 0, 1280, 960}, { 0, 240, 639, 479}, "Viewport (0, 0) - (1280, 960)"}, + {{ 0, 0, 2000, 1600}, {-10, -10, -10, -10}, "Viewport (0, 0) - (2000, 1600)"}, + {{100, 100, 640, 480}, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"}, + {{ 0, 0, 8192, 8192}, {-10, -10, -10, -10}, "Viewport (0, 0) - (8192, 8192)"}, + }; + static struct vec3 quad[] = + { + {-1.5f, -0.5f, 0.1f}, + {-1.5f, 0.5f, 0.1f}, + { 0.5f, -0.5f, 0.1f}, + { 0.5f, 0.5f, 0.1f}, + }; + static const struct vec2 rt_sizes[] = + { + {640, 480}, {1280, 960}, {320, 240}, {800, 600}, + }; + IDirectDrawSurface7 *rt, *ds; + DDSURFACEDESC2 surface_desc; + IDirect3DDevice7 *device; + IDirectDraw7 *ddraw; + DDPIXELFORMAT z_fmt; + unsigned int i, j; + IDirect3D7 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d7_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + if (!(device = create_device(window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice7_GetDirect3D(device, &d3d); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); + ok(SUCCEEDED(hr), "Failed to get ddraw interface, hr %#x.\n", hr); + IDirect3D7_Release(d3d); + + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); + ok(SUCCEEDED(hr), "Failed to disable depth test, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice7_SetViewport(device, NULL); + ok(hr == E_INVALIDARG, "Setting NULL viewport data returned unexpected hr %#x.\n", hr); + + ds = get_depth_stencil(device); + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface7_GetSurfaceDesc(ds, &surface_desc); + z_fmt = U4(surface_desc).ddpfPixelFormat; + + for (i = 0; i < ARRAY_SIZE(rt_sizes); ++i) + { + if (i) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.dwWidth = rt_sizes[i].x; + surface_desc.dwHeight = rt_sizes[i].y; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x (i %u).\n", hr, i); + + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U4(surface_desc).ddpfPixelFormat = z_fmt; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &ds, NULL); + ok(SUCCEEDED(hr), "Failed to create depth buffer, hr %#x (i %u).\n", hr, i); + hr = IDirectDrawSurface7_AddAttachedSurface(rt, ds); + ok(SUCCEEDED(hr), "Failed to attach depth buffer, hr %#x (i %u).\n", hr, i); + + hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x (i %u).\n", hr, i); + } + else + { + hr = IDirect3DDevice7_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + } + + for (j = 0; j < ARRAY_SIZE(tests); ++j) + { + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x (i %u, j %u).\n", hr, i, j); + + hr = IDirect3DDevice7_SetViewport(device, &tests[j].vp); + if (tests[j].vp.dwX + tests[j].vp.dwWidth > rt_sizes[i].x + || tests[j].vp.dwY + tests[j].vp.dwHeight > rt_sizes[i].y) + { + ok(hr == E_INVALIDARG, "Setting the viewport returned unexpected hr %#x (i %u, j %u).\n", hr, i, j); + continue; + } + else + { + ok(SUCCEEDED(hr), "Failed to set the viewport, hr %#x (i %u, j %u).\n", hr, i, j); + } + + hr = IDirect3DDevice7_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x (i %u, j %u).\n", hr, i, j); + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); + ok(SUCCEEDED(hr), "Got unexpected hr %#x (i %u, j %u).\n", hr, i, j); + hr = IDirect3DDevice7_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x (i %u, j %u).\n", hr, i, j); + + check_rect(rt, tests[j].expected_rect, tests[j].message); + } + + hr = IDirectDrawSurface7_DeleteAttachedSurface(rt, 0, ds); + ok(SUCCEEDED(hr), "Failed to detach surface, hr %#x (i %u).\n", hr, i); + IDirectDrawSurface7_Release(ds); + + IDirectDrawSurface7_Release(rt); + } + + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw7) { DDDEVICEIDENTIFIER2 identifier; @@ -14229,4 +14405,5 @@ START_TEST(ddraw7) test_depth_readback(); test_clear(); test_enum_surfaces(); + test_viewport(); }
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
79
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
Results per page:
10
25
50
100
200