Rebase against a0c651cd7cf83c9fac6b8776de2d54a731fc4b29.

[secur32-ANSI_NTLM_Credentials]
Removed patch to fix handling of ANSI NTLM credentials (accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-05-26 23:37:02 +02:00
parent 71bb1a35f5
commit e460e59354
4 changed files with 73 additions and 197 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b5aeb661b9297a6ee6047335f42543936f593525"
echo "a0c651cd7cf83c9fac6b8776de2d54a731fc4b29"
}
# Show version information
@ -274,7 +274,6 @@ patch_enable_all ()
enable_riched20_IText_Interface="$1"
enable_rpcrt4_Pipe_Transport="$1"
enable_rpcrt4_RpcBindingServerFromClient="$1"
enable_secur32_ANSI_NTLM_Credentials="$1"
enable_secur32_Zero_Buffer_Length="$1"
enable_server_ClipCursor="$1"
enable_server_CreateProcess_ACLs="$1"
@ -1001,9 +1000,6 @@ patch_enable ()
rpcrt4-RpcBindingServerFromClient)
enable_rpcrt4_RpcBindingServerFromClient="$2"
;;
secur32-ANSI_NTLM_Credentials)
enable_secur32_ANSI_NTLM_Credentials="$2"
;;
secur32-Zero_Buffer_Length)
enable_secur32_Zero_Buffer_Length="$2"
;;
@ -5904,21 +5900,6 @@ if test "$enable_rpcrt4_RpcBindingServerFromClient" -eq 1; then
) >> "$patchlist"
fi
# Patchset secur32-ANSI_NTLM_Credentials
# |
# | This patchset fixes the following Wine bugs:
# | * [#37063] Fix handling of ANSI NTLM credentials
# |
# | Modified files:
# | * dlls/secur32/ntlm.c
# |
if test "$enable_secur32_ANSI_NTLM_Credentials" -eq 1; then
patch_apply secur32-ANSI_NTLM_Credentials/0001-secur32-Fix-handling-of-ANSI-NTLM-credentials.patch
(
echo '+ { "David Woodhouse", "secur32: Fix handling of ANSI NTLM credentials.", 1 },';
) >> "$patchlist"
fi
# Patchset secur32-Zero_Buffer_Length
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,104 +0,0 @@
From 84e4f321118a11991a34e24dd1729181ad8a1574 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 8 Aug 2014 13:21:56 +0100
Subject: secur32: Fix handling of ANSI NTLM credentials
One of many issues covered in bug 37063... we assume that the
credentials are in Unicode, instead of looking at the Flags field.
---
dlls/secur32/ntlm.c | 69 ++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 58 insertions(+), 11 deletions(-)
diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index 0fe64ed..72e9706 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -174,27 +174,74 @@ SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(
if(pAuthData != NULL)
{
PSEC_WINNT_AUTH_IDENTITY_W auth_data = pAuthData;
+ LPWSTR domain = NULL, user = NULL, password = NULL;
+ int domain_len = 0, user_len = 0, password_len = 0;
- TRACE("Username is %s\n", debugstr_wn(auth_data->User, auth_data->UserLength));
- TRACE("Domain name is %s\n", debugstr_wn(auth_data->Domain, auth_data->DomainLength));
+ if (auth_data->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI)
+ {
+ if (auth_data->DomainLength)
+ {
+ domain_len = MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Domain,
+ auth_data->DomainLength, NULL, 0);
+ domain = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * domain_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Domain, auth_data->DomainLength,
+ domain, domain_len);
+ }
+
+ if (auth_data->UserLength)
+ {
+ user_len = MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->User,
+ auth_data->UserLength, NULL, 0);
+ user = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * user_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->User, auth_data->UserLength,
+ user, user_len);
+ }
+
+ if (auth_data->PasswordLength)
+ {
+ password_len = MultiByteToWideChar(CP_ACP, 0,(char *)auth_data->Password,
+ auth_data->PasswordLength, NULL, 0);
+ password = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * password_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Password, auth_data->PasswordLength,
+ password, password_len);
+ }
+ }
+ else
+ {
+ domain = auth_data->Domain;
+ domain_len = auth_data->DomainLength;
+
+ user = auth_data->User;
+ user_len = auth_data->UserLength;
+
+ password = auth_data->Password;
+ password_len = auth_data->PasswordLength;
+ }
+
+ TRACE("Username is %s\n", debugstr_wn(user, user_len));
+ TRACE("Domain name is %s\n", debugstr_wn(domain, domain_len));
- ntlm_cred->username_arg = ntlm_GetUsernameArg(auth_data->User, auth_data->UserLength);
- ntlm_cred->domain_arg = ntlm_GetDomainArg(auth_data->Domain, auth_data->DomainLength);
+ ntlm_cred->username_arg = ntlm_GetUsernameArg(user, user_len);
+ ntlm_cred->domain_arg = ntlm_GetDomainArg(domain, domain_len);
- if(auth_data->PasswordLength != 0)
+ if(password_len != 0)
{
- ntlm_cred->pwlen = WideCharToMultiByte(CP_UNIXCP,
- WC_NO_BEST_FIT_CHARS, auth_data->Password,
- auth_data->PasswordLength, NULL, 0, NULL,
- NULL);
+ ntlm_cred->pwlen = WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS, password,
+ password_len, NULL, 0, NULL, NULL);
ntlm_cred->password = HeapAlloc(GetProcessHeap(), 0,
ntlm_cred->pwlen);
- WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS,
- auth_data->Password, auth_data->PasswordLength,
+ WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS, password, password_len,
ntlm_cred->password, ntlm_cred->pwlen, NULL, NULL);
}
+
+ if (auth_data->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI)
+ {
+ HeapFree(GetProcessHeap(), 0, domain);
+ HeapFree(GetProcessHeap(), 0, user);
+ HeapFree(GetProcessHeap(), 0, password);
+ }
}
phCredential->dwUpper = fCredentialUse;
--
2.3.3

