Rebase against 10dcee21c4b28b7f1cedc9ade01c09616521b628

This commit is contained in:
Alistair Leslie-Hughes 2019-05-07 08:27:08 +10:00
parent 5f18c8565c
commit b105021410
10 changed files with 146 additions and 427 deletions

View File

@ -1,14 +1,14 @@
From 05d2fdef11e728574c7551e3a96f3223407027f4 Mon Sep 17 00:00:00 2001
From 9f36741fe5895aaf8aa5a954b78db09e32c2db3a Mon Sep 17 00:00:00 2001
From: Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Date: Sat, 24 Sep 2016 06:51:24 +0300
Subject: [PATCH] d3d11: Add stub deferred rendering context.
---
dlls/d3d11/device.c | 1263 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 1127 insertions(+), 136 deletions(-)
dlls/d3d11/device.c | 1267 +++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 1129 insertions(+), 138 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index c930248..80f73de 100644
index 8f9a850..b7cdd49 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -25,6 +25,16 @@
@ -28,18 +28,18 @@ index c930248..80f73de 100644
static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {}
static const struct wined3d_parent_ops d3d_null_wined3d_parent_ops =
@@ -2910,214 +2920,1182 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont
@@ -2886,218 +2896,1186 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont
wined3d_private_store_cleanup(&context->private_store);
}
-/* ID3D11Device methods */
+/* ID3D11DeviceContext - deferred context methods */
-static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID riid, void **out)
-static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID iid, void **out)
+static inline struct d3d11_deferred_context *impl_from_deferred_ID3D11DeviceContext(ID3D11DeviceContext *iface)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- return IUnknown_QueryInterface(device->outer_unk, riid, out);
- return IUnknown_QueryInterface(device->outer_unk, iid, out);
+ return CONTAINING_RECORD(iface, struct d3d11_deferred_context, ID3D11DeviceContext_iface);
}
@ -129,11 +129,11 @@ index c930248..80f73de 100644
- HRESULT hr;
-
- TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
-
- if (FAILED(hr = d3d_texture2d_create(device, desc, data, &object)))
- return hr;
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
- if (FAILED(hr = d3d_texture2d_create(device, desc, data, &object)))
- return hr;
-
- *texture = &object->ID3D11Texture2D_iface;
+ TRACE("iface %p, device %p.\n", iface, device);
@ -150,13 +150,13 @@ index c930248..80f73de 100644
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_texture3d *object;
- HRESULT hr;
-
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
- TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture);
-
- if (FAILED(hr = d3d_texture3d_create(device, desc, data, &object)))
- return hr;
+ struct d3d11_deferred_context *context = impl_from_deferred_ID3D11DeviceContext(iface);
-
- *texture = &object->ID3D11Texture3D_iface;
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
@ -204,14 +204,11 @@ index c930248..80f73de 100644
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d11_unordered_access_view *object;
- HRESULT hr;
-
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- if (FAILED(hr = d3d11_unordered_access_view_create(device, resource, desc, &object)))
- return hr;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
@ -219,7 +216,8 @@ index c930248..80f73de 100644
+ iface, start_slot, view_count, views);
+}
- *view = &object->ID3D11UnorderedAccessView_iface;
- if (FAILED(hr = d3d11_unordered_access_view_create(device, resource, desc, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetShader(ID3D11DeviceContext *iface,
+ ID3D11PixelShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
@ -227,36 +225,35 @@ index c930248..80f73de 100644
+ iface, shader, class_instances, class_instance_count);
+}
- return S_OK;
- *view = &object->ID3D11UnorderedAccessView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface,
+ ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
+ FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n",
+ iface, shader, class_instances, class_instance_count);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device2 *iface,
- ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view)
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShader(ID3D11DeviceContext *iface,
+ ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexed(ID3D11DeviceContext *iface,
+ UINT index_count, UINT start_index_location, INT base_vertex_location)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_rendertarget_view *object;
- HRESULT hr;
+ FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n",
+ iface, shader, class_instances, class_instance_count);
+}
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexed(ID3D11DeviceContext *iface,
+ UINT index_count, UINT start_index_location, INT base_vertex_location)
+{
+ FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n",
+ iface, index_count, start_index_location, base_vertex_location);
+}
- if (!resource)
- return E_INVALIDARG;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_Draw(ID3D11DeviceContext *iface,
+ UINT vertex_count, UINT start_vertex_location)
+{
@ -264,46 +261,46 @@ index c930248..80f73de 100644
+ iface, vertex_count, start_vertex_location);
+}
- if (FAILED(hr = d3d_rendertarget_view_create(device, resource, desc, &object)))
- return hr;
- if (!resource)
- return E_INVALIDARG;
+static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_Map(ID3D11DeviceContext *iface, ID3D11Resource *resource,
+ UINT subresource_idx, D3D11_MAP map_type, UINT map_flags, D3D11_MAPPED_SUBRESOURCE *mapped_subresource)
+{
+ FIXME("iface %p, resource %p, subresource_idx %u, map_type %u, map_flags %#x, mapped_subresource %p stub!\n",
+ iface, resource, subresource_idx, map_type, map_flags, mapped_subresource);
- *view = &object->ID3D11RenderTargetView_iface;
- if (FAILED(hr = d3d_rendertarget_view_create(device, resource, desc, &object)))
- return hr;
+ return E_NOTIMPL;
+}
- return S_OK;
- *view = &object->ID3D11RenderTargetView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_Unmap(ID3D11DeviceContext *iface, ID3D11Resource *resource,
+ UINT subresource_idx)
+{
+ FIXME("iface %p, resource %p, subresource_idx %u stub!\n", iface, resource, subresource_idx);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+{
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device2 *iface,
- ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view)
+static void STDMETHODCALLTYPE d3d11_deferred_context_PSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetInputLayout(ID3D11DeviceContext *iface,
+ ID3D11InputLayout *input_layout)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_depthstencil_view *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetInputLayout(ID3D11DeviceContext *iface,
+ ID3D11InputLayout *input_layout)
+{
+ FIXME("iface %p, input_layout %p stub!\n", iface, input_layout);
+}
- if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object)))
- return hr;
- TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetVertexBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers, const UINT *strides, const UINT *offsets)
+{
@ -311,7 +308,8 @@ index c930248..80f73de 100644
+ iface, start_slot, buffer_count, buffers, strides, offsets);
+}
- *view = &object->ID3D11DepthStencilView_iface;
- if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetIndexBuffer(ID3D11DeviceContext *iface,
+ ID3D11Buffer *buffer, DXGI_FORMAT format, UINT offset)
+{
@ -319,7 +317,7 @@ index c930248..80f73de 100644
+ iface, buffer, debug_dxgi_format(format), offset);
+}
- return S_OK;
- *view = &object->ID3D11DepthStencilView_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawIndexedInstanced(ID3D11DeviceContext *iface,
+ UINT instance_index_count, UINT instance_count, UINT start_index_location, INT base_vertex_location,
+ UINT start_instance_location)
@ -328,36 +326,34 @@ index c930248..80f73de 100644
+ "base_vertex_location %d, start_instance_location %u stub!\n",
+ iface, instance_index_count, instance_count, start_index_location,
+ base_vertex_location, start_instance_location);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface,
+ UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location)
+{
+ FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, "
+ "start_instance_location %u stub!\n",
+ iface, instance_vertex_count, instance_count, start_vertex_location,
+ start_instance_location);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device2 *iface,
- const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code,
- SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout)
+static void STDMETHODCALLTYPE d3d11_deferred_context_DrawInstanced(ID3D11DeviceContext *iface,
+ UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location)
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_input_layout *object;
- HRESULT hr;
+ FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, "
+ "start_instance_location %u stub!\n",
+ iface, instance_vertex_count, instance_count, start_vertex_location,
+ start_instance_location);
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, "
- "input_layout %p.\n", iface, element_descs, element_count, shader_byte_code,
- shader_byte_code_length, input_layout);
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetConstantBuffers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers)
+{
+ FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
+ iface, start_slot, buffer_count, buffers);
+}
- if (FAILED(hr = d3d_input_layout_create(device, element_descs, element_count,
- shader_byte_code, shader_byte_code_length, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShader(ID3D11DeviceContext *iface,
+ ID3D11GeometryShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count)
+{
@ -365,35 +361,44 @@ index c930248..80f73de 100644
+ iface, shader, class_instances, class_instance_count);
+}
- *input_layout = &object->ID3D11InputLayout_iface;
- if (FAILED(hr = d3d_input_layout_create(device, element_descs, element_count,
- shader_byte_code, shader_byte_code_length, &object)))
- return hr;
+static void STDMETHODCALLTYPE d3d11_deferred_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface,
+ D3D11_PRIMITIVE_TOPOLOGY topology)
+{
+ FIXME("iface %p, topology %u stub!\n", iface, topology);
+}
- return S_OK;
- *input_layout = &object->ID3D11InputLayout_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device2 *iface, const void *byte_code,
- SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader)
+static void STDMETHODCALLTYPE d3d11_deferred_context_VSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_vertex_shader *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
+}
- TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
- iface, byte_code, byte_code_length, class_linkage, shader);
+static void STDMETHODCALLTYPE d3d11_deferred_context_Begin(ID3D11DeviceContext *iface,
+static void STDMETHODCALLTYPE d3d11_deferred_context_End(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
+{
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
@ -401,47 +406,44 @@ index c930248..80f73de 100644
- if (class_linkage)
- FIXME("Class linkage is not implemented yet.\n");
+static void STDMETHODCALLTYPE d3d11_deferred_context_End(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous)
+{
+ FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous);
+}
- if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object)))
- return hr;
+static HRESULT STDMETHODCALLTYPE d3d11_deferred_context_GetData(ID3D11DeviceContext *iface,
+ ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags)
+{
+ FIXME("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x stub!\n",
+ iface, asynchronous, data, data_size, data_flags);
- *shader = &object->ID3D11VertexShader_iface;
- if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object)))
- return hr;
+ return E_NOTIMPL;
+}
- return S_OK;
- *shader = &object->ID3D11VertexShader_iface;
+static void STDMETHODCALLTYPE d3d11_deferred_context_SetPredication(ID3D11DeviceContext *iface,
+ ID3D11Predicate *predicate, BOOL value)
+{
+ FIXME("iface %p, predicate %p, value %#x stub!\n", iface, predicate, value);
+}
- return S_OK;
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
+{
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
}
-static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device2 *iface, const void *byte_code,
- SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader)
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetShaderResources(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views)
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
+ FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views);
+}
+
+static void STDMETHODCALLTYPE d3d11_deferred_context_GSSetSamplers(ID3D11DeviceContext *iface,
+ UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers)
+{
{
- struct d3d_device *device = impl_from_ID3D11Device2(iface);
- struct d3d_geometry_shader *object;
- HRESULT hr;
+ FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
+ iface, start_slot, sampler_count, samplers);
+}
+
- TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
+static void STDMETHODCALLTYPE d3d11_deferred_context_OMSetRenderTargets(ID3D11DeviceContext *iface,
+ UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views,
+ ID3D11DepthStencilView *depth_stencil_view)
@ -1342,10 +1344,14 @@ index c930248..80f73de 100644
+ SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader)
+{
+ struct d3d_device *device = impl_from_ID3D11Device2(iface);
struct d3d_geometry_shader *object;
HRESULT hr;
+ struct d3d_geometry_shader *object;
+ HRESULT hr;
+
+ TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n",
iface, byte_code, byte_code_length, class_linkage, shader);
@@ -3389,9 +4367,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
if (class_linkage)
@@ -3365,9 +4343,22 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device2 *iface
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device2 *iface, UINT flags,
ID3D11DeviceContext **context)
{
@ -1369,7 +1375,7 @@ index c930248..80f73de 100644
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID riid,
static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID iid,
--
1.9.1

View File

@ -1,27 +0,0 @@
From 7b59e0a7d0962899762b5b7a466d16b97d771df2 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 27 Apr 2019 12:53:06 +1000
Subject: [PATCH 3/7] dinput: Return E_NOINTERFACE from IDirectInputDevice2
QueryInterface
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/dinput/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 63eb868..1317e91 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1257,7 +1257,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W ifa
}
WARN("Unsupported interface!\n");
- return E_FAIL;
+ return E_NOINTERFACE;
}
HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface, REFIID riid, LPVOID *ppobj)
--
1.9.1

