winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
September 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
920 discussions
Start a n
N
ew thread
Zebediah Figura : wined3d: Make wined3d_stateblock_state_{init,cleanup}() static.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: fb0c4ec5a32791ce43eecffcafc4478da26c7d6e URL:
https://gitlab.winehq.org/wine/wine/-/commit/fb0c4ec5a32791ce43eecffcafc447…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Dec 29 16:59:02 2022 -0600 wined3d: Make wined3d_stateblock_state_{init,cleanup}() static. --- dlls/wined3d/stateblock.c | 4 ++-- dlls/wined3d/wined3d_private.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 3cd7077eab2..b263bbb8fda 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -489,7 +489,7 @@ void state_unbind_resources(struct wined3d_state *state) } } -void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) +static void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) { struct wined3d_light_info *light, *cursor; struct wined3d_vertex_declaration *decl; @@ -2065,7 +2065,7 @@ static void stateblock_state_init_default(struct wined3d_stateblock_state *state state->streams[i].frequency = 1; } -void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, +static void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, const struct wined3d_device *device, uint32_t flags) { rb_init(&state->light_state->lights_tree, lights_compare); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 09f078344c8..c89bd191255 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3608,10 +3608,6 @@ struct wined3d_stateblock unsigned int num_contained_sampler_states; }; -void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state, - const struct wined3d_device *device, uint32_t flags) DECLSPEC_HIDDEN; -void wined3d_stateblock_state_cleanup(struct wined3d_stateblock_state *state) DECLSPEC_HIDDEN; - bool wined3d_light_state_enable_light(struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN; struct wined3d_light_info *wined3d_light_state_get_light(const struct wined3d_light_state *state,
1
0
0
0
Zebediah Figura : wined3d: Remove invalid parameter checks from internal wined3d_device_set_*() functions.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 7bb6dc7b83947545995759aab44c3be22ddb70b4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7bb6dc7b83947545995759aab44c3b…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Dec 29 16:57:26 2022 -0600 wined3d: Remove invalid parameter checks from internal wined3d_device_set_*() functions. --- dlls/wined3d/stateblock.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 2dfc53a8359..3cd7077eab2 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2398,30 +2398,22 @@ static void wined3d_device_set_light_enable(struct wined3d_device *device, unsig wined3d_device_context_emit_set_light_enable(&device->cs->c, light_idx, enable); } -static HRESULT wined3d_device_set_clip_plane(struct wined3d_device *device, +static void wined3d_device_set_clip_plane(struct wined3d_device *device, unsigned int plane_idx, const struct wined3d_vec4 *plane) { struct wined3d_vec4 *clip_planes = device->cs->c.state->clip_planes; TRACE("device %p, plane_idx %u, plane %p.\n", device, plane_idx, plane); - if (plane_idx >= device->adapter->d3d_info.limits.max_clip_distances) - { - TRACE("Application has requested clipplane this device doesn't support.\n"); - return WINED3DERR_INVALIDCALL; - } - if (!memcmp(&clip_planes[plane_idx], plane, sizeof(*plane))) { TRACE("Application is setting old values over, nothing to do.\n"); - return WINED3D_OK; + return; } clip_planes[plane_idx] = *plane; wined3d_device_context_emit_set_clip_plane(&device->cs->c, plane_idx, plane); - - return WINED3D_OK; } static void resolve_depth_buffer(struct wined3d_device *device) @@ -2446,12 +2438,6 @@ static void resolve_depth_buffer(struct wined3d_device *device) static void wined3d_device_set_render_state(struct wined3d_device *device, enum wined3d_render_state state, unsigned int value) { - if (state > WINEHIGHEST_RENDER_STATE) - { - WARN("Unhandled render state %#x.\n", state); - return; - } - if (value == device->cs->c.state->render_states[state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2472,18 +2458,9 @@ static void wined3d_device_set_render_state(struct wined3d_device *device, static void wined3d_device_set_texture_stage_state(struct wined3d_device *device, unsigned int stage, enum wined3d_texture_stage_state state, uint32_t value) { - const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; - TRACE("device %p, stage %u, state %s, value %#x.\n", device, stage, debug_d3dtexturestate(state), value); - if (stage >= d3d_info->limits.ffp_blend_stages) - { - WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n", - stage, d3d_info->limits.ffp_blend_stages - 1); - return; - } - if (value == device->cs->c.state->texture_states[stage][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2519,12 +2496,6 @@ static void wined3d_device_set_texture(struct wined3d_device *device, TRACE("device %p, stage %u, texture %p.\n", device, stage, texture); - if (stage >= ARRAY_SIZE(state->textures)) - { - WARN("Ignoring invalid stage %u.\n", stage); - return; - } - prev = state->textures[stage]; TRACE("Previous texture %p.\n", prev);
1
0
0
0
Akihiro Sagawa : cmd: Always outputs leading zeros when listing file time information.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: ae8b7109f050754d95c15752741fa29059cd278e URL:
https://gitlab.winehq.org/wine/wine/-/commit/ae8b7109f050754d95c15752741fa2…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Sep 19 22:39:10 2023 +0900 cmd: Always outputs leading zeros when listing file time information. --- programs/cmd/directory.c | 118 +++++++++++++++++++++++++++++++++++++++-- programs/cmd/tests/directory.c | 4 -- 2 files changed, 114 insertions(+), 8 deletions(-) diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c index 6efcbb3a841..4d3ae3f9c7d 100644 --- a/programs/cmd/directory.c +++ b/programs/cmd/directory.c @@ -41,6 +41,10 @@ typedef enum _DISPLAYORDER Date } DISPLAYORDER; +#define MAX_DATETIME_FORMAT 80 + +static WCHAR date_format[MAX_DATETIME_FORMAT * 2]; +static WCHAR time_format[MAX_DATETIME_FORMAT * 2]; static int file_total, dir_total, max_width; static ULONGLONG byte_total; static DISPLAYTIME dirTime; @@ -345,8 +349,10 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le FileTimeToLocalFileTime (&fd[i].ftCreationTime, &ft); } FileTimeToSystemTime (&ft, &st); - GetDateFormatW(0, DATE_SHORTDATE, &st, NULL, datestring, ARRAY_SIZE(datestring)); - GetTimeFormatW(0, TIME_NOSECONDS, &st, NULL, timestring, ARRAY_SIZE(timestring)); + GetDateFormatW(LOCALE_USER_DEFAULT, 0, &st, date_format, + datestring, ARRAY_SIZE(datestring)); + GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, time_format, + timestring, ARRAY_SIZE(timestring)); if (wide) { @@ -375,7 +381,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le dir_count++; if (!bare) { - WCMD_output (L"%1!10s! %2!8s! <DIR> ", datestring, timestring); + WCMD_output (L"%1 %2 <DIR> ", datestring, timestring); if (shortname) WCMD_output(L"%1!-13s!", fd[i].cAlternateFileName); if (usernames) WCMD_output(L"%1!-23s!", username); WCMD_output(L"%1",fd[i].cFileName); @@ -394,7 +400,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le file_size.u.HighPart = fd[i].nFileSizeHigh; byte_count.QuadPart += file_size.QuadPart; if (!bare) { - WCMD_output (L"%1!10s! %2!8s! %3!10s! ", datestring, timestring, + WCMD_output (L"%1 %2 %3!14s! ", datestring, timestring, WCMD_filesize64(file_size.QuadPart)); if (shortname) WCMD_output(L"%1!-13s!", fd[i].cAlternateFileName); if (usernames) WCMD_output(L"%1!-23s!", username); @@ -523,6 +529,107 @@ static void WCMD_dir_trailer(const WCHAR *path) { } } +/* Get the length of a date/time formatting pattern */ +/* copied from dlls/kernelbase/locale.c */ +static int get_pattern_len( const WCHAR *pattern, const WCHAR *accept ) +{ + int i; + + if (*pattern == '\'') + { + for (i = 1; pattern[i]; i++) + { + if (pattern[i] != '\'') continue; + if (pattern[++i] != '\'') return i; + } + return i; + } + if (!wcschr( accept, *pattern )) return 1; + for (i = 1; pattern[i]; i++) if (pattern[i] != pattern[0]) break; + return i; +} + +/* Initialize date format to use abbreviated one with leading zeros */ +static void init_date_format(void) +{ + WCHAR sys_format[MAX_DATETIME_FORMAT]; + int src_pat_len, dst_pat_len; + const WCHAR *src; + WCHAR *dst = date_format; + + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, sys_format, ARRAY_SIZE(sys_format)); + + for (src = sys_format; *src; src += src_pat_len, dst += dst_pat_len) { + src_pat_len = dst_pat_len = get_pattern_len(src, L"yMd"); + + switch (*src) + { + case '\'': + wmemcpy(dst, src, src_pat_len); + break; + + case 'd': + case 'M': + if (src_pat_len == 4) /* full name */ + dst_pat_len--; /* -> use abbreviated one */ + /* fallthrough */ + case 'y': + if (src_pat_len == 1) /* without leading zeros */ + dst_pat_len++; /* -> with leading zeros */ + wmemset(dst, *src, dst_pat_len); + break; + + default: + *dst = *src; + break; + } + } + *dst = '\0'; + + TRACE("date format: %s\n", wine_dbgstr_w(date_format)); +} + +/* Initialize time format to use leading zeros */ +static void init_time_format(void) +{ + WCHAR sys_format[MAX_DATETIME_FORMAT]; + int src_pat_len, dst_pat_len; + const WCHAR *src; + WCHAR *dst = time_format; + + GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, sys_format, ARRAY_SIZE(sys_format)); + + for (src = sys_format; *src; src += src_pat_len, dst += dst_pat_len) { + src_pat_len = dst_pat_len = get_pattern_len(src, L"Hhmst"); + + switch (*src) + { + case '\'': + wmemcpy(dst, src, src_pat_len); + break; + + case 'H': + case 'h': + case 'm': + case 's': + if (src_pat_len == 1) /* without leading zeros */ + dst_pat_len++; /* -> with leading zeros */ + /* fallthrough */ + case 't': + wmemset(dst, *src, dst_pat_len); + break; + + default: + *dst = *src; + break; + } + } + *dst = '\0'; + + /* seconds portion will be dropped by TIME_NOSECONDS */ + TRACE("time format: %s\n", wine_dbgstr_w(time_format)); +} + /***************************************************************************** * WCMD_directory * @@ -727,6 +834,9 @@ void WCMD_directory (WCHAR *args) WCMD_enter_paged_mode(NULL); } + init_date_format(); + init_time_format(); + argno = 0; argN = args; GetCurrentDirectoryW(MAX_PATH, cwd); diff --git a/programs/cmd/tests/directory.c b/programs/cmd/tests/directory.c index 6644bc52b35..1a62ce120ca 100644 --- a/programs/cmd/tests/directory.c +++ b/programs/cmd/tests/directory.c @@ -163,7 +163,6 @@ static BOOL match_timestamp(const char* line, void *data) (!strncmp(ptr, "dd", 2) || !strncmp(ptr, "d", 1))) { sprintf(pattern, "%02hd", param->st.wDay); - todo_wine_if(strncmp(ptr, "dd", 2)) ok(!!strstr(line, pattern), "expected day %s, got %s\n", pattern, wine_dbgstr_a(line)); } else @@ -173,7 +172,6 @@ static BOOL match_timestamp(const char* line, void *data) (!strncmp(ptr, "MM", 2) || !strncmp(ptr, "M", 1))) { sprintf(pattern, "%02hd", param->st.wMonth); - todo_wine_if(strncmp(ptr, "MM", 2)) ok(!!strstr(line, pattern), "expected month %s, got %s\n", pattern, wine_dbgstr_a(line)); } else @@ -183,7 +181,6 @@ static BOOL match_timestamp(const char* line, void *data) if (strstr(format, "h") || strstr(format, "H")) { sprintf(pattern, "%02hd", param->st.wHour); - todo_wine_if(!strstr(format, "hh") && !strstr(format, "HH")) ok(!!strstr(line, pattern), "expected hour %s, got %s\n", pattern, wine_dbgstr_a(line)); } else @@ -192,7 +189,6 @@ static BOOL match_timestamp(const char* line, void *data) if (strstr(format, "m")) { sprintf(pattern, "%02hd", param->st.wMinute); - todo_wine_if(!strstr(format, "mm")) ok(!!strstr(line, pattern), "expected minute %s, got %s\n", pattern, wine_dbgstr_a(line)); } else
1
0
0
0
Akihiro Sagawa : cmd/tests: Test file time stamp format.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 2188e11e787c85a3fa08df20a4edf3a5e7441a3c URL:
https://gitlab.winehq.org/wine/wine/-/commit/2188e11e787c85a3fa08df20a4edf3…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Sep 19 22:38:41 2023 +0900 cmd/tests: Test file time stamp format. --- programs/cmd/tests/directory.c | 127 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/programs/cmd/tests/directory.c b/programs/cmd/tests/directory.c index 7b965f068b0..6644bc52b35 100644 --- a/programs/cmd/tests/directory.c +++ b/programs/cmd/tests/directory.c @@ -25,6 +25,8 @@ static char stdout_buffer[MAX_BUFFER], stderr_buffer[MAX_BUFFER]; static DWORD stdout_size, stderr_size; static char work_dir[MAX_PATH]; +typedef BOOL (*find_line_callback)(const char* line, void *data); + static void read_all_from_handle(HANDLE handle, char *buffer, DWORD *size) { char bytes[4096]; @@ -88,6 +90,36 @@ static void _run_dir(const char *file, int line, const char *commandline, int ex exitcode_expected, exitcode); } +static BOOL find_line(const char* buf, find_line_callback callback, void *data) +{ + BOOL found = FALSE; + const char* p = buf; + char *line = NULL; + size_t size = 0; + + while (*p) + { + size_t len; + const char* eol = strpbrk(p, "\r\n"); + len = eol ? (eol - p) : strlen(p); + if (len + 1 > size) + { + char *ptr = realloc(line, len + 1); + if (!ptr) break; + line = ptr; + size = len + 1; + } + memcpy(line, p, len); + line[len] = '\0'; + found = callback(line, data); + if (found) break; + if (*eol == '\r' && *(eol+1) == '\n') eol++; + p = eol + 1; + } + free(line); + return found; +} + static void test_basic(void) { /* no options */ @@ -111,6 +143,100 @@ static void test_basic(void) ok(stderr_size == 0, "unexpected stderr buffer size %ld.\n", stderr_size); } +struct timestamp_param { + SYSTEMTIME st; + const char* filename; +}; + +static BOOL match_timestamp(const char* line, void *data) +{ + const struct timestamp_param *param = (const struct timestamp_param *)data; + char pattern[MAX_BUFFER], *ptr; + + if ((ptr = strstr(line, " 0 ")) && strstr(ptr, param->filename)) { + char format[60]; + + while (*ptr == ' ') *ptr-- = '\0'; + + GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, format, sizeof(format)); + if ((ptr = strstr(format, "d")) && strncmp(ptr, "ddd", 3) && + (!strncmp(ptr, "dd", 2) || !strncmp(ptr, "d", 1))) + { + sprintf(pattern, "%02hd", param->st.wDay); + todo_wine_if(strncmp(ptr, "dd", 2)) + ok(!!strstr(line, pattern), "expected day %s, got %s\n", pattern, wine_dbgstr_a(line)); + } + else + skip("date format %s doesn't represent day of the month as digits\n", wine_dbgstr_a(format)); + + if ((ptr = strstr(format, "M")) && strncmp(ptr, "MMM", 3) && + (!strncmp(ptr, "MM", 2) || !strncmp(ptr, "M", 1))) + { + sprintf(pattern, "%02hd", param->st.wMonth); + todo_wine_if(strncmp(ptr, "MM", 2)) + ok(!!strstr(line, pattern), "expected month %s, got %s\n", pattern, wine_dbgstr_a(line)); + } + else + skip("date format %s doesn't represent month as digits\n", wine_dbgstr_a(format)); + + GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, format, sizeof(format)); + if (strstr(format, "h") || strstr(format, "H")) + { + sprintf(pattern, "%02hd", param->st.wHour); + todo_wine_if(!strstr(format, "hh") && !strstr(format, "HH")) + ok(!!strstr(line, pattern), "expected hour %s, got %s\n", pattern, wine_dbgstr_a(line)); + } + else + skip("time format %s doesn't represent hour as digits\n", wine_dbgstr_a(format)); + + if (strstr(format, "m")) + { + sprintf(pattern, "%02hd", param->st.wMinute); + todo_wine_if(!strstr(format, "mm")) + ok(!!strstr(line, pattern), "expected minute %s, got %s\n", pattern, wine_dbgstr_a(line)); + } + else + skip("time format %s doesn't represent minute as digits\n", wine_dbgstr_a(format)); + + return TRUE; + } + return FALSE; +} + +static void test_timestamp(void) +{ + static const char* filename = "test.dir"; + FILETIME local, ft; + SYSTEMTIME st = { + /* Use single digits for leading zeros except the year */ + .wYear = 2009, .wMonth = 1, .wDay = 3, .wHour = 5, .wMinute = 7, + }; + struct timestamp_param param = { + .filename = filename, + }; + HANDLE file; + BOOL ret; + + file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "Can't create file, err %lu\n", GetLastError()); + + SystemTimeToFileTime(&st, &local); + LocalFileTimeToFileTime(&local, &ft); + SetFileTime(file, NULL, NULL, &ft); + FileTimeToLocalFileTime(&ft, &local); + FileTimeToSystemTime(&local, ¶m.st); + + CloseHandle(file); + + run_dir(filename, 0); + stdout_buffer[stdout_size] = '\0'; + ret = find_line(stdout_buffer, match_timestamp, ¶m); + ok(ret, "file name is not found in the output\n"); + + ret = DeleteFileA(filename); + ok(ret, "Can't delete file, err %lu\n", GetLastError()); +} + START_TEST(directory) { WCHAR curdir[MAX_PATH]; @@ -125,6 +251,7 @@ START_TEST(directory) ok(ret, "Failed to set the working directory\n"); test_basic(); + test_timestamp(); ret = SetCurrentDirectoryW(curdir); ok(ret, "Failed to restore the current directory\n");
1
0
0
0
Akihiro Sagawa : cmd/tests: Add dir built-in command test.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 6800ab403e94d626f5ca0d01c516eae0a4a8a896 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6800ab403e94d626f5ca0d01c516ea…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Sep 19 22:38:41 2023 +0900 cmd/tests: Add dir built-in command test. --- programs/cmd/tests/Makefile.in | 3 +- programs/cmd/tests/directory.c | 133 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) diff --git a/programs/cmd/tests/Makefile.in b/programs/cmd/tests/Makefile.in index 87942fedcf9..9f50cbe042b 100644 --- a/programs/cmd/tests/Makefile.in +++ b/programs/cmd/tests/Makefile.in @@ -1,6 +1,7 @@ TESTDLL = cmd.exe C_SRCS = \ - batch.c + batch.c \ + directory.c RC_SRCS = rsrc.rc diff --git a/programs/cmd/tests/directory.c b/programs/cmd/tests/directory.c new file mode 100644 index 00000000000..7b965f068b0 --- /dev/null +++ b/programs/cmd/tests/directory.c @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Akihiro Sagawa + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include "wine/test.h" + +#define MAX_BUFFER 65536 + +static char stdout_buffer[MAX_BUFFER], stderr_buffer[MAX_BUFFER]; +static DWORD stdout_size, stderr_size; +static char work_dir[MAX_PATH]; + +static void read_all_from_handle(HANDLE handle, char *buffer, DWORD *size) +{ + char bytes[4096]; + DWORD bytes_read; + + memset(buffer, 0, MAX_BUFFER); + *size = 0; + for (;;) + { + BOOL success = ReadFile(handle, bytes, sizeof(bytes), &bytes_read, NULL); + if (!success || !bytes_read) + break; + if (*size + bytes_read > MAX_BUFFER) + { + ok(FALSE, "Insufficient buffer.\n"); + break; + } + memcpy(buffer + *size, bytes, bytes_read); + *size += bytes_read; + } +} + +#define run_dir(a, b) _run_dir(__FILE__, __LINE__, a, b) +static void _run_dir(const char *file, int line, const char *commandline, int exitcode_expected) +{ + HANDLE child_stdout_write, child_stderr_write, parent_stdout_read, parent_stderr_read; + SECURITY_ATTRIBUTES security_attributes = {0}; + PROCESS_INFORMATION process_info = {0}; + STARTUPINFOA startup_info = {0}; + DWORD exitcode; + char cmd[256]; + + security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); + security_attributes.bInheritHandle = TRUE; + + CreatePipe(&parent_stdout_read, &child_stdout_write, &security_attributes, 0); + CreatePipe(&parent_stderr_read, &child_stderr_write, &security_attributes, 0); + SetHandleInformation(parent_stdout_read, HANDLE_FLAG_INHERIT, 0); + SetHandleInformation(parent_stderr_read, HANDLE_FLAG_INHERIT, 0); + + startup_info.cb = sizeof(STARTUPINFOA); + startup_info.hStdOutput = child_stdout_write; + startup_info.hStdError = child_stderr_write; + startup_info.dwFlags |= STARTF_USESTDHANDLES; + + sprintf(cmd, "cmd.exe /d /c dir %s", commandline); + CreateProcessA(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info); + CloseHandle(child_stdout_write); + CloseHandle(child_stderr_write); + + read_all_from_handle(parent_stdout_read, stdout_buffer, &stdout_size); + read_all_from_handle(parent_stderr_read, stderr_buffer, &stderr_size); + CloseHandle(parent_stdout_read); + CloseHandle(parent_stderr_read); + + WaitForSingleObject(process_info.hProcess, INFINITE); + GetExitCodeProcess(process_info.hProcess, &exitcode); + CloseHandle(process_info.hProcess); + CloseHandle(process_info.hThread); + ok_(file, line)(exitcode == exitcode_expected, "expected exitcode %d, got %ld\n", + exitcode_expected, exitcode); +} + +static void test_basic(void) +{ + /* no options */ + run_dir("", 0); + ok(stdout_size > 0, "unexpected stdout buffer size %ld.\n", stdout_size); + ok(stderr_size == 0, "unexpected stderr buffer size %ld.\n", stderr_size); + + /* if file doesn't exist, cmd.exe prints an error message to stderr. */ + run_dir("nonexistent", 1); + ok(stdout_size > 0, "unexpected stdout buffer size %ld.\n", stdout_size); + ok(stderr_size > 0, "unexpected stderr buffer size %ld.\n", stderr_size); + + /* unknown option produces an error message to stderr. */ + run_dir("/*", 1); + ok(stdout_size == 0, "unexpected stdout buffer size %ld.\n", stdout_size); + ok(stderr_size > 0, "unexpected stderr buffer size %ld.\n", stderr_size); + + /* errorlevel for usage is 0. But, cmd.exe's exit code is 1. */ + todo_wine run_dir("/?", 1); + ok(stdout_size > 0, "unexpected stdout buffer size %ld.\n", stdout_size); + ok(stderr_size == 0, "unexpected stderr buffer size %ld.\n", stderr_size); +} + +START_TEST(directory) +{ + WCHAR curdir[MAX_PATH]; + BOOL ret; + + GetCurrentDirectoryW(ARRAY_SIZE(curdir), curdir); + GetTempPathA(ARRAY_SIZE(work_dir), work_dir); + lstrcatA(work_dir, "winetest.dir"); + ret = CreateDirectoryA(work_dir, NULL); + ok(ret, "Failed to create %s\n", work_dir); + ret = SetCurrentDirectoryA(work_dir); + ok(ret, "Failed to set the working directory\n"); + + test_basic(); + + ret = SetCurrentDirectoryW(curdir); + ok(ret, "Failed to restore the current directory\n"); + ret = RemoveDirectoryA(work_dir); + ok(ret, "Failed to remove the working directory\n"); +}
1
0
0
0
Brendan Shanks : msv1_0: Implement ntlm_fork() using posix_spawn().
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 6d366ce7b40d4adf043e23065db92a98660a99a2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6d366ce7b40d4adf043e23065db92a…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Wed Sep 13 12:01:13 2023 -0700 msv1_0: Implement ntlm_fork() using posix_spawn(). --- dlls/msv1_0/unixlib.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/dlls/msv1_0/unixlib.c b/dlls/msv1_0/unixlib.c index 5ab028ed51f..b51dde2ef0a 100644 --- a/dlls/msv1_0/unixlib.c +++ b/dlls/msv1_0/unixlib.c @@ -28,6 +28,7 @@ #include <unistd.h> #include <fcntl.h> #include <errno.h> +#include <spawn.h> #include <sys/wait.h> #include "ntstatus.h" #define WIN32_NO_STATUS @@ -39,6 +40,8 @@ #include "wine/debug.h" #include "unixlib.h" +extern char **environ; + WINE_DEFAULT_DEBUG_CHANNEL(ntlm); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -155,6 +158,7 @@ static NTSTATUS ntlm_fork( void *args ) { const struct fork_params *params = args; struct ntlm_ctx *ctx = params->ctx; + posix_spawn_file_actions_t file_actions; int pipe_in[2], pipe_out[2]; #ifdef HAVE_PIPE2 @@ -179,29 +183,29 @@ static NTSTATUS ntlm_fork( void *args ) fcntl( pipe_out[1], F_SETFD, FD_CLOEXEC ); } - if (!(ctx->pid = fork())) /* child */ - { - dup2( pipe_out[0], 0 ); - close( pipe_out[0] ); - close( pipe_out[1] ); + posix_spawn_file_actions_init( &file_actions ); - dup2( pipe_in[1], 1 ); - close( pipe_in[0] ); - close( pipe_in[1] ); + posix_spawn_file_actions_adddup2( &file_actions, pipe_out[0], 0 ); + posix_spawn_file_actions_addclose( &file_actions, pipe_out[0] ); + posix_spawn_file_actions_addclose( &file_actions, pipe_out[1] ); - execvp( params->argv[0], params->argv ); + posix_spawn_file_actions_adddup2( &file_actions, pipe_in[1], 1 ); + posix_spawn_file_actions_addclose( &file_actions, pipe_in[0] ); + posix_spawn_file_actions_addclose( &file_actions, pipe_in[1] ); - write( 1, "BH\n", 3 ); - _exit( 1 ); - } - else + if (posix_spawnp( &ctx->pid, params->argv[0], &file_actions, NULL, params->argv, environ )) { - ctx->pipe_in = pipe_in[0]; - close( pipe_in[1] ); - ctx->pipe_out = pipe_out[1]; - close( pipe_out[0] ); + ctx->pid = -1; + write( pipe_in[1], "BH\n", 3 ); } + ctx->pipe_in = pipe_in[0]; + close( pipe_in[1] ); + ctx->pipe_out = pipe_out[1]; + close( pipe_out[0] ); + + posix_spawn_file_actions_destroy( &file_actions ); + return SEC_E_OK; }
1
0
0
0
Bartosz Kosiorek : gdiplus/tests: Add tests of InterpolationMode Bilinear for GdipDrawImagePointsRect.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: d18fd2c194e98840828b36394107dad02b292f62 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d18fd2c194e98840828b36394107da…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Sun Sep 17 19:28:30 2023 +0200 gdiplus/tests: Add tests of InterpolationMode Bilinear for GdipDrawImagePointsRect. --- dlls/gdiplus/tests/image.c | 112 +++++++++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 34 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 18fe8fcba37..4d93e28d951 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -4797,6 +4797,23 @@ static void test_image_format(void) } } +INT compare_with_precision(const BYTE *ptr1, const BYTE *ptr2, size_t num, INT precision) +{ + if (ptr1 == NULL || ptr2 == NULL) + return ptr1 < ptr2 ? -1 : 1; + + for (size_t i = 0; i < num; i++) + { + INT byte1 = ptr1[i]; + INT byte2 = ptr2[i]; + + if ((byte1 < byte2 - precision) || (byte1 > byte2 + precision)) + return byte1 < byte2 ? -1 : 1; + } + + return 0; +} + static void test_DrawImage_scale(void) { static const BYTE back_8x1[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, @@ -4825,45 +4842,71 @@ static void test_DrawImage_scale(void) 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0x40,0x40,0x40, 0x40,0x40,0x40 }; static const BYTE image_250_half[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0x80,0x80,0x80, 0x80,0x80,0x80, 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0x40,0x40,0x40 }; + + static const BYTE image_bil_080[24] = { 0x40,0x40,0x40, 0x93,0x93,0x93, 0x86,0x86,0x86, 0x40,0x40,0x40, + 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 }; + static const BYTE image_bil_120[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0xb2,0xb2,0xb2, 0x87,0x87,0x87, + 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 }; + static const BYTE image_bil_150[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x99,0x99,0x99, 0xcc,0xcc,0xcc, + 0x6f,0x6f,0x6f, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 }; + static const BYTE image_bil_180[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x88,0x88,0x88, 0xb2,0xb2,0xb2, + 0xad,0xad,0xad, 0x5f,0x5f,0x5f, 0x40,0x40,0x40, 0x40,0x40,0x40 }; + static const BYTE image_bil_200[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0xa6,0xa6,0xa6, + 0xcc,0xcc,0xcc, 0x86,0x86,0x86, 0x40,0x40,0x40, 0x40,0x40,0x40 }; + static const BYTE image_bil_250[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x8f,0x8f,0x8f, + 0xad,0xad,0xad, 0xcc,0xcc,0xcc, 0x95,0x95,0x95, 0x5c,0x5c,0x5c }; static const struct test_data { REAL scale_x; + InterpolationMode interpolation_mode; PixelOffsetMode pixel_offset_mode; const BYTE *image; + INT precision; BOOL todo; } td[] = { - { 0.8, PixelOffsetModeNone, image_080 }, /* 0 */ - { 1.0, PixelOffsetModeNone, image_100 }, - { 1.2, PixelOffsetModeNone, image_120 }, - { 1.5, PixelOffsetModeNone, image_150 }, - { 1.8, PixelOffsetModeNone, image_180 }, - { 2.0, PixelOffsetModeNone, image_200 }, - { 2.5, PixelOffsetModeNone, image_250 }, - - { 0.8, PixelOffsetModeHighSpeed, image_080 }, /* 7 */ - { 1.0, PixelOffsetModeHighSpeed, image_100 }, - { 1.2, PixelOffsetModeHighSpeed, image_120 }, - { 1.5, PixelOffsetModeHighSpeed, image_150 }, - { 1.8, PixelOffsetModeHighSpeed, image_180 }, - { 2.0, PixelOffsetModeHighSpeed, image_200 }, - { 2.5, PixelOffsetModeHighSpeed, image_250 }, - - { 0.8, PixelOffsetModeHalf, image_080 }, /* 14 */ - { 1.0, PixelOffsetModeHalf, image_100 }, - { 1.2, PixelOffsetModeHalf, image_120_half, TRUE }, - { 1.5, PixelOffsetModeHalf, image_150_half, TRUE }, - { 1.8, PixelOffsetModeHalf, image_180_half, TRUE }, - { 2.0, PixelOffsetModeHalf, image_200_half, TRUE }, - { 2.5, PixelOffsetModeHalf, image_250_half, TRUE }, - - { 0.8, PixelOffsetModeHighQuality, image_080 }, /* 21 */ - { 1.0, PixelOffsetModeHighQuality, image_100 }, - { 1.2, PixelOffsetModeHighQuality, image_120_half, TRUE }, - { 1.5, PixelOffsetModeHighQuality, image_150_half, TRUE }, - { 1.8, PixelOffsetModeHighQuality, image_180_half, TRUE }, - { 2.0, PixelOffsetModeHighQuality, image_200_half, TRUE }, - { 2.5, PixelOffsetModeHighQuality, image_250_half, TRUE }, + { 0.8, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_080 }, /* 0 */ + { 1.0, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_100 }, + { 1.2, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_120 }, + { 1.5, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_150 }, + { 1.8, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_180 }, + { 2.0, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_200 }, + { 2.5, InterpolationModeNearestNeighbor, PixelOffsetModeNone, image_250 }, + + { 0.8, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_080 }, /* 7 */ + { 1.0, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_100 }, + { 1.2, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_120 }, + { 1.5, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_150 }, + { 1.8, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_180 }, + { 2.0, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_200 }, + { 2.5, InterpolationModeNearestNeighbor, PixelOffsetModeHighSpeed, image_250 }, + + /* TODO There are missing left pixel column of image*/ + { 0.8, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_080 }, /* 14 */ + { 1.0, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_100 }, + { 1.2, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_120_half, 0, TRUE }, + { 1.5, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_150_half, 0, TRUE }, + { 1.8, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_180_half, 0, TRUE }, + { 2.0, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_200_half, 0, TRUE }, + { 2.5, InterpolationModeNearestNeighbor, PixelOffsetModeHalf, image_250_half, 0, TRUE }, + + { 0.8, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_080 }, /* 21 */ + { 1.0, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_100 }, + { 1.2, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_120_half, 0, TRUE }, + { 1.5, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_150_half, 0, TRUE }, + { 1.8, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_180_half, 0, TRUE }, + { 2.0, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_200_half, 0, TRUE }, + { 2.5, InterpolationModeNearestNeighbor, PixelOffsetModeHighQuality, image_250_half, 0, TRUE }, + + /* The bilinear interpolation results are little bit different than on Windows */ + /* TODO In two cases, there are missing right pixel column of image */ + { 0.8, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_080, 1, TRUE }, /* 28 */ + { 1.0, InterpolationModeBilinear, PixelOffsetModeNone, image_100 }, + { 1.2, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_120, 2 }, + { 1.5, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_150, 1 }, + { 1.8, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_180, 1, TRUE }, + { 2.0, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_200, 1 }, + { 2.5, InterpolationModeBilinear, PixelOffsetModeNone, image_bil_250, 1 }, }; BYTE src_2x1[6] = { 0x80,0x80,0x80, 0xcc,0xcc,0xcc }; BYTE dst_8x1[24]; @@ -4888,11 +4931,12 @@ static void test_DrawImage_scale(void) expect(Ok, status); status = GdipGetImageGraphicsContext(u2.image, &graphics); expect(Ok, status); - status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); - expect(Ok, status); for (i = 0; i < ARRAY_SIZE(td); i++) { + status = GdipSetInterpolationMode(graphics, td[i].interpolation_mode); + expect(Ok, status); + status = GdipSetPixelOffsetMode(graphics, td[i].pixel_offset_mode); expect(Ok, status); @@ -4906,7 +4950,7 @@ static void test_DrawImage_scale(void) status = GdipDrawImageI(graphics, u1.image, 1, 0); expect(Ok, status); - match = memcmp(dst_8x1, td[i].image, sizeof(dst_8x1)) == 0; + match = compare_with_precision(dst_8x1, td[i].image, sizeof(dst_8x1), td[i].precision) == 0; todo_wine_if (!match && td[i].todo) ok(match, "%d: data should match\n", i); if (!match)
1
0
0
0
Andrew Brobston : d2d1: Support GUID_WICPixelFormat32bppRGB.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 54b875c08e5700426078f141ce897feb54ca6c94 URL:
https://gitlab.winehq.org/wine/wine/-/commit/54b875c08e5700426078f141ce897f…
Author: Andrew Brobston <winehq(a)brobston.com> Date: Sun Sep 24 11:01:53 2023 -0500 d2d1: Support GUID_WICPixelFormat32bppRGB. Needed by PowerFritz 18. --- dlls/d2d1/bitmap.c | 1 + dlls/d2d1/tests/d2d1.c | 1 + 2 files changed, 2 insertions(+) diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c index 316d0f25ad6..e5048611519 100644 --- a/dlls/d2d1/bitmap.c +++ b/dlls/d2d1/bitmap.c @@ -680,6 +680,7 @@ HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IW {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, {&GUID_WICPixelFormat32bppPRGBA, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, + {&GUID_WICPixelFormat32bppRGB, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, }; if (FAILED(hr = IWICBitmapSource_GetSize(bitmap_source, &size.width, &size.height))) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 9480e1fc1a5..024886706c3 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10433,6 +10433,7 @@ static void test_wic_bitmap_format(BOOL d3d11) {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, {&GUID_WICPixelFormat32bppPRGBA, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, + {&GUID_WICPixelFormat32bppRGB, {DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, }; if (!init_test_context(&ctx, d3d11))
1
0
0
0
Nikolay Sivov : d3dcompiler: Add support for matrix majority compiler flags.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 167ad1ee7bbdaa1ec329f4b6a27b2e9b9389c0e2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/167ad1ee7bbdaa1ec329f4b6a27b2e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Sep 22 23:09:39 2023 +0200 d3dcompiler: Add support for matrix majority compiler flags. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55182
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/d3dcompiler_43/compiler.c | 17 +++++++++++++++-- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 069ff992c22..d41639ee3a2 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -406,7 +406,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen struct d3dcompiler_include_from_file include_from_file; struct vkd3d_shader_preprocess_info preprocess_info; struct vkd3d_shader_hlsl_source_info hlsl_info; - struct vkd3d_shader_compile_option options[2]; + struct vkd3d_shader_compile_option options[3]; struct vkd3d_shader_compile_info compile_info; struct vkd3d_shader_compile_option *option; struct vkd3d_shader_code byte_code; @@ -453,7 +453,7 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen include = &include_from_file.ID3DInclude_iface; } - if (flags & ~D3DCOMPILE_DEBUG) + if (flags & ~(D3DCOMPILE_DEBUG | D3DCOMPILE_PACK_MATRIX_ROW_MAJOR | D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR)) FIXME("Ignoring flags %#x.\n", flags); if (effect_flags) FIXME("Ignoring effect flags %#x.\n", effect_flags); @@ -519,6 +519,19 @@ HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filen option->value = true; } + if (flags & D3DCOMPILE_PACK_MATRIX_ROW_MAJOR) + { + option = &options[compile_info.option_count++]; + option->name = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ORDER; + option->value = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ROW_MAJOR; + } + else if (flags & D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR) + { + option = &options[compile_info.option_count++]; + option->name = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_ORDER; + option->value = VKD3D_SHADER_COMPILE_OPTION_PACK_MATRIX_COLUMN_MAJOR; + } + ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages); if (ret) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 7ea5ef67fdc..c6e7aa367f0 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -968,7 +968,6 @@ static void test_majority(void) draw_quad(test_context.device, ps_code); v = get_color_vec4(test_context.device, 0, 0); - todo_wine_if(i == 4 || i == 6) ok(compare_vec4(&v, c->x, c->y, c->z, c->w, 1), "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
1
0
0
0
Yuxuan Shui : rtworkq: Fix leak of thread pool work items.
by Alexandre Julliard
26 Sep '23
26 Sep '23
Module: wine Branch: master Commit: 34319496d83a816bc22005851cce32bd480892af URL:
https://gitlab.winehq.org/wine/wine/-/commit/34319496d83a816bc22005851cce32…
Author: Yuxuan Shui <yshui(a)codeweavers.com> Date: Mon Sep 25 18:23:21 2023 +0100 rtworkq: Fix leak of thread pool work items. --- dlls/rtworkq/queue.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/rtworkq/queue.c b/dlls/rtworkq/queue.c index 1f82eb7ad12..15b8da47639 100644 --- a/dlls/rtworkq/queue.c +++ b/dlls/rtworkq/queue.c @@ -118,6 +118,13 @@ enum system_queue_index SYS_QUEUE_COUNT, }; +enum work_item_type +{ + WORK_ITEM_WORK, + WORK_ITEM_TIMER, + WORK_ITEM_WAIT, +}; + struct work_item { IUnknown IUnknown_iface; @@ -129,10 +136,11 @@ struct work_item RTWQWORKITEM_KEY key; LONG priority; DWORD flags; - TP_WORK *work_object; PTP_SIMPLE_CALLBACK finalization_callback; + enum work_item_type type; union { + TP_WORK *work_object; TP_WAIT *wait_object; TP_TIMER *timer_object; } u; @@ -387,8 +395,9 @@ static void pool_queue_submit(struct queue *queue, struct work_item *item) we need finalization callback. */ if (item->finalization_callback) IUnknown_AddRef(&item->IUnknown_iface); - item->work_object = CreateThreadpoolWork(standard_queue_worker, item, (TP_CALLBACK_ENVIRON *)&env); - SubmitThreadpoolWork(item->work_object); + item->u.work_object = CreateThreadpoolWork(standard_queue_worker, item, (TP_CALLBACK_ENVIRON *)&env); + item->type = WORK_ITEM_WORK; + SubmitThreadpoolWork(item->u.work_object); TRACE("dispatched %p.\n", item->result); } @@ -549,8 +558,18 @@ static ULONG WINAPI work_item_Release(IUnknown *iface) if (!refcount) { - if (item->work_object) - CloseThreadpoolWork(item->work_object); + switch (item->type) + { + case WORK_ITEM_WORK: + if (item->u.work_object) CloseThreadpoolWork(item->u.work_object); + break; + case WORK_ITEM_WAIT: + if (item->u.wait_object) CloseThreadpoolWait(item->u.wait_object); + break; + case WORK_ITEM_TIMER: + if (item->u.timer_object) CloseThreadpoolTimer(item->u.timer_object); + break; + } if (item->reply_result) IRtwqAsyncResult_Release(item->reply_result); IRtwqAsyncResult_Release(item->result); @@ -814,6 +833,7 @@ static HRESULT queue_submit_wait(struct queue *queue, HANDLE event, LONG priorit item->u.wait_object = CreateThreadpoolWait(callback, item, (TP_CALLBACK_ENVIRON *)&queue->envs[TP_CALLBACK_PRIORITY_NORMAL]); + item->type = WORK_ITEM_WAIT; SetThreadpoolWait(item->u.wait_object, event, NULL); TRACE("dispatched %p.\n", result); @@ -848,6 +868,7 @@ static HRESULT queue_submit_timer(struct queue *queue, IRtwqAsyncResult *result, item->u.timer_object = CreateThreadpoolTimer(callback, item, (TP_CALLBACK_ENVIRON *)&queue->envs[TP_CALLBACK_PRIORITY_NORMAL]); + item->type = WORK_ITEM_TIMER; SetThreadpoolTimer(item->u.timer_object, &filetime, period, 0); TRACE("dispatched %p.\n", result);
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200