Rebase against 7d3c068c3beeac8691cfa96f0dce6b5583072eaa.

This commit is contained in:
Sebastian Lackner 2017-07-22 01:14:10 +02:00
parent 5ec57827af
commit 62ae507b36
5 changed files with 18 additions and 283 deletions

View File

@ -1,219 +0,0 @@
From 994798c0649cf8c66d5c97a2217e36f0d12ea96f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 9 Jul 2017 18:30:26 +0200
Subject: d3d11: Prevent race condition when creating samplers.
---
dlls/d3d11/device.c | 32 ++++++++++++++++++++++++--------
dlls/d3d11/state.c | 18 ++++--------------
2 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index cf45233dc82..66d566cfecb 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -5451,12 +5451,16 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device *ifa
return S_OK;
}
- wined3d_mutex_unlock();
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ {
+ wined3d_mutex_unlock();
return E_OUTOFMEMORY;
+ }
- if (FAILED(hr = d3d_blend_state_init(object, device, &tmp_desc)))
+ hr = d3d_blend_state_init(object, device, &tmp_desc);
+ wined3d_mutex_unlock();
+ if (FAILED(hr))
{
WARN("Failed to initialize blend state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
@@ -5531,12 +5535,16 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Devi
return S_OK;
}
- wined3d_mutex_unlock();
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ {
+ wined3d_mutex_unlock();
return E_OUTOFMEMORY;
+ }
- if (FAILED(hr = d3d_depthstencil_state_init(object, device, &tmp_desc)))
+ hr = d3d_depthstencil_state_init(object, device, &tmp_desc);
+ wined3d_mutex_unlock();
+ if (FAILED(hr))
{
WARN("Failed to initialize depthstencil state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
@@ -5574,12 +5582,16 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device
return S_OK;
}
- wined3d_mutex_unlock();
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ {
+ wined3d_mutex_unlock();
return E_OUTOFMEMORY;
+ }
- if (FAILED(hr = d3d_rasterizer_state_init(object, device, desc)))
+ hr = d3d_rasterizer_state_init(object, device, desc);
+ wined3d_mutex_unlock();
+ if (FAILED(hr))
{
WARN("Failed to initialize rasterizer state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
@@ -5628,12 +5640,16 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device *i
return S_OK;
}
- wined3d_mutex_unlock();
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ {
+ wined3d_mutex_unlock();
return E_OUTOFMEMORY;
+ }
- if (FAILED(hr = d3d_sampler_state_init(object, device, &normalized_desc)))
+ hr = d3d_sampler_state_init(object, device, &normalized_desc);
+ wined3d_mutex_unlock();
+ if (FAILED(hr))
{
WARN("Failed to initialize sampler state, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
index 43dd10ffa7f..9c377c1a27b 100644
--- a/dlls/d3d11/state.c
+++ b/dlls/d3d11/state.c
@@ -283,13 +283,13 @@ static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl =
d3d10_blend_state_GetDesc1,
};
+/* requires wined3d lock */
HRESULT d3d_blend_state_init(struct d3d_blend_state *state, struct d3d_device *device,
const D3D11_BLEND_DESC *desc)
{
state->ID3D11BlendState_iface.lpVtbl = &d3d11_blend_state_vtbl;
state->ID3D10BlendState1_iface.lpVtbl = &d3d10_blend_state_vtbl;
state->refcount = 1;
- wined3d_mutex_lock();
wined3d_private_store_init(&state->private_store);
state->desc = *desc;
@@ -297,10 +297,8 @@ HRESULT d3d_blend_state_init(struct d3d_blend_state *state, struct d3d_device *d
{
ERR("Failed to insert blend state entry.\n");
wined3d_private_store_cleanup(&state->private_store);
- wined3d_mutex_unlock();
return E_FAIL;
}
- wined3d_mutex_unlock();
state->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(state->device);
@@ -562,13 +560,13 @@ static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl =
d3d10_depthstencil_state_GetDesc,
};
+/* requires wined3d lock */
HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, struct d3d_device *device,
const D3D11_DEPTH_STENCIL_DESC *desc)
{
state->ID3D11DepthStencilState_iface.lpVtbl = &d3d11_depthstencil_state_vtbl;
state->ID3D10DepthStencilState_iface.lpVtbl = &d3d10_depthstencil_state_vtbl;
state->refcount = 1;
- wined3d_mutex_lock();
wined3d_private_store_init(&state->private_store);
state->desc = *desc;
@@ -576,10 +574,8 @@ HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, struct
{
ERR("Failed to insert depthstencil state entry.\n");
wined3d_private_store_cleanup(&state->private_store);
- wined3d_mutex_unlock();
return E_FAIL;
}
- wined3d_mutex_unlock();
state->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(state->device);
@@ -869,6 +865,7 @@ static const struct wined3d_parent_ops d3d_rasterizer_state_wined3d_parent_ops =
d3d_rasterizer_state_wined3d_object_destroyed,
};
+/* requires wined3d lock */
HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d_device *device,
const D3D11_RASTERIZER_DESC *desc)
{
@@ -878,7 +875,6 @@ HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d
state->ID3D11RasterizerState_iface.lpVtbl = &d3d11_rasterizer_state_vtbl;
state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl;
state->refcount = 1;
- wined3d_mutex_lock();
wined3d_private_store_init(&state->private_store);
state->desc = *desc;
@@ -886,7 +882,6 @@ HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d
{
ERR("Failed to insert rasterizer state entry.\n");
wined3d_private_store_cleanup(&state->private_store);
- wined3d_mutex_unlock();
return E_FAIL;
}
@@ -900,10 +895,8 @@ HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d
WARN("Failed to create wined3d rasterizer state, hr %#x.\n", hr);
wined3d_private_store_cleanup(&state->private_store);
wine_rb_remove(&device->rasterizer_states, &state->entry);
- wined3d_mutex_unlock();
return hr;
}
- wined3d_mutex_unlock();
ID3D11Device_AddRef(state->device = &device->ID3D11Device_iface);
@@ -1228,6 +1221,7 @@ static enum wined3d_cmp_func wined3d_cmp_func_from_d3d11(D3D11_COMPARISON_FUNC f
return (enum wined3d_cmp_func)f;
}
+/* requires wined3d lock */
HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device,
const D3D11_SAMPLER_DESC *desc)
{
@@ -1237,7 +1231,6 @@ HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_devic
state->ID3D11SamplerState_iface.lpVtbl = &d3d11_sampler_state_vtbl;
state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
state->refcount = 1;
- wined3d_mutex_lock();
wined3d_private_store_init(&state->private_store);
state->desc = *desc;
@@ -1261,7 +1254,6 @@ HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_devic
{
ERR("Failed to insert sampler state entry.\n");
wined3d_private_store_cleanup(&state->private_store);
- wined3d_mutex_unlock();
return E_FAIL;
}
@@ -1273,10 +1265,8 @@ HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_devic
WARN("Failed to create wined3d sampler, hr %#x.\n", hr);
wined3d_private_store_cleanup(&state->private_store);
wine_rb_remove(&device->sampler_states, &state->entry);
- wined3d_mutex_unlock();
return hr;
}
- wined3d_mutex_unlock();
state->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(state->device);
--
2.13.1

View File

@ -1 +0,0 @@
Fixes: Fix race condition in d3d11 state_init functions

View File

@ -1,27 +0,0 @@
From fd6e6fe5c429fb1210e9ef55da0870495d066ca6 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Wed, 16 Sep 2015 13:49:46 -0600
Subject: msi: Return an error when MsiDatabaseImport is passed an invalid
pathname.
Signed-off-by: Erich E. Hoover <erich.e.hoover@wine-staging.com>
---
dlls/msi/database.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index 32e5a63..e28cf1c 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -780,6 +780,8 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
lstrcatW( path, file );
data = msi_read_text_archive( path, &len );
+ if (data == NULL)
+ return ERROR_BAD_PATHNAME;
ptr = data;
msi_parse_line( &ptr, &columns, &num_columns, &len );
--
2.5.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "addd8e69ff09e8620aa3c9c2120d2161df478ac2"
echo "7d3c068c3beeac8691cfa96f0dce6b5583072eaa"
}
# Show version information
@ -117,7 +117,6 @@ patch_enable_all ()
enable_d3d11_ID3D11Texture1D="$1"
enable_d3d11_ResolveSubresource="$1"
enable_d3d11_Silence_FIXMEs="$1"
enable_d3d11_State_Init="$1"
enable_d3d8_ValidateShader="$1"
enable_d3d9_DesktopWindow="$1"
enable_d3d9_Tests="$1"
@ -610,9 +609,6 @@ patch_enable ()
d3d11-Silence_FIXMEs)
enable_d3d11_Silence_FIXMEs="$2"
;;
d3d11-State_Init)
enable_d3d11_State_Init="$2"
;;
d3d8-ValidateShader)
enable_d3d8_ValidateShader="$2"
;;
@ -3665,18 +3661,6 @@ if test "$enable_d3d11_Silence_FIXMEs" -eq 1; then
) >> "$patchlist"
fi
# Patchset d3d11-State_Init
# |
# | Modified files:
# | * dlls/d3d11/device.c, dlls/d3d11/state.c
# |
if test "$enable_d3d11_State_Init" -eq 1; then
patch_apply d3d11-State_Init/0001-d3d11-Prevent-race-condition-when-creating-samplers.patch
(
printf '%s\n' '+ { "Michael Müller", "d3d11: Prevent race condition when creating samplers.", 1 },';
) >> "$patchlist"
fi
# Patchset d3d8-ValidateShader
# |
# | This patchset fixes the following Wine bugs:
@ -5559,7 +5543,6 @@ fi
# |
if test "$enable_msidb_Implementation" -eq 1; then
patch_apply msidb-Implementation/0001-msidb-Add-stub-tool-for-manipulating-MSI-databases.patch
patch_apply msidb-Implementation/0002-msi-Return-an-error-when-MsiDatabaseImport-is-passed.patch
patch_apply msidb-Implementation/0003-msidb-Add-support-for-importing-database-tables.patch
patch_apply msidb-Implementation/0004-msidb-Add-support-for-adding-stream-cabinet-files-to.patch
patch_apply msidb-Implementation/0005-msi-Add-support-for-deleting-streams-from-an-MSI-dat.patch
@ -5573,7 +5556,6 @@ if test "$enable_msidb_Implementation" -eq 1; then
patch_apply msidb-Implementation/0013-msidb-Add-support-for-wildcard-full-database-export.patch
(
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add stub tool for manipulating MSI databases.", 1 },';
printf '%s\n' '+ { "Erich E. Hoover", "msi: Return an error when MsiDatabaseImport is passed an invalid pathname.", 1 },';
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for importing database tables.", 1 },';
printf '%s\n' '+ { "Erich E. Hoover", "msidb: Add support for adding stream/cabinet files to MSI databases.", 1 },';
printf '%s\n' '+ { "Erich E. Hoover", "msi: Add support for deleting streams from an MSI database.", 1 },';

View File

@ -1,4 +1,4 @@
From 1fee677cce6255628039d2e6b9e9fc12e57b998c Mon Sep 17 00:00:00 2001
From a6a51cbacb0ebe2f387b04824ece1048611becc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= <nerv@dawncrow.de>
Date: Tue, 26 Aug 2014 00:59:37 +0200
Subject: wpcap: Load libpcap dynamically.
@ -28,7 +28,7 @@ index 1e6bba3..f0a3b55 100644
[enable_wpcap])
diff --git a/dlls/wpcap/Makefile.in b/dlls/wpcap/Makefile.in
index 91b4a95..aeef71a 100644
index 91b4a955911..aeef71a46e5 100644
--- a/dlls/wpcap/Makefile.in
+++ b/dlls/wpcap/Makefile.in
@@ -1,6 +1,5 @@
@ -39,7 +39,7 @@ index 91b4a95..aeef71a 100644
C_SRCS = \
wpcap.c
diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c
index 697e5fc..51e976b 100644
index d731d8494f2..94d5479305c 100644
--- a/dlls/wpcap/wpcap.c
+++ b/dlls/wpcap/wpcap.c
@@ -18,6 +18,9 @@
@ -50,9 +50,9 @@ index 697e5fc..51e976b 100644
+#include "wine/port.h"
+#include "wine/library.h"
#include <pcap/pcap.h>
#include "winsock2.h"
#include "windef.h"
@@ -40,47 +43,128 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
/* pcap.h might define those: */
@@ -45,47 +48,128 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
#define PCAP_SRC_IFLOCAL 3
#endif
@ -188,7 +188,7 @@ index 697e5fc..51e976b 100644
}
typedef struct
@@ -109,10 +193,10 @@ int CDECL wine_pcap_dispatch(pcap_t *p, int cnt,
@@ -114,10 +198,10 @@ int CDECL wine_pcap_dispatch(pcap_t *p, int cnt,
PCAP_HANDLER_CALLBACK pcb;
pcb.pfn_cb = callback;
pcb.user_data = user;
@ -201,7 +201,7 @@ index 697e5fc..51e976b 100644
}
int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
@@ -120,7 +204,7 @@ int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
@@ -125,7 +209,7 @@ int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
int ret;
TRACE("(%p %p)\n", alldevsp, errbuf);
@ -210,7 +210,7 @@ index 697e5fc..51e976b 100644
if(alldevsp && !*alldevsp)
ERR_(winediag)("Failed to access raw network (pcap), this requires special permissions.\n");
@@ -136,13 +220,13 @@ int CDECL wine_pcap_findalldevs_ex(char *source, void *auth, pcap_if_t **alldevs
@@ -141,13 +225,13 @@ int CDECL wine_pcap_findalldevs_ex(char *source, void *auth, pcap_if_t **alldevs
void CDECL wine_pcap_freealldevs(pcap_if_t *alldevs)
{
TRACE("(%p)\n", alldevs);
@ -226,7 +226,7 @@ index 697e5fc..51e976b 100644
}
typedef struct _AirpcapHandle *PAirpcapHandle;
@@ -155,18 +239,18 @@ PAirpcapHandle CDECL wine_pcap_get_airpcap_handle(pcap_t *p)
@@ -160,18 +244,18 @@ PAirpcapHandle CDECL wine_pcap_get_airpcap_handle(pcap_t *p)
char* CDECL wine_pcap_geterr(pcap_t *p)
{
TRACE("(%p)\n", p);
@ -248,7 +248,7 @@ index 697e5fc..51e976b 100644
TRACE("%s\n", debugstr_a(ret));
return ret;
}
@@ -174,20 +258,20 @@ const char* CDECL wine_pcap_lib_version(void)
@@ -179,20 +263,20 @@ const char* CDECL wine_pcap_lib_version(void)
int CDECL wine_pcap_list_datalinks(pcap_t *p, int **dlt_buffer)
{
TRACE("(%p %p)\n", p, dlt_buffer);
@ -272,7 +272,7 @@ index 697e5fc..51e976b 100644
}
int CDECL wine_pcap_loop(pcap_t *p, int cnt,
@@ -201,34 +285,34 @@ int CDECL wine_pcap_loop(pcap_t *p, int cnt,
@@ -206,34 +290,34 @@ int CDECL wine_pcap_loop(pcap_t *p, int cnt,
PCAP_HANDLER_CALLBACK pcb;
pcb.pfn_cb = callback;
pcb.user_data = user;
@ -313,7 +313,7 @@ index 697e5fc..51e976b 100644
}
#define PCAP_OPENFLAG_PROMISCUOUS 1
@@ -239,14 +323,14 @@ pcap_t* CDECL wine_pcap_open(const char *source, int snaplen, int flags, int rea
@@ -244,14 +328,14 @@ pcap_t* CDECL wine_pcap_open(const char *source, int snaplen, int flags, int rea
int promisc = flags & PCAP_OPENFLAG_PROMISCUOUS;
FIXME("(%s %i %i %i %p %p): partial stub\n", debugstr_a(source), snaplen, flags, read_timeout,
auth, errbuf);
@ -330,7 +330,7 @@ index 697e5fc..51e976b 100644
}
int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf)
@@ -290,13 +374,13 @@ int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char
@@ -295,13 +379,13 @@ int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char
int CDECL wine_pcap_sendpacket(pcap_t *p, const unsigned char *buf, int size)
{
TRACE("(%p %p %i)\n", p, buf, size);
@ -346,7 +346,7 @@ index 697e5fc..51e976b 100644
}
int CDECL wine_pcap_setbuff(pcap_t * p, int dim)
@@ -308,25 +392,25 @@ int CDECL wine_pcap_setbuff(pcap_t * p, int dim)
@@ -313,25 +397,25 @@ int CDECL wine_pcap_setbuff(pcap_t * p, int dim)
int CDECL wine_pcap_setfilter(pcap_t *p, struct bpf_program *fp)
{
TRACE("(%p %p)\n", p, fp);
@ -376,7 +376,7 @@ index 697e5fc..51e976b 100644
}
int CDECL wine_wsockinit(void)
@@ -339,10 +423,29 @@ int CDECL wine_wsockinit(void)
@@ -344,10 +428,29 @@ int CDECL wine_wsockinit(void)
pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname)
{
@ -409,5 +409,5 @@ index 697e5fc..51e976b 100644
+ return TRUE;
}
--
2.7.1
2.13.1