View File

@ -1,28 +0,0 @@
From 1b1158f85ae61f348207460ce98b1977eee79b66 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 27 Apr 2019 13:10:01 +1000
Subject: [PATCH 4/7] dinput: Dont report we cannot open a device
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/dinput/joystick_linuxinput.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index fb6b305..7343a50 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -219,10 +219,7 @@ static void find_joydevs(void)
}
if (fd == -1)
- {
- WARN("Failed to open \"%s\": %d %s\n", buf, errno, strerror(errno));
continue;
- }
if (ioctl(fd, EVIOCGBIT(0, sizeof(joydev.evbits)), joydev.evbits) == -1)
{
--
1.9.1

View File

@ -1,29 +0,0 @@
From 0e363558e654e25546127effe43a07c2b2038c9b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 27 Apr 2019 13:23:46 +1000
Subject: [PATCH 5/7] dinput: Improve EnumDevice tracing
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/dinput/dinput_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 7bf067f..4b41b71 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -467,9 +467,10 @@ static HRESULT WINAPI IDirectInputAImpl_EnumDevices(
for (i = 0; i < ARRAY_SIZE(dinput_devices); i++) {
if (!dinput_devices[i]->enum_deviceA) continue;
+
+ TRACE(" Checking device %u ('%s')\n", i, dinput_devices[i]->name);
for (j = 0, r = S_OK; SUCCEEDED(r); j++) {
devInstance.dwSize = sizeof(devInstance);
- TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
r = dinput_devices[i]->enum_deviceA(dwDevType, dwFlags, &devInstance, This->dwVersion, j);
if (r == S_OK)
if (enum_callback_wrapper(lpCallback, &devInstance, pvRef) == DIENUM_STOP)
--
1.9.1

View File

@ -1,79 +0,0 @@
From e5eb27de156f7d250755fb3070c419e28e9d1957 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sun, 28 Apr 2019 12:11:56 +1000
Subject: [PATCH 6/7] dinput: Support DIDEVICEINSTANCE_DX3 for Mouse
GetDeviceInfo
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/dinput/mouse.c | 5 -----
dlls/dinput/tests/mouse.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 0adba03..1e2b1d1 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -765,11 +765,6 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceInfo(
SysMouseImpl *This = impl_from_IDirectInputDevice8A(iface);
TRACE("(this=%p,%p)\n", This, pdidi);
- if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) {
- WARN(" dinput3 not supported yet...\n");
- return DI_OK;
- }
-
fill_mouse_dideviceinstanceA(pdidi, This->base.dinput->dwVersion);
return DI_OK;
diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c
index c2d0226..c1a7ff7 100644
--- a/dlls/dinput/tests/mouse.c
+++ b/dlls/dinput/tests/mouse.c
@@ -198,6 +198,35 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
DestroyWindow( hwnd2 );
}
+static void test_GetDeviceInfo(IDirectInputA *pDI)
+{
+ HRESULT hr;
+ IDirectInputDeviceA *pMouse = NULL;
+ DIDEVICEINSTANCEA instA;
+ DIDEVICEINSTANCE_DX3A inst3A;
+
+ hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, &pMouse, NULL);
+ ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
+ if (FAILED(hr)) return;
+
+ instA.dwSize = sizeof(instA);
+ hr = IDirectInputDevice_GetDeviceInfo(pMouse, &instA);
+ ok(SUCCEEDED(hr), "got %08x\n", hr);
+
+ inst3A.dwSize = sizeof(inst3A);
+ hr = IDirectInputDevice_GetDeviceInfo(pMouse, (DIDEVICEINSTANCEA *)&inst3A);
+ ok(SUCCEEDED(hr), "got %08x\n", hr);
+
+ ok(instA.dwSize != inst3A.dwSize, "got %d, %d \n", instA.dwSize, inst3A.dwSize);
+ ok(IsEqualGUID(&instA.guidInstance, &inst3A.guidInstance), "got %s, %s\n",
+ wine_dbgstr_guid(&instA.guidInstance), wine_dbgstr_guid(&inst3A.guidInstance) );
+ ok(IsEqualGUID(&instA.guidProduct, &inst3A.guidProduct), "got %s, %s\n",
+ wine_dbgstr_guid(&instA.guidProduct), wine_dbgstr_guid(&inst3A.guidProduct) );
+ ok(instA.dwDevType == inst3A.dwDevType, "got %d, %d\n", instA.dwDevType, inst3A.dwDevType);
+
+ if (pMouse) IUnknown_Release(pMouse);
+}
+
static void mouse_tests(void)
{
HRESULT hr;
@@ -224,6 +253,7 @@ static void mouse_tests(void)
test_set_coop(pDI, hwnd);
test_acquire(pDI, hwnd);
+ test_GetDeviceInfo(pDI);
DestroyWindow(hwnd);
}
--
1.9.1

View File

@ -1,95 +0,0 @@
From 28112782ac7279d42d539671a4e181264559b93d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 10 Nov 2014 04:05:38 +0100
Subject: [PATCH] ntoskrnl.exe: Avoid invalid memory access when relocation
block addresses memory outside of the current page.
---
dlls/ntoskrnl.exe/ntoskrnl.c | 49 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 6 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index ace79a8..97def67 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -3349,6 +3349,39 @@ static LDR_MODULE *find_ldr_module( HMODULE module )
return ldr;
}
+/* change permissions of a specific memory range, save original permissions */
+static void virtual_protect_save( void *addr, SIZE_T size, ULONG new_prot, ULONG *old_prot )
+{
+ SYSTEM_BASIC_INFORMATION info;
+ UINT i = 0;
+
+ NtQuerySystemInformation( SystemBasicInformation, &info, sizeof(info), NULL );
+ while (size)
+ {
+ SIZE_T block_size = min( size, info.PageSize - ((UINT_PTR)addr & (info.PageSize - 1)) );
+ VirtualProtect( addr, block_size, new_prot, &old_prot[i++] );
+ addr = (void *)((char *)addr + block_size);
+ size -= block_size;
+ }
+}
+
+/* restore permissions for a specific memory range */
+static void virtual_protect_load( void *addr, SIZE_T size, ULONG *old_prot )
+{
+ SYSTEM_BASIC_INFORMATION info;
+ DWORD dummy;
+ UINT i = 0;
+
+ NtQuerySystemInformation( SystemBasicInformation, &info, sizeof(info), NULL );
+ while (size)
+ {
+ SIZE_T block_size = min( size, info.PageSize - ((UINT_PTR)addr & (info.PageSize - 1)) );
+ VirtualProtect( addr, block_size, old_prot[i++], &dummy );
+ addr = (void *)((char *)addr + block_size);
+ size -= block_size;
+ }
+}
+
/* load the driver module file */
static HMODULE load_driver_module( const WCHAR *name )
{
@@ -3372,27 +3405,31 @@ static HMODULE load_driver_module( const WCHAR *name )
if (nt->OptionalHeader.SectionAlignment < info.PageSize ||
!(nt->FileHeader.Characteristics & IMAGE_FILE_DLL))
{
- DWORD old;
+ DWORD old_prot[3];
IMAGE_BASE_RELOCATION *rel, *end;
if ((rel = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_BASERELOC, &size )))
{
TRACE( "%s: relocating from %p to %p\n", wine_dbgstr_w(name), (char *)module - delta, module );
end = (IMAGE_BASE_RELOCATION *)((char *)rel + size);
- while (rel < end && rel->SizeOfBlock)
+ while (rel < end - 1 && rel->SizeOfBlock)
{
void *page = (char *)module + rel->VirtualAddress;
- VirtualProtect( page, info.PageSize, PAGE_EXECUTE_READWRITE, &old );
+ /* LdrProcessRelocationBlock can access the memory range from page - (page + 0xfff + 8), so
+ * changing permissions of a single page is not sufficient. We assume here that the minimum
+ * page size is 0x1000, so we have to save/restore two or three pages, depending on the
+ * virtual address. */
+ virtual_protect_save( page, 0xfff + 8, PAGE_EXECUTE_READWRITE, old_prot );
rel = LdrProcessRelocationBlock( page, (rel->SizeOfBlock - sizeof(*rel)) / sizeof(USHORT),
(USHORT *)(rel + 1), delta );
- if (old != PAGE_EXECUTE_READWRITE) VirtualProtect( page, info.PageSize, old, &old );
+ virtual_protect_load( page, 0xfff + 8, old_prot );
if (!rel) goto error;
}
/* make sure we don't try again */
size = FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + nt->FileHeader.SizeOfOptionalHeader;
- VirtualProtect( nt, size, PAGE_READWRITE, &old );
+ VirtualProtect( nt, size, PAGE_READWRITE, &old_prot[0] );
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0;
- VirtualProtect( nt, size, old, &old );
+ VirtualProtect( nt, size, old_prot[0], &old_prot[0] );
}
}
--
1.9.1

View File

@ -1 +0,0 @@
Fixes: [28254] Fix crash of winedevice when relocation entry crosses page boundary

View File

@ -1,41 +1,40 @@
From 60b8f3d44890b9d3a60c7893c6633e89e91064c8 Mon Sep 17 00:00:00 2001
From dab5f521ad21f95aeedde39f0625541fe39d8bdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 7 Jul 2017 23:56:16 +0200
Subject: [PATCH] nvapi: Implement NvAPI_D3D11_SetDepthBoundsTest. (v2)
---
dlls/d3d11/device.c | 12 ++++++++++++
dlls/d3d11/device.c | 11 +++++++++++
dlls/nvapi/nvapi.c | 29 +++++++++++++++++++++++++++++
dlls/nvapi/tests/nvapi.c | 17 +++++++++++++++++
include/wine/wined3d.h | 2 ++
4 files changed, 60 insertions(+)
4 files changed, 59 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 18fa670..abe9e29 100644
index 751afc1..ad91cdb 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -48,6 +48,8 @@ static inline struct d3d_device *device_from_immediate_ID3D11DeviceContext1(ID3D
static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11DeviceContext1 *iface,
REFIID riid, void **out)
@@ -49,6 +49,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11De
REFIID iid, void **out)
{
struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1( (ID3D11DeviceContext1*)iface);
+
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_ID3D11DeviceContext1)
@@ -59,6 +61,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11De
*out = iface;
return S_OK;
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
@@ -63,6 +64,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11De
{
*out = &context->ID3D11Multithread_iface;
}
+ else if (IsEqualGUID(riid, &IID_IWineD3DDevice))
+ else if (IsEqualGUID(iid, &IID_IWineD3DDevice))
+ {
+ *out = device->wined3d_device;
+ return S_OK;
+ }
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
*out = NULL;
@@ -3864,6 +3871,11 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
else
{
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
@@ -3942,6 +3948,11 @@ static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface
{
*out = &device->IWineDXGIDeviceParent_iface;
}
@ -48,10 +47,10 @@ index 18fa670..abe9e29 100644
{
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
diff --git a/dlls/nvapi/nvapi.c b/dlls/nvapi/nvapi.c
index 12ddb0d..22894d6 100644
index b67b414..ad8266b 100644
--- a/dlls/nvapi/nvapi.c
+++ b/dlls/nvapi/nvapi.c
@@ -22,6 +22,7 @@
@@ -23,6 +23,7 @@
#include <stdarg.h>
#define COBJMACROS
@ -59,7 +58,7 @@ index 12ddb0d..22894d6 100644
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
@@ -681,6 +682,33 @@ static NvAPI_Status CDECL NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysica
@@ -682,6 +683,33 @@ static NvAPI_Status CDECL NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysica
return NVAPI_OK;
}
@ -93,7 +92,7 @@ index 12ddb0d..22894d6 100644
void* CDECL nvapi_QueryInterface(unsigned int offset)
{
static const struct
@@ -726,6 +754,7 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
@@ -727,6 +755,7 @@ void* CDECL nvapi_QueryInterface(unsigned int offset)
{0x46fbeb03, NvAPI_GPU_GetPhysicalFrameBufferSize},
{0x5a04b644, NvAPI_GPU_GetVirtualFrameBufferSize},
{0xc7026a87, NvAPI_GPU_GetGpuCoreCount},
@ -151,7 +150,7 @@ index c8b66ac..87327c0 100644
/* d3d9 tests */
wc.lpfnWndProc = DefWindowProcA;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 15e14e5..f9df2d2 100644
index 958ade1..4828f9c 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -32,6 +32,8 @@
@ -164,5 +163,5 @@ index 15e14e5..f9df2d2 100644
#define _FACWINED3D 0x876
--
2.7.4
1.9.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b479382737f9ee110bc61b1dd765c5b81d56c900"
echo "10dcee21c4b28b7f1cedc9ade01c09616521b628"
}
# Show version information
@ -226,7 +226,6 @@ patch_enable_all ()
enable_ntdll_aarch_TEB="$1"
enable_ntdll_set_full_cpu_context="$1"
enable_ntoskrnl_Stubs="$1"
enable_ntoskrnl_exe_Fix_Relocation="$1"
enable_nvapi_Stub_DLL="$1"
enable_nvcuda_CUDA_Support="$1"
enable_nvcuvid_CUDA_Video_Support="$1"
@ -810,9 +809,6 @@ patch_enable ()
ntoskrnl-Stubs)
enable_ntoskrnl_Stubs="$2"
;;
ntoskrnl.exe-Fix_Relocation)
enable_ntoskrnl_exe_Fix_Relocation="$2"
;;
nvapi-Stub_DLL)
enable_nvapi_Stub_DLL="$2"
;;
@ -3080,21 +3076,13 @@ fi
# | * [#36764] dinput: Allow DirectX version 3 to enumerate joysticks.
# |
# | Modified files:
# | * dlls/dinput/device.c, dlls/dinput/dinput_main.c, dlls/dinput/joystick_linux.c, dlls/dinput/joystick_linuxinput.c,
# | dlls/dinput/joystick_osx.c, dlls/dinput/mouse.c, dlls/dinput/tests/joystick.c, dlls/dinput/tests/mouse.c
# | * dlls/dinput/joystick_linux.c, dlls/dinput/joystick_linuxinput.c, dlls/dinput/joystick_osx.c,
# | dlls/dinput/tests/joystick.c
# |
if test "$enable_dinput_joy_directX3" -eq 1; then
patch_apply dinput-joy-directX3/0001-dinput-Allow-Enumeration-of-joysticks-with-DirectX-3.patch
patch_apply dinput-joy-directX3/0003-dinput-Return-E_NOINTERFACE-from-IDirectInputDevice2.patch
patch_apply dinput-joy-directX3/0004-dinput-Dont-report-we-cannot-open-a-device.patch
patch_apply dinput-joy-directX3/0005-dinput-Improve-EnumDevice-tracing.patch
patch_apply dinput-joy-directX3/0006-dinput-Support-DIDEVICEINSTANCE_DX3-for-Mouse-GetDev.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "dinput: Allow Enumeration of joysticks with DirectX 3.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "dinput: Return E_NOINTERFACE from IDirectInputDevice2 QueryInterface.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "dinput: Dont report we cannot open a device.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "dinput: Improve EnumDevice tracing.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "dinput: Support DIDEVICEINSTANCE_DX3 for Mouse GetDeviceInfo.", 1 },';
) >> "$patchlist"
fi
@ -5118,21 +5106,6 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntoskrnl.exe-Fix_Relocation
# |
# | This patchset fixes the following Wine bugs:
# | * [#28254] Fix crash of winedevice when relocation entry crosses page boundary
# |
# | Modified files:
# | * dlls/ntoskrnl.exe/ntoskrnl.c
# |
if test "$enable_ntoskrnl_exe_Fix_Relocation" -eq 1; then
patch_apply ntoskrnl.exe-Fix_Relocation/0001-ntoskrnl.exe-Avoid-invalid-memory-access-when-reloca.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "ntoskrnl.exe: Avoid invalid memory access when relocation block addresses memory outside of the current page.", 1 },';
) >> "$patchlist"
fi
# Patchset nvcuvid-CUDA_Video_Support
# |
# | This patchset has the following (direct or indirect) dependencies:

