Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2020
- 68 participants
- 931 messages
[PATCH 1/4] wined3d: Use the "bo user" mechanism to invalidate existing bindings in wined3d_buffer_gl_destroy_buffer_object().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/adapter_vk.c | 6 ++---
dlls/wined3d/buffer.c | 47 +++++++++-------------------------
dlls/wined3d/context_gl.c | 20 ++++++++++++---
dlls/wined3d/state.c | 36 ++++++++++++++++++--------
dlls/wined3d/wined3d_private.h | 8 +++---
5 files changed, 62 insertions(+), 55 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c
index 3fb9e4ce4b4..3da1615b1b5 100644
--- a/dlls/wined3d/adapter_vk.c
+++ b/dlls/wined3d/adapter_vk.c
@@ -860,10 +860,10 @@ static void *adapter_vk_map_bo_address(struct wined3d_context *context,
{
struct wined3d_context_vk *context_vk = wined3d_context_vk(context);
const struct wined3d_vk_info *vk_info;
- struct wined3d_bo_user_vk *bo_user_vk;
struct wined3d_device_vk *device_vk;
VkCommandBuffer vk_command_buffer;
VkBufferMemoryBarrier vk_barrier;
+ struct wined3d_bo_user *bo_user;
struct wined3d_bo_vk *bo, tmp;
VkMappedMemoryRange range;
void *map_ptr;
@@ -886,9 +886,9 @@ static void *adapter_vk_map_bo_address(struct wined3d_context *context,
*bo = tmp;
list_init(&bo->users);
list_move_head(&bo->users, &tmp.users);
- LIST_FOR_EACH_ENTRY(bo_user_vk, &bo->users, struct wined3d_bo_user_vk, entry)
+ LIST_FOR_EACH_ENTRY(bo_user, &bo->users, struct wined3d_bo_user, entry)
{
- bo_user_vk->valid = false;
+ bo_user->valid = false;
}
goto map;
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 5dbc66449f4..e179f202cb8 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -143,47 +143,22 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu
struct wined3d_context_gl *context_gl)
{
struct wined3d_resource *resource = &buffer_gl->b.resource;
- struct wined3d_buffer *buffer = &buffer_gl->b;
- struct wined3d_cs *cs = resource->device->cs;
if (!buffer_gl->b.buffer_object)
return;
- /* The stream source state handler might have read the memory of the
- * vertex buffer already and got the memory in the vbo which is not
- * valid any longer. Dirtify the stream source to force a reload. This
- * happens only once per changed vertexbuffer and should occur rather
- * rarely. */
- if (resource->bind_count)
- {
- if (resource->bind_flags & WINED3D_BIND_VERTEX_BUFFER)
- device_invalidate_state(resource->device, STATE_STREAMSRC);
- if (resource->bind_flags & WINED3D_BIND_INDEX_BUFFER
- && cs->state.index_buffer == buffer)
- device_invalidate_state(resource->device, STATE_INDEXBUFFER);
- if (resource->bind_flags & WINED3D_BIND_CONSTANT_BUFFER)
- {
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_HULL));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_DOMAIN));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL));
- device_invalidate_state(resource->device, STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_COMPUTE));
- }
- if (resource->bind_flags & WINED3D_BIND_STREAM_OUTPUT)
- {
- device_invalidate_state(resource->device, STATE_STREAM_OUTPUT);
- if (context_gl->c.transform_feedback_active)
- {
- /* We have to make sure that transform feedback is not active
- * when deleting a potentially bound transform feedback buffer.
- * This may happen when the device is being destroyed. */
- WARN("Deleting buffer object for buffer %p, disabling transform feedback.\n", buffer_gl);
- wined3d_context_gl_end_transform_feedback(context_gl);
- }
- }
+ if (context_gl->c.transform_feedback_active && resource->bind_count
+ && resource->bind_flags & WINED3D_BIND_STREAM_OUTPUT)
+ {
+ /* We have to make sure that transform feedback is not active
+ * when deleting a potentially bound transform feedback buffer.
+ * This may happen when the device is being destroyed. */
+ WARN("Deleting buffer object for buffer %p, disabling transform feedback.\n", buffer_gl);
+ wined3d_context_gl_end_transform_feedback(context_gl);
}
+ buffer_gl->bo_user.valid = false;
+ list_remove(&buffer_gl->bo_user.entry);
wined3d_context_gl_destroy_bo(context_gl, &buffer_gl->bo);
buffer_gl->b.buffer_object = 0;
@@ -225,6 +200,8 @@ static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buf
if (!coherent && gl_info->supported[APPLE_FLUSH_BUFFER_RANGE])
buffer_gl->b.flags |= WINED3D_BUFFER_APPLESYNC;
+ list_init(&buffer_gl->bo_user.entry);
+ list_add_head(&buffer_gl->bo.users, &buffer_gl->bo_user.entry);
buffer_gl->b.buffer_object = (uintptr_t)bo;
buffer_invalidate_bo_range(&buffer_gl->b, 0, 0);
diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 406b325cda8..305ca0507ff 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -2823,6 +2823,7 @@ bool wined3d_context_gl_create_bo(struct wined3d_context_gl *context_gl, GLsizei
bo->id = id;
bo->binding = binding;
bo->usage = usage;
+ list_init(&bo->users);
bo->command_fence_id = 0;
return true;
@@ -3718,6 +3719,8 @@ static void context_gl_load_shader_resources(struct wined3d_context_gl *context_
buffer_gl = wined3d_buffer_gl(state->cb[i][j]);
wined3d_buffer_load(&buffer_gl->b, &context_gl->c, state);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
+ if (!buffer_gl->bo_user.valid)
+ device_invalidate_state(context_gl->c.device, STATE_CONSTANT_BUFFER(i));
}
for (j = 0; j < shader->reg_maps.sampler_map.count; ++j)
@@ -3793,6 +3796,8 @@ static void context_gl_load_stream_output_buffers(struct wined3d_context_gl *con
wined3d_buffer_load(&buffer_gl->b, &context_gl->c, state);
wined3d_buffer_invalidate_location(&buffer_gl->b, ~WINED3D_LOCATION_BUFFER);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
+ if (!buffer_gl->bo_user.valid)
+ device_invalidate_state(context_gl->c.device, STATE_STREAM_OUTPUT);
}
}
@@ -3848,7 +3853,10 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
e = &context->stream_info.elements[wined3d_bit_scan(&map)];
buffer_gl = wined3d_buffer_gl(state->streams[e->stream_idx].buffer);
- wined3d_buffer_load(&buffer_gl->b, context, state);
+ if (!buffer_gl->bo_user.valid)
+ device_invalidate_state(device, STATE_STREAMSRC);
+ else
+ wined3d_buffer_load(&buffer_gl->b, context, state);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
}
/* Loading the buffers above may have invalidated the stream info. */
@@ -3862,6 +3870,8 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
if (context->stream_info.all_vbo)
{
wined3d_buffer_load(&buffer_gl->b, context, state);
+ if (!buffer_gl->bo_user.valid)
+ device_invalidate_state(device, STATE_INDEXBUFFER);
wined3d_context_gl_reference_bo(context_gl, &buffer_gl->bo);
}
else
@@ -4989,6 +4999,7 @@ void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context
gl_info->gl_ops.gl.p_glTexCoordPointer(format_gl->vtx_format, format_gl->vtx_type, e->stride,
e->data.addr + state->load_base_vertex_index * e->stride);
gl_info->gl_ops.gl.p_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ wined3d_buffer_gl(state->streams[e->stream_idx].buffer)->bo_user.valid = true;
}
else
{
@@ -5077,6 +5088,7 @@ static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *conte
checkGLcall("glVertexPointer(...)");
gl_info->gl_ops.gl.p_glEnableClientState(GL_VERTEX_ARRAY);
checkGLcall("glEnableClientState(GL_VERTEX_ARRAY)");
+ wined3d_buffer_gl(state->streams[e->stream_idx].buffer)->bo_user.valid = true;
}
/* Normals */
@@ -5100,7 +5112,7 @@ static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *conte
checkGLcall("glNormalPointer(...)");
gl_info->gl_ops.gl.p_glEnableClientState(GL_NORMAL_ARRAY);
checkGLcall("glEnableClientState(GL_NORMAL_ARRAY)");
-
+ wined3d_buffer_gl(state->streams[e->stream_idx].buffer)->bo_user.valid = true;
}
else
{
@@ -5130,7 +5142,7 @@ static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *conte
checkGLcall("glColorPointer(4, GL_UNSIGNED_BYTE, ...)");
gl_info->gl_ops.gl.p_glEnableClientState(GL_COLOR_ARRAY);
checkGLcall("glEnableClientState(GL_COLOR_ARRAY)");
-
+ wined3d_buffer_gl(state->streams[e->stream_idx].buffer)->bo_user.valid = true;
}
else
{
@@ -5199,6 +5211,7 @@ static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *conte
}
gl_info->gl_ops.gl.p_glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT);
checkGLcall("glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT)");
+ wined3d_buffer_gl(state->streams[e->stream_idx].buffer)->bo_user.valid = true;
}
else
{
@@ -5292,6 +5305,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
format_gl = wined3d_format_gl(element->format);
stream = &state->streams[element->stream_idx];
+ wined3d_buffer_gl(stream->buffer)->bo_user.valid = true;
if ((stream->flags & WINED3DSTREAMSOURCE_INSTANCEDATA) && !context->instance_count)
context->instance_count = state->streams[0].frequency;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 71f7ac53a2f..e40c23daf03 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4452,12 +4452,17 @@ static void indexbuffer(struct wined3d_context *context, const struct wined3d_st
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
const struct wined3d_stream_info *stream_info = &context->stream_info;
- const struct wined3d_buffer *ib = state->index_buffer;
+ struct wined3d_buffer_gl *buffer_gl;
- if (!ib || !stream_info->all_vbo)
+ if (!state->index_buffer || !stream_info->all_vbo)
+ {
GL_EXTCALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
- else
- GL_EXTCALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, wined3d_buffer_gl_const(ib)->bo.id));
+ return;
+ }
+
+ buffer_gl = wined3d_buffer_gl(state->index_buffer);
+ GL_EXTCALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer_gl->bo.id));
+ buffer_gl->bo_user.valid = true;
}
static void depth_clip(const struct wined3d_rasterizer_state *r, const struct wined3d_gl_info *gl_info)
@@ -4550,7 +4555,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
{
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
enum wined3d_shader_type shader_type;
- struct wined3d_buffer *buffer;
+ struct wined3d_buffer_gl *buffer_gl;
unsigned int i, base, count;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@@ -4563,8 +4568,15 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
wined3d_gl_limits_get_uniform_block_range(&gl_info->limits, shader_type, &base, &count);
for (i = 0; i < count; ++i)
{
- buffer = state->cb[shader_type][i];
- GL_EXTCALL(glBindBufferBase(GL_UNIFORM_BUFFER, base + i, buffer ? wined3d_buffer_gl(buffer)->bo.id : 0));
+ if (!state->cb[shader_type][i])
+ {
+ GL_EXTCALL(glBindBufferBase(GL_UNIFORM_BUFFER, base + i, 0));
+ continue;
+ }
+
+ buffer_gl = wined3d_buffer_gl(state->cb[shader_type][i]);
+ GL_EXTCALL(glBindBufferBase(GL_UNIFORM_BUFFER, base + i, buffer_gl->bo.id));
+ buffer_gl->bo_user.valid = true;
}
checkGLcall("bind constant buffers");
}
@@ -4614,7 +4626,7 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state
{
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
- struct wined3d_buffer *buffer;
+ struct wined3d_buffer_gl *buffer_gl;
unsigned int offset, size, i;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@@ -4623,20 +4635,22 @@ static void state_so(struct wined3d_context *context, const struct wined3d_state
for (i = 0; i < ARRAY_SIZE(state->stream_output); ++i)
{
- if (!(buffer = state->stream_output[i].buffer))
+ if (!state->stream_output[i].buffer)
{
GL_EXTCALL(glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, i, 0));
continue;
}
+ buffer_gl = wined3d_buffer_gl(state->stream_output[i].buffer);
offset = state->stream_output[i].offset;
if (offset == ~0u)
{
FIXME("Appending to stream output buffers not implemented.\n");
offset = 0;
}
- size = buffer->resource.size - offset;
- GL_EXTCALL(glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, i, wined3d_buffer_gl(buffer)->bo.id, offset, size));
+ size = buffer_gl->b.resource.size - offset;
+ GL_EXTCALL(glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, i, buffer_gl->bo.id, offset, size));
+ buffer_gl->bo_user.valid = true;
}
checkGLcall("bind transform feedback buffers");
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 67caf98ead7..67a55c4dedd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1575,6 +1575,7 @@ struct wined3d_bo_gl
GLenum binding;
GLenum usage;
+ struct list users;
uint64_t command_fence_id;
};
@@ -1583,7 +1584,7 @@ static inline GLuint wined3d_bo_gl_id(uintptr_t bo)
return bo ? ((struct wined3d_bo_gl *)bo)->id : 0;
}
-struct wined3d_bo_user_vk
+struct wined3d_bo_user
{
struct list entry;
bool valid;
@@ -4875,6 +4876,7 @@ struct wined3d_buffer_gl
struct wined3d_buffer b;
struct wined3d_bo_gl bo;
+ struct wined3d_bo_user bo_user;
};
static inline struct wined3d_buffer_gl *wined3d_buffer_gl(struct wined3d_buffer *buffer)
@@ -4898,7 +4900,7 @@ struct wined3d_buffer_vk
struct wined3d_buffer b;
struct wined3d_bo_vk bo;
- struct wined3d_bo_user_vk bo_user;
+ struct wined3d_bo_user bo_user;
VkDescriptorBufferInfo buffer_info;
};
@@ -5029,7 +5031,7 @@ HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view
struct wined3d_view_vk
{
- struct wined3d_bo_user_vk bo_user;
+ struct wined3d_bo_user bo_user;
union
{
VkBufferView vk_buffer_view;
--
2.20.1
Dec. 4, 2020
Re: Wine staging 5.19 release
by Gerald Pfeifer
On Sat, 24 Oct 2020, Gerald Pfeifer wrote:
> Here is a patch on top (of the Wine Staging patchset) that is required.
>
> Can you please include that? Thank you!
Thanks to (I believe Zebediah) for addressing those issues!
I have to confess there is one snippet I missed. With the additional
patch below Wine 5.22 + Staging patchset builds on FreeBSD 11 out of
the box.
Thank you for considering that; for now I'm carrying it as part of
the FreeBSD emulators/wine-devel port.
Gerald
--- dlls/ntdll/unix/file.c.orig 2020-11-07 09:33:27.083812000 +0000
+++ dlls/ntdll/unix/file.c 2020-11-07 09:53:55.641522000 +0000
@@ -394,6 +394,18 @@
#define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1)
#endif
+#ifdef HAVE_SYS_EXTATTR_H
+static inline int xattr_valid_namespace( const char *name )
+{
+ if (strncmp( XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN ) != 0)
+ {
+ errno = EPERM;
+ return 0;
+ }
+ return 1;
+}
+#endif
+
static int xattr_fremove( int filedes, const char *name )
{
#if defined(XATTR_ADDITIONAL_OPTIONS)
Dec. 4, 2020
[PATCH] bcrypt: Add initial support for asymmetric keys in BCryptDecrypt().
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/bcrypt/bcrypt_internal.h | 1 +
dlls/bcrypt/bcrypt_main.c | 22 ++++++++++++++++--
dlls/bcrypt/gnutls.c | 43 +++++++++++++++++++++++++++++++++++
dlls/bcrypt/macos.c | 8 +++++++
4 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
index e1777ed130b..eb136111509 100644
--- a/dlls/bcrypt/bcrypt_internal.h
+++ b/dlls/bcrypt/bcrypt_internal.h
@@ -206,6 +206,7 @@ struct key_funcs
void (CDECL *key_symmetric_destroy)( struct key * );
NTSTATUS (CDECL *key_asymmetric_init)( struct key * );
NTSTATUS (CDECL *key_asymmetric_generate)( struct key * );
+ NTSTATUS (CDECL *key_asymmetric_decrypt)( struct key *, UCHAR *, ULONG, UCHAR *, ULONG * );
NTSTATUS (CDECL *key_asymmetric_duplicate)( struct key *, struct key * );
NTSTATUS (CDECL *key_asymmetric_sign)( struct key *, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG *, ULONG );
NTSTATUS (CDECL *key_asymmetric_verify)( struct key *, void *, UCHAR *, ULONG, UCHAR *, ULONG, DWORD );
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
index 591c01c710c..a1423dcd836 100644
--- a/dlls/bcrypt/bcrypt_main.c
+++ b/dlls/bcrypt/bcrypt_main.c
@@ -1160,8 +1160,8 @@ static NTSTATUS key_encrypt( struct key *key, UCHAR *input, ULONG input_len, vo
return status;
}
-static NTSTATUS key_decrypt( struct key *key, UCHAR *input, ULONG input_len, void *padding, UCHAR *iv,
- ULONG iv_len, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags )
+static NTSTATUS key_symmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len, void *padding, UCHAR *iv,
+ ULONG iv_len, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags )
{
ULONG bytes_left = input_len;
UCHAR *buf, *src, *dst;
@@ -1240,6 +1240,24 @@ static NTSTATUS key_decrypt( struct key *key, UCHAR *input, ULONG input_len, voi
return status;
}
+static NTSTATUS key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len, UCHAR *output,
+ ULONG output_len, ULONG *ret_len )
+{
+ NTSTATUS status;
+
+ if (!(status = key_funcs->key_asymmetric_decrypt( key, input, input_len, output, &output_len )))
+ *ret_len = output_len;
+
+ return status;
+}
+
+static NTSTATUS key_decrypt( struct key *key, UCHAR *input, ULONG input_len, void *padding, UCHAR *iv,
+ ULONG iv_len, UCHAR *output, ULONG output_len, ULONG *ret_len, ULONG flags )
+{
+ return key_is_symmetric( key ) ? key_symmetric_decrypt( key, input, input_len, padding, iv, iv_len,
+ output, output_len, ret_len, flags ) : key_asymmetric_decrypt( key, input, input_len, output, output_len, ret_len );
+}
+
static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYPT_KEY_HANDLE *ret_key, UCHAR *input,
ULONG input_len )
{
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index 162ac9ea732..c065ac31fba 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -109,6 +109,7 @@ static int (*pgnutls_privkey_generate)(gnutls_privkey_t, gnutls_pk_algorithm_t,
static int (*pgnutls_privkey_import_rsa_raw)(gnutls_privkey_t, const gnutls_datum_t *, const gnutls_datum_t *,
const gnutls_datum_t *, const gnutls_datum_t *, const gnutls_datum_t *,
const gnutls_datum_t *, const gnutls_datum_t *, const gnutls_datum_t *);
+static int (*pgnutls_privkey_decrypt_data)(gnutls_privkey_t, unsigned int flags, const gnutls_datum_t *, gnutls_datum_t *);
/* Not present in gnutls version < 3.6.0 */
static int (*pgnutls_decode_rs_value)(const gnutls_datum_t *, gnutls_datum_t *, gnutls_datum_t *);
@@ -124,6 +125,7 @@ MAKE_FUNCPTR(gnutls_global_init);
MAKE_FUNCPTR(gnutls_global_set_log_function);
MAKE_FUNCPTR(gnutls_global_set_log_level);
MAKE_FUNCPTR(gnutls_perror);
+MAKE_FUNCPTR(gnutls_privkey_decrypt_data);
MAKE_FUNCPTR(gnutls_privkey_deinit);
MAKE_FUNCPTR(gnutls_privkey_import_dsa_raw);
MAKE_FUNCPTR(gnutls_privkey_init);
@@ -215,6 +217,12 @@ static int compat_gnutls_privkey_import_rsa_raw(gnutls_privkey_t key, const gnut
return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
}
+static int compat_gnutls_privkey_decrypt_data(gnutls_privkey_t key, unsigned int flags, const gnutls_datum_t *cipher_text,
+ gnutls_datum_t *plain_text)
+{
+ return GNUTLS_E_UNKNOWN_PK_ALGORITHM;
+}
+
static void gnutls_log( int level, const char *msg )
{
TRACE( "<%d> %s", level, msg );
@@ -341,6 +349,11 @@ static BOOL gnutls_initialize(void)
WARN("gnutls_privkey_import_rsa_raw not found\n");
pgnutls_privkey_import_rsa_raw = compat_gnutls_privkey_import_rsa_raw;
}
+ if (!(pgnutls_privkey_decrypt_data = dlsym( libgnutls_handle, "gnutls_privkey_decrypt_data" )))
+ {
+ WARN("gnutls_privkey_decrypt_data not found\n");
+ pgnutls_privkey_decrypt_data = compat_gnutls_privkey_decrypt_data;
+ }
if (TRACE_ON( bcrypt ))
{
@@ -1883,6 +1896,35 @@ static NTSTATUS CDECL key_asymmetric_duplicate( struct key *key_orig, struct key
return STATUS_SUCCESS;
}
+static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len,
+ UCHAR *output, ULONG *output_len )
+{
+ gnutls_datum_t e, d = { 0 };
+ NTSTATUS status = STATUS_SUCCESS;
+ int ret;
+
+ e.data = (unsigned char *)input;
+ e.size = input_len;
+
+ if ((ret = pgnutls_privkey_decrypt_data( key_data(key)->privkey, 0, &e, &d )))
+ {
+ pgnutls_perror( ret );
+ return STATUS_INTERNAL_ERROR;
+ }
+
+ if (*output_len >= d.size)
+ {
+ *output_len = d.size;
+ memcpy( output, d.data, *output_len );
+ }
+ else
+ status = STATUS_BUFFER_TOO_SMALL;
+
+ free( d.data );
+
+ return status;
+}
+
static const struct key_funcs key_funcs =
{
key_set_property,
@@ -1895,6 +1937,7 @@ static const struct key_funcs key_funcs =
key_symmetric_destroy,
key_asymmetric_init,
key_asymmetric_generate,
+ key_asymmetric_decrypt,
key_asymmetric_duplicate,
key_asymmetric_sign,
key_asymmetric_verify,
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
index 57edc3e262b..44906519cef 100644
--- a/dlls/bcrypt/macos.c
+++ b/dlls/bcrypt/macos.c
@@ -271,6 +271,13 @@ static NTSTATUS CDECL key_asymmetric_duplicate( struct key *key_orig, struct key
return STATUS_NOT_IMPLEMENTED;
}
+static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len,
+ UCHAR *output, ULONG *output_len )
+{
+ FIXME( "not implemented on Mac\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
static const struct key_funcs key_funcs =
{
key_set_property,
@@ -283,6 +290,7 @@ static const struct key_funcs key_funcs =
key_symmetric_destroy,
key_asymmetric_init,
key_asymmetric_generate,
+ key_asymmetric_decrypt,
key_asymmetric_duplicate,
key_asymmetric_sign,
key_asymmetric_verify,
--
2.29.2
Dec. 4, 2020
[PATCH 2/2] quartz/vmr9: Allow the aspect ratio parameters to be NULL in IVMRWindowlessControl::GetNativeVideoSize().
by Akihiro Sagawa
Please refer to the commit 45789e00dad69a2609b6a104b71731fe483428b0 which
fixes IVMRWindowlessControl9::GetNativeVideoSize().
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
dlls/quartz/tests/vmr7.c | 6 +++---
dlls/quartz/vmr9.c | 24 ++++++++++++------------
2 files changed, 15 insertions(+), 15 deletions(-)
Dec. 4, 2020
[PATCH 1/2] quartz/tests: Add some tests for VMR7 windowless video size.
by Akihiro Sagawa
This is a port of VMR9 commit fd159a356345d71d96d158e9a87bd8e4ec1a699d.
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
dlls/quartz/tests/vmr7.c | 134 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 133 insertions(+), 1 deletion(-)
Dec. 4, 2020
Dec. 4, 2020
Re: [PATCH] localspl: Use wide-char string literals.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH] ntdll/sec: Add RtlDefaultNpAcl stub.
by Biswapriyo Nath
Any comment on this patch to improve?
Dec. 4, 2020
Re: [PATCH vkd3d v2 5/5] vkd3d-shader: Implement basic support for #if and #endif.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83096
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
Dec. 4, 2020
Re: [PATCH vkd3d v2 4/5] vkd3d-shader: Handle preprocessor parsing errors.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83095
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
Dec. 4, 2020
Re: [PATCH vkd3d v2 3/5] vkd3d-shader: Preserve some tokens verbatim for HLSL.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83094
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
Dec. 4, 2020
Re: [PATCH vkd3d v2 2/5] vkd3d-shader: Parse comments in the preprocessor.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83093
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
Dec. 4, 2020
Re: [PATCH vkd3d v2 1/5] vkd3d-shader: Implement an initial pass-through HLSL preprocessor.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83092
Your paranoid android.
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: configure.ac:30
Task: Patch failed to apply
Dec. 4, 2020
[PATCH vkd3d v2 5/5] vkd3d-shader: Implement basic support for #if and #endif.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
include/private/vkd3d_memory.h | 11 +++
libs/vkd3d-shader/preproc.h | 16 ++++
libs/vkd3d-shader/preproc.l | 94 ++++++++++++++++++--
libs/vkd3d-shader/preproc.y | 106 ++++++++++++++++++++++-
libs/vkd3d-shader/vkd3d_shader_main.c | 15 ++++
libs/vkd3d-shader/vkd3d_shader_private.h | 6 ++
tests/hlsl_d3d12.c | 2 +-
7 files changed, 242 insertions(+), 8 deletions(-)
diff --git a/include/private/vkd3d_memory.h b/include/private/vkd3d_memory.h
index df93abf5..bd56d30a 100644
--- a/include/private/vkd3d_memory.h
+++ b/include/private/vkd3d_memory.h
@@ -22,6 +22,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include "vkd3d_debug.h"
@@ -54,6 +55,16 @@ static inline void vkd3d_free(void *ptr)
free(ptr);
}
+static inline char *vkd3d_strdup(const char *string)
+{
+ size_t len = strlen(string) + 1;
+ char *ptr;
+
+ if ((ptr = vkd3d_malloc(len)))
+ memcpy(ptr, string, len);
+ return ptr;
+}
+
bool vkd3d_array_reserve(void **elements, size_t *capacity,
size_t element_count, size_t element_size) DECLSPEC_HIDDEN;
diff --git a/libs/vkd3d-shader/preproc.h b/libs/vkd3d-shader/preproc.h
index 769b8c23..29fbbd02 100644
--- a/libs/vkd3d-shader/preproc.h
+++ b/libs/vkd3d-shader/preproc.h
@@ -29,6 +29,12 @@ struct preproc_location
unsigned int first_line, first_column;
};
+struct preproc_if_state
+{
+ /* Are we currently in a "true" block? */
+ bool current_true;
+};
+
struct preproc_ctx
{
void *scanner;
@@ -38,7 +44,17 @@ struct preproc_ctx
unsigned int line, column;
const char *source_name;
+ struct preproc_if_state *if_stack;
+ size_t if_count, if_stack_size;
+
+ int current_directive;
+
+ bool last_was_newline;
+
bool error;
};
+void preproc_warning(struct preproc_ctx *ctx, const struct preproc_location *loc,
+ enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN;
+
#endif
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l
index c0c6b13a..e9a5b14a 100644
--- a/libs/vkd3d-shader/preproc.l
+++ b/libs/vkd3d-shader/preproc.l
@@ -50,6 +50,7 @@ static void update_location(struct preproc_ctx *ctx);
%s C_COMMENT
%s CXX_COMMENT
+NEWLINE \r?\n
WS [ \t]
IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
@@ -57,10 +58,10 @@ IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
<INITIAL>"//" {yy_push_state(CXX_COMMENT, yyscanner);}
<INITIAL>"/*" {yy_push_state(C_COMMENT, yyscanner);}
-<CXX_COMMENT>\\\r?\n {}
+<CXX_COMMENT>\\{NEWLINE} {}
<CXX_COMMENT>\n {
yy_pop_state(yyscanner);
- return T_TEXT;
+ return T_NEWLINE;
}
<C_COMMENT>"*/" {yy_pop_state(yyscanner);}
<C_COMMENT,CXX_COMMENT><<EOF>> {yy_pop_state(yyscanner);}
@@ -68,13 +69,15 @@ IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
<INITIAL>{IDENTIFIER} {return T_TEXT;}
+ /* We have no use for floats, but shouldn't parse them as integers. */
+
<INITIAL>[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[hHfF]? {return T_TEXT;}
<INITIAL>[0-9]+\.([eE][+-]?[0-9]+)?[hHfF]? {return T_TEXT;}
<INITIAL>[0-9]+([eE][+-]?[0-9]+)?[hHfF] {return T_TEXT;}
<INITIAL>[0-9]+[eE][+-]?[0-9]+ {return T_TEXT;}
-<INITIAL>0[xX][0-9a-fA-f]+[ul]{0,2} {return T_TEXT;}
-<INITIAL>0[0-7]*[ul]{0,2} {return T_TEXT;}
-<INITIAL>[1-9][0-9]*[ul]{0,2} {return T_TEXT;}
+<INITIAL>0[xX][0-9a-fA-f]+[ul]{0,2} {return T_INTEGER;}
+<INITIAL>0[0-7]*[ul]{0,2} {return T_INTEGER;}
+<INITIAL>[1-9][0-9]*[ul]{0,2} {return T_INTEGER;}
<INITIAL>"&&" {return T_TEXT;}
<INITIAL>"||" {return T_TEXT;}
@@ -87,6 +90,29 @@ IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
/* C strings (including escaped quotes). */
<INITIAL>\"([^"\\]|\\.)*\" {return T_TEXT;}
+<INITIAL>#{WS}*{IDENTIFIER} {
+ struct preproc_ctx *ctx = yyget_extra(yyscanner);
+ const char *p;
+
+ if (!ctx->last_was_newline)
+ return T_TEXT;
+
+ for (p = yytext + 1; strchr(" \t", *p); ++p)
+ ;
+
+ if (!strcmp(p, "endif"))
+ return T_ENDIF;
+ if (!strcmp(p, "if"))
+ return T_IF;
+
+ preproc_warning(ctx, yyget_lloc(yyscanner), VKD3D_SHADER_WARNING_PP_UNKNOWN_DIRECTIVE,
+ "Ignoring unknown directive \"%s\".", yytext);
+ return T_TEXT;
+ }
+
+<INITIAL>\\{NEWLINE} {}
+<INITIAL>{NEWLINE} {return T_NEWLINE;}
+
<INITIAL>{WS}+ {}
<INITIAL>. {return T_TEXT;}
@@ -114,6 +140,27 @@ static void update_location(struct preproc_ctx *ctx)
}
}
+static bool preproc_is_writing(struct preproc_ctx *ctx)
+{
+ if (!ctx->if_count)
+ return true;
+ return ctx->if_stack[ctx->if_count - 1].current_true;
+}
+
+static int return_token(int token, YYSTYPE *lval, const char *text)
+{
+ switch (token)
+ {
+ case T_INTEGER:
+ case T_TEXT:
+ if (!(lval->string = vkd3d_strdup(text)))
+ return PREPROC_YYerror;
+ break;
+ }
+
+ return token;
+}
+
int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
{
struct preproc_ctx *ctx = yyget_extra(scanner);
@@ -127,7 +174,32 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
return PREPROC_YYEOF;
text = yyget_text(scanner);
- TRACE("Parsing token %d, line %d, string %s.\n", token, lloc->first_line, debugstr_a(text));
+ lloc->filename = ctx->source_name;
+
+ if (ctx->last_was_newline)
+ {
+ switch (token)
+ {
+ case T_ENDIF:
+ case T_IF:
+ ctx->current_directive = token;
+ break;
+
+ default:
+ ctx->current_directive = 0;
+ }
+ }
+
+ ctx->last_was_newline = (token == T_NEWLINE);
+
+ TRACE("Parsing token %d, line %d, in directive %d, string %s.\n", token,
+ lloc->first_line, ctx->current_directive, debugstr_a(text));
+
+ if (!ctx->current_directive && !preproc_is_writing(ctx))
+ continue;
+
+ if (ctx->current_directive)
+ return return_token(token, lval, text);
vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text);
}
@@ -148,12 +220,22 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
yylex_init_extra(&ctx, &ctx.scanner);
top_buffer = yy_scan_bytes(compile_info->source.code, compile_info->source.size, ctx.scanner);
+ ctx.last_was_newline = true;
preproc_yyparse(ctx.scanner, &ctx);
yy_delete_buffer(top_buffer, ctx.scanner);
yylex_destroy(ctx.scanner);
+ if (ctx.if_count)
+ {
+ const struct preproc_location loc = {.filename = ctx.source_name};
+
+ preproc_warning(&ctx, &loc, VKD3D_SHADER_WARNING_PP_UNTERMINATED_IF, "Unterminated #if block.");
+ }
+
+ vkd3d_free(ctx.if_stack);
+
if (ctx.error)
{
WARN("Failed to preprocess.\n");
diff --git a/libs/vkd3d-shader/preproc.y b/libs/vkd3d-shader/preproc.y
index 88b855c6..4353d10c 100644
--- a/libs/vkd3d-shader/preproc.y
+++ b/libs/vkd3d-shader/preproc.y
@@ -72,11 +72,71 @@ static void preproc_error(struct preproc_ctx *ctx, const struct preproc_location
ctx->error = true;
}
+void preproc_warning(struct preproc_ctx *ctx, const struct preproc_location *loc,
+ enum vkd3d_shader_error error, const char *format, ...)
+{
+ va_list args;
+
+ set_location(ctx, loc);
+ va_start(args, format);
+ vkd3d_shader_vwarning(ctx->message_context, error, format, args);
+ va_end(args);
+}
+
static void yyerror(const YYLTYPE *loc, void *scanner, struct preproc_ctx *ctx, const char *string)
{
preproc_error(ctx, loc, VKD3D_SHADER_ERROR_PP_INVALID_SYNTAX, "%s", string);
}
+static bool preproc_was_writing(struct preproc_ctx *ctx)
+{
+ if (ctx->if_count < 2)
+ return true;
+ return ctx->if_stack[ctx->if_count - 2].current_true;
+}
+
+static bool preproc_push_if(struct preproc_ctx *ctx, bool condition)
+{
+ struct preproc_if_state *state;
+
+ if (!vkd3d_array_reserve((void **)&ctx->if_stack, &ctx->if_stack_size, ctx->if_count + 1, sizeof(*ctx->if_stack)))
+ return false;
+ state = &ctx->if_stack[ctx->if_count++];
+ state->current_true = condition && preproc_was_writing(ctx);
+ return true;
+}
+
+static int char_to_int(char c)
+{
+ if ('0' <= c && c <= '9')
+ return c - '0';
+ if ('A' <= c && c <= 'F')
+ return c - 'A' + 10;
+ if ('a' <= c && c <= 'f')
+ return c - 'a' + 10;
+ return -1;
+}
+
+static uint32_t preproc_parse_integer(const char *s)
+{
+ uint32_t base = 10, ret = 0;
+ int digit;
+
+ if (s[0] == '0')
+ {
+ base = 8;
+ if (s[1] == 'x' || s[1] == 'X')
+ {
+ base = 16;
+ s += 2;
+ }
+ }
+
+ while ((digit = char_to_int(*s++)) >= 0)
+ ret = ret * base + (uint32_t)digit;
+ return ret;
+}
+
}
%define api.location.type {struct preproc_location}
@@ -89,9 +149,53 @@ static void yyerror(const YYLTYPE *loc, void *scanner, struct preproc_ctx *ctx,
%parse-param {void *scanner}
%parse-param {struct preproc_ctx *ctx}
-%token T_TEXT
+%union
+{
+ char *string;
+ uint32_t integer;
+}
+
+%token <string> T_INTEGER
+%token <string> T_TEXT
+
+%token T_NEWLINE
+
+%token T_ENDIF "#endif"
+%token T_IF "#if"
+
+%type <integer> expr
%%
shader_text
: %empty
+ | shader_text directive
+ {
+ vkd3d_string_buffer_printf(&ctx->buffer, "\n");
+ }
+
+directive
+ : T_IF expr newline
+ {
+ if (!preproc_push_if(ctx, !!$2))
+ YYABORT;
+ }
+ | T_ENDIF newline
+ {
+ if (ctx->if_count)
+ --ctx->if_count;
+ else
+ preproc_warning(ctx, &@$, VKD3D_SHADER_WARNING_PP_INVALID_DIRECTIVE,
+ "Ignoring #endif without prior #if.");
+ }
+
+newline
+ : T_NEWLINE
+ | YYEOF
+
+expr
+ : T_INTEGER
+ {
+ $$ = preproc_parse_integer($1);
+ vkd3d_free($1);
+ }
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index eed0316c..ad456133 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -148,6 +148,21 @@ bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_cont
return true;
}
+void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context,
+ enum vkd3d_shader_error error, const char *format, va_list args)
+{
+ if (context->log_level < VKD3D_SHADER_LOG_WARNING)
+ return;
+
+ if (context->line)
+ vkd3d_string_buffer_printf(&context->messages, "%s:%u:%u: W%04u: ",
+ context->source_name, context->line, context->column, error);
+ else
+ vkd3d_string_buffer_printf(&context->messages, "%s: W%04u: ", context->source_name, error);
+ vkd3d_string_buffer_vprintf(&context->messages, format, args);
+ vkd3d_string_buffer_printf(&context->messages, "\n");
+}
+
void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
enum vkd3d_shader_error error, const char *format, va_list args)
{
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 5a022708..01a74ede 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -81,6 +81,10 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES = 3004,
VKD3D_SHADER_ERROR_PP_INVALID_SYNTAX = 4000,
+
+ VKD3D_SHADER_WARNING_PP_INVALID_DIRECTIVE = 5001,
+ VKD3D_SHADER_WARNING_PP_UNKNOWN_DIRECTIVE = 5003,
+ VKD3D_SHADER_WARNING_PP_UNTERMINATED_IF = 5005,
};
enum VKD3D_SHADER_INSTRUCTION_HANDLER
@@ -867,6 +871,8 @@ void vkd3d_shader_error(struct vkd3d_shader_message_context *context, enum vkd3d
const char *format, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN;
void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
enum vkd3d_shader_error error, const char *format, va_list args) DECLSPEC_HIDDEN;
+void vkd3d_shader_vwarning(struct vkd3d_shader_message_context *context,
+ enum vkd3d_shader_error error, const char *format, va_list args) DECLSPEC_HIDDEN;
int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length,
struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN;
diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c
index 61324fa9..77a7ea1a 100644
--- a/tests/hlsl_d3d12.c
+++ b/tests/hlsl_d3d12.c
@@ -414,7 +414,7 @@ static void test_preprocess(void)
hr = D3DPreprocess(test_include_top, strlen(test_include_top), NULL, NULL, &test_include_fail, &blob, &errors);
todo ok(hr == E_FAIL, "Got hr %#x.\n", hr);
todo ok(blob == (ID3D10Blob *)0xdeadbeef, "Expected no compiled shader blob.\n");
- todo ok(!!errors, "Expected non-NULL error blob.\n");
+ ok(!!errors, "Expected non-NULL error blob.\n");
if (errors)
{
if (vkd3d_test_state.debug_level)
--
2.29.2
Dec. 4, 2020
[PATCH vkd3d v2 4/5] vkd3d-shader: Handle preprocessor parsing errors.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/preproc.h | 11 +++++++
libs/vkd3d-shader/preproc.l | 39 +++++++++++++++++++++++-
libs/vkd3d-shader/preproc.y | 39 +++++++++++++++++++++++-
libs/vkd3d-shader/vkd3d_shader_private.h | 2 ++
4 files changed, 89 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/preproc.h b/libs/vkd3d-shader/preproc.h
index cbd93229..769b8c23 100644
--- a/libs/vkd3d-shader/preproc.h
+++ b/libs/vkd3d-shader/preproc.h
@@ -23,11 +23,22 @@
#include "vkd3d_shader_private.h"
+struct preproc_location
+{
+ const char *filename;
+ unsigned int first_line, first_column;
+};
+
struct preproc_ctx
{
void *scanner;
+ struct vkd3d_shader_message_context *message_context;
struct vkd3d_string_buffer buffer;
+ unsigned int line, column;
+ const char *source_name;
+
+ bool error;
};
#endif
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l
index f931292b..c0c6b13a 100644
--- a/libs/vkd3d-shader/preproc.l
+++ b/libs/vkd3d-shader/preproc.l
@@ -27,6 +27,10 @@
#define YY_DECL static int preproc_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
+static void update_location(struct preproc_ctx *ctx);
+
+#define YY_USER_ACTION update_location(yyget_extra(yyscanner));
+
%}
%option 8bit
@@ -88,6 +92,28 @@ IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
%%
+static void update_location(struct preproc_ctx *ctx)
+{
+ unsigned int i, leng = yyget_leng(ctx->scanner);
+ const char *text = yyget_text(ctx->scanner);
+
+ /* We want to do this here, rather than before calling yylex(), because
+ * some tokens are skipped by the lexer. */
+
+ yyget_lloc(ctx->scanner)->first_line = ctx->line;
+ yyget_lloc(ctx->scanner)->first_column = ctx->column;
+
+ for (i = 0; i < leng; ++i)
+ {
+ ++ctx->column;
+ if (text[i] == '\n')
+ {
+ ctx->column = 1;
+ ++ctx->line;
+ }
+ }
+}
+
int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
{
struct preproc_ctx *ctx = yyget_extra(scanner);
@@ -101,7 +127,7 @@ int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
return PREPROC_YYEOF;
text = yyget_text(scanner);
- TRACE("Parsing token %d, string %s.\n", token, debugstr_a(text));
+ TRACE("Parsing token %d, line %d, string %s.\n", token, lloc->first_line, debugstr_a(text));
vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text);
}
@@ -115,6 +141,10 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
void *output_code;
vkd3d_string_buffer_init(&ctx.buffer);
+ ctx.message_context = message_context;
+ ctx.source_name = compile_info->source_name ? compile_info->source_name : "<anonymous>";
+ ctx.line = 1;
+ ctx.column = 1;
yylex_init_extra(&ctx, &ctx.scanner);
top_buffer = yy_scan_bytes(compile_info->source.code, compile_info->source.size, ctx.scanner);
@@ -124,6 +154,13 @@ int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
yy_delete_buffer(top_buffer, ctx.scanner);
yylex_destroy(ctx.scanner);
+ if (ctx.error)
+ {
+ WARN("Failed to preprocess.\n");
+ vkd3d_string_buffer_cleanup(&ctx.buffer);
+ return VKD3D_ERROR_INVALID_SHADER;
+ }
+
if (!(output_code = vkd3d_malloc(ctx.buffer.content_size)))
{
vkd3d_string_buffer_cleanup(&ctx.buffer);
diff --git a/libs/vkd3d-shader/preproc.y b/libs/vkd3d-shader/preproc.y
index 92448f24..88b855c6 100644
--- a/libs/vkd3d-shader/preproc.y
+++ b/libs/vkd3d-shader/preproc.y
@@ -36,13 +36,50 @@ int preproc_yylex(PREPROC_YYSTYPE *yylval_param, PREPROC_YYLTYPE *yylloc_param,
%code
{
+#define YYLLOC_DEFAULT(cur, rhs, n) \
+ do \
+ { \
+ if (n) \
+ { \
+ (cur).filename = YYRHSLOC(rhs, 1).filename; \
+ (cur).first_line = YYRHSLOC(rhs, 1).first_line; \
+ (cur).first_column = YYRHSLOC(rhs, 1).first_column; \
+ } \
+ else \
+ { \
+ (cur).filename = YYRHSLOC(rhs, 0).filename; \
+ (cur).first_line = YYRHSLOC(rhs, 0).first_line; \
+ (cur).first_column = YYRHSLOC(rhs, 0).first_column; \
+ } \
+ } while (0)
+
+static void set_location(struct preproc_ctx *ctx, const struct preproc_location *loc)
+{
+ ctx->message_context->source_name = loc->filename;
+ ctx->message_context->line = loc->first_line;
+ ctx->message_context->column = loc->first_column;
+}
+
+static void preproc_error(struct preproc_ctx *ctx, const struct preproc_location *loc,
+ enum vkd3d_shader_error error, const char *format, ...)
+{
+ va_list args;
+
+ set_location(ctx, loc);
+ va_start(args, format);
+ vkd3d_shader_verror(ctx->message_context, error, format, args);
+ va_end(args);
+ ctx->error = true;
+}
+
static void yyerror(const YYLTYPE *loc, void *scanner, struct preproc_ctx *ctx, const char *string)
{
- FIXME("Error reporting is not implemented.\n");
+ preproc_error(ctx, loc, VKD3D_SHADER_ERROR_PP_INVALID_SYNTAX, "%s", string);
}
}
+%define api.location.type {struct preproc_location}
%define api.prefix {preproc_yy}
%define api.pure full
%define parse.error verbose
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 83038384..5a022708 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -79,6 +79,8 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE = 3002,
VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE = 3003,
VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES = 3004,
+
+ VKD3D_SHADER_ERROR_PP_INVALID_SYNTAX = 4000,
};
enum VKD3D_SHADER_INSTRUCTION_HANDLER
--
2.29.2
Dec. 4, 2020
[PATCH vkd3d v2 3/5] vkd3d-shader: Preserve some tokens verbatim for HLSL.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/preproc.l | 22 ++++++++++++++++++++++
tests/hlsl_d3d12.c | 15 +++++++++------
2 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l
index 966c11b0..f931292b 100644
--- a/libs/vkd3d-shader/preproc.l
+++ b/libs/vkd3d-shader/preproc.l
@@ -47,6 +47,7 @@
%s CXX_COMMENT
WS [ \t]
+IDENTIFIER [A-Za-z_][A-Za-z0-9_]*
%%
@@ -61,6 +62,27 @@ WS [ \t]
<C_COMMENT,CXX_COMMENT><<EOF>> {yy_pop_state(yyscanner);}
<C_COMMENT,CXX_COMMENT>. {}
+<INITIAL>{IDENTIFIER} {return T_TEXT;}
+
+<INITIAL>[0-9]*\.[0-9]+([eE][+-]?[0-9]+)?[hHfF]? {return T_TEXT;}
+<INITIAL>[0-9]+\.([eE][+-]?[0-9]+)?[hHfF]? {return T_TEXT;}
+<INITIAL>[0-9]+([eE][+-]?[0-9]+)?[hHfF] {return T_TEXT;}
+<INITIAL>[0-9]+[eE][+-]?[0-9]+ {return T_TEXT;}
+<INITIAL>0[xX][0-9a-fA-f]+[ul]{0,2} {return T_TEXT;}
+<INITIAL>0[0-7]*[ul]{0,2} {return T_TEXT;}
+<INITIAL>[1-9][0-9]*[ul]{0,2} {return T_TEXT;}
+
+<INITIAL>"&&" {return T_TEXT;}
+<INITIAL>"||" {return T_TEXT;}
+<INITIAL>"++" {return T_TEXT;}
+<INITIAL>"--" {return T_TEXT;}
+<INITIAL>"<<"=? {return T_TEXT;}
+<INITIAL>">>"=? {return T_TEXT;}
+<INITIAL>[-+*/%&|^=><!]= {return T_TEXT;}
+
+ /* C strings (including escaped quotes). */
+<INITIAL>\"([^"\\]|\\.)*\" {return T_TEXT;}
+
<INITIAL>{WS}+ {}
<INITIAL>. {return T_TEXT;}
diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c
index 787355ba..61324fa9 100644
--- a/tests/hlsl_d3d12.c
+++ b/tests/hlsl_d3d12.c
@@ -43,7 +43,7 @@ static void check_preprocess_(int line, const char *source, const D3D_SHADER_MAC
ok_(line)(vkd3d_memmem(code, size, present, strlen(present)),
"\"%s\" not found in preprocessed shader.\n", present);
if (absent)
- assert_that_(line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
+ ok_(line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
"\"%s\" found in preprocessed shader.\n", absent);
ID3D10Blob_Release(blob);
}
@@ -349,8 +349,10 @@ static void test_preprocess(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
+ if (i == 43)
+ continue;
vkd3d_test_set_context("Source \"%s\"", tests[i].source);
- todo_if (i != 5 && i != 8 && i != 42)
+ todo_if (i <= 4 || (i >= 9 && i <= 14))
check_preprocess(tests[i].source, NULL, NULL, tests[i].present, tests[i].absent);
}
vkd3d_test_set_context(NULL);
@@ -361,10 +363,10 @@ static void test_preprocess(void)
macros[1].Definition = NULL;
todo check_preprocess("KEY", macros, NULL, "value", "KEY");
- todo check_preprocess("#undef KEY\nKEY", macros, NULL, "KEY", "value");
+ check_preprocess("#undef KEY\nKEY", macros, NULL, "KEY", "value");
macros[0].Name = NULL;
- todo check_preprocess("KEY", macros, NULL, "KEY", "value");
+ check_preprocess("KEY", macros, NULL, "KEY", "value");
macros[0].Name = "KEY";
macros[0].Definition = NULL;
@@ -376,7 +378,7 @@ static void test_preprocess(void)
macros[0].Name = "KEY(a)";
macros[0].Definition = "value";
- todo check_preprocess("KEY(a)", macros, NULL, "KEY", "value");
+ check_preprocess("KEY(a)", macros, NULL, "KEY", "value");
macros[0].Name = "KEY";
macros[0].Definition = "value1";
@@ -398,7 +400,8 @@ static void test_preprocess(void)
macros[1].Definition = "KEY2";
todo check_preprocess("KEY", macros, NULL, "value", NULL);
- todo check_preprocess(test_include_top, NULL, &test_include, "pass", "fail");
+ if (0)
+ todo check_preprocess(test_include_top, NULL, &test_include, "pass", "fail");
ok(!refcount_file1, "Got %d references to file1.\n", refcount_file1);
ok(!refcount_file2, "Got %d references to file1.\n", refcount_file2);
ok(!refcount_file3, "Got %d references to file1.\n", refcount_file3);
--
2.29.2
Dec. 4, 2020
[PATCH vkd3d v2 2/5] vkd3d-shader: Parse comments in the preprocessor.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/preproc.l | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l
index 1ae43a8d..966c11b0 100644
--- a/libs/vkd3d-shader/preproc.l
+++ b/libs/vkd3d-shader/preproc.l
@@ -36,16 +36,33 @@
%option never-interactive
%option noinput
%option nounput
+%option noyy_top_state
%option noyywrap
%option prefix="preproc_yy"
%option reentrant
+%option stack
+
+ /* Because these can both be terminated by EOF, we need states for them. */
+%s C_COMMENT
+%s CXX_COMMENT
WS [ \t]
%%
-{WS}+ {}
-. {return T_TEXT;}
+<INITIAL>"//" {yy_push_state(CXX_COMMENT, yyscanner);}
+<INITIAL>"/*" {yy_push_state(C_COMMENT, yyscanner);}
+<CXX_COMMENT>\\\r?\n {}
+<CXX_COMMENT>\n {
+ yy_pop_state(yyscanner);
+ return T_TEXT;
+ }
+<C_COMMENT>"*/" {yy_pop_state(yyscanner);}
+<C_COMMENT,CXX_COMMENT><<EOF>> {yy_pop_state(yyscanner);}
+<C_COMMENT,CXX_COMMENT>. {}
+
+<INITIAL>{WS}+ {}
+<INITIAL>. {return T_TEXT;}
%%
--
2.29.2
Dec. 4, 2020
[PATCH vkd3d v2 1/5] vkd3d-shader: Implement an initial pass-through HLSL preprocessor.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
v2: quote some autoconf macros, use AS_IF, try to fix out-of-tree builds
.gitignore | 3 +
Makefile.am | 25 +++++-
configure.ac | 6 ++
libs/vkd3d-shader/preproc.h | 33 ++++++++
libs/vkd3d-shader/preproc.l | 99 ++++++++++++++++++++++++
libs/vkd3d-shader/preproc.y | 60 ++++++++++++++
libs/vkd3d-shader/vkd3d_shader_main.c | 16 +++-
libs/vkd3d-shader/vkd3d_shader_private.h | 8 ++
tests/hlsl_d3d12.c | 31 ++++----
9 files changed, 260 insertions(+), 21 deletions(-)
create mode 100644 libs/vkd3d-shader/preproc.h
create mode 100644 libs/vkd3d-shader/preproc.l
create mode 100644 libs/vkd3d-shader/preproc.y
diff --git a/.gitignore b/.gitignore
index 63a9ffc6..b6d29d19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,7 +19,10 @@ vkd3d-*.tar.xz
*.log
*.o
*.pc
+*.tab.c
+*.tab.h
*.trs
+*.yy.c
*~
.deps
diff --git a/Makefile.am b/Makefile.am
index 5a6e4dc9..46eacbd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -108,6 +108,29 @@ libvkd3d_common_la_SOURCES = \
lib_LTLIBRARIES = libvkd3d-shader.la libvkd3d.la libvkd3d-utils.la
+VKD3D_V_FLEX = $(vkd3d_v_flex_(a)AM_V@)
+vkd3d_v_flex_ = $(vkd3d_v_flex_(a)AM_DEFAULT_V@)
+vkd3d_v_flex_0 = @echo " FLEX " $@;
+vkd3d_v_flex_1 =
+
+VKD3D_V_BISON = $(vkd3d_v_bison_(a)AM_V@)
+vkd3d_v_bison_ = $(vkd3d_v_bison_(a)AM_DEFAULT_V@)
+vkd3d_v_bison_0 = @echo " BISON " $@;
+vkd3d_v_bison_1 =
+
+libs/vkd3d-shader/preproc.yy.c: libs/vkd3d-shader/preproc.l
+ $(VKD3D_V_FLEX)$(FLEX) $(LFLAGS) -o $@ $<
+
+libs/vkd3d-shader/preproc.tab.c libs/vkd3d-shader/preproc.tab.h &: libs/vkd3d-shader/preproc.y
+ $(VKD3D_V_BISON)$(BISON) $(YFLAGS) -d -o $@ $<
+
+BUILT_SOURCES += libs/vkd3d-shader/preproc.tab.h
+
+nodist_libvkd3d_shader_la_SOURCES = \
+ libs/vkd3d-shader/preproc.tab.c \
+ libs/vkd3d-shader/preproc.tab.h \
+ libs/vkd3d-shader/preproc.yy.c
+
libvkd3d_shader_la_SOURCES = \
include/private/list.h \
include/private/rbtree.h \
@@ -122,7 +145,7 @@ libvkd3d_shader_la_SOURCES = \
libs/vkd3d-shader/vkd3d_shader.map \
libs/vkd3d-shader/vkd3d_shader_main.c \
libs/vkd3d-shader/vkd3d_shader_private.h
-libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) @SPIRV_TOOLS_CFLAGS@
+libvkd3d_shader_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libs/vkd3d-shader @SPIRV_TOOLS_CFLAGS@
libvkd3d_shader_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0
libvkd3d_shader_la_LIBADD = libvkd3d-common.la @SPIRV_TOOLS_LIBS@
if HAVE_LD_VERSION_SCRIPT
diff --git a/configure.ac b/configure.ac
index 2f22b05f..b7902b63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,12 @@ AC_PROG_MKDIR_P
VKD3D_PROG_WIDL(3, 20)
AS_IF([test "x$WIDL" = "xno"], [AC_MSG_WARN([widl is required to build header files.])])
+AC_CHECK_PROGS([FLEX], [flex], [none])
+AS_IF([test "$FLEX" = "none"], [AC_MSG_ERROR([no suitable flex found. Please install the 'flex' package.])])
+
+AC_CHECK_PROGS([BISON], [bison], [none])
+AS_IF([test "$BISON" = "none"], [AC_MSG_ERROR([no suitable bison found. Please install the 'bison' package.])])
+
DX_PS_FEATURE([OFF])
DX_INIT_DOXYGEN([vkd3d], [Doxyfile], [doc])
AC_CONFIG_FILES([Doxyfile])
diff --git a/libs/vkd3d-shader/preproc.h b/libs/vkd3d-shader/preproc.h
new file mode 100644
index 00000000..cbd93229
--- /dev/null
+++ b/libs/vkd3d-shader/preproc.h
@@ -0,0 +1,33 @@
+/*
+ * HLSL preprocessor
+ *
+ * Copyright 2020 Zebediah Figura for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __VKD3D_SHADER_PREPROC_H
+#define __VKD3D_SHADER_PREPROC_H
+
+#include "vkd3d_shader_private.h"
+
+struct preproc_ctx
+{
+ void *scanner;
+
+ struct vkd3d_string_buffer buffer;
+};
+
+#endif
diff --git a/libs/vkd3d-shader/preproc.l b/libs/vkd3d-shader/preproc.l
new file mode 100644
index 00000000..1ae43a8d
--- /dev/null
+++ b/libs/vkd3d-shader/preproc.l
@@ -0,0 +1,99 @@
+/*
+ * HLSL preprocessor
+ *
+ * Copyright 2020 Zebediah Figura for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+%{
+
+#include "preproc.tab.h"
+
+#define YYSTYPE PREPROC_YYSTYPE
+#define YYLTYPE PREPROC_YYLTYPE
+
+#define YY_DECL static int preproc_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
+
+%}
+
+%option 8bit
+%option bison-bridge
+%option bison-locations
+%option extra-type="struct preproc_ctx *"
+%option never-interactive
+%option noinput
+%option nounput
+%option noyywrap
+%option prefix="preproc_yy"
+%option reentrant
+
+WS [ \t]
+
+%%
+
+{WS}+ {}
+. {return T_TEXT;}
+
+%%
+
+int yylex(YYSTYPE *lval, YYLTYPE *lloc, yyscan_t scanner)
+{
+ struct preproc_ctx *ctx = yyget_extra(scanner);
+
+ for (;;)
+ {
+ const char *text;
+ int token;
+
+ if (!(token = preproc_lexer_lex(lval, lloc, scanner)))
+ return PREPROC_YYEOF;
+ text = yyget_text(scanner);
+
+ TRACE("Parsing token %d, string %s.\n", token, debugstr_a(text));
+
+ vkd3d_string_buffer_printf(&ctx->buffer, "%s ", text);
+ }
+}
+
+int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
+ struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
+{
+ struct preproc_ctx ctx = {0};
+ YY_BUFFER_STATE top_buffer;
+ void *output_code;
+
+ vkd3d_string_buffer_init(&ctx.buffer);
+
+ yylex_init_extra(&ctx, &ctx.scanner);
+ top_buffer = yy_scan_bytes(compile_info->source.code, compile_info->source.size, ctx.scanner);
+
+ preproc_yyparse(ctx.scanner, &ctx);
+
+ yy_delete_buffer(top_buffer, ctx.scanner);
+ yylex_destroy(ctx.scanner);
+
+ if (!(output_code = vkd3d_malloc(ctx.buffer.content_size)))
+ {
+ vkd3d_string_buffer_cleanup(&ctx.buffer);
+ return VKD3D_ERROR_OUT_OF_MEMORY;
+ }
+ memcpy(output_code, ctx.buffer.buffer, ctx.buffer.content_size);
+ out->size = ctx.buffer.content_size;
+ out->code = output_code;
+ vkd3d_string_buffer_trace(&ctx.buffer);
+ vkd3d_string_buffer_cleanup(&ctx.buffer);
+ return VKD3D_OK;
+}
diff --git a/libs/vkd3d-shader/preproc.y b/libs/vkd3d-shader/preproc.y
new file mode 100644
index 00000000..92448f24
--- /dev/null
+++ b/libs/vkd3d-shader/preproc.y
@@ -0,0 +1,60 @@
+/*
+ * HLSL preprocessor
+ *
+ * Copyright 2020 Zebediah Figura for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+%code requires
+{
+
+#include "vkd3d_shader_private.h"
+#include "preproc.h"
+
+}
+
+%code provides
+{
+
+int preproc_yylex(PREPROC_YYSTYPE *yylval_param, PREPROC_YYLTYPE *yylloc_param, void *scanner);
+
+}
+
+%code
+{
+
+static void yyerror(const YYLTYPE *loc, void *scanner, struct preproc_ctx *ctx, const char *string)
+{
+ FIXME("Error reporting is not implemented.\n");
+}
+
+}
+
+%define api.prefix {preproc_yy}
+%define api.pure full
+%define parse.error verbose
+%expect 0
+%locations
+%lex-param {yyscan_t scanner}
+%parse-param {void *scanner}
+%parse-param {struct preproc_ctx *ctx}
+
+%token T_TEXT
+
+%%
+
+shader_text
+ : %empty
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index 1a029246..eed0316c 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -78,8 +78,7 @@ int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *
}
}
-static int VKD3D_PRINTF_FUNC(2, 3) vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer,
- const char *format, ...)
+int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, const char *format, ...)
{
va_list args;
int ret;
@@ -91,7 +90,7 @@ static int VKD3D_PRINTF_FUNC(2, 3) vkd3d_string_buffer_printf(struct vkd3d_strin
return ret;
}
-static void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function)
+void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function)
{
const char *p, *q, *end = buffer->buffer + buffer->content_size;
@@ -1154,6 +1153,7 @@ const enum vkd3d_shader_target_type *vkd3d_shader_get_supported_target_types(
int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_code *out, char **messages)
{
+ struct vkd3d_shader_message_context message_context;
int ret;
TRACE("compile_info %p, out %p, messages %p.\n", compile_info, out, messages);
@@ -1164,5 +1164,13 @@ int vkd3d_shader_preprocess(const struct vkd3d_shader_compile_info *compile_info
if ((ret = vkd3d_shader_validate_compile_info(compile_info, false)) < 0)
return ret;
- return VKD3D_ERROR_NOT_IMPLEMENTED;
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+
+ ret = preproc_lexer_parse(compile_info, out, &message_context);
+
+ vkd3d_shader_message_context_trace_messages(&message_context);
+ if (!vkd3d_shader_message_context_copy_messages(&message_context, messages))
+ ret = VKD3D_ERROR_OUT_OF_MEMORY;
+ vkd3d_shader_message_context_cleanup(&message_context);
+ return ret;
}
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 5ae5724a..83038384 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -837,6 +837,11 @@ struct vkd3d_string_buffer
enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data, struct vkd3d_shader_code *out) DECLSPEC_HIDDEN;
void vkd3d_string_buffer_cleanup(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN;
void vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer) DECLSPEC_HIDDEN;
+int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer,
+ const char *format, ...) VKD3D_PRINTF_FUNC(2, 3) DECLSPEC_HIDDEN;
+#define vkd3d_string_buffer_trace(buffer) \
+ vkd3d_string_buffer_trace_(buffer, __FUNCTION__)
+void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const char *function) DECLSPEC_HIDDEN;
int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args) DECLSPEC_HIDDEN;
struct vkd3d_shader_message_context
@@ -882,6 +887,9 @@ void vkd3d_dxbc_compiler_destroy(struct vkd3d_dxbc_compiler *compiler) DECLSPEC_
void vkd3d_compute_dxbc_checksum(const void *dxbc, size_t size, uint32_t checksum[4]) DECLSPEC_HIDDEN;
+int preproc_lexer_parse(const struct vkd3d_shader_compile_info *compile_info,
+ struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN;
+
static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_type(
enum vkd3d_data_type data_type)
{
diff --git a/tests/hlsl_d3d12.c b/tests/hlsl_d3d12.c
index 4f4cc37f..787355ba 100644
--- a/tests/hlsl_d3d12.c
+++ b/tests/hlsl_d3d12.c
@@ -30,22 +30,20 @@ static void check_preprocess_(int line, const char *source, const D3D_SHADER_MAC
HRESULT hr;
hr = D3DPreprocess(source, strlen(source), NULL, macros, include, &blob, &errors);
- todo ok_(line)(hr == S_OK, "Failed to preprocess shader, hr %#x.\n", hr);
+ assert_that_(line)(hr == S_OK, "Failed to preprocess shader, hr %#x.\n", hr);
if (errors)
{
if (vkd3d_test_state.debug_level)
trace_(line)("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors));
ID3D10Blob_Release(errors);
}
- if (hr != S_OK)
- return;
code = ID3D10Blob_GetBufferPointer(blob);
size = ID3D10Blob_GetBufferSize(blob);
if (present)
ok_(line)(vkd3d_memmem(code, size, present, strlen(present)),
"\"%s\" not found in preprocessed shader.\n", present);
if (absent)
- ok_(line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
+ assert_that_(line)(!vkd3d_memmem(code, size, absent, strlen(absent)),
"\"%s\" found in preprocessed shader.\n", absent);
ID3D10Blob_Release(blob);
}
@@ -352,7 +350,8 @@ static void test_preprocess(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
vkd3d_test_set_context("Source \"%s\"", tests[i].source);
- check_preprocess(tests[i].source, NULL, NULL, tests[i].present, tests[i].absent);
+ todo_if (i != 5 && i != 8 && i != 42)
+ check_preprocess(tests[i].source, NULL, NULL, tests[i].present, tests[i].absent);
}
vkd3d_test_set_context(NULL);
@@ -360,16 +359,16 @@ static void test_preprocess(void)
macros[0].Definition = "value";
macros[1].Name = NULL;
macros[1].Definition = NULL;
- check_preprocess("KEY", macros, NULL, "value", "KEY");
+ todo check_preprocess("KEY", macros, NULL, "value", "KEY");
- check_preprocess("#undef KEY\nKEY", macros, NULL, "KEY", "value");
+ todo check_preprocess("#undef KEY\nKEY", macros, NULL, "KEY", "value");
macros[0].Name = NULL;
- check_preprocess("KEY", macros, NULL, "KEY", "value");
+ todo check_preprocess("KEY", macros, NULL, "KEY", "value");
macros[0].Name = "KEY";
macros[0].Definition = NULL;
- check_preprocess("KEY", macros, NULL, NULL, "KEY");
+ todo check_preprocess("KEY", macros, NULL, NULL, "KEY");
macros[0].Name = "0";
macros[0].Definition = "value";
@@ -377,7 +376,7 @@ static void test_preprocess(void)
macros[0].Name = "KEY(a)";
macros[0].Definition = "value";
- check_preprocess("KEY(a)", macros, NULL, "KEY", "value");
+ todo check_preprocess("KEY(a)", macros, NULL, "KEY", "value");
macros[0].Name = "KEY";
macros[0].Definition = "value1";
@@ -385,33 +384,33 @@ static void test_preprocess(void)
macros[1].Definition = "value2";
macros[2].Name = NULL;
macros[2].Definition = NULL;
- check_preprocess("KEY", macros, NULL, "value2", NULL);
+ todo check_preprocess("KEY", macros, NULL, "value2", NULL);
macros[0].Name = "KEY";
macros[0].Definition = "KEY2";
macros[1].Name = "KEY2";
macros[1].Definition = "value";
- check_preprocess("KEY", macros, NULL, "value", NULL);
+ todo check_preprocess("KEY", macros, NULL, "value", NULL);
macros[0].Name = "KEY2";
macros[0].Definition = "value";
macros[1].Name = "KEY";
macros[1].Definition = "KEY2";
- check_preprocess("KEY", macros, NULL, "value", NULL);
+ todo check_preprocess("KEY", macros, NULL, "value", NULL);
- check_preprocess(test_include_top, NULL, &test_include, "pass", "fail");
+ todo check_preprocess(test_include_top, NULL, &test_include, "pass", "fail");
ok(!refcount_file1, "Got %d references to file1.\n", refcount_file1);
ok(!refcount_file2, "Got %d references to file1.\n", refcount_file2);
ok(!refcount_file3, "Got %d references to file1.\n", refcount_file3);
todo ok(include_count_file2 == 2, "file2 was included %u times.\n", include_count_file2);
/* Macro invocation spread across multiple files. */
- check_preprocess(test_include2_top, NULL, &test_include, "pass", NULL);
+ todo check_preprocess(test_include2_top, NULL, &test_include, "pass", NULL);
blob = errors = (ID3D10Blob *)0xdeadbeef;
hr = D3DPreprocess(test_include_top, strlen(test_include_top), NULL, NULL, &test_include_fail, &blob, &errors);
todo ok(hr == E_FAIL, "Got hr %#x.\n", hr);
- ok(blob == (ID3D10Blob *)0xdeadbeef, "Expected no compiled shader blob.\n");
+ todo ok(blob == (ID3D10Blob *)0xdeadbeef, "Expected no compiled shader blob.\n");
todo ok(!!errors, "Expected non-NULL error blob.\n");
if (errors)
{
--
2.29.2
Dec. 4, 2020
Re: [PATCH 2/2] xmllite: Drop superfluous casts to self.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH 1/2] xmllite: Use a string literal for an empty string.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH] mfplat: Zero-initialize the device manager object.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH 07/17] winegstreamer: Introduce color conversion transform.
by Derek Lesho
On 12/3/20 10:40 PM, Zebediah Figura (she/her) wrote:
> On 12/3/20 3:55 PM, Derek Lesho wrote:
>> Serves as a wrapper of videoconvert, and roughly fills the roll of Windows' CColorConverterDMO.
> Why can't this be CColorConvertDMO?
Nothing specific, I don't think there's any fundamental differences here
to what a CColorConvertDMO implementation would like. While I haven't
tested any applications that manually use CColorConvertDMO, I don't
think we'd run into any problems with incompatibility if/when they come up.
Dec. 4, 2020
Re: [PATCH 03/17] winegstreamer: Implement ::Process(Input/Output) for audio conversion transform.
by Derek Lesho
On 12/3/20 10:26 PM, Zebediah Figura (she/her) wrote:
>
>> + g_signal_emit_by_name(converter->appsink, "pull-sample", &sample);
> I'm not fully familiar with mfplat, but this call may block, and it
> doesn't look like ProcessOutput() is supposed to. You probably want
> "try-pull-sample" instead.
Actually, with sync MFTs, ::ProcessOutput is blocking until a sample is
yielded or an error occurs. In MFT writing guides from Microsoft I've
seen, ::ProcessInput just buts the data in a buffer, and ::ProcessOutput
actually invokes the functionality of the transform. This should match
that behavior pretty closely.
Dec. 4, 2020
Re: [PATCH 07/17] winegstreamer: Introduce color conversion transform.
by Zebediah Figura (she/her)
On 12/3/20 3:55 PM, Derek Lesho wrote:
> Serves as a wrapper of videoconvert, and roughly fills the roll of Windows' CColorConverterDMO.
Why can't this be CColorConvertDMO?
>
> Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
> ---
> dlls/winegstreamer/Makefile.in | 1 +
> dlls/winegstreamer/colorconvert.c | 302 +++++++++++++++++++
> dlls/winegstreamer/gst_private.h | 1 +
> dlls/winegstreamer/mfplat.c | 3 +
> dlls/winegstreamer/winegstreamer_classes.idl | 6 +
> 5 files changed, 313 insertions(+)
> create mode 100644 dlls/winegstreamer/colorconvert.c
>
> diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in
> index 0b3229160b9..5395d6fd501 100644
> --- a/dlls/winegstreamer/Makefile.in
> +++ b/dlls/winegstreamer/Makefile.in
> @@ -7,6 +7,7 @@ PARENTSRC = ../strmbase
>
> C_SRCS = \
> audioconvert.c \
> + colorconvert.c \
> filter.c \
> gst_cbs.c \
> gstdemux.c \
> diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
> new file mode 100644
> index 00000000000..8d0823fc0dc
> --- /dev/null
> +++ b/dlls/winegstreamer/colorconvert.c
> @@ -0,0 +1,302 @@
> +/* GStreamer Color Converter
> + *
> + * Copyright 2020 Derek Lesho
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
> + */
> +
> +#include "config.h"
> +
> +#include "gst_private.h"
> +
> +#include "mfapi.h"
> +#include "mferror.h"
> +#include "mfidl.h"
> +
> +#include "wine/debug.h"
> +#include "wine/heap.h"
> +
> +WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
> +
> +struct color_converter
> +{
> + IMFTransform IMFTransform_iface;
> + LONG refcount;
> +};
> +
> +static struct color_converter *impl_color_converter_from_IMFTransform(IMFTransform *iface)
> +{
> + return CONTAINING_RECORD(iface, struct color_converter, IMFTransform_iface);
> +}
> +
> +static HRESULT WINAPI color_converter_QueryInterface(IMFTransform *iface, REFIID riid, void **obj)
> +{
> + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
> +
> + if (IsEqualIID(riid, &IID_IMFTransform) ||
> + IsEqualIID(riid, &IID_IUnknown))
> + {
> + *obj = iface;
> + IMFTransform_AddRef(iface);
> + return S_OK;
> + }
> +
> + WARN("Unsupported %s.\n", debugstr_guid(riid));
> + *obj = NULL;
> + return E_NOINTERFACE;
> +}
> +
> +static ULONG WINAPI color_converter_AddRef(IMFTransform *iface)
> +{
> + struct color_converter *transform = impl_color_converter_from_IMFTransform(iface);
> + ULONG refcount = InterlockedIncrement(&transform->refcount);
> +
> + TRACE("%p, refcount %u.\n", iface, refcount);
> +
> + return refcount;
> +}
> +
> +static ULONG WINAPI color_converter_Release(IMFTransform *iface)
> +{
> + struct color_converter *transform = impl_color_converter_from_IMFTransform(iface);
> + ULONG refcount = InterlockedDecrement(&transform->refcount);
> +
> + TRACE("%p, refcount %u.\n", iface, refcount);
> +
> + if (!refcount)
> + {
> + heap_free(transform);
> + }
> +
> + return refcount;
> +}
> +
> +static HRESULT WINAPI color_converter_GetStreamLimits(IMFTransform *iface, DWORD *input_minimum, DWORD *input_maximum,
> + DWORD *output_minimum, DWORD *output_maximum)
> +{
> + TRACE("%p, %p, %p, %p, %p.\n", iface, input_minimum, input_maximum, output_minimum, output_maximum);
> +
> + *input_minimum = *input_maximum = *output_minimum = *output_maximum = 1;
> +
> + return S_OK;
> +}
> +
> +static HRESULT WINAPI color_converter_GetStreamCount(IMFTransform *iface, DWORD *inputs, DWORD *outputs)
> +{
> + TRACE("%p, %p, %p.\n", iface, inputs, outputs);
> +
> + *inputs = *outputs = 1;
> +
> + return S_OK;
> +}
> +
> +static HRESULT WINAPI color_converter_GetStreamIDs(IMFTransform *iface, DWORD input_size, DWORD *inputs,
> + DWORD output_size, DWORD *outputs)
> +{
> + TRACE("%p %u %p %u %p.\n", iface, input_size, inputs, output_size, outputs);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
> +{
> + FIXME("%p %u %p.\n", iface, id, info);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
> +{
> + FIXME("%p %u %p.\n", iface, id, info);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
> +{
> + FIXME("%p, %p.\n", iface, attributes);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
> + IMFAttributes **attributes)
> +{
> + FIXME("%p, %u, %p.\n", iface, id, attributes);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
> + IMFAttributes **attributes)
> +{
> + FIXME("%p, %u, %p.\n", iface, id, attributes);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
> +{
> + TRACE("%p, %u.\n", iface, id);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_AddInputStreams(IMFTransform *iface, DWORD streams, DWORD *ids)
> +{
> + TRACE("%p, %u, %p.\n", iface, streams, ids);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetInputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
> + IMFMediaType **type)
> +{
> + FIXME("%p, %u, %u, %p.\n", iface, id, index, type);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetOutputAvailableType(IMFTransform *iface, DWORD id, DWORD index,
> + IMFMediaType **type)
> +{
> + FIXME("%p, %u, %u, %p.\n", iface, id, index, type);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
> +{
> + FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD id, IMFMediaType *type, DWORD flags)
> +{
> + FIXME("%p, %u, %p, %#x.\n", iface, id, type, flags);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetInputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
> +{
> + FIXME("%p, %u, %p.\n", iface, id, type);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetOutputCurrentType(IMFTransform *iface, DWORD id, IMFMediaType **type)
> +{
> + FIXME("%p, %u, %p.\n", iface, id, type);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetInputStatus(IMFTransform *iface, DWORD id, DWORD *flags)
> +{
> + FIXME("%p, %u, %p.\n", iface, id, flags);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_GetOutputStatus(IMFTransform *iface, DWORD *flags)
> +{
> + FIXME("%p, %p.\n", iface, flags);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
> +{
> + FIXME("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper));
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_ProcessEvent(IMFTransform *iface, DWORD id, IMFMediaEvent *event)
> +{
> + TRACE("%p, %u, %p.\n", iface, id, event);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param)
> +{
> + FIXME("%p, %u %lu.\n", iface, message, param);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
> +{
> + FIXME("%p, %u, %p, %#x.\n", iface, id, sample, flags);
> +
> + return E_NOTIMPL;
> +}
> +
> +static HRESULT WINAPI color_converter_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
> + MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
> +{
> + FIXME("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status);
> +
> + return E_NOTIMPL;
> +}
> +
> +static const IMFTransformVtbl color_converter_vtbl =
> +{
> + color_converter_QueryInterface,
> + color_converter_AddRef,
> + color_converter_Release,
> + color_converter_GetStreamLimits,
> + color_converter_GetStreamCount,
> + color_converter_GetStreamIDs,
> + color_converter_GetInputStreamInfo,
> + color_converter_GetOutputStreamInfo,
> + color_converter_GetAttributes,
> + color_converter_GetInputStreamAttributes,
> + color_converter_GetOutputStreamAttributes,
> + color_converter_DeleteInputStream,
> + color_converter_AddInputStreams,
> + color_converter_GetInputAvailableType,
> + color_converter_GetOutputAvailableType,
> + color_converter_SetInputType,
> + color_converter_SetOutputType,
> + color_converter_GetInputCurrentType,
> + color_converter_GetOutputCurrentType,
> + color_converter_GetInputStatus,
> + color_converter_GetOutputStatus,
> + color_converter_SetOutputBounds,
> + color_converter_ProcessEvent,
> + color_converter_ProcessMessage,
> + color_converter_ProcessInput,
> + color_converter_ProcessOutput,
> +};
> +
> +HRESULT color_converter_create(REFIID riid, void **ret)
> +{
> + struct color_converter *object;
> +
> + TRACE("%s %p\n", debugstr_guid(riid), ret);
> +
> + if (!(object = heap_alloc_zero(sizeof(*object))))
> + return E_OUTOFMEMORY;
> +
> + object->IMFTransform_iface.lpVtbl = &color_converter_vtbl;
> + object->refcount = 1;
> +
> + *ret = &object->IMFTransform_iface;
> + return S_OK;
> +}
> diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
> index 14b6a011ac2..075e0ce1f0f 100644
> --- a/dlls/winegstreamer/gst_private.h
> +++ b/dlls/winegstreamer/gst_private.h
> @@ -87,5 +87,6 @@ GstBuffer *gst_buffer_from_mf_sample(IMFSample *in) DECLSPEC_HIDDEN;
> HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
>
> HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
> +HRESULT color_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
>
> #endif /* __GST_PRIVATE_INCLUDED__ */
> diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
> index 883084b2d89..288b79997cd 100644
> --- a/dlls/winegstreamer/mfplat.c
> +++ b/dlls/winegstreamer/mfplat.c
> @@ -407,6 +407,8 @@ static const GUID CLSID_GStreamerByteStreamHandler = {0x317df618, 0x5e5a, 0x468a
>
> static const GUID CLSID_WINEAudioConverter = {0x6a170414,0xaad9,0x4693,{0xb8,0x06,0x3a,0x0c,0x47,0xc5,0x70,0xd6}};
>
> +static GUID CLSID_WINEColorConverter = {0x2be8b27f,0xcd60,0x4b8a,{0x95,0xae,0xd1,0x74,0xcc,0x5c,0xba,0xa7}};
> +
This can be const...
> static const struct class_object
> {
> const GUID *clsid;
> @@ -417,6 +419,7 @@ class_objects[] =
> { &CLSID_VideoProcessorMFT, &video_processor_create },
> { &CLSID_GStreamerByteStreamHandler, &winegstreamer_stream_handler_create },
> { &CLSID_WINEAudioConverter, &audio_converter_create },
> + { &CLSID_WINEColorConverter, &color_converter_create },
> };
>
> HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
> diff --git a/dlls/winegstreamer/winegstreamer_classes.idl b/dlls/winegstreamer/winegstreamer_classes.idl
> index cf1fc69f38a..47c10a09cf0 100644
> --- a/dlls/winegstreamer/winegstreamer_classes.idl
> +++ b/dlls/winegstreamer/winegstreamer_classes.idl
> @@ -67,3 +67,9 @@ coclass GStreamerByteStreamHandler {}
> uuid(6a170414-aad9-4693-b806-3a0c47c570d6)
> ]
> coclass WINEAudioConverter { }
> +
> +[
> + threading(both),
> + uuid(2be8b27f-cd60-4b8a-95ae-d174cc5cbaa7)
> +]
> +coclass WINEColorConverter { }
>
Dec. 4, 2020
Re: [PATCH 06/17] winegstreamer: Implement Get(Input/Output)CurrentType functions for audio converter transform.
by Zebediah Figura (she/her)
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH 05/17] winegstreamer: Implement Get*Attributes functions for audio converter transform.
by Zebediah Figura (she/her)
On 12/3/20 3:55 PM, Derek Lesho wrote:
> Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
> ---
> dlls/winegstreamer/audioconvert.c | 37 +++++++++++++++++++++++++++----
> 1 file changed, 33 insertions(+), 4 deletions(-)
>
The patch subject is mildly misleading, since you don't implement all
such functions...
> diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
> index d204d9582ba..556aba44fc9 100644
> --- a/dlls/winegstreamer/audioconvert.c
> +++ b/dlls/winegstreamer/audioconvert.c
> @@ -37,6 +37,8 @@ struct audio_converter
> {
> IMFTransform IMFTransform_iface;
> LONG refcount;
> + IMFAttributes *attributes;
> + IMFAttributes *output_attributes;
> IMFMediaType *input_type;
> IMFMediaType *output_type;
> CRITICAL_SECTION cs;
> @@ -87,6 +89,10 @@ static ULONG WINAPI audio_converter_Release(IMFTransform *iface)
> {
> transform->cs.DebugInfo->Spare[0] = 0;
> DeleteCriticalSection(&transform->cs);
> + if (transform->attributes)
> + IMFAttributes_Release(transform->attributes);
> + if (transform->output_attributes)
> + IMFAttributes_Release(transform->output_attributes);
> gst_object_unref(transform->container);
> heap_free(transform);
> }
> @@ -152,9 +158,14 @@ static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, D
>
> static HRESULT WINAPI audio_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
> {
> - FIXME("%p, %p.\n", iface, attributes);
> + struct audio_converter *converter = impl_audio_converter_from_IMFTransform(iface);
>
> - return E_NOTIMPL;
> + TRACE("%p, %p.\n", iface, attributes);
> +
> + *attributes = converter->attributes;
> + IMFAttributes_AddRef(*attributes);
> +
> + return S_OK;
> }
>
> static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
> @@ -168,9 +179,14 @@ static HRESULT WINAPI audio_converter_GetInputStreamAttributes(IMFTransform *ifa
> static HRESULT WINAPI audio_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
> IMFAttributes **attributes)
> {
> - FIXME("%p, %u, %p.\n", iface, id, attributes);
> + struct audio_converter *converter = impl_audio_converter_from_IMFTransform(iface);
>
> - return E_NOTIMPL;
> + TRACE("%p, %u, %p.\n", iface, id, attributes);
> +
> + *attributes = converter->output_attributes;
> + IMFAttributes_AddRef(*attributes);
> +
> + return S_OK;
> }
>
> static HRESULT WINAPI audio_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
> @@ -644,6 +660,7 @@ static const IMFTransformVtbl audio_converter_vtbl =
> HRESULT audio_converter_create(REFIID riid, void **ret)
> {
> struct audio_converter *object;
> + HRESULT hr;
>
> TRACE("%s %p\n", debugstr_guid(riid), ret);
>
> @@ -656,6 +673,18 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
> InitializeCriticalSection(&object->cs);
> object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": audio_converter_lock");
>
> + if (FAILED(hr = MFCreateAttributes(&object->attributes, 0)))
> + {
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return hr;
> + }
> +
> + if (FAILED(hr = MFCreateAttributes(&object->output_attributes, 0)))
> + {
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return hr;
> + }
> +
> object->container = gst_bin_new(NULL);
>
> if (!(object->appsrc = gst_element_factory_make("appsrc", NULL)))
>
Dec. 4, 2020
Re: [PATCH 04/17] winegstreamer: Implement ::Get(Input/Output)StreamInfo for audio conversion transform.
by Zebediah Figura (she/her)
On 12/3/20 3:55 PM, Derek Lesho wrote:
> Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
> ---
> v1(v6): Made naming and style of the two functions consistent.
> ---
> dlls/winegstreamer/audioconvert.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
> index 631c57d6d55..d204d9582ba 100644
> --- a/dlls/winegstreamer/audioconvert.c
> +++ b/dlls/winegstreamer/audioconvert.c
> @@ -123,16 +123,31 @@ static HRESULT WINAPI audio_converter_GetStreamIDs(IMFTransform *iface, DWORD in
>
> static HRESULT WINAPI audio_converter_GetInputStreamInfo(IMFTransform *iface, DWORD id, MFT_INPUT_STREAM_INFO *info)
> {
> - FIXME("%p %u %p.\n", iface, id, info);
> + TRACE("%p %u %p.\n", iface, id, info);
>
> - return E_NOTIMPL;
> + if (id != 0)
> + return MF_E_INVALIDSTREAMNUMBER;
> +
> + info->dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_DOES_NOT_ADDREF;
> + info->cbMaxLookahead = 0;
> + info->cbAlignment = 0;
> + info->hnsMaxLatency = 0;
> +
"info->cbSize" isn't set here; is that intentional?
> + return S_OK;
> }
>
> static HRESULT WINAPI audio_converter_GetOutputStreamInfo(IMFTransform *iface, DWORD id, MFT_OUTPUT_STREAM_INFO *info)
> {
> - FIXME("%p %u %p.\n", iface, id, info);
> + TRACE("%p %u %p.\n", iface, id, info);
>
> - return E_NOTIMPL;
> + if (id != 0)
> + return MF_E_INVALIDSTREAMNUMBER;
> +
> + info->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES;
Is it intentional to provide WHOLE_SAMPLES in GetInputStreamInfo() but
not (the equivalent flag) here?
> + info->cbSize = 0;
> + info->cbAlignment = 0;
> +
> + return S_OK;
> }
>
> static HRESULT WINAPI audio_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
>
Dec. 4, 2020
Re: [PATCH 03/17] winegstreamer: Implement ::Process(Input/Output) for audio conversion transform.
by Zebediah Figura (she/her)
On 12/3/20 3:55 PM, Derek Lesho wrote:
> Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
> ---
> v1(v6):
> - Move unused hr to later patch.
> - Fix extra parentheses.
> - Place converter declaration more consistently.
> ---
> dlls/winegstreamer/audioconvert.c | 175 +++++++++++++++++++++++++++++-
> dlls/winegstreamer/gst_private.h | 1 +
> dlls/winegstreamer/mfplat.c | 69 ++++++++++++
> 3 files changed, 239 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
> index 7fb0dee99f6..631c57d6d55 100644
> --- a/dlls/winegstreamer/audioconvert.c
> +++ b/dlls/winegstreamer/audioconvert.c
> @@ -40,6 +40,8 @@ struct audio_converter
> IMFMediaType *input_type;
> IMFMediaType *output_type;
> CRITICAL_SECTION cs;
> + BOOL inflight;
> + GstElement *container, *appsrc, *audioconvert, *resampler, *appsink;
Both "resampler" and "audioconvert" can be local variables, I think.
> };
>
> static struct audio_converter *impl_audio_converter_from_IMFTransform(IMFTransform *iface)
> @@ -85,6 +87,7 @@ static ULONG WINAPI audio_converter_Release(IMFTransform *iface)
> {
> transform->cs.DebugInfo->Spare[0] = 0;
> DeleteCriticalSection(&transform->cs);
> + gst_object_unref(transform->container);
> heap_free(transform);
> }
>
> @@ -311,7 +314,8 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
> if (!(input_caps = caps_from_mf_media_type(type)))
> return MF_E_INVALIDTYPE;
>
> - gst_caps_unref(input_caps);
> + if (flags & MFT_SET_TYPE_TEST_ONLY)
> + gst_caps_unref(input_caps);
> }
>
> if (flags & MFT_SET_TYPE_TEST_ONLY)
> @@ -320,6 +324,7 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
> EnterCriticalSection(&converter->cs);
>
> hr = S_OK;
> + gst_element_set_state(converter->container, GST_STATE_READY);
Presumably you also want to reset "inflight" here...
>
> if (type)
> {
> @@ -329,6 +334,9 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
> if (SUCCEEDED(hr))
> hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->input_type);
>
> + g_object_set(converter->appsrc, "caps", input_caps, NULL);
> + gst_caps_unref(input_caps);
> +
> if (FAILED(hr))
> {
> IMFMediaType_Release(converter->input_type);
> @@ -341,6 +349,9 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
> converter->input_type = NULL;
> }
>
> + if (converter->input_type && converter->output_type)
> + gst_element_set_state(converter->container, GST_STATE_PLAYING);
> +
> LeaveCriticalSection(&converter->cs);
>
> return hr;
> @@ -386,7 +397,8 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
> if (!(output_caps = caps_from_mf_media_type(type)))
> return MF_E_INVALIDTYPE;
>
> - gst_caps_unref(output_caps);
> + if (flags & MFT_SET_TYPE_TEST_ONLY)
> + gst_caps_unref(output_caps);
This is something of a style nitpick, but having variables that are
conditionally valid like this is often better avoided. Reorganizing the
function to be something more like
if (CLEAR)
{
if (TEST_ONLY)
return;
EnterCriticalSection();
// clear
LeaveCriticalSection();
return;
}
// validate
// convert to caps
if (TEST_ONLY)
return;
EnterCriticalSection();
// clear
LeaveCriticalSection();
might be more idiomatic.
> }
>
> if (flags & MFT_SET_TYPE_TEST_ONLY)
> @@ -395,6 +407,7 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
> EnterCriticalSection(&converter->cs);
>
> hr = S_OK;
> + gst_element_set_state(converter->container, GST_STATE_READY);
...and here.
>
> if (type)
> {
> @@ -404,6 +417,9 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
> if (SUCCEEDED(hr))
> hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *) converter->output_type);
>
> + g_object_set(converter->appsink, "caps", output_caps, NULL);
> + gst_caps_unref(output_caps);
> +
> if (FAILED(hr))
> {
> IMFMediaType_Release(converter->output_type);
> @@ -416,6 +432,9 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
> converter->output_type = NULL;
> }
>
> + if (converter->input_type && converter->output_type)
> + gst_element_set_state(converter->container, GST_STATE_PLAYING);
> +
> LeaveCriticalSection(&converter->cs);
>
> return hr;
> @@ -479,17 +498,102 @@ static HRESULT WINAPI audio_converter_ProcessMessage(IMFTransform *iface, MFT_ME
>
> static HRESULT WINAPI audio_converter_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags)
> {
> - FIXME("%p, %u, %p, %#x.\n", iface, id, sample, flags);
> + GstBuffer *gst_buffer;
> + int ret;
>
> - return E_NOTIMPL;
> + struct audio_converter *converter = impl_audio_converter_from_IMFTransform(iface);
> +
> + TRACE("%p, %u, %p, %#x.\n", iface, id, sample, flags);
> +
> + if (flags)
> + WARN("Unsupported flags %#x\n", flags);
> +
> + if (id != 0)
> + return MF_E_INVALIDSTREAMNUMBER;
> +
> + EnterCriticalSection(&converter->cs);
> +
> + if (!converter->input_type || !converter->output_type)
> + {
> + LeaveCriticalSection(&converter->cs);
> + return MF_E_TRANSFORM_TYPE_NOT_SET;
> + }
> +
> + if (converter->inflight)
> + {
> + LeaveCriticalSection(&converter->cs);
> + return MF_E_NOTACCEPTING;
> + }
> +
> + if (!(gst_buffer = gst_buffer_from_mf_sample(sample)))
> + {
> + LeaveCriticalSection(&converter->cs);
> + return E_FAIL;
> + }
> +
> + g_signal_emit_by_name(converter->appsrc, "push-buffer", gst_buffer, &ret);
> + gst_buffer_unref(gst_buffer);
> + if (ret != GST_FLOW_OK)
> + {
> + ERR("Couldn't push buffer ret = %d (%s)\n", ret, gst_flow_get_name(ret));
Is there a point in tracing the numeric value as well?
> + LeaveCriticalSection(&converter->cs);
> + return E_FAIL;
> + }
> +
> + converter->inflight = TRUE;
> + LeaveCriticalSection(&converter->cs);
> +
> + return S_OK;
> }
>
> static HRESULT WINAPI audio_converter_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,
> MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status)
> {
> - FIXME("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status);
> + GstSample *sample;
>
> - return E_NOTIMPL;
> + struct audio_converter *converter = impl_audio_converter_from_IMFTransform(iface);
> +
> + TRACE("%p, %#x, %u, %p, %p.\n", iface, flags, count, samples, status);
> +
> + if (flags)
> + WARN("Unsupported flags %#x\n", flags);
> +
> + if (!count)
> + return S_OK;
> +
> + if (count != 1)
> + return MF_E_INVALIDSTREAMNUMBER;
> +
> + if (samples[0].dwStreamID != 0)
> + return MF_E_INVALIDSTREAMNUMBER;
> +
> + EnterCriticalSection(&converter->cs);
> +
> + if (!converter->input_type || !converter->output_type)
> + {
> + LeaveCriticalSection(&converter->cs);
> + return MF_E_TRANSFORM_TYPE_NOT_SET;
> + }
> +
> + if (!converter->inflight)
> + {
> + LeaveCriticalSection(&converter->cs);
> + return MF_E_TRANSFORM_NEED_MORE_INPUT;
> + }
> +
> + g_signal_emit_by_name(converter->appsink, "pull-sample", &sample);
I'm not fully familiar with mfplat, but this call may block, and it
doesn't look like ProcessOutput() is supposed to. You probably want
"try-pull-sample" instead.
> +
> + converter->inflight = FALSE;
Nitpick, but this looks like a spacing error.
> +
> + samples[0].pSample = mf_sample_from_gst_buffer(gst_sample_get_buffer(sample));
> + gst_sample_unref(sample);
> + samples[0].dwStatus = S_OK;
> + samples[0].pEvents = NULL;
> + *status = 0;
> +
> + LeaveCriticalSection(&converter->cs);
> +
> + return S_OK;
> }
>
> static const IMFTransformVtbl audio_converter_vtbl =
> @@ -537,6 +641,65 @@ HRESULT audio_converter_create(REFIID riid, void **ret)
> InitializeCriticalSection(&object->cs);
> object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": audio_converter_lock");
>
> + object->container = gst_bin_new(NULL);
> +
> + if (!(object->appsrc = gst_element_factory_make("appsrc", NULL)))
> + {
> + ERR("Failed to create appsrc, are %u-bit Gstreamer \"base\" plugins installed?\n",
> + 8 * (int)sizeof(void *));
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> + gst_bin_add(GST_BIN(object->container), object->appsrc);
> +
> + if (!(object->audioconvert = gst_element_factory_make("audioconvert", NULL)))
> + {
> + ERR("Failed to create audioconvert, are %u-bit Gstreamer \"base\" plugins installed?\n",
> + 8 * (int)sizeof(void *));
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> + gst_bin_add(GST_BIN(object->container), object->audioconvert);
> +
> + if (!(object->resampler = gst_element_factory_make("audioresample", NULL)))
> + {
> + ERR("Failed to create audioresample, are %u-bit Gstreamer \"base\" plugins installed?\n",
> + 8 * (int)sizeof(void *));
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> + gst_bin_add(GST_BIN(object->container), object->resampler);
> +
> + if (!(object->appsink = gst_element_factory_make("appsink", NULL)))
> + {
> + ERR("Failed to create appsink, are %u-bit Gstreamer \"base\" plugins installed?\n",
> + 8 * (int)sizeof(void *));
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> + gst_bin_add(GST_BIN(object->container), object->appsink);
> +
> + if (!gst_element_link(object->appsrc, object->audioconvert))
> + {
> + ERR("Failed to link appsrc to audioconvert\n");
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> +
> + if (!gst_element_link(object->audioconvert, object->resampler))
> + {
> + ERR("Failed to link audioconvert to resampler\n");
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> +
> + if (!gst_element_link(object->resampler, object->appsink))
> + {
> + ERR("Failed to link resampler to appsink\n");
> + IMFTransform_Release(&object->IMFTransform_iface);
> + return E_FAIL;
> + }
> +
> *ret = &object->IMFTransform_iface;
> return S_OK;
> }
> diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
> index 9518f721504..14b6a011ac2 100644
> --- a/dlls/winegstreamer/gst_private.h
> +++ b/dlls/winegstreamer/gst_private.h
> @@ -82,6 +82,7 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HI
> IMFMediaType *mf_media_type_from_caps(const GstCaps *caps) DECLSPEC_HIDDEN;
> GstCaps *caps_from_mf_media_type(IMFMediaType *type) DECLSPEC_HIDDEN;
> IMFSample *mf_sample_from_gst_buffer(GstBuffer *in) DECLSPEC_HIDDEN;
> +GstBuffer *gst_buffer_from_mf_sample(IMFSample *in) DECLSPEC_HIDDEN;
>
> HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HIDDEN;
>
> diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
> index f300988fc5c..883084b2d89 100644
> --- a/dlls/winegstreamer/mfplat.c
> +++ b/dlls/winegstreamer/mfplat.c
> @@ -865,3 +865,72 @@ done:
>
> return out;
> }
> +
> +GstBuffer* gst_buffer_from_mf_sample(IMFSample *mf_sample)
Please use consistent spacing around pointers.
> +{
> + GstBuffer *out = gst_buffer_new();
> + IMFMediaBuffer *mf_buffer = NULL;
> + LONGLONG duration, time;
> + DWORD buffer_count;
> + unsigned int i;
> + HRESULT hr;
> +
> + if (FAILED(hr = IMFSample_GetSampleDuration(mf_sample, &duration)))
> + goto fail;
> +
> + if (FAILED(hr = IMFSample_GetSampleTime(mf_sample, &time)))
> + goto fail;
> +
> + GST_BUFFER_DURATION(out) = duration;
> + GST_BUFFER_PTS(out) = time * 100;
> +
> + if (FAILED(hr = IMFSample_GetBufferCount(mf_sample, &buffer_count)))
> + goto fail;
> +
> + for (i = 0; i < buffer_count; i++)
> + {
> + DWORD buffer_size;
> + GstMapInfo map_info;
> + GstMemory *memory;
> + BYTE *buf_data;
> +
> + if (FAILED(hr = IMFSample_GetBufferByIndex(mf_sample, i, &mf_buffer)))
> + goto fail;
> +
> + if (FAILED(hr = IMFMediaBuffer_GetCurrentLength(mf_buffer, &buffer_size)))
> + goto fail;
> +
> + memory = gst_allocator_alloc(NULL, buffer_size, NULL);
> + gst_memory_resize(memory, 0, buffer_size);
> +
> + if (!(gst_memory_map(memory, &map_info, GST_MAP_WRITE)))
These parentheses are somewhat redundant...
> + {
> + hr = E_FAIL;
> + goto fail;
> + }
> +
> + if (FAILED(hr = IMFMediaBuffer_Lock(mf_buffer, &buf_data, NULL, NULL)))
> + goto fail;
> +
> + memcpy(map_info.data, buf_data, buffer_size);
> +
> + if (FAILED(hr = IMFMediaBuffer_Unlock(mf_buffer)))
> + goto fail;
> +
> + gst_memory_unmap(memory, &map_info);
> +
> + gst_buffer_append_memory(out, memory);
> +
> + IMFMediaBuffer_Release(mf_buffer);
> + mf_buffer = NULL;
> + }
> +
> + return out;
> +
> +fail:
> + ERR("Failed to copy IMFSample to GstBuffer, hr = %#x\n", hr);
> + if (mf_buffer)
> + IMFMediaBuffer_Release(mf_buffer);
> + gst_buffer_unref(out);
> + return NULL;
> +}
>
Dec. 4, 2020
Re: [PATCH 02/17] winegstreamer: Implement ::SetOutputType for audio conversion transform.
by Zebediah Figura (she/her)
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Dec. 4, 2020
Re: [PATCH 01/17] winegstreamer: Implement ::SetInputType for audio conversion transform.
by Zebediah Figura (she/her)
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
That said, I am only really qualified to review these patches for
general errors, and for usage of GStreamer; it strikes me as a good idea
for the Media Foundation maintainers to also review them, to ensure the
functions are doing what they are supposed to.
Dec. 4, 2020
[PATCH] mfplat: Zero-initialize the device manager object.
by Zebediah Figura
This fixes a crash for me when reallocating "handles", triggered by the mfplat tests.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/mfplat/main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index e4cd1c397ad..54bd70a2fff 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -8911,14 +8911,12 @@ HRESULT WINAPI MFCreateDXGIDeviceManager(UINT *token, IMFDXGIDeviceManager **man
if (!token || !manager)
return E_POINTER;
- object = heap_alloc(sizeof(*object));
- if (!object)
+ if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
object->IMFDXGIDeviceManager_iface.lpVtbl = &dxgi_device_manager_vtbl;
object->refcount = 1;
object->token = GetTickCount();
- object->device = NULL;
InitializeCriticalSection(&object->cs);
InitializeConditionVariable(&object->lock);
--
2.29.2
Dec. 4, 2020
[PATCH] ntdll: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/ntdll/atom.c | 3 +-
dlls/ntdll/directory.c | 6 +-
dlls/ntdll/env.c | 138 +++++++++++++----------------------------
dlls/ntdll/loader.c | 107 +++++++++++---------------------
dlls/ntdll/loadorder.c | 24 +++----
dlls/ntdll/locale.c | 8 +--
dlls/ntdll/path.c | 15 ++---
dlls/ntdll/reg.c | 31 ++-------
dlls/ntdll/relay.c | 32 +++-------
dlls/ntdll/rtl.c | 6 +-
dlls/ntdll/rtlstr.c | 20 ++----
dlls/ntdll/sec.c | 7 +--
12 files changed, 123 insertions(+), 274 deletions(-)
diff --git a/dlls/ntdll/atom.c b/dlls/ntdll/atom.c
index fd1f17b6197..8facadbf8f6 100644
--- a/dlls/ntdll/atom.c
+++ b/dlls/ntdll/atom.c
@@ -102,11 +102,10 @@ NTSTATUS WINAPI RtlDeleteAtomFromAtomTable( RTL_ATOM_TABLE table, RTL_ATOM atom
*/
static ULONG integral_atom_name(WCHAR* buffer, ULONG len, RTL_ATOM atom)
{
- static const WCHAR fmt[] = {'#','%','u',0};
WCHAR tmp[16];
int ret;
- ret = swprintf( tmp, ARRAY_SIZE(tmp), fmt, atom );
+ ret = swprintf( tmp, ARRAY_SIZE(tmp), L"#%u", atom );
if (!len) return ret * sizeof(WCHAR);
if (len <= ret) ret = len - 1;
memcpy( buffer, tmp, ret * sizeof(WCHAR) );
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 39641e9d4d5..cfb4595d457 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -50,8 +50,6 @@ static BOOL show_dot_files;
*/
void init_directories(void)
{
- static const WCHAR WineW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0};
- static const WCHAR ShowDotFilesW[] = {'S','h','o','w','D','o','t','F','i','l','e','s',0};
char tmp[80];
HANDLE root, hkey;
DWORD dummy;
@@ -65,12 +63,12 @@ void init_directories(void)
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &nameW, WineW );
+ RtlInitUnicodeString( &nameW, L"Software\\Wine" );
/* @@ Wine registry key: HKCU\Software\Wine */
if (!NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ))
{
- RtlInitUnicodeString( &nameW, ShowDotFilesW );
+ RtlInitUnicodeString( &nameW, L"ShowDotFiles" );
if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy ))
{
WCHAR *str = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data;
diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c
index bf3fedcac67..5d1b6de5bba 100644
--- a/dlls/ntdll/env.c
+++ b/dlls/ntdll/env.c
@@ -33,7 +33,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(environ);
-static WCHAR empty[] = {0};
+static WCHAR empty[] = L"";
static const UNICODE_STRING empty_str = { 0, sizeof(empty), empty };
static const UNICODE_STRING null_str = { 0, 0, NULL };
@@ -76,7 +76,6 @@ static void set_env_var( WCHAR **env, const WCHAR *name, const WCHAR *val )
static void set_registry_variables( WCHAR **env, HANDLE hkey, ULONG type )
{
static const WCHAR pathW[] = {'P','A','T','H'};
- static const WCHAR sep[] = {';',0};
UNICODE_STRING env_name, env_value;
NTSTATUS status;
DWORD size;
@@ -114,7 +113,7 @@ static void set_registry_variables( WCHAR **env, HANDLE hkey, ULONG type )
!wcsnicmp( env_name.Buffer, pathW, ARRAY_SIZE( pathW )) &&
!RtlQueryEnvironmentVariable_U( *env, &env_name, &tmp ))
{
- RtlAppendUnicodeToString( &tmp, sep );
+ RtlAppendUnicodeToString( &tmp, L";" );
if (RtlAppendUnicodeStringToString( &tmp, &env_value )) continue;
RtlCopyUnicodeString( &env_value, &tmp );
}
@@ -137,16 +136,6 @@ static void set_registry_variables( WCHAR **env, HANDLE hkey, ULONG type )
*/
static BOOL set_registry_environment( WCHAR **env, BOOL first_time )
{
- static const WCHAR env_keyW[] = {'\\','R','e','g','i','s','t','r','y','\\',
- 'M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\',
- 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',
- 'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r','\\',
- 'E','n','v','i','r','o','n','m','e','n','t',0};
- static const WCHAR envW[] = {'E','n','v','i','r','o','n','m','e','n','t',0};
- static const WCHAR volatile_envW[] = {'V','o','l','a','t','i','l','e',' ','E','n','v','i','r','o','n','m','e','n','t',0};
-
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
HANDLE hkey;
@@ -154,7 +143,8 @@ static BOOL set_registry_environment( WCHAR **env, BOOL first_time )
/* first the system environment variables */
InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL );
- RtlInitUnicodeString( &nameW, env_keyW );
+ RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\"
+ "Session Manager\\Environment" );
if (first_time && !NtOpenKey( &hkey, KEY_READ, &attr ))
{
set_registry_variables( env, hkey, REG_SZ );
@@ -165,7 +155,7 @@ static BOOL set_registry_environment( WCHAR **env, BOOL first_time )
/* then the ones for the current user */
if (RtlOpenCurrentUser( KEY_READ, &attr.RootDirectory ) != STATUS_SUCCESS) return ret;
- RtlInitUnicodeString( &nameW, envW );
+ RtlInitUnicodeString( &nameW, L"Environment" );
if (first_time && !NtOpenKey( &hkey, KEY_READ, &attr ))
{
set_registry_variables( env, hkey, REG_SZ );
@@ -173,7 +163,7 @@ static BOOL set_registry_environment( WCHAR **env, BOOL first_time )
NtClose( hkey );
}
- RtlInitUnicodeString( &nameW, volatile_envW );
+ RtlInitUnicodeString( &nameW, L"Volatile Environment" );
if (!NtOpenKey( &hkey, KEY_READ, &attr ))
{
set_registry_variables( env, hkey, REG_SZ );
@@ -237,26 +227,6 @@ static WCHAR *get_registry_value( WCHAR *env, HKEY hkey, const WCHAR *name )
*/
static void set_additional_environment( WCHAR **env )
{
- static const WCHAR profile_keyW[] = {'\\','R','e','g','i','s','t','r','y','\\',
- 'M','a','c','h','i','n','e','\\',
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'P','r','o','f','i','l','e','L','i','s','t',0};
- static const WCHAR computer_keyW[] = {'\\','R','e','g','i','s','t','r','y','\\',
- 'M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\',
- 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',
- 'C','o','m','p','u','t','e','r','N','a','m','e','\\',
- 'A','c','t','i','v','e','C','o','m','p','u','t','e','r','N','a','m','e',0};
- static const WCHAR computer_valueW[] = {'C','o','m','p','u','t','e','r','N','a','m','e',0};
- static const WCHAR public_valueW[] = {'P','u','b','l','i','c',0};
- static const WCHAR computernameW[] = {'C','O','M','P','U','T','E','R','N','A','M','E',0};
- static const WCHAR allusersW[] = {'A','L','L','U','S','E','R','S','P','R','O','F','I','L','E',0};
- static const WCHAR programdataW[] = {'P','r','o','g','r','a','m','D','a','t','a',0};
- static const WCHAR publicW[] = {'P','U','B','L','I','C',0};
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
WCHAR *val;
@@ -265,18 +235,19 @@ static void set_additional_environment( WCHAR **env )
/* set the user profile variables */
InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL );
- RtlInitUnicodeString( &nameW, profile_keyW );
+ RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\"
+ "CurrentVersion\\ProfileList" );
if (!NtOpenKey( &hkey, KEY_READ, &attr ))
{
- if ((val = get_registry_value( *env, hkey, programdataW )))
+ if ((val = get_registry_value( *env, hkey, L"ProgramData" )))
{
- set_env_var( env, allusersW, val );
- set_env_var( env, programdataW, val );
+ set_env_var( env, L"ALLUSERSPROFILE", val );
+ set_env_var( env, L"ProgramData", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
- if ((val = get_registry_value( *env, hkey, public_valueW )))
+ if ((val = get_registry_value( *env, hkey, L"Public" )))
{
- set_env_var( env, publicW, val );
+ set_env_var( env, L"PUBLIC", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
NtClose( hkey );
@@ -284,12 +255,13 @@ static void set_additional_environment( WCHAR **env )
/* set the computer name */
- RtlInitUnicodeString( &nameW, computer_keyW );
+ RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\"
+ "ComputerName\\ActiveComputerName" );
if (!NtOpenKey( &hkey, KEY_READ, &attr ))
{
- if ((val = get_registry_value( *env, hkey, computer_valueW )))
+ if ((val = get_registry_value( *env, hkey, L"ComputerName" )))
{
- set_env_var( env, computernameW, val );
+ set_env_var( env, L"COMPUTERNAME", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
NtClose( hkey );
@@ -304,25 +276,8 @@ static void set_additional_environment( WCHAR **env )
*/
static void set_wow64_environment( WCHAR **env )
{
- static WCHAR archW[] = {'P','R','O','C','E','S','S','O','R','_','A','R','C','H','I','T','E','C','T','U','R','E',0};
- static WCHAR arch6432W[] = {'P','R','O','C','E','S','S','O','R','_','A','R','C','H','I','T','E','W','6','4','3','2',0};
- static const WCHAR x86W[] = {'x','8','6',0};
- static const WCHAR versionW[] = {'\\','R','e','g','i','s','t','r','y','\\',
- 'M','a','c','h','i','n','e','\\',
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
- static const WCHAR progdirW[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',0};
- static const WCHAR progdir86W[] = {'P','r','o','g','r','a','m','F','i','l','e','s','D','i','r',' ','(','x','8','6',')',0};
- static const WCHAR progfilesW[] = {'P','r','o','g','r','a','m','F','i','l','e','s',0};
- static const WCHAR progfiles86W[] = {'P','r','o','g','r','a','m','F','i','l','e','s','(','x','8','6',')',0};
- static const WCHAR progw6432W[] = {'P','r','o','g','r','a','m','W','6','4','3','2',0};
- static const WCHAR commondirW[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',0};
- static const WCHAR commondir86W[] = {'C','o','m','m','o','n','F','i','l','e','s','D','i','r',' ','(','x','8','6',')',0};
- static const WCHAR commonfilesW[] = {'C','o','m','m','o','n','P','r','o','g','r','a','m','F','i','l','e','s',0};
- static const WCHAR commonfiles86W[] = {'C','o','m','m','o','n','P','r','o','g','r','a','m','F','i','l','e','s','(','x','8','6',')',0};
- static const WCHAR commonw6432W[] = {'C','o','m','m','o','n','P','r','o','g','r','a','m','W','6','4','3','2',0};
+ static WCHAR archW[] = L"PROCESSOR_ARCHITECTURE";
+ static WCHAR arch6432W[] = L"PROCESSOR_ARCHITEW6432";
WCHAR buf[256];
UNICODE_STRING arch_strW = { sizeof(archW) - sizeof(WCHAR), sizeof(archW), archW };
@@ -363,42 +318,42 @@ static void set_wow64_environment( WCHAR **env )
if (is_wow64)
{
RtlSetEnvironmentVariable( env, &arch6432_strW, &valW );
- RtlInitUnicodeString( &nameW, x86W );
+ RtlInitUnicodeString( &nameW, L"x86" );
RtlSetEnvironmentVariable( env, &arch_strW, &nameW );
}
}
InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL );
- RtlInitUnicodeString( &nameW, versionW );
+ RtlInitUnicodeString( &nameW, L"\\Registry\\Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
if (NtOpenKey( &hkey, KEY_READ | KEY_WOW64_64KEY, &attr )) return;
/* set the ProgramFiles variables */
- if ((val = get_registry_value( *env, hkey, progdirW )))
+ if ((val = get_registry_value( *env, hkey, L"ProgramFilesDir" )))
{
- if (is_win64 || is_wow64) set_env_var( env, progw6432W, val );
- if (is_win64 || !is_wow64) set_env_var( env, progfilesW, val );
+ if (is_win64 || is_wow64) set_env_var( env, L"ProgramW6432", val );
+ if (is_win64 || !is_wow64) set_env_var( env, L"ProgramFiles", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
- if ((val = get_registry_value( *env, hkey, progdir86W )))
+ if ((val = get_registry_value( *env, hkey, L"ProgramFilesDir (x86)" )))
{
- if (is_win64 || is_wow64) set_env_var( env, progfiles86W, val );
- if (is_wow64) set_env_var( env, progfilesW, val );
+ if (is_win64 || is_wow64) set_env_var( env, L"ProgramFiles(x86)", val );
+ if (is_wow64) set_env_var( env, L"ProgramFiles", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
/* set the CommonProgramFiles variables */
- if ((val = get_registry_value( *env, hkey, commondirW )))
+ if ((val = get_registry_value( *env, hkey, L"CommonFilesDir" )))
{
- if (is_win64 || is_wow64) set_env_var( env, commonw6432W, val );
- if (is_win64 || !is_wow64) set_env_var( env, commonfilesW, val );
+ if (is_win64 || is_wow64) set_env_var( env, L"CommonProgramW6432", val );
+ if (is_win64 || !is_wow64) set_env_var( env, L"CommonProgramFiles", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
- if ((val = get_registry_value( *env, hkey, commondir86W )))
+ if ((val = get_registry_value( *env, hkey, L"CommonFilesDir (x86)" )))
{
- if (is_win64 || is_wow64) set_env_var( env, commonfiles86W, val );
- if (is_wow64) set_env_var( env, commonfilesW, val );
+ if (is_win64 || is_wow64) set_env_var( env, L"CommonProgramFiles(x86)", val );
+ if (is_wow64) set_env_var( env, L"CommonProgramFiles", val );
RtlFreeHeap( GetProcessHeap(), 0, val );
}
NtClose( hkey );
@@ -469,7 +424,6 @@ static inline BOOL is_path_prefix( const WCHAR *prefix, const WCHAR *path, const
*/
static void get_image_path( const WCHAR *name, UNICODE_STRING *path )
{
- static const WCHAR exeW[] = {'.','e','x','e',0};
WCHAR *load_path, *file_part, full_name[MAX_PATH];
DWORD len;
@@ -482,7 +436,7 @@ static void get_image_path( const WCHAR *name, UNICODE_STRING *path )
if (RtlDoesFileExists_U( full_name )) goto done;
if (len < (MAX_PATH - 4) * sizeof(WCHAR) && !wcschr( file_part, '.' ))
{
- wcscat( file_part, exeW );
+ wcscat( file_part, L".exe" );
if (RtlDoesFileExists_U( full_name )) goto done;
}
/* check for builtin path inside system directory */
@@ -495,7 +449,7 @@ static void get_image_path( const WCHAR *name, UNICODE_STRING *path )
else
{
RtlGetExePath( name, &load_path );
- len = RtlDosSearchPath_U( load_path, name, exeW, sizeof(full_name), full_name, &file_part );
+ len = RtlDosSearchPath_U( load_path, name, L".exe", sizeof(full_name), full_name, &file_part );
RtlReleasePath( load_path );
if (!len || len > sizeof(full_name))
{
@@ -504,7 +458,7 @@ static void get_image_path( const WCHAR *name, UNICODE_STRING *path )
if (wcslen( name ) >= MAX_PATH - 4 - len) goto failed;
wcscpy( full_name, system_dir );
wcscat( full_name, name );
- if (!wcschr( name, '.' )) wcscat( full_name, exeW );
+ if (!wcschr( name, '.' )) wcscat( full_name, L".exe" );
}
}
done:
@@ -1140,15 +1094,6 @@ static inline void get_unicode_string( UNICODE_STRING *str, WCHAR **src, UINT le
*/
static void run_wineboot( WCHAR **env )
{
- static const WCHAR wineboot_eventW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
- '\\','_','_','w','i','n','e','b','o','o','t','_','e','v','e','n','t',0};
- static const WCHAR wineboot[] = {'\\','?','?','\\','C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','t','e','m','3','2','\\',
- 'w','i','n','e','b','o','o','t','.','e','x','e',0};
- static const WCHAR cmdline[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','t','e','m','3','2','\\',
- 'w','i','n','e','b','o','o','t','.','e','x','e',' ',
- '-','-','i','n','i','t',0};
UNICODE_STRING nameW, cmdlineW, dllpathW;
RTL_USER_PROCESS_PARAMETERS *params;
RTL_USER_PROCESS_INFORMATION info;
@@ -1160,7 +1105,7 @@ static void run_wineboot( WCHAR **env )
ULONG redir = 0;
int count = 1;
- RtlInitUnicodeString( &nameW, wineboot_eventW );
+ RtlInitUnicodeString( &nameW, L"\\KernelObjects\\__wineboot_event" );
InitializeObjectAttributes( &attr, &nameW, OBJ_OPENIF, 0, NULL );
status = NtCreateEvent( &handles[0], EVENT_ALL_ACCESS, &attr, NotificationEvent, 0 );
@@ -1170,17 +1115,18 @@ static void run_wineboot( WCHAR **env )
ERR( "failed to create wineboot event, expect trouble\n" );
return;
}
- LdrGetDllPath( wineboot + 4, LOAD_WITH_ALTERED_SEARCH_PATH, &load_path, &dummy );
- RtlInitUnicodeString( &nameW, wineboot + 4 );
+ LdrGetDllPath( L"C:\\windows\\system32\\wineboot.exe", LOAD_WITH_ALTERED_SEARCH_PATH,
+ &load_path, &dummy );
+ RtlInitUnicodeString( &nameW, L"C:\\windows\\system32\\wineboot.exe" );
RtlInitUnicodeString( &dllpathW, load_path );
- RtlInitUnicodeString( &cmdlineW, cmdline );
+ RtlInitUnicodeString( &cmdlineW, L"C:\\windows\\system32\\wineboot.exe --init" );
RtlCreateProcessParametersEx( ¶ms, &nameW, &dllpathW, NULL, &cmdlineW, *env, NULL, NULL,
NULL, NULL, PROCESS_PARAMS_FLAG_NORMALIZED );
params->hStdInput = 0;
params->hStdOutput = 0;
params->hStdError = NtCurrentTeb()->Peb->ProcessParameters->hStdError;
- RtlInitUnicodeString( &nameW, wineboot );
+ RtlInitUnicodeString( &nameW, L"\\??\\C:\\windows\\system32\\wineboot.exe" );
RtlWow64EnableFsRedirectionEx( TRUE, &redir );
status = RtlCreateUserProcess( &nameW, OBJ_CASE_INSENSITIVE, params,
NULL, NULL, 0, FALSE, 0, 0, &info );
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index ff5a175027c..45ad496fd64 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -63,23 +63,16 @@ void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) = NUL
const struct unix_funcs *unix_funcs = NULL;
/* windows directory */
-const WCHAR windows_dir[] = {'C',':','\\','w','i','n','d','o','w','s',0};
+const WCHAR windows_dir[] = L"C:\\windows";
/* system directory with trailing backslash */
-const WCHAR system_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','t','e','m','3','2','\\',0};
-const WCHAR syswow64_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','w','o','w','6','4','\\',0};
+const WCHAR system_dir[] = L"C:\\windows\\system32\\";
+const WCHAR syswow64_dir[] = L"C:\\windows\\syswow64\\";
static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
BOOL is_wow64 = FALSE;
/* system search path */
-static const WCHAR system_path[] =
- {'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2',';',
- 'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m',';',
- 'C',':','\\','w','i','n','d','o','w','s',0};
-
-static const WCHAR dotW[] = {'.',0};
+static const WCHAR system_path[] = L"C:\\windows\\system32;C:\\windows\\system;C:\\windows";
static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
@@ -116,8 +109,6 @@ static const char * const reason_names[] =
"WINE_PREATTACH"
};
-static const WCHAR dllW[] = {'.','d','l','l',0};
-
struct file_id
{
BYTE ObjectId[16];
@@ -613,20 +604,21 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
FARPROC proc = NULL;
if (!end) return NULL;
- if ((end - forward) * sizeof(WCHAR) > sizeof(buffer) - sizeof(dllW))
+ if ((end - forward) * sizeof(WCHAR) > sizeof(buffer) - sizeof(L".dll"))
{
- if (!(mod_name = RtlAllocateHeap( GetProcessHeap(), 0, (end - forward + sizeof(dllW)) * sizeof(WCHAR) )))
+ if (!(mod_name = RtlAllocateHeap( GetProcessHeap(), 0,
+ (end - forward + sizeof(L".dll")) * sizeof(WCHAR) )))
return NULL;
}
ascii_to_unicode( mod_name, forward, end - forward );
mod_name[end - forward] = 0;
if (!wcschr( mod_name, '.' ))
- memcpy( mod_name + (end - forward), dllW, sizeof(dllW) );
+ memcpy( mod_name + (end - forward), L".dll", sizeof(L".dll") );
if (!(wm = find_basename_module( mod_name )))
{
TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward );
- if (load_dll( load_path, mod_name, dllW, 0, &wm ) == STATUS_SUCCESS &&
+ if (load_dll( load_path, mod_name, L".dll", 0, &wm ) == STATUS_SUCCESS &&
!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
{
if (!imports_fixup_done && current_modref)
@@ -789,7 +781,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
{
ascii_to_unicode( buffer, name, len );
buffer[len] = 0;
- status = load_dll( load_path, buffer, dllW, 0, &wmImp );
+ status = load_dll( load_path, buffer, L".dll", 0, &wmImp );
}
else /* need to allocate a larger buffer */
{
@@ -797,7 +789,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
if (!ptr) return FALSE;
ascii_to_unicode( ptr, name, len );
ptr[len] = 0;
- status = load_dll( load_path, ptr, dllW, 0, &wmImp );
+ status = load_dll( load_path, ptr, L".dll", 0, &wmImp );
RtlFreeHeap( GetProcessHeap(), 0, ptr );
}
@@ -930,8 +922,6 @@ static NTSTATUS create_module_activation_context( LDR_DATA_TABLE_ENTRY *module )
*/
static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_HEADERS *nt, LPCWSTR filename )
{
- static const WCHAR ntdllW[] = {'n','t','d','l','l','.','d','l','l',0};
- static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
const IMAGE_IMPORT_DESCRIPTOR *imports;
DWORD i, size;
WCHAR buffer[16];
@@ -949,7 +939,7 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H
DWORD len = strlen(name);
if (len * sizeof(WCHAR) >= sizeof(buffer)) continue;
ascii_to_unicode( buffer, name, len + 1 );
- if (!wcsicmp( buffer, ntdllW ) || !wcsicmp( buffer, kernel32W ))
+ if (!wcsicmp( buffer, L"ntdll.dll" ) || !wcsicmp( buffer, L"kernel32.dll" ))
{
TRACE( "%s imports %s, assuming not native\n", debugstr_w(filename), debugstr_w(buffer) );
return FALSE;
@@ -1067,7 +1057,6 @@ static void free_tls_slot( LDR_DATA_TABLE_ENTRY *mod )
*/
static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void **entry )
{
- static const WCHAR mscoreeW[] = {'m','s','c','o','r','e','e','.','d','l','l',0};
IMAGE_EXPORT_DIRECTORY *exports;
DWORD exp_size;
NTSTATUS status;
@@ -1082,7 +1071,7 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void *
prev = current_modref;
current_modref = wm;
- if (!(status = load_dll( load_path, mscoreeW, NULL, 0, &imp ))) wm->deps[0] = imp;
+ if (!(status = load_dll( load_path, L"mscoree.dll", NULL, 0, &imp ))) wm->deps[0] = imp;
current_modref = prev;
if (status)
{
@@ -2099,8 +2088,6 @@ static inline WCHAR *append_path( WCHAR *p, const WCHAR *str, int len )
*/
static NTSTATUS get_dll_load_path( LPCWSTR module, LPCWSTR dll_dir, ULONG safe_mode, WCHAR **path )
{
- static const WCHAR pathW[] = {'P','A','T','H',0};
-
const WCHAR *mod_end = module;
UNICODE_STRING name, value;
WCHAR *p, *ret;
@@ -2112,7 +2099,7 @@ static NTSTATUS get_dll_load_path( LPCWSTR module, LPCWSTR dll_dir, ULONG safe_m
len += (mod_end - module) + 1;
}
- RtlInitUnicodeString( &name, pathW );
+ RtlInitUnicodeString( &name, L"PATH" );
value.Length = 0;
value.MaximumLength = 0;
value.Buffer = NULL;
@@ -2126,9 +2113,9 @@ static NTSTATUS get_dll_load_path( LPCWSTR module, LPCWSTR dll_dir, ULONG safe_m
p = append_path( p, module, mod_end - module );
if (dll_dir) p = append_path( p, dll_dir, -1 );
- else if (!safe_mode) p = append_path( p, dotW, -1 );
+ else if (!safe_mode) p = append_path( p, L".", -1 );
p = append_path( p, system_path, -1 );
- if (!dll_dir && safe_mode) p = append_path( p, dotW, -1 );
+ if (!dll_dir && safe_mode) p = append_path( p, L".", -1 );
value.Buffer = p;
value.MaximumLength = path_len;
@@ -2400,7 +2387,6 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na
static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
{
static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\'};
- static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0};
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info;
ACTCTX_SECTION_KEYED_DATA data;
@@ -2446,7 +2432,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
len = wcslen( p );
if (!dirlen || len <= dirlen ||
RtlCompareUnicodeStrings( p, dirlen, info->lpAssemblyDirectoryName, dirlen, TRUE ) ||
- wcsicmp( p + dirlen, dotManifestW ))
+ wcsicmp( p + dirlen, L".manifest" ))
{
/* manifest name does not match directory name, so it's not a global
* windows/winsxs manifest; use the manifest directory name instead */
@@ -2794,7 +2780,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
RtlEnterCriticalSection( &loader_section );
if (!path_name) path_name = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
- nts = load_dll( path_name, libname->Buffer, dllW, flags, &wm );
+ nts = load_dll( path_name, libname->Buffer, L".dll", flags, &wm );
if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
{
@@ -2828,7 +2814,7 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S
if (!load_path) load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
- status = find_dll_file( load_path, name->Buffer, dllW, &nt_name, &wm, &module, &image_info, &id );
+ status = find_dll_file( load_path, name->Buffer, L".dll", &nt_name, &wm, &module, &image_info, &id );
if (wm) *base = wm->ldr.DllBase;
else
@@ -3574,20 +3560,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
*/
static void load_global_options(void)
{
- static const WCHAR sessionW[] = {'M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\',
- 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',
- 'S','e','s','s','i','o','n',' ','M','a','n','a','g','e','r',0};
- static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
- static const WCHAR safesearchW[] = {'S','a','f','e','P','r','o','c','e','s','s','S','e','a','r','c','h','M','o','d','e',0};
- static const WCHAR safedllmodeW[] = {'S','a','f','e','D','l','l','S','e','a','r','c','h','M','o','d','e',0};
- static const WCHAR critsectW[] = {'C','r','i','t','i','c','a','l','S','e','c','t','i','o','n','T','i','m','e','o','u','t',0};
- static const WCHAR heapresW[] = {'H','e','a','p','S','e','g','m','e','n','t','R','e','s','e','r','v','e',0};
- static const WCHAR heapcommitW[] = {'H','e','a','p','S','e','g','m','e','n','t','C','o','m','m','i','t',0};
- static const WCHAR decommittotalW[] = {'H','e','a','p','D','e','C','o','m','m','i','t','T','o','t','a','l','F','r','e','e','T','h','r','e','s','h','o','l','d',0};
- static const WCHAR decommitfreeW[] = {'H','e','a','p','D','e','C','o','m','m','i','t','F','r','e','e','B','l','o','c','k','T','h','r','e','s','h','o','l','d',0};
-
OBJECT_ATTRIBUTES attr;
UNICODE_STRING name_str;
HANDLE hkey;
@@ -3599,33 +3571,33 @@ static void load_global_options(void)
attr.Attributes = OBJ_CASE_INSENSITIVE;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &name_str, sessionW );
+ RtlInitUnicodeString( &name_str, L"Machine\\System\\CurrentControlSet\\Control\\Session Manager" );
if (!NtOpenKey( &hkey, KEY_QUERY_VALUE, &attr ))
{
- query_dword_option( hkey, globalflagW, &NtCurrentTeb()->Peb->NtGlobalFlag );
- query_dword_option( hkey, safesearchW, &path_safe_mode );
- query_dword_option( hkey, safedllmodeW, &dll_safe_mode );
+ query_dword_option( hkey, L"GlobalFlag", &NtCurrentTeb()->Peb->NtGlobalFlag );
+ query_dword_option( hkey, L"SafeProcessSearchMode", &path_safe_mode );
+ query_dword_option( hkey, L"SafeDllSearchMode", &dll_safe_mode );
- if (!query_dword_option( hkey, critsectW, &value ))
+ if (!query_dword_option( hkey, L"CriticalSectionTimeout", &value ))
NtCurrentTeb()->Peb->CriticalSectionTimeout.QuadPart = (ULONGLONG)value * -10000000;
- if (!query_dword_option( hkey, heapresW, &value ))
+ if (!query_dword_option( hkey, L"HeapSegmentReserve", &value ))
NtCurrentTeb()->Peb->HeapSegmentReserve = value;
- if (!query_dword_option( hkey, heapcommitW, &value ))
+ if (!query_dword_option( hkey, L"HeapSegmentCommit", &value ))
NtCurrentTeb()->Peb->HeapSegmentCommit = value;
- if (!query_dword_option( hkey, decommittotalW, &value ))
+ if (!query_dword_option( hkey, L"HeapDeCommitTotalFreeThreshold", &value ))
NtCurrentTeb()->Peb->HeapDeCommitTotalFreeThreshold = value;
- if (!query_dword_option( hkey, decommitfreeW, &value ))
+ if (!query_dword_option( hkey, L"HeapDeCommitFreeBlockThreshold", &value ))
NtCurrentTeb()->Peb->HeapDeCommitFreeBlockThreshold = value;
NtClose( hkey );
}
LdrQueryImageFileExecutionOptions( &NtCurrentTeb()->Peb->ProcessParameters->ImagePathName,
- globalflagW, REG_DWORD, &NtCurrentTeb()->Peb->NtGlobalFlag,
+ L"GlobalFlag", REG_DWORD, &NtCurrentTeb()->Peb->NtGlobalFlag,
sizeof(DWORD), NULL );
heap_set_debug_flags( GetProcessHeap() );
}
@@ -3918,21 +3890,17 @@ NTSTATUS WINAPI RtlSetSearchPathMode( ULONG flags )
*/
NTSTATUS WINAPI RtlGetExePath( PCWSTR name, PWSTR *path )
{
- static const WCHAR emptyW[1];
- const WCHAR *dlldir = dotW;
+ const WCHAR *dlldir = L".";
const WCHAR *module = NtCurrentTeb()->Peb->ProcessParameters->ImagePathName.Buffer;
/* same check as NeedCurrentDirectoryForExePathW */
if (!wcschr( name, '\\' ))
{
- static const WCHAR env_name[] = {'N','o','D','e','f','a','u','l','t','C','u','r','r','e','n','t',
- 'D','i','r','e','c','t','o','r','y','I','n',
- 'E','x','e','P','a','t','h',0};
UNICODE_STRING name, value = { 0 };
- RtlInitUnicodeString( &name, env_name );
+ RtlInitUnicodeString( &name, L"NoDefaultCurrentDirectoryInExePath" );
if (RtlQueryEnvironmentVariable_U( NULL, &name, &value ) != STATUS_VARIABLE_NOT_FOUND)
- dlldir = emptyW;
+ dlldir = L"";
}
return get_dll_load_path( module, dlldir, FALSE, path );
}
@@ -3995,12 +3963,6 @@ static void restart_winevdm( RTL_USER_PROCESS_PARAMETERS *params )
*/
static NTSTATUS process_init(void)
{
- static const WCHAR ntdllW[] = {'\\','?','?','\\','C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','t','e','m','3','2','\\',
- 'n','t','d','l','l','.','d','l','l',0};
- static const WCHAR kernel32W[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
- 's','y','s','t','e','m','3','2','\\',
- 'k','e','r','n','e','l','3','2','.','d','l','l',0};
RTL_USER_PROCESS_PARAMETERS *params;
WINE_MODREF *wm;
NTSTATUS status;
@@ -4046,13 +4008,14 @@ static NTSTATUS process_init(void)
version_init();
/* setup the load callback and create ntdll modref */
- RtlInitUnicodeString( &nt_name, ntdllW );
+ RtlInitUnicodeString( &nt_name, L"\\??\\C:\\windows\\system32\\ntdll.dll" );
NtQueryVirtualMemory( GetCurrentProcess(), process_init, MemoryBasicInformation,
&meminfo, sizeof(meminfo), NULL );
status = build_builtin_module( params->DllPath.Buffer, &nt_name, meminfo.AllocationBase, 0, &wm );
assert( !status );
- if ((status = load_dll( params->DllPath.Buffer, kernel32W, NULL, 0, &wm )) != STATUS_SUCCESS)
+ if ((status = load_dll( params->DllPath.Buffer, L"C:\\windows\\system32\\kernel32.dll",
+ NULL, 0, &wm )) != STATUS_SUCCESS)
{
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
NtTerminateProcess( GetCurrentProcess(), status );
diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c
index c55806df2b8..e4aaf9dd74f 100644
--- a/dlls/ntdll/loadorder.c
+++ b/dlls/ntdll/loadorder.c
@@ -49,7 +49,7 @@ struct loadorder_list
module_loadorder_t *order;
};
-static const WCHAR separatorsW[] = {',',' ','\t',0};
+static const WCHAR separatorsW[] = L", \t";
static BOOL init_done;
static struct loadorder_list env_list;
@@ -89,10 +89,9 @@ static const WCHAR *get_basename( const WCHAR *name )
*/
static inline void remove_dll_ext( WCHAR *name )
{
- static const WCHAR dllW[] = {'.','d','l','l',0};
WCHAR *p = wcsrchr( name, '.' );
- if (p && !wcsicmp( p, dllW )) *p = 0;
+ if (p && !wcsicmp( p, L".dll" )) *p = 0;
}
@@ -224,7 +223,6 @@ static void add_load_order_set( WCHAR *entry )
*/
static void init_load_order(void)
{
- static const WCHAR winedlloverridesW[] = {'W','I','N','E','D','L','L','O','V','E','R','R','I','D','E','S',0};
WCHAR *entry, *next, *order;
SIZE_T len = 1024;
NTSTATUS status;
@@ -234,7 +232,7 @@ static void init_load_order(void)
for (;;)
{
order = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) );
- status = RtlQueryEnvironmentVariable( NULL, winedlloverridesW, wcslen(winedlloverridesW),
+ status = RtlQueryEnvironmentVariable( NULL, L"WINEDLLOVERRIDES", wcslen(L"WINEDLLOVERRIDES"),
order, len - 1, &len );
if (!status)
{
@@ -290,8 +288,6 @@ static inline enum loadorder get_env_load_order( const WCHAR *module )
*/
static HANDLE get_standard_key(void)
{
- static const WCHAR DllOverridesW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
- 'D','l','l','O','v','e','r','r','i','d','e','s',0};
static HANDLE std_key = (HANDLE)-1;
if (std_key == (HANDLE)-1)
@@ -307,7 +303,7 @@ static HANDLE get_standard_key(void)
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &nameW, DllOverridesW );
+ RtlInitUnicodeString( &nameW, L"Software\\Wine\\DllOverrides" );
/* @@ Wine registry key: HKCU\Software\Wine\DllOverrides */
if (NtOpenKey( &std_key, KEY_ALL_ACCESS, &attr )) std_key = 0;
@@ -328,20 +324,17 @@ static HANDLE get_app_key( const WCHAR *app_name )
UNICODE_STRING nameW;
HANDLE root;
WCHAR *str;
- static const WCHAR AppDefaultsW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
- 'A','p','p','D','e','f','a','u','l','t','s','\\',0};
- static const WCHAR DllOverridesW[] = {'\\','D','l','l','O','v','e','r','r','i','d','e','s',0};
static HANDLE app_key = (HANDLE)-1;
if (app_key != (HANDLE)-1) return app_key;
str = RtlAllocateHeap( GetProcessHeap(), 0,
- sizeof(AppDefaultsW) + sizeof(DllOverridesW) +
+ sizeof(L"Software\\Wine\\AppDefaults\\") + sizeof(L"\\DllOverrides") +
wcslen(app_name) * sizeof(WCHAR) );
if (!str) return 0;
- wcscpy( str, AppDefaultsW );
+ wcscpy( str, L"Software\\Wine\\AppDefaults\\" );
wcscat( str, app_name );
- wcscat( str, DllOverridesW );
+ wcscat( str, L"\\DllOverrides" );
RtlOpenCurrentUser( KEY_ALL_ACCESS, &root );
attr.Length = sizeof(attr);
@@ -425,7 +418,6 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, cons
*/
enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name )
{
- static const WCHAR nt_prefixW[] = {'\\','?','?','\\',0};
enum loadorder ret = LO_INVALID;
HANDLE std_key, app_key = 0;
const WCHAR *path = nt_name->Buffer;
@@ -435,7 +427,7 @@ enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_n
if (!init_done) init_load_order();
std_key = get_standard_key();
if (app_name) app_key = get_app_key( app_name );
- if (!wcsncmp( path, nt_prefixW, 4 )) path += 4;
+ if (!wcsncmp( path, L"\\??\\", 4 )) path += 4;
TRACE("looking for %s\n", debugstr_w(path));
diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
index e3cc0d183c4..3979f41089b 100644
--- a/dlls/ntdll/locale.c
+++ b/dlls/ntdll/locale.c
@@ -1269,8 +1269,6 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags
{
/* locale name format is: lang[-script][-country][_modifier] */
- static const WCHAR sepW[] = {'-','_',0};
-
const IMAGE_RESOURCE_DIRECTORY *resdir;
const IMAGE_RESOURCE_DIRECTORY_ENTRY *et;
LDR_RESOURCE_INFO info;
@@ -1291,16 +1289,16 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags
if (wcslen( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1;
wcscpy( lang, name );
- if ((p = wcspbrk( lang, sepW )) && *p == '-')
+ if ((p = wcspbrk( lang, L"-_" )) && *p == '-')
{
*p++ = 0;
country = p;
- if ((p = wcspbrk( p, sepW )) && *p == '-')
+ if ((p = wcspbrk( p, L"-_" )) && *p == '-')
{
*p++ = 0;
script = country;
country = p;
- p = wcspbrk( p, sepW );
+ p = wcspbrk( p, L"-_" );
}
if (p) *p = 0; /* FIXME: modifier is ignored */
/* second value can be script or country, check length to resolve the ambiguity */
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 53470b4f357..86760f178e1 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -31,10 +31,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(file);
-static const WCHAR DeviceRootW[] = {'\\','\\','.','\\',0};
-static const WCHAR NTDosPrefixW[] = {'\\','?','?','\\',0};
-static const WCHAR UncPfxW[] = {'U','N','C','\\',0};
-
#define IS_SEPARATOR(ch) ((ch) == '\\' || (ch) == '/')
/***********************************************************************
@@ -69,7 +65,6 @@ DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U( PCWSTR path )
*/
ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
{
- static const WCHAR consoleW[] = {'\\','\\','.','\\','C','O','N',0};
static const WCHAR auxW[] = {'A','U','X'};
static const WCHAR comW[] = {'C','O','M'};
static const WCHAR conW[] = {'C','O','N'};
@@ -87,7 +82,7 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
case UNC_PATH:
return 0;
case DEVICE_PATH:
- if (!wcsicmp( dos_name, consoleW ))
+ if (!wcsicmp( dos_name, L"\\\\.\\CON" ))
return MAKELONG( sizeof(conW), 4 * sizeof(WCHAR) ); /* 4 is length of \\.\ prefix */
return 0;
case ABSOLUTE_DRIVE_PATH:
@@ -207,12 +202,12 @@ NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(const WCHAR *dos_path, U
return STATUS_NO_MEMORY;
}
- wcscpy(ntpath->Buffer, NTDosPrefixW);
+ wcscpy(ntpath->Buffer, L"\\??\\");
switch (RtlDetermineDosPathNameType_U(ptr))
{
case UNC_PATH: /* \\foo */
offset = 2;
- wcscat(ntpath->Buffer, UncPfxW);
+ wcscat(ntpath->Buffer, L"UNC\\");
break;
case DEVICE_PATH: /* \\.\foo */
offset = 4;
@@ -661,7 +656,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
DWORD sz = LOWORD(dosdev); /* in bytes */
if (8 + sz + 2 > size) return sz + 10;
- wcscpy(buffer, DeviceRootW);
+ wcscpy(buffer, L"\\\\.\\");
memmove(buffer + 4, name + offset, sz);
buffer[4 + sz / sizeof(WCHAR)] = '\0';
/* file_part isn't set in this case */
@@ -874,7 +869,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
if (size && ptr[size - 1] != '\\') ptr[size++] = '\\';
/* convert \??\UNC\ path to \\ prefix */
- if (size >= 4 && !wcsnicmp(ptr, UncPfxW, 4))
+ if (size >= 4 && !wcsnicmp(ptr, L"UNC\\", 4))
{
ptr += 2;
size -= 2;
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 5a54d7fee26..54f01049abf 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -402,49 +402,30 @@ static NTSTATUS RTL_KeyHandleCreateObject(ULONG RelativeTo, PCWSTR Path, POBJECT
PCWSTR base;
INT len;
- static const WCHAR empty[] = {0};
- static const WCHAR control[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e',
- '\\','S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',0};
-
- static const WCHAR devicemap[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',
- 'H','a','r','d','w','a','r','e','\\','D','e','v','i','c','e','M','a','p','\\',0};
-
- static const WCHAR services[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'S','e','r','v','i','c','e','s','\\',0};
-
- static const WCHAR user[] = {'\\','R','e','g','i','s','t','r','y','\\','U','s','e','r','\\',
- 'C','u','r','r','e','n','t','U','s','e','r','\\',0};
-
- static const WCHAR windows_nt[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',
- 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',0};
-
switch (RelativeTo & 0xff)
{
case RTL_REGISTRY_ABSOLUTE:
- base = empty;
+ base = L"";
break;
case RTL_REGISTRY_CONTROL:
- base = control;
+ base = L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\";
break;
case RTL_REGISTRY_DEVICEMAP:
- base = devicemap;
+ base = L"\\Registry\\Machine\\Hardware\\DeviceMap\\";
break;
case RTL_REGISTRY_SERVICES:
- base = services;
+ base = L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\";
break;
case RTL_REGISTRY_USER:
- base = user;
+ base = L"\\Registry\\User\\CurrentUser\\";
break;
case RTL_REGISTRY_WINDOWS_NT:
- base = windows_nt;
+ base = L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\";
break;
default:
diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
index e1596312491..ee7d9951c59 100644
--- a/dlls/ntdll/relay.c
+++ b/dlls/ntdll/relay.c
@@ -167,17 +167,6 @@ static DWORD WINAPI init_debug_lists( RTL_RUN_ONCE *once, void *param, void **co
OBJECT_ATTRIBUTES attr;
UNICODE_STRING name;
HANDLE root, hkey;
- static const WCHAR configW[] = {'S','o','f','t','w','a','r','e','\\',
- 'W','i','n','e','\\',
- 'D','e','b','u','g',0};
- static const WCHAR RelayIncludeW[] = {'R','e','l','a','y','I','n','c','l','u','d','e',0};
- static const WCHAR RelayExcludeW[] = {'R','e','l','a','y','E','x','c','l','u','d','e',0};
- static const WCHAR SnoopIncludeW[] = {'S','n','o','o','p','I','n','c','l','u','d','e',0};
- static const WCHAR SnoopExcludeW[] = {'S','n','o','o','p','E','x','c','l','u','d','e',0};
- static const WCHAR RelayFromIncludeW[] = {'R','e','l','a','y','F','r','o','m','I','n','c','l','u','d','e',0};
- static const WCHAR RelayFromExcludeW[] = {'R','e','l','a','y','F','r','o','m','E','x','c','l','u','d','e',0};
- static const WCHAR SnoopFromIncludeW[] = {'S','n','o','o','p','F','r','o','m','I','n','c','l','u','d','e',0};
- static const WCHAR SnoopFromExcludeW[] = {'S','n','o','o','p','F','r','o','m','E','x','c','l','u','d','e',0};
RtlOpenCurrentUser( KEY_ALL_ACCESS, &root );
attr.Length = sizeof(attr);
@@ -186,21 +175,21 @@ static DWORD WINAPI init_debug_lists( RTL_RUN_ONCE *once, void *param, void **co
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &name, configW );
+ RtlInitUnicodeString( &name, L"Software\\Wine\\Debug" );
/* @@ Wine registry key: HKCU\Software\Wine\Debug */
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) hkey = 0;
NtClose( root );
if (!hkey) return TRUE;
- debug_relay_includelist = load_list( hkey, RelayIncludeW );
- debug_relay_excludelist = load_list( hkey, RelayExcludeW );
- debug_snoop_includelist = load_list( hkey, SnoopIncludeW );
- debug_snoop_excludelist = load_list( hkey, SnoopExcludeW );
- debug_from_relay_includelist = load_list( hkey, RelayFromIncludeW );
- debug_from_relay_excludelist = load_list( hkey, RelayFromExcludeW );
- debug_from_snoop_includelist = load_list( hkey, SnoopFromIncludeW );
- debug_from_snoop_excludelist = load_list( hkey, SnoopFromExcludeW );
+ debug_relay_includelist = load_list( hkey, L"RelayInclude" );
+ debug_relay_excludelist = load_list( hkey, L"RelayExclude" );
+ debug_snoop_includelist = load_list( hkey, L"SnoopInclude" );
+ debug_snoop_excludelist = load_list( hkey, L"SnoopExclude" );
+ debug_from_relay_includelist = load_list( hkey, L"RelayFromInclude" );
+ debug_from_relay_excludelist = load_list( hkey, L"RelayFromExclude" );
+ debug_from_snoop_includelist = load_list( hkey, L"SnoopFromInclude" );
+ debug_from_snoop_excludelist = load_list( hkey, L"SnoopFromExclude" );
NtClose( hkey );
return TRUE;
@@ -259,7 +248,6 @@ static BOOL check_relay_include( const WCHAR *module, int ordinal, const char *f
*/
static BOOL check_from_module( const WCHAR **includelist, const WCHAR **excludelist, const WCHAR *module )
{
- static const WCHAR dllW[] = {'.','d','l','l',0 };
const WCHAR **listitem;
BOOL show;
@@ -281,7 +269,7 @@ static BOOL check_from_module( const WCHAR **includelist, const WCHAR **excludel
if (!wcsicmp( *listitem, module )) return !show;
len = wcslen( *listitem );
- if (!wcsnicmp( *listitem, module, len ) && !wcsicmp( module + len, dllW ))
+ if (!wcsnicmp( *listitem, module, len ) && !wcsicmp( module + len, L".dll" ))
return !show;
}
return show;
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
index 11dbc63a3b3..cf21c980a45 100644
--- a/dlls/ntdll/rtl.c
+++ b/dlls/ntdll/rtl.c
@@ -1314,8 +1314,6 @@ NTSTATUS WINAPI RtlIpv6StringToAddressA(const char *str, const char **terminator
NTSTATUS WINAPI RtlIpv4AddressToStringExW(const IN_ADDR *pin, USHORT port, LPWSTR buffer, PULONG psize)
{
WCHAR tmp_ip[32];
- static const WCHAR fmt_ip[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
- static const WCHAR fmt_port[] = {':','%','u',0};
ULONG needed;
if (!pin || !buffer || !psize)
@@ -1323,11 +1321,11 @@ NTSTATUS WINAPI RtlIpv4AddressToStringExW(const IN_ADDR *pin, USHORT port, LPWST
TRACE("(%p:0x%x, %d, %p, %p:%d)\n", pin, pin->S_un.S_addr, port, buffer, psize, *psize);
- needed = swprintf(tmp_ip, ARRAY_SIZE(tmp_ip), fmt_ip,
+ needed = swprintf(tmp_ip, ARRAY_SIZE(tmp_ip), L"%u.%u.%u.%u",
pin->S_un.S_un_b.s_b1, pin->S_un.S_un_b.s_b2,
pin->S_un.S_un_b.s_b3, pin->S_un.S_un_b.s_b4);
- if (port) needed += swprintf(tmp_ip + needed, ARRAY_SIZE(tmp_ip) - needed, fmt_port, ntohs(port));
+ if (port) needed += swprintf(tmp_ip + needed, ARRAY_SIZE(tmp_ip) - needed, L":%u", ntohs(port));
if (*psize > needed) {
*psize = needed + 1;
diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c
index d8ff81b8050..90f32ceecf0 100644
--- a/dlls/ntdll/rtlstr.c
+++ b/dlls/ntdll/rtlstr.c
@@ -1160,8 +1160,6 @@ NTSTATUS WINAPI RtlFindCharInUnicodeString(
*/
BOOLEAN WINAPI RtlIsTextUnicode( LPCVOID buf, INT len, INT *pf )
{
- static const WCHAR std_control_chars[] = {'\r','\n','\t',' ',0x3000,0};
- static const WCHAR byterev_control_chars[] = {0x0d00,0x0a00,0x0900,0x2000,0};
const WCHAR *s = buf;
int i;
unsigned int flags = ~0U, out_flags = 0;
@@ -1225,7 +1223,7 @@ BOOLEAN WINAPI RtlIsTextUnicode( LPCVOID buf, INT len, INT *pf )
{
for (i = 0; i < len; i++)
{
- if (wcschr(std_control_chars, s[i]))
+ if (wcschr(L"\r\n\t \x3000", s[i]))
{
out_flags |= IS_TEXT_UNICODE_CONTROLS;
break;
@@ -1237,7 +1235,7 @@ BOOLEAN WINAPI RtlIsTextUnicode( LPCVOID buf, INT len, INT *pf )
{
for (i = 0; i < len; i++)
{
- if (wcschr(byterev_control_chars, s[i]))
+ if (wcschr(L"\x0d00\x0a00\x0900\x2000", s[i]))
{
out_flags |= IS_TEXT_UNICODE_REVERSE_CONTROLS;
break;
@@ -1684,11 +1682,6 @@ NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING str, GUID* guid)
*/
NTSTATUS WINAPI RtlStringFromGUID(const GUID* guid, UNICODE_STRING *str)
{
- static const WCHAR szFormat[] = { '{','%','0','8','l','X','-',
- '%','0','4','X','-', '%','0','4','X','-','%','0','2','X','%','0','2','X',
- '-', '%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',
- '%','0','2','X','%','0','2','X','}','\0' };
-
TRACE("(%p,%p)\n", guid, str);
str->Length = GUID_STRING_LENGTH * sizeof(WCHAR);
@@ -1699,7 +1692,8 @@ NTSTATUS WINAPI RtlStringFromGUID(const GUID* guid, UNICODE_STRING *str)
str->Length = str->MaximumLength = 0;
return STATUS_NO_MEMORY;
}
- swprintf(str->Buffer, str->MaximumLength/sizeof(WCHAR), szFormat, guid->Data1, guid->Data2, guid->Data3,
+ swprintf(str->Buffer, str->MaximumLength/sizeof(WCHAR),
+ L"{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid->Data1, guid->Data2, guid->Data3,
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
@@ -1739,7 +1733,6 @@ static UINT64 get_arg( int nr, struct format_message_args *args_data, BOOL is64
static NTSTATUS add_format( WCHAR **buffer, WCHAR *end, const WCHAR **src, int insert, BOOLEAN ansi,
struct format_message_args *args_data )
{
- static const WCHAR modifiers[] = {'0','1','2','3','4','5','6','7','8','9',' ','+','-','*','#','.',0};
const WCHAR *format = *src;
WCHAR *p, fmt[32];
ULONG_PTR args[5] = { 0 };
@@ -1757,7 +1750,7 @@ static NTSTATUS add_format( WCHAR **buffer, WCHAR *end, const WCHAR **src, int i
if (!end || end - format > ARRAY_SIZE(fmt) - 2) return STATUS_INVALID_PARAMETER;
*src = end + 1;
- while (wcschr( modifiers, *format ))
+ while (wcschr( L"0123456789 +-*#.", *format ))
{
if (*format == '*') stars++;
*p++ = *format++;
@@ -1829,7 +1822,6 @@ NTSTATUS WINAPI RtlFormatMessageEx( const WCHAR *src, ULONG width, BOOLEAN ignor
BOOLEAN ansi, BOOLEAN is_array, __ms_va_list *args,
WCHAR *buffer, ULONG size, ULONG *retsize, ULONG flags )
{
- static const WCHAR emptyW = 0;
static const WCHAR spaceW = ' ';
static const WCHAR crW = '\r';
static const WCHAR tabW = '\t';
@@ -1945,7 +1937,7 @@ NTSTATUS WINAPI RtlFormatMessageEx( const WCHAR *src, ULONG width, BOOLEAN ignor
}
}
- if ((status = add_chars( &buffer, end, &emptyW, 1 ))) return status;
+ if ((status = add_chars( &buffer, end, L"", 1 ))) return status;
*retsize = (buffer - start) * sizeof(WCHAR);
return STATUS_SUCCESS;
diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c
index c0f962f0562..0d45bbf02aa 100644
--- a/dlls/ntdll/sec.c
+++ b/dlls/ntdll/sec.c
@@ -1617,21 +1617,20 @@ NTSTATUS WINAPI RtlConvertSidToUnicodeString(
PSID pSid,
BOOLEAN AllocateString)
{
- static const WCHAR formatW[] = {'-','%','u',0};
WCHAR buffer[2 + 10 + 10 + 10 * SID_MAX_SUB_AUTHORITIES];
WCHAR *p = buffer;
const SID *sid = pSid;
DWORD i, len;
*p++ = 'S';
- p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), formatW, sid->Revision );
- p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), formatW,
+ p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), L"-%u", sid->Revision );
+ p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), L"-%u",
MAKELONG( MAKEWORD( sid->IdentifierAuthority.Value[5],
sid->IdentifierAuthority.Value[4] ),
MAKEWORD( sid->IdentifierAuthority.Value[3],
sid->IdentifierAuthority.Value[2] )));
for (i = 0; i < sid->SubAuthorityCount; i++)
- p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), formatW, sid->SubAuthority[i] );
+ p += swprintf( p, ARRAY_SIZE(buffer) - (p - buffer), L"-%u", sid->SubAuthority[i] );
len = (p + 1 - buffer) * sizeof(WCHAR);
--
2.26.2
Dec. 3, 2020
[PATCH] ntdll: Use wide-char string literals in version.c.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/ntdll/version.c | 177 ++++++++++++++++---------------------------
1 file changed, 64 insertions(+), 113 deletions(-)
diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c
index 46715575225..740d8403f5e 100644
--- a/dlls/ntdll/version.c
+++ b/dlls/ntdll/version.c
@@ -66,20 +66,17 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
/* WIN20 FIXME: verify values */
{
sizeof(RTL_OSVERSIONINFOEXW), 2, 0, 0, VER_PLATFORM_WIN32s,
- {'W','i','n','3','2','s',' ','1','.','3',0},
- 0, 0, 0, 0, 0
+ L"Win32s 1.3", 0, 0, 0, 0, 0
},
/* WIN30 FIXME: verify values */
{
sizeof(RTL_OSVERSIONINFOEXW), 3, 0, 0, VER_PLATFORM_WIN32s,
- {'W','i','n','3','2','s',' ','1','.','3',0},
- 0, 0, 0, 0, 0
+ L"Win32s 1.3", 0, 0, 0, 0, 0
},
/* WIN31 */
{
sizeof(RTL_OSVERSIONINFOEXW), 3, 10, 0, VER_PLATFORM_WIN32s,
- {'W','i','n','3','2','s',' ','1','.','3',0},
- 0, 0, 0, 0, 0
+ L"Win32s 1.3", 0, 0, 0, 0, 0
},
/* WIN95 */
{
@@ -91,8 +88,7 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
* Win95a/b can be discerned via regkey SubVersionNumber
*/
sizeof(RTL_OSVERSIONINFOEXW), 4, 0, 0x40003B6, VER_PLATFORM_WIN32_WINDOWS,
- {0},
- 0, 0, 0, 0, 0
+ L"", 0, 0, 0, 0, 0
},
/* WIN98 (second edition) */
{
@@ -100,121 +96,111 @@ static const RTL_OSVERSIONINFOEXW VersionData[NB_WINDOWS_VERSIONS] =
* Win98SE: 4, 10, 0x40A08AE, " A " 4.10.2222
*/
sizeof(RTL_OSVERSIONINFOEXW), 4, 10, 0x40A08AE, VER_PLATFORM_WIN32_WINDOWS,
- {' ','A',' ',0},
- 0, 0, 0, 0, 0
+ L" A ", 0, 0, 0, 0, 0
},
/* WINME */
{
sizeof(RTL_OSVERSIONINFOEXW), 4, 90, 0x45A0BB8, VER_PLATFORM_WIN32_WINDOWS,
- {' ',0},
- 0, 0, 0, 0, 0
+ L" ", 0, 0, 0, 0, 0
},
/* NT351 */
{
sizeof(RTL_OSVERSIONINFOEXW), 3, 51, 0x421, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','5',0},
- 5, 0, 0, VER_NT_WORKSTATION, 0
+ L"Service Pack 5", 5, 0, 0, VER_NT_WORKSTATION, 0
},
/* NT40 */
{
sizeof(RTL_OSVERSIONINFOEXW), 4, 0, 0x565, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','6','a',0},
- 6, 0, 0, VER_NT_WORKSTATION, 0
+ L"Service Pack 6a", 6, 0, 0, VER_NT_WORKSTATION, 0
},
/* NT2K */
{
sizeof(RTL_OSVERSIONINFOEXW), 5, 0, 0x893, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','4',0},
- 4, 0, 0, VER_NT_WORKSTATION, 30 /* FIXME: Great, a reserved field with a value! */
+ L"Service Pack 4", 4, 0, 0, VER_NT_WORKSTATION,
+ 30 /* FIXME: Great, a reserved field with a value! */
},
/* WINXP */
{
sizeof(RTL_OSVERSIONINFOEXW), 5, 1, 0xA28, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0},
- 3, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 30 /* FIXME: Great, a reserved field with a value! */
+ L"Service Pack 3", 3, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION,
+ 30 /* FIXME: Great, a reserved field with a value! */
},
/* WINXP64 */
{
sizeof(RTL_OSVERSIONINFOEXW), 5, 2, 0xECE, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','2',0},
- 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"Service Pack 2", 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
/* WIN2K3 */
{
sizeof(RTL_OSVERSIONINFOEXW), 5, 2, 0xECE, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','2',0},
- 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
+ L"Service Pack 2", 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
},
/* WINVISTA */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 0, 0x1772, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','2',0},
- 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"Service Pack 2", 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
/* WIN2K8 */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 0, 0x1772, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','2',0},
- 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
+ L"Service Pack 2", 2, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
},
/* WIN7 */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 1, 0x1DB1, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','1',0},
- 1, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"Service Pack 1", 1, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
/* WIN2K8R2 */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 1, 0x1DB1, VER_PLATFORM_WIN32_NT,
- {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','1',0},
- 1, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
+ L"Service Pack 1", 1, 0, VER_SUITE_SINGLEUSERTS, VER_NT_SERVER, 0
},
/* WIN8 */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 2, 0x23F0, VER_PLATFORM_WIN32_NT,
- {0}, 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
/* WIN81 */
{
sizeof(RTL_OSVERSIONINFOEXW), 6, 3, 0x2580, VER_PLATFORM_WIN32_NT,
- {0}, 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
/* WIN10 */
{
sizeof(RTL_OSVERSIONINFOEXW), 10, 0, 0x4563, VER_PLATFORM_WIN32_NT,
- {0}, 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
+ L"", 0, 0, VER_SUITE_SINGLEUSERTS, VER_NT_WORKSTATION, 0
},
};
static const struct { WCHAR name[12]; WINDOWS_VERSION ver; } version_names[] =
{
- { {'w','i','n','2','0',0}, WIN20 },
- { {'w','i','n','3','0',0}, WIN30 },
- { {'w','i','n','3','1',0}, WIN31 },
- { {'w','i','n','9','5',0}, WIN95 },
- { {'w','i','n','9','8',0}, WIN98 },
- { {'w','i','n','m','e',0}, WINME },
- { {'n','t','3','5','1',0}, NT351 },
- { {'n','t','4','0',0}, NT40 },
- { {'w','i','n','2','0','0','0',0}, NT2K },
- { {'w','i','n','2','k',0}, NT2K },
- { {'n','t','2','k',0}, NT2K },
- { {'n','t','2','0','0','0',0}, NT2K },
- { {'w','i','n','x','p',0}, WINXP },
- { {'w','i','n','x','p','6','4',0}, WINXP64 },
- { {'w','i','n','2','0','0','3',0}, WIN2K3 },
- { {'w','i','n','2','k','3',0}, WIN2K3 },
- { {'v','i','s','t','a',0}, WINVISTA },
- { {'w','i','n','v','i','s','t','a',0}, WINVISTA },
- { {'w','i','n','2','0','0','8',0}, WIN2K8 },
- { {'w','i','n','2','k','8',0}, WIN2K8 },
- { {'w','i','n','2','0','0','8','r','2',0}, WIN2K8R2 },
- { {'w','i','n','2','k','8','r','2',0}, WIN2K8R2 },
- { {'w','i','n','7',0}, WIN7 },
- { {'w','i','n','8',0}, WIN8 },
- { {'w','i','n','8','1',0}, WIN81 },
- { {'w','i','n','1','0',0}, WIN10 },
+ { L"win20", WIN20 },
+ { L"win30", WIN30 },
+ { L"win31", WIN31 },
+ { L"win95", WIN95 },
+ { L"win98", WIN98 },
+ { L"winme", WINME },
+ { L"nt351", NT351 },
+ { L"nt40", NT40 },
+ { L"win2000", NT2K },
+ { L"win2k", NT2K },
+ { L"nt2k", NT2K },
+ { L"nt2000", NT2K },
+ { L"winxp", WINXP },
+ { L"winxp64", WINXP64 },
+ { L"win2003", WIN2K3 },
+ { L"win2k3", WIN2K3 },
+ { L"vista", WINVISTA },
+ { L"winvista", WINVISTA },
+ { L"win2008", WIN2K8 },
+ { L"win2k8", WIN2K8 },
+ { L"win2008r2", WIN2K8R2 },
+ { L"win2k8r2", WIN2K8R2 },
+ { L"win7", WIN7 },
+ { L"win8", WIN8 },
+ { L"win81", WIN81 },
+ { L"win10", WIN10 },
};
@@ -229,29 +215,6 @@ static const RTL_OSVERSIONINFOEXW *current_version;
*/
static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
{
- static const WCHAR version_keyW[] = {'M','a','c','h','i','n','e','\\',
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
- static const WCHAR service_pack_keyW[] = {'M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\',
- 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',
- 'W','i','n','d','o','w','s',0};
- static const WCHAR product_keyW[] = {'M','a','c','h','i','n','e','\\',
- 'S','y','s','t','e','m','\\',
- 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
- 'C','o','n','t','r','o','l','\\',
- 'P','r','o','d','u','c','t','O','p','t','i','o','n','s',0};
- static const WCHAR CurrentBuildNumberW[] = {'C','u','r','r','e','n','t','B','u','i','l','d','N','u','m','b','e','r',0};
- static const WCHAR CSDVersionW[] = {'C','S','D','V','e','r','s','i','o','n',0};
- static const WCHAR CurrentVersionW[] = {'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
- static const WCHAR ProductTypeW[] = {'P','r','o','d','u','c','t','T','y','p','e',0};
- static const WCHAR WinNTW[] = {'W','i','n','N','T',0};
- static const WCHAR ServerNTW[] = {'S','e','r','v','e','r','N','T',0};
- static const WCHAR LanmanNTW[] = {'L','a','n','m','a','n','N','T',0};
-
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW, valueW;
HANDLE hkey, hkey2;
@@ -266,13 +229,13 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &nameW, version_keyW );
+ RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion" );
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
memset( version, 0, sizeof(*version) );
- RtlInitUnicodeString( &valueW, CurrentVersionW );
+ RtlInitUnicodeString( &valueW, L"CurrentVersion" );
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
WCHAR *p, *str = (WCHAR *)info->Data;
@@ -293,7 +256,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get build number */
- RtlInitUnicodeString( &valueW, CurrentBuildNumberW );
+ RtlInitUnicodeString( &valueW, L"CurrentBuildNumber" );
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
WCHAR *str = (WCHAR *)info->Data;
@@ -303,7 +266,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get version description */
- RtlInitUnicodeString( &valueW, CSDVersionW );
+ RtlInitUnicodeString( &valueW, L"CSDVersion" );
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
DWORD len = min( info->DataLength, sizeof(version->szCSDVersion) - sizeof(WCHAR) );
@@ -313,10 +276,10 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get service pack version */
- RtlInitUnicodeString( &nameW, service_pack_keyW );
+ RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\Windows" );
if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
{
- RtlInitUnicodeString( &valueW, CSDVersionW );
+ RtlInitUnicodeString( &valueW, L"CSDVersion" );
if (!NtQueryValueKey( hkey2, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp), &count ))
{
if (info->DataLength >= sizeof(DWORD))
@@ -331,17 +294,17 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
/* get product type */
- RtlInitUnicodeString( &nameW, product_keyW );
+ RtlInitUnicodeString( &nameW, L"Machine\\System\\CurrentControlSet\\Control\\ProductOptions" );
if (!NtOpenKey( &hkey2, KEY_ALL_ACCESS, &attr ))
{
- RtlInitUnicodeString( &valueW, ProductTypeW );
+ RtlInitUnicodeString( &valueW, L"ProductType" );
if (!NtQueryValueKey( hkey2, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
WCHAR *str = (WCHAR *)info->Data;
str[info->DataLength / sizeof(WCHAR)] = 0;
- if (!wcsicmp( str, WinNTW )) version->wProductType = VER_NT_WORKSTATION;
- else if (!wcsicmp( str, LanmanNTW )) version->wProductType = VER_NT_DOMAIN_CONTROLLER;
- else if (!wcsicmp( str, ServerNTW )) version->wProductType = VER_NT_SERVER;
+ if (!wcsicmp( str, L"WinNT" )) version->wProductType = VER_NT_WORKSTATION;
+ else if (!wcsicmp( str, L"LanmanNT" )) version->wProductType = VER_NT_DOMAIN_CONTROLLER;
+ else if (!wcsicmp( str, L"ServerNT" )) version->wProductType = VER_NT_SERVER;
}
NtClose( hkey2 );
}
@@ -361,14 +324,6 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
*/
static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
{
- static const WCHAR version_keyW[] = {'M','a','c','h','i','n','e','\\',
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n',0};
- static const WCHAR VersionNumberW[] = {'V','e','r','s','i','o','n','N','u','m','b','e','r',0};
- static const WCHAR SubVersionNumberW[] = {'S','u','b','V','e','r','s','i','o','n','N','u','m','b','e','r',0};
-
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW, valueW;
HANDLE hkey;
@@ -383,13 +338,13 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &nameW, version_keyW );
+ RtlInitUnicodeString( &nameW, L"Machine\\Software\\Microsoft\\Windows\\CurrentVersion" );
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) return FALSE;
memset( version, 0, sizeof(*version) );
- RtlInitUnicodeString( &valueW, VersionNumberW );
+ RtlInitUnicodeString( &valueW, L"VersionNumber" );
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
WCHAR *p, *str = (WCHAR *)info->Data;
@@ -417,7 +372,7 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
ret = TRUE;
version->dwPlatformId = VER_PLATFORM_WIN32_WINDOWS;
- RtlInitUnicodeString( &valueW, SubVersionNumberW );
+ RtlInitUnicodeString( &valueW, L"SubVersionNumber" );
if (!NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp)-1, &count ))
{
DWORD len = min( info->DataLength, sizeof(version->szCSDVersion) - sizeof(WCHAR) );
@@ -438,14 +393,12 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
*/
static BOOL parse_win_version( HANDLE hkey )
{
- static const WCHAR VersionW[] = {'V','e','r','s','i','o','n',0};
-
UNICODE_STRING valueW;
WCHAR *name, tmp[64];
KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)tmp;
DWORD i, count;
- RtlInitUnicodeString( &valueW, VersionW );
+ RtlInitUnicodeString( &valueW, L"Version" );
if (NtQueryValueKey( hkey, &valueW, KeyValuePartialInformation, tmp, sizeof(tmp) - sizeof(WCHAR), &count ))
return FALSE;
@@ -470,8 +423,6 @@ static BOOL parse_win_version( HANDLE hkey )
*/
void version_init(void)
{
- static const WCHAR configW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0};
- static const WCHAR appdefaultsW[] = {'A','p','p','D','e','f','a','u','l','t','s','\\',0};
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
HANDLE root, hkey, config_key;
@@ -488,7 +439,7 @@ void version_init(void)
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
- RtlInitUnicodeString( &nameW, configW );
+ RtlInitUnicodeString( &nameW, L"Software\\Wine" );
/* @@ Wine registry key: HKCU\Software\Wine */
if (NtOpenKey( &config_key, KEY_ALL_ACCESS, &attr )) config_key = 0;
@@ -500,7 +451,7 @@ void version_init(void)
if ((p = wcsrchr( appname, '/' ))) appname = p + 1;
if ((p = wcsrchr( appname, '\\' ))) appname = p + 1;
- wcscpy( appversion, appdefaultsW );
+ wcscpy( appversion, L"AppDefaults\\" );
wcscat( appversion, appname );
RtlInitUnicodeString( &nameW, appversion );
attr.RootDirectory = config_key;
--
2.26.2
Dec. 3, 2020
[PATCH 2/2] ntdll: Use wide-char string literals in actctx.c.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/ntdll/actctx.c | 532 ++++++++++++++++----------------------------
1 file changed, 194 insertions(+), 338 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index faccd21d4b1..5db464a383e 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -565,125 +565,25 @@ struct actctx_loader
static const xmlstr_t empty_xmlstr;
#ifdef __i386__
-static const WCHAR current_archW[] = {'x','8','6',0};
+static const WCHAR current_archW[] = L"x86";
#elif defined __x86_64__
-static const WCHAR current_archW[] = {'a','m','d','6','4',0};
+static const WCHAR current_archW[] = L"amd64";
#elif defined __arm__
-static const WCHAR current_archW[] = {'a','r','m',0};
+static const WCHAR current_archW[] = L"arm";
#elif defined __aarch64__
-static const WCHAR current_archW[] = {'a','r','m','6','4',0};
+static const WCHAR current_archW[] = L"arm64";
#else
-static const WCHAR current_archW[] = {'n','o','n','e',0};
+static const WCHAR current_archW[] = L"none";
#endif
-static const WCHAR asmv1W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0};
-static const WCHAR asmv2W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0};
-static const WCHAR asmv3W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0};
-static const WCHAR assemblyW[] = {'a','s','s','e','m','b','l','y',0};
-static const WCHAR assemblyIdentityW[] = {'a','s','s','e','m','b','l','y','I','d','e','n','t','i','t','y',0};
-static const WCHAR bindingRedirectW[] = {'b','i','n','d','i','n','g','R','e','d','i','r','e','c','t',0};
-static const WCHAR clrClassW[] = {'c','l','r','C','l','a','s','s',0};
-static const WCHAR clrSurrogateW[] = {'c','l','r','S','u','r','r','o','g','a','t','e',0};
-static const WCHAR comClassW[] = {'c','o','m','C','l','a','s','s',0};
-static const WCHAR comInterfaceExternalProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','E','x','t','e','r','n','a','l','P','r','o','x','y','S','t','u','b',0};
-static const WCHAR comInterfaceProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','P','r','o','x','y','S','t','u','b',0};
-static const WCHAR dependencyW[] = {'d','e','p','e','n','d','e','n','c','y',0};
-static const WCHAR dependentAssemblyW[] = {'d','e','p','e','n','d','e','n','t','A','s','s','e','m','b','l','y',0};
-static const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n',0};
-static const WCHAR fileW[] = {'f','i','l','e',0};
-static const WCHAR hashW[] = {'h','a','s','h',0};
-static const WCHAR noInheritW[] = {'n','o','I','n','h','e','r','i','t',0};
-static const WCHAR noInheritableW[] = {'n','o','I','n','h','e','r','i','t','a','b','l','e',0};
-static const WCHAR typelibW[] = {'t','y','p','e','l','i','b',0};
-static const WCHAR windowClassW[] = {'w','i','n','d','o','w','C','l','a','s','s',0};
-
-static const WCHAR clsidW[] = {'c','l','s','i','d',0};
-static const WCHAR hashalgW[] = {'h','a','s','h','a','l','g',0};
-static const WCHAR helpdirW[] = {'h','e','l','p','d','i','r',0};
-static const WCHAR iidW[] = {'i','i','d',0};
-static const WCHAR languageW[] = {'l','a','n','g','u','a','g','e',0};
-static const WCHAR manifestVersionW[] = {'m','a','n','i','f','e','s','t','V','e','r','s','i','o','n',0};
-static const WCHAR nameW[] = {'n','a','m','e',0};
-static const WCHAR neutralW[] = {'n','e','u','t','r','a','l',0};
-static const WCHAR newVersionW[] = {'n','e','w','V','e','r','s','i','o','n',0};
-static const WCHAR oldVersionW[] = {'o','l','d','V','e','r','s','i','o','n',0};
-static const WCHAR optionalW[] = {'o','p','t','i','o','n','a','l',0};
-static const WCHAR processorArchitectureW[] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0};
-static const WCHAR progidW[] = {'p','r','o','g','i','d',0};
-static const WCHAR publicKeyTokenW[] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0};
-static const WCHAR threadingmodelW[] = {'t','h','r','e','a','d','i','n','g','M','o','d','e','l',0};
-static const WCHAR tlbidW[] = {'t','l','b','i','d',0};
-static const WCHAR typeW[] = {'t','y','p','e',0};
-static const WCHAR versionW[] = {'v','e','r','s','i','o','n',0};
-static const WCHAR xmlnsW[] = {'x','m','l','n','s',0};
-static const WCHAR versionedW[] = {'v','e','r','s','i','o','n','e','d',0};
-static const WCHAR yesW[] = {'y','e','s',0};
-static const WCHAR noW[] = {'n','o',0};
-static const WCHAR restrictedW[] = {'R','E','S','T','R','I','C','T','E','D',0};
-static const WCHAR controlW[] = {'C','O','N','T','R','O','L',0};
-static const WCHAR hiddenW[] = {'H','I','D','D','E','N',0};
-static const WCHAR hasdiskimageW[] = {'H','A','S','D','I','S','K','I','M','A','G','E',0};
-static const WCHAR flagsW[] = {'f','l','a','g','s',0};
-static const WCHAR miscstatusW[] = {'m','i','s','c','S','t','a','t','u','s',0};
-static const WCHAR miscstatusiconW[] = {'m','i','s','c','S','t','a','t','u','s','I','c','o','n',0};
-static const WCHAR miscstatuscontentW[] = {'m','i','s','c','S','t','a','t','u','s','C','o','n','t','e','n','t',0};
-static const WCHAR miscstatusthumbnailW[] = {'m','i','s','c','S','t','a','t','u','s','T','h','u','m','b','n','a','i','l',0};
-static const WCHAR miscstatusdocprintW[] = {'m','i','s','c','S','t','a','t','u','s','D','o','c','P','r','i','n','t',0};
-static const WCHAR baseInterfaceW[] = {'b','a','s','e','I','n','t','e','r','f','a','c','e',0};
-static const WCHAR nummethodsW[] = {'n','u','m','M','e','t','h','o','d','s',0};
-static const WCHAR proxyStubClsid32W[] = {'p','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0};
-static const WCHAR runtimeVersionW[] = {'r','u','n','t','i','m','e','V','e','r','s','i','o','n',0};
-static const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0};
-static const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0};
-
-static const WCHAR activatewhenvisibleW[] = {'a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0};
-static const WCHAR actslikebuttonW[] = {'a','c','t','s','l','i','k','e','b','u','t','t','o','n',0};
-static const WCHAR actslikelabelW[] = {'a','c','t','s','l','i','k','e','l','a','b','e','l',0};
-static const WCHAR alignableW[] = {'a','l','i','g','n','a','b','l','e',0};
-static const WCHAR alwaysrunW[] = {'a','l','w','a','y','s','r','u','n',0};
-static const WCHAR canlinkbyole1W[] = {'c','a','n','l','i','n','k','b','y','o','l','e','1',0};
-static const WCHAR cantlinkinsideW[] = {'c','a','n','t','l','i','n','k','i','n','s','i','d','e',0};
-static const WCHAR ignoreactivatewhenvisibleW[] = {'i','g','n','o','r','e','a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0};
-static const WCHAR imemodeW[] = {'i','m','e','m','o','d','e',0};
-static const WCHAR insertnotreplaceW[] = {'i','n','s','e','r','t','n','o','t','r','e','p','l','a','c','e',0};
-static const WCHAR insideoutW[] = {'i','n','s','i','d','e','o','u','t',0};
-static const WCHAR invisibleatruntimeW[] = {'i','n','v','i','s','i','b','l','e','a','t','r','u','n','t','i','m','e',0};
-static const WCHAR islinkobjectW[] = {'i','s','l','i','n','k','o','b','j','e','c','t',0};
-static const WCHAR nouiactivateW[] = {'n','o','u','i','a','c','t','i','v','a','t','e',0};
-static const WCHAR onlyiconicW[] = {'o','n','l','y','i','c','o','n','i','c',0};
-static const WCHAR recomposeonresizeW[] = {'r','e','c','o','m','p','o','s','e','o','n','r','e','s','i','z','e',0};
-static const WCHAR renderingisdeviceindependentW[] = {'r','e','n','d','e','r','i','n','g','i','s','d','e','v','i','c','e','i','n','d','e','p','e','n','d','e','n','t',0};
-static const WCHAR setclientsitefirstW[] = {'s','e','t','c','l','i','e','n','t','s','i','t','e','f','i','r','s','t',0};
-static const WCHAR simpleframeW[] = {'s','i','m','p','l','e','f','r','a','m','e',0};
-static const WCHAR staticW[] = {'s','t','a','t','i','c',0};
-static const WCHAR supportsmultilevelundoW[] = {'s','u','p','p','o','r','t','s','m','u','l','t','i','l','e','v','e','l','u','n','d','o',0};
-static const WCHAR wantstomenumergeW[] = {'w','a','n','t','s','t','o','m','e','n','u','m','e','r','g','e',0};
-
-static const WCHAR compatibilityW[] = {'c','o','m','p','a','t','i','b','i','l','i','t','y',0};
-static const WCHAR compatibilityNSW[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','c','o','m','p','a','t','i','b','i','l','i','t','y','.','v','1',0};
-static const WCHAR applicationW[] = {'a','p','p','l','i','c','a','t','i','o','n',0};
-static const WCHAR supportedOSW[] = {'s','u','p','p','o','r','t','e','d','O','S',0};
-static const WCHAR IdW[] = {'I','d',0};
-static const WCHAR requestedExecutionLevelW[] = {'r','e','q','u','e','s','t','e','d','E','x','e','c','u','t','i','o','n','L','e','v','e','l',0};
-static const WCHAR requestedPrivilegesW[] = {'r','e','q','u','e','s','t','e','d','P','r','i','v','i','l','e','g','e','s',0};
-static const WCHAR securityW[] = {'s','e','c','u','r','i','t','y',0};
-static const WCHAR trustInfoW[] = {'t','r','u','s','t','I','n','f','o',0};
-static const WCHAR windowsSettingsW[] = {'w','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
-static const WCHAR autoElevateW[] = {'a','u','t','o','E','l','e','v','a','t','e',0};
-static const WCHAR disableThemingW[] = {'d','i','s','a','b','l','e','T','h','e','m','i','n','g',0};
-static const WCHAR disableWindowFilteringW[] = {'d','i','s','a','b','l','e','W','i','n','d','o','w','F','i','l','t','e','r','i','n','g',0};
-static const WCHAR windowsSettings2005NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
-static const WCHAR windowsSettings2011NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','1','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
-static const WCHAR windowsSettings2016NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
-static const WCHAR windowsSettings2017NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','7','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0};
-static const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0};
-static const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0};
-static const WCHAR gdiScalingW[] = {'g','d','i','S','c','a','l','i','n','g',0};
-static const WCHAR highResolutionScrollingAwareW[] = {'h','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0};
-static const WCHAR longPathAwareW[] = {'l','o','n','g','P','a','t','h','A','w','a','r','e',0};
-static const WCHAR magicFutureSettingW[] = {'m','a','g','i','c','F','u','t','u','r','e','S','e','t','t','i','n','g',0};
-static const WCHAR printerDriverIsolationW[] = {'p','r','i','n','t','e','r','D','r','i','v','e','r','I','s','o','l','a','t','i','o','n',0};
-static const WCHAR ultraHighResolutionScrollingAwareW[] = {'u','l','t','r','a','H','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0};
+static const WCHAR asmv1W[] = L"urn:schemas-microsoft-com:asm.v1";
+static const WCHAR asmv2W[] = L"urn:schemas-microsoft-com:asm.v2";
+static const WCHAR asmv3W[] = L"urn:schemas-microsoft-com:asm.v3";
+static const WCHAR compatibilityNSW[] = L"urn:schemas-microsoft-com:compatibility.v1";
+static const WCHAR windowsSettings2005NSW[] = L"http://schemas.microsoft.com/SMI/2005/WindowsSettings";
+static const WCHAR windowsSettings2011NSW[] = L"http://schemas.microsoft.com/SMI/2011/WindowsSettings";
+static const WCHAR windowsSettings2016NSW[] = L"http://schemas.microsoft.com/SMI/2016/WindowsSettings";
+static const WCHAR windowsSettings2017NSW[] = L"http://schemas.microsoft.com/SMI/2017/WindowsSettings";
struct olemisc_entry
{
@@ -693,35 +593,30 @@ struct olemisc_entry
static const struct olemisc_entry olemisc_values[] =
{
- { activatewhenvisibleW, OLEMISC_ACTIVATEWHENVISIBLE },
- { actslikebuttonW, OLEMISC_ACTSLIKEBUTTON },
- { actslikelabelW, OLEMISC_ACTSLIKELABEL },
- { alignableW, OLEMISC_ALIGNABLE },
- { alwaysrunW, OLEMISC_ALWAYSRUN },
- { canlinkbyole1W, OLEMISC_CANLINKBYOLE1 },
- { cantlinkinsideW, OLEMISC_CANTLINKINSIDE },
- { ignoreactivatewhenvisibleW, OLEMISC_IGNOREACTIVATEWHENVISIBLE },
- { imemodeW, OLEMISC_IMEMODE },
- { insertnotreplaceW, OLEMISC_INSERTNOTREPLACE },
- { insideoutW, OLEMISC_INSIDEOUT },
- { invisibleatruntimeW, OLEMISC_INVISIBLEATRUNTIME },
- { islinkobjectW, OLEMISC_ISLINKOBJECT },
- { nouiactivateW, OLEMISC_NOUIACTIVATE },
- { onlyiconicW, OLEMISC_ONLYICONIC },
- { recomposeonresizeW, OLEMISC_RECOMPOSEONRESIZE },
- { renderingisdeviceindependentW, OLEMISC_RENDERINGISDEVICEINDEPENDENT },
- { setclientsitefirstW, OLEMISC_SETCLIENTSITEFIRST },
- { simpleframeW, OLEMISC_SIMPLEFRAME },
- { staticW, OLEMISC_STATIC },
- { supportsmultilevelundoW, OLEMISC_SUPPORTSMULTILEVELUNDO },
- { wantstomenumergeW, OLEMISC_WANTSTOMENUMERGE }
+ { L"activatewhenvisible", OLEMISC_ACTIVATEWHENVISIBLE },
+ { L"actslikebutton", OLEMISC_ACTSLIKEBUTTON },
+ { L"actslikelabel", OLEMISC_ACTSLIKELABEL },
+ { L"alignable", OLEMISC_ALIGNABLE },
+ { L"alwaysrun", OLEMISC_ALWAYSRUN },
+ { L"canlinkbyole1", OLEMISC_CANLINKBYOLE1 },
+ { L"cantlinkinside", OLEMISC_CANTLINKINSIDE },
+ { L"ignoreactivatewhenvisible", OLEMISC_IGNOREACTIVATEWHENVISIBLE },
+ { L"imemode", OLEMISC_IMEMODE },
+ { L"insertnotreplace", OLEMISC_INSERTNOTREPLACE },
+ { L"insideout", OLEMISC_INSIDEOUT },
+ { L"invisibleatruntime", OLEMISC_INVISIBLEATRUNTIME },
+ { L"islinkobject", OLEMISC_ISLINKOBJECT },
+ { L"nouiactivate", OLEMISC_NOUIACTIVATE },
+ { L"onlyiconic", OLEMISC_ONLYICONIC },
+ { L"recomposeonresize", OLEMISC_RECOMPOSEONRESIZE },
+ { L"renderingisdeviceindependent", OLEMISC_RENDERINGISDEVICEINDEPENDENT },
+ { L"setclientsitefirst", OLEMISC_SETCLIENTSITEFIRST },
+ { L"simpleframe", OLEMISC_SIMPLEFRAME },
+ { L"static", OLEMISC_STATIC },
+ { L"supportsmultilevelundo", OLEMISC_SUPPORTSMULTILEVELUNDO },
+ { L"wantstomenumerge", OLEMISC_WANTSTOMENUMERGE }
};
-static const WCHAR xmlW[] = {'?','x','m','l',0};
-static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0};
-static const WCHAR version_formatW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
-static const WCHAR wildcardW[] = {'*',0};
-
static ACTIVATION_CONTEXT system_actctx = { ACTCTX_MAGIC, 1 };
static ACTIVATION_CONTEXT *process_actctx = &system_actctx;
@@ -1008,7 +903,7 @@ static BOOL is_matching_identity( const struct assembly_identity *id1,
if (id1->language && id2->language && !is_matching_string( id1->language, id2->language ))
{
- if (wcscmp( wildcardW, id1->language ) && wcscmp( wildcardW, id2->language ))
+ if (wcscmp( L"*", id1->language ) && wcscmp( L"*", id2->language ))
return FALSE;
}
if (id1->version.major != id2->version.major) return FALSE;
@@ -1078,14 +973,11 @@ static void free_depend_manifests(struct actctx_loader* acl)
static WCHAR *build_assembly_dir(struct assembly_identity* ai)
{
- static const WCHAR undW[] = {'_',0};
- static const WCHAR noneW[] = {'n','o','n','e',0};
- static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0};
-
- const WCHAR *arch = ai->arch ? ai->arch : noneW;
- const WCHAR *key = ai->public_key ? ai->public_key : noneW;
- const WCHAR *lang = ai->language ? ai->language : noneW;
- const WCHAR *name = ai->name ? ai->name : noneW;
+ static const WCHAR mskeyW[] = L"deadbeef";
+ const WCHAR *arch = ai->arch ? ai->arch : L"none";
+ const WCHAR *key = ai->public_key ? ai->public_key : L"none";
+ const WCHAR *lang = ai->language ? ai->language : L"none";
+ const WCHAR *name = ai->name ? ai->name : L"none";
SIZE_T size = (wcslen(arch) + 1 + wcslen(name) + 1 + wcslen(key) + 24 + 1 +
wcslen(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW);
WCHAR *ret;
@@ -1093,16 +985,16 @@ static WCHAR *build_assembly_dir(struct assembly_identity* ai)
if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
wcscpy( ret, arch );
- wcscat( ret, undW );
+ wcscat( ret, L"_" );
wcscat( ret, name );
- wcscat( ret, undW );
+ wcscat( ret, L"_" );
wcscat( ret, key );
- wcscat( ret, undW );
- swprintf( ret + wcslen(ret), size - wcslen(ret), version_formatW,
+ wcscat( ret, L"_" );
+ swprintf( ret + wcslen(ret), size - wcslen(ret), L"%u.%u.%u.%u",
ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
- wcscat( ret, undW );
+ wcscat( ret, L"_" );
wcscat( ret, lang );
- wcscat( ret, undW );
+ wcscat( ret, L"_" );
wcscat( ret, mskeyW );
return ret;
}
@@ -1123,35 +1015,26 @@ static inline void append_string( WCHAR *buffer, const WCHAR *prefix, const WCHA
static WCHAR *build_assembly_id( const struct assembly_identity *ai )
{
- static const WCHAR archW[] =
- {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0};
- static const WCHAR public_keyW[] =
- {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0};
- static const WCHAR typeW[] =
- {',','t','y','p','e','=',0};
- static const WCHAR versionW[] =
- {',','v','e','r','s','i','o','n','=',0};
-
WCHAR version[64], *ret;
SIZE_T size = 0;
- swprintf( version, ARRAY_SIZE(version), version_formatW,
+ swprintf( version, ARRAY_SIZE(version), L"%u.%u.%u.%u",
ai->version.major, ai->version.minor, ai->version.build, ai->version.revision );
if (ai->name) size += wcslen(ai->name) * sizeof(WCHAR);
- if (ai->arch) size += wcslen(archW) + wcslen(ai->arch) + 2;
- if (ai->public_key) size += wcslen(public_keyW) + wcslen(ai->public_key) + 2;
- if (ai->type) size += wcslen(typeW) + wcslen(ai->type) + 2;
- size += wcslen(versionW) + wcslen(version) + 2;
+ if (ai->arch) size += wcslen(L",processorArchitecture=") + wcslen(ai->arch) + 2;
+ if (ai->public_key) size += wcslen(L",publicKeyToken=") + wcslen(ai->public_key) + 2;
+ if (ai->type) size += wcslen(L",type=") + wcslen(ai->type) + 2;
+ size += wcslen(L",version=") + wcslen(version) + 2;
if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
return NULL;
if (ai->name) wcscpy( ret, ai->name );
else *ret = 0;
- append_string( ret, archW, ai->arch );
- append_string( ret, public_keyW, ai->public_key );
- append_string( ret, typeW, ai->type );
- append_string( ret, versionW, version );
+ append_string( ret, L",processorArchitecture=", ai->arch );
+ append_string( ret, L",publicKeyToken=", ai->public_key );
+ append_string( ret, L",type=", ai->type );
+ append_string( ret, L",version=", version );
return ret;
}
@@ -1222,15 +1105,15 @@ static BOOL set_error( xmlbuf_t *xmlbuf )
static BOOL is_xmlns_attr( const struct xml_attr *attr )
{
- const int len = wcslen( xmlnsW );
+ const int len = wcslen( L"xmlns" );
if (attr->name.len < len) return FALSE;
- if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE;
+ if (wcsncmp( attr->name.ptr, L"xmlns", len )) return FALSE;
return (attr->name.len == len || attr->name.ptr[len] == ':');
}
static void push_xmlns( xmlbuf_t *xmlbuf, const struct xml_attr *attr )
{
- const int len = wcslen( xmlnsW );
+ const int len = wcslen( L"xmlns" );
struct xml_attr *ns;
if (xmlbuf->ns_pos == MAX_NAMESPACES - 1)
@@ -1527,27 +1410,27 @@ static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *a
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, nameW))
+ if (xml_attr_cmp(&attr, L"name"))
{
if (!(ai->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, typeW))
+ else if (xml_attr_cmp(&attr, L"type"))
{
if (!(ai->type = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, versionW))
+ else if (xml_attr_cmp(&attr, L"version"))
{
if (!parse_version(&attr.value, &ai->version)) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, processorArchitectureW))
+ else if (xml_attr_cmp(&attr, L"processorArchitecture"))
{
if (!(ai->arch = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, publicKeyTokenW))
+ else if (xml_attr_cmp(&attr, L"publicKeyToken"))
{
if (!(ai->public_key = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, languageW))
+ else if (xml_attr_cmp(&attr, L"language"))
{
if (!(ai->language = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
@@ -1565,19 +1448,14 @@ static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *a
static enum comclass_threadingmodel parse_com_class_threadingmodel(xmlstr_t *value)
{
- static const WCHAR apartW[] = {'A','p','a','r','t','m','e','n','t',0};
- static const WCHAR neutralW[] = {'N','e','u','t','r','a','l',0};
- static const WCHAR freeW[] = {'F','r','e','e',0};
- static const WCHAR bothW[] = {'B','o','t','h',0};
-
if (value->len == 0) return ThreadingModel_No;
- if (xmlstr_cmp(value, apartW))
+ if (xmlstr_cmp(value, L"Apartment"))
return ThreadingModel_Apartment;
- else if (xmlstr_cmp(value, freeW))
+ else if (xmlstr_cmp(value, L"Free"))
return ThreadingModel_Free;
- else if (xmlstr_cmp(value, bothW))
+ else if (xmlstr_cmp(value, L"Both"))
return ThreadingModel_Both;
- else if (xmlstr_cmp(value, neutralW))
+ else if (xmlstr_cmp(value, L"Neutral"))
return ThreadingModel_Neutral;
else
return ThreadingModel_No;
@@ -1686,43 +1564,43 @@ static void parse_com_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, st
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, clsidW))
+ if (xml_attr_cmp(&attr, L"clsid"))
{
if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, progidW))
+ else if (xml_attr_cmp(&attr, L"progid"))
{
if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, tlbidW))
+ else if (xml_attr_cmp(&attr, L"tlbid"))
{
if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, threadingmodelW))
+ else if (xml_attr_cmp(&attr, L"threadingModel"))
{
entity->u.comclass.model = parse_com_class_threadingmodel(&attr.value);
}
- else if (xml_attr_cmp(&attr, miscstatusW))
+ else if (xml_attr_cmp(&attr, L"miscStatus"))
{
entity->u.comclass.miscstatus = parse_com_class_misc(&attr.value);
}
- else if (xml_attr_cmp(&attr, miscstatuscontentW))
+ else if (xml_attr_cmp(&attr, L"miscStatusContent"))
{
entity->u.comclass.miscstatuscontent = parse_com_class_misc(&attr.value);
}
- else if (xml_attr_cmp(&attr, miscstatusthumbnailW))
+ else if (xml_attr_cmp(&attr, L"miscStatusThumbnail"))
{
entity->u.comclass.miscstatusthumbnail = parse_com_class_misc(&attr.value);
}
- else if (xml_attr_cmp(&attr, miscstatusiconW))
+ else if (xml_attr_cmp(&attr, L"miscStatusIcon"))
{
entity->u.comclass.miscstatusicon = parse_com_class_misc(&attr.value);
}
- else if (xml_attr_cmp(&attr, miscstatusdocprintW))
+ else if (xml_attr_cmp(&attr, L"miscStatusDocPrint"))
{
entity->u.comclass.miscstatusdocprint = parse_com_class_misc(&attr.value);
}
- else if (xml_attr_cmp(&attr, descriptionW))
+ else if (xml_attr_cmp(&attr, L"description"))
{
/* not stored */
}
@@ -1740,7 +1618,7 @@ static void parse_com_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, st
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, progidW, asmv1W))
+ if (xml_elem_cmp(&elem, L"progid", asmv1W))
{
parse_com_class_progid(xmlbuf, entity, &elem);
}
@@ -1818,34 +1696,34 @@ static void parse_cominterface_proxy_stub_elem( xmlbuf_t *xmlbuf, struct dll_red
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, iidW))
+ if (xml_attr_cmp(&attr, L"iid"))
{
if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, nameW))
+ else if (xml_attr_cmp(&attr, L"name"))
{
if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, baseInterfaceW))
+ else if (xml_attr_cmp(&attr, L"baseInterface"))
{
if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
entity->u.ifaceps.mask |= BaseIface;
}
- else if (xml_attr_cmp(&attr, nummethodsW))
+ else if (xml_attr_cmp(&attr, L"numMethods"))
{
if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
entity->u.ifaceps.mask |= NumMethods;
}
- else if (xml_attr_cmp(&attr, tlbidW))
+ else if (xml_attr_cmp(&attr, L"tlbid"))
{
if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, proxyStubClsid32W))
+ else if (xml_attr_cmp(&attr, L"proxyStubClsid32"))
{
if (!(psclsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
/* not used */
- else if (xml_attr_cmp(&attr, threadingmodelW))
+ else if (xml_attr_cmp(&attr, L"threadingModel"))
{
}
else if (!is_xmlns_attr( &attr ))
@@ -1876,13 +1754,13 @@ static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity)
start = str;
while (*str != ',' && (i++ < value->len)) str++;
- if (!wcsnicmp(start, restrictedW, str-start))
+ if (!wcsnicmp(start, L"RESTRICTED", str-start))
*flags |= LIBFLAG_FRESTRICTED;
- else if (!wcsnicmp(start, controlW, str-start))
+ else if (!wcsnicmp(start, L"CONTROL", str-start))
*flags |= LIBFLAG_FCONTROL;
- else if (!wcsnicmp(start, hiddenW, str-start))
+ else if (!wcsnicmp(start, L"HIDDEN", str-start))
*flags |= LIBFLAG_FHIDDEN;
- else if (!wcsnicmp(start, hasdiskimageW, str-start))
+ else if (!wcsnicmp(start, L"HASDISKIMAGE", str-start))
*flags |= LIBFLAG_FHASDISKIMAGE;
else
{
@@ -1943,19 +1821,19 @@ static void parse_typelib_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, tlbidW))
+ if (xml_attr_cmp(&attr, L"tlbid"))
{
if (!(entity->u.typelib.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, versionW))
+ else if (xml_attr_cmp(&attr, L"version"))
{
if (!parse_typelib_version(&attr.value, entity)) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, helpdirW))
+ else if (xml_attr_cmp(&attr, L"helpdir"))
{
if (!(entity->u.typelib.helpdir = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, flagsW))
+ else if (xml_attr_cmp(&attr, L"flags"))
{
if (!parse_typelib_flags(&attr.value, entity)) set_error( xmlbuf );
}
@@ -1976,12 +1854,11 @@ static inline int aligned_string_len(int len)
static int get_assembly_version(struct assembly *assembly, WCHAR *ret)
{
- static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
struct assembly_version *ver = &assembly->id.version;
WCHAR buff[25];
if (!ret) ret = buff;
- return swprintf(ret, ARRAY_SIZE(buff), fmtW, ver->major, ver->minor, ver->build, ver->revision);
+ return swprintf(ret, ARRAY_SIZE(buff), L"%u.%u.%u.%u", ver->major, ver->minor, ver->build, ver->revision);
}
static void parse_window_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll,
@@ -2001,11 +1878,11 @@ static void parse_window_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll,
entity->u.class.versioned = TRUE;
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, versionedW))
+ if (xml_attr_cmp(&attr, L"versioned"))
{
- if (xmlstr_cmpi(&attr.value, noW))
+ if (xmlstr_cmpi(&attr.value, L"no"))
entity->u.class.versioned = FALSE;
- else if (!xmlstr_cmpi(&attr.value, yesW))
+ else if (!xmlstr_cmpi(&attr.value, L"yes"))
set_error( xmlbuf );
}
else if (!is_xmlns_attr( &attr ))
@@ -2035,11 +1912,11 @@ static void parse_binding_redirect_elem( xmlbuf_t *xmlbuf, const struct xml_elem
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, oldVersionW))
+ if (xml_attr_cmp(&attr, L"oldVersion"))
{
FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
}
- else if (xml_attr_cmp(&attr, newVersionW))
+ else if (xml_attr_cmp(&attr, L"newVersion"))
{
FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr));
}
@@ -2093,29 +1970,29 @@ static void parse_com_interface_external_proxy_stub_elem(xmlbuf_t *xmlbuf,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, iidW))
+ if (xml_attr_cmp(&attr, L"iid"))
{
if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, nameW))
+ else if (xml_attr_cmp(&attr, L"name"))
{
if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, baseInterfaceW))
+ else if (xml_attr_cmp(&attr, L"baseInterface"))
{
if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf );
entity->u.ifaceps.mask |= BaseIface;
}
- else if (xml_attr_cmp(&attr, nummethodsW))
+ else if (xml_attr_cmp(&attr, L"numMethods"))
{
if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf );
entity->u.ifaceps.mask |= NumMethods;
}
- else if (xml_attr_cmp(&attr, proxyStubClsid32W))
+ else if (xml_attr_cmp(&attr, L"proxyStubClsid32"))
{
if (!(entity->u.ifaceps.ps32 = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, tlbidW))
+ else if (xml_attr_cmp(&attr, L"tlbid"))
{
if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
@@ -2146,27 +2023,27 @@ static void parse_clr_class_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, nameW))
+ if (xml_attr_cmp(&attr, L"name"))
{
if (!(entity->u.comclass.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, clsidW))
+ else if (xml_attr_cmp(&attr, L"clsid"))
{
if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, progidW))
+ else if (xml_attr_cmp(&attr, L"progid"))
{
if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, tlbidW))
+ else if (xml_attr_cmp(&attr, L"tlbid"))
{
if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, threadingmodelW))
+ else if (xml_attr_cmp(&attr, L"threadingModel"))
{
entity->u.comclass.model = parse_com_class_threadingmodel(&attr.value);
}
- else if (xml_attr_cmp(&attr, runtimeVersionW))
+ else if (xml_attr_cmp(&attr, L"runtimeVersion"))
{
if (!(entity->u.comclass.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
@@ -2183,7 +2060,7 @@ static void parse_clr_class_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, progidW, asmv1W))
+ if (xml_elem_cmp(&elem, L"progid", asmv1W))
{
parse_com_class_progid(xmlbuf, entity, &elem);
}
@@ -2213,15 +2090,15 @@ static void parse_clr_surrogate_elem( xmlbuf_t *xmlbuf, struct assembly *assembl
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, nameW))
+ if (xml_attr_cmp(&attr, L"name"))
{
if (!(entity->u.clrsurrogate.name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, clsidW))
+ else if (xml_attr_cmp(&attr, L"clsid"))
{
if (!(entity->u.clrsurrogate.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, runtimeVersionW))
+ else if (xml_attr_cmp(&attr, L"runtimeVersion"))
{
if (!(entity->u.clrsurrogate.version = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
@@ -2248,11 +2125,8 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade
while (next_xml_attr(xmlbuf, &attr, &end))
{
- static const WCHAR allowDelayedBindingW[] = {'a','l','l','o','w','D','e','l','a','y','e','d','B','i','n','d','i','n','g',0};
- static const WCHAR trueW[] = {'t','r','u','e',0};
-
- if (xml_attr_cmp(&attr, allowDelayedBindingW))
- ai.delayed = xmlstr_cmp(&attr.value, trueW);
+ if (xml_attr_cmp(&attr, L"allowDelayedBinding"))
+ ai.delayed = xmlstr_cmp(&attr.value, L"true");
else if (!is_xmlns_attr( &attr ))
WARN("unknown attr %s\n", debugstr_xml_attr(&attr));
}
@@ -2261,11 +2135,11 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, assemblyIdentityW, asmv1W))
+ if (xml_elem_cmp(&elem, L"assemblyIdentity", asmv1W))
{
parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai, &elem);
/* store the newly found identity for later loading */
- if (ai.arch && !wcscmp(ai.arch, wildcardW))
+ if (ai.arch && !wcscmp(ai.arch, L"*"))
{
RtlFreeHeap( GetProcessHeap(), 0, ai.arch );
ai.arch = strdupW( current_archW );
@@ -2274,7 +2148,7 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade
debugstr_w(ai.name), debugstr_version(&ai.version), debugstr_w(ai.arch) );
if (!add_dependent_assembly_id(acl, &ai)) set_error( xmlbuf );
}
- else if (xml_elem_cmp(&elem, bindingRedirectW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"bindingRedirect", asmv1W))
{
parse_binding_redirect_elem(xmlbuf, &elem);
}
@@ -2296,9 +2170,9 @@ static void parse_dependency_elem( xmlbuf_t *xmlbuf, struct actctx_loader *acl,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, optionalW))
+ if (xml_attr_cmp(&attr, L"optional"))
{
- optional = xmlstr_cmpi( &attr.value, yesW );
+ optional = xmlstr_cmpi( &attr.value, L"yes" );
TRACE("optional=%s\n", debugstr_xmlstr(&attr.value));
}
else if (!is_xmlns_attr( &attr ))
@@ -2311,7 +2185,7 @@ static void parse_dependency_elem( xmlbuf_t *xmlbuf, struct actctx_loader *acl,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, dependentAssemblyW, asmv1W))
+ if (xml_elem_cmp(&elem, L"dependentAssembly", asmv1W))
{
parse_dependent_assembly_elem(xmlbuf, acl, &elem, optional);
}
@@ -2355,19 +2229,18 @@ static void parse_file_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, nameW))
+ if (xml_attr_cmp(&attr, L"name"))
{
if (!(dll->name = xmlstrdupW(&attr.value))) set_error( xmlbuf );
TRACE("name=%s\n", debugstr_xmlstr(&attr.value));
}
- else if (xml_attr_cmp(&attr, hashW))
+ else if (xml_attr_cmp(&attr, L"hash"))
{
if (!(dll->hash = xmlstrdupW(&attr.value))) set_error( xmlbuf );
}
- else if (xml_attr_cmp(&attr, hashalgW))
+ else if (xml_attr_cmp(&attr, L"hashalg"))
{
- static const WCHAR sha1W[] = {'S','H','A','1',0};
- if (!xmlstr_cmpi(&attr.value, sha1W))
+ if (!xmlstr_cmpi(&attr.value, L"SHA1"))
FIXME("hashalg should be SHA1, got %s\n", debugstr_xmlstr(&attr.value));
}
else if (!is_xmlns_attr( &attr ))
@@ -2384,24 +2257,24 @@ static void parse_file_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, comClassW, asmv1W))
+ if (xml_elem_cmp(&elem, L"comClass", asmv1W))
{
parse_com_class_elem(xmlbuf, dll, acl, &elem);
}
- else if (xml_elem_cmp(&elem, comInterfaceProxyStubW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"comInterfaceProxyStub", asmv1W))
{
parse_cominterface_proxy_stub_elem(xmlbuf, dll, acl, &elem);
}
- else if (xml_elem_cmp(&elem, hashW, asmv2W))
+ else if (xml_elem_cmp(&elem, L"hash", asmv2W))
{
WARN("asmv2:hash (undocumented) not supported\n");
parse_unknown_elem(xmlbuf, &elem);
}
- else if (xml_elem_cmp(&elem, typelibW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"typelib", asmv1W))
{
parse_typelib_elem(xmlbuf, dll, acl, &elem);
}
- else if (xml_elem_cmp(&elem, windowClassW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"windowClass", asmv1W))
{
parse_window_class_elem(xmlbuf, dll, acl, &elem);
}
@@ -2421,7 +2294,7 @@ static void parse_supportedos_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, IdW))
+ if (xml_attr_cmp(&attr, L"Id"))
{
COMPATIBILITY_CONTEXT_ELEMENT *compat;
UNICODE_STRING str;
@@ -2460,7 +2333,7 @@ static void parse_compatibility_application_elem(xmlbuf_t *xmlbuf, struct assemb
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, supportedOSW, compatibilityNSW))
+ if (xml_elem_cmp(&elem, L"supportedOS", compatibilityNSW))
{
parse_supportedos_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2479,7 +2352,7 @@ static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, applicationW, compatibilityNSW))
+ if (xml_elem_cmp(&elem, L"application", compatibilityNSW))
{
parse_compatibility_application_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2534,17 +2407,17 @@ static void parse_windows_settings_elem( xmlbuf_t *xmlbuf, struct assembly *asse
while (next_xml_elem( xmlbuf, &elem, parent ))
{
- if (xml_elem_cmp( &elem, autoElevateW, windowsSettings2005NSW ) ||
- xml_elem_cmp( &elem, disableThemingW, windowsSettings2005NSW ) ||
- xml_elem_cmp( &elem, disableWindowFilteringW, windowsSettings2011NSW ) ||
- xml_elem_cmp( &elem, dpiAwareW, windowsSettings2005NSW ) ||
- xml_elem_cmp( &elem, dpiAwarenessW, windowsSettings2016NSW ) ||
- xml_elem_cmp( &elem, gdiScalingW, windowsSettings2017NSW ) ||
- xml_elem_cmp( &elem, highResolutionScrollingAwareW, windowsSettings2017NSW ) ||
- xml_elem_cmp( &elem, longPathAwareW, windowsSettings2016NSW ) ||
- xml_elem_cmp( &elem, magicFutureSettingW, windowsSettings2017NSW ) ||
- xml_elem_cmp( &elem, printerDriverIsolationW, windowsSettings2011NSW ) ||
- xml_elem_cmp( &elem, ultraHighResolutionScrollingAwareW, windowsSettings2017NSW ))
+ if (xml_elem_cmp( &elem, L"autoElevate", windowsSettings2005NSW ) ||
+ xml_elem_cmp( &elem, L"disableTheming", windowsSettings2005NSW ) ||
+ xml_elem_cmp( &elem, L"disableWindowFiltering", windowsSettings2011NSW ) ||
+ xml_elem_cmp( &elem, L"dpiAware", windowsSettings2005NSW ) ||
+ xml_elem_cmp( &elem, L"dpiAwareness", windowsSettings2016NSW ) ||
+ xml_elem_cmp( &elem, L"gdiScaling", windowsSettings2017NSW ) ||
+ xml_elem_cmp( &elem, L"highResolutionScrollingAware", windowsSettings2017NSW ) ||
+ xml_elem_cmp( &elem, L"longPathAware", windowsSettings2016NSW ) ||
+ xml_elem_cmp( &elem, L"magicFutureSetting", windowsSettings2017NSW ) ||
+ xml_elem_cmp( &elem, L"printerDriverIsolation", windowsSettings2011NSW ) ||
+ xml_elem_cmp( &elem, L"ultraHighResolutionScrollingAware", windowsSettings2017NSW ))
{
parse_settings_elem( xmlbuf, assembly, acl, &elem );
}
@@ -2563,7 +2436,7 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem( xmlbuf, &elem, parent ))
{
- if (xml_elem_cmp( &elem, windowsSettingsW, asmv3W ))
+ if (xml_elem_cmp( &elem, L"windowsSettings", asmv3W ))
{
parse_windows_settings_elem( xmlbuf, assembly, acl, &elem );
}
@@ -2578,14 +2451,6 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
static void parse_requested_execution_level_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
struct actctx_loader *acl, const struct xml_elem *parent )
{
- static const WCHAR levelW[] = {'l','e','v','e','l',0};
- static const WCHAR asInvokerW[] = {'a','s','I','n','v','o','k','e','r',0};
- static const WCHAR requireAdministratorW[] = {'r','e','q','u','i','r','e','A','d','m','i','n','i','s','t','r','a','t','o','r',0};
- static const WCHAR highestAvailableW[] = {'h','i','g','h','e','s','t','A','v','a','i','l','a','b','l','e',0};
- static const WCHAR uiAccessW[] = {'u','i','A','c','c','e','s','s',0};
- static const WCHAR falseW[] = {'f','a','l','s','e',0};
- static const WCHAR trueW[] = {'t','r','u','e',0};
-
struct xml_elem elem;
struct xml_attr attr;
BOOL end = FALSE;
@@ -2595,22 +2460,22 @@ static void parse_requested_execution_level_elem( xmlbuf_t *xmlbuf, struct assem
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, levelW))
+ if (xml_attr_cmp(&attr, L"level"))
{
- if (xmlstr_cmpi(&attr.value, asInvokerW))
+ if (xmlstr_cmpi(&attr.value, L"asInvoker"))
assembly->run_level = ACTCTX_RUN_LEVEL_AS_INVOKER;
- else if (xmlstr_cmpi(&attr.value, highestAvailableW))
+ else if (xmlstr_cmpi(&attr.value, L"highestAvailable"))
assembly->run_level = ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE;
- else if (xmlstr_cmpi(&attr.value, requireAdministratorW))
+ else if (xmlstr_cmpi(&attr.value, L"requireAdministrator"))
assembly->run_level = ACTCTX_RUN_LEVEL_REQUIRE_ADMIN;
else
FIXME("unknown execution level: %s\n", debugstr_xmlstr(&attr.value));
}
- else if (xml_attr_cmp(&attr, uiAccessW))
+ else if (xml_attr_cmp(&attr, L"uiAccess"))
{
- if (xmlstr_cmpi(&attr.value, falseW))
+ if (xmlstr_cmpi(&attr.value, L"false"))
assembly->ui_access = FALSE;
- else if (xmlstr_cmpi(&attr.value, trueW))
+ else if (xmlstr_cmpi(&attr.value, L"true"))
assembly->ui_access = TRUE;
else
FIXME("unknown uiAccess value: %s\n", debugstr_xmlstr(&attr.value));
@@ -2635,7 +2500,7 @@ static void parse_requested_privileges_elem( xmlbuf_t *xmlbuf, struct assembly *
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, requestedExecutionLevelW, asmv1W))
+ if (xml_elem_cmp(&elem, L"requestedExecutionLevel", asmv1W))
{
parse_requested_execution_level_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2654,7 +2519,7 @@ static void parse_security_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, requestedPrivilegesW, asmv1W))
+ if (xml_elem_cmp(&elem, L"requestedPrivileges", asmv1W))
{
parse_requested_privileges_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2673,7 +2538,7 @@ static void parse_trust_info_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (xml_elem_cmp(&elem, securityW, asmv1W))
+ if (xml_elem_cmp(&elem, L"security", asmv1W))
{
parse_security_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2697,10 +2562,9 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end))
{
- if (xml_attr_cmp(&attr, manifestVersionW))
+ if (xml_attr_cmp(&attr, L"manifestVersion"))
{
- static const WCHAR v10W[] = {'1','.','0',0};
- if (!xmlstr_cmp(&attr.value, v10W))
+ if (!xmlstr_cmp(&attr.value, L"1.0"))
{
FIXME("wrong version %s\n", debugstr_xmlstr(&attr.value));
break;
@@ -2721,44 +2585,44 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent))
{
- if (assembly->type == APPLICATION_MANIFEST && xml_elem_cmp(&elem, noInheritW, asmv1W))
+ if (assembly->type == APPLICATION_MANIFEST && xml_elem_cmp(&elem, L"noInherit", asmv1W))
{
parse_noinherit_elem(xmlbuf, &elem);
assembly->no_inherit = TRUE;
}
- else if (xml_elem_cmp(&elem, noInheritableW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"noInheritable", asmv1W))
{
parse_noinheritable_elem(xmlbuf, &elem);
}
- else if (xml_elem_cmp(&elem, descriptionW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"description", asmv1W))
{
parse_description_elem(xmlbuf, &elem);
}
- else if (xml_elem_cmp(&elem, comInterfaceExternalProxyStubW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"comInterfaceExternalProxyStub", asmv1W))
{
parse_com_interface_external_proxy_stub_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, dependencyW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"dependency", asmv1W))
{
parse_dependency_elem(xmlbuf, acl, &elem);
}
- else if (xml_elem_cmp(&elem, fileW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"file", asmv1W))
{
parse_file_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, clrClassW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"clrClass", asmv1W))
{
parse_clr_class_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, clrSurrogateW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"clrSurrogate", asmv1W))
{
parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, trustInfoW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"trustInfo", asmv1W))
{
parse_trust_info_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, assemblyIdentityW, asmv1W))
+ else if (xml_elem_cmp(&elem, L"assemblyIdentity", asmv1W))
{
parse_assembly_identity_elem(xmlbuf, acl->actctx, &assembly->id, &elem);
@@ -2787,11 +2651,11 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly,
}
}
}
- else if (xml_elem_cmp(&elem, compatibilityW, compatibilityNSW))
+ else if (xml_elem_cmp(&elem, L"compatibility", compatibilityNSW))
{
parse_compatibility_elem(xmlbuf, assembly, acl, &elem);
}
- else if (xml_elem_cmp(&elem, applicationW, asmv3W))
+ else if (xml_elem_cmp(&elem, L"application", asmv3W))
{
parse_application_elem(xmlbuf, assembly, acl, &elem);
}
@@ -2820,11 +2684,11 @@ static NTSTATUS parse_manifest_buffer( struct actctx_loader* acl, struct assembl
if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
- if (xmlstr_cmp(&elem.name, xmlW) &&
+ if (xmlstr_cmp(&elem.name, L"?xml") &&
(!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent)))
return STATUS_SXS_CANT_GEN_ACTCTX;
- if (!xml_elem_cmp(&elem, assemblyW, asmv1W))
+ if (!xml_elem_cmp(&elem, L"assembly", asmv1W))
{
FIXME("root element is %s, not <assembly>\n", debugstr_xml_elem(&elem));
return STATUS_SXS_CANT_GEN_ACTCTX;
@@ -3080,7 +2944,6 @@ static NTSTATUS get_manifest_in_manifest_file( struct actctx_loader* acl, struct
static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, struct assembly_identity* ai,
LPCWSTR filename, LPCWSTR directory, HMODULE module, LPCWSTR resname )
{
- static const WCHAR fmtW[] = { '.','%','l','u',0 };
WCHAR *buffer;
NTSTATUS status;
UNICODE_STRING nameW;
@@ -3095,10 +2958,10 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl,
{
UNICODE_STRING name;
- if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) )))
+ if (!(status = get_module_filename( module, &name, sizeof(L".manifest") + 10*sizeof(WCHAR) )))
{
- if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, fmtW, resid );
- wcscat( name.Buffer, dotManifestW );
+ if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, L".%lu", resid );
+ wcscat( name.Buffer, L".manifest" );
if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL ))
status = STATUS_RESOURCE_DATA_NOT_FOUND;
RtlFreeUnicodeString( &name );
@@ -3108,11 +2971,11 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl,
else
{
if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0,
- (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
+ (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(L".manifest") )))
return STATUS_NO_MEMORY;
wcscpy( buffer, filename );
- if (resid != 1) swprintf( buffer + wcslen(buffer), 10, fmtW, resid );
- wcscat( buffer, dotManifestW );
+ if (resid != 1) swprintf( buffer + wcslen(buffer), 10, L".%lu", resid );
+ wcscat( buffer, L".manifest" );
RtlInitUnicodeString( &nameW, buffer );
}
@@ -3128,9 +2991,7 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl,
static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
{
- static const WCHAR lookup_fmtW[] =
- {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_',
- '%','s','_','*','.','m','a','n','i','f','e','s','t',0};
+ static const WCHAR lookup_fmtW[] = L"%s_%s_%s_%u.%u.*.*_%s_*.manifest";
static const WCHAR wine_trailerW[] = {'d','e','a','d','b','e','e','f','.','m','a','n','i','f','e','s','t'};
WCHAR *lookup, *ret = NULL;
@@ -3140,7 +3001,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
unsigned int data_pos = 0, data_len, len;
char buffer[8192];
- if (!lang || !wcsicmp( lang, neutralW )) lang = wildcardW;
+ if (!lang || !wcsicmp( lang, L"neutral" )) lang = L"*";
len = wcslen(ai->arch) + wcslen(ai->name) + wcslen(ai->public_key) + wcslen(lang) + 20 + ARRAY_SIZE(lookup_fmtW);
if (!(lookup = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
@@ -3217,17 +3078,14 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
WCHAR *path, *file = NULL;
HANDLE handle;
- static const WCHAR manifest_dirW[] =
- {'\\','w','i','n','s','x','s','\\','m','a','n','i','f','e','s','t','s',0};
-
if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
- if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(manifest_dirW) +
+ if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(L"\\winsxs\\manifests") +
wcslen(windows_dir) * sizeof(WCHAR) )))
return STATUS_NO_MEMORY;
wcscpy( path, windows_dir );
- wcscat( path, manifest_dirW );
+ wcscat( path, L"\\winsxs\\manifests" );
if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
{
@@ -3285,7 +3143,6 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
static NTSTATUS lookup_assembly(struct actctx_loader* acl,
struct assembly_identity* ai)
{
- static const WCHAR dotDllW[] = {'.','d','l','l',0};
unsigned int i;
WCHAR *buffer, *p, *directory;
NTSTATUS status;
@@ -3305,7 +3162,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
nameW.Buffer = NULL;
if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0,
- (len + 2 * wcslen(ai->name) + 2) * sizeof(WCHAR) + sizeof(dotManifestW) )))
+ (len + 2 * wcslen(ai->name) + 2) * sizeof(WCHAR) + sizeof(L".manifest") )))
return STATUS_NO_MEMORY;
if (!(directory = build_assembly_dir( ai )))
@@ -3336,7 +3193,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
wcscpy( p, ai->name );
p += wcslen(p);
- wcscpy( p, dotDllW );
+ wcscpy( p, L".dll" );
if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL ))
{
status = open_nt_file( &file, &nameW );
@@ -3351,7 +3208,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
RtlFreeUnicodeString( &nameW );
}
- wcscpy( p, dotManifestW );
+ wcscpy( p, L".manifest" );
if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL ))
{
status = open_nt_file( &file, &nameW );
@@ -3684,7 +3541,6 @@ static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT* actctx, struct strsec
struct entity *entity = &dll->entities.base[k];
if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
{
- static const WCHAR exclW[] = {'!',0};
ULONG versioned_len, module_len;
UNICODE_STRING str;
WCHAR *ptrW;
@@ -3733,7 +3589,7 @@ static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT* actctx, struct strsec
if (entity->u.class.versioned)
{
get_assembly_version(assembly, ptrW);
- wcscat(ptrW, exclW);
+ wcscat(ptrW, L"!");
wcscat(ptrW, entity->u.class.name);
}
else
@@ -4037,7 +3893,7 @@ static void get_comserver_datalen(const struct entity_array *entities, const str
*len += aligned_string_len(str_len*sizeof(WCHAR));
/* module name is forced to mscoree.dll, and stored two times with different case */
- *module_len += sizeof(mscoreeW) + sizeof(mscoree2W);
+ *module_len += sizeof(L"MSCOREE.DLL") + sizeof(L"mscoree.dll");
}
else
{
@@ -4076,7 +3932,7 @@ static void add_comserver_record(const struct guidsection_header *section, const
else
progid_len = 0;
- module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(mscoreeW)*sizeof(WCHAR);
+ module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(L"MSCOREE.DLL")*sizeof(WCHAR);
/* setup new index entry */
RtlInitUnicodeString(&str, entity->u.comclass.clsid);
@@ -4142,7 +3998,7 @@ static void add_comserver_record(const struct guidsection_header *section, const
clrdata->size = sizeof(*clrdata);
clrdata->res[0] = 0;
clrdata->res[1] = 2; /* FIXME: unknown field */
- clrdata->module_len = wcslen(mscoreeW)*sizeof(WCHAR);
+ clrdata->module_len = wcslen(L"MSCOREE.DLL")*sizeof(WCHAR);
clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR);
clrdata->name_len = wcslen(entity->u.comclass.name)*sizeof(WCHAR);
clrdata->name_offset = clrdata->size;
@@ -4155,11 +4011,11 @@ static void add_comserver_record(const struct guidsection_header *section, const
/* module name */
ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset);
- memcpy(ptrW, mscoree2W, clrdata->module_len);
+ memcpy(ptrW, L"mscoree.dll", clrdata->module_len);
ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
ptrW = (WCHAR*)((BYTE*)section + data->name_offset);
- memcpy(ptrW, mscoreeW, data->name_len);
+ memcpy(ptrW, L"MSCOREE.DLL", data->name_len);
ptrW[data->name_len/sizeof(WCHAR)] = 0;
/* class name */
--
2.26.2
Dec. 3, 2020
[PATCH 1/2] ntdll: Print the correct debug string and not a random global variable.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/ntdll/actctx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index b99d1655d22..faccd21d4b1 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -3533,7 +3533,7 @@ static struct string_index *find_string_index(const struct strsection_header *se
break;
}
else
- WARN("hash collision 0x%08x, %s, %s\n", hash, debugstr_us(name), debugstr_w(nameW));
+ WARN("hash collision 0x%08x, %s, %s\n", hash, debugstr_us(name), debugstr_us(&str));
}
iter++;
}
@@ -3794,7 +3794,7 @@ static NTSTATUS find_window_class(ACTIVATION_CONTEXT* actctx, const UNICODE_STRI
break;
}
else
- WARN("hash collision 0x%08x, %s, %s\n", hash, debugstr_us(name), debugstr_w(nameW));
+ WARN("hash collision 0x%08x, %s, %s\n", hash, debugstr_us(name), debugstr_us(&str));
}
iter++;
}
--
2.26.2
Dec. 3, 2020
Re: [PATCH 17/17] winegstreamer: Implement Get(Input/Output)CurrentType functions for color converter transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83080
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 16/17] winegstreamer: Implement Get*Attributes functions for color converter transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83079
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 15/17] winegstreamer: Implement ::Get(Input/Output)StreamInfo for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83078
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 14/17] winegstreamer: Implement ::ProcessMessage for color conversion MFT.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83077
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 13/17] winegstreamer: Implement ::Process(Input/Output) for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83076
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 12/17] winegstreamer: Implement ::SetOutputType for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83075
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 11/17] winegstreamer: Implement ::GetOutputAvailableType for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83074
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 10/17] winegstreamer: Implement ::SetInputType for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83073
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 09/17] winegstreamer: Implement ::GetInputAvailableType for color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83072
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 08/17] winegstreamer: Register the color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83071
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
error: patch failed: dlls/winegstreamer/mfplat.c:455
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 07/17] winegstreamer: Introduce color conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83070
Your paranoid android.
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
Task: Patch failed to apply
=== debiant (build log) ===
error: patch failed: dlls/winegstreamer/Makefile.in:7
error: patch failed: dlls/winegstreamer/gst_private.h:87
error: patch failed: dlls/winegstreamer/mfplat.c:407
error: patch failed: dlls/winegstreamer/winegstreamer_classes.idl:67
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 06/17] winegstreamer: Implement Get(Input/Output)CurrentType functions for audio converter transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83069
Your paranoid android.
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 05/17] winegstreamer: Implement Get*Attributes functions for audio converter transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83068
Your paranoid android.
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 04/17] winegstreamer: Implement ::Get(Input/Output)StreamInfo for audio conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83067
Your paranoid android.
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
Dec. 3, 2020
Re: [PATCH 03/17] winegstreamer: Implement ::Process(Input/Output) for audio conversion transform.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=83066
Your paranoid android.
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
Dec. 3, 2020