From efbd38ae84085142b7f7f8f93fa091897d3b674f Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 7 Dec 2009 20:20:03 +0100 Subject: [PATCH] dxgi: The "unknown0" parameter to DXGID3D10CreateDevice() is a pointer. Fixes stack corruption in the 64-bit tests. Thanks to Paul Vriens for debugging this. --- dlls/d3d10/d3d10_main.c | 2 +- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10core/d3d10core.spec | 2 +- dlls/d3d10core/d3d10core_main.c | 4 ++-- dlls/d3d10core/d3d10core_private.h | 2 +- dlls/d3d10core/tests/device.c | 6 +++--- dlls/dxgi/dxgi.spec | 2 +- dlls/dxgi/dxgi_main.c | 4 ++-- dlls/dxgi/tests/device.c | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 10bf5335606..65ce1e07d5f 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -124,7 +124,7 @@ HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver } } - hr = D3D10CoreCreateDevice(factory, adapter, flags, 0, device); + hr = D3D10CoreCreateDevice(factory, adapter, flags, NULL, device); IDXGIAdapter_Release(adapter); IDXGIFactory_Release(factory); if (FAILED(hr)) diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index f07711559b9..5bf59b1c463 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -179,6 +179,6 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T d /* D3D10Core */ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, DWORD unknown0, ID3D10Device **device); + UINT flags, void *unknown0, ID3D10Device **device); #endif /* __WINE_D3D10_PRIVATE_H */ diff --git a/dlls/d3d10core/d3d10core.spec b/dlls/d3d10core/d3d10core.spec index 9bf25b5c7f4..65698881c92 100644 --- a/dlls/d3d10core/d3d10core.spec +++ b/dlls/d3d10core/d3d10core.spec @@ -1,2 +1,2 @@ -@ stdcall D3D10CoreCreateDevice(ptr ptr long long ptr) +@ stdcall D3D10CoreCreateDevice(ptr ptr long ptr ptr) @ stdcall D3D10CoreRegisterLayers() diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 4151dd05336..9d0c5d7e020 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -102,13 +102,13 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void) } HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, DWORD unknown0, ID3D10Device **device) + UINT flags, void *unknown0, ID3D10Device **device) { IUnknown *dxgi_device; HMODULE d3d10core; HRESULT hr; - TRACE("factory %p, adapter %p, flags %#x, unknown0 %#x, device %p\n", + TRACE("factory %p, adapter %p, flags %#x, unknown0 %p, device %p.\n", factory, adapter, flags, unknown0, device); d3d10core = GetModuleHandleA("d3d10core.dll"); diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index 35d5ed3e256..cc3029fe642 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -257,7 +257,7 @@ struct dxgi_device_layer }; HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, DWORD unknown0, void **device); + UINT flags, void *unknown0, void **device); HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, UINT layer_count); #endif /* __WINE_D3D10CORE_PRIVATE_H */ diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index fb166ec45bb..122a1543451 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -22,7 +22,7 @@ #include "wine/test.h" HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, DWORD unknown0, ID3D10Device **device); + UINT flags, void *unknown0, ID3D10Device **device); static ID3D10Device *create_device(void) { @@ -38,7 +38,7 @@ static ID3D10Device *create_device(void) ok(SUCCEEDED(hr), "EnumAdapters failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; - hr = D3D10CoreCreateDevice(factory, adapter, 0, 0, &device); + hr = D3D10CoreCreateDevice(factory, adapter, 0, NULL, &device); if (FAILED(hr)) { HMODULE d3d10ref; @@ -59,7 +59,7 @@ static ID3D10Device *create_device(void) ok(SUCCEEDED(hr), "CreateSoftwareAdapter failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; - hr = D3D10CoreCreateDevice(factory, adapter, 0, 0, &device); + hr = D3D10CoreCreateDevice(factory, adapter, 0, NULL, &device); ok(SUCCEEDED(hr), "Failed to create a REF device, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; } diff --git a/dlls/dxgi/dxgi.spec b/dlls/dxgi/dxgi.spec index d7f8aba61d9..853d8e28d13 100644 --- a/dlls/dxgi/dxgi.spec +++ b/dlls/dxgi/dxgi.spec @@ -1,3 +1,3 @@ @ stdcall CreateDXGIFactory(ptr ptr) -@ stdcall DXGID3D10CreateDevice(ptr ptr ptr long long ptr) +@ stdcall DXGID3D10CreateDevice(ptr ptr ptr long ptr ptr) @ stdcall DXGID3D10RegisterLayers(ptr long) diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index 489f9862320..312b3b79ebb 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -224,7 +224,7 @@ static HRESULT register_d3d10core_layers(HMODULE d3d10core) } HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, DWORD unknown0, void **device) + UINT flags, void *unknown0, void **device) { struct layer_get_size_args get_size_args; struct dxgi_device *dxgi_device; @@ -233,7 +233,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I DWORD count; HRESULT hr; - TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, unknown0 %#x, device %p\n", + TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, unknown0 %p, device %p.\n", d3d10core, factory, adapter, flags, unknown0, device); hr = register_d3d10core_layers(d3d10core); diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c index 2391c1b67ec..d4ca50b28aa 100644 --- a/dlls/dxgi/tests/device.c +++ b/dlls/dxgi/tests/device.c @@ -22,7 +22,7 @@ #include "wine/test.h" HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, - IDXGIAdapter *adapter, UINT flags, DWORD arg5, void **device); + IDXGIAdapter *adapter, UINT flags, void *unknown0, void **device); static IDXGIDevice *create_device(HMODULE d3d10core) { @@ -39,7 +39,7 @@ static IDXGIDevice *create_device(HMODULE d3d10core) ok(SUCCEEDED(hr), "EnumAdapters failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; - hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, 0, (void **)&device); + hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, NULL, (void **)&device); if (FAILED(hr)) { HMODULE d3d10ref; @@ -60,7 +60,7 @@ static IDXGIDevice *create_device(HMODULE d3d10core) ok(SUCCEEDED(hr), "CreateSoftwareAdapter failed, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; - hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, 0, (void **)&device); + hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, NULL, (void **)&device); ok(SUCCEEDED(hr), "Failed to create a REF device, hr %#x\n", hr); if (FAILED(hr)) goto cleanup; }