View File

@ -1,4 +1,4 @@
From 852993baf2f57a99f9646f946d0921449be43c82 Mon Sep 17 00:00:00 2001
From 71c90bdb271420737b08bfd7ffda33de2db10d12 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: [PATCH] wpcap: Load libpcap dynamically.
@ -12,10 +12,10 @@ Something we don't want i guess.
3 files changed, 139 insertions(+), 37 deletions(-)
diff --git a/configure.ac b/configure.ac
index be946d542eb..9c59bb5a070 100644
index d6b1d27..bff3266 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1292,9 +1292,9 @@ WINE_NOTICE_WITH(opencl,[test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes],
@@ -1364,9 +1364,9 @@ WINE_NOTICE_WITH(opencl,[test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes],
dnl **** Check for libpcap ****
if test "$ac_cv_header_pcap_pcap_h" = "yes"
then
@ -28,7 +28,7 @@ index be946d542eb..9c59bb5a070 100644
[enable_wpcap])
diff --git a/dlls/wpcap/Makefile.in b/dlls/wpcap/Makefile.in
index 91b4a955911..aeef71a46e5 100644
index 91b4a95..aeef71a 100644
--- a/dlls/wpcap/Makefile.in
+++ b/dlls/wpcap/Makefile.in
@@ -1,6 +1,5 @@
@ -39,7 +39,7 @@ index 91b4a955911..aeef71a46e5 100644
C_SRCS = \
wpcap.c
diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c
index e7908cd038a..a88c325189e 100644
index 6450a0e..b97ed12 100644
--- a/dlls/wpcap/wpcap.c
+++ b/dlls/wpcap/wpcap.c
@@ -18,6 +18,9 @@
@ -52,7 +52,7 @@ index e7908cd038a..a88c325189e 100644
#include <pcap/pcap.h>
/* pcap.h might define those: */
@@ -62,47 +65,128 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
@@ -63,47 +66,128 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
return ret;
}
@ -188,7 +188,7 @@ index e7908cd038a..a88c325189e 100644
}
typedef struct
@@ -131,10 +215,10 @@ int CDECL wine_pcap_dispatch(pcap_t *p, int cnt,
@@ -132,10 +216,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 e7908cd038a..a88c325189e 100644
}
int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
@@ -142,7 +226,7 @@ int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
@@ -143,7 +227,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 e7908cd038a..a88c325189e 100644
if(alldevsp && !*alldevsp)
ERR_(winediag)("Failed to access raw network (pcap), this requires special permissions.\n");
@@ -158,13 +242,13 @@ int CDECL wine_pcap_findalldevs_ex(char *source, void *auth, pcap_if_t **alldevs
@@ -159,13 +243,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 e7908cd038a..a88c325189e 100644
}
typedef struct _AirpcapHandle *PAirpcapHandle;
@@ -177,18 +261,18 @@ PAirpcapHandle CDECL wine_pcap_get_airpcap_handle(pcap_t *p)
@@ -178,18 +262,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 e7908cd038a..a88c325189e 100644
TRACE("%s\n", debugstr_a(ret));
return ret;
}
@@ -196,20 +280,20 @@ const char* CDECL wine_pcap_lib_version(void)
@@ -197,20 +281,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 e7908cd038a..a88c325189e 100644
}
int CDECL wine_pcap_loop(pcap_t *p, int cnt,
@@ -223,34 +307,34 @@ int CDECL wine_pcap_loop(pcap_t *p, int cnt,
@@ -224,34 +308,34 @@ int CDECL wine_pcap_loop(pcap_t *p, int cnt,
PCAP_HANDLER_CALLBACK pcb;
pcb.pfn_cb = callback;
pcb.user_data = user;
@ -312,8 +312,8 @@ index e7908cd038a..a88c325189e 100644
+ return ppcap_next_ex(p, pkt_header, pkt_data);
}
#define PCAP_OPENFLAG_PROMISCUOUS 1
@@ -261,14 +345,14 @@ pcap_t* CDECL wine_pcap_open(const char *source, int snaplen, int flags, int rea
#ifndef PCAP_OPENFLAG_PROMISCUOUS
@@ -264,14 +348,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 e7908cd038a..a88c325189e 100644
}
int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf)
@@ -312,13 +396,13 @@ int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char
@@ -315,13 +399,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 e7908cd038a..a88c325189e 100644
}
int CDECL wine_pcap_setbuff(pcap_t * p, int dim)
@@ -330,25 +414,25 @@ int CDECL wine_pcap_setbuff(pcap_t * p, int dim)
@@ -333,25 +417,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 e7908cd038a..a88c325189e 100644
}
int CDECL wine_wsockinit(void)
@@ -374,7 +458,7 @@ pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname)
@@ -377,7 +461,7 @@ pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname)
TRACE("unix_path %s\n", debugstr_a(unix_path));
@ -385,7 +385,7 @@ index e7908cd038a..a88c325189e 100644
heap_free(unix_path);
return dumper;
@@ -383,5 +467,24 @@ pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname)
@@ -386,5 +470,24 @@ pcap_dumper_t* CDECL wine_pcap_dump_open(pcap_t *p, const char *fname)
void CDECL wine_pcap_dump(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
{
TRACE("(%p %p %p)\n", user, h, sp);
@ -412,5 +412,5 @@ index e7908cd038a..a88c325189e 100644
+ return TRUE;
}
--
2.16.3
1.9.1