diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 2e578546..c36b7e0a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -5094,8 +5094,10 @@ fi # | * dlls/ntdll/ntdll.spec, dlls/ntdll/server.c, dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c, include/wine/server.h # | if test "$enable_ws2_32_Select" -eq 1; then - patch_apply ws2_32-Select/0001-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch + patch_apply ws2_32-Select/0001-ntdll-Introduce-a-helper-function-to-check-for-exist.patch + patch_apply ws2_32-Select/0002-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch ( + echo '+ { "Sebastian Lackner", "ntdll: Introduce a helper function to check for existance of server handles.", 1 },'; echo '+ { "Sebastian Lackner", "ws2_32: Properly handle closing sockets during a select call.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 1f899ef1..3b0ebe08 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3439,7 +3439,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Save away the information. */ object->OriginalParms = *light; -@@ -1508,9 +1697,11 @@ +@@ -1515,9 +1704,11 @@ FIXME("Unrecognized light type %#x.\n", light->type); } @@ -3451,7 +3451,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1583,6 +1774,14 @@ +@@ -1590,6 +1781,14 @@ { if (light_info->glIndex != -1) { @@ -3466,7 +3466,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state->lights[light_info->glIndex] = NULL; light_info->glIndex = -1; } -@@ -1624,11 +1823,23 @@ +@@ -1631,11 +1830,23 @@ WARN("Too many concurrently active lights\n"); return WINED3D_OK; } @@ -3490,7 +3490,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -1803,9 +2014,11 @@ +@@ -1810,9 +2021,11 @@ TRACE("device %p, base_index %d.\n", device, base_index); device->update_state->base_vertex_index = base_index; @@ -3502,7 +3502,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) -@@ -1850,7 +2063,11 @@ +@@ -1857,7 +2070,11 @@ || !(texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; surface = surface_from_resource(texture->sub_resources[0]); @@ -3514,7 +3514,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; wined3d_surface_blt(surface, NULL, depth_stencil, NULL, 0, NULL, WINED3D_TEXF_POINT); -@@ -2170,7 +2387,11 @@ +@@ -2177,7 +2394,11 @@ return device->state.sampler[WINED3D_SHADER_TYPE_VERTEX][idx]; } @@ -3526,7 +3526,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { UINT i; -@@ -2203,8 +2424,12 @@ +@@ -2210,8 +2431,12 @@ } else { @@ -3539,7 +3539,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2251,8 +2476,12 @@ +@@ -2258,8 +2483,12 @@ } else { @@ -3552,7 +3552,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2303,8 +2532,13 @@ +@@ -2310,8 +2539,13 @@ memset(device->recording->changed.vertexShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.vertexShaderConstantsF) * vector4f_count); else @@ -3566,7 +3566,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2439,8 +2673,12 @@ +@@ -2446,8 +2680,12 @@ } else { @@ -3579,7 +3579,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2487,8 +2725,12 @@ +@@ -2494,8 +2732,12 @@ } else { @@ -3592,7 +3592,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2540,8 +2782,12 @@ +@@ -2547,8 +2789,12 @@ memset(device->recording->changed.pixelShaderConstantsF + start_register, 1, sizeof(*device->recording->changed.pixelShaderConstantsF) * vector4f_count); else @@ -3605,7 +3605,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2701,6 +2947,7 @@ +@@ -2708,6 +2954,7 @@ return hr; } @@ -3613,7 +3613,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_settings.cs_multithreaded) { FIXME("Waiting for cs.\n"); -@@ -2708,6 +2955,7 @@ +@@ -2715,6 +2962,7 @@ device->cs->ops->finish(device->cs); } @@ -3621,7 +3621,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_device_get_transform(device, WINED3D_TS_VIEW, &view_mat); wined3d_device_get_transform(device, WINED3D_TS_PROJECTION, &proj_mat); wined3d_device_get_transform(device, WINED3D_TS_WORLD_MATRIX(0), &world_mat); -@@ -3209,6 +3457,10 @@ +@@ -3216,6 +3464,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3632,7 +3632,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3217,6 +3469,15 @@ +@@ -3224,6 +3476,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3648,7 +3648,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3242,8 +3503,10 @@ +@@ -3249,8 +3510,10 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -3659,7 +3659,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); -@@ -3252,12 +3515,19 @@ +@@ -3259,12 +3522,19 @@ WARN("Rects is %p, but rect_count is 0, ignoring clear\n", rects); return WINED3D_OK; } @@ -3679,7 +3679,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3266,8 +3536,13 @@ +@@ -3273,8 +3543,13 @@ } else if (flags & WINED3DCLEAR_TARGET) { @@ -3693,7 +3693,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3313,6 +3588,9 @@ +@@ -3320,6 +3595,9 @@ enum wined3d_primitive_type primitive_type) { GLenum gl_primitive_type, prev; @@ -3703,7 +3703,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, primitive_type %s\n", device, debug_d3dprimitivetype(primitive_type)); gl_primitive_type = gl_primitive_type_from_d3d(primitive_type); -@@ -3320,8 +3598,13 @@ +@@ -3327,8 +3605,13 @@ device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3717,7 +3717,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3344,6 +3627,14 @@ +@@ -3351,6 +3634,14 @@ return WINED3DERR_INVALIDCALL; } @@ -3732,7 +3732,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_vertex, vertex_count, 0, 0, FALSE); return WINED3D_OK; -@@ -3360,6 +3651,10 @@ +@@ -3367,6 +3658,10 @@ HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { @@ -3743,7 +3743,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count); if (!device->state.index_buffer) -@@ -3378,6 +3673,15 @@ +@@ -3385,6 +3680,15 @@ return WINED3DERR_INVALIDCALL; } @@ -3759,7 +3759,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_draw(device->cs, start_idx, index_count, 0, 0, TRUE); return WINED3D_OK; -@@ -3393,6 +3697,7 @@ +@@ -3400,6 +3704,7 @@ } /* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */ @@ -3767,7 +3767,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c static void device_update_volume(struct wined3d_context *context, struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume) { -@@ -3428,6 +3733,88 @@ +@@ -3435,6 +3740,88 @@ { enum wined3d_resource_type type = src_texture->resource.type; unsigned int level_count, i, j, src_size, dst_size, src_skip_levels = 0; @@ -3856,7 +3856,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3446,7 +3833,13 @@ +@@ -3453,7 +3840,13 @@ } /* Make sure that the destination texture is loaded. */ @@ -3870,7 +3870,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Update every surface level of the texture. */ switch (type) -@@ -3461,7 +3854,16 @@ +@@ -3468,7 +3861,16 @@ src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)); @@ -3887,7 +3887,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } break; } -@@ -3481,7 +3883,16 @@ +@@ -3488,7 +3890,16 @@ i * src_levels + j + src_skip_levels)); dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, i * dst_levels + j)); @@ -3904,7 +3904,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -3491,6 +3902,7 @@ +@@ -3498,6 +3909,7 @@ { for (i = 0; i < level_count; ++i) { @@ -3912,7 +3912,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device_update_volume(context, volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i + src_skip_levels)), -@@ -3539,6 +3951,25 @@ +@@ -3546,6 +3958,25 @@ } wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture); @@ -3938,7 +3938,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -3601,8 +4032,13 @@ +@@ -3608,8 +4039,13 @@ if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3952,7 +3952,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3699,6 +4135,7 @@ +@@ -3706,6 +4142,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, struct wined3d_surface *dst_surface, const POINT *dst_point) { @@ -3960,7 +3960,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c const struct wined3d_format *src_format = src_surface->resource.format; const struct wined3d_format *dst_format = dst_surface->resource.format; UINT update_w, update_h; -@@ -3706,6 +4143,7 @@ +@@ -3713,6 +4150,7 @@ RECT r, dst_rect; POINT p; @@ -3968,7 +3968,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %s.\n", device, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_point(dst_point)); -@@ -3717,6 +4155,7 @@ +@@ -3724,6 +4162,7 @@ return WINED3DERR_INVALIDCALL; } @@ -3976,7 +3976,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (src_format->id != dst_format->id) { WARN("Source and destination surfaces should have the same format.\n"); -@@ -3779,6 +4218,9 @@ +@@ -3786,6 +4225,9 @@ wined3d_cs_emit_update_surface(device->cs, src_surface, src_rect, dst_surface, dst_point); return WINED3D_OK; @@ -3986,7 +3986,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_copy_resource(struct wined3d_device *device, -@@ -3880,8 +4322,14 @@ +@@ -3887,8 +4329,14 @@ rect = &r; } @@ -4001,7 +4001,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -3895,6 +4343,7 @@ +@@ -3902,6 +4350,7 @@ return NULL; } @@ -4009,7 +4009,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return device->state.fb.render_targets[view_idx]; } -@@ -3910,6 +4359,22 @@ +@@ -3917,6 +4366,22 @@ { struct wined3d_rendertarget_view *prev; struct wined3d_fb_state *fb = &device->state.fb; @@ -4032,7 +4032,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -3949,6 +4414,7 @@ +@@ -3956,6 +4421,7 @@ } @@ -4040,7 +4040,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c prev = fb->render_targets[view_idx]; if (view == prev) return WINED3D_OK; -@@ -3956,6 +4422,15 @@ +@@ -3963,6 +4429,15 @@ if (view) wined3d_rendertarget_view_incref(view); fb->render_targets[view_idx] = view; @@ -4056,7 +4056,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -3967,6 +4442,7 @@ +@@ -3974,6 +4449,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -4064,7 +4064,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_fb_state *fb = &device->state.fb; struct wined3d_rendertarget_view *prev; -@@ -3991,6 +4467,79 @@ +@@ -3998,6 +4474,79 @@ { TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", device, x_hotspot, y_hotspot, cursor_image); @@ -4144,7 +4144,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (cursor_image) { -@@ -4026,8 +4575,16 @@ +@@ -4033,8 +4582,16 @@ * release it after setting the cursor image. Windows doesn't * addref the set surface, so we can't do this either without * creating circular refcount dependencies. */ @@ -4161,7 +4161,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->cursorWidth = cursor_image->resource.width; device->cursorHeight = cursor_image->resource.height; -@@ -4127,6 +4684,12 @@ +@@ -4134,6 +4691,12 @@ else SetCursor(NULL); } @@ -4174,7 +4174,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return oldVisible; } -@@ -4137,8 +4700,10 @@ +@@ -4144,8 +4707,10 @@ TRACE("device %p.\n", device); @@ -4185,7 +4185,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Checking resource %p for eviction.\n", resource); -@@ -4146,6 +4711,7 @@ +@@ -4153,6 +4718,7 @@ if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count) { TRACE("Evicting %p.\n", resource); @@ -4193,7 +4193,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_evict_resource(device->cs, resource); } } -@@ -4166,6 +4732,37 @@ +@@ -4173,6 +4739,37 @@ gl_info = context->gl_info; wine_rb_clear(&device->samplers, device_free_sampler, NULL); @@ -4231,7 +4231,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (device->depth_blt_texture) { -@@ -4186,6 +4783,7 @@ +@@ -4193,6 +4790,7 @@ HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4239,7 +4239,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c swapchain->num_contexts = 0; } -@@ -4205,6 +4803,14 @@ +@@ -4212,6 +4810,14 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { @@ -4254,7 +4254,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4221,6 +4827,7 @@ +@@ -4228,6 +4834,7 @@ return hr; } @@ -4262,7 +4262,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain); if (FAILED(hr)) { -@@ -4231,6 +4838,34 @@ +@@ -4238,6 +4845,34 @@ } wined3d_cs_emit_create_dummy_textures(device->cs); @@ -4297,7 +4297,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4251,8 +4886,10 @@ +@@ -4258,8 +4893,10 @@ unsigned int i; TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); @@ -4308,7 +4308,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { -@@ -4268,9 +4905,21 @@ +@@ -4275,9 +4912,21 @@ wined3d_texture_decref(device->logo_texture); device->logo_texture = NULL; } @@ -4330,7 +4330,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4279,6 +4928,7 @@ +@@ -4286,6 +4935,7 @@ } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4338,7 +4338,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (reset_state) { state_unbind_resources(&device->state); -@@ -4288,6 +4938,12 @@ +@@ -4295,6 +4945,12 @@ { wined3d_surface_decref(device->cs->onscreen_depth_stencil); device->cs->onscreen_depth_stencil = NULL; @@ -4351,7 +4351,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4300,6 +4956,7 @@ +@@ -4307,6 +4963,7 @@ } } @@ -4359,7 +4359,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Free implicit resources and wait for the command stream before modifying * swapchain parameters. After modifying the swapchain parameters a new GL * context may be acquired by the worker thread. This causes problems in the -@@ -4321,6 +4978,7 @@ +@@ -4328,6 +4985,7 @@ } device->cs->ops->finish(device->cs); @@ -4367,7 +4367,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Is it necessary to recreate the gl context? Actually every setting can be changed * on an existing gl context, so there's no real need for recreation. * -@@ -4462,6 +5120,13 @@ +@@ -4469,6 +5127,13 @@ } } @@ -4381,7 +4381,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.enable_auto_depth_stencil) { struct wined3d_resource_desc surface_desc; -@@ -4499,6 +5164,13 @@ +@@ -4506,6 +5171,13 @@ wined3d_device_set_depth_stencil_view(device, device->auto_depth_stencil_view); } @@ -4395,7 +4395,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (swapchain->desc.backbuffer_count && FAILED(hr = wined3d_rendertarget_view_create_from_surface( surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)), NULL, &wined3d_null_parent_ops, &device->back_buffer_view))) -@@ -4581,12 +5253,20 @@ +@@ -4588,12 +5260,20 @@ } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state); @@ -4416,7 +4416,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize device state, hr %#x.\n", hr); device->update_state = &device->state; -@@ -4595,6 +5275,7 @@ +@@ -4602,6 +5282,7 @@ } else if (device->back_buffer_view) { @@ -4424,7 +4424,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; wined3d_device_set_rendertarget_view(device, 0, device->back_buffer_view, FALSE); -@@ -4610,6 +5291,24 @@ +@@ -4617,6 +5298,24 @@ state->scissor_rect.left = 0; state->scissor_rect.right = swapchain->desc.backbuffer_width; state->scissor_rect.bottom = swapchain->desc.backbuffer_height; @@ -4449,7 +4449,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4688,6 +5387,10 @@ +@@ -4695,6 +5394,10 @@ TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); @@ -4460,7 +4460,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c switch (type) { case WINED3D_RTYPE_SURFACE: -@@ -4698,6 +5401,7 @@ +@@ -4705,6 +5408,7 @@ for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4468,7 +4468,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (wined3d_rendertarget_view_get_surface(device->state.fb.render_targets[i]) == surface) { ERR("Surface %p is still in use as render target %u.\n", surface, i); -@@ -4709,6 +5413,19 @@ +@@ -4716,6 +5420,19 @@ { ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); device->state.fb.depth_stencil = NULL; @@ -4488,7 +4488,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } } break; -@@ -4871,7 +5588,11 @@ +@@ -4878,7 +5595,11 @@ device->blitter = adapter->blitter; @@ -4500,7 +4500,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT))) { ERR("Failed to initialize device state, hr %#x.\n", hr); -@@ -4970,6 +5691,7 @@ +@@ -4977,6 +5698,7 @@ else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -4508,7 +4508,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Context activation is done by the caller */ struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage, -@@ -5023,3 +5745,4 @@ +@@ -5030,3 +5752,4 @@ wined3d_device_destroy_bo(device, context, bo); } @@ -4516,7 +4516,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c -@@ -1456,8 +1456,15 @@ +@@ -1462,8 +1462,15 @@ const struct wined3d_shader_reg_maps *reg_maps, const struct shader_glsl_ctx_priv *ctx_priv) { const struct wined3d_shader_version *version = ®_maps->shader_version; @@ -4532,7 +4532,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c unsigned int i, extra_constants_needed = 0; const struct wined3d_shader_lconst *lconst; const char *prefix; -@@ -1698,7 +1705,11 @@ +@@ -1704,7 +1711,11 @@ { UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); @@ -4544,7 +4544,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } -@@ -1739,6 +1750,7 @@ +@@ -1745,6 +1756,7 @@ } else { @@ -4552,7 +4552,7 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c /* This happens because we do not have proper tracking of the * constant registers that are actually used, only the max * limit of the shader version. -@@ -1747,6 +1759,23 @@ +@@ -1753,6 +1765,23 @@ * it and just create the uniform. */ FIXME("Cannot find a free uniform for vpos correction params\n"); diff --git a/patches/ws2_32-Select/0001-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch b/patches/ws2_32-Select/0001-ntdll-Introduce-a-helper-function-to-check-for-exist.patch similarity index 54% rename from patches/ws2_32-Select/0001-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch rename to patches/ws2_32-Select/0001-ntdll-Introduce-a-helper-function-to-check-for-exist.patch index ac4c46e6..73aea167 100644 --- a/patches/ws2_32-Select/0001-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch +++ b/patches/ws2_32-Select/0001-ntdll-Introduce-a-helper-function-to-check-for-exist.patch @@ -1,34 +1,33 @@ -From 2c467089a7cbb58f76375226314bd37d3e832e4d Mon Sep 17 00:00:00 2001 +From b474b9b40dc95c477890ef0b1407e647b46a22d0 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner -Date: Thu, 16 Apr 2015 12:59:51 +0200 -Subject: ws2_32: Properly handle closing sockets during a select call. +Date: Thu, 30 Apr 2015 05:43:21 +0200 +Subject: ntdll: Introduce a helper function to check for existance of server + handles. -Based on a patch by Bruno Jesus. --- - dlls/ntdll/ntdll.spec | 1 + - dlls/ntdll/server.c | 21 +++++++++++++++++++++ - dlls/ws2_32/socket.c | 8 +++++++- - dlls/ws2_32/tests/sock.c | 1 - - include/wine/server.h | 1 + - 5 files changed, 30 insertions(+), 2 deletions(-) + dlls/ntdll/ntdll.spec | 1 + + dlls/ntdll/server.c | 21 +++++++++++++++++++++ + dlls/ws2_32/socket.c | 13 ++++--------- + include/wine/server.h | 1 + + 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec -index c3307b2..f47a24b 100644 +index 28165ef..0c73380 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec -@@ -1416,6 +1416,7 @@ +@@ -1417,6 +1417,7 @@ # Server interface @ cdecl -norelay wine_server_call(ptr) @ cdecl wine_server_fd_to_handle(long long long ptr) -+@ cdecl wine_server_handle_exists(long) ++@ cdecl wine_server_handle_exists(long long) @ cdecl wine_server_handle_to_fd(long long ptr ptr) @ cdecl wine_server_release_fd(long long) @ cdecl wine_server_send_fd(long) diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 29cfcb5..237f439 100644 +index 69d01be..03f85ff 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -1039,6 +1039,27 @@ int CDECL wine_server_fd_to_handle( int fd, unsigned int access, unsigned int at +@@ -974,6 +974,27 @@ int CDECL wine_server_fd_to_handle( int fd, unsigned int access, unsigned int at /*********************************************************************** @@ -57,36 +56,32 @@ index 29cfcb5..237f439 100644 * * Retrieve the file descriptor corresponding to a file handle. diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 95ea83c..ff21577 100644 +index ef43186..22dd084 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c -@@ -4788,7 +4788,13 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd - if (exceptfds) +@@ -2940,18 +2940,13 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen) + */ + int WINAPI WS_closesocket(SOCKET s) + { +- int res = SOCKET_ERROR, fd; ++ int res = SOCKET_ERROR; + if (num_startup) { - for (i = 0; i < exceptfds->fd_count; i++, j++) -- if (fds[j].fd != -1) release_sock_fd( exceptfds->fd_array[i], fds[j].fd ); -+ { -+ if (fds[j].fd == -1) continue; -+ release_sock_fd( exceptfds->fd_array[i], fds[j].fd ); -+ if (!(fds[j].revents & POLLHUP)) continue; -+ if (wine_server_handle_exists( SOCKET2HANDLE( exceptfds->fd_array[i] ), 0 )) continue; -+ fds[j].revents = 0; -+ } +- fd = get_sock_fd(s, FILE_READ_DATA, NULL); +- if (fd >= 0) +- { +- release_sock_fd(s, fd); +- if (CloseHandle(SOCKET2HANDLE(s))) +- res = 0; +- } +- else ++ if (!wine_server_handle_exists(SOCKET2HANDLE(s), FILE_READ_DATA)) + SetLastError(WSAENOTSOCK); ++ else if (CloseHandle(SOCKET2HANDLE(s))) ++ res = 0; } - } - -diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c -index aa06a08..d276867 100644 ---- a/dlls/ws2_32/tests/sock.c -+++ b/dlls/ws2_32/tests/sock.c -@@ -3834,7 +3834,6 @@ todo_wine - FD_ZERO_ALL(); - FD_SET_ALL(fdWrite); - ret = select(0, &readfds, NULL, &exceptfds, &select_timeout); --todo_wine - ok(ret == 1, "expected 1, got %d\n", ret); - ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n"); - WaitForSingleObject (thread_handle, 1000); + else + SetLastError(WSANOTINITIALISED); diff --git a/include/wine/server.h b/include/wine/server.h index d573d1f..a114cf9 100644 --- a/include/wine/server.h diff --git a/patches/ws2_32-Select/0002-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch b/patches/ws2_32-Select/0002-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch new file mode 100644 index 00000000..8e797f2a --- /dev/null +++ b/patches/ws2_32-Select/0002-ws2_32-Properly-handle-closing-sockets-during-a-sele.patch @@ -0,0 +1,45 @@ +From d0e3cdea2ff7ef0d2b2d3959d00538d1473cac70 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Thu, 30 Apr 2015 05:43:26 +0200 +Subject: ws2_32: Properly handle closing sockets during a select call. + +Based on a patch by Bruno Jesus. +--- + dlls/ws2_32/socket.c | 8 +++++++- + dlls/ws2_32/tests/sock.c | 1 - + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c +index 22dd084..15e4dce 100644 +--- a/dlls/ws2_32/socket.c ++++ b/dlls/ws2_32/socket.c +@@ -4768,7 +4768,13 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd + if (exceptfds) + { + for (i = 0; i < exceptfds->fd_count; i++, j++) +- if (fds[j].fd != -1) release_sock_fd( exceptfds->fd_array[i], fds[j].fd ); ++ { ++ if (fds[j].fd == -1) continue; ++ release_sock_fd( exceptfds->fd_array[i], fds[j].fd ); ++ if (!(fds[j].revents & POLLHUP)) continue; ++ if (!wine_server_handle_exists( SOCKET2HANDLE(exceptfds->fd_array[i]), 0 )) ++ fds[j].revents = 0; ++ } + } + } + +diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c +index f31539f..d67a47d 100644 +--- a/dlls/ws2_32/tests/sock.c ++++ b/dlls/ws2_32/tests/sock.c +@@ -3834,7 +3834,6 @@ todo_wine + FD_ZERO_ALL(); + FD_SET_ALL(fdWrite); + ret = select(0, &readfds, NULL, &exceptfds, &select_timeout); +-todo_wine + ok(ret == 1, "expected 1, got %d\n", ret); + ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n"); + WaitForSingleObject (thread_handle, 1000); +-- +2.3.5 +