Wine-devel
Threads by month
- ----- 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
November 2018
- 75 participants
- 771 discussions
[PATCH 2/3] crypt32: Add support for a particular ALG_ID to I_CryptGetDefaultCryptProv.
by Dmitry Timoshkov 06 Nov '18
by Dmitry Timoshkov 06 Nov '18
06 Nov '18
Based on a patch of Alexander Morozov.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/crypt32/crypt32_private.h | 2 +-
dlls/crypt32/main.c | 73 ++++++++++++++++++++++++++++++----
dlls/crypt32/tests/main.c | 2 +-
3 files changed, 68 insertions(+), 9 deletions(-)
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index c6e20120fc..1b390f4a92 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -149,7 +149,7 @@ BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD dwCertEncodingType,
/* Returns a handle to the default crypto provider; loads it if necessary.
* Returns NULL on failure.
*/
-HCRYPTPROV WINAPI I_CryptGetDefaultCryptProv(DWORD);
+HCRYPTPROV WINAPI I_CryptGetDefaultCryptProv(ALG_ID);
HINSTANCE hInstance DECLSPEC_HIDDEN;
diff --git a/dlls/crypt32/main.c b/dlls/crypt32/main.c
index d37bf4a712..d0643f4107 100644
--- a/dlls/crypt32/main.c
+++ b/dlls/crypt32/main.c
@@ -35,6 +35,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(crypt);
static HCRYPTPROV hDefProv;
HINSTANCE hInstance;
+static CRITICAL_SECTION prov_param_cs;
+static CRITICAL_SECTION_DEBUG prov_param_cs_debug =
+{
+ 0, 0, &prov_param_cs,
+ { &prov_param_cs_debug.ProcessLocksList,
+ &prov_param_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": prov_param_cs") }
+};
+static CRITICAL_SECTION prov_param_cs = { &prov_param_cs_debug, -1, 0, 0, 0, 0 };
+
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, PVOID pvReserved)
{
switch (fdwReason)
@@ -174,20 +184,69 @@ BOOL WINAPI I_CryptGetOssGlobal(DWORD x)
return FALSE;
}
-HCRYPTPROV WINAPI DECLSPEC_HOTPATCH I_CryptGetDefaultCryptProv(DWORD reserved)
+static BOOL is_supported_algid(HCRYPTPROV prov, ALG_ID algid)
+{
+ PROV_ENUMALGS prov_algs;
+ DWORD size = sizeof(prov_algs);
+ BOOL ret = FALSE;
+
+ /* This enumeration is not thread safe */
+ EnterCriticalSection(&prov_param_cs);
+ if (CryptGetProvParam(prov, PP_ENUMALGS, (BYTE *)&prov_algs, &size, CRYPT_FIRST))
+ {
+ do
+ {
+ if (prov_algs.aiAlgid == algid)
+ {
+ ret = TRUE;
+ break;
+ }
+ } while (CryptGetProvParam(prov, PP_ENUMALGS, (BYTE *)&prov_algs, &size, CRYPT_NEXT));
+ }
+ LeaveCriticalSection(&prov_param_cs);
+ return ret;
+}
+
+HCRYPTPROV WINAPI DECLSPEC_HOTPATCH I_CryptGetDefaultCryptProv(ALG_ID algid)
{
- HCRYPTPROV ret;
+ HCRYPTPROV prov, defprov;
+
+ TRACE("(%08x)\n", algid);
- TRACE("(%08x)\n", reserved);
+ defprov = CRYPT_GetDefaultProvider();
- if (reserved)
+ if (algid && !is_supported_algid(defprov, algid))
{
+ DWORD i = 0, type, size;
+
+ while (CryptEnumProvidersW(i, NULL, 0, &type, NULL, &size))
+ {
+ WCHAR *name = CryptMemAlloc(size);
+ if (name)
+ {
+ if (CryptEnumProvidersW(i, NULL, 0, &type, name, &size))
+ {
+ if (CryptAcquireContextW(&prov, NULL, name, type, CRYPT_VERIFYCONTEXT))
+ {
+ if (is_supported_algid(prov, algid))
+ {
+ CryptMemFree(name);
+ return prov;
+ }
+ CryptReleaseContext(prov, 0);
+ }
+ }
+ CryptMemFree(name);
+ }
+ i++;
+ }
+
SetLastError(E_INVALIDARG);
return 0;
}
- ret = CRYPT_GetDefaultProvider();
- CryptContextAddRef(ret, NULL, 0);
- return ret;
+
+ CryptContextAddRef(defprov, NULL, 0);
+ return defprov;
}
BOOL WINAPI I_CryptReadTrustedPublisherDWORDValueFromRegistry(LPCWSTR name,
diff --git a/dlls/crypt32/tests/main.c b/dlls/crypt32/tests/main.c
index a490c51e3f..6a031527d8 100644
--- a/dlls/crypt32/tests/main.c
+++ b/dlls/crypt32/tests/main.c
@@ -357,7 +357,7 @@ static void test_getDefaultCryptProv(void)
prov = pI_CryptGetDefaultCryptProv(test_prov[i].algid);
if (!prov)
{
-todo_wine_if(!test_prov[i].optional)
+todo_wine_if(test_prov[i].algid == CALG_DSS_SIGN || test_prov[i].algid == CALG_NO_SIGN)
ok(test_prov[i].optional, "%u: I_CryptGetDefaultCryptProv(%#x) failed\n", i, test_prov[i].algid);
continue;
}
--
2.17.1
1
0
[PATCH 1/3] crypt32/tests: Add more tests for I_CryptGetDefaultCryptProv.
by Dmitry Timoshkov 06 Nov '18
by Dmitry Timoshkov 06 Nov '18
06 Nov '18
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/crypt32/tests/main.c | 52 +++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/dlls/crypt32/tests/main.c b/dlls/crypt32/tests/main.c
index 11beff11c4..a490c51e3f 100644
--- a/dlls/crypt32/tests/main.c
+++ b/dlls/crypt32/tests/main.c
@@ -305,8 +305,32 @@ static void test_readTrustedPublisherDWORD(void)
static void test_getDefaultCryptProv(void)
{
+#define ALG(id) id, #id
+ static const struct
+ {
+ ALG_ID algid;
+ const char *name;
+ BOOL optional;
+ } test_prov[] =
+ {
+ { ALG(CALG_MD2), TRUE },
+ { ALG(CALG_MD4), TRUE },
+ { ALG(CALG_MD5), TRUE },
+ { ALG(CALG_SHA), TRUE },
+ { ALG(CALG_RSA_SIGN) },
+ { ALG(CALG_DSS_SIGN) },
+ { ALG(CALG_NO_SIGN) },
+ { ALG(CALG_ECDSA), TRUE },
+ { ALG(CALG_ECDH), TRUE },
+ { ALG(CALG_RSA_KEYX) },
+ { ALG(CALG_RSA_KEYX) },
+ };
+#undef ALG
HCRYPTPROV (WINAPI *pI_CryptGetDefaultCryptProv)(DWORD w);
HCRYPTPROV prov;
+ BOOL ret;
+ DWORD size, i;
+ LPSTR name;
pI_CryptGetDefaultCryptProv = (void *)GetProcAddress(hCrypt, "I_CryptGetDefaultCryptProv");
if (!pI_CryptGetDefaultCryptProv) return;
@@ -323,6 +347,34 @@ static void test_getDefaultCryptProv(void)
prov = pI_CryptGetDefaultCryptProv(0);
ok(prov != 0, "I_CryptGetDefaultCryptProv failed: %08x\n", GetLastError());
CryptReleaseContext(prov, 0);
+
+ for (i = 0; i < ARRAY_SIZE(test_prov); i++)
+ {
+ if (winetest_debug > 1)
+ trace("%u: algid %#x (%s): class %u, type %u, sid %u\n", i, test_prov[i].algid, test_prov[i].name,
+ GET_ALG_CLASS(test_prov[i].algid) >> 13, GET_ALG_TYPE(test_prov[i].algid) >> 9, GET_ALG_SID(test_prov[i].algid));
+
+ prov = pI_CryptGetDefaultCryptProv(test_prov[i].algid);
+ if (!prov)
+ {
+todo_wine_if(!test_prov[i].optional)
+ ok(test_prov[i].optional, "%u: I_CryptGetDefaultCryptProv(%#x) failed\n", i, test_prov[i].algid);
+ continue;
+ }
+
+ ret = CryptGetProvParam(prov, PP_NAME, NULL, &size, 0);
+ if (ret) /* some provders don't support PP_NAME */
+ {
+ name = CryptMemAlloc(size);
+ ret = CryptGetProvParam(prov, PP_NAME, (BYTE *)name, &size, 0);
+ ok(ret, "%u: CryptGetProvParam failed %#x\n", i, GetLastError());
+ if (winetest_debug > 1)
+ trace("%u: algid %#x, name %s\n", i, test_prov[i].algid, name);
+ CryptMemFree(name);
+ }
+
+ CryptReleaseContext(prov, 0);
+ }
}
static void test_CryptInstallOssGlobal(void)
--
2.17.1
1
0
06 Nov '18
This patch allows to use Wine headers with Visual Studio 12.0.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
include/sal.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/sal.h b/include/sal.h
index c8b4491fbc..c69f7f9840 100644
--- a/include/sal.h
+++ b/include/sal.h
@@ -61,6 +61,7 @@
#define _Inout_updates_bytes_(count)
#define _Inout_updates_opt_(count)
#define _Inout_updates_z_(count)
+#define _Inout_updates_opt_z_(count)
#define _Inout_z_
#define _Inout_z_bytecap_(count)
#define _Inout_z_cap_(count)
--
2.17.1
1
0
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d8/tests/device.c | 243 ++++++++++++++++++-----------------------------
1 file changed, 91 insertions(+), 152 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 5c4e5b96659..6313d4855fd 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -75,6 +75,16 @@ static int get_refcount(IUnknown *object)
return IUnknown_Release( object );
}
+static HWND create_window(void)
+{
+ RECT r = {0, 0, 640, 480};
+
+ AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW | WS_VISIBLE, FALSE);
+
+ return CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ 0, 0, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL);
+}
+
/* try to make sure pending X events have been processed before continuing */
static void flush_events(void)
{
@@ -231,8 +241,7 @@ static void test_mipmap_levels(void)
ULONG refcount;
HWND window;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -268,11 +277,9 @@ static void test_swapchain(void)
HRESULT hr;
struct device_desc device_desc;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
- window2 = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window2 = create_window();
ok(!!window2, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -477,8 +484,7 @@ static void test_refcount(void)
D3DVSD_END()
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -807,8 +813,7 @@ static void test_checkdevicemultisampletype(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -866,8 +871,7 @@ static void test_invalid_multisample(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -935,8 +939,7 @@ static void test_cursor(void)
return;
}
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
ret = SetCursorPos(50, 50);
@@ -1126,8 +1129,7 @@ static void test_states(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1869,8 +1871,7 @@ static void test_scene(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1959,8 +1960,7 @@ static void test_shader(void)
const DWORD simple_vs_size = sizeof(simple_vs);
const DWORD simple_ps_size = sizeof(simple_ps);
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -2153,8 +2153,7 @@ static void test_limits(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -2201,8 +2200,7 @@ static void test_lights(void)
BOOL enabled;
D3DCAPS8 caps;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -2268,8 +2266,7 @@ static void test_render_zero_triangles(void)
{{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff},
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -3431,8 +3428,7 @@ static void test_fpu_setup(void)
IDirect3DSurface8 *surface;
IUnknown dummy_object = {&dummy_object_vtbl};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_CAPTION, 0, 0,
- registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, 0, 0, 0, 0);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -3535,8 +3531,7 @@ static void test_ApplyStateBlock(void)
HRESULT hr;
DWORD received, token;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -3833,8 +3828,7 @@ static void test_unsupported_shaders(void)
D3DVSD_END()
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -4214,8 +4208,7 @@ static void test_reset_resources(void)
HRESULT hr;
ULONG ref;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -4271,8 +4264,7 @@ static void test_set_rt_vp_scissor(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4447,8 +4439,7 @@ static void test_volume_get_container(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4545,8 +4536,7 @@ static void test_vb_lock_flags(void)
HRESULT hr;
BYTE *data;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4592,8 +4582,7 @@ static void test_texture_stage_states(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4681,8 +4670,7 @@ static void test_cube_textures(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4737,8 +4725,7 @@ static void test_get_set_texture(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -4805,8 +4792,7 @@ static void test_image_surface_pool(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4841,8 +4827,7 @@ static void test_surface_get_container(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -4953,8 +4938,7 @@ static void test_lockrect_invalid(void)
{D3DRTYPE_CUBETEXTURE, D3DPOOL_SCRATCH, "scratch cube texture", TRUE, TRUE},
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -5228,8 +5212,7 @@ static void test_private_data(void)
{0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b}
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -5383,8 +5366,7 @@ static void test_surface_dimensions(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -5432,8 +5414,7 @@ static void test_surface_format_null(void)
return;
}
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
if (!(device = create_device(d3d, window, NULL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -5514,8 +5495,7 @@ static void test_surface_double_unlock(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -5669,8 +5649,7 @@ static void test_surface_blocks(void)
{60, 136, 68, 144}, /* top > surface */
};
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -5955,8 +5934,7 @@ static void test_set_palette(void)
unsigned int i;
D3DCAPS8 caps;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6020,8 +5998,7 @@ static void test_swvp_buffer(void)
float x, y, z;
} *ptr, *ptr2;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
@@ -6103,8 +6080,7 @@ static void test_managed_buffer(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6193,8 +6169,7 @@ static void test_npot_textures(void)
unsigned int i, levels;
BOOL tex_pow2, cube_pow2, vol_pow2;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6314,8 +6289,7 @@ static void test_volume_locking(void)
{ D3DPOOL_SCRATCH, D3DUSAGE_DYNAMIC, D3DERR_INVALIDCALL, D3D_OK },
};
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6421,8 +6395,7 @@ static void test_update_volumetexture(void)
{ 8, 8, 4, 4, D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 }, /* Different format */
};
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6525,8 +6498,7 @@ static void test_create_rt_ds_fail(void)
IDirect3D8 *d3d8;
IDirect3DSurface8 *surface;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6638,8 +6610,7 @@ static void test_volume_blocks(void)
BOOL pow2;
unsigned int offset, expected_offset;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d8, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d8, window, NULL)))
@@ -6950,8 +6921,7 @@ static void test_lockbox_invalid(void)
BYTE *base;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7033,36 +7003,26 @@ static void test_lockbox_invalid(void)
static void test_pixel_format(void)
{
- HWND hwnd, hwnd2 = NULL;
- HDC hdc, hdc2 = NULL;
- HMODULE gl = NULL;
int format, test_format;
PIXELFORMATDESCRIPTOR pfd;
IDirect3D8 *d3d8 = NULL;
IDirect3DDevice8 *device = NULL;
+ HWND hwnd, hwnd2;
+ HDC hdc, hdc2;
+ HMODULE gl;
HRESULT hr;
- static const float point[3] = {0.0, 0.0, 0.0};
- hwnd = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 100, 100, 160, 160, NULL, NULL, NULL, NULL);
- if (!hwnd)
- {
- skip("Failed to create window\n");
- return;
- }
+ static const float point[] = {0.0f, 0.0f, 0.0f};
- hwnd2 = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 100, 100, 160, 160, NULL, NULL, NULL, NULL);
+ hwnd = create_window();
+ ok(!!hwnd, "Failed to create window.\n");
+ hwnd2 = create_window();
+ ok(!!hwnd2, "Failed to create window.\n");
hdc = GetDC(hwnd);
- if (!hdc)
- {
- skip("Failed to get DC\n");
- goto cleanup;
- }
-
- if (hwnd2)
- hdc2 = GetDC(hwnd2);
+ ok(!!hdc, "Failed to get DC.\n");
+ hdc2 = GetDC(hwnd2);
+ ok(!!hdc2, "Failed to get DC.\n");
gl = LoadLibraryA("opengl32.dll");
ok(!!gl, "failed to load opengl32.dll; SetPixelFormat()/GetPixelFormat() may not work right\n");
@@ -7089,14 +7049,10 @@ static void test_pixel_format(void)
goto cleanup;
}
- if (!hdc2 || !SetPixelFormat(hdc2, format, &pfd) || GetPixelFormat(hdc2) != format)
+ if (!SetPixelFormat(hdc2, format, &pfd) || GetPixelFormat(hdc2) != format)
{
skip("failed to set pixel format on second window\n");
- if (hdc2)
- {
- ReleaseDC(hwnd2, hdc2);
- hdc2 = NULL;
- }
+ goto cleanup;
}
d3d8 = Direct3DCreate8(D3D_SDK_VERSION);
@@ -7144,17 +7100,14 @@ static void test_pixel_format(void)
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
- if (hdc2)
- {
- hr = IDirect3DDevice8_Present(device, NULL, NULL, hwnd2, NULL);
- ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
+ hr = IDirect3DDevice8_Present(device, NULL, NULL, hwnd2, NULL);
+ ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
- test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ test_format = GetPixelFormat(hdc);
+ ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
- test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
- }
+ test_format = GetPixelFormat(hdc2);
+ ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
cleanup:
if (device)
@@ -7162,12 +7115,13 @@ cleanup:
UINT refcount = IDirect3DDevice8_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}
- if (d3d8) IDirect3D8_Release(d3d8);
- if (gl) FreeLibrary(gl);
- if (hdc) ReleaseDC(hwnd, hdc);
- if (hdc2) ReleaseDC(hwnd2, hdc2);
- if (hwnd) DestroyWindow(hwnd);
- if (hwnd2) DestroyWindow(hwnd2);
+ if (d3d8)
+ IDirect3D8_Release(d3d8);
+ FreeLibrary(gl);
+ ReleaseDC(hwnd2, hdc2);
+ ReleaseDC(hwnd, hdc);
+ DestroyWindow(hwnd2);
+ DestroyWindow(hwnd);
}
static void test_begin_end_state_block(void)
@@ -7179,8 +7133,7 @@ static void test_begin_end_state_block(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7235,8 +7188,7 @@ static void test_shader_constant_apply(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7395,8 +7347,7 @@ static void test_resource_type(void)
HRESULT hr;
D3DCAPS8 caps;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7548,8 +7499,7 @@ static void test_mipmap_lock(void)
HRESULT hr;
D3DLOCKED_RECT locked_rect;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7630,8 +7580,7 @@ static void test_writeonly_resource(void)
{{ 1.0f, 1.0f, 0.0f}}
};
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7693,8 +7642,7 @@ static void test_lost_device(void)
HRESULT hr;
BOOL ret;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
device_desc.device_window = window;
@@ -7816,8 +7764,7 @@ static void test_resource_priority(void)
unsigned int i;
DWORD priority;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7940,8 +7887,7 @@ static void test_swapchain_parameters(void)
{FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
};
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8159,8 +8105,7 @@ static void test_miptree_layout(void)
{D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH"},
};
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8276,8 +8221,7 @@ static void test_render_target_device_mismatch(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8334,8 +8278,7 @@ static void test_format_unknown(void)
void *iface;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8477,8 +8420,7 @@ static void test_clip_planes_limits(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -8557,8 +8499,7 @@ static void test_swapchain_multisample_reset(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create D3D object.\n");
@@ -8612,8 +8553,7 @@ static void test_device_caps(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8728,8 +8668,7 @@ static void test_get_info(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
--
2.11.0
2
1
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d9/tests/device.c | 324 +++++++++++++++++------------------------------
1 file changed, 118 insertions(+), 206 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 7bf06307646..52a3ee795fa 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -117,6 +117,16 @@ static BOOL compare_elements(IDirect3DVertexDeclaration9 *declaration, const D3D
return equal;
}
+static HWND create_window(void)
+{
+ RECT r = {0, 0, 640, 480};
+
+ AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW | WS_VISIBLE, FALSE);
+
+ return CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ 0, 0, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL);
+}
+
/* try to make sure pending X events have been processed before continuing */
static void flush_events(void)
{
@@ -276,8 +286,7 @@ static void test_get_set_vertex_declaration(void)
D3DDECL_END()
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -331,8 +340,7 @@ static void test_get_declaration(void)
D3DDECL_END()
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -650,8 +658,7 @@ static void test_fvf_decl_conversion(void)
},
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -748,8 +755,7 @@ static void test_fvf_decl_management(void)
static const D3DVERTEXELEMENT9 test_elements2[] =
{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0}, D3DDECL_END()};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -866,8 +872,7 @@ static void test_vertex_declaration_alignment(void)
},
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -940,8 +945,7 @@ static void test_unused_declaration_type(void)
},
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -985,8 +989,7 @@ static void test_mipmap_levels(void)
ULONG refcount;
HWND window;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1015,8 +1018,7 @@ static void test_checkdevicemultisampletype(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1102,8 +1104,7 @@ static void test_invalid_multisample(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1179,11 +1180,9 @@ static void test_swapchain(void)
HRESULT hr;
struct device_desc device_desc;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
- window2 = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window2 = create_window();
ok(!!window2, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1410,8 +1409,7 @@ static void test_refcount(void)
D3DDECL_END()
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -1744,8 +1742,7 @@ static void test_cursor(void)
HRESULT hr;
BOOL ret;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
ret = SetCursorPos(50, 50);
@@ -2462,8 +2459,7 @@ static void test_scene(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -2586,8 +2582,7 @@ static void test_limits(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -2804,8 +2799,7 @@ static void test_get_rt(void)
ULONG ref;
UINT i;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 128, 128, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
device = create_device(d3d9, window, NULL);
@@ -2872,8 +2866,7 @@ static void test_draw_primitive(void)
HRESULT hr;
void *ptr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -3031,8 +3024,7 @@ static void test_null_stream(void)
D3DDECL_END()
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -3104,8 +3096,7 @@ static void test_lights(void)
BOOL enabled;
D3DCAPS9 caps;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -3157,8 +3148,7 @@ static void test_set_stream_source(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -3383,8 +3373,7 @@ static void test_multi_device(void)
IDirect3D9 *d3d9;
ULONG refcount;
- window1 = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window1 = create_window();
ok(!!window1, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -3397,8 +3386,7 @@ static void test_multi_device(void)
}
IDirect3D9_Release(d3d9);
- window2 = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window2 = create_window();
ok(!!window2, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -4600,8 +4588,7 @@ static void test_fpu_setup(void)
IDirect3D9 *d3d9;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_CAPTION, 0, 0,
- registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, 0, 0, 0, 0);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -5223,8 +5210,7 @@ static void test_reset_resources(void)
HRESULT hr;
ULONG ref;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -5294,8 +5280,7 @@ static void test_set_rt_vp_scissor(void)
HRESULT hr;
RECT rect;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5399,8 +5384,7 @@ static void test_volume_get_container(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5481,8 +5465,7 @@ static void test_volume_resource(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5549,8 +5532,7 @@ static void test_vb_lock_flags(void)
HRESULT hr;
void *data;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5619,8 +5601,7 @@ static void test_vertex_buffer_alignment(void)
HRESULT hr;
void *data;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5689,8 +5670,7 @@ static void test_query_support(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -5772,8 +5752,7 @@ static void test_occlusion_query(void)
BOOL broken_occlusion = FALSE;
expected.uint = registry_mode.dmPelsWidth * registry_mode.dmPelsHeight;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
device_desc.device_window = window;
@@ -6022,8 +6001,7 @@ static void test_timestamp_query(void)
DWORD timestamp[2], freq[2];
WORD disjoint[2];
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -6213,8 +6191,7 @@ static void test_get_set_vertex_shader(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -6287,8 +6264,7 @@ static void test_vertex_shader_constant(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -6415,8 +6391,7 @@ static void test_get_set_pixel_shader(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -6487,8 +6462,7 @@ static void test_pixel_shader_constant(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -6759,8 +6733,7 @@ float4 main(const float4 color : COLOR) : SV_TARGET
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -6907,8 +6880,7 @@ static void test_texture_stage_states(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7069,8 +7041,7 @@ static void test_cube_textures(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7175,8 +7146,7 @@ static void test_mipmap_gen(void)
return;
}
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
if (!(device = create_device(d3d, window, NULL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -7370,8 +7340,7 @@ static void test_filter(void)
return;
}
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
if (!(device = create_device(d3d, window, NULL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -7440,8 +7409,7 @@ static void test_get_set_texture(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7492,8 +7460,7 @@ static void test_lod(void)
HRESULT hr;
DWORD ret;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7538,8 +7505,7 @@ static void test_surface_get_container(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7608,8 +7574,7 @@ static void test_surface_alignment(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7710,8 +7675,7 @@ static void test_lockrect_offset(void)
BYTE *base;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -7820,8 +7784,7 @@ static void test_lockrect_invalid(void)
{D3DRTYPE_CUBETEXTURE, D3DPOOL_SCRATCH, "scratch cube texture"},
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8073,8 +8036,7 @@ static void test_private_data(void)
{0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b}
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8268,8 +8230,7 @@ static void test_getdc(void)
HDC dc, dc2;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8578,8 +8539,7 @@ static void test_surface_dimensions(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8629,8 +8589,7 @@ static void test_surface_format_null(void)
return;
}
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
if (!(device = create_device(d3d, window, NULL)))
{
skip("Failed to create a D3D device, skipping tests.\n");
@@ -8721,8 +8680,7 @@ static void test_surface_double_unlock(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -8853,8 +8811,7 @@ static void test_surface_blocks(void)
{60, 136, 68, 144}, /* top > surface */
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -9175,8 +9132,7 @@ static void test_set_palette(void)
unsigned int i;
D3DCAPS9 caps;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9239,8 +9195,7 @@ static void test_swvp_buffer(void)
float x, y, z;
} *ptr, *ptr2;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
@@ -9322,8 +9277,7 @@ static void test_managed_buffer(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9413,8 +9367,7 @@ static void test_npot_textures(void)
unsigned int i, levels;
BOOL tex_pow2, cube_pow2, vol_pow2;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9516,8 +9469,7 @@ static void test_vidmem_accounting(void)
unsigned int i;
UINT vidmem_start, vidmem_end, diff;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9587,8 +9539,7 @@ static void test_volume_locking(void)
{ D3DPOOL_SCRATCH, D3DUSAGE_DYNAMIC, D3DERR_INVALIDCALL, D3D_OK },
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9694,8 +9645,7 @@ static void test_update_volumetexture(void)
{ 8, 8, 4, 4, D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 }, /* Different format */
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9798,8 +9748,7 @@ static void test_create_rt_ds_fail(void)
IDirect3D9 *d3d9;
IDirect3DSurface9 *surface;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -9911,8 +9860,7 @@ static void test_volume_blocks(void)
BOOL pow2;
unsigned int offset, expected_offset;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d9, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d9, window, NULL)))
@@ -10223,8 +10171,7 @@ static void test_lockbox_invalid(void)
BYTE *base;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -10321,8 +10268,7 @@ static void test_shared_handle(void)
void *mem;
D3DCAPS9 caps;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -10406,36 +10352,26 @@ static void test_shared_handle(void)
static void test_pixel_format(void)
{
- HWND hwnd, hwnd2 = NULL;
- HDC hdc, hdc2 = NULL;
- HMODULE gl = NULL;
int format, test_format;
PIXELFORMATDESCRIPTOR pfd;
IDirect3D9 *d3d9 = NULL;
IDirect3DDevice9 *device = NULL;
+ HWND hwnd, hwnd2;
+ HDC hdc, hdc2;
+ HMODULE gl;
HRESULT hr;
- static const float point[3] = {0.0, 0.0, 0.0};
- hwnd = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 100, 100, 160, 160, NULL, NULL, NULL, NULL);
- if (!hwnd)
- {
- skip("Failed to create window\n");
- return;
- }
+ static const float point[] = {0.0f, 0.0f, 0.0f};
- hwnd2 = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 100, 100, 160, 160, NULL, NULL, NULL, NULL);
+ hwnd = create_window();
+ ok(!!hwnd, "Failed to create window.\n");
+ hwnd2 = create_window();
+ ok(!!hwnd2, "Failed to create window.\n");
hdc = GetDC(hwnd);
- if (!hdc)
- {
- skip("Failed to get DC\n");
- goto cleanup;
- }
-
- if (hwnd2)
- hdc2 = GetDC(hwnd2);
+ ok(!!hdc, "Failed to get DC.\n");
+ hdc2 = GetDC(hwnd2);
+ ok(!!hdc2, "Failed to get DC.\n");
gl = LoadLibraryA("opengl32.dll");
ok(!!gl, "failed to load opengl32.dll; SetPixelFormat()/GetPixelFormat() may not work right\n");
@@ -10462,14 +10398,10 @@ static void test_pixel_format(void)
goto cleanup;
}
- if (!hdc2 || !SetPixelFormat(hdc2, format, &pfd) || GetPixelFormat(hdc2) != format)
+ if (!SetPixelFormat(hdc2, format, &pfd) || GetPixelFormat(hdc2) != format)
{
skip("failed to set pixel format on second window\n");
- if (hdc2)
- {
- ReleaseDC(hwnd2, hdc2);
- hdc2 = NULL;
- }
+ goto cleanup;
}
d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
@@ -10517,17 +10449,14 @@ static void test_pixel_format(void)
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
- if (hdc2)
- {
- hr = IDirect3DDevice9_Present(device, NULL, NULL, hwnd2, NULL);
- ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
+ hr = IDirect3DDevice9_Present(device, NULL, NULL, hwnd2, NULL);
+ ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
- test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ test_format = GetPixelFormat(hdc);
+ ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
- test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
- }
+ test_format = GetPixelFormat(hdc2);
+ ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
cleanup:
if (device)
@@ -10535,12 +10464,13 @@ cleanup:
UINT refcount = IDirect3DDevice9_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
}
- if (d3d9) IDirect3D9_Release(d3d9);
- if (gl) FreeLibrary(gl);
- if (hdc) ReleaseDC(hwnd, hdc);
- if (hdc2) ReleaseDC(hwnd2, hdc2);
- if (hwnd) DestroyWindow(hwnd);
- if (hwnd2) DestroyWindow(hwnd2);
+ if (d3d9)
+ IDirect3D9_Release(d3d9);
+ FreeLibrary(gl);
+ ReleaseDC(hwnd2, hdc2);
+ ReleaseDC(hwnd, hdc);
+ DestroyWindow(hwnd2);
+ DestroyWindow(hwnd);
}
static void test_begin_end_state_block(void)
@@ -10552,8 +10482,7 @@ static void test_begin_end_state_block(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -10610,8 +10539,7 @@ static void test_shader_constant_apply(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -10778,8 +10706,7 @@ static void test_vdecl_apply(void)
D3DDECL_END(),
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -10957,8 +10884,7 @@ static void test_resource_type(void)
HRESULT hr;
D3DCAPS9 caps;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11126,8 +11052,7 @@ static void test_mipmap_lock(void)
HRESULT hr;
D3DLOCKED_RECT locked_rect;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11208,8 +11133,7 @@ static void test_writeonly_resource(void)
{{ 1.0f, 1.0f, 0.0f}}
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11271,8 +11195,7 @@ static void test_lost_device(void)
HRESULT hr;
BOOL ret;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
device_desc.device_window = window;
@@ -11389,8 +11312,7 @@ static void test_resource_priority(void)
unsigned int i;
DWORD priority;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11551,8 +11473,7 @@ static void test_swapchain_parameters(void)
{FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL},
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11836,8 +11757,7 @@ static void test_miptree_layout(void)
{D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH"},
};
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -11953,8 +11873,7 @@ static void test_get_render_target_data(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -12002,8 +11921,7 @@ static void test_render_target_device_mismatch(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -12060,8 +11978,7 @@ static void test_format_unknown(void)
void *iface;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL)))
@@ -12164,8 +12081,7 @@ static void test_lockable_backbuffer(void)
HRESULT hr;
HDC dc;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -12255,8 +12171,7 @@ static void test_clip_planes_limits(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -12338,8 +12253,7 @@ static void test_swapchain_multisample_reset(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -12411,8 +12325,7 @@ static void test_stretch_rect(void)
D3DFMT_R5G6B5,
};
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, NULL, NULL, NULL, NULL);
+ window = create_window();
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
@@ -12567,8 +12480,7 @@ static void test_device_caps(void)
HWND window;
HRESULT hr;
- window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW,
- 0, 0, 640, 480, 0, 0, 0, 0);
+ window = create_window();
d3d = Direct3DCreate9(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n");
--
2.11.0
2
1
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/buffer.c | 2 +-
dlls/d3d11/d3d11_private.h | 2 +-
dlls/d3d11/texture.c | 6 +++---
dlls/d3d11/utils.c | 10 +---------
dlls/d3d8/texture.c | 4 +---
dlls/d3d9/texture.c | 4 +---
dlls/ddraw/surface.c | 3 ---
dlls/dxgi/device.c | 2 --
dlls/wined3d/directx.c | 4 ----
dlls/wined3d/resource.c | 1 -
dlls/wined3d/swapchain.c | 2 --
dlls/wined3d/utils.c | 1 -
include/wine/wined3d.h | 7 +++----
13 files changed, 11 insertions(+), 37 deletions(-)
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c
index fb5b8177516..f2d32ed0a9a 100644
--- a/dlls/d3d11/buffer.c
+++ b/dlls/d3d11/buffer.c
@@ -450,7 +450,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
return E_INVALIDARG;
wined3d_desc.byte_width = buffer->desc.ByteWidth;
- wined3d_desc.usage = wined3d_usage_from_d3d11(0, buffer->desc.Usage);
+ wined3d_desc.usage = wined3d_usage_from_d3d11(buffer->desc.Usage);
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(buffer->desc.BindFlags);
wined3d_desc.access = wined3d_access_from_d3d11(buffer->desc.Usage, buffer->desc.CPUAccessFlags);
wined3d_desc.misc_flags = buffer->desc.MiscFlags;
diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index e3261a57c94..580f520aae9 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -65,7 +65,7 @@ void d3d11_primitive_topology_from_wined3d_primitive_type(enum wined3d_primitive
void wined3d_primitive_type_from_d3d11_primitive_topology(D3D11_PRIMITIVE_TOPOLOGY topology,
enum wined3d_primitive_type *type, unsigned int *patch_vertex_count) DECLSPEC_HIDDEN;
unsigned int wined3d_getdata_flags_from_d3d11_async_getdata_flags(unsigned int d3d11_flags) DECLSPEC_HIDDEN;
-DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage) DECLSPEC_HIDDEN;
+DWORD wined3d_usage_from_d3d11(enum D3D11_USAGE usage) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *resource) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN;
DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type) DECLSPEC_HIDDEN;
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index 9df8bae00c8..78821955604 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -456,7 +456,7 @@ HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DE
wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = 0;
- wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage);
+ wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
@@ -1010,7 +1010,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
wined3d_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = desc->SampleDesc.Quality;
- wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage);
+ wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
@@ -1469,7 +1469,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format);
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
wined3d_desc.multisample_quality = 0;
- wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage);
+ wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
index 1a619717587..cf40cc47eff 100644
--- a/dlls/d3d11/utils.c
+++ b/dlls/d3d11/utils.c
@@ -441,18 +441,10 @@ unsigned int wined3d_getdata_flags_from_d3d11_async_getdata_flags(unsigned int d
return WINED3DGETDATA_FLUSH;
}
-DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage)
+DWORD wined3d_usage_from_d3d11(enum D3D11_USAGE usage)
{
- static const DWORD handled = D3D11_BIND_SHADER_RESOURCE
- | D3D11_BIND_RENDER_TARGET
- | D3D11_BIND_DEPTH_STENCIL;
DWORD wined3d_usage = 0;
- if (bind_flags & D3D11_BIND_SHADER_RESOURCE)
- wined3d_usage |= WINED3DUSAGE_TEXTURE;
- if (bind_flags & ~handled)
- FIXME("Unhandled bind flags %#x.\n", bind_flags & ~handled);
-
if (usage == D3D11_USAGE_DYNAMIC)
wined3d_usage |= WINED3DUSAGE_DYNAMIC;
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index c952579ce61..1c144a14dae 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -1107,7 +1107,6 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device,
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = usage & WINED3DUSAGE_MASK;
- desc.usage |= WINED3DUSAGE_TEXTURE;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d8_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
@@ -1156,7 +1155,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = usage & WINED3DUSAGE_MASK;
- desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE;
+ desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d8_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
@@ -1204,7 +1203,6 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = usage & WINED3DUSAGE_MASK;
- desc.usage |= WINED3DUSAGE_TEXTURE;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d8_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c
index 70d35fc50c1..5cb0b3967df 100644
--- a/dlls/d3d9/texture.c
+++ b/dlls/d3d9/texture.c
@@ -1311,7 +1311,6 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device,
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = wined3dusage_from_d3dusage(usage);
- desc.usage |= WINED3DUSAGE_TEXTURE;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d9_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
@@ -1398,7 +1397,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = wined3dusage_from_d3dusage(usage);
- desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP | WINED3DUSAGE_TEXTURE;
+ desc.usage |= WINED3DUSAGE_LEGACY_CUBEMAP;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d9_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
@@ -1470,7 +1469,6 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev
desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
desc.multisample_quality = 0;
desc.usage = wined3dusage_from_d3dusage(usage);
- desc.usage |= WINED3DUSAGE_TEXTURE;
if (pool == D3DPOOL_SCRATCH)
desc.usage |= WINED3DUSAGE_SCRATCH;
desc.bind_flags = wined3d_bind_flags_from_d3d9_usage(usage) | WINED3D_BIND_SHADER_RESOURCE;
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index fb0cc85e7b0..7c13cbfa39c 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6170,10 +6170,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
if (!(ddraw->flags & DDRAW_NO3D))
{
if (desc->ddsCaps.dwCaps & DDSCAPS_TEXTURE)
- {
- wined3d_desc.usage |= WINED3DUSAGE_TEXTURE;
wined3d_desc.bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
- }
if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
wined3d_desc.bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c
index 9b57b46d1c7..c7481c6b6ef 100644
--- a/dlls/dxgi/device.c
+++ b/dlls/dxgi/device.c
@@ -188,8 +188,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
&surface_desc.multisample_quality, &desc->SampleDesc);
surface_desc.bind_flags = wined3d_bind_flags_from_dxgi_usage(usage);
surface_desc.usage = 0;
- if (surface_desc.bind_flags & WINED3D_BIND_SHADER_RESOURCE)
- surface_desc.usage |= WINED3DUSAGE_TEXTURE;
surface_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
surface_desc.width = desc->Width;
surface_desc.height = desc->Height;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index dab10cbf116..4a135860dcf 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1541,10 +1541,6 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
adapter_format = wined3d_get_format(adapter, adapter_format_id, WINED3D_BIND_RENDER_TARGET);
format = wined3d_get_format(adapter, check_format_id, bind_flags);
- if (usage & WINED3DUSAGE_TEXTURE)
- bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
- usage &= ~WINED3DUSAGE_TEXTURE;
-
switch (resource_type)
{
case WINED3D_RTYPE_NONE:
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 61143556e73..05fbafbfb35 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -37,7 +37,6 @@ static void resource_check_usage(DWORD usage)
| WINED3DUSAGE_SCRATCH
| WINED3DUSAGE_PRIVATE
| WINED3DUSAGE_LEGACY_CUBEMAP
- | WINED3DUSAGE_TEXTURE
| ~WINED3DUSAGE_MASK;
/* WINED3DUSAGE_WRITEONLY is supposed to result in write-combined mappings
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index ba7c817adf5..f6963c4aba2 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -921,8 +921,6 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
texture_desc.usage = 0;
if (device->wined3d->flags & WINED3D_NO3D)
texture_desc.usage |= WINED3DUSAGE_OWNDC;
- if (texture_desc.bind_flags & WINED3D_BIND_SHADER_RESOURCE)
- texture_desc.usage |= WINED3DUSAGE_TEXTURE;
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
{
TRACE("Creating back buffer %u.\n", i);
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4e5d36c7bd6..1fd3f321283 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4524,7 +4524,6 @@ const char *debug_d3dusage(DWORD usage)
WINED3DUSAGE_TO_STR(WINED3DUSAGE_DMAP);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_TEXTAPI);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_LEGACY_CUBEMAP);
- WINED3DUSAGE_TO_STR(WINED3DUSAGE_TEXTURE);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_OWNDC);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_STATICDECL);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_OVERLAY);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 0d98dfae890..70b27bb3d3a 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -928,10 +928,9 @@ enum wined3d_shader_type
#define WINED3DUSAGE_TEXTAPI 0x10000000
#define WINED3DUSAGE_MASK 0x10007bf8
-#define WINED3DUSAGE_SCRATCH 0x00200000
-#define WINED3DUSAGE_PRIVATE 0x00400000
-#define WINED3DUSAGE_LEGACY_CUBEMAP 0x00800000
-#define WINED3DUSAGE_TEXTURE 0x01000000
+#define WINED3DUSAGE_SCRATCH 0x00400000
+#define WINED3DUSAGE_PRIVATE 0x00800000
+#define WINED3DUSAGE_LEGACY_CUBEMAP 0x01000000
#define WINED3DUSAGE_OWNDC 0x02000000
#define WINED3DUSAGE_STATICDECL 0x04000000
#define WINED3DUSAGE_OVERLAY 0x08000000
--
2.11.0
1
0
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/utils.c | 2 --
dlls/ddraw/surface.c | 5 -----
dlls/wined3d/device.c | 2 +-
dlls/wined3d/directx.c | 4 +---
dlls/wined3d/resource.c | 3 +--
dlls/wined3d/swapchain.c | 2 +-
dlls/wined3d/utils.c | 1 -
include/wine/wined3d.h | 3 +--
8 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
index 2a1a8c699e5..1a619717587 100644
--- a/dlls/d3d11/utils.c
+++ b/dlls/d3d11/utils.c
@@ -450,8 +450,6 @@ DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage)
if (bind_flags & D3D11_BIND_SHADER_RESOURCE)
wined3d_usage |= WINED3DUSAGE_TEXTURE;
- if (bind_flags & D3D11_BIND_DEPTH_STENCIL)
- wined3d_usage |= WINED3DUSAGE_DEPTHSTENCIL;
if (bind_flags & ~handled)
FIXME("Unhandled bind flags %#x.\n", bind_flags & ~handled);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 6bb92d5d399..fb0cc85e7b0 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -6175,14 +6175,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
wined3d_desc.bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
}
if (desc->ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
- {
- wined3d_desc.usage |= WINED3DUSAGE_DEPTHSTENCIL;
wined3d_desc.bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
- }
else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
- {
wined3d_desc.bind_flags |= WINED3D_BIND_RENDER_TARGET;
- }
}
if (desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 1af76f235c8..893ce55c9aa 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4898,7 +4898,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
texture_desc.format = swapchain->desc.auto_depth_stencil_format;
texture_desc.multisample_type = swapchain->desc.multisample_type;
texture_desc.multisample_quality = swapchain->desc.multisample_quality;
- texture_desc.usage = WINED3DUSAGE_DEPTHSTENCIL;
+ texture_desc.usage = 0;
texture_desc.bind_flags = WINED3D_BIND_DEPTH_STENCIL;
texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
texture_desc.width = swapchain->desc.backbuffer_width;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index a79e9247267..dab10cbf116 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1541,11 +1541,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
adapter_format = wined3d_get_format(adapter, adapter_format_id, WINED3D_BIND_RENDER_TARGET);
format = wined3d_get_format(adapter, check_format_id, bind_flags);
- if (usage & WINED3DUSAGE_DEPTHSTENCIL)
- bind_flags |= WINED3D_BIND_DEPTH_STENCIL;
if (usage & WINED3DUSAGE_TEXTURE)
bind_flags |= WINED3D_BIND_SHADER_RESOURCE;
- usage &= ~(WINED3DUSAGE_DEPTHSTENCIL | WINED3DUSAGE_TEXTURE);
+ usage &= ~WINED3DUSAGE_TEXTURE;
switch (resource_type)
{
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 58caccc7305..61143556e73 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -30,8 +30,7 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
static void resource_check_usage(DWORD usage)
{
- static const DWORD handled = WINED3DUSAGE_DEPTHSTENCIL
- | WINED3DUSAGE_WRITEONLY
+ static const DWORD handled = WINED3DUSAGE_WRITEONLY
| WINED3DUSAGE_DYNAMIC
| WINED3DUSAGE_STATICDECL
| WINED3DUSAGE_OVERLAY
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 36e7b2e8318..ba7c817adf5 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -947,7 +947,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
struct wined3d_texture *ds;
texture_desc.format = swapchain->desc.auto_depth_stencil_format;
- texture_desc.usage = WINED3DUSAGE_DEPTHSTENCIL;
+ texture_desc.usage = 0;
texture_desc.bind_flags = WINED3D_BIND_DEPTH_STENCIL;
if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent,
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index a7b1b10f9ac..4e5d36c7bd6 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4511,7 +4511,6 @@ const char *debug_d3dusage(DWORD usage)
init_debug_buffer(&buffer, "0");
#define WINED3DUSAGE_TO_STR(x) if (usage & x) { debug_append(&buffer, #x, " | "); usage &= ~x; }
- WINED3DUSAGE_TO_STR(WINED3DUSAGE_DEPTHSTENCIL);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_WRITEONLY);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_SOFTWAREPROCESSING);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_DONOTCLIP);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index fd907578c2d..0d98dfae890 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -914,7 +914,6 @@ enum wined3d_shader_type
#define WINED3D_BIND_DEPTH_STENCIL 0x00000040
#define WINED3D_BIND_UNORDERED_ACCESS 0x00000080
-#define WINED3DUSAGE_DEPTHSTENCIL 0x00000002
#define WINED3DUSAGE_WRITEONLY 0x00000008
#define WINED3DUSAGE_SOFTWAREPROCESSING 0x00000010
#define WINED3DUSAGE_DONOTCLIP 0x00000020
@@ -927,7 +926,7 @@ enum wined3d_shader_type
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE 0x00002000
#define WINED3DUSAGE_DMAP 0x00004000
#define WINED3DUSAGE_TEXTAPI 0x10000000
-#define WINED3DUSAGE_MASK 0x10007bfa
+#define WINED3DUSAGE_MASK 0x10007bf8
#define WINED3DUSAGE_SCRATCH 0x00200000
#define WINED3DUSAGE_PRIVATE 0x00400000
--
2.11.0
1
0
[PATCH] advapi32: Return error from RegCreateKeyEx[AW] if the key name is null
by Alex Henrie 06 Nov '18
by Alex Henrie 06 Nov '18
06 Nov '18
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
Fixes Coverity #731771
---
dlls/advapi32/registry.c | 4 +++-
dlls/advapi32/tests/registry.c | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 9989097ff4..0601e43d3c 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -371,6 +371,7 @@ LSTATUS WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR
UNICODE_STRING nameW, classW;
if (reserved) return ERROR_INVALID_PARAMETER;
+ if (!name) return ERROR_BADKEY;
if (!(hkey = get_special_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
attr.Length = sizeof(attr);
@@ -420,10 +421,11 @@ LSTATUS WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR cl
NTSTATUS status;
if (reserved) return ERROR_INVALID_PARAMETER;
+ if (!name) return ERROR_BADKEY;
if (!is_version_nt())
{
access = MAXIMUM_ALLOWED; /* Win95 ignores the access mask */
- if (name && *name == '\\') name++; /* win9x,ME ignores one (and only one) beginning backslash */
+ if (name[0] == '\\') name++; /* win9x,ME ignores one (and only one) beginning backslash */
}
if (!(hkey = get_special_root_hkey( hkey, access ))) return ERROR_INVALID_HANDLE;
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 6043cab184..21698220aa 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -1297,6 +1297,15 @@ static void test_reg_create_key(void)
PACL key_acl;
SECURITY_DESCRIPTOR *sd;
+ ret = RegCreateKeyExA(INVALID_HANDLE_VALUE, NULL, 1, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_INVALID_PARAMETER, "RegCreateKeyExA returned %d\n", ret);
+
+ ret = RegCreateKeyExA(INVALID_HANDLE_VALUE, NULL, 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_BADKEY, "RegCreateKeyExA returned %d\n", ret);
+
+ ret = RegCreateKeyExA(INVALID_HANDLE_VALUE, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_INVALID_HANDLE, "RegCreateKeyExA returned %d\n", ret);
+
ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
ok(!ret, "RegCreateKeyExA failed with error %d\n", ret);
/* should succeed: all versions of Windows ignore the access rights
--
2.19.1
2
2
Signed-off-by: Austin English <austinenglish(a)gmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 15 +++++++++++++++
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 1 +
2 files changed, 16 insertions(+)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 9fbf22d71f..00d93a21bd 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -3991,13 +3991,28 @@ void WINAPI IoReleaseRemoveLockAndWaitEx(PIO_REMOVE_LOCK lock, PVOID tag, ULONG
FIXME("stub: %p %p %u\n", lock, tag, size);
}
+/*********************************************************************
+ * DbgQueryDebugFilterState (NTOSKRNL.@)
+ */
NTSTATUS WINAPI DbgQueryDebugFilterState(ULONG component, ULONG level)
{
FIXME("stub: %d %d\n", component, level);
return STATUS_NOT_IMPLEMENTED;
}
+/*********************************************************************
+ * ExReleaseResourceLite (NTOSKRNL.@)
+ */
void WINAPI ExReleaseResourceLite(PERESOURCE resource)
{
FIXME("stub: %p\n", resource);
}
+
+/*********************************************************************
+ * PsGetProcessWow64Process (NTOSKRNL.@)
+ */
+PVOID WINAPI PsGetProcessWow64Process(PEPROCESS process)
+{
+ FIXME("stub: %p\n", process);
+ return NULL;
+}
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index 422d575926..18b76c2c84 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -886,6 +886,7 @@
@ stub PsGetProcessSessionId
@ stub PsGetProcessWin32Process
@ stub PsGetProcessWin32WindowStation
+@ stdcall -arch=x86_64 PsGetProcessWow64Process(ptr)
@ stub PsGetThreadFreezeCount
@ stub PsGetThreadHardErrorsAreDisabled
@ stub PsGetThreadId
--
2.16.4
1
1
Debug symbols (like PDB, ...) could not be found if the direcory of
the module and application differs. Applying this patch they will
be found.
Dbghelp searches the module path too. (See MS docs).
Signed-off-by: Andreas Maier <andy1.m(a)gmx.de>
---
dlls/dbghelp/dbghelp_private.h | 6 +++---
dlls/dbghelp/msc.c | 4 ++--
dlls/dbghelp/path.c | 34 +++++++++++++++++++++++++++++++---
dlls/dbghelp/pe_module.c | 2 +-
4 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index f689db8919..1308d63f7a 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -657,9 +657,9 @@ extern BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
union ctx *context, struct pdb_cmd_pair *cpair) DECLSPEC_HIDDEN;
/* path.c */
-extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
- const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
- BOOL* is_unmatched) DECLSPEC_HIDDEN;
+extern BOOL path_find_symbol_file(const struct process* pcs, const struct module* module,
+ PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2,
+ PSTR buffer, BOOL* is_unmatched) DECLSPEC_HIDDEN;
/* pe_module.c */
extern BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth) DECLSPEC_HIDDEN;
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index 0508e120bd..6003bc3401 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -2450,11 +2450,11 @@ static HANDLE map_pdb_file(const struct process* pcs,
switch (lookup->kind)
{
case PDB_JG:
- ret = path_find_symbol_file(pcs, lookup->filename, NULL, lookup->timestamp,
+ ret = path_find_symbol_file(pcs, module, lookup->filename, NULL, lookup->timestamp,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
case PDB_DS:
- ret = path_find_symbol_file(pcs, lookup->filename, &lookup->guid, 0,
+ ret = path_find_symbol_file(pcs, module, lookup->filename, &lookup->guid, 0,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
}
diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c
index 8c74426eec..2e4d98233f 100644
--- a/dlls/dbghelp/path.c
+++ b/dlls/dbghelp/path.c
@@ -49,6 +49,17 @@ static inline const WCHAR* file_nameW(const WCHAR* str)
return p + 1;
}
+static inline void file_pathW(const WCHAR* srcFileNameW,
+ WCHAR* dstFilePathW)
+{
+ int len;
+
+ for (len = strlenW(srcFileNameW) - 1; (len > 0) && (!is_sepW(srcFileNameW[len])); len--);
+
+ lstrcpynW(dstFilePathW, srcFileNameW, len);
+ dstFilePathW[len] = L'\0';
+}
+
/******************************************************************
* FindDebugInfoFile (DBGHELP.@)
*
@@ -612,9 +623,9 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
return mf->matched == 2;
}
-BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
- const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
- BOOL* is_unmatched)
+BOOL path_find_symbol_file(const struct process* pcs, const struct module* module,
+ PCSTR full_path, const GUID* guid, DWORD dw1, DWORD dw2,
+ PSTR buffer, BOOL* is_unmatched)
{
struct module_find mf;
WCHAR full_pathW[MAX_PATH];
@@ -643,6 +654,23 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
return TRUE;
}
+ /* FIXME: Use Environment-Variables (see MS docs)
+ _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH
+ FIXME: Implement "Standard Path Elements" (Path) ... (see MS docs)
+ do a search for (every?) path-element like this ...
+ <path>
+ <path>\dll
+ <path>\symbols\dll
+ (dll may be exe, or sys depending on the file extension) */
+
+ /* 2. check module-path */
+ file_pathW(module->module.LoadedImageName, tmp);
+ if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf))
+ {
+ WideCharToMultiByte(CP_ACP, 0, tmp, -1, buffer, MAX_PATH, NULL, NULL);
+ return TRUE;
+ }
+
while (searchPath)
{
ptr = strchrW(searchPath, ';');
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index e7255f89ba..ea2a8262d2 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -531,7 +531,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
- if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
+ if (path_find_symbol_file(pcs, module, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
(hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE &&
((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&
--
2.11.0
1
0