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
[RFC] Announcing Wayland driver development
by Alexandros Frantzis
Hi all,
For some time now I have been working on a Wayland driver for Wine, and
it has now reached a good enough state to present it to the wider
community. This driver allows users to run Windows GDI and OpenGL
applications directly on Wayland compositors without an intermediate
layer to translate from X11 to Wayland. This leads to a leaner and more
efficient stack.
The code currently resides at:
https://gitlab.collabora.com/alf/wine/-/commits/wayland
Get it with:
$ git clone -b wayland https://gitlab.collabora.com/alf/wine/
Configure with (you need the wayland-client and wayland-egl packages):
$ ./configure --with-wayland
To run, ensure there is a Wayland compositor running, unset DISPLAY (so
that Wayland is picked instead of X11) and set WAYLAND_DISPLAY (if
needed):
$ DISPLAY= WAYLAND_DISPLAY=wayland-0 ./wine ...
Here is video showcasing a few Windows applications running with the
Wayland driver on the Weston reference compositor:
https://youtu.be/br2b8gUy5n8
The Wayland protocol is by design more constrained compared to more
traditional display systems like X11. These constraints add some
special challenges in the integration of Wayland with Win32.
Since Wayland's window model is not based on a single flat 2D
co-ordinate space, as X11's was, the Wayland protocol doesn't allow
applications to control their absolute position on the screen. For Win32
transient windows (menus, tooltips, etc) the driver tries to work around
the lack of absolute positioning by "anchoring" them to an owning
Wayland surface and treating them as subsurfaces of that owner. Screen
coordinates for such windows are transformed to local coordinates
relative to the owning surface, allowing correct placement through
relative subsurface movement, which is supported by Wayland. By using
heuristics to select the proper owning surface, this approach has led to
very good results.
Absolute positioning of non-transient top level windows is not supported
at this time, and will likely require a (possibly controversial) Wayland
extension if it is to ever be pursued. The lack of absolute positioning
also has an adverse effect on input handling, when parts of windows
reside outside the visible windows display space, but are still full
accessible in the Wayland compositor display space (and thus the user).
Input events to such areas don't reach their intended coordinates (are
clamped to Windows display bounds) leaving the user mystified about why
they are unable to interact with a perfectly visible area in their
Wayland compositor. The current partial workaround is to force all
windows at (0,0) windows display coordinates, to maximize the area which
can be interacted with. With this workaround, and as long as windows
remain smaller than the display size, input works without issues.
Here what's supported at the moment (modulo bugs):
* GDI apps, including layered/translucent windows
* OpenGL apps
* Window resizing
* Maximized and fullscreen window states
* Mouse and keyboard (only QWERTY) input
* Mouse cursors
* Menus, tooltips, etc
* Single display
What needs more work (or is completely missing):
* Minimize
* Better z-order and activation handling
* Keyboard layout support
* Grabs
* GTK menu mouse handling bug (cannot click to select items)
* Multiple displays
* Vulkan. Note that that there is another effort at
https://github.com/varmd/wine-wayland/ focusing solely on vulkan.
My hope is that we will be able to share efforts going forward.
Programs I have tried and which are working well (again modulo bugs):
* Native Wine/Win32 apps (notepad, regedit etc)
* Supertuxkart
* 010Editor
* Firefox
* Stellarium
* Battle For Wesnoth
* GIMP (except clicking items in GTK menus as noted above)
* Unigine Valley
My first question to the Wine community is how complete the driver
should be before being considered for inclusion. Is the current Wayland
driver state enough? If there is interest, I was hoping to get the
driver in earlier rather than later, in an experimental capacity, in
order to provide a single, official point of development for people
wanting to contribute.
My second question is about the best way to move forward with
upstreaming. The code is currently split between just a few commits,
mostly as a result of the experimental nature of this effort, and also
because I used existing code from winex11 and wineandroid as my starting
point. I would like to split this into smaller commits to make it more
review-friendly for the mailing list. I was thinking of splitting by
user32 function (and internal dependencies), but since this is going to
be an artificial split, I am open to other ideas to make reviewers'
lives easier.
Looking forward to your feedback and questions!
Thanks,
Alexandros
Dec. 15, 2020
[PATCH vkd3d v2 2/2] vkd3d-shader: Move location tracking out of the vkd3d_shader_message_context structure.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
v2: Retain source names for shader_extract_from_dxbc().
I still think it's better and easier to get rid of the pointless "<anonymous>"
for signature parsing and compilation, but that functional change can be
reverted as well...
libs/vkd3d-shader/dxbc.c | 63 +++++++++++++-----------
libs/vkd3d-shader/spirv.c | 6 ++-
libs/vkd3d-shader/vkd3d_shader_main.c | 61 ++++++++++++-----------
libs/vkd3d-shader/vkd3d_shader_private.h | 19 ++++---
4 files changed, 83 insertions(+), 66 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c
index 9977d1a3..278912d8 100644
--- a/libs/vkd3d-shader/dxbc.c
+++ b/libs/vkd3d-shader/dxbc.c
@@ -2021,9 +2021,11 @@ static const char *shader_get_string(const char *data, size_t data_size, DWORD o
return data + offset;
}
-static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_message_context *message_context,
+static int parse_dxbc(const char *data, size_t data_size,
+ struct vkd3d_shader_message_context *message_context, const char *source_name,
int (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx)
{
+ const struct vkd3d_shader_location location = {.source_name = source_name};
uint32_t checksum[4], calculated_checksum[4];
const char *ptr = data;
int ret = VKD3D_OK;
@@ -2036,7 +2038,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (data_size < VKD3D_DXBC_HEADER_SIZE)
{
WARN("Invalid data size %zu.\n", data_size);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_SIZE,
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_SIZE,
"DXBC size %zu is smaller than the DXBC header size.", data_size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2047,7 +2049,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (tag != TAG_DXBC)
{
WARN("Wrong tag.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_MAGIC, "Invalid DXBC magic.");
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_MAGIC, "Invalid DXBC magic.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2063,7 +2065,8 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
checksum[0], checksum[1], checksum[2], checksum[3],
calculated_checksum[0], calculated_checksum[1],
calculated_checksum[2], calculated_checksum[3]);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHECKSUM, "Invalid DXBC checksum.");
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_CHECKSUM,
+ "Invalid DXBC checksum.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2072,7 +2075,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (version != 0x00000001)
{
WARN("Got unexpected DXBC version %#x.\n", version);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_VERSION,
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_VERSION,
"DXBC version %#x is not supported.", version);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2095,7 +2098,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size))
{
WARN("Invalid chunk offset %#x (data size %zu).\n", chunk_offset, data_size);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET,
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET,
"DXBC chunk %u has invalid offset %#x (data size %#zx).", i, chunk_offset, data_size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2109,7 +2112,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
{
WARN("Invalid chunk size %#x (data size %zu, chunk offset %#x).\n",
chunk_size, data_size, chunk_offset);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
+ vkd3d_shader_error(message_context, &location, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
"DXBC chunk %u has invalid size %#x (data size %#zx, chunk offset %#x).",
i, chunk_offset, data_size, chunk_offset);
return VKD3D_ERROR_INVALID_ARGUMENT;
@@ -2229,7 +2232,7 @@ int shader_parse_input_signature(const void *dxbc, size_t dxbc_length,
int ret;
memset(signature, 0, sizeof(*signature));
- if ((ret = parse_dxbc(dxbc, dxbc_length, message_context, isgn_handler, signature)) < 0)
+ if ((ret = parse_dxbc(dxbc, dxbc_length, message_context, NULL, isgn_handler, signature)) < 0)
ERR("Failed to parse input signature.\n");
return ret;
@@ -2304,7 +2307,7 @@ void free_shader_desc(struct vkd3d_shader_desc *desc)
}
int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length,
- struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_desc *desc)
+ struct vkd3d_shader_message_context *message_context, const char *source_name, struct vkd3d_shader_desc *desc)
{
int ret;
@@ -2314,7 +2317,7 @@ int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length,
memset(&desc->output_signature, 0, sizeof(desc->output_signature));
memset(&desc->patch_constant_signature, 0, sizeof(desc->patch_constant_signature));
- ret = parse_dxbc(dxbc, dxbc_length, message_context, shdr_handler, desc);
+ ret = parse_dxbc(dxbc, dxbc_length, message_context, source_name, shdr_handler, desc);
if (!desc->byte_code)
ret = VKD3D_ERROR_INVALID_ARGUMENT;
@@ -2781,9 +2784,9 @@ int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc,
memset(root_signature, 0, sizeof(*root_signature));
if (messages)
*messages = NULL;
- vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO);
- ret = parse_dxbc(dxbc->code, dxbc->size, &message_context, rts0_handler, root_signature);
+ ret = parse_dxbc(dxbc->code, dxbc->size, &message_context, NULL, rts0_handler, root_signature);
vkd3d_shader_message_context_trace_messages(&message_context);
if (!vkd3d_shader_message_context_copy_messages(&message_context, messages))
ret = VKD3D_ERROR_OUT_OF_MEMORY;
@@ -2935,7 +2938,7 @@ static int shader_write_root_signature_header(struct root_signature_writer_conte
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature header.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -2963,7 +2966,7 @@ static int shader_write_descriptor_ranges(struct root_signature_writer_context *
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature descriptor ranges.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -2993,7 +2996,7 @@ static int shader_write_descriptor_ranges1(struct root_signature_writer_context
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature descriptor ranges.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3009,7 +3012,7 @@ static int shader_write_descriptor_table(struct root_signature_writer_context *c
return shader_write_descriptor_ranges(context, table);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor table.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3025,7 +3028,7 @@ static int shader_write_descriptor_table1(struct root_signature_writer_context *
return shader_write_descriptor_ranges1(context, table);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor table.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3043,7 +3046,7 @@ static int shader_write_root_constants(struct root_signature_writer_context *con
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root constants.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3059,7 +3062,7 @@ static int shader_write_root_descriptor(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3077,7 +3080,7 @@ static int shader_write_root_descriptor1(struct root_signature_writer_context *c
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3126,7 +3129,7 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co
break;
default:
FIXME("Unrecognized type %#x.\n", versioned_root_signature_get_parameter_type(desc, i));
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE,
"Invalid/unrecognised root signature root parameter type %#x.",
versioned_root_signature_get_parameter_type(desc, i));
return VKD3D_ERROR_INVALID_ARGUMENT;
@@ -3139,7 +3142,7 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root parameters.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3183,7 +3186,7 @@ static int shader_write_static_samplers(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature static samplers.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3218,7 +3221,7 @@ static int shader_write_root_signature(struct root_signature_writer_context *con
return shader_write_static_samplers(context, desc);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3247,7 +3250,7 @@ static int validate_descriptor_table_v_1_0(const struct vkd3d_shader_root_descri
else
{
WARN("Invalid descriptor range type %#x.\n", r->range_type);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
"Invalid root signature descriptor range type %#x.", r->range_type);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3256,7 +3259,7 @@ static int validate_descriptor_table_v_1_0(const struct vkd3d_shader_root_descri
if (have_srv_uav_cbv && have_sampler)
{
WARN("Samplers cannot be mixed with CBVs/SRVs/UAVs in descriptor tables.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
"Encountered both CBV/SRV/UAV and sampler descriptor ranges in the same root descriptor table.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3288,7 +3291,7 @@ static int validate_descriptor_table_v_1_1(const struct vkd3d_shader_root_descri
else
{
WARN("Invalid descriptor range type %#x.\n", r->range_type);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
"Invalid root signature descriptor range type %#x.", r->range_type);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3297,7 +3300,7 @@ static int validate_descriptor_table_v_1_1(const struct vkd3d_shader_root_descri
if (have_srv_uav_cbv && have_sampler)
{
WARN("Samplers cannot be mixed with CBVs/SRVs/UAVs in descriptor tables.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
"Encountered both CBV/SRV/UAV and sampler descriptor ranges in the same root descriptor table.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3345,14 +3348,14 @@ int vkd3d_shader_serialize_root_signature(const struct vkd3d_shader_versioned_ro
*messages = NULL;
memset(&context, 0, sizeof(context));
- vkd3d_shader_message_context_init(&context.message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&context.message_context, VKD3D_SHADER_LOG_INFO);
if (root_signature->version != VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_0
&& root_signature->version != VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_1)
{
ret = VKD3D_ERROR_INVALID_ARGUMENT;
WARN("Root signature version %#x not supported.\n", root_signature->version);
- vkd3d_shader_error(&context.message_context, VKD3D_SHADER_ERROR_RS_INVALID_VERSION,
+ vkd3d_shader_error(&context.message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_VERSION,
"Root signature version %#x is not supported.", root_signature->version);
goto done;
}
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index cb9c7a12..61d0d472 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2155,6 +2155,7 @@ struct vkd3d_dxbc_compiler
struct vkd3d_spirv_builder spirv_builder;
struct vkd3d_shader_message_context *message_context;
+ struct vkd3d_shader_location location;
bool failed;
bool strip_debug;
@@ -2245,6 +2246,8 @@ struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader
memset(compiler, 0, sizeof(*compiler));
compiler->message_context = message_context;
+ compiler->location.source_name = compile_info->source_name;
+ compiler->location.line = 2; /* Line 1 is the version token. */
if ((target_info = vkd3d_find_struct(compile_info->next, SPIRV_TARGET_INFO)))
{
@@ -2452,7 +2455,7 @@ static void VKD3D_PRINTF_FUNC(3, 4) vkd3d_dxbc_compiler_error(struct vkd3d_dxbc_
va_list args;
va_start(args, format);
- vkd3d_shader_verror(compiler->message_context, error, format, args);
+ vkd3d_shader_verror(compiler->message_context, &compiler->location, error, format, args);
va_end(args);
compiler->failed = true;
}
@@ -9194,6 +9197,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler,
FIXME("Unhandled instruction %#x.\n", instruction->handler_idx);
}
+ ++compiler->location.line;
return ret;
}
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index 2ea233bb..173ff170 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -108,13 +108,9 @@ void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const
}
void vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context,
- enum vkd3d_shader_log_level log_level, const char *source_name)
+ enum vkd3d_shader_log_level log_level)
{
context->log_level = log_level;
- context->source_name = source_name ? source_name : "<anonymous>";
- context->line = 0;
- context->column = 0;
-
vkd3d_string_buffer_init(&context->messages);
}
@@ -148,28 +144,37 @@ bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_cont
return true;
}
-void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
enum vkd3d_shader_error error, const char *format, va_list args)
{
if (context->log_level < VKD3D_SHADER_LOG_ERROR)
return;
- if (context->line)
- vkd3d_string_buffer_printf(&context->messages, "%s:%u:%u: E%04u: ",
- context->source_name, context->line, context->column, error);
+ if (location)
+ {
+ const char *source_name = location->source_name ? location->source_name : "<anonymous>";
+
+ if (location->line)
+ vkd3d_string_buffer_printf(&context->messages, "%s:%u:%u: E%04u: ",
+ source_name, location->line, location->column, error);
+ else
+ vkd3d_string_buffer_printf(&context->messages, "%s: E%04u: ", source_name, error);
+ }
else
- vkd3d_string_buffer_printf(&context->messages, "%s: E%04u: ", context->source_name, error);
+ {
+ vkd3d_string_buffer_printf(&context->messages, "E%04u: ", error);
+ }
vkd3d_string_buffer_vprintf(&context->messages, format, args);
vkd3d_string_buffer_printf(&context->messages, "\n");
}
-void vkd3d_shader_error(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_error(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
enum vkd3d_shader_error error, const char *format, ...)
{
va_list args;
va_start(args, format);
- vkd3d_shader_verror(context, error, format, args);
+ vkd3d_shader_verror(context, location, error, format, args);
va_end(args);
}
@@ -222,12 +227,13 @@ struct vkd3d_shader_parser
};
static int vkd3d_shader_parser_init(struct vkd3d_shader_parser *parser,
- const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context)
+ const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
{
struct vkd3d_shader_desc *shader_desc = &parser->shader_desc;
int ret;
- if ((ret = shader_extract_from_dxbc(dxbc->code, dxbc->size, message_context, shader_desc)) < 0)
+ if ((ret = shader_extract_from_dxbc(compile_info->source.code, compile_info->source.size,
+ message_context, compile_info->source_name, shader_desc)) < 0)
{
WARN("Failed to extract shader, vkd3d result %d.\n", ret);
return ret;
@@ -307,6 +313,7 @@ struct vkd3d_shader_scan_context
size_t descriptors_size;
struct vkd3d_shader_message_context *message_context;
+ struct vkd3d_shader_location location;
struct vkd3d_shader_cf_info
{
@@ -332,12 +339,15 @@ struct vkd3d_shader_scan_context
};
static void vkd3d_shader_scan_context_init(struct vkd3d_shader_scan_context *context,
+ const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info,
struct vkd3d_shader_message_context *message_context)
{
memset(context, 0, sizeof(*context));
context->scan_descriptor_info = scan_descriptor_info;
context->message_context = message_context;
+ context->location.source_name = compile_info->source_name;
+ context->location.line = 2; /* Line 1 is the version token. */
}
static void vkd3d_shader_scan_context_cleanup(struct vkd3d_shader_scan_context *context)
@@ -606,7 +616,7 @@ static void vkd3d_shader_scan_error(struct vkd3d_shader_scan_context *context,
va_list args;
va_start(args, format);
- vkd3d_shader_verror(context->message_context, error, format, args);
+ vkd3d_shader_verror(context->message_context, &context->location, error, format, args);
va_end(args);
}
@@ -774,6 +784,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
if (vkd3d_shader_instruction_is_uav_counter(instruction))
vkd3d_shader_scan_record_uav_counter(context, &instruction->src[0].reg);
+ ++context->location.line;
return VKD3D_OK;
}
@@ -792,9 +803,9 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
scan_descriptor_info->descriptor_count = 0;
}
- vkd3d_shader_scan_context_init(&context, scan_descriptor_info, message_context);
+ vkd3d_shader_scan_context_init(&context, compile_info, scan_descriptor_info, message_context);
- if ((ret = vkd3d_shader_parser_init(&parser, &compile_info->source, message_context)) < 0)
+ if ((ret = vkd3d_shader_parser_init(&parser, compile_info, message_context)) < 0)
{
vkd3d_shader_scan_context_cleanup(&context);
return ret;
@@ -803,8 +814,6 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
if (TRACE_ON())
vkd3d_shader_trace(parser.data);
- message_context->line = 2; /* Line 1 is the version token. */
- message_context->column = 1;
while (!shader_sm4_is_end(parser.data, &parser.ptr))
{
shader_sm4_read_instruction(parser.data, &parser.ptr, &instruction);
@@ -824,7 +833,6 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
goto done;
}
- ++message_context->line;
}
ret = VKD3D_OK;
@@ -848,7 +856,7 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
if ((ret = vkd3d_shader_validate_compile_info(compile_info, true)) < 0)
return ret;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
ret = scan_dxbc(compile_info, &message_context);
@@ -877,7 +885,7 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
if ((ret = scan_dxbc(&scan_info, message_context)) < 0)
return ret;
- if ((ret = vkd3d_shader_parser_init(&parser, &compile_info->source, message_context)) < 0)
+ if ((ret = vkd3d_shader_parser_init(&parser, compile_info, message_context)) < 0)
{
vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info);
return ret;
@@ -902,8 +910,6 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
return VKD3D_ERROR;
}
- message_context->line = 2; /* Line 1 is the version token. */
- message_context->column = 1;
while (!shader_sm4_is_end(parser.data, &parser.ptr))
{
shader_sm4_read_instruction(parser.data, &parser.ptr, &instruction);
@@ -917,7 +923,6 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
if ((ret = vkd3d_dxbc_compiler_handle_instruction(spirv_compiler, &instruction)) < 0)
break;
- ++message_context->line;
}
if (ret >= 0)
@@ -949,7 +954,7 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info,
if ((ret = vkd3d_shader_validate_compile_info(compile_info, true)) < 0)
return ret;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
switch (compile_info->source_type)
{
@@ -1051,7 +1056,7 @@ int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
if (messages)
*messages = NULL;
- vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO);
ret = shader_parse_input_signature(dxbc->code, dxbc->size, &message_context, signature);
vkd3d_shader_message_context_trace_messages(&message_context);
@@ -1174,7 +1179,7 @@ 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;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
ret = preproc_lexer_parse(compile_info, out, &message_context);
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 83038384..e974b928 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -844,11 +844,15 @@ int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer,
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
+struct vkd3d_shader_location
{
- enum vkd3d_shader_log_level log_level;
const char *source_name;
unsigned int line, column;
+};
+
+struct vkd3d_shader_message_context
+{
+ enum vkd3d_shader_log_level log_level;
struct vkd3d_string_buffer messages;
};
@@ -856,18 +860,19 @@ void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *c
bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context,
char **out) DECLSPEC_HIDDEN;
void vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context,
- enum vkd3d_shader_log_level log_level, const char *source_name) DECLSPEC_HIDDEN;
+ enum vkd3d_shader_log_level log_level) DECLSPEC_HIDDEN;
void vkd3d_shader_message_context_trace_messages_(const struct vkd3d_shader_message_context *context,
const char *function) DECLSPEC_HIDDEN;
#define vkd3d_shader_message_context_trace_messages(context) \
vkd3d_shader_message_context_trace_messages_(context, __FUNCTION__)
-void vkd3d_shader_error(struct vkd3d_shader_message_context *context, enum vkd3d_shader_error error,
- const char *format, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN;
-void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_error(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
+ enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN;
+void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
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;
+ struct vkd3d_shader_message_context *message_context, const char *source_name,
+ struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN;
void free_shader_desc(struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN;
int shader_parse_input_signature(const void *dxbc, size_t dxbc_length,
--
2.29.2
Dec. 15, 2020
Re: [PATCH vkd3d 1/2] vkd3d-shader: Introduce a helper to report errors while scanning.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Dec. 15, 2020
Re: [PATCH vkd3d] build: Create object directories before running bison or flex.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Dec. 15, 2020
Re: [PATCH vkd3d 2/2] vkd3d-shader: Move location tracking out of the vkd3d_shader_message_context structure.
by Henri Verbeet
On Tue, 15 Dec 2020 at 08:19, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
>
> Includes a slight change in behaviour: parse_dxbc() and
> vkd3d_shader_serialize_root_signature() now print nothing instead of
> "<anonymous>".
>
It does a bit more than that. E.g., before this patch:
$ vkd3d-compiler -b d3d-asm invalid.dxbc
invalid.dxbc: E0003: Invalid DXBC checksum.
Failed to compile shader, ret -3.
After this patch, parse_dxbc() doesn't print source names at all.
Dec. 15, 2020
Re: TestBot news
by Francois Gouget
On Mon, 7 Dec 2020, Francois Gouget wrote:
[...]
> vm3 SSD
> -------
>
> The SSD of the vm3 host died last week so I moved its VMs to vm1 and
> vm4. That's part of why the TestBot was slow at the start of the week.
> The other reasons are:
[...]
> vm4's SSD is also on the brink of death according to smartctl so they'll
> both get new and bigger SSDs soon.
vm3 has a new SSD and is fully operational again. I moved the w1064 VM
back to it which will give a bit of breathing room to vm1.
vm4 also has a new SSD. It is also back on the 4.19 kernel + QEmu 3.1
[1] which matches the configuration of the other VM hosts . To do so I
had to change the pc-q35-5.0 machine to pc-q35-3.1 on w10pro64. As far
as I can tell this makes no difference to the guest.
I will certainly move back to QEmu 5.0 one day but for now it did not
seem to have any benefit. So sticking to QEmu 3.1 will avoid the "no
Spice client" audio bug [2] and avoid any issue when moving VMs created
on vm4 to the other hosts.
I also inadvertantly confirmed that the ntdll:exception crash is related
to the kernel version: it happens with 4.19.0-8 but not with 4.19.0-13.
Also this only impacts Windows 10: w7u never had any problem even with
4.19.0-8!
And while checking the WineTest results I noticed some getting this
error:
C:\Users\Public\Documents>winetest64-latest.exe -q -s exe64.report
The system cannot execute the specified program.
https://testbot.winehq.org/JobDetails.pl?Key=83433&f101=task.log#k101
https://testbot.winehq.org/JobDetails.pl?Key=83455&f101=task.log#k101
Yet Windows successfully ran WineTest just before. As far as I can tell
this only happens on Windows 10 so I suspect Windows Defender since it
does not seem possible to completely disable it on the recent versions.
But this is not systematic so it's going to be hard to confirm.
It also happened last week so it's not related to the latest vm3 and vm4
update.
[1] Instead of kernel 5.8 + QEmu 5.0
[2] https://www.winehq.org/pipermail/wine-devel/2020-November/177510.html
--
Francois Gouget <fgouget(a)codeweavers.com>
Dec. 15, 2020
[PATCH] po: Update Japanese translation.
by Akihiro Sagawa
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
po/ja.po | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
Dec. 15, 2020
[PATCH 2/2] wined3d: Avoid referencing empty command buffers in wined3d_query_event_vk_issue().
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
This fixes a deadlock in "Ryse: Son of Rome" when starting a new campaign.
dlls/wined3d/query.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 9e0e22b32e5..4670bbfddff 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1720,6 +1720,14 @@ static BOOL wined3d_query_event_vk_issue(struct wined3d_query *query, uint32_t f
{
context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0));
wined3d_context_vk_reference_query(context_vk, query_vk);
+ /* Because we don't actually submit any commands to the command buffer
+ * for event queries, the context's current command buffer may still
+ * be empty, and we should wait on the preceding command buffer
+ * instead. That's not merely an optimisation; if the command buffer
+ * referenced by the query is still empty by the time the application
+ * waits for it, that wait will never complete. */
+ if (!context_vk->current_command_buffer.vk_command_buffer)
+ --query_vk->command_buffer_id;
context_release(&context_vk->c);
return TRUE;
--
2.20.1
Dec. 15, 2020
[PATCH 1/2] wined3d: Zero-initialise context_vk in wined3d_context_vk_init().
by Henri Verbeet
wined3d_context_vk_init() assumes zero-initialised memory, but that's not
necessarily true in case we previously went through an
adapter_vk_init_3d()/adapter_vk_uninit_3d() pair.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
This fixes a crash on startup with the Vulkan backend in Batman: Arkham
Origins.
dlls/wined3d/context_vk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 9db363172f1..2d80c59ca32 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -3158,6 +3158,7 @@ HRESULT wined3d_context_vk_init(struct wined3d_context_vk *context_vk, struct wi
TRACE("context_vk %p, swapchain %p.\n", context_vk, swapchain);
+ memset(context_vk, 0, sizeof(*context_vk));
wined3d_context_init(&context_vk->c, swapchain);
device_vk = wined3d_device_vk(swapchain->device);
adapter_vk = wined3d_adapter_vk(device_vk->d.adapter);
--
2.20.1
Dec. 15, 2020
[PATCH v2 4/4] fonts: Correct default glyph index for MS Sans Serif font to match Windows.
by Dmitry Timoshkov
This one doesn't depend on previous patches in the sequence.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
fonts/ms_sans_serif.sfd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fonts/ms_sans_serif.sfd b/fonts/ms_sans_serif.sfd
index 751b35d064..e8c720b528 100644
--- a/fonts/ms_sans_serif.sfd
+++ b/fonts/ms_sans_serif.sfd
@@ -4,7 +4,7 @@ FullName: MS Sans Serif
FamilyName: MS Sans Serif
Weight: Medium
Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov
-UComments: "#pragma makedep font ssee1255.fon -d 129 13,1255,5 16,1255,7 20,1255,8+AAoA#pragma makedep font ssee1256.fon -d 129 13,1256,5 16,1256,7 20,1256,8+AAoA#pragma makedep font ssee1257.fon -d 129 13,1257,5 16,1257,7 20,1257,8+AAoA#pragma makedep font ssee874.fon -d 129 13,874,5 16,874,7 20,874,8+AAoA#pragma makedep font ssef1255.fon -d 129 -r 120 16,1255,7 20,1255,8+AAoA#pragma makedep font ssef1256.fon -d 129 -r 120 16,1256,7 20,1256,8+AAoA#pragma makedep font ssef1257.fon -d 129 -r 120 16,1257,7 20,1257,8+AAoA#pragma makedep font ssef874.fon -d 129 -r 120 16,874,7 20,874,8+AAoA#pragma makedep font sserife.fon -d 129 13,1252,5 16,1252,7 20,1252,8+AAoA#pragma makedep font sserifee.fon -d 129 13,1250,5 16,1250,7+AAoA#pragma makedep font sserifeg.fon -d 129 13,1253,5 16,1253,7 20,1253,8 +AAoA#pragma makedep font sserifer.fon -d 129 13,1251,5 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifet.fon -d 129 13,1254,5 16,1254,7 20,1254,8+AAoA#pragma makedep font sseriff.fon -d 129 -r 120 16,1252,7 20,1252,8+AAoA#pragma makedep font sseriffe.fon -d 129 -r 120 16,1250,7+AAoA#pragma makedep font sseriffg.fon -d 129 -r 120 16,1253,7 20,1253,8 +AAoA#pragma makedep font sseriffr.fon -d 129 -r 120 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifft.fon -d 129 -r 120 16,1254,7 20,1254,8"
+UComments: "#pragma makedep font ssee1255.fon -d 129 13,1255,5 16,1255,7 20,1255,8+AAoA#pragma makedep font ssee1256.fon -d 129 13,1256,5 16,1256,7 20,1256,8+AAoA#pragma makedep font ssee1257.fon -d 128 13,1257,5 16,1257,7 20,1257,8+AAoA#pragma makedep font ssee874.fon -d 129 13,874,5 16,874,7 20,874,8+AAoA#pragma makedep font ssef1255.fon -d 129 -r 120 16,1255,7 20,1255,8+AAoA#pragma makedep font ssef1256.fon -d 129 -r 120 16,1256,7 20,1256,8+AAoA#pragma makedep font ssef1257.fon -d 128 -r 120 16,1257,7 20,1257,8+AAoA#pragma makedep font ssef874.fon -d 129 -r 120 16,874,7 20,874,8+AAoA#pragma makedep font sserife.fon -d 129 13,1252,5 16,1252,7 20,1252,8+AAoA#pragma makedep font sserifee.fon -d 128 13,1250,5 16,1250,7+AAoA#pragma makedep font sserifeg.fon -d 129 13,1253,5 16,1253,7 20,1253,8 +AAoA#pragma makedep font sserifer.fon -d 127 13,1251,5 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifet.fon -d 129 13,1254,5 16,1254,7 20,1254,8+AAoA#pragma makedep font sseriff.fon -d 129 -r 120 16,1252,7 20,1252,8+AAoA#pragma makedep font sseriffe.fon -d 128 -r 120 16,1250,7+AAoA#pragma makedep font sseriffg.fon -d 129 -r 120 16,1253,7 20,1253,8 +AAoA#pragma makedep font sseriffr.fon -d 127 -r 120 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifft.fon -d 129 -r 120 16,1254,7 20,1254,8"
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -15753.8
--
2.29.2
Dec. 15, 2020
[PATCH v2 3/4] gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
by Dmitry Timoshkov
This part fixes drawing text.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/gdi32/font.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 9380d3efbe..850bbaab19 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -2910,11 +2910,11 @@ static UINT get_glyph_index( struct gdi_font *font, UINT glyph )
glyph = get_glyph_index_symbol( font, wc );
if (!glyph)
{
- if (WideCharToMultiByte( CP_ACP, 0, &wc, 1, &ch, 1, NULL, NULL ))
+ if (WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, NULL ))
glyph = get_glyph_index_symbol( font, (unsigned char)ch );
}
}
- else if (WideCharToMultiByte( font->codepage, 0, &wc, 1, &ch, 1, NULL, &used ) && !used)
+ else if (WideCharToMultiByte( font->codepage, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, &used ) && !used)
{
glyph = (unsigned char)ch;
font_funcs->get_glyph_index( font, &glyph, FALSE );
--
2.29.2
Dec. 15, 2020
[PATCH v2 2/4] gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
by Dmitry Timoshkov
This part fixes GetGlyphIndices.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/gdi32/font.c | 2 +-
dlls/gdi32/tests/font.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 00bbeb0a11..9380d3efbe 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -3223,7 +3223,7 @@ static DWORD CDECL font_GetGlyphIndices( PHYSDEV dev, const WCHAR *str, INT coun
if (str[i] >= 0xf020 && str[i] <= 0xf100) glyph = str[i] - 0xf000;
else if (str[i] < 0x100) glyph = str[i];
}
- else if (WideCharToMultiByte( physdev->font->codepage, 0, &str[i], 1,
+ else if (WideCharToMultiByte( physdev->font->codepage, WC_NO_BEST_FIT_CHARS, &str[i], 1,
&ch, 1, NULL, &used ) && !used)
glyph = (unsigned char)ch;
}
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index c630b65e5e..5eb069bf31 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1690,14 +1690,12 @@ static void test_GetGlyphIndices(void)
charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS);
ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]);
-todo_wine
ok(glyphs[1] == 0x001f || glyphs[1] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
glyphs[0] = glyphs[1] = 0;
charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, 0);
ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
ok(glyphs[0] == textm.tmDefaultChar || glyphs[0] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[0]);
-todo_wine
ok(glyphs[1] == textm.tmDefaultChar || glyphs[1] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[1]);
DeleteObject(SelectObject(hdc, hOldFont));
--
2.29.2
Dec. 15, 2020
[PATCH v2 1/4] gdi32/tests: Add some tests to show that GetGlyphIndices() should avoid best fit chars.
by Dmitry Timoshkov
v2: Fix test failures under CJK Windows versions.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/gdi32/tests/font.c | 41 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 86ccddd05e..c630b65e5e 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1634,6 +1634,7 @@ static void test_GetGlyphIndices(void)
LOGFONTA lf;
DWORD flags = 0;
WCHAR testtext[] = {'T','e','s','t',0xffff,0};
+ WCHAR c[] = { 0x25bc /* Black Down-Pointing Triangle */, 0x212a /* Kelvin Sign */ };
WORD glyphs[(sizeof(testtext)/2)-1];
TEXTMETRICA textm;
HFONT hOldFont;
@@ -1655,8 +1656,9 @@ static void test_GetGlyphIndices(void)
lf.lfCharSet = ANSI_CHARSET;
hfont = CreateFontIndirectA(&lf);
- ok(hfont != 0, "CreateFontIndirectEx failed\n");
- ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n");
+ ok(hfont != 0, "CreateFontIndirect failed\n");
+ hOldFont = SelectObject(hdc, hfont);
+ ok(GetTextMetricsA(hdc, &textm), "GetTextMetrics failed\n");
if (textm.tmCharSet == ANSI_CHARSET)
{
flags |= GGI_MARK_NONEXISTING_GLYPHS;
@@ -1666,16 +1668,44 @@ static void test_GetGlyphIndices(void)
flags = 0;
charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags);
ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount);
- ok(glyphs[4] == textm.tmDefaultChar, "GetGlyphIndicesW should have returned a %04x not %04x\n",
- textm.tmDefaultChar, glyphs[4]);
+ ok(glyphs[4] == textm.tmDefaultChar || glyphs[4] == 0x20 /* CJK Windows */,
+ "GetGlyphIndicesW should have returned a %04x not %04x\n", textm.tmDefaultChar, glyphs[4]);
}
else
/* FIXME: Write tests for non-ANSI charsets. */
skip("GetGlyphIndices System font tests only for ANSI_CHARSET\n");
+ DeleteObject(SelectObject(hdc, hOldFont));
+
+ memset(&lf, 0, sizeof(lf));
+ strcpy(lf.lfFaceName, "MS Sans Serif");
+ lf.lfHeight = -13;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ hfont = CreateFontIndirectA(&lf);
+ ok(hfont != 0, "CreateFontIndirect failed\n");
+ hOldFont = SelectObject(hdc, hfont);
+ ok(GetTextMetricsA(hdc, &textm), "GetTextMetrics failed\n");
+
+ glyphs[0] = glyphs[1] = 0;
+ charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS);
+ ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
+ ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]);
+todo_wine
+ ok(glyphs[1] == 0x001f || glyphs[1] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
+
+ glyphs[0] = glyphs[1] = 0;
+ charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, 0);
+ ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
+ ok(glyphs[0] == textm.tmDefaultChar || glyphs[0] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[0]);
+todo_wine
+ ok(glyphs[1] == textm.tmDefaultChar || glyphs[1] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[1]);
+
+ DeleteObject(SelectObject(hdc, hOldFont));
+
if(!is_font_installed("Tahoma"))
{
skip("Tahoma is not installed so skipping this test\n");
+ ReleaseDC(0, hdc);
return;
}
memset(&lf, 0, sizeof(lf));
@@ -1720,12 +1750,13 @@ static void test_GetGlyphIndices(void)
ok(glyphs[4] == 0, "GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]);
DeleteObject(SelectObject(hdc, hOldFont));
+ ReleaseDC(0, hdc);
+
ret = pRemoveFontMemResourceEx(rsrc);
ok(ret, "RemoveFontMemResourceEx error %d\n", GetLastError());
free_font(font);
ret = DeleteFileA(ttf_name);
ok(ret, "Failed to delete font file, %d.\n", GetLastError());
-
}
static void test_GetKerningPairs(void)
--
2.29.2
Dec. 15, 2020
[PATCH v3 2/2] ntdll: Save unwind information in KiUserApcDispatcher() on x64.
by Paul Gofman
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v2:
- fix build for other archs.
dlls/ntdll/tests/exception.c | 53 +++++++++++++++++++++++++++++++++
dlls/ntdll/thread.c | 28 ++++++++++++++++-
dlls/ntdll/unix/signal_x86_64.c | 23 ++++++++++++--
3 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 5686e39ab9e..3a0a5ac049c 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -37,6 +37,8 @@ static void *code_mem;
static NTSTATUS (WINAPI *pNtGetContextThread)(HANDLE,CONTEXT*);
static NTSTATUS (WINAPI *pNtSetContextThread)(HANDLE,CONTEXT*);
+static NTSTATUS (WINAPI *pNtQueueApcThread)(HANDLE handle, PNTAPCFUNC func,
+ ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3);
static NTSTATUS (WINAPI *pRtlRaiseException)(EXCEPTION_RECORD *rec);
static PVOID (WINAPI *pRtlUnwind)(PVOID, PVOID, PEXCEPTION_RECORD, PVOID);
static VOID (WINAPI *pRtlCaptureContext)(CONTEXT*);
@@ -4061,6 +4063,55 @@ static void test_nested_exception(void)
ok(got_prev_frame_exception, "Did not get nested exception in the previous frame.\n");
}
+static CONTEXT test_unwind_apc_context;
+static BOOL test_unwind_apc_called;
+
+static void CALLBACK test_unwind_apc(ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3)
+{
+ EXCEPTION_RECORD rec;
+
+ test_unwind_apc_called = TRUE;
+ memset(&rec, 0, sizeof(rec));
+ pRtlUnwind((void *)test_unwind_apc_context.Rsp, (void *)test_unwind_apc_context.Rip, &rec, (void *)0xdeadbeef);
+ ok(0, "Should not get here.\n");
+}
+
+static void test_unwind_from_apc(void)
+{
+ NTSTATUS status;
+ int pass;
+
+ if (!pNtQueueApcThread)
+ {
+ win_skip("NtQueueApcThread is not available.\n");
+ return;
+ }
+
+ pass = 0;
+ InterlockedIncrement(&pass);
+ RtlCaptureContext(&test_unwind_apc_context);
+ InterlockedIncrement(&pass);
+
+ if (pass == 2)
+ {
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ SleepEx(0, TRUE);
+ ok(0, "Should not get here.\n");
+ }
+ if (pass == 3)
+ {
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ NtContinue(&test_unwind_apc_context, TRUE );
+ ok(0, "Should not get here.\n");
+ }
+ ok(pass == 4, "Got unexpected pass %d.\n", pass);
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+}
#elif defined(__arm__)
static void test_thread_context(void)
@@ -8073,6 +8124,7 @@ START_TEST(exception)
#define X(f) p##f = (void*)GetProcAddress(hntdll, #f)
X(NtGetContextThread);
X(NtSetContextThread);
+ X(NtQueueApcThread);
X(NtReadVirtualMemory);
X(NtClose);
X(RtlUnwind);
@@ -8241,6 +8293,7 @@ START_TEST(exception)
skip( "Dynamic unwind functions not found\n" );
test_extended_context();
test_copy_context();
+ test_unwind_from_apc();
#elif defined(__aarch64__)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 578c7a5436c..5bf456ec040 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -78,7 +78,7 @@ int __cdecl __wine_dbg_output( const char *str )
/*******************************************************************
* KiUserApcDispatcher (NTDLL.@)
*/
-void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+void WINAPI dispatch_apc( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
PNTAPCFUNC func )
{
func( ctx, arg1, arg2 );
@@ -86,6 +86,32 @@ void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1
}
+#ifdef __x86_64__
+__ASM_GLOBAL_FUNC( KiUserApcDispatcher,
+ "addq $0x8,%rsp\n\t"
+ "mov 0x98(%rcx),%r10\n\t" /* context->Rsp */
+ "mov 0xf8(%rcx),%r11\n\t" /* context->Rip */
+ "mov %r11,-0x8(%r10)\n\t"
+ "mov %rbp,-0x10(%r10)\n\t"
+ "lea -0x10(%r10),%rbp\n\t"
+ __ASM_SEH(".seh_pushreg %rbp\n\t")
+ __ASM_SEH(".seh_setframe %rbp,0\n\t")
+ __ASM_SEH(".seh_endprologue\n\t")
+ __ASM_CFI(".cfi_signal_frame\n\t")
+ __ASM_CFI(".cfi_adjust_cfa_offset 0x10\n\t")
+ __ASM_CFI(".cfi_def_cfa %rbp,0x10\n\t")
+ __ASM_CFI(".cfi_rel_offset %rip,0x8\n\t")
+ __ASM_CFI(".cfi_rel_offset %rbp,0\n\t")
+ "call " __ASM_NAME("dispatch_apc") "\n\t"
+ "int3")
+#else
+void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+ PNTAPCFUNC func )
+{
+ dispatch_apc( context, ctx, arg1, arg2, func );
+}
+#endif
+
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 0fc7ad69584..290e275a86e 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2077,9 +2077,28 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq %r14,%r9\n" /* arg2 */
"movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
- "movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
+ "movq %rdi,%r10\n\t"
+ /* Set nonvolatile regs from context. */
+ "movq 0xa0(%rcx),%rbp\n\t"
+ "movq 0x90(%rcx),%rbx\n\t"
+ "movq 0xa8(%rcx),%rsi\n\t"
+ "movq 0xb0(%rcx),%rdi\n\t"
+ "movq 0xd8(%rcx),%r12\n\t"
+ "movq 0xe0(%rcx),%r13\n\t"
+ "movq 0xe8(%rcx),%r14\n\t"
+ "movq 0xf0(%rcx),%r15\n\t"
+ "movdqa 0x200(%rcx),%xmm6\n\t"
+ "movdqa 0x210(%rcx),%xmm7\n\t"
+ "movdqa 0x220(%rcx),%xmm8\n\t"
+ "movdqa 0x230(%rcx),%xmm9\n\t"
+ "movdqa 0x240(%rcx),%xmm10\n\t"
+ "movdqa 0x250(%rcx),%xmm11\n\t"
+ "movdqa 0x260(%rcx),%xmm12\n\t"
+ "movdqa 0x270(%rcx),%xmm13\n\t"
+ "movdqa 0x280(%rcx),%xmm14\n\t"
+ "movdqa 0x290(%rcx),%xmm15\n\t"
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
- "jmp *%rdi" )
+ "jmp *%r10" )
/***********************************************************************
--
2.29.2
Dec. 15, 2020
[PATCH v3 1/2] ntdll: Always copy context in call_user_apc_dispatcher() on x64.
by Paul Gofman
Currently, if call_user_apc_dispatcher() is called with nonzero context,
there is no guarantee that the provided context is stored above the
rsp = context_ptr->Rsp - (sizeof(CONTEXT) + offsetof(frame,ret_addr))
being set.
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v3:
- properly align / reserve stack for setup_user_apc_dispatcher_stack() call.
dlls/ntdll/unix/signal_x86_64.c | 62 +++++++++++++++++++++++++--------
1 file changed, 48 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 359f2d7c361..0fc7ad69584 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -254,6 +254,22 @@ C_ASSERT((offsetof(struct stack_layout, xstate) == sizeof(struct stack_layout)))
C_ASSERT( sizeof(XSTATE) == 0x140 );
C_ASSERT( sizeof(struct stack_layout) == 0x5b0 ); /* Should match the size in call_user_exception_dispatcher(). */
+/* stack layout when calling an user apc function.
+ * FIXME: match Windows ABI. */
+struct apc_stack_layout
+{
+ ULONG64 save_regs[4];
+ void *func;
+ ULONG64 align;
+ CONTEXT context;
+ ULONG64 rbp;
+ ULONG64 rip;
+};
+
+/* Should match size and offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof(struct apc_stack_layout, context) == 0x30 );
+C_ASSERT( sizeof(struct apc_stack_layout) == 0x510 );
+
struct syscall_frame
{
ULONG64 xmm[10 * 2]; /* xmm6-xmm15 */
@@ -270,6 +286,9 @@ struct syscall_frame
ULONG64 ret_addr;
};
+/* Should match the offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof( struct syscall_frame, ret_addr ) == 0xf0);
+
struct amd64_thread_data
{
DWORD_PTR dr0; /* 02f0 debug registers */
@@ -2017,31 +2036,46 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec )
/***********************************************************************
* call_user_apc_dispatcher
*/
+struct apc_stack_layout * WINAPI setup_user_apc_dispatcher_stack( CONTEXT *context, struct apc_stack_layout *stack )
+{
+ CONTEXT c;
+
+ if (!context)
+ {
+ c.ContextFlags = CONTEXT_FULL;
+ NtGetContextThread( GetCurrentThread(), &c );
+ context = &c;
+ }
+ memmove( &stack->context, context, sizeof(stack->context) );
+ return stack;
+}
+
__ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq 0x28(%rsp),%rsi\n\t" /* func */
"movq 0x30(%rsp),%rdi\n\t" /* dispatcher */
"movq %gs:0x30,%rbx\n\t"
- "jrcxz 1f\n\t"
- "movq 0x98(%rcx),%rax\n\t" /* context_ptr->Rsp */
- "leaq -0x5c0(%rax),%rsp\n\t" /* sizeof(CONTEXT) + offsetof(frame,ret_addr) */
- "andq $~15,%rsp\n\t"
- "jmp 2f\n"
- "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
- "leaq -0x4d0(%rax),%rsp\n\t"
- "andq $~15,%rsp\n\t"
"movq %rdx,%r12\n\t" /* ctx */
"movq %r8,%r13\n\t" /* arg1 */
"movq %r9,%r14\n\t" /* arg2 */
- "movq %rsp,%rdx\n\t" /* context */
- "movl $0x10000b,0x30(%rdx)\n\t" /* context.ContextFlags */
- "movq $~1,%rcx\n\t"
- "call " __ASM_NAME("NtGetContextThread") "\n\t"
- "movq %rsp,%rcx\n\t" /* context */
+ "jrcxz 1f\n\t"
+ "movq 0x98(%rcx),%rdx\n\t" /* context->Rsp */
+ "jmp 2f\n\t"
+ "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
+ "leaq 0xf0(%rax),%rdx\n\t" /* &amd64_thread_data()->syscall_frame->ret_addr */
+ "2:\tsubq $0x510,%rdx\n\t" /* sizeof(struct apc_stack_layout) */
+ "andq $~0xf,%rdx\n\t"
+ "addq $8,%rsp\n\t" /* pop return address */
+ "cmpq %rsp,%rdx\n\t"
+ "cmovbq %rdx,%rsp\n\t"
+ "subq $0x20,%rsp\n\t"
+ "call " __ASM_NAME("setup_user_apc_dispatcher_stack") "\n\t"
+ "movq %rax,%rsp\n\t"
+ "leaq 0x30(%rsp),%rcx\n\t" /* context */
"movq $0xc0,0x78(%rcx)\n\t" /* context.Rax = STATUS_USER_APC */
"movq %r12,%rdx\n\t" /* ctx */
"movq %r13,%r8\n\t" /* arg1 */
"movq %r14,%r9\n" /* arg2 */
- "2:\tmovq $0,0x328(%rbx)\n\t"
+ "movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
"movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
--
2.29.2
Dec. 15, 2020
Re: [PATCH 2/3] gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
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=83438
Your paranoid android.
=== w10pro64_ja (64 bit report) ===
gdi32:
font.c:1671: Test failed: GetGlyphIndicesW should have returned a 0081 not 0020
font.c:1698: Test failed: got 0x20
font.c:1700: Test failed: got 0x20
=== w10pro64_zh_CN (64 bit report) ===
gdi32:
font.c:1698: Test failed: got 0x20
font.c:1700: Test failed: got 0x20
Dec. 15, 2020
Re: [PATCH 1/3] gdi32/tests: Add some tests to show that GetGlyphIndices() should avoid best fit chars.
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=83437
Your paranoid android.
=== w10pro64_ja (64 bit report) ===
gdi32:
font.c:1671: Test failed: GetGlyphIndicesW should have returned a 0081 not 0020
font.c:1700: Test failed: got 0x20
font.c:1702: Test failed: got 0x20
=== w10pro64_zh_CN (64 bit report) ===
gdi32:
font.c:1700: Test failed: got 0x20
font.c:1702: Test failed: got 0x20
Dec. 15, 2020
Dec. 15, 2020
Dec. 15, 2020
Dec. 15, 2020
[PATCH 3/3] fonts: Correct default glyph index for MS Sans Serif font to match Windows.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
fonts/ms_sans_serif.sfd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fonts/ms_sans_serif.sfd b/fonts/ms_sans_serif.sfd
index 751b35d064..e8c720b528 100644
--- a/fonts/ms_sans_serif.sfd
+++ b/fonts/ms_sans_serif.sfd
@@ -4,7 +4,7 @@ FullName: MS Sans Serif
FamilyName: MS Sans Serif
Weight: Medium
Copyright: Copyright (C) 2004 Huw D M Davies, Dmitry Timoshkov
-UComments: "#pragma makedep font ssee1255.fon -d 129 13,1255,5 16,1255,7 20,1255,8+AAoA#pragma makedep font ssee1256.fon -d 129 13,1256,5 16,1256,7 20,1256,8+AAoA#pragma makedep font ssee1257.fon -d 129 13,1257,5 16,1257,7 20,1257,8+AAoA#pragma makedep font ssee874.fon -d 129 13,874,5 16,874,7 20,874,8+AAoA#pragma makedep font ssef1255.fon -d 129 -r 120 16,1255,7 20,1255,8+AAoA#pragma makedep font ssef1256.fon -d 129 -r 120 16,1256,7 20,1256,8+AAoA#pragma makedep font ssef1257.fon -d 129 -r 120 16,1257,7 20,1257,8+AAoA#pragma makedep font ssef874.fon -d 129 -r 120 16,874,7 20,874,8+AAoA#pragma makedep font sserife.fon -d 129 13,1252,5 16,1252,7 20,1252,8+AAoA#pragma makedep font sserifee.fon -d 129 13,1250,5 16,1250,7+AAoA#pragma makedep font sserifeg.fon -d 129 13,1253,5 16,1253,7 20,1253,8 +AAoA#pragma makedep font sserifer.fon -d 129 13,1251,5 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifet.fon -d 129 13,1254,5 16,1254,7 20,1254,8+AAoA#pragma makedep font sseriff.fon -d 129 -r 120 16,1252,7 20,1252,8+AAoA#pragma makedep font sseriffe.fon -d 129 -r 120 16,1250,7+AAoA#pragma makedep font sseriffg.fon -d 129 -r 120 16,1253,7 20,1253,8 +AAoA#pragma makedep font sseriffr.fon -d 129 -r 120 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifft.fon -d 129 -r 120 16,1254,7 20,1254,8"
+UComments: "#pragma makedep font ssee1255.fon -d 129 13,1255,5 16,1255,7 20,1255,8+AAoA#pragma makedep font ssee1256.fon -d 129 13,1256,5 16,1256,7 20,1256,8+AAoA#pragma makedep font ssee1257.fon -d 128 13,1257,5 16,1257,7 20,1257,8+AAoA#pragma makedep font ssee874.fon -d 129 13,874,5 16,874,7 20,874,8+AAoA#pragma makedep font ssef1255.fon -d 129 -r 120 16,1255,7 20,1255,8+AAoA#pragma makedep font ssef1256.fon -d 129 -r 120 16,1256,7 20,1256,8+AAoA#pragma makedep font ssef1257.fon -d 128 -r 120 16,1257,7 20,1257,8+AAoA#pragma makedep font ssef874.fon -d 129 -r 120 16,874,7 20,874,8+AAoA#pragma makedep font sserife.fon -d 129 13,1252,5 16,1252,7 20,1252,8+AAoA#pragma makedep font sserifee.fon -d 128 13,1250,5 16,1250,7+AAoA#pragma makedep font sserifeg.fon -d 129 13,1253,5 16,1253,7 20,1253,8 +AAoA#pragma makedep font sserifer.fon -d 127 13,1251,5 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifet.fon -d 129 13,1254,5 16,1254,7 20,1254,8+AAoA#pragma makedep font sseriff.fon -d 129 -r 120 16,1252,7 20,1252,8+AAoA#pragma makedep font sseriffe.fon -d 128 -r 120 16,1250,7+AAoA#pragma makedep font sseriffg.fon -d 129 -r 120 16,1253,7 20,1253,8 +AAoA#pragma makedep font sseriffr.fon -d 127 -r 120 16,1251,7 20,1251,8+AAoA#pragma makedep font sserifft.fon -d 129 -r 120 16,1254,7 20,1254,8"
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -15753.8
--
2.29.2
Dec. 15, 2020
[PATCH 2/3] gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/gdi32/font.c | 4 ++--
dlls/gdi32/tests/font.c | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 00bbeb0a11..b8ba4258e9 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -2910,11 +2910,11 @@ static UINT get_glyph_index( struct gdi_font *font, UINT glyph )
glyph = get_glyph_index_symbol( font, wc );
if (!glyph)
{
- if (WideCharToMultiByte( CP_ACP, 0, &wc, 1, &ch, 1, NULL, NULL ))
+ if (WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, NULL ))
glyph = get_glyph_index_symbol( font, (unsigned char)ch );
}
}
- else if (WideCharToMultiByte( font->codepage, 0, &wc, 1, &ch, 1, NULL, &used ) && !used)
+ else if (WideCharToMultiByte( font->codepage, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, &used ) && !used)
{
glyph = (unsigned char)ch;
font_funcs->get_glyph_index( font, &glyph, FALSE );
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index dde41b501a..f6d2a49c91 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1689,9 +1689,7 @@ static void test_GetGlyphIndices(void)
glyphs[0] = glyphs[1] = 0;
charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS);
ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
-todo_wine
ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]);
-todo_wine
ok(glyphs[1] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
glyphs[0] = glyphs[1] = 0;
--
2.29.2
Dec. 15, 2020
[PATCH 1/3] gdi32/tests: Add some tests to show that GetGlyphIndices() should avoid best fit chars.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/gdi32/tests/font.c | 38 +++++++++++++++++++++++++++++++++++---
1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 86ccddd05e..dde41b501a 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1634,6 +1634,7 @@ static void test_GetGlyphIndices(void)
LOGFONTA lf;
DWORD flags = 0;
WCHAR testtext[] = {'T','e','s','t',0xffff,0};
+ WCHAR c[] = { 0x25bc /* Black Down-Pointing Triangle */, 0x212a /* Kelvin Sign */ };
WORD glyphs[(sizeof(testtext)/2)-1];
TEXTMETRICA textm;
HFONT hOldFont;
@@ -1655,8 +1656,9 @@ static void test_GetGlyphIndices(void)
lf.lfCharSet = ANSI_CHARSET;
hfont = CreateFontIndirectA(&lf);
- ok(hfont != 0, "CreateFontIndirectEx failed\n");
- ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n");
+ ok(hfont != 0, "CreateFontIndirect failed\n");
+ hOldFont = SelectObject(hdc, hfont);
+ ok(GetTextMetricsA(hdc, &textm), "GetTextMetrics failed\n");
if (textm.tmCharSet == ANSI_CHARSET)
{
flags |= GGI_MARK_NONEXISTING_GLYPHS;
@@ -1673,9 +1675,38 @@ static void test_GetGlyphIndices(void)
/* FIXME: Write tests for non-ANSI charsets. */
skip("GetGlyphIndices System font tests only for ANSI_CHARSET\n");
+ DeleteObject(SelectObject(hdc, hOldFont));
+
+ memset(&lf, 0, sizeof(lf));
+ strcpy(lf.lfFaceName, "MS Sans Serif");
+ lf.lfHeight = -13;
+ lf.lfCharSet = DEFAULT_CHARSET;
+ hfont = CreateFontIndirectA(&lf);
+ ok(hfont != 0, "CreateFontIndirect failed\n");
+ hOldFont = SelectObject(hdc, hfont);
+ ok(GetTextMetricsA(hdc, &textm), "GetTextMetrics failed\n");
+
+ glyphs[0] = glyphs[1] = 0;
+ charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS);
+ ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
+todo_wine
+ ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]);
+todo_wine
+ ok(glyphs[1] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
+
+ glyphs[0] = glyphs[1] = 0;
+ charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, 0);
+ ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
+ ok(glyphs[0] == textm.tmDefaultChar, "got %#x\n", glyphs[0]);
+todo_wine
+ ok(glyphs[1] == textm.tmDefaultChar, "got %#x\n", glyphs[1]);
+
+ DeleteObject(SelectObject(hdc, hOldFont));
+
if(!is_font_installed("Tahoma"))
{
skip("Tahoma is not installed so skipping this test\n");
+ ReleaseDC(0, hdc);
return;
}
memset(&lf, 0, sizeof(lf));
@@ -1720,12 +1751,13 @@ static void test_GetGlyphIndices(void)
ok(glyphs[4] == 0, "GetGlyphIndicesW should have returned 0 not %04x\n", glyphs[4]);
DeleteObject(SelectObject(hdc, hOldFont));
+ ReleaseDC(0, hdc);
+
ret = pRemoveFontMemResourceEx(rsrc);
ok(ret, "RemoveFontMemResourceEx error %d\n", GetLastError());
free_font(font);
ret = DeleteFileA(ttf_name);
ok(ret, "Failed to delete font file, %d.\n", GetLastError());
-
}
static void test_GetKerningPairs(void)
--
2.29.2
Dec. 15, 2020
[PATCH] po: Update Simplified Chinese translation.
by Jactry Zeng
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
po/zh_CN.po | 228 ++++++++++++++++------------------------------------
1 file changed, 70 insertions(+), 158 deletions(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index ae0d24b32c6..14771308488 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -5,14 +5,14 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2019-06-04 19:24-0600\n"
-"Last-Translator: Zixing Liu <liushuyu011(a)gmail.com>\n"
+"PO-Revision-Date: 2020-12-15 16:24+0800\n"
+"Last-Translator: Jactry Zeng <jzeng(a)codeweavers.com>\n"
"Language-Team: Chinese (PRC)\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.2.1\n"
+"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: dlls/appwiz.cpl/appwiz.rc:58
@@ -3686,7 +3686,7 @@ msgstr "游戏控制器"
#: dlls/joy.cpl/joy.rc:32
msgid "Test and configure game controllers."
-msgstr ""
+msgstr "测试和配置游戏控制器。"
#: dlls/jscript/jscript.rc:28
msgid "Error converting object to primitive type"
@@ -3701,10 +3701,8 @@ msgid "Subscript out of range"
msgstr "标记越界"
#: dlls/jscript/jscript.rc:31
-#, fuzzy
-#| msgid "Out of paper; "
msgid "Out of stack space"
-msgstr "缺纸;"
+msgstr "堆栈空间不足"
#: dlls/jscript/jscript.rc:32
msgid "Object required"
@@ -3843,16 +3841,12 @@ msgid "JScript object expected"
msgstr "期望得到 JScript 对象"
#: dlls/jscript/jscript.rc:63
-#, fuzzy
-#| msgid "Array object expected"
msgid "Enumerator object expected"
-msgstr "期望得到 Array 对象"
+msgstr "期望得到枚举器对象"
#: dlls/jscript/jscript.rc:64
-#, fuzzy
-#| msgid "Boolean object expected"
msgid "Regular Expression object expected"
-msgstr "期望得到布尔型对象"
+msgstr "期望得到正则表达式对象"
#: dlls/jscript/jscript.rc:65
msgid "Syntax error in regular expression"
@@ -6874,32 +6868,24 @@ msgid "Connection reset by peer.\n"
msgstr "连接被重置。\n"
#: dlls/kernel32/winerror.mc:3767
-#, fuzzy
-#| msgid "Not implemented"
msgid "Not implemented.\n"
-msgstr "尚未实现"
+msgstr "尚未实现。\n"
#: dlls/kernel32/winerror.mc:3788
-#, fuzzy
-#| msgid "RPC call failed.\n"
msgid "Call failed.\n"
-msgstr "RPC 调用失败。\n"
+msgstr "调用失败。\n"
#: dlls/kernel32/winerror.mc:3760
msgid "No Signature found in file.\n"
msgstr "未在文件内找到签名。\n"
#: dlls/kernel32/winerror.mc:3774
-#, fuzzy
-#| msgid "Invalid level.\n"
msgid "Invalid call.\n"
-msgstr "无效的级别。\n"
+msgstr "无效调用。\n"
#: dlls/kernel32/winerror.mc:3781
-#, fuzzy
-#| msgid "Value is not available.\n"
msgid "Resource is not currently available.\n"
-msgstr "值不可用。\n"
+msgstr "资源当前不可用。\n"
#: dlls/localspl/localspl.rc:31 dlls/localui/localui.rc:31
#: dlls/winspool.drv/winspool.rc:30
@@ -9838,16 +9824,12 @@ msgid "Iran Daylight Time"
msgstr "伊朗夏令时"
#: dlls/tzres/tzres.rc:204
-#, fuzzy
-#| msgid "Haiti Standard Time"
msgid "Saint Pierre Standard Time"
-msgstr "海地标准时间"
+msgstr "圣皮埃尔标准时间"
#: dlls/tzres/tzres.rc:205
-#, fuzzy
-#| msgid "Haiti Daylight Time"
msgid "Saint Pierre Daylight Time"
-msgstr "海地夏令时"
+msgstr "圣皮埃尔夏令时"
#: dlls/tzres/tzres.rc:170
msgid "Namibia Standard Time"
@@ -9890,16 +9872,12 @@ msgid "Central Asia Daylight Time"
msgstr "中亚夏令时"
#: dlls/tzres/tzres.rc:146
-#, fuzzy
-#| msgid "Korea Standard Time"
msgid "Lord Howe Standard Time"
-msgstr "韩国标准时间"
+msgstr "豪勋爵标准时间"
#: dlls/tzres/tzres.rc:147
-#, fuzzy
-#| msgid "Korea Daylight Time"
msgid "Lord Howe Daylight Time"
-msgstr "韩国夏令时"
+msgstr "豪勋爵夏令时"
#: dlls/tzres/tzres.rc:40
msgid "Arabic Standard Time"
@@ -9950,16 +9928,12 @@ msgid "Azerbaijan Daylight Time"
msgstr "阿塞拜疆夏令时"
#: dlls/tzres/tzres.rc:150
-#, fuzzy
-#| msgid "Magadan Standard Time"
msgid "Magallanes Standard Time"
-msgstr "马加丹标准时间"
+msgstr "麦哲伦标准时间"
#: dlls/tzres/tzres.rc:151
-#, fuzzy
-#| msgid "Magadan Daylight Time"
msgid "Magallanes Daylight Time"
-msgstr "马加丹夏令时"
+msgstr "麦哲伦夏令时"
#: dlls/tzres/tzres.rc:206
msgid "Samoa Standard Time"
@@ -10010,16 +9984,12 @@ msgid "Line Islands Daylight Time"
msgstr "莱恩群岛夏令时"
#: dlls/tzres/tzres.rc:92
-#, fuzzy
-#| msgid "China Standard Time"
msgid "Cuba Standard Time"
-msgstr "中国标准时间"
+msgstr "古巴标准时间"
#: dlls/tzres/tzres.rc:93
-#, fuzzy
-#| msgid "China Daylight Time"
msgid "Cuba Daylight Time"
-msgstr "中国夏令时"
+msgstr "古巴夏令时"
#: dlls/tzres/tzres.rc:136
msgid "Jordan Standard Time"
@@ -10218,16 +10188,12 @@ msgid "US Eastern Daylight Time"
msgstr "美国东部夏令时"
#: dlls/tzres/tzres.rc:182
-#, fuzzy
-#| msgid "Korea Standard Time"
msgid "North Korea Standard Time"
-msgstr "韩国标准时间"
+msgstr "朝鲜标准时间"
#: dlls/tzres/tzres.rc:183
-#, fuzzy
-#| msgid "Korea Daylight Time"
msgid "North Korea Daylight Time"
-msgstr "韩国夏令时"
+msgstr "朝鲜夏令时"
#: dlls/tzres/tzres.rc:220
msgid "Tasmania Standard Time"
@@ -10318,16 +10284,12 @@ msgid "Arabian Daylight Time"
msgstr "阿拉伯夏令时"
#: dlls/tzres/tzres.rc:222
-#, fuzzy
-#| msgid "Mountain Standard Time"
msgid "Tocantins Standard Time"
-msgstr "山地标准时间"
+msgstr "托坎廷斯标准时间"
#: dlls/tzres/tzres.rc:223
-#, fuzzy
-#| msgid "Mountain Daylight Time"
msgid "Tocantins Daylight Time"
-msgstr "山地夏令时"
+msgstr "托坎廷斯夏令时"
#: dlls/tzres/tzres.rc:196
msgid "Russian Standard Time"
@@ -10338,16 +10300,12 @@ msgid "Russian Daylight Time"
msgstr "俄罗斯夏令时"
#: dlls/tzres/tzres.rc:48
-#, fuzzy
-#| msgid "AUS Central Standard Time"
msgid "Aus Central W. Standard Time"
-msgstr "澳大利亚中部标准时间"
+msgstr "澳大利亚中西部标准时间"
#: dlls/tzres/tzres.rc:49
-#, fuzzy
-#| msgid "AUS Central Daylight Time"
msgid "Aus Central W. Daylight Time"
-msgstr "澳大利亚中部夏令时"
+msgstr "澳大利亚中西部夏令时"
#: dlls/tzres/tzres.rc:194
msgid "Romance Standard Time"
@@ -10566,16 +10524,12 @@ msgid "Egypt Daylight Time"
msgstr "埃及夏令时"
#: dlls/tzres/tzres.rc:106
-#, fuzzy
-#| msgid "Central Standard Time (Mexico)"
msgid "Eastern Standard Time (Mexico)"
-msgstr "中部标准时间(墨西哥)"
+msgstr "东部标准时间(墨西哥)"
#: dlls/tzres/tzres.rc:107
-#, fuzzy
-#| msgid "Central Daylight Time (Mexico)"
msgid "Eastern Daylight Time (Mexico)"
-msgstr "中部夏令时(墨西哥)"
+msgstr "东部夏令时(墨西哥)"
#: dlls/tzres/tzres.rc:154
msgid "Mauritius Standard Time"
@@ -10780,153 +10734,115 @@ msgstr "更多窗口(&M)..."
#: dlls/vbscript/vbscript.rc:30
msgid "Overflow"
-msgstr ""
+msgstr "溢出"
#: dlls/vbscript/vbscript.rc:31
-#, fuzzy
-#| msgid "Out of memory."
msgid "Out of memory"
-msgstr "内存不足。"
+msgstr "内存不足"
#: dlls/vbscript/vbscript.rc:33
msgid "This array is fixed or temporarily locked"
-msgstr ""
+msgstr "该数组为固定数组或已被临时锁定"
#: dlls/vbscript/vbscript.rc:34
-#, fuzzy
-#| msgid "Data type mismatch.\n"
msgid "Type mismatch"
-msgstr "数据类型不匹配。\n"
+msgstr "类型不匹配"
#: dlls/vbscript/vbscript.rc:36
-#, fuzzy
-#| msgid "I/O device error.\n"
msgid "Device I/O error"
-msgstr "I/O 设备错误。\n"
+msgstr "设备 I/O 错误"
#: dlls/vbscript/vbscript.rc:37
-#, fuzzy
-#| msgid "File already exists.\n"
msgid "File already exists"
-msgstr "文件已存在。\n"
+msgstr "文件已存在"
#: dlls/vbscript/vbscript.rc:38
-#, fuzzy
-#| msgid "Disk full.\n"
msgid "Disk full"
-msgstr "磁盘满。\n"
+msgstr "磁盘已满"
#: dlls/vbscript/vbscript.rc:39
-#, fuzzy
-#| msgid "Too many open files.\n"
msgid "Too many files"
-msgstr "太多打开的文件。\n"
+msgstr "太多文件"
#: dlls/vbscript/vbscript.rc:40
-#, fuzzy
-#| msgid "Access denied.\n"
msgid "Permission denied"
-msgstr "访问被拒绝。\n"
+msgstr "没有权限"
#: dlls/vbscript/vbscript.rc:41
msgid "Path/File access error"
-msgstr ""
+msgstr "路径/文件访问出错"
#: dlls/vbscript/vbscript.rc:42
-#, fuzzy
-#| msgid "Path not found.\n"
msgid "Path not found"
-msgstr "找不到路径。\n"
+msgstr "找不到路径"
#: dlls/vbscript/vbscript.rc:43
-#, fuzzy
-#| msgid "(value not set)"
msgid "Object variable not set"
-msgstr "(没有设值)"
+msgstr "未设置对象变量"
#: dlls/vbscript/vbscript.rc:44
-#, fuzzy
-#| msgid "Invalid user buffer.\n"
msgid "Invalid use of Null"
-msgstr "用户缓冲区无效。\n"
+msgstr "Null 使用无效"
#: dlls/vbscript/vbscript.rc:45
msgid "Can't create necessary temporary file"
-msgstr ""
+msgstr "无法创建必要的临时文件"
#: dlls/vbscript/vbscript.rc:46
-#, fuzzy
-#| msgid "Automation server can't create object"
msgid "ActiveX component can't create object"
-msgstr "自动化服务器无法创建对象"
+msgstr "ActiveX 组件无法创建对象"
#: dlls/vbscript/vbscript.rc:47
-#, fuzzy
-#| msgid "Object doesn't support this action"
msgid "Class doesn't support Automation"
-msgstr "对象不支持此动作"
+msgstr "类不支持自动化"
#: dlls/vbscript/vbscript.rc:48
msgid "File name or class name not found during Automation operation"
-msgstr ""
+msgstr "自动化操作期间无法找到文件名或类名"
#: dlls/vbscript/vbscript.rc:51
-#, fuzzy
-#| msgid "Object doesn't support this action"
msgid "Object doesn't support named arguments"
-msgstr "对象不支持此动作"
+msgstr "对象不支持命名参数"
#: dlls/vbscript/vbscript.rc:52
-#, fuzzy
-#| msgid "Object doesn't support this action"
msgid "Object doesn't support current locale setting"
-msgstr "对象不支持此动作"
+msgstr "对象不支持当前 locale 设置"
#: dlls/vbscript/vbscript.rc:53 dlls/vbscript/vbscript.rc:54
-#, fuzzy
-#| msgid "Element not found.\n"
msgid "Named argument not found"
-msgstr "找不到元素。\n"
+msgstr "未找到命名参数"
#: dlls/vbscript/vbscript.rc:55
msgid "Wrong number of arguments or invalid property assignment"
-msgstr ""
+msgstr "参数数量错误或无效的指定属性"
#: dlls/vbscript/vbscript.rc:56
-#, fuzzy
-#| msgid "Object Class Violation"
msgid "Object not a collection"
-msgstr "对象类冲突"
+msgstr "对象不是集合"
#: dlls/vbscript/vbscript.rc:57
-#, fuzzy
-#| msgid "Specified control was not found in message"
msgid "Specified DLL function not found"
-msgstr "消息中找不到指定的控制"
+msgstr "未找到指定的 DLL 函数"
#: dlls/vbscript/vbscript.rc:58
msgid "Variable uses an Automation type not supported in VBScript"
-msgstr ""
+msgstr "变量使用了 VBScript 中不支持的自动化类型"
#: dlls/vbscript/vbscript.rc:59
msgid "The remote server machine does not exist or is unavailable"
-msgstr ""
+msgstr "远程服务器不存在或不可用"
#: dlls/vbscript/vbscript.rc:60
msgid "Invalid or unqualified reference"
-msgstr ""
+msgstr "无效或不合格引用"
#: dlls/vbscript/vbscript.rc:62
-#, fuzzy
-#| msgid "Microsoft JScript compilation error"
msgid "Microsoft VBScript compilation error"
-msgstr "Microsoft JScript 编译错误"
+msgstr "Microsoft VBScript 编译错误"
#: dlls/vbscript/vbscript.rc:63
-#, fuzzy
-#| msgid "Microsoft JScript runtime error"
msgid "Microsoft VBScript runtime error"
-msgstr "Microsoft JScript 运行时错误"
+msgstr "Microsoft VBScript 运行时错误"
#: dlls/winemac.drv/winemac.rc:33
msgid "Hide %@"
@@ -11023,33 +10939,27 @@ msgstr "证书至少带有一个不明安全问题。"
#: dlls/wininet/wininet.rc:35
msgid "Effective Date"
-msgstr ""
+msgstr "生效日期"
#: dlls/wininet/wininet.rc:37
-#, fuzzy
-#| msgid "Security"
msgid "Security Protocol"
-msgstr "安全"
+msgstr "安全协议"
#: dlls/wininet/wininet.rc:38
-#, fuzzy
-#| msgid "Signature"
msgid "Signature Type"
-msgstr "签名"
+msgstr "签名类型"
#: dlls/wininet/wininet.rc:39
-#, fuzzy
-#| msgid "Encrypting File System"
msgid "Encryption Type"
-msgstr "正在加密文件系統"
+msgstr "加密类型"
#: dlls/wininet/wininet.rc:40
msgid "Privacy Strength"
-msgstr ""
+msgstr "隐私级别"
#: dlls/wininet/wininet.rc:43
msgid "bits"
-msgstr ""
+msgstr "bits"
#: dlls/wininet/winineterror.mc:26
msgid "The request has timed out.\n"
@@ -12937,6 +12847,9 @@ msgid ""
"\n"
"hardlink hardlink management\n"
msgstr ""
+"- 支持命令 -\n"
+"\n"
+"hardlink 硬链接管理\n"
#: programs/fsutil/fsutil.mc:35
msgid ""
@@ -12944,10 +12857,13 @@ msgid ""
"\n"
"create create a hardlink\n"
msgstr ""
+"- Hardlink - 支持命令 -\n"
+"\n"
+"create 创建硬链接\n"
#: programs/fsutil/fsutil.mc:40
msgid "Syntax: fsutil hardlink create <new> <existing>\n"
-msgstr ""
+msgstr "语法:fsutil hardlink create <new> <existing>\n"
#: programs/hostname/hostname.rc:30
msgid "Usage: hostname\n"
@@ -16713,10 +16629,8 @@ msgid "&Beginner"
msgstr "初学者(&B)"
#: programs/winemine/winemine.rc:45
-#, fuzzy
-#| msgid "Interface"
msgid "&Intermediate"
-msgstr "接口"
+msgstr "&中等"
#: programs/winemine/winemine.rc:46
msgid "&Expert"
@@ -16747,10 +16661,8 @@ msgid "Beginner"
msgstr "初学者"
#: programs/winemine/winemine.rc:65
-#, fuzzy
-#| msgid "Interface"
msgid "Intermediate"
-msgstr "接口"
+msgstr "中等"
#: programs/winemine/winemine.rc:66
msgid "Expert"
--
2.29.2
Dec. 15, 2020
Re: [PATCH] qcap/tests: Use wide-char string literals.
by Zebediah Figura (she/her)
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Dec. 15, 2020
[PATCH vkd3d 2/2] vkd3d-shader: Move location tracking out of the vkd3d_shader_message_context structure.
by Zebediah Figura
Includes a slight change in behaviour: parse_dxbc() and
vkd3d_shader_serialize_root_signature() now print nothing instead of
"<anonymous>".
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/dxbc.c | 50 ++++++++++++------------
libs/vkd3d-shader/spirv.c | 6 ++-
libs/vkd3d-shader/vkd3d_shader_main.c | 41 +++++++++----------
libs/vkd3d-shader/vkd3d_shader_private.h | 16 +++++---
4 files changed, 58 insertions(+), 55 deletions(-)
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c
index 9977d1a3..df9245de 100644
--- a/libs/vkd3d-shader/dxbc.c
+++ b/libs/vkd3d-shader/dxbc.c
@@ -2036,7 +2036,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (data_size < VKD3D_DXBC_HEADER_SIZE)
{
WARN("Invalid data size %zu.\n", data_size);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_SIZE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_SIZE,
"DXBC size %zu is smaller than the DXBC header size.", data_size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2047,7 +2047,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (tag != TAG_DXBC)
{
WARN("Wrong tag.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_MAGIC, "Invalid DXBC magic.");
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_MAGIC, "Invalid DXBC magic.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2063,7 +2063,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
checksum[0], checksum[1], checksum[2], checksum[3],
calculated_checksum[0], calculated_checksum[1],
calculated_checksum[2], calculated_checksum[3]);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHECKSUM, "Invalid DXBC checksum.");
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_CHECKSUM, "Invalid DXBC checksum.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2072,7 +2072,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (version != 0x00000001)
{
WARN("Got unexpected DXBC version %#x.\n", version);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_VERSION,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_VERSION,
"DXBC version %#x is not supported.", version);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2095,7 +2095,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
if (chunk_offset >= data_size || !require_space(chunk_offset, 2, sizeof(DWORD), data_size))
{
WARN("Invalid chunk offset %#x (data size %zu).\n", chunk_offset, data_size);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_OFFSET,
"DXBC chunk %u has invalid offset %#x (data size %#zx).", i, chunk_offset, data_size);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -2109,7 +2109,7 @@ static int parse_dxbc(const char *data, size_t data_size, struct vkd3d_shader_me
{
WARN("Invalid chunk size %#x (data size %zu, chunk offset %#x).\n",
chunk_size, data_size, chunk_offset);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_DXBC_INVALID_CHUNK_SIZE,
"DXBC chunk %u has invalid size %#x (data size %#zx, chunk offset %#x).",
i, chunk_offset, data_size, chunk_offset);
return VKD3D_ERROR_INVALID_ARGUMENT;
@@ -2781,7 +2781,7 @@ int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc,
memset(root_signature, 0, sizeof(*root_signature));
if (messages)
*messages = NULL;
- vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO);
ret = parse_dxbc(dxbc->code, dxbc->size, &message_context, rts0_handler, root_signature);
vkd3d_shader_message_context_trace_messages(&message_context);
@@ -2935,7 +2935,7 @@ static int shader_write_root_signature_header(struct root_signature_writer_conte
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature header.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -2963,7 +2963,7 @@ static int shader_write_descriptor_ranges(struct root_signature_writer_context *
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature descriptor ranges.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -2993,7 +2993,7 @@ static int shader_write_descriptor_ranges1(struct root_signature_writer_context
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature descriptor ranges.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3009,7 +3009,7 @@ static int shader_write_descriptor_table(struct root_signature_writer_context *c
return shader_write_descriptor_ranges(context, table);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor table.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3025,7 +3025,7 @@ static int shader_write_descriptor_table1(struct root_signature_writer_context *
return shader_write_descriptor_ranges1(context, table);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor table.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3043,7 +3043,7 @@ static int shader_write_root_constants(struct root_signature_writer_context *con
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root constants.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3059,7 +3059,7 @@ static int shader_write_root_descriptor(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3077,7 +3077,7 @@ static int shader_write_root_descriptor1(struct root_signature_writer_context *c
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root descriptor.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3126,7 +3126,7 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co
break;
default:
FIXME("Unrecognized type %#x.\n", versioned_root_signature_get_parameter_type(desc, i));
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_ROOT_PARAMETER_TYPE,
"Invalid/unrecognised root signature root parameter type %#x.",
versioned_root_signature_get_parameter_type(desc, i));
return VKD3D_ERROR_INVALID_ARGUMENT;
@@ -3139,7 +3139,7 @@ static int shader_write_root_parameters(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature root parameters.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3183,7 +3183,7 @@ static int shader_write_static_samplers(struct root_signature_writer_context *co
return VKD3D_OK;
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature static samplers.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3218,7 +3218,7 @@ static int shader_write_root_signature(struct root_signature_writer_context *con
return shader_write_static_samplers(context, desc);
fail:
- vkd3d_shader_error(&context->message_context, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
+ vkd3d_shader_error(&context->message_context, NULL, VKD3D_SHADER_ERROR_RS_OUT_OF_MEMORY,
"Out of memory while writing root signature.");
return VKD3D_ERROR_OUT_OF_MEMORY;
}
@@ -3247,7 +3247,7 @@ static int validate_descriptor_table_v_1_0(const struct vkd3d_shader_root_descri
else
{
WARN("Invalid descriptor range type %#x.\n", r->range_type);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
"Invalid root signature descriptor range type %#x.", r->range_type);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3256,7 +3256,7 @@ static int validate_descriptor_table_v_1_0(const struct vkd3d_shader_root_descri
if (have_srv_uav_cbv && have_sampler)
{
WARN("Samplers cannot be mixed with CBVs/SRVs/UAVs in descriptor tables.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
"Encountered both CBV/SRV/UAV and sampler descriptor ranges in the same root descriptor table.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3288,7 +3288,7 @@ static int validate_descriptor_table_v_1_1(const struct vkd3d_shader_root_descri
else
{
WARN("Invalid descriptor range type %#x.\n", r->range_type);
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_DESCRIPTOR_RANGE_TYPE,
"Invalid root signature descriptor range type %#x.", r->range_type);
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3297,7 +3297,7 @@ static int validate_descriptor_table_v_1_1(const struct vkd3d_shader_root_descri
if (have_srv_uav_cbv && have_sampler)
{
WARN("Samplers cannot be mixed with CBVs/SRVs/UAVs in descriptor tables.\n");
- vkd3d_shader_error(message_context, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
+ vkd3d_shader_error(message_context, NULL, VKD3D_SHADER_ERROR_RS_MIXED_DESCRIPTOR_RANGE_TYPES,
"Encountered both CBV/SRV/UAV and sampler descriptor ranges in the same root descriptor table.");
return VKD3D_ERROR_INVALID_ARGUMENT;
}
@@ -3345,14 +3345,14 @@ int vkd3d_shader_serialize_root_signature(const struct vkd3d_shader_versioned_ro
*messages = NULL;
memset(&context, 0, sizeof(context));
- vkd3d_shader_message_context_init(&context.message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&context.message_context, VKD3D_SHADER_LOG_INFO);
if (root_signature->version != VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_0
&& root_signature->version != VKD3D_SHADER_ROOT_SIGNATURE_VERSION_1_1)
{
ret = VKD3D_ERROR_INVALID_ARGUMENT;
WARN("Root signature version %#x not supported.\n", root_signature->version);
- vkd3d_shader_error(&context.message_context, VKD3D_SHADER_ERROR_RS_INVALID_VERSION,
+ vkd3d_shader_error(&context.message_context, NULL, VKD3D_SHADER_ERROR_RS_INVALID_VERSION,
"Root signature version %#x is not supported.", root_signature->version);
goto done;
}
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index cb9c7a12..61d0d472 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2155,6 +2155,7 @@ struct vkd3d_dxbc_compiler
struct vkd3d_spirv_builder spirv_builder;
struct vkd3d_shader_message_context *message_context;
+ struct vkd3d_shader_location location;
bool failed;
bool strip_debug;
@@ -2245,6 +2246,8 @@ struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader
memset(compiler, 0, sizeof(*compiler));
compiler->message_context = message_context;
+ compiler->location.source_name = compile_info->source_name;
+ compiler->location.line = 2; /* Line 1 is the version token. */
if ((target_info = vkd3d_find_struct(compile_info->next, SPIRV_TARGET_INFO)))
{
@@ -2452,7 +2455,7 @@ static void VKD3D_PRINTF_FUNC(3, 4) vkd3d_dxbc_compiler_error(struct vkd3d_dxbc_
va_list args;
va_start(args, format);
- vkd3d_shader_verror(compiler->message_context, error, format, args);
+ vkd3d_shader_verror(compiler->message_context, &compiler->location, error, format, args);
va_end(args);
compiler->failed = true;
}
@@ -9194,6 +9197,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler,
FIXME("Unhandled instruction %#x.\n", instruction->handler_idx);
}
+ ++compiler->location.line;
return ret;
}
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index 2ea233bb..53e22789 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -108,13 +108,9 @@ void vkd3d_string_buffer_trace_(const struct vkd3d_string_buffer *buffer, const
}
void vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context,
- enum vkd3d_shader_log_level log_level, const char *source_name)
+ enum vkd3d_shader_log_level log_level)
{
context->log_level = log_level;
- context->source_name = source_name ? source_name : "<anonymous>";
- context->line = 0;
- context->column = 0;
-
vkd3d_string_buffer_init(&context->messages);
}
@@ -148,28 +144,28 @@ bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_cont
return true;
}
-void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
enum vkd3d_shader_error error, const char *format, va_list args)
{
if (context->log_level < VKD3D_SHADER_LOG_ERROR)
return;
- if (context->line)
+ if (location)
vkd3d_string_buffer_printf(&context->messages, "%s:%u:%u: E%04u: ",
- context->source_name, context->line, context->column, error);
+ location->source_name ? location->source_name : "<anonymous>", location->line, location->column, error);
else
- vkd3d_string_buffer_printf(&context->messages, "%s: E%04u: ", context->source_name, error);
+ vkd3d_string_buffer_printf(&context->messages, "E%04u: ", error);
vkd3d_string_buffer_vprintf(&context->messages, format, args);
vkd3d_string_buffer_printf(&context->messages, "\n");
}
-void vkd3d_shader_error(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_error(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
enum vkd3d_shader_error error, const char *format, ...)
{
va_list args;
va_start(args, format);
- vkd3d_shader_verror(context, error, format, args);
+ vkd3d_shader_verror(context, location, error, format, args);
va_end(args);
}
@@ -307,6 +303,7 @@ struct vkd3d_shader_scan_context
size_t descriptors_size;
struct vkd3d_shader_message_context *message_context;
+ struct vkd3d_shader_location location;
struct vkd3d_shader_cf_info
{
@@ -332,12 +329,15 @@ struct vkd3d_shader_scan_context
};
static void vkd3d_shader_scan_context_init(struct vkd3d_shader_scan_context *context,
+ const struct vkd3d_shader_compile_info *compile_info,
struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info,
struct vkd3d_shader_message_context *message_context)
{
memset(context, 0, sizeof(*context));
context->scan_descriptor_info = scan_descriptor_info;
context->message_context = message_context;
+ context->location.source_name = compile_info->source_name;
+ context->location.line = 2; /* Line 1 is the version token. */
}
static void vkd3d_shader_scan_context_cleanup(struct vkd3d_shader_scan_context *context)
@@ -606,7 +606,7 @@ static void vkd3d_shader_scan_error(struct vkd3d_shader_scan_context *context,
va_list args;
va_start(args, format);
- vkd3d_shader_verror(context->message_context, error, format, args);
+ vkd3d_shader_verror(context->message_context, &context->location, error, format, args);
va_end(args);
}
@@ -774,6 +774,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
if (vkd3d_shader_instruction_is_uav_counter(instruction))
vkd3d_shader_scan_record_uav_counter(context, &instruction->src[0].reg);
+ ++context->location.line;
return VKD3D_OK;
}
@@ -792,7 +793,7 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
scan_descriptor_info->descriptor_count = 0;
}
- vkd3d_shader_scan_context_init(&context, scan_descriptor_info, message_context);
+ vkd3d_shader_scan_context_init(&context, compile_info, scan_descriptor_info, message_context);
if ((ret = vkd3d_shader_parser_init(&parser, &compile_info->source, message_context)) < 0)
{
@@ -803,8 +804,6 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
if (TRACE_ON())
vkd3d_shader_trace(parser.data);
- message_context->line = 2; /* Line 1 is the version token. */
- message_context->column = 1;
while (!shader_sm4_is_end(parser.data, &parser.ptr))
{
shader_sm4_read_instruction(parser.data, &parser.ptr, &instruction);
@@ -824,7 +823,6 @@ static int scan_dxbc(const struct vkd3d_shader_compile_info *compile_info,
vkd3d_shader_free_scan_descriptor_info(scan_descriptor_info);
goto done;
}
- ++message_context->line;
}
ret = VKD3D_OK;
@@ -848,7 +846,7 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
if ((ret = vkd3d_shader_validate_compile_info(compile_info, true)) < 0)
return ret;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
ret = scan_dxbc(compile_info, &message_context);
@@ -902,8 +900,6 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
return VKD3D_ERROR;
}
- message_context->line = 2; /* Line 1 is the version token. */
- message_context->column = 1;
while (!shader_sm4_is_end(parser.data, &parser.ptr))
{
shader_sm4_read_instruction(parser.data, &parser.ptr, &instruction);
@@ -917,7 +913,6 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info
if ((ret = vkd3d_dxbc_compiler_handle_instruction(spirv_compiler, &instruction)) < 0)
break;
- ++message_context->line;
}
if (ret >= 0)
@@ -949,7 +944,7 @@ int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info,
if ((ret = vkd3d_shader_validate_compile_info(compile_info, true)) < 0)
return ret;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
switch (compile_info->source_type)
{
@@ -1051,7 +1046,7 @@ int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
if (messages)
*messages = NULL;
- vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO, NULL);
+ vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO);
ret = shader_parse_input_signature(dxbc->code, dxbc->size, &message_context, signature);
vkd3d_shader_message_context_trace_messages(&message_context);
@@ -1174,7 +1169,7 @@ 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;
- vkd3d_shader_message_context_init(&message_context, compile_info->log_level, compile_info->source_name);
+ vkd3d_shader_message_context_init(&message_context, compile_info->log_level);
ret = preproc_lexer_parse(compile_info, out, &message_context);
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 83038384..7b0e0fc0 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -844,11 +844,15 @@ int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer,
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
+struct vkd3d_shader_location
{
- enum vkd3d_shader_log_level log_level;
const char *source_name;
unsigned int line, column;
+};
+
+struct vkd3d_shader_message_context
+{
+ enum vkd3d_shader_log_level log_level;
struct vkd3d_string_buffer messages;
};
@@ -856,14 +860,14 @@ void vkd3d_shader_message_context_cleanup(struct vkd3d_shader_message_context *c
bool vkd3d_shader_message_context_copy_messages(struct vkd3d_shader_message_context *context,
char **out) DECLSPEC_HIDDEN;
void vkd3d_shader_message_context_init(struct vkd3d_shader_message_context *context,
- enum vkd3d_shader_log_level log_level, const char *source_name) DECLSPEC_HIDDEN;
+ enum vkd3d_shader_log_level log_level) DECLSPEC_HIDDEN;
void vkd3d_shader_message_context_trace_messages_(const struct vkd3d_shader_message_context *context,
const char *function) DECLSPEC_HIDDEN;
#define vkd3d_shader_message_context_trace_messages(context) \
vkd3d_shader_message_context_trace_messages_(context, __FUNCTION__)
-void vkd3d_shader_error(struct vkd3d_shader_message_context *context, enum vkd3d_shader_error error,
- const char *format, ...) VKD3D_PRINTF_FUNC(3, 4) DECLSPEC_HIDDEN;
-void vkd3d_shader_verror(struct vkd3d_shader_message_context *context,
+void vkd3d_shader_error(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
+ enum vkd3d_shader_error error, const char *format, ...) VKD3D_PRINTF_FUNC(4, 5) DECLSPEC_HIDDEN;
+void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location,
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,
--
2.29.2
Dec. 15, 2020
[PATCH vkd3d 1/2] vkd3d-shader: Introduce a helper to report errors while scanning.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
libs/vkd3d-shader/vkd3d_shader_main.c | 32 ++++++++++++++++++---------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c
index eed0316c..2ea233bb 100644
--- a/libs/vkd3d-shader/vkd3d_shader_main.c
+++ b/libs/vkd3d-shader/vkd3d_shader_main.c
@@ -600,6 +600,16 @@ static void vkd3d_shader_scan_typed_resource_declaration(struct vkd3d_shader_sca
semantic->resource_type, resource_data_type);
}
+static void vkd3d_shader_scan_error(struct vkd3d_shader_scan_context *context,
+ enum vkd3d_shader_error error, const char *format, ...)
+{
+ va_list args;
+
+ va_start(args, format);
+ vkd3d_shader_verror(context->message_context, error, format, args);
+ va_end(args);
+}
+
static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *context,
const struct vkd3d_shader_instruction *instruction)
{
@@ -636,7 +646,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_ELSE:
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context)) || cf_info->type != VKD3D_SHADER_BLOCK_IF)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘else’ instruction without corresponding ‘if’ block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -645,7 +655,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_ENDIF:
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context)) || cf_info->type != VKD3D_SHADER_BLOCK_IF)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘endif’ instruction without corresponding ‘if’ block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -658,7 +668,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_ENDLOOP:
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context)) || cf_info->type != VKD3D_SHADER_BLOCK_LOOP)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘endloop’ instruction without corresponding ‘loop’ block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -672,7 +682,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context))
|| cf_info->type != VKD3D_SHADER_BLOCK_SWITCH || cf_info->inside_block)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘endswitch’ instruction without corresponding ‘switch’ block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -682,7 +692,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context))
|| cf_info->type != VKD3D_SHADER_BLOCK_SWITCH)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘case’ instruction outside switch block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -692,13 +702,13 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
if (!(cf_info = vkd3d_shader_scan_get_current_cf_info(context))
|| cf_info->type != VKD3D_SHADER_BLOCK_SWITCH)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘default’ instruction outside switch block.");
return VKD3D_ERROR_INVALID_SHADER;
}
if (cf_info->has_default)
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered duplicate ‘default’ instruction inside the current switch block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -708,7 +718,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_BREAK:
if (!(cf_info = vkd3d_shader_scan_find_innermost_breakable_cf_info(context)))
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘break’ instruction outside breakable block.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -717,7 +727,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_BREAKP:
if (!(cf_info = vkd3d_shader_scan_find_innermost_loop_cf_info(context)))
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘breakp’ instruction outside loop.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -725,7 +735,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_CONTINUE:
if (!(cf_info = vkd3d_shader_scan_find_innermost_loop_cf_info(context)))
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘continue’ instruction outside loop.");
return VKD3D_ERROR_INVALID_SHADER;
}
@@ -734,7 +744,7 @@ static int vkd3d_shader_scan_instruction(struct vkd3d_shader_scan_context *conte
case VKD3DSIH_CONTINUEP:
if (!(cf_info = vkd3d_shader_scan_find_innermost_loop_cf_info(context)))
{
- vkd3d_shader_error(context->message_context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
+ vkd3d_shader_scan_error(context, VKD3D_SHADER_ERROR_TPF_MISMATCHED_CF,
"Encountered ‘continue’ instruction outside loop.");
return VKD3D_ERROR_INVALID_SHADER;
}
--
2.29.2
Dec. 15, 2020
[PATCH vkd3d] build: Create object directories before running bison or flex.
by Zebediah Figura
Vkd3d-Bug: https://bugs.winehq.org/show_bug.cgi?id=50334
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
Makefile.am | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 32c8777f..bf1d7bfa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -119,9 +119,11 @@ vkd3d_v_bison_0 = @echo " BISON " $@;
vkd3d_v_bison_1 =
libs/vkd3d-shader/preproc.yy.c: libs/vkd3d-shader/preproc.l
+ @$(MKDIR_P) libs/vkd3d-shader
$(VKD3D_V_FLEX)$(FLEX) $(LFLAGS) -o $@ $<
libs/vkd3d-shader/preproc.tab.c libs/vkd3d-shader/preproc.tab.h &: libs/vkd3d-shader/preproc.y
+ @$(MKDIR_P) libs/vkd3d-shader
$(VKD3D_V_BISON)$(BISON) $(YFLAGS) -d -o libs/vkd3d-shader/preproc.tab.c $<
BUILT_SOURCES += libs/vkd3d-shader/preproc.tab.h
--
2.29.2
Dec. 15, 2020
[PATCH] qcap/tests: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/qcap/tests/audiorecord.c | 9 ++----
dlls/qcap/tests/avico.c | 54 +++++++++++++-------------------
dlls/qcap/tests/avimux.c | 31 +++++++++---------
dlls/qcap/tests/smartteefilter.c | 36 ++++++++++-----------
4 files changed, 55 insertions(+), 75 deletions(-)
diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c
index dc74c3cfc15..350ae986b44 100644
--- a/dlls/qcap/tests/audiorecord.c
+++ b/dlls/qcap/tests/audiorecord.c
@@ -176,18 +176,15 @@ static ULONG WINAPI property_bag_Release(IPropertyBag *iface)
ok(0, "Unexpected call.\n");
return 1;
}
-
-static const WCHAR waveinidW[] = {'W','a','v','e','I','n','I','d',0};
-static const WCHAR usemixerW[] = {'U','s','e','M','i','x','e','r',0};
static int ppb_id;
static unsigned int ppb_got_read;
static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *name, VARIANT *var, IErrorLog *log)
{
- if (!lstrcmpW(name, usemixerW))
+ if (!lstrcmpW(name, L"UseMixer"))
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
- todo_wine ok(!lstrcmpW(name, waveinidW), "Got unexpected name %s.\n", wine_dbgstr_w(name));
+ todo_wine ok(!lstrcmpW(name, L"WaveInId"), "Got unexpected name %s.\n", wine_dbgstr_w(name));
ok(V_VT(var) == VT_I4, "Got unexpected type %u.\n", V_VT(var));
ok(!log, "Got unexpected error log %p.\n", log);
ppb_got_read++;
@@ -222,7 +219,7 @@ static void test_property_bag(IMoniker *mon)
ok(hr == S_OK, "Got hr %#x.\n", hr);
VariantInit(&var);
- hr = IPropertyBag_Read(devenum_bag, waveinidW, &var, NULL);
+ hr = IPropertyBag_Read(devenum_bag, L"WaveInId", &var, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ppb_id = V_I4(&var);
diff --git a/dlls/qcap/tests/avico.c b/dlls/qcap/tests/avico.c
index b4f52f10210..332ca5a8e7d 100644
--- a/dlls/qcap/tests/avico.c
+++ b/dlls/qcap/tests/avico.c
@@ -23,11 +23,6 @@
#include "vfw.h"
#include "wine/test.h"
-static const WCHAR sink_id[] = {'I','n',0};
-static const WCHAR source_id[] = {'O','u','t',0};
-static const WCHAR sink_name[] = {'I','n','p','u','t',0};
-static const WCHAR source_name[] = {'O','u','t','p','u','t',0};
-
static const DWORD test_fourcc = mmioFOURCC('w','t','s','t');
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
@@ -74,7 +69,7 @@ static void test_interfaces(IBaseFilter *filter)
check_interface(filter, &IID_IReferenceClock, FALSE);
check_interface(filter, &IID_IVideoWindow, FALSE);
- IBaseFilter_FindPin(filter, sink_id, &pin);
+ IBaseFilter_FindPin(filter, L"In", &pin);
check_interface(pin, &IID_IMemInputPin, TRUE);
check_interface(pin, &IID_IPin, TRUE);
@@ -85,7 +80,7 @@ static void test_interfaces(IBaseFilter *filter)
check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"Out", &pin);
todo_wine check_interface(pin, &IID_IMediaPosition, TRUE);
todo_wine check_interface(pin, &IID_IMediaSeeking, TRUE);
@@ -319,7 +314,7 @@ static void test_find_pin(IBaseFilter *filter)
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IBaseFilter_FindPin(filter, sink_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"In", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -327,7 +322,7 @@ static void test_find_pin(IBaseFilter *filter)
IPin_Release(pin);
IPin_Release(pin2);
- hr = IBaseFilter_FindPin(filter, source_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -335,9 +330,9 @@ static void test_find_pin(IBaseFilter *filter)
IPin_Release(pin);
IPin_Release(pin2);
- hr = IBaseFilter_FindPin(filter, sink_name, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Input", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
- hr = IBaseFilter_FindPin(filter, source_name, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Output", &pin);
ok(hr == VFW_E_NOT_FOUND, "Got hr %#x.\n", hr);
IEnumPins_Release(enum_pins);
@@ -351,14 +346,14 @@ static void test_pin_info(IBaseFilter *filter)
WCHAR *id;
IPin *pin;
- hr = IBaseFilter_FindPin(filter, sink_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"In", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
- todo_wine ok(!lstrcmpW(info.achName, sink_name), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ todo_wine ok(!lstrcmpW(info.achName, L"Input"), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
@@ -367,19 +362,19 @@ static void test_pin_info(IBaseFilter *filter)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, sink_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"In"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, source_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
- todo_wine ok(!lstrcmpW(info.achName, source_name), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ todo_wine ok(!lstrcmpW(info.achName, L"Output"), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
@@ -388,7 +383,7 @@ static void test_pin_info(IBaseFilter *filter)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, source_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"Out"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
IPin_Release(pin);
@@ -397,7 +392,6 @@ static void test_pin_info(IBaseFilter *filter)
static LRESULT CALLBACK driver_proc(DWORD_PTR id, HDRVR driver, UINT msg,
LPARAM lparam1, LPARAM lparam2)
{
- static const WCHAR nameW[] = {'f','o','o',0};
if (winetest_debug > 1) trace("msg %#x, lparam1 %#lx, lparam2 %#lx.\n", msg, lparam1, lparam2);
switch (msg)
@@ -415,8 +409,8 @@ static LRESULT CALLBACK driver_proc(DWORD_PTR id, HDRVR driver, UINT msg,
info->dwFlags = VIDCF_TEMPORAL;
info->dwVersion = 0x10101;
info->dwVersionICM = ICVERSION;
- lstrcpyW(info->szName, nameW);
- lstrcpyW(info->szDescription, nameW);
+ lstrcpyW(info->szName, L"foo");
+ lstrcpyW(info->szDescription, L"foo");
return sizeof(ICINFO);
}
case ICM_COMPRESS_QUERY:
@@ -446,14 +440,12 @@ static ULONG WINAPI property_bag_Release(IPropertyBag *iface)
ok(0, "Unexpected call.\n");
return 1;
}
-
-static const WCHAR fcchandlerW[] = {'F','c','c','H','a','n','d','l','e','r',0};
static BSTR ppb_handler;
static unsigned int ppb_got_read;
static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, const WCHAR *name, VARIANT *var, IErrorLog *log)
{
- ok(!lstrcmpW(name, fcchandlerW), "Got unexpected name %s.\n", wine_dbgstr_w(name));
+ ok(!lstrcmpW(name, L"FccHandler"), "Got unexpected name %s.\n", wine_dbgstr_w(name));
ok(V_VT(var) == VT_BSTR, "Got unexpected type %u.\n", V_VT(var));
ok(!log, "Got unexpected error log %p.\n", log);
V_BSTR(var) = SysAllocString(ppb_handler);
@@ -489,7 +481,7 @@ static void test_property_bag(IMoniker *mon)
ok(hr == S_OK, "Got hr %#x.\n", hr);
VariantInit(&var);
- hr = IPropertyBag_Read(devenum_bag, fcchandlerW, &var, NULL);
+ hr = IPropertyBag_Read(devenum_bag, L"FccHandler", &var, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ppb_handler = V_BSTR(&var);
@@ -525,7 +517,7 @@ static void test_media_types(IBaseFilter *filter)
HRESULT hr;
IPin *pin;
- IBaseFilter_FindPin(filter, sink_id, &pin);
+ IBaseFilter_FindPin(filter, L"In", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -572,7 +564,7 @@ static void test_media_types(IBaseFilter *filter)
IPin_Release(pin);
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"Out", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -592,7 +584,7 @@ static void test_enum_media_types(IBaseFilter *filter)
HRESULT hr;
IPin *pin;
- IBaseFilter_FindPin(filter, sink_id, &pin);
+ IBaseFilter_FindPin(filter, L"In", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -623,7 +615,7 @@ static void test_enum_media_types(IBaseFilter *filter)
IEnumMediaTypes_Release(enum2);
IPin_Release(pin);
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"Out", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -709,10 +701,8 @@ static void test_unconnected_filter_state(IBaseFilter *filter)
START_TEST(avico)
{
- static const WCHAR test_display_name[] = {'@','d','e','v','i','c','e',':',
- 'c','m',':','{','3','3','D','9','A','7','6','0','-','9','0','C','8',
- '-','1','1','D','0','-','B','D','4','3','-','0','0','A','0','C','9',
- '1','1','C','E','8','6','}','\\','w','t','s','t',0};
+ static const WCHAR test_display_name[] =
+ L"@device:cm:{33D9A760-90C8-11D0-BD43-00A0C911CE86}\\wtst";
ICreateDevEnum *devenum;
IEnumMoniker *enummon;
IBaseFilter *filter;
diff --git a/dlls/qcap/tests/avimux.c b/dlls/qcap/tests/avimux.c
index d1a67a01a11..3f43ff569cf 100644
--- a/dlls/qcap/tests/avimux.c
+++ b/dlls/qcap/tests/avimux.c
@@ -23,9 +23,6 @@
#include "vfw.h"
#include "wine/test.h"
-static const WCHAR source_id[] = {'A','V','I',' ','O','u','t',0};
-static const WCHAR sink0_id[] = {'I','n','p','u','t',' ','0','1',0};
-
static const GUID testguid = {0xfacade};
static IBaseFilter *create_avi_mux(void)
@@ -86,7 +83,7 @@ static void test_interfaces(void)
check_interface(filter, &IID_IReferenceClock, FALSE);
check_interface(filter, &IID_IVideoWindow, FALSE);
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"AVI Out", &pin);
check_interface(pin, &IID_IPin, TRUE);
check_interface(pin, &IID_IQualityControl, TRUE);
@@ -99,7 +96,7 @@ static void test_interfaces(void)
IPin_Release(pin);
- IBaseFilter_FindPin(filter, sink0_id, &pin);
+ IBaseFilter_FindPin(filter, L"Input 01", &pin);
check_interface(pin, &IID_IAMStreamControl, TRUE);
check_interface(pin, &IID_IMemInputPin, TRUE);
@@ -343,7 +340,7 @@ static void test_find_pin(void)
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IBaseFilter_FindPin(filter, source_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"AVI Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -351,7 +348,7 @@ static void test_find_pin(void)
IPin_Release(pin);
IPin_Release(pin2);
- hr = IBaseFilter_FindPin(filter, sink0_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Input 01", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -374,7 +371,7 @@ static void test_pin_info(void)
ULONG ref;
IPin *pin;
- hr = IBaseFilter_FindPin(filter, source_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"AVI Out", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
@@ -385,7 +382,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
- ok(!lstrcmpW(info.achName, source_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ ok(!lstrcmpW(info.achName, L"AVI Out"), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
@@ -398,7 +395,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, source_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"AVI Out"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
@@ -406,14 +403,14 @@ static void test_pin_info(void)
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, sink0_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Input 01", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
- ok(!lstrcmpW(info.achName, sink0_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ ok(!lstrcmpW(info.achName, L"Input 01"), "Got name %s.\n", wine_dbgstr_w(info.achName));
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
@@ -422,7 +419,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, sink0_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"Input 01"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
@@ -445,7 +442,7 @@ static void test_media_types(void)
ULONG ref;
IPin *pin;
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"AVI Out", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -498,7 +495,7 @@ static void test_media_types(void)
IEnumMediaTypes_Release(enummt);
IPin_Release(pin);
- IBaseFilter_FindPin(filter, sink0_id, &pin);
+ IBaseFilter_FindPin(filter, L"Input 01", &pin);
hr = IPin_EnumMediaTypes(pin, &enummt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -565,7 +562,7 @@ static void test_enum_media_types(void)
HRESULT hr;
IPin *pin;
- IBaseFilter_FindPin(filter, source_id, &pin);
+ IBaseFilter_FindPin(filter, L"AVI Out", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -629,7 +626,7 @@ static void test_enum_media_types(void)
IEnumMediaTypes_Release(enum2);
IPin_Release(pin);
- IBaseFilter_FindPin(filter, sink0_id, &pin);
+ IBaseFilter_FindPin(filter, L"Input 01", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c
index df741ba1284..e5ae66ff2d3 100644
--- a/dlls/qcap/tests/smartteefilter.c
+++ b/dlls/qcap/tests/smartteefilter.c
@@ -23,10 +23,6 @@
#include "wine/strmbase.h"
#include "wine/test.h"
-static const WCHAR sink_id[] = {'I','n','p','u','t',0};
-static const WCHAR capture_id[] = {'C','a','p','t','u','r','e',0};
-static const WCHAR preview_id[] = {'P','r','e','v','i','e','w',0};
-
static HANDLE event;
static IBaseFilter *create_smart_tee(void)
@@ -90,7 +86,7 @@ static void test_interfaces(void)
check_interface(filter, &IID_IReferenceClock, FALSE);
check_interface(filter, &IID_IVideoWindow, FALSE);
- IBaseFilter_FindPin(filter, sink_id, &pin);
+ IBaseFilter_FindPin(filter, L"Input", &pin);
check_interface(pin, &IID_IMemInputPin, TRUE);
check_interface(pin, &IID_IPin, TRUE);
@@ -106,7 +102,7 @@ static void test_interfaces(void)
IPin_Release(pin);
- IBaseFilter_FindPin(filter, capture_id, &pin);
+ IBaseFilter_FindPin(filter, L"Capture", &pin);
todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE);
check_interface(pin, &IID_IPin, TRUE);
@@ -122,7 +118,7 @@ static void test_interfaces(void)
IPin_Release(pin);
- IBaseFilter_FindPin(filter, preview_id, &pin);
+ IBaseFilter_FindPin(filter, L"Preview", &pin);
todo_wine check_interface(pin, &IID_IAMStreamControl, TRUE);
check_interface(pin, &IID_IPin, TRUE);
@@ -387,7 +383,7 @@ static void test_find_pin(void)
hr = IBaseFilter_EnumPins(filter, &enum_pins);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- hr = IBaseFilter_FindPin(filter, sink_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Input", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -395,7 +391,7 @@ static void test_find_pin(void)
IPin_Release(pin2);
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, capture_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Capture", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -403,7 +399,7 @@ static void test_find_pin(void)
IPin_Release(pin2);
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, preview_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Preview", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -427,7 +423,7 @@ static void test_pin_info(void)
ULONG ref;
IPin *pin;
- hr = IBaseFilter_FindPin(filter, sink_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Input", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
ok(ref == 2, "Got unexpected refcount %d.\n", ref);
@@ -438,7 +434,7 @@ static void test_pin_info(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
- ok(!lstrcmpW(info.achName, sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ ok(!lstrcmpW(info.achName, L"Input"), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
@@ -451,7 +447,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, sink_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"Input"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, &count);
@@ -459,14 +455,14 @@ static void test_pin_info(void)
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, capture_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Capture", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
- ok(!lstrcmpW(info.achName, capture_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ ok(!lstrcmpW(info.achName, L"Capture"), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
@@ -479,7 +475,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, capture_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"Capture"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, &count);
@@ -487,14 +483,14 @@ static void test_pin_info(void)
IPin_Release(pin);
- hr = IBaseFilter_FindPin(filter, preview_id, &pin);
+ hr = IBaseFilter_FindPin(filter, L"Preview", &pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IPin_QueryPinInfo(pin, &info);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_OUTPUT, "Got direction %d.\n", info.dir);
- ok(!lstrcmpW(info.achName, preview_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
+ ok(!lstrcmpW(info.achName, L"Preview"), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
@@ -507,7 +503,7 @@ static void test_pin_info(void)
hr = IPin_QueryId(pin, &id);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(!lstrcmpW(id, preview_id), "Got id %s.\n", wine_dbgstr_w(id));
+ ok(!lstrcmpW(id, L"Preview"), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, &count);
@@ -528,7 +524,7 @@ static void test_enum_media_types(void)
HRESULT hr;
IPin *pin;
- IBaseFilter_FindPin(filter, sink_id, &pin);
+ IBaseFilter_FindPin(filter, L"Input", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
--
2.26.2
Dec. 14, 2020
[PATCH] -Add SORT_DIGITSASNUMBERS flag to CompareStringsEx (Fixes FL Studio 20.8 crash on startup)
by John Zourlios
---
dlls/kernelbase/locale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index c60b796aa48..51085f4377a 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -3021,7 +3021,7 @@ INT WINAPI CompareStringEx( const WCHAR *locale, DWORD flags, const WCHAR *str1,
{
DWORD supported_flags = NORM_IGNORECASE | NORM_IGNORENONSPACE | NORM_IGNORESYMBOLS | SORT_STRINGSORT |
NORM_IGNOREKANATYPE | NORM_IGNOREWIDTH | LOCALE_USE_CP_ACP;
- DWORD semistub_flags = NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE | 0x10000000;
+ DWORD semistub_flags = NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE | 0x10000000 | SORT_DIGITSASNUMBERS;
/* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */
INT ret;
static int once;
--
2.29.2
Dec. 14, 2020
Re: [PATCH v2 vkd3d 2/4] vkd3d-shader: Implement basic support for #if and #endif.
by Zebediah Figura (she/her)
On 12/14/20 9:26 AM, Henri Verbeet wrote:
> On Sat, 12 Dec 2020 at 01:57, Zebediah Figura (she/her)
> <zfigura(a)codeweavers.com> wrote:
>> On 12/11/20 12:11 PM, Henri Verbeet wrote:
>>> Is reusing enum vkd3d_shader_error for warnings instead of introducing
>>> a separate enumeration here intentional?
>>>
>>
>> It was intentional, though of course not necessary. I guess my reasoning
>> was that there's no reason to let any numerical values coincide, and
>> hence no reason to bother separating the enumerations...
>
> Fair enough, although it does look a bit odd to pass an enum
> vkd3d_shader_error to vkd3d_shader_warning(). We may want to consider
> starting the preprocessor warning range at e.g. 4200 or 4300 in that
> case though; if we were to add VKD3D_SHADER_LOG_WARNING and
> VKD3D_SHADER_LOG_INFO ranges for all the existing
> VKD3D_SHADER_LOG_ERROR ranges using the current allocation scheme,
> 4-digit error codes would already be insufficient. (And there are
> still some sources/targets we may potentially add; HLSL of course, but
> also GLSL, perhaps MSL, probably DXIL, D3D shader model 1-3 bytecode.)
>
I hadn't thought about keeping error codes four digits long; that makes
sense to me. I'll adjust the numerical values.
Dec. 14, 2020
Re: [PATCH v2 vkd3d 1/4] vkd3d-shader: Handle preprocessor parsing errors.
by Zebediah Figura (she/her)
On 12/14/20 9:26 AM, Henri Verbeet wrote:
> On Sat, 12 Dec 2020 at 01:52, Zebediah Figura (she/her)
> <zfigura(a)codeweavers.com> wrote:
>>
>> On 12/11/20 12:11 PM, Henri Verbeet wrote:
>>> On Fri, 11 Dec 2020 at 00:27, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
>>>> +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;
>>>> };
>>>>
>>> There seems to be some duplication of location information between
>>> struct vkd3d_shader_message_context, struct preproc_ctx, and struct
>>> preproc_location. Is that intentional? If it is, would it make sense
>>> to introduce e.g. a struct vkd3d_shader_source_location instead of
>>> struct preproc_location, and then use that structure in both struct
>>> vkd3d_shader_message_context and struct preproc_ctx?
>>
>> Wrt the vkd3d_shader_message_context part—the current structure
>> definitely isn't a great fit for the preprocessor or HLSL parser (i.e.
>> the parts that use yacc) because the location tracking means that we'll
>> be setting a new location on every error call. (And of course most of
>> the other parsers we have don't really have a meaningful concept of
>> line/column locations...) But I wasn't sure enough to actually try to
>> redesign those parts, and it seemed like something that could be
>> deferred, so I just left it alone...
>>
> I probably haven't looked at this series in enough detail, so I may be
> missing something obvious, but is the issue that we're getting an
> explicit location in yyerror() that may not match the location stored
> in struct preproc_ctx? I think it would be fine to pass an explicit
> location to vkd3d_shader_error() and similar functions as well, and
> moving location tracking out of struct vkd3d_shader_message_context.
yyerror() is one example where we need to preserve a location that's not
the "current" one, but it actually ends up being most errors.
In the case of the HLSL compiler, except for a scant few errors
generated by the lexer, pretty much everything has a location attached
that doesn't match the lexer's current location. This is partly because
of lookahead (e.g. we want to complain about variable attributes on a
function, and have the caret point toward the invalid attribute, but we
don't know which one we've parsed yet), partly because bison makes no
guarantees about where the lexer actually is when a given rule is
parsed, and partly because we report some errors *after* having parsed
the whole file [which we do by saving the locations of code that caused
us to generate instructions and other IR objects].
In the case of the preprocessor, it's a bit odd, because most errors can
be blamed on a malformed or misplaced directive [and so even including
the column in the first place doesn't necessarily make a lot of sense].
It'd be arguably possible to always pass the current line and file name,
except that it'd actually need to be the previous line and file name,
since we've already parsed a newline at that point. But this is also
sort of depending on bison internals that I don't think are guaranteed.
> That probably doesn't need to delay this series, but if that change is
> what we want, it seems easier to make it sooner rather than later.
Well, I did add preproc_error() as a helper (and there are already
similar helpers for the HLSL compiler) so that it wouldn't be too much
of a problem. But it is of course nice to not punt the problem, and it's
not too hard...
>
> It does look like we'd want a struct vkd3d_shader_source_location
> instead of struct preproc_location in that case.
>
>> Wrt preproc_location vs preproc_ctx—part of the rub here is that {line,
>> column} is a bit different from {first_line, first_column}; i.e. if we
>> were to add {last_line, last_column}, that wouldn't be a part of
>> preproc_ctx.
>>
> Hmm, right.
>
Dec. 14, 2020
[PATCH] dbghelp: Fetch version info only for PE modules in minidumps.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/dbghelp/minidump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Dec. 14, 2020
Re: [PATCH] gdi32/tests: Add tests for zero-width control characters.
by Nikolay Sivov
On 12/14/20 5:53 PM, Sven Baars wrote:
> Signed-off-by: Sven Baars <sbaars(a)codeweavers.com>
> ---
> Some tests with zero-width control characters for inconsistent behavior
> that I observed while trying to fix the ID3DXFont implementation. In our
> implementation these functions all use the same internal function, but on
> Windows none of them seem to do exactly the same.
Have you tried with different fonts? Especially with fonts not shipped
with Windows.
As I remember certain system fonts were updated in Windows 10 to have
empty glyphs for control characters. So what you see and this whole test
might be unnecessary tailored for Tahoma (including broken parts
reflecting font changes across windows releases).
Easy way to test is to use some modified Noto font to see when metrics
are used and when metrics are ignored for certain characters.
Dec. 14, 2020
[PATCH 5/5] winapi: Use __alignof__ on clang.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/gdi32/tests/generated.c | 2 +-
dlls/kernel32/tests/generated.c | 2 +-
dlls/ntdll/tests/generated.c | 2 +-
dlls/rpcrt4/tests/generated.c | 2 +-
dlls/shell32/tests/generated.c | 2 +-
dlls/shlwapi/tests/generated.c | 2 +-
dlls/urlmon/tests/generated.c | 90 +--------------------------------
dlls/user32/tests/generated.c | 2 +-
dlls/wininet/tests/generated.c | 2 +-
dlls/winmm/tests/generated.c | 2 +-
tools/winapi/winapi_test | 2 +-
11 files changed, 11 insertions(+), 99 deletions(-)
Dec. 14, 2020
[PATCH 4/5] msvcrt: Use __ASM_USE_THISCALL_WRAPPER in cxx.h.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/msvcrt/cxx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Dec. 14, 2020
[PATCH 3/5] msvcrt: Use GCC-style assembly on Clang MSVC target.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/msvcrt/math.c | 14 +++++++-------
dlls/msvcrt/misc.c | 6 +++---
2 files changed, 10 insertions(+), 10 deletions(-)
Dec. 14, 2020
[PATCH 2/5] msvcrt: Prefix *rot* functions.
by Jacek Caban
MSVC does not allow overriding those intrinsic functions.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/crtdll/crtdll.spec | 8 ++++----
dlls/msvcr100/msvcr100.spec | 12 ++++++------
dlls/msvcr110/msvcr110.spec | 12 ++++++------
dlls/msvcr120/msvcr120.spec | 12 ++++++------
dlls/msvcr70/msvcr70.spec | 8 ++++----
dlls/msvcr71/msvcr71.spec | 8 ++++----
dlls/msvcr80/msvcr80.spec | 12 ++++++------
dlls/msvcr90/msvcr90.spec | 12 ++++++------
dlls/msvcrt/math.c | 12 ++++++------
dlls/msvcrt/msvcrt.spec | 12 ++++++------
dlls/msvcrtd/msvcrtd.spec | 8 ++++----
dlls/ucrtbase/ucrtbase.spec | 12 ++++++------
12 files changed, 64 insertions(+), 64 deletions(-)
Dec. 14, 2020
[PATCH 1/5] ucrtbase: Improve __intrinsic_abnormal_termination stub.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
The real motivation is renaming _abnormal_termination, which is not
allowed on MSVC.
dlls/crtdll/crtdll.spec | 2 +-
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr70/msvcr70.spec | 2 +-
dlls/msvcr71/msvcr71.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/except.c | 2 +-
dlls/msvcrt/msvcrt.spec | 2 +-
dlls/msvcrtd/msvcrtd.spec | 2 +-
dlls/ucrtbase/ucrtbase.spec | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
Dec. 14, 2020
Re: [PATCH] crypt32/tests: Fix a registerOIDInfo() failure when missing elevated privileges.
by Francois Gouget
On Mon, 14 Dec 2020, Dmitry Timoshkov wrote:
[...]
> If the intent to add is_process_elevated() checks to every place where
> ERROR_ACCESS_DENIED error returned then it's not justified.
Ok.
> > > > @@ -645,7 +661,11 @@ static void test_registerOIDInfo(void)
> > > > info1.pszOID = test_oid;
> > > > SetLastError(0xdeadbeef);
> > > > ret = CryptUnregisterOIDInfo(&info1);
> > > > - ok(!ret, "should fail\n");
> > > > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > > > + {
> > > > + skip("Need admin rights FIXME\n");
> > > > + return;
> > > > + } ok(!ret, "should fail\n");
> > >
> > > This change doesn't look right. Most likely it's not needed here.
> >
> > It is needed:
> > https://test.winehq.org/data/3acb0b3326c4120ea0c4c6076bd03c9cfe82c744/win10…
>
> In addition to broken indentation and strange skip message the test bot
> results seem not related, in both cases !ret is the only accepted value.
Oh, right. I missed the cleanup step and mixed it up with the fix
for another test too. I will resubmit it.
--
Francois Gouget <fgouget(a)codeweavers.com>
Dec. 14, 2020
[PATCH v2 2/2] ntdll: Save unwind information in KiUserApcDispatcher() on x64.
by Paul Gofman
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
v2:
- fix build for other archs.
dlls/ntdll/tests/exception.c | 53 +++++++++++++++++++++++++++++++++
dlls/ntdll/thread.c | 28 ++++++++++++++++-
dlls/ntdll/unix/signal_x86_64.c | 23 ++++++++++++--
3 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 5686e39ab9e..3a0a5ac049c 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -37,6 +37,8 @@ static void *code_mem;
static NTSTATUS (WINAPI *pNtGetContextThread)(HANDLE,CONTEXT*);
static NTSTATUS (WINAPI *pNtSetContextThread)(HANDLE,CONTEXT*);
+static NTSTATUS (WINAPI *pNtQueueApcThread)(HANDLE handle, PNTAPCFUNC func,
+ ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3);
static NTSTATUS (WINAPI *pRtlRaiseException)(EXCEPTION_RECORD *rec);
static PVOID (WINAPI *pRtlUnwind)(PVOID, PVOID, PEXCEPTION_RECORD, PVOID);
static VOID (WINAPI *pRtlCaptureContext)(CONTEXT*);
@@ -4061,6 +4063,55 @@ static void test_nested_exception(void)
ok(got_prev_frame_exception, "Did not get nested exception in the previous frame.\n");
}
+static CONTEXT test_unwind_apc_context;
+static BOOL test_unwind_apc_called;
+
+static void CALLBACK test_unwind_apc(ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3)
+{
+ EXCEPTION_RECORD rec;
+
+ test_unwind_apc_called = TRUE;
+ memset(&rec, 0, sizeof(rec));
+ pRtlUnwind((void *)test_unwind_apc_context.Rsp, (void *)test_unwind_apc_context.Rip, &rec, (void *)0xdeadbeef);
+ ok(0, "Should not get here.\n");
+}
+
+static void test_unwind_from_apc(void)
+{
+ NTSTATUS status;
+ int pass;
+
+ if (!pNtQueueApcThread)
+ {
+ win_skip("NtQueueApcThread is not available.\n");
+ return;
+ }
+
+ pass = 0;
+ InterlockedIncrement(&pass);
+ RtlCaptureContext(&test_unwind_apc_context);
+ InterlockedIncrement(&pass);
+
+ if (pass == 2)
+ {
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ SleepEx(0, TRUE);
+ ok(0, "Should not get here.\n");
+ }
+ if (pass == 3)
+ {
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ NtContinue(&test_unwind_apc_context, TRUE );
+ ok(0, "Should not get here.\n");
+ }
+ ok(pass == 4, "Got unexpected pass %d.\n", pass);
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+}
#elif defined(__arm__)
static void test_thread_context(void)
@@ -8073,6 +8124,7 @@ START_TEST(exception)
#define X(f) p##f = (void*)GetProcAddress(hntdll, #f)
X(NtGetContextThread);
X(NtSetContextThread);
+ X(NtQueueApcThread);
X(NtReadVirtualMemory);
X(NtClose);
X(RtlUnwind);
@@ -8241,6 +8293,7 @@ START_TEST(exception)
skip( "Dynamic unwind functions not found\n" );
test_extended_context();
test_copy_context();
+ test_unwind_from_apc();
#elif defined(__aarch64__)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 578c7a5436c..5bf456ec040 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -78,7 +78,7 @@ int __cdecl __wine_dbg_output( const char *str )
/*******************************************************************
* KiUserApcDispatcher (NTDLL.@)
*/
-void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+void WINAPI dispatch_apc( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
PNTAPCFUNC func )
{
func( ctx, arg1, arg2 );
@@ -86,6 +86,32 @@ void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1
}
+#ifdef __x86_64__
+__ASM_GLOBAL_FUNC( KiUserApcDispatcher,
+ "addq $0x8,%rsp\n\t"
+ "mov 0x98(%rcx),%r10\n\t" /* context->Rsp */
+ "mov 0xf8(%rcx),%r11\n\t" /* context->Rip */
+ "mov %r11,-0x8(%r10)\n\t"
+ "mov %rbp,-0x10(%r10)\n\t"
+ "lea -0x10(%r10),%rbp\n\t"
+ __ASM_SEH(".seh_pushreg %rbp\n\t")
+ __ASM_SEH(".seh_setframe %rbp,0\n\t")
+ __ASM_SEH(".seh_endprologue\n\t")
+ __ASM_CFI(".cfi_signal_frame\n\t")
+ __ASM_CFI(".cfi_adjust_cfa_offset 0x10\n\t")
+ __ASM_CFI(".cfi_def_cfa %rbp,0x10\n\t")
+ __ASM_CFI(".cfi_rel_offset %rip,0x8\n\t")
+ __ASM_CFI(".cfi_rel_offset %rbp,0\n\t")
+ "call " __ASM_NAME("dispatch_apc") "\n\t"
+ "int3")
+#else
+void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+ PNTAPCFUNC func )
+{
+ dispatch_apc( context, ctx, arg1, arg2, func );
+}
+#endif
+
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 09088b75750..4a03f3b3bac 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2076,9 +2076,28 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq %r14,%r9\n" /* arg2 */
"movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
- "movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
+ "movq %rdi,%r10\n\t"
+ /* Set nonvolatile regs from context. */
+ "movq 0xa0(%rcx),%rbp\n\t"
+ "movq 0x90(%rcx),%rbx\n\t"
+ "movq 0xa8(%rcx),%rsi\n\t"
+ "movq 0xb0(%rcx),%rdi\n\t"
+ "movq 0xd8(%rcx),%r12\n\t"
+ "movq 0xe0(%rcx),%r13\n\t"
+ "movq 0xe8(%rcx),%r14\n\t"
+ "movq 0xf0(%rcx),%r15\n\t"
+ "movdqa 0x200(%rcx),%xmm6\n\t"
+ "movdqa 0x210(%rcx),%xmm7\n\t"
+ "movdqa 0x220(%rcx),%xmm8\n\t"
+ "movdqa 0x230(%rcx),%xmm9\n\t"
+ "movdqa 0x240(%rcx),%xmm10\n\t"
+ "movdqa 0x250(%rcx),%xmm11\n\t"
+ "movdqa 0x260(%rcx),%xmm12\n\t"
+ "movdqa 0x270(%rcx),%xmm13\n\t"
+ "movdqa 0x280(%rcx),%xmm14\n\t"
+ "movdqa 0x290(%rcx),%xmm15\n\t"
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
- "jmp *%rdi" )
+ "jmp *%r10" )
/***********************************************************************
--
2.29.2
Dec. 14, 2020
[PATCH v2 1/2] ntdll: Always copy context in call_user_apc_dispatcher() on x64.
by Paul Gofman
Currently, if call_user_apc_dispatcher() is called with nonzero context,
there is no guarantee that the provided context is stored above the
rsp = context_ptr->Rsp - (sizeof(CONTEXT) + offsetof(frame,ret_addr))
being set.
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/ntdll/unix/signal_x86_64.c | 61 +++++++++++++++++++++++++--------
1 file changed, 47 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 359f2d7c361..09088b75750 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -254,6 +254,22 @@ C_ASSERT((offsetof(struct stack_layout, xstate) == sizeof(struct stack_layout)))
C_ASSERT( sizeof(XSTATE) == 0x140 );
C_ASSERT( sizeof(struct stack_layout) == 0x5b0 ); /* Should match the size in call_user_exception_dispatcher(). */
+/* stack layout when calling an user apc function.
+ * FIXME: match Windows ABI. */
+struct apc_stack_layout
+{
+ ULONG64 save_regs[4];
+ void *func;
+ ULONG64 align;
+ CONTEXT context;
+ ULONG64 rbp;
+ ULONG64 rip;
+};
+
+/* Should match size and offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof(struct apc_stack_layout, context) == 0x30 );
+C_ASSERT( sizeof(struct apc_stack_layout) == 0x510 );
+
struct syscall_frame
{
ULONG64 xmm[10 * 2]; /* xmm6-xmm15 */
@@ -270,6 +286,9 @@ struct syscall_frame
ULONG64 ret_addr;
};
+/* Should match the offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof( struct syscall_frame, ret_addr ) == 0xf0);
+
struct amd64_thread_data
{
DWORD_PTR dr0; /* 02f0 debug registers */
@@ -2017,31 +2036,45 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec )
/***********************************************************************
* call_user_apc_dispatcher
*/
+struct apc_stack_layout * WINAPI setup_user_apc_dispatcher_stack( CONTEXT *context, struct apc_stack_layout *stack )
+{
+ CONTEXT c;
+
+ if (!context)
+ {
+ c.ContextFlags = CONTEXT_FULL;
+ NtGetContextThread( GetCurrentThread(), &c );
+ context = &c;
+ }
+ memmove( &stack->context, context, sizeof(stack->context) );
+ return stack;
+}
+
__ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq 0x28(%rsp),%rsi\n\t" /* func */
"movq 0x30(%rsp),%rdi\n\t" /* dispatcher */
"movq %gs:0x30,%rbx\n\t"
- "jrcxz 1f\n\t"
- "movq 0x98(%rcx),%rax\n\t" /* context_ptr->Rsp */
- "leaq -0x5c0(%rax),%rsp\n\t" /* sizeof(CONTEXT) + offsetof(frame,ret_addr) */
- "andq $~15,%rsp\n\t"
- "jmp 2f\n"
- "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
- "leaq -0x4d0(%rax),%rsp\n\t"
- "andq $~15,%rsp\n\t"
"movq %rdx,%r12\n\t" /* ctx */
"movq %r8,%r13\n\t" /* arg1 */
"movq %r9,%r14\n\t" /* arg2 */
- "movq %rsp,%rdx\n\t" /* context */
- "movl $0x10000b,0x30(%rdx)\n\t" /* context.ContextFlags */
- "movq $~1,%rcx\n\t"
- "call " __ASM_NAME("NtGetContextThread") "\n\t"
- "movq %rsp,%rcx\n\t" /* context */
+ "jrcxz 1f\n\t"
+ "movq 0x98(%rcx),%rdx\n\t" /* context->Rsp */
+ "jmp 2f\n\t"
+ "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
+ "leaq 0xf0(%rax),%rdx\n\t" /* &amd64_thread_data()->syscall_frame->ret_addr */
+ "2:\tsubq $0x510,%rdx\n\t" /* sizeof(struct apc_stack_layout) */
+ "andq $~0xf,%rdx\n\t"
+ "cmpq %rsp,%rdx\n\t"
+ "cmovbq %rdx,%rsp\n\t"
+ "subq $0x18,%rsp\n\t"
+ "call " __ASM_NAME("setup_user_apc_dispatcher_stack") "\n\t"
+ "movq %rax,%rsp\n\t"
+ "leaq 0x30(%rsp),%rcx\n\t" /* context */
"movq $0xc0,0x78(%rcx)\n\t" /* context.Rax = STATUS_USER_APC */
"movq %r12,%rdx\n\t" /* ctx */
"movq %r13,%r8\n\t" /* arg1 */
"movq %r14,%r9\n" /* arg2 */
- "2:\tmovq $0,0x328(%rbx)\n\t"
+ "movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
"movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
--
2.29.2
Dec. 14, 2020
Re: [PATCH 2/2] ntdll: Save unwind information in KiUserApcDispatcher() on x64.
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=83408
Your paranoid android.
=== debiant (build log) ===
../wine/dlls/ntdll/thread.c:111:5: error: too few arguments to function ‘dispatch_apc’
Task: The win32 Wine build failed
=== debiant (build log) ===
../wine/dlls/ntdll/thread.c:111:5: error: too few arguments to function ‘dispatch_apc’
Task: The wow32 Wine build failed
Dec. 14, 2020
[PATCH 2/2] ntdll: Save unwind information in KiUserApcDispatcher() on x64.
by Paul Gofman
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/ntdll/tests/exception.c | 53 +++++++++++++++++++++++++++++++++
dlls/ntdll/thread.c | 28 ++++++++++++++++-
dlls/ntdll/unix/signal_x86_64.c | 23 ++++++++++++--
3 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 5686e39ab9e..3a0a5ac049c 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -37,6 +37,8 @@ static void *code_mem;
static NTSTATUS (WINAPI *pNtGetContextThread)(HANDLE,CONTEXT*);
static NTSTATUS (WINAPI *pNtSetContextThread)(HANDLE,CONTEXT*);
+static NTSTATUS (WINAPI *pNtQueueApcThread)(HANDLE handle, PNTAPCFUNC func,
+ ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3);
static NTSTATUS (WINAPI *pRtlRaiseException)(EXCEPTION_RECORD *rec);
static PVOID (WINAPI *pRtlUnwind)(PVOID, PVOID, PEXCEPTION_RECORD, PVOID);
static VOID (WINAPI *pRtlCaptureContext)(CONTEXT*);
@@ -4061,6 +4063,55 @@ static void test_nested_exception(void)
ok(got_prev_frame_exception, "Did not get nested exception in the previous frame.\n");
}
+static CONTEXT test_unwind_apc_context;
+static BOOL test_unwind_apc_called;
+
+static void CALLBACK test_unwind_apc(ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3)
+{
+ EXCEPTION_RECORD rec;
+
+ test_unwind_apc_called = TRUE;
+ memset(&rec, 0, sizeof(rec));
+ pRtlUnwind((void *)test_unwind_apc_context.Rsp, (void *)test_unwind_apc_context.Rip, &rec, (void *)0xdeadbeef);
+ ok(0, "Should not get here.\n");
+}
+
+static void test_unwind_from_apc(void)
+{
+ NTSTATUS status;
+ int pass;
+
+ if (!pNtQueueApcThread)
+ {
+ win_skip("NtQueueApcThread is not available.\n");
+ return;
+ }
+
+ pass = 0;
+ InterlockedIncrement(&pass);
+ RtlCaptureContext(&test_unwind_apc_context);
+ InterlockedIncrement(&pass);
+
+ if (pass == 2)
+ {
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ SleepEx(0, TRUE);
+ ok(0, "Should not get here.\n");
+ }
+ if (pass == 3)
+ {
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+ test_unwind_apc_called = FALSE;
+ status = pNtQueueApcThread(GetCurrentThread(), test_unwind_apc, 0, 0, 0);
+ ok(!status, "Got unexpected status %#x.\n", status);
+ NtContinue(&test_unwind_apc_context, TRUE );
+ ok(0, "Should not get here.\n");
+ }
+ ok(pass == 4, "Got unexpected pass %d.\n", pass);
+ ok(test_unwind_apc_called, "Test user APC was not called.\n");
+}
#elif defined(__arm__)
static void test_thread_context(void)
@@ -8073,6 +8124,7 @@ START_TEST(exception)
#define X(f) p##f = (void*)GetProcAddress(hntdll, #f)
X(NtGetContextThread);
X(NtSetContextThread);
+ X(NtQueueApcThread);
X(NtReadVirtualMemory);
X(NtClose);
X(RtlUnwind);
@@ -8241,6 +8293,7 @@ START_TEST(exception)
skip( "Dynamic unwind functions not found\n" );
test_extended_context();
test_copy_context();
+ test_unwind_from_apc();
#elif defined(__aarch64__)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 578c7a5436c..c5dcb931ba5 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -78,7 +78,7 @@ int __cdecl __wine_dbg_output( const char *str )
/*******************************************************************
* KiUserApcDispatcher (NTDLL.@)
*/
-void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+void WINAPI dispatch_apc( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
PNTAPCFUNC func )
{
func( ctx, arg1, arg2 );
@@ -86,6 +86,32 @@ void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1
}
+#ifdef __x86_64__
+__ASM_GLOBAL_FUNC( KiUserApcDispatcher,
+ "addq $0x8,%rsp\n\t"
+ "mov 0x98(%rcx),%r10\n\t" /* context->Rsp */
+ "mov 0xf8(%rcx),%r11\n\t" /* context->Rip */
+ "mov %r11,-0x8(%r10)\n\t"
+ "mov %rbp,-0x10(%r10)\n\t"
+ "lea -0x10(%r10),%rbp\n\t"
+ __ASM_SEH(".seh_pushreg %rbp\n\t")
+ __ASM_SEH(".seh_setframe %rbp,0\n\t")
+ __ASM_SEH(".seh_endprologue\n\t")
+ __ASM_CFI(".cfi_signal_frame\n\t")
+ __ASM_CFI(".cfi_adjust_cfa_offset 0x10\n\t")
+ __ASM_CFI(".cfi_def_cfa %rbp,0x10\n\t")
+ __ASM_CFI(".cfi_rel_offset %rip,0x8\n\t")
+ __ASM_CFI(".cfi_rel_offset %rbp,0\n\t")
+ "call " __ASM_NAME("dispatch_apc") "\n\t"
+ "int3")
+#else
+void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR ctx, ULONG_PTR arg1, ULONG_PTR arg2,
+ PNTAPCFUNC func )
+{
+ dispatch_apc();
+}
+#endif
+
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 09088b75750..4a03f3b3bac 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2076,9 +2076,28 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq %r14,%r9\n" /* arg2 */
"movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
- "movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
+ "movq %rdi,%r10\n\t"
+ /* Set nonvolatile regs from context. */
+ "movq 0xa0(%rcx),%rbp\n\t"
+ "movq 0x90(%rcx),%rbx\n\t"
+ "movq 0xa8(%rcx),%rsi\n\t"
+ "movq 0xb0(%rcx),%rdi\n\t"
+ "movq 0xd8(%rcx),%r12\n\t"
+ "movq 0xe0(%rcx),%r13\n\t"
+ "movq 0xe8(%rcx),%r14\n\t"
+ "movq 0xf0(%rcx),%r15\n\t"
+ "movdqa 0x200(%rcx),%xmm6\n\t"
+ "movdqa 0x210(%rcx),%xmm7\n\t"
+ "movdqa 0x220(%rcx),%xmm8\n\t"
+ "movdqa 0x230(%rcx),%xmm9\n\t"
+ "movdqa 0x240(%rcx),%xmm10\n\t"
+ "movdqa 0x250(%rcx),%xmm11\n\t"
+ "movdqa 0x260(%rcx),%xmm12\n\t"
+ "movdqa 0x270(%rcx),%xmm13\n\t"
+ "movdqa 0x280(%rcx),%xmm14\n\t"
+ "movdqa 0x290(%rcx),%xmm15\n\t"
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
- "jmp *%rdi" )
+ "jmp *%r10" )
/***********************************************************************
--
2.29.2
Dec. 14, 2020
[PATCH 1/2] ntdll: Always copy context in call_user_apc_dispatcher() on x64.
by Paul Gofman
Currently, if call_user_apc_dispatcher() is called with nonzero context,
there is no guarantee that the provided context is stored above the
rsp = context_ptr->Rsp - (sizeof(CONTEXT) + offsetof(frame,ret_addr))
being set.
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/ntdll/unix/signal_x86_64.c | 61 +++++++++++++++++++++++++--------
1 file changed, 47 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 359f2d7c361..09088b75750 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -254,6 +254,22 @@ C_ASSERT((offsetof(struct stack_layout, xstate) == sizeof(struct stack_layout)))
C_ASSERT( sizeof(XSTATE) == 0x140 );
C_ASSERT( sizeof(struct stack_layout) == 0x5b0 ); /* Should match the size in call_user_exception_dispatcher(). */
+/* stack layout when calling an user apc function.
+ * FIXME: match Windows ABI. */
+struct apc_stack_layout
+{
+ ULONG64 save_regs[4];
+ void *func;
+ ULONG64 align;
+ CONTEXT context;
+ ULONG64 rbp;
+ ULONG64 rip;
+};
+
+/* Should match size and offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof(struct apc_stack_layout, context) == 0x30 );
+C_ASSERT( sizeof(struct apc_stack_layout) == 0x510 );
+
struct syscall_frame
{
ULONG64 xmm[10 * 2]; /* xmm6-xmm15 */
@@ -270,6 +286,9 @@ struct syscall_frame
ULONG64 ret_addr;
};
+/* Should match the offset in call_user_apc_dispatcher(). */
+C_ASSERT( offsetof( struct syscall_frame, ret_addr ) == 0xf0);
+
struct amd64_thread_data
{
DWORD_PTR dr0; /* 02f0 debug registers */
@@ -2017,31 +2036,45 @@ static void setup_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec )
/***********************************************************************
* call_user_apc_dispatcher
*/
+struct apc_stack_layout * WINAPI setup_user_apc_dispatcher_stack( CONTEXT *context, struct apc_stack_layout *stack )
+{
+ CONTEXT c;
+
+ if (!context)
+ {
+ c.ContextFlags = CONTEXT_FULL;
+ NtGetContextThread( GetCurrentThread(), &c );
+ context = &c;
+ }
+ memmove( &stack->context, context, sizeof(stack->context) );
+ return stack;
+}
+
__ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq 0x28(%rsp),%rsi\n\t" /* func */
"movq 0x30(%rsp),%rdi\n\t" /* dispatcher */
"movq %gs:0x30,%rbx\n\t"
- "jrcxz 1f\n\t"
- "movq 0x98(%rcx),%rax\n\t" /* context_ptr->Rsp */
- "leaq -0x5c0(%rax),%rsp\n\t" /* sizeof(CONTEXT) + offsetof(frame,ret_addr) */
- "andq $~15,%rsp\n\t"
- "jmp 2f\n"
- "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
- "leaq -0x4d0(%rax),%rsp\n\t"
- "andq $~15,%rsp\n\t"
"movq %rdx,%r12\n\t" /* ctx */
"movq %r8,%r13\n\t" /* arg1 */
"movq %r9,%r14\n\t" /* arg2 */
- "movq %rsp,%rdx\n\t" /* context */
- "movl $0x10000b,0x30(%rdx)\n\t" /* context.ContextFlags */
- "movq $~1,%rcx\n\t"
- "call " __ASM_NAME("NtGetContextThread") "\n\t"
- "movq %rsp,%rcx\n\t" /* context */
+ "jrcxz 1f\n\t"
+ "movq 0x98(%rcx),%rdx\n\t" /* context->Rsp */
+ "jmp 2f\n\t"
+ "1:\tmovq 0x328(%rbx),%rax\n\t" /* amd64_thread_data()->syscall_frame */
+ "leaq 0xf0(%rax),%rdx\n\t" /* &amd64_thread_data()->syscall_frame->ret_addr */
+ "2:\tsubq $0x510,%rdx\n\t" /* sizeof(struct apc_stack_layout) */
+ "andq $~0xf,%rdx\n\t"
+ "cmpq %rsp,%rdx\n\t"
+ "cmovbq %rdx,%rsp\n\t"
+ "subq $0x18,%rsp\n\t"
+ "call " __ASM_NAME("setup_user_apc_dispatcher_stack") "\n\t"
+ "movq %rax,%rsp\n\t"
+ "leaq 0x30(%rsp),%rcx\n\t" /* context */
"movq $0xc0,0x78(%rcx)\n\t" /* context.Rax = STATUS_USER_APC */
"movq %r12,%rdx\n\t" /* ctx */
"movq %r13,%r8\n\t" /* arg1 */
"movq %r14,%r9\n" /* arg2 */
- "2:\tmovq $0,0x328(%rbx)\n\t"
+ "movq $0,0x328(%rbx)\n\t" /* amd64_thread_data()->syscall_frame */
"movq %rsi,0x20(%rsp)\n\t" /* func */
"movq 0xa0(%rcx),%rbp\n\t" /* context.Rbp */
"pushq 0xf8(%rcx)\n\t" /* context.Rip */
--
2.29.2
Dec. 14, 2020
Re: [PATCH] crypt32/tests: Fix a registerOIDInfo() failure when missing elevated privileges.
by Dmitry Timoshkov
Francois Gouget <fgouget(a)codeweavers.com> wrote:
> > > @@ -499,7 +515,7 @@ static void test_getDefaultOIDFunctionAddress(void)
> > > SetLastError(0xdeadbeef);
> > > ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
> > > bogusDll);
> > > - if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
> > > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > > skip("Need admin rights\n");
> > > else
> > > ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
> >
> > In which cases the changes above are needed? It seems that this only
> > complicates things without a reason and could potentially slow down
> > the tests execution.
>
> These are not strictly needed. Rather the goal is to verify that we only
> get ERROR_ACCESS_DENIED when missing elevated privileges rather than
> blindly assuming the access denied error is justified.
If the intent to add is_process_elevated() checks to every place where
ERROR_ACCESS_DENIED error returned then it's not justified.
> > > @@ -645,7 +661,11 @@ static void test_registerOIDInfo(void)
> > > info1.pszOID = test_oid;
> > > SetLastError(0xdeadbeef);
> > > ret = CryptUnregisterOIDInfo(&info1);
> > > - ok(!ret, "should fail\n");
> > > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > > + {
> > > + skip("Need admin rights FIXME\n");
> > > + return;
> > > + } ok(!ret, "should fail\n");
> >
> > This change doesn't look right. Most likely it's not needed here.
>
> It is needed:
> https://test.winehq.org/data/3acb0b3326c4120ea0c4c6076bd03c9cfe82c744/win10…
In addition to broken indentation and strange skip message the test bot
results seem not related, in both cases !ret is the only accepted value.
--
Dmitry.
Dec. 14, 2020
Re: [PATCH v2 vkd3d 2/4] vkd3d-shader: Implement basic support for #if and #endif.
by Henri Verbeet
On Sat, 12 Dec 2020 at 01:57, Zebediah Figura (she/her)
<zfigura(a)codeweavers.com> wrote:
> On 12/11/20 12:11 PM, Henri Verbeet wrote:
> > Is reusing enum vkd3d_shader_error for warnings instead of introducing
> > a separate enumeration here intentional?
> >
>
> It was intentional, though of course not necessary. I guess my reasoning
> was that there's no reason to let any numerical values coincide, and
> hence no reason to bother separating the enumerations...
Fair enough, although it does look a bit odd to pass an enum
vkd3d_shader_error to vkd3d_shader_warning(). We may want to consider
starting the preprocessor warning range at e.g. 4200 or 4300 in that
case though; if we were to add VKD3D_SHADER_LOG_WARNING and
VKD3D_SHADER_LOG_INFO ranges for all the existing
VKD3D_SHADER_LOG_ERROR ranges using the current allocation scheme,
4-digit error codes would already be insufficient. (And there are
still some sources/targets we may potentially add; HLSL of course, but
also GLSL, perhaps MSL, probably DXIL, D3D shader model 1-3 bytecode.)
Dec. 14, 2020
Re: [PATCH v2 vkd3d 1/4] vkd3d-shader: Handle preprocessor parsing errors.
by Henri Verbeet
On Sat, 12 Dec 2020 at 01:52, Zebediah Figura (she/her)
<zfigura(a)codeweavers.com> wrote:
>
> On 12/11/20 12:11 PM, Henri Verbeet wrote:
> > On Fri, 11 Dec 2020 at 00:27, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> >> +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;
> >> };
> >>
> > There seems to be some duplication of location information between
> > struct vkd3d_shader_message_context, struct preproc_ctx, and struct
> > preproc_location. Is that intentional? If it is, would it make sense
> > to introduce e.g. a struct vkd3d_shader_source_location instead of
> > struct preproc_location, and then use that structure in both struct
> > vkd3d_shader_message_context and struct preproc_ctx?
>
> Wrt the vkd3d_shader_message_context part—the current structure
> definitely isn't a great fit for the preprocessor or HLSL parser (i.e.
> the parts that use yacc) because the location tracking means that we'll
> be setting a new location on every error call. (And of course most of
> the other parsers we have don't really have a meaningful concept of
> line/column locations...) But I wasn't sure enough to actually try to
> redesign those parts, and it seemed like something that could be
> deferred, so I just left it alone...
>
I probably haven't looked at this series in enough detail, so I may be
missing something obvious, but is the issue that we're getting an
explicit location in yyerror() that may not match the location stored
in struct preproc_ctx? I think it would be fine to pass an explicit
location to vkd3d_shader_error() and similar functions as well, and
moving location tracking out of struct vkd3d_shader_message_context.
That probably doesn't need to delay this series, but if that change is
what we want, it seems easier to make it sooner rather than later.
It does look like we'd want a struct vkd3d_shader_source_location
instead of struct preproc_location in that case.
> Wrt preproc_location vs preproc_ctx—part of the rub here is that {line,
> column} is a bit different from {first_line, first_column}; i.e. if we
> were to add {last_line, last_column}, that wouldn't be a part of
> preproc_ctx.
>
Hmm, right.
Dec. 14, 2020
Re: [PATCH] crypt32/tests: Fix a registerOIDInfo() failure when missing elevated privileges.
by Francois Gouget
On Mon, 14 Dec 2020, Dmitry Timoshkov wrote:
> Francois Gouget <fgouget(a)codeweavers.com> wrote:
>
> > @@ -314,7 +330,7 @@ static void test_registerOIDFunction(void)
> > SetLastError(0xdeadbeef);
> > ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "CryptDllEncodeObject",
> > "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
> > - if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
> > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > {
> > skip("Need admin rights\n");
> > return;
> > @@ -393,7 +409,7 @@ static void test_registerDefaultOIDFunction(void)
> > SetLastError(0xdeadbeef);
> > ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
> > bogusDll);
> > - if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
> > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > {
> > skip("Need admin rights\n");
> > return;
> > @@ -499,7 +515,7 @@ static void test_getDefaultOIDFunctionAddress(void)
> > SetLastError(0xdeadbeef);
> > ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
> > bogusDll);
> > - if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
> > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > skip("Need admin rights\n");
> > else
> > ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
>
> In which cases the changes above are needed? It seems that this only
> complicates things without a reason and could potentially slow down
> the tests execution.
These are not strictly needed. Rather the goal is to verify that we only
get ERROR_ACCESS_DENIED when missing elevated privileges rather than
blindly assuming the access denied error is justified.
> > @@ -645,7 +661,11 @@ static void test_registerOIDInfo(void)
> > info1.pszOID = test_oid;
> > SetLastError(0xdeadbeef);
> > ret = CryptUnregisterOIDInfo(&info1);
> > - ok(!ret, "should fail\n");
> > + if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
> > + {
> > + skip("Need admin rights FIXME\n");
> > + return;
> > + } ok(!ret, "should fail\n");
>
> This change doesn't look right. Most likely it's not needed here.
It is needed:
https://test.winehq.org/data/3acb0b3326c4120ea0c4c6076bd03c9cfe82c744/win10…
--
Francois Gouget <fgouget(a)codeweavers.com>
Dec. 14, 2020