View File

@ -1 +0,0 @@
Fixes: [37063] Fix handling of ANSI NTLM credentials

View File

@ -5994,7 +5994,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -95,7 +95,9 @@
@@ -104,7 +104,9 @@
sub_resource->locations &= ~WINED3D_LOCATION_SYSMEM;
}
wined3d_resource_free_sysmem(&texture->resource);
@ -6004,7 +6004,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
void wined3d_texture_validate_location(struct wined3d_texture *texture,
@@ -187,7 +189,11 @@
@@ -196,7 +198,11 @@
}
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
@ -6016,7 +6016,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
{
struct wined3d_texture_sub_resource *sub_resource;
@@ -198,10 +204,14 @@
@@ -207,10 +213,14 @@
if (locations & WINED3D_LOCATION_BUFFER)
{
data->addr = NULL;
@ -6031,7 +6031,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return;
}
if (locations & WINED3D_LOCATION_USER_MEMORY)
@@ -212,10 +222,14 @@
@@ -221,10 +231,14 @@
}
if (locations & WINED3D_LOCATION_SYSMEM)
{
@ -6046,7 +6046,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
data->addr += sub_resource->offset;
data->buffer_object = 0;
return;
@@ -301,6 +315,7 @@
@@ -310,6 +324,7 @@
/* Context activation is done by the caller. */
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
@ -6054,7 +6054,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
unsigned int sub_resource_idx, struct wined3d_context *context)
{
struct wined3d_gl_bo *buffer = texture->sub_resources[sub_resource_idx].buffer;
@@ -317,6 +332,20 @@
@@ -326,6 +341,20 @@
TRACE("Deleted buffer object %u for texture %p, sub-resource %u.\n",
name, texture, sub_resource_idx);
@ -6075,7 +6075,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -333,10 +362,17 @@
@@ -342,10 +371,17 @@
for (i = 0; i < sub_count; ++i)
{
if (texture->sub_resources[i].locations == texture->resource.map_binding
@ -6093,7 +6093,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
if (context)
@@ -404,6 +440,7 @@
@@ -479,6 +515,7 @@
resource_unload(&texture->resource);
}
@ -6101,7 +6101,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
void wined3d_texture_cleanup(struct wined3d_texture *texture)
{
unsigned int sub_count = texture->level_count * texture->layer_count;
@@ -440,6 +477,42 @@
@@ -515,6 +552,42 @@
texture->texture_ops->texture_cleanup_sub_resources(texture);
wined3d_texture_unload_gl_texture(texture);
HeapFree(GetProcessHeap(), 0, texture);
@ -6144,7 +6144,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
@@ -733,6 +806,7 @@
@@ -808,6 +881,7 @@
return refcount;
}
@ -6152,7 +6152,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
static void wined3d_texture_cleanup_main(struct wined3d_texture *texture)
{
struct wined3d_device *device = texture->resource.device;
@@ -756,6 +830,7 @@
@@ -831,6 +905,7 @@
wined3d_cs_emit_texture_cleanup(device->cs, texture);
}
@ -6160,7 +6160,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
{
ULONG refcount;
@@ -770,8 +845,14 @@
@@ -845,8 +920,14 @@
if (!refcount)
{
@ -6175,7 +6175,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
return refcount;
@@ -821,7 +902,11 @@
@@ -896,7 +977,11 @@
TRACE("Reloading because of color key value change.\n");
for (i = 0; i < sub_count; i++)
{
@ -6187,7 +6187,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
else
wined3d_texture_invalidate_location(texture, i, ~texture->resource.map_binding);
@@ -839,7 +924,11 @@
@@ -914,7 +999,11 @@
/* Reload the surfaces if the texture is marked dirty. */
for (i = 0; i < sub_count; ++i)
{
@ -6199,7 +6199,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB))
ERR("Failed to load location (srgb %#x).\n", srgb);
}
@@ -848,8 +937,15 @@
@@ -923,8 +1012,15 @@
void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
{
@ -6215,7 +6215,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
@@ -912,6 +1008,7 @@
@@ -987,6 +1083,7 @@
if (texture->lod != lod)
{
@ -6223,7 +6223,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if (wined3d_settings.cs_multithreaded)
{
struct wined3d_device *device = texture->resource.device;
@@ -919,6 +1016,7 @@
@@ -994,6 +1091,7 @@
device->cs->ops->finish(device->cs);
}
@ -6231,7 +6231,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
texture->lod = lod;
texture->texture_rgb.base_level = ~0u;
@@ -1039,10 +1137,14 @@
@@ -1114,10 +1212,14 @@
}
if (device->d3d_initialized)
@ -6246,7 +6246,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
sub_resource = &texture->sub_resources[0];
surface = sub_resource->u.surface;
@@ -1053,7 +1155,9 @@
@@ -1128,7 +1230,9 @@
}
wined3d_resource_free_sysmem(&texture->resource);
@ -6256,7 +6256,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if ((texture->row_pitch = pitch))
texture->slice_pitch = height * pitch;
@@ -1110,6 +1214,7 @@
@@ -1185,6 +1289,7 @@
wined3d_texture_invalidate_location(texture, 0, ~valid_location);
if (create_dib)
@ -6264,7 +6264,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
{
HDC dc;
wined3d_texture_get_dc(texture, 0, &dc);
@@ -1143,6 +1248,31 @@
@@ -1218,6 +1323,31 @@
* message. Freeing the actual memory and setting the read pointer to 0 is
* the task of the worker thread. */
texture->resource.map_heap_memory = NULL;
@ -6296,7 +6296,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1260,7 +1390,9 @@
@@ -1335,7 +1465,9 @@
ERR("Failed to allocate system memory.\n");
return FALSE;
}
@ -6306,7 +6306,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return TRUE;
case WINED3D_LOCATION_USER_MEMORY:
@@ -1269,7 +1401,11 @@
@@ -1344,7 +1476,11 @@
return TRUE;
case WINED3D_LOCATION_BUFFER:
@ -6318,7 +6318,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1340,7 +1476,11 @@
@@ -1415,7 +1551,11 @@
WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
context = context_acquire(texture->resource.device, NULL);
@ -6330,7 +6330,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
context, texture->resource.map_binding))
{
ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
@@ -1386,7 +1526,9 @@
@@ -1461,7 +1601,9 @@
return WINED3D_OK;
}
@ -6340,7 +6340,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
{
@@ -1409,8 +1551,12 @@
@@ -1484,8 +1626,12 @@
static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location)
{
@ -6353,7 +6353,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
/* Context activation is done by the caller. */
@@ -1531,6 +1677,10 @@
@@ -1575,6 +1721,10 @@
list_remove(&overlay->overlay_entry);
overlay->overlay_dest = NULL;
}
@ -6364,7 +6364,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
if (context)
context_release(context);
@@ -1579,7 +1729,11 @@
@@ -1623,7 +1773,11 @@
struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[i];
if (resource->pool != WINED3D_POOL_DEFAULT
@ -6376,7 +6376,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
{
wined3d_texture_invalidate_location(texture, i, ~resource->map_binding);
}
@@ -1594,8 +1748,13 @@
@@ -1638,8 +1792,13 @@
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@ -6390,7 +6390,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if (resource->type == WINED3D_RTYPE_TEXTURE_2D)
{
@@ -1620,6 +1779,7 @@
@@ -1664,6 +1823,7 @@
wined3d_texture_unload_gl_texture(texture);
}
@ -6398,7 +6398,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
void *wined3d_texture_map_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD flags)
{
struct wined3d_device *device = texture->resource.device;
@@ -1701,6 +1861,7 @@
@@ -1745,6 +1905,7 @@
return data;
}
@ -6406,7 +6406,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
@@ -1708,9 +1869,19 @@
@@ -1752,9 +1913,19 @@
struct wined3d_texture_sub_resource *sub_resource;
struct wined3d_device *device = resource->device;
unsigned int fmt_flags = resource->format_flags;
@ -6426,7 +6426,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
resource, sub_resource_idx, map_desc, debug_box(box), flags);
@@ -1757,6 +1928,7 @@
@@ -1801,6 +1972,7 @@
flags = wined3d_resource_sanitize_map_flags(resource, flags);
@ -6434,7 +6434,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if (flags & WINED3D_MAP_NOOVERWRITE)
FIXME("WINED3D_MAP_NOOVERWRITE is not implemented yet.\n");
@@ -1778,6 +1950,47 @@
@@ -1822,6 +1994,47 @@
wined3d_resource_wait_fence(&texture->resource);
base_memory = wined3d_cs_emit_texture_map(device->cs, texture, sub_resource_idx, flags);
@ -6482,7 +6482,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH)
{
@@ -1813,6 +2026,19 @@
@@ -1857,6 +2070,19 @@
}
}
@ -6502,7 +6502,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
++resource->map_count;
++sub_resource->map_count;
@@ -1822,6 +2048,7 @@
@@ -1866,6 +2092,7 @@
return WINED3D_OK;
}
@ -6510,7 +6510,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
void wined3d_texture_unmap_internal(struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
struct wined3d_context *context = NULL;
@@ -1877,6 +2104,16 @@
@@ -1921,6 +2148,16 @@
struct wined3d_texture_sub_resource *sub_resource;
struct wined3d_texture *texture;
struct wined3d_device *device = resource->device;
@ -6527,7 +6527,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
@@ -1892,6 +2129,7 @@
@@ -1936,6 +2173,7 @@
return WINEDDERR_NOTLOCKED;
}
@ -6535,7 +6535,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
wined3d_cs_emit_texture_unmap(device->cs, texture, sub_resource_idx);
if (sub_resource->unmap_dirtify)
@@ -1899,6 +2137,28 @@
@@ -1943,6 +2181,28 @@
wined3d_cs_emit_texture_changed(device->cs, texture, sub_resource_idx, sub_resource->map_buffer,
resource->map_heap_memory);
sub_resource->unmap_dirtify = FALSE;
@ -6564,7 +6564,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
--sub_resource->map_count;
@@ -1932,7 +2192,9 @@
@@ -1976,7 +2236,9 @@
&& !gl_info->supported[EXT_TEXTURE_ARRAY])
{
WARN("OpenGL implementation does not support array textures.\n");
@ -6574,7 +6574,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
@@ -1941,7 +2203,9 @@
@@ -1985,7 +2247,9 @@
if (WINED3DFMT_UNKNOWN >= desc->format)
{
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
@ -6584,7 +6584,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
@@ -1964,7 +2228,9 @@
@@ -2008,7 +2272,9 @@
if (desc->pool != WINED3D_POOL_SCRATCH)
{
WARN("Attempted to create a mipmapped/cube/array NPOT texture without unconditional NPOT support.\n");
@ -6594,7 +6594,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
@@ -1982,7 +2248,9 @@
@@ -2026,7 +2292,9 @@
{
FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n",
desc->width, desc->height);
@ -6604,7 +6604,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_NOTAVAILABLE;
}
@@ -2014,7 +2282,9 @@
@@ -2058,7 +2326,9 @@
if (desc->pool == WINED3D_POOL_DEFAULT || desc->pool == WINED3D_POOL_MANAGED)
{
WARN("Dimensions (%ux%u) exceed the maximum texture size.\n", pow2_width, pow2_height);
@ -6614,7 +6614,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_NOTAVAILABLE;
}
@@ -2028,6 +2298,7 @@
@@ -2072,6 +2342,7 @@
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
{
WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
@ -6622,7 +6622,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
HeapFree(GetProcessHeap(), 0, texture);
return WINED3DERR_INVALIDCALL;
}
@@ -2036,6 +2307,14 @@
@@ -2080,6 +2351,14 @@
{
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n");
HeapFree(GetProcessHeap(), 0, texture);
@ -6637,7 +6637,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
}
@@ -2044,7 +2323,9 @@
@@ -2088,7 +2367,9 @@
flags, device, parent, parent_ops, &texture_resource_ops)))
{
WARN("Failed to initialize texture, returning %#x.\n", hr);
@ -6647,7 +6647,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2086,7 +2367,11 @@
@@ -2130,7 +2411,11 @@
if (level_count > ~(SIZE_T)0 / layer_count
|| !(surfaces = wined3d_calloc(level_count * layer_count, sizeof(*surfaces))))
{
@ -6659,7 +6659,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return E_OUTOFMEMORY;
}
@@ -2129,7 +2414,11 @@
@@ -2173,7 +2458,11 @@
texture, idx, &sub_resource->parent, &sub_resource->parent_ops)))
{
WARN("Failed to create surface parent, hr %#x.\n", hr);
@ -6671,7 +6671,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2137,6 +2426,7 @@
@@ -2181,6 +2470,7 @@
TRACE("Created surface level %u, layer %u @ %p.\n", i, j, surface);
@ -6679,7 +6679,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
{
HDC dc;
@@ -2146,6 +2436,13 @@
@@ -2190,6 +2480,13 @@
return hr;
}
wined3d_texture_release_dc(texture, idx, dc);
@ -6693,7 +6693,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
}
}
@@ -2153,7 +2450,9 @@
@@ -2197,7 +2494,9 @@
return WINED3D_OK;
}
@ -6703,7 +6703,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
static void texture3d_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
const struct wined3d_context *context, const struct wined3d_sub_resource_data *data)
{
@@ -2201,6 +2500,23 @@
@@ -2256,6 +2555,23 @@
static void texture3d_cleanup_sub_resources(struct wined3d_texture *texture)
{
@ -6727,7 +6727,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
HeapFree(GetProcessHeap(), 0, texture->sub_resources[0].u.volume);
}
@@ -2254,7 +2570,9 @@
@@ -2309,7 +2625,9 @@
if (layer_count != 1)
{
ERR("Invalid layer count for volume texture.\n");
@ -6737,7 +6737,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return E_INVALIDARG;
}
@@ -2263,6 +2581,7 @@
@@ -2318,6 +2636,7 @@
if (WINED3DFMT_UNKNOWN >= desc->format)
{
WARN("(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.\n", texture);
@ -6745,7 +6745,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
HeapFree(GetProcessHeap(), 0, texture);
return WINED3DERR_INVALIDCALL;
}
@@ -2271,6 +2590,14 @@
@@ -2326,6 +2645,14 @@
{
WARN("(%p) : Texture cannot be created - no volume texture support.\n", texture);
HeapFree(GetProcessHeap(), 0, texture);
@ -6760,7 +6760,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
@@ -2280,6 +2607,7 @@
@@ -2335,6 +2662,7 @@
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
{
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
@ -6768,7 +6768,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
HeapFree(GetProcessHeap(), 0, texture);
return WINED3DERR_INVALIDCALL;
}
@@ -2288,6 +2616,14 @@
@@ -2343,6 +2671,14 @@
{
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n");
HeapFree(GetProcessHeap(), 0, texture);
@ -6783,7 +6783,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
}
@@ -2296,7 +2632,9 @@
@@ -2351,7 +2687,9 @@
|| desc->pool == WINED3D_POOL_SCRATCH))
{
WARN("Attempted to create a DYNAMIC texture in pool %s.\n", debug_d3dpool(desc->pool));
@ -6793,7 +6793,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
@@ -2323,7 +2661,9 @@
@@ -2378,7 +2716,9 @@
{
WARN("Attempted to create a NPOT volume texture (%u, %u, %u) without GL support.\n",
desc->width, desc->height, desc->depth);
@ -6803,7 +6803,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return WINED3DERR_INVALIDCALL;
}
}
@@ -2333,7 +2673,9 @@
@@ -2388,7 +2728,9 @@
0, device, parent, parent_ops, &texture_resource_ops)))
{
WARN("Failed to initialize texture, returning %#x.\n", hr);
@ -6813,7 +6813,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2346,6 +2688,7 @@
@@ -2401,6 +2743,7 @@
if (wined3d_texture_use_pbo(texture, gl_info))
{
wined3d_resource_free_sysmem(&texture->resource);
@ -6821,7 +6821,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
texture->resource.map_heap_memory = NULL;
texture->resource.map_binding = WINED3D_LOCATION_BUFFER;
}
@@ -2353,6 +2696,14 @@
@@ -2408,6 +2751,14 @@
if (!(volumes = wined3d_calloc(level_count, sizeof(*volumes))))
{
wined3d_texture_cleanup_main(texture);
@ -6836,7 +6836,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return E_OUTOFMEMORY;
}
@@ -2374,7 +2725,11 @@
@@ -2429,7 +2780,11 @@
texture, i, &sub_resource->parent, &sub_resource->parent_ops)))
{
WARN("Failed to create volume parent, hr %#x.\n", hr);
@ -6848,7 +6848,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2671,6 +3026,9 @@
@@ -2726,6 +3081,9 @@
if (FAILED(hr))
{
WARN("Failed to initialize texture, returning %#x.\n", hr);
@ -6858,7 +6858,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2678,7 +3036,12 @@
@@ -2733,7 +3091,12 @@
* in this case. */
if (data && FAILED(hr = wined3d_texture_upload_data(object, data)))
{
@ -6871,7 +6871,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
return hr;
}
@@ -2688,6 +3051,7 @@
@@ -2743,6 +3106,7 @@
return WINED3D_OK;
}
@ -6879,7 +6879,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
void wined3d_texture_get_dc_cs(struct wined3d_texture *texture, unsigned int sub_resource_idx)
{
struct wined3d_device *device = texture->resource.device;
@@ -2721,6 +3085,15 @@
@@ -2776,6 +3140,15 @@
struct wined3d_device *device = texture->resource.device;
struct wined3d_texture_sub_resource *sub_resource;
struct wined3d_surface *surface;
@ -6895,7 +6895,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc);
@@ -2738,6 +3111,7 @@
@@ -2793,6 +3166,7 @@
if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
return WINED3DERR_INVALIDCALL;
@ -6903,7 +6903,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
wined3d_cs_emit_get_dc(device->cs, texture, sub_resource_idx);
if (FAILED(texture->dc_hr))
return texture->dc_hr;
@@ -2762,6 +3136,30 @@
@@ -2817,6 +3191,30 @@
wined3d_texture_update_map_binding(texture);
if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE;
@ -6934,7 +6934,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
@@ -2792,6 +3190,7 @@
@@ -2847,6 +3245,7 @@
return WINED3DERR_INVALIDCALL;
}
@ -6942,7 +6942,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
wined3d_cs_emit_release_dc(device->cs, texture, sub_resource_idx);
return WINED3D_OK;
@@ -2925,4 +3324,16 @@
@@ -2980,4 +3379,16 @@
}
}
return ret;