Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
March 2020
- 72 participants
- 2643 messages
Re: [PATCH v6] winevulkan: Create JSON manifest and registry entry used by official Vulkan loader.
by Liam Middlebrook
Signed-off-by: Liam Middlebrook <lmiddlebrook(a)nvidia.com>
Thanks,
Liam Middlebrook
On 3/30/20 5:35 PM, Brendan Shanks wrote:
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47109
> Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
> ---
> v6: As recommended by Alexandre, the JSON file is now generated by
> make_vulkan and stored in resources.
> The library_path in the JSON file is now a relative path, this is
> simpler and is what NVIDIA and AMD ICDs do on Windows.
>
> dlls/winevulkan/Makefile.in | 5 +-
> dlls/winevulkan/make_vulkan | 16 +++++++
> dlls/winevulkan/vulkan.c | 85 +++++++++++++++++++++++++++++++++
> dlls/winevulkan/winevulkan.json | 7 +++
> dlls/winevulkan/winevulkan.rc | 21 ++++++++
> dlls/winevulkan/winevulkan.spec | 2 +
> loader/wine.inf.in | 1 +
> 7 files changed, 135 insertions(+), 2 deletions(-)
> create mode 100644 dlls/winevulkan/winevulkan.json
> create mode 100644 dlls/winevulkan/winevulkan.rc
>
> diff --git a/dlls/winevulkan/Makefile.in b/dlls/winevulkan/Makefile.in
> index e0bca6fad7..d832a2a8f8 100644
> --- a/dlls/winevulkan/Makefile.in
> +++ b/dlls/winevulkan/Makefile.in
> @@ -1,9 +1,10 @@
> MODULE = winevulkan.dll
> IMPORTLIB = winevulkan
> -IMPORTS = user32 gdi32
> +IMPORTS = user32 gdi32 advapi32
>
> C_SRCS = \
> vulkan.c \
> vulkan_thunks.c
>
> -RC_SRCS = version.rc
> +RC_SRCS = version.rc \
> + winevulkan.rc
> diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
> index e5b3a1fdfa..1811d5ae10 100755
> --- a/dlls/winevulkan/make_vulkan
> +++ b/dlls/winevulkan/make_vulkan
> @@ -71,6 +71,7 @@ WINE_VK_VERSION = (1, 2)
> WINE_VULKAN_H = "../../include/wine/vulkan.h"
> WINE_VULKAN_DRIVER_H = "../../include/wine/vulkan_driver.h"
> WINE_VULKAN_LOADER_SPEC = "../vulkan-1/vulkan-1.spec"
> +WINE_VULKAN_JSON = "winevulkan.json"
> WINE_VULKAN_SPEC = "winevulkan.spec"
> WINE_VULKAN_THUNKS_C = "vulkan_thunks.c"
> WINE_VULKAN_THUNKS_H = "vulkan_thunks.h"
> @@ -2526,6 +2527,9 @@ class VkGenerator(object):
> else:
> f.write("@ stub {0}\n".format(func.name))
>
> + f.write("@ stdcall -private DllRegisterServer()\n")
> + f.write("@ stdcall -private DllUnregisterServer()\n")
> +
> def generate_vulkan_loader_spec(self, f):
> self._generate_copyright(f, spec_file=True)
>
> @@ -3033,6 +3037,15 @@ class VkRegistry(object):
> self.handles = sorted(handles, key=lambda handle: handle.name)
> self.structs = sorted(structs, key=lambda struct: struct.name)
>
> +def generate_vulkan_json(f):
> + f.write("{\n")
> + f.write(" \"file_format_version\": \"1.0.0\",\n")
> + f.write(" \"ICD\": {\n")
> + f.write(" \"library_path\": \".\\\\winevulkan.dll\",\n")
> + f.write(" \"api_version\": \"{0}\"\n".format(VK_XML_VERSION))
> + f.write(" }\n")
> + f.write("}\n")
> +
> def set_working_directory():
> path = os.path.abspath(__file__)
> path = os.path.dirname(path)
> @@ -3074,6 +3087,9 @@ def main():
> with open(WINE_VULKAN_THUNKS_C, "w") as f:
> generator.generate_thunks_c(f, "wine_")
>
> + with open(WINE_VULKAN_JSON, "w") as f:
> + generate_vulkan_json(f)
> +
> with open(WINE_VULKAN_SPEC, "w") as f:
> generator.generate_vulkan_spec(f)
>
> diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
> index 59472bcef8..3a894d4e1f 100644
> --- a/dlls/winevulkan/vulkan.c
> +++ b/dlls/winevulkan/vulkan.c
> @@ -21,6 +21,7 @@
>
> #include "windef.h"
> #include "winbase.h"
> +#include "winreg.h"
> #include "winuser.h"
>
> #include "vulkan_private.h"
> @@ -50,6 +51,7 @@ static void *wine_vk_find_struct_(void *s, VkStructureType t)
>
> static void *wine_vk_get_global_proc_addr(const char *name);
>
> +static HINSTANCE hinstance;
> static const struct vulkan_funcs *vk_funcs;
> static VkResult (*p_vkEnumerateInstanceVersion)(uint32_t *version);
>
> @@ -1268,6 +1270,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
> switch (reason)
> {
> case DLL_PROCESS_ATTACH:
> + hinstance = hinst;
> DisableThreadLibraryCalls(hinst);
> return wine_vk_init();
> }
> @@ -1307,3 +1310,85 @@ void *native_vkGetInstanceProcAddrWINE(VkInstance instance, const char *name)
> {
> return vk_funcs->p_vkGetInstanceProcAddr(instance, name);
> }
> +
> +
> +static const WCHAR winevulkan_json_resW[] = {'w','i','n','e','v','u','l','k','a','n','_','j','s','o','n',0};
> +static const WCHAR winevulkan_json_pathW[] = {'\\','w','i','n','e','v','u','l','k','a','n','.','j','s','o','n',0};
> +static const WCHAR vulkan_driversW[] = {'S','o','f','t','w','a','r','e','\\','K','h','r','o','n','o','s','\\',
> + 'V','u','l','k','a','n','\\','D','r','i','v','e','r','s',0};
> +
> +HRESULT WINAPI DllRegisterServer(void)
> +{
> + WCHAR json_path[MAX_PATH];
> + HRSRC rsrc;
> + const char *data;
> + DWORD datalen, written, zero = 0;
> + HANDLE file;
> + HKEY key;
> +
> + /* Create the JSON manifest and registry key to register this ICD with the official Vulkan loader. */
> + TRACE("\n");
> + rsrc = FindResourceW(hinstance, winevulkan_json_resW, (const WCHAR *)RT_RCDATA);
> + if (!rsrc)
> + {
> + ERR("Unable to find resource.\n");
> + return E_UNEXPECTED;
> + }
> + data = LockResource(LoadResource(hinstance, rsrc));
> + datalen = SizeofResource(hinstance, rsrc);
> +
> + GetSystemDirectoryW(json_path, ARRAY_SIZE(json_path));
> + lstrcatW(json_path, winevulkan_json_pathW);
> + file = CreateFileW(json_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
> + if (file == INVALID_HANDLE_VALUE)
> + {
> + ERR("Unable to create JSON manifest.\n");
> + return E_UNEXPECTED;
> + }
> +
> + if (WriteFile(file, data, datalen, &written, NULL) == FALSE)
> + {
> + ERR("Unable to write to JSON manifest.\n");
> + CloseHandle(file);
> + return E_UNEXPECTED;
> + }
> +
> + CloseHandle(file);
> +
> + if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, vulkan_driversW, 0, NULL, 0, KEY_SET_VALUE,
> + NULL, &key, NULL) != ERROR_SUCCESS)
> + {
> + ERR("Unable to create registry key.\n");
> + return E_UNEXPECTED;
> + }
> +
> + if (RegSetValueExW(key, json_path, 0, REG_DWORD, (const BYTE *)&zero, sizeof(zero)) != ERROR_SUCCESS)
> + {
> + ERR("Unable to set registry value.\n");
> + RegCloseKey(key);
> + return E_UNEXPECTED;
> + }
> +
> + RegCloseKey(key);
> + return S_OK;
> +}
> +
> +HRESULT WINAPI DllUnregisterServer(void)
> +{
> + WCHAR json_path[MAX_PATH];
> + HKEY key;
> +
> + /* Remove the JSON manifest and registry key */
> + TRACE("\n");
> + GetSystemDirectoryW(json_path, ARRAY_SIZE(json_path));
> + lstrcatW(json_path, winevulkan_json_pathW);
> + DeleteFileW(json_path);
> +
> + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, vulkan_driversW, 0, KEY_SET_VALUE, &key) == ERROR_SUCCESS)
> + {
> + RegDeleteValueW(key, json_path);
> + RegCloseKey(key);
> + }
> +
> + return S_OK;
> +}
> diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json
> new file mode 100644
> index 0000000000..993bf8f949
> --- /dev/null
> +++ b/dlls/winevulkan/winevulkan.json
> @@ -0,0 +1,7 @@
> +{
> + "file_format_version": "1.0.0",
> + "ICD": {
> + "library_path": ".\\winevulkan.dll",
> + "api_version": "1.2.134"
> + }
> +}
> diff --git a/dlls/winevulkan/winevulkan.rc b/dlls/winevulkan/winevulkan.rc
> new file mode 100644
> index 0000000000..740c7f7878
> --- /dev/null
> +++ b/dlls/winevulkan/winevulkan.rc
> @@ -0,0 +1,21 @@
> +/* Wine Vulkan resources
> + *
> + * Copyright 2020 Brendan Shanks for CodeWeavers
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
> + */
> +
> +/* @makedep: winevulkan.json */
> +winevulkan_json RCDATA winevulkan.json
> diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec
> index c02af5aeaa..e024a43586 100644
> --- a/dlls/winevulkan/winevulkan.spec
> +++ b/dlls/winevulkan/winevulkan.spec
> @@ -239,3 +239,5 @@
> @ stdcall -private wine_vkUpdateDescriptorSets(ptr long ptr long ptr)
> @ stdcall -private wine_vkWaitForFences(ptr long ptr long int64)
> @ stdcall -private wine_vkWaitSemaphores(ptr ptr int64)
> +@ stdcall -private DllRegisterServer()
> +@ stdcall -private DllUnregisterServer()
> diff --git a/loader/wine.inf.in b/loader/wine.inf.in
> index ad79c084dd..271a422506 100644
> --- a/loader/wine.inf.in
> +++ b/loader/wine.inf.in
> @@ -2570,6 +2570,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
> 11,,windowscodecs.dll,1
> 11,,winegstreamer.dll,1
> 11,,wineqtdecoder.dll,1
> +11,,winevulkan.dll,1
> 11,,wintrust.dll,1
> 11,,iexplore.exe,1
>
>
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
March 31, 2020
[PATCH v6] winevulkan: Create JSON manifest and registry entry used by official Vulkan loader.
by Brendan Shanks
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47109
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
v6: As recommended by Alexandre, the JSON file is now generated by
make_vulkan and stored in resources.
The library_path in the JSON file is now a relative path, this is
simpler and is what NVIDIA and AMD ICDs do on Windows.
dlls/winevulkan/Makefile.in | 5 +-
dlls/winevulkan/make_vulkan | 16 +++++++
dlls/winevulkan/vulkan.c | 85 +++++++++++++++++++++++++++++++++
dlls/winevulkan/winevulkan.json | 7 +++
dlls/winevulkan/winevulkan.rc | 21 ++++++++
dlls/winevulkan/winevulkan.spec | 2 +
loader/wine.inf.in | 1 +
7 files changed, 135 insertions(+), 2 deletions(-)
create mode 100644 dlls/winevulkan/winevulkan.json
create mode 100644 dlls/winevulkan/winevulkan.rc
diff --git a/dlls/winevulkan/Makefile.in b/dlls/winevulkan/Makefile.in
index e0bca6fad7..d832a2a8f8 100644
--- a/dlls/winevulkan/Makefile.in
+++ b/dlls/winevulkan/Makefile.in
@@ -1,9 +1,10 @@
MODULE = winevulkan.dll
IMPORTLIB = winevulkan
-IMPORTS = user32 gdi32
+IMPORTS = user32 gdi32 advapi32
C_SRCS = \
vulkan.c \
vulkan_thunks.c
-RC_SRCS = version.rc
+RC_SRCS = version.rc \
+ winevulkan.rc
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index e5b3a1fdfa..1811d5ae10 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -71,6 +71,7 @@ WINE_VK_VERSION = (1, 2)
WINE_VULKAN_H = "../../include/wine/vulkan.h"
WINE_VULKAN_DRIVER_H = "../../include/wine/vulkan_driver.h"
WINE_VULKAN_LOADER_SPEC = "../vulkan-1/vulkan-1.spec"
+WINE_VULKAN_JSON = "winevulkan.json"
WINE_VULKAN_SPEC = "winevulkan.spec"
WINE_VULKAN_THUNKS_C = "vulkan_thunks.c"
WINE_VULKAN_THUNKS_H = "vulkan_thunks.h"
@@ -2526,6 +2527,9 @@ class VkGenerator(object):
else:
f.write("@ stub {0}\n".format(func.name))
+ f.write("@ stdcall -private DllRegisterServer()\n")
+ f.write("@ stdcall -private DllUnregisterServer()\n")
+
def generate_vulkan_loader_spec(self, f):
self._generate_copyright(f, spec_file=True)
@@ -3033,6 +3037,15 @@ class VkRegistry(object):
self.handles = sorted(handles, key=lambda handle: handle.name)
self.structs = sorted(structs, key=lambda struct: struct.name)
+def generate_vulkan_json(f):
+ f.write("{\n")
+ f.write(" \"file_format_version\": \"1.0.0\",\n")
+ f.write(" \"ICD\": {\n")
+ f.write(" \"library_path\": \".\\\\winevulkan.dll\",\n")
+ f.write(" \"api_version\": \"{0}\"\n".format(VK_XML_VERSION))
+ f.write(" }\n")
+ f.write("}\n")
+
def set_working_directory():
path = os.path.abspath(__file__)
path = os.path.dirname(path)
@@ -3074,6 +3087,9 @@ def main():
with open(WINE_VULKAN_THUNKS_C, "w") as f:
generator.generate_thunks_c(f, "wine_")
+ with open(WINE_VULKAN_JSON, "w") as f:
+ generate_vulkan_json(f)
+
with open(WINE_VULKAN_SPEC, "w") as f:
generator.generate_vulkan_spec(f)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index 59472bcef8..3a894d4e1f 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -21,6 +21,7 @@
#include "windef.h"
#include "winbase.h"
+#include "winreg.h"
#include "winuser.h"
#include "vulkan_private.h"
@@ -50,6 +51,7 @@ static void *wine_vk_find_struct_(void *s, VkStructureType t)
static void *wine_vk_get_global_proc_addr(const char *name);
+static HINSTANCE hinstance;
static const struct vulkan_funcs *vk_funcs;
static VkResult (*p_vkEnumerateInstanceVersion)(uint32_t *version);
@@ -1268,6 +1270,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
switch (reason)
{
case DLL_PROCESS_ATTACH:
+ hinstance = hinst;
DisableThreadLibraryCalls(hinst);
return wine_vk_init();
}
@@ -1307,3 +1310,85 @@ void *native_vkGetInstanceProcAddrWINE(VkInstance instance, const char *name)
{
return vk_funcs->p_vkGetInstanceProcAddr(instance, name);
}
+
+
+static const WCHAR winevulkan_json_resW[] = {'w','i','n','e','v','u','l','k','a','n','_','j','s','o','n',0};
+static const WCHAR winevulkan_json_pathW[] = {'\\','w','i','n','e','v','u','l','k','a','n','.','j','s','o','n',0};
+static const WCHAR vulkan_driversW[] = {'S','o','f','t','w','a','r','e','\\','K','h','r','o','n','o','s','\\',
+ 'V','u','l','k','a','n','\\','D','r','i','v','e','r','s',0};
+
+HRESULT WINAPI DllRegisterServer(void)
+{
+ WCHAR json_path[MAX_PATH];
+ HRSRC rsrc;
+ const char *data;
+ DWORD datalen, written, zero = 0;
+ HANDLE file;
+ HKEY key;
+
+ /* Create the JSON manifest and registry key to register this ICD with the official Vulkan loader. */
+ TRACE("\n");
+ rsrc = FindResourceW(hinstance, winevulkan_json_resW, (const WCHAR *)RT_RCDATA);
+ if (!rsrc)
+ {
+ ERR("Unable to find resource.\n");
+ return E_UNEXPECTED;
+ }
+ data = LockResource(LoadResource(hinstance, rsrc));
+ datalen = SizeofResource(hinstance, rsrc);
+
+ GetSystemDirectoryW(json_path, ARRAY_SIZE(json_path));
+ lstrcatW(json_path, winevulkan_json_pathW);
+ file = CreateFileW(json_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file == INVALID_HANDLE_VALUE)
+ {
+ ERR("Unable to create JSON manifest.\n");
+ return E_UNEXPECTED;
+ }
+
+ if (WriteFile(file, data, datalen, &written, NULL) == FALSE)
+ {
+ ERR("Unable to write to JSON manifest.\n");
+ CloseHandle(file);
+ return E_UNEXPECTED;
+ }
+
+ CloseHandle(file);
+
+ if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, vulkan_driversW, 0, NULL, 0, KEY_SET_VALUE,
+ NULL, &key, NULL) != ERROR_SUCCESS)
+ {
+ ERR("Unable to create registry key.\n");
+ return E_UNEXPECTED;
+ }
+
+ if (RegSetValueExW(key, json_path, 0, REG_DWORD, (const BYTE *)&zero, sizeof(zero)) != ERROR_SUCCESS)
+ {
+ ERR("Unable to set registry value.\n");
+ RegCloseKey(key);
+ return E_UNEXPECTED;
+ }
+
+ RegCloseKey(key);
+ return S_OK;
+}
+
+HRESULT WINAPI DllUnregisterServer(void)
+{
+ WCHAR json_path[MAX_PATH];
+ HKEY key;
+
+ /* Remove the JSON manifest and registry key */
+ TRACE("\n");
+ GetSystemDirectoryW(json_path, ARRAY_SIZE(json_path));
+ lstrcatW(json_path, winevulkan_json_pathW);
+ DeleteFileW(json_path);
+
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, vulkan_driversW, 0, KEY_SET_VALUE, &key) == ERROR_SUCCESS)
+ {
+ RegDeleteValueW(key, json_path);
+ RegCloseKey(key);
+ }
+
+ return S_OK;
+}
diff --git a/dlls/winevulkan/winevulkan.json b/dlls/winevulkan/winevulkan.json
new file mode 100644
index 0000000000..993bf8f949
--- /dev/null
+++ b/dlls/winevulkan/winevulkan.json
@@ -0,0 +1,7 @@
+{
+ "file_format_version": "1.0.0",
+ "ICD": {
+ "library_path": ".\\winevulkan.dll",
+ "api_version": "1.2.134"
+ }
+}
diff --git a/dlls/winevulkan/winevulkan.rc b/dlls/winevulkan/winevulkan.rc
new file mode 100644
index 0000000000..740c7f7878
--- /dev/null
+++ b/dlls/winevulkan/winevulkan.rc
@@ -0,0 +1,21 @@
+/* Wine Vulkan resources
+ *
+ * Copyright 2020 Brendan Shanks for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* @makedep: winevulkan.json */
+winevulkan_json RCDATA winevulkan.json
diff --git a/dlls/winevulkan/winevulkan.spec b/dlls/winevulkan/winevulkan.spec
index c02af5aeaa..e024a43586 100644
--- a/dlls/winevulkan/winevulkan.spec
+++ b/dlls/winevulkan/winevulkan.spec
@@ -239,3 +239,5 @@
@ stdcall -private wine_vkUpdateDescriptorSets(ptr long ptr long ptr)
@ stdcall -private wine_vkWaitForFences(ptr long ptr long int64)
@ stdcall -private wine_vkWaitSemaphores(ptr ptr int64)
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index ad79c084dd..271a422506 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2570,6 +2570,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,windowscodecs.dll,1
11,,winegstreamer.dll,1
11,,wineqtdecoder.dll,1
+11,,winevulkan.dll,1
11,,wintrust.dll,1
11,,iexplore.exe,1
--
2.24.1
March 31, 2020
Re: [PATCH 1/6] qedit/samplegrabber: Use calloc() in sample_grabber_create().
by Zebediah Figura
On 3/30/20 6:19 PM, Marvin wrote:
> Hi,
>
> While running your changed tests, I think I found new failures.
> Being a bot and all I'm not very good at pattern recognition, so I might be
> wrong, but could you please double-check?
>
> Full results can be found at:
> https://testbot.winehq.org/JobDetails.pl?Key=68501
>
> Your paranoid android.
>
>
> === debiant (build log) ===
>
> error: patch failed: dlls/qedit/samplegrabber.c:107
> Task: Patch failed to apply
>
Eh, I submitted this one before the testbot updated, so it should apply
fine. Sorry about the noise.
March 30, 2020
[PATCH vkd3d] include: Fix incorrect type. (Clang)
by Chip Davis
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
See? It caught one! :)
---
include/vkd3d_shader.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h
index 6083ea7..d6f80f9 100644
--- a/include/vkd3d_shader.h
+++ b/include/vkd3d_shader.h
@@ -274,7 +274,7 @@ struct vkd3d_shader_domain_shader_compile_arguments
const void *next;
enum vkd3d_tessellator_output_primitive output_primitive;
- enum vkd3d_tessellator_output_primitive partitioning;
+ enum vkd3d_tessellator_partitioning partitioning;
};
/* root signature 1.0 */
--
2.24.0
March 30, 2020
Re: [PATCH 1/6] qedit/samplegrabber: Use calloc() in sample_grabber_create().
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=68501
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/qedit/samplegrabber.c:107
Task: Patch failed to apply
March 30, 2020
[PATCH 6/6] evr: Get rid of the evr_filter typedef.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/evr/evr.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
index e2caae31d37..911075de338 100644
--- a/dlls/evr/evr.c
+++ b/dlls/evr/evr.c
@@ -31,19 +31,19 @@
WINE_DEFAULT_DEBUG_CHANNEL(evr);
-typedef struct
+struct evr
{
struct strmbase_renderer renderer;
-} evr_filter;
+};
-static inline evr_filter *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
+static struct evr *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
{
- return CONTAINING_RECORD(iface, evr_filter, renderer);
+ return CONTAINING_RECORD(iface, struct evr, renderer);
}
static void evr_destroy(struct strmbase_renderer *iface)
{
- evr_filter *filter = impl_from_strmbase_renderer(iface);
+ struct evr *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer);
free(filter);
@@ -70,7 +70,7 @@ static const struct strmbase_renderer_ops renderer_ops =
HRESULT evr_filter_create(IUnknown *outer, void **out)
{
- evr_filter *object;
+ struct evr *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
--
2.26.0
March 30, 2020
[PATCH 5/6] evr: Use calloc() in evr_filter_create().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/evr/evr.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
index d6f6603eaa6..e2caae31d37 100644
--- a/dlls/evr/evr.c
+++ b/dlls/evr/evr.c
@@ -46,7 +46,7 @@ static void evr_destroy(struct strmbase_renderer *iface)
evr_filter *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer);
- CoTaskMemFree(filter);
+ free(filter);
}
static HRESULT WINAPI evr_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample)
@@ -72,16 +72,13 @@ HRESULT evr_filter_create(IUnknown *outer, void **out)
{
evr_filter *object;
- *out = NULL;
-
- object = CoTaskMemAlloc(sizeof(evr_filter));
- if (!object)
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
strmbase_renderer_init(&object->renderer, outer,
&CLSID_EnhancedVideoRenderer, L"EVR Input0", &renderer_ops);
+ TRACE("Created EVR %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
-
return S_OK;
}
--
2.26.0
March 30, 2020
[PATCH 4/6] qedit/nullrenderer: Get rid of the NullRendererImpl typedef.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/nullrenderer.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c
index 61de7927505..e703ea24305 100644
--- a/dlls/qedit/nullrenderer.c
+++ b/dlls/qedit/nullrenderer.c
@@ -26,14 +26,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(qedit);
-typedef struct NullRendererImpl
+struct null_renderer
{
struct strmbase_renderer renderer;
-} NullRendererImpl;
+};
-static inline NullRendererImpl *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
+static struct null_renderer *impl_from_strmbase_renderer(struct strmbase_renderer *iface)
{
- return CONTAINING_RECORD(iface, NullRendererImpl, renderer);
+ return CONTAINING_RECORD(iface, struct null_renderer, renderer);
}
static HRESULT WINAPI NullRenderer_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample)
@@ -49,7 +49,7 @@ static HRESULT WINAPI NullRenderer_CheckMediaType(struct strmbase_renderer *ifac
static void null_renderer_destroy(struct strmbase_renderer *iface)
{
- NullRendererImpl *filter = impl_from_strmbase_renderer(iface);
+ struct null_renderer *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer);
free(filter);
@@ -64,7 +64,7 @@ static const struct strmbase_renderer_ops renderer_ops =
HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
{
- NullRendererImpl *object;
+ struct null_renderer *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
--
2.26.0
March 30, 2020
[PATCH 3/6] qedit/nullrenderer: Use calloc() in null_renderer_create().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/nullrenderer.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c
index 9f29ab78283..61de7927505 100644
--- a/dlls/qedit/nullrenderer.c
+++ b/dlls/qedit/nullrenderer.c
@@ -52,7 +52,7 @@ static void null_renderer_destroy(struct strmbase_renderer *iface)
NullRendererImpl *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer);
- CoTaskMemFree(filter);
+ free(filter);
}
static const struct strmbase_renderer_ops renderer_ops =
@@ -64,15 +64,14 @@ static const struct strmbase_renderer_ops renderer_ops =
HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
{
- NullRendererImpl *pNullRenderer;
+ NullRendererImpl *object;
- *out = NULL;
+ if (!(object = calloc(1, sizeof(*object))))
+ return E_OUTOFMEMORY;
- pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
+ strmbase_renderer_init(&object->renderer, outer, &CLSID_NullRenderer, L"In", &renderer_ops);
- strmbase_renderer_init(&pNullRenderer->renderer, outer,
- &CLSID_NullRenderer, L"In", &renderer_ops);
-
- *out = &pNullRenderer->renderer.filter.IUnknown_inner;
+ TRACE("Created null renderer %p.\n", object);
+ *out = &object->renderer.filter.IUnknown_inner;
return S_OK;
}
--
2.26.0
March 30, 2020
[PATCH 2/6] qedit/samplegrabber: Get rid of the SG_Impl typedef.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qedit/samplegrabber.c | 96 +++++++++++++++++++-------------------
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index 90e4102afa4..bd8480df48b 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -33,8 +33,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(qedit);
-/* Sample Grabber filter implementation */
-typedef struct _SG_Impl {
+struct sample_grabber
+{
struct strmbase_filter filter;
ISampleGrabber ISampleGrabber_iface;
@@ -51,7 +51,7 @@ typedef struct _SG_Impl {
LONG oneShot;
LONG bufferLen;
void* bufferData;
-} SG_Impl;
+};
enum {
OneShot_None,
@@ -59,24 +59,24 @@ enum {
OneShot_Past,
};
-static inline SG_Impl *impl_from_strmbase_filter(struct strmbase_filter *iface)
+static struct sample_grabber *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
- return CONTAINING_RECORD(iface, SG_Impl, filter);
+ return CONTAINING_RECORD(iface, struct sample_grabber, filter);
}
-static inline SG_Impl *impl_from_ISampleGrabber(ISampleGrabber *iface)
+static struct sample_grabber *impl_from_ISampleGrabber(ISampleGrabber *iface)
{
- return CONTAINING_RECORD(iface, SG_Impl, ISampleGrabber_iface);
+ return CONTAINING_RECORD(iface, struct sample_grabber, ISampleGrabber_iface);
}
-static inline SG_Impl *impl_from_IMemInputPin(IMemInputPin *iface)
+static struct sample_grabber *impl_from_IMemInputPin(IMemInputPin *iface)
{
- return CONTAINING_RECORD(iface, SG_Impl, IMemInputPin_iface);
+ return CONTAINING_RECORD(iface, struct sample_grabber, IMemInputPin_iface);
}
/* Cleanup at end of life */
-static void SampleGrabber_cleanup(SG_Impl *This)
+static void SampleGrabber_cleanup(struct sample_grabber *This)
{
TRACE("(%p)\n", This);
if (This->allocator)
@@ -89,7 +89,7 @@ static void SampleGrabber_cleanup(SG_Impl *This)
static struct strmbase_pin *sample_grabber_get_pin(struct strmbase_filter *iface, unsigned int index)
{
- SG_Impl *filter = impl_from_strmbase_filter(iface);
+ struct sample_grabber *filter = impl_from_strmbase_filter(iface);
if (index == 0)
return &filter->sink.pin;
@@ -100,7 +100,7 @@ static struct strmbase_pin *sample_grabber_get_pin(struct strmbase_filter *iface
static void sample_grabber_destroy(struct strmbase_filter *iface)
{
- SG_Impl *filter = impl_from_strmbase_filter(iface);
+ struct sample_grabber *filter = impl_from_strmbase_filter(iface);
SampleGrabber_cleanup(filter);
strmbase_sink_cleanup(&filter->sink);
@@ -112,7 +112,7 @@ static void sample_grabber_destroy(struct strmbase_filter *iface)
static HRESULT sample_grabber_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
{
- SG_Impl *filter = impl_from_strmbase_filter(iface);
+ struct sample_grabber *filter = impl_from_strmbase_filter(iface);
if (IsEqualGUID(iid, &IID_ISampleGrabber))
*out = &filter->ISampleGrabber_iface;
@@ -131,7 +131,7 @@ static const struct strmbase_filter_ops filter_ops =
};
/* Helper that buffers data and/or calls installed sample callbacks */
-static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample)
+static void SampleGrabber_callback(struct sample_grabber *This, IMediaSample *sample)
{
double time = 0.0;
REFERENCE_TIME tStart, tEnd;
@@ -192,31 +192,31 @@ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample)
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_QueryInterface(ISampleGrabber *iface, REFIID riid, void **ppv)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
- return IUnknown_QueryInterface(This->filter.outer_unk, riid, ppv);
+ struct sample_grabber *filter = impl_from_ISampleGrabber(iface);
+ return IUnknown_QueryInterface(filter->filter.outer_unk, riid, ppv);
}
/* IUnknown */
static ULONG WINAPI
SampleGrabber_ISampleGrabber_AddRef(ISampleGrabber *iface)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
- return IUnknown_AddRef(This->filter.outer_unk);
+ struct sample_grabber *filter = impl_from_ISampleGrabber(iface);
+ return IUnknown_AddRef(filter->filter.outer_unk);
}
/* IUnknown */
static ULONG WINAPI
SampleGrabber_ISampleGrabber_Release(ISampleGrabber *iface)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
- return IUnknown_Release(This->filter.outer_unk);
+ struct sample_grabber *filter = impl_from_ISampleGrabber(iface);
+ return IUnknown_Release(filter->filter.outer_unk);
}
/* ISampleGrabber */
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *This = impl_from_ISampleGrabber(iface);
TRACE("(%p)->(%u)\n", This, oneShot);
This->oneShot = oneShot ? OneShot_Wait : OneShot_None;
return S_OK;
@@ -225,7 +225,7 @@ SampleGrabber_ISampleGrabber_SetOneShot(ISampleGrabber *iface, BOOL oneShot)
/* ISampleGrabber */
static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetMediaType(ISampleGrabber *iface, const AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *filter = impl_from_ISampleGrabber(iface);
TRACE("filter %p, mt %p.\n", filter, mt);
strmbase_dump_media_type(mt);
@@ -242,7 +242,7 @@ static HRESULT WINAPI SampleGrabber_ISampleGrabber_SetMediaType(ISampleGrabber *
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_GetConnectedMediaType(ISampleGrabber *iface, AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *filter = impl_from_ISampleGrabber(iface);
TRACE("filter %p, mt %p.\n", filter, mt);
@@ -260,7 +260,7 @@ SampleGrabber_ISampleGrabber_GetConnectedMediaType(ISampleGrabber *iface, AM_MED
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL bufferEm)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *This = impl_from_ISampleGrabber(iface);
TRACE("(%p)->(%u)\n", This, bufferEm);
EnterCriticalSection(&This->filter.csFilter);
if (bufferEm) {
@@ -277,7 +277,7 @@ SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL buffer
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSize, LONG *buffer)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *This = impl_from_ISampleGrabber(iface);
HRESULT ret = S_OK;
TRACE("(%p)->(%p, %p)\n", This, bufSize, buffer);
if (!bufSize)
@@ -315,7 +315,7 @@ SampleGrabber_ISampleGrabber_GetCurrentSample(ISampleGrabber *iface, IMediaSampl
static HRESULT WINAPI
SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB *cb, LONG whichMethod)
{
- SG_Impl *This = impl_from_ISampleGrabber(iface);
+ struct sample_grabber *This = impl_from_ISampleGrabber(iface);
TRACE("(%p)->(%p, %u)\n", This, cb, whichMethod);
if (This->grabberIface)
ISampleGrabberCB_Release(This->grabberIface);
@@ -328,19 +328,19 @@ SampleGrabber_ISampleGrabber_SetCallback(ISampleGrabber *iface, ISampleGrabberCB
static HRESULT WINAPI SampleGrabber_IMemInputPin_QueryInterface(IMemInputPin *iface, REFIID iid, void **out)
{
- SG_Impl *filter = impl_from_IMemInputPin(iface);
+ struct sample_grabber *filter = impl_from_IMemInputPin(iface);
return IPin_QueryInterface(&filter->sink.pin.IPin_iface, iid, out);
}
static ULONG WINAPI SampleGrabber_IMemInputPin_AddRef(IMemInputPin *iface)
{
- SG_Impl *filter = impl_from_IMemInputPin(iface);
+ struct sample_grabber *filter = impl_from_IMemInputPin(iface);
return IPin_AddRef(&filter->sink.pin.IPin_iface);
}
static ULONG WINAPI SampleGrabber_IMemInputPin_Release(IMemInputPin *iface)
{
- SG_Impl *filter = impl_from_IMemInputPin(iface);
+ struct sample_grabber *filter = impl_from_IMemInputPin(iface);
return IPin_Release(&filter->sink.pin.IPin_iface);
}
@@ -348,7 +348,7 @@ static ULONG WINAPI SampleGrabber_IMemInputPin_Release(IMemInputPin *iface)
static HRESULT WINAPI
SampleGrabber_IMemInputPin_GetAllocator(IMemInputPin *iface, IMemAllocator **allocator)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
TRACE("(%p)->(%p) allocator = %p\n", This, allocator, This->allocator);
if (!allocator)
return E_POINTER;
@@ -363,7 +363,7 @@ SampleGrabber_IMemInputPin_GetAllocator(IMemInputPin *iface, IMemAllocator **all
static HRESULT WINAPI
SampleGrabber_IMemInputPin_NotifyAllocator(IMemInputPin *iface, IMemAllocator *allocator, BOOL readOnly)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
TRACE("(%p)->(%p, %u) allocator = %p\n", This, allocator, readOnly, This->allocator);
if (This->allocator == allocator)
return S_OK;
@@ -379,7 +379,7 @@ SampleGrabber_IMemInputPin_NotifyAllocator(IMemInputPin *iface, IMemAllocator *a
static HRESULT WINAPI
SampleGrabber_IMemInputPin_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
FIXME("(%p)->(%p): semi-stub\n", This, props);
if (!props)
return E_POINTER;
@@ -390,7 +390,7 @@ SampleGrabber_IMemInputPin_GetAllocatorRequirements(IMemInputPin *iface, ALLOCAT
static HRESULT WINAPI
SampleGrabber_IMemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
HRESULT hr;
TRACE("(%p)->(%p) output = %p, grabber = %p\n", This, sample, This->source.pMemInputPin, This->grabberIface);
if (!sample)
@@ -412,7 +412,7 @@ SampleGrabber_IMemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample)
static HRESULT WINAPI
SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **samples, LONG nSamples, LONG *nProcessed)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
LONG idx;
TRACE("(%p)->(%p, %u, %p) output = %p, grabber = %p\n", This, samples, nSamples, nProcessed, This->source.pMemInputPin, This->grabberIface);
if (!samples || !nProcessed)
@@ -428,7 +428,7 @@ SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **s
static HRESULT WINAPI
SampleGrabber_IMemInputPin_ReceiveCanBlock(IMemInputPin *iface)
{
- SG_Impl *This = impl_from_IMemInputPin(iface);
+ struct sample_grabber *This = impl_from_IMemInputPin(iface);
TRACE("(%p)\n", This);
return This->source.pMemInputPin ? IMemInputPin_ReceiveCanBlock(This->source.pMemInputPin) : S_OK;
}
@@ -460,14 +460,14 @@ static const IMemInputPinVtbl IMemInputPin_VTable =
SampleGrabber_IMemInputPin_ReceiveCanBlock,
};
-static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface)
+static struct sample_grabber *impl_from_sink_pin(struct strmbase_pin *iface)
{
- return CONTAINING_RECORD(iface, SG_Impl, sink.pin);
+ return CONTAINING_RECORD(iface, struct sample_grabber, sink.pin);
}
static HRESULT sample_grabber_sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
{
- SG_Impl *filter = impl_from_sink_pin(iface);
+ struct sample_grabber *filter = impl_from_sink_pin(iface);
if (IsEqualGUID(iid, &IID_IMemInputPin))
*out = &filter->IMemInputPin_iface;
@@ -478,7 +478,7 @@ static HRESULT sample_grabber_sink_query_interface(struct strmbase_pin *iface, R
return S_OK;
}
-static BOOL check_filter_mt(SG_Impl *filter, const AM_MEDIA_TYPE *mt)
+static BOOL check_filter_mt(struct sample_grabber *filter, const AM_MEDIA_TYPE *mt)
{
if (IsEqualGUID(&filter->filter_mt.majortype, &GUID_NULL))
return TRUE;
@@ -500,7 +500,7 @@ static BOOL check_filter_mt(SG_Impl *filter, const AM_MEDIA_TYPE *mt)
static HRESULT sample_grabber_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_sink_pin(iface);
+ struct sample_grabber *filter = impl_from_sink_pin(iface);
return check_filter_mt(filter, mt) ? S_OK : S_FALSE;
}
@@ -508,7 +508,7 @@ static HRESULT sample_grabber_sink_query_accept(struct strmbase_pin *iface, cons
static HRESULT sample_grabber_sink_get_media_type(struct strmbase_pin *iface,
unsigned int index, AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_sink_pin(iface);
+ struct sample_grabber *filter = impl_from_sink_pin(iface);
IEnumMediaTypes *enummt;
AM_MEDIA_TYPE *pmt;
HRESULT hr;
@@ -539,14 +539,14 @@ static const struct strmbase_sink_ops sink_ops =
.base.pin_get_media_type = sample_grabber_sink_get_media_type,
};
-static inline SG_Impl *impl_from_source_pin(struct strmbase_pin *iface)
+static struct sample_grabber *impl_from_source_pin(struct strmbase_pin *iface)
{
- return CONTAINING_RECORD(iface, SG_Impl, source.pin);
+ return CONTAINING_RECORD(iface, struct sample_grabber, source.pin);
}
static HRESULT sample_grabber_source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
{
- SG_Impl *filter = impl_from_source_pin(iface);
+ struct sample_grabber *filter = impl_from_source_pin(iface);
if (IsEqualGUID(iid, &IID_IMediaPosition))
*out = &filter->passthrough.IMediaPosition_iface;
@@ -561,7 +561,7 @@ static HRESULT sample_grabber_source_query_interface(struct strmbase_pin *iface,
static HRESULT sample_grabber_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_source_pin(iface);
+ struct sample_grabber *filter = impl_from_source_pin(iface);
if (filter->sink.pin.peer && IPin_QueryAccept(filter->sink.pin.peer, mt) != S_OK)
return S_FALSE;
@@ -572,7 +572,7 @@ static HRESULT sample_grabber_source_query_accept(struct strmbase_pin *iface, co
static HRESULT sample_grabber_source_get_media_type(struct strmbase_pin *iface,
unsigned int index, AM_MEDIA_TYPE *mt)
{
- SG_Impl *filter = impl_from_source_pin(iface);
+ struct sample_grabber *filter = impl_from_source_pin(iface);
IEnumMediaTypes *enummt;
AM_MEDIA_TYPE *pmt;
HRESULT hr;
@@ -605,7 +605,7 @@ static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TY
static HRESULT WINAPI sample_grabber_source_DecideAllocator(struct strmbase_source *iface,
IMemInputPin *peer, IMemAllocator **allocator)
{
- SG_Impl *filter = impl_from_source_pin(&iface->pin);
+ struct sample_grabber *filter = impl_from_source_pin(&iface->pin);
const AM_MEDIA_TYPE *mt = &iface->pin.mt;
if (!compare_media_types(mt, &filter->sink.pin.mt))
@@ -639,7 +639,7 @@ static const struct strmbase_source_ops source_ops =
HRESULT sample_grabber_create(IUnknown *outer, IUnknown **out)
{
- SG_Impl *object;
+ struct sample_grabber *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
--
2.26.0
March 30, 2020