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
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
List overview
wine-devel
January 2021
----- 2025 -----
May 2025
April 2025
March 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-devel@winehq.org
74 participants
438 discussions
Start a n
N
ew thread
[PATCH] user32: Keep toplevel minimized windows offscreen if they're already.
by Gabriel Ivăncescu
04 Feb '21
04 Feb '21
Some applications (e.g. Lego Worlds) use (-32000,-32000) to determine whether a window is minimized. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/user32/tests/win.c | 52 +++++++++++++++++++++++++++++++++++++++++ dlls/user32/winpos.c | 8 +++++++ 2 files changed, 60 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 843da89..19a0db2 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11593,6 +11593,58 @@
…
[View More]
todo_wine ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n", wine_dbgstr_rect(&wp.rcNormalPosition)); + wp.flags = WPF_SETMINPOSITION; + wp.showCmd = SW_NORMAL; + wp.ptMinPosition.x = wp.ptMinPosition.y = 100; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100; + wp.rcNormalPosition = orig; + ret = SetWindowPlacement(hwnd, &wp); + ok(ret, "failed to set window placement, error %u\n", GetLastError()); + + ShowWindow(hwnd, SW_MINIMIZE); + + ret = GetWindowPlacement(hwnd, &wp); + ok(ret, "failed to get window placement, error %u\n", GetLastError()); + ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd); + ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000, + "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y); +todo_wine + ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1, + "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y); + ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n", + wine_dbgstr_rect(&wp.rcNormalPosition)); + + ret = SetWindowPos(hwnd, NULL, 100, 100, 151, 151, SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "failed to set window pos, error %u\n", GetLastError()); + + ret = GetWindowPlacement(hwnd, &wp); + ok(ret, "failed to get window placement, error %u\n", GetLastError()); + ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd); + ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000, + "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y); +todo_wine + ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1, + "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y); + ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n", + wine_dbgstr_rect(&wp.rcNormalPosition)); + GetWindowRect(hwnd, &rect); + ok(rect.left == -32000 && rect.top == -32000, "got window rect %s\n", wine_dbgstr_rect(&rect)); + + ShowWindow(hwnd, SW_SHOWNORMAL); + + ret = GetWindowPlacement(hwnd, &wp); + ok(ret, "failed to get window placement, error %u\n", GetLastError()); + ok(wp.showCmd == SW_NORMAL, "got show cmd %u\n", wp.showCmd); + ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000, + "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y); +todo_wine + ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1, + "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y); + ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n", + wine_dbgstr_rect(&wp.rcNormalPosition)); + GetWindowRect(hwnd, &rect); + ok(EqualRect(&rect, &orig), "got window rect %s\n", wine_dbgstr_rect(&rect)); + DestroyWindow(hwnd); } diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index b45b74c..3ccd939 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1688,6 +1688,14 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS *pWinpos, RECT *old_window_rect, REC } if (!(pWinpos->flags & SWP_NOMOVE)) { + /* If the window is toplevel minimized off-screen, force keep it there */ + if ((wndPtr->dwStyle & WS_MINIMIZE) && + wndPtr->window_rect.left <= -32000 && wndPtr->window_rect.top <= -32000 && + (!wndPtr->parent || wndPtr->parent == GetDesktopWindow())) + { + pWinpos->x = -32000; + pWinpos->y = -32000; + } new_window_rect->left = pWinpos->x; new_window_rect->top = pWinpos->y; new_window_rect->right += pWinpos->x - old_window_rect->left; -- 2.21.0
[View Less]
3
3
0
0
[PATCH 00/23] Port Wine to PPC64 (try 2)
by André Hentschel
04 Feb '21
04 Feb '21
Since quite some time I keep splitting/cleaning up/rebasing and fixing the 2 year old PowerPC64le patchset from 2019 (done by Timothy Pearson): [1] The goal is to have a winelib base for Hangover [2] on PowerPC64 and there's also interest in having winelib for crosscompiling [3]. This rebase meanwhile matured, especially end of last year, and I hope it can get upstreamed now that wine-6.0 is out and the patch flood after it calmed down a bit. [1]
https://github.com/madscientist159/wine/
…
[View More]
commits/master
[2]
https://github.com/AndreRH/hangover
[3]
https://wiki.raptorcs.com/wiki/Porting/Wine
[View Less]
4
27
0
0
[PATCH] shell32: IPersistFile::Save(NULL) should use previously stored file name.
by Dmitry Timoshkov
03 Feb '21
03 Feb '21
This is a resend, previous version didn't get much attention. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- dlls/shell32/shelllink.c | 14 ++++++++++---- dlls/shell32/tests/shelllink.c | 10 ++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index 5b044d4be1..23c5935a7b 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -367,7 +367,10 @@ static HRESULT WINAPI
…
[View More]
IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile TRACE("(%p)->(%s)\n",This,debugstr_w(pszFileName)); if (!pszFileName) - return E_FAIL; + { + pszFileName = This->filepath; + fRemember = FALSE; + } r = SHCreateStreamOnFileW( pszFileName, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE, &stm ); if( SUCCEEDED( r ) ) @@ -379,9 +382,12 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile { StartLinkProcessor( pszFileName ); - /* update file path */ - heap_free(This->filepath); - This->filepath = strdupW(pszFileName); + if (fRemember) + { + /* update file path */ + heap_free(This->filepath); + This->filepath = strdupW(pszFileName); + } This->bDirty = FALSE; } diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 20c48814f1..21e9107fa6 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -467,6 +467,16 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc) lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); CoTaskMemFree(str); + r = IPersistFile_Save(pf, NULL, TRUE); + lok(r == S_OK, "save failed (0x%08x)\n", r); + + /* test GetCurFile after ::Save */ + r = IPersistFile_GetCurFile(pf, &str); + lok(r == S_OK, "got 0x%08x\n", r); + lok(str != NULL, "Didn't expect NULL\n"); + lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); + CoTaskMemFree(str); + IPersistFile_Release(pf); } -- 2.29.2
[View Less]
2
4
0
0
[PATCH vkd3d 1/5] vkd3d-shader: Move instruction allocation functions to hlsl.c.
by Zebediah Figura
02 Feb '21
02 Feb '21
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.c | 205 +++++++++++++++++++++++++++++++++++++++ libs/vkd3d-shader/hlsl.h | 22 ++++- libs/vkd3d-shader/hlsl.y | 205 --------------------------------------- 3 files changed, 224 insertions(+), 208 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index cd0d9cbc..e73ed923 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -18,6 +18,7 @@ */ #include
…
[View More]
"hlsl.h" +#include <stdio.h> BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) { @@ -102,6 +103,41 @@ struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int arra return type; } +static DWORD get_array_size(const struct hlsl_type *type) +{ + if (type->type == HLSL_CLASS_ARRAY) + return get_array_size(type->e.array.type) * type->e.array.elements_count; + return 1; +} + +struct hlsl_type *new_struct_type(const char *name, struct list *fields) +{ + struct hlsl_struct_field *field; + unsigned int reg_size = 0; + struct hlsl_type *type; + + if (!(type = vkd3d_calloc(1, sizeof(*type)))) + return NULL; + type->type = HLSL_CLASS_STRUCT; + type->base_type = HLSL_TYPE_VOID; + type->name = name; + type->dimx = 0; + type->dimy = 1; + type->e.elements = fields; + + LIST_FOR_EACH_ENTRY(field, fields, struct hlsl_struct_field, entry) + { + field->reg_offset = reg_size; + reg_size += field->type->reg_size; + type->dimx += field->type->dimx * field->type->dimy * get_array_size(field->type); + } + type->reg_size = reg_size; + + list_add_tail(&hlsl_ctx.types, &type->entry); + + return type; +} + struct hlsl_type *get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) { struct rb_entry *entry = rb_get(&scope->types, name); @@ -639,6 +675,35 @@ struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, return expr_from_node(cast); } +struct hlsl_ir_var *new_var(const char *name, struct hlsl_type *type, const struct source_location loc, + const char *semantic, unsigned int modifiers, const struct reg_reservation *reg_reservation) +{ + struct hlsl_ir_var *var; + + if (!(var = vkd3d_calloc(1, sizeof(*var)))) + { + hlsl_ctx.status = PARSE_ERR; + return NULL; + } + + var->name = name; + var->data_type = type; + var->loc = loc; + var->semantic = semantic; + var->modifiers = modifiers; + var->reg_reservation = reg_reservation; + return var; +} + +struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, const struct source_location loc) +{ + struct hlsl_ir_var *var = new_var(vkd3d_strdup(name), type, loc, NULL, 0, NULL); + + if (var) + list_add_tail(&hlsl_ctx.globals->vars, &var->scope_entry); + return var; +} + static enum hlsl_ir_expr_op op_from_assignment(enum parse_assign_op op) { static const enum hlsl_ir_expr_op ops[] = @@ -780,6 +845,146 @@ struct hlsl_ir_node *add_assignment(struct list *instrs, struct hlsl_ir_node *lh return &assign->node; } +static BOOL type_is_single_reg(const struct hlsl_type *type) +{ + return type->type == HLSL_CLASS_SCALAR || type->type == HLSL_CLASS_VECTOR; +} + +struct hlsl_ir_assignment *new_assignment(struct hlsl_ir_var *var, struct hlsl_ir_node *offset, + struct hlsl_ir_node *rhs, unsigned int writemask, struct source_location loc) +{ + struct hlsl_ir_assignment *assign; + + if (!writemask && type_is_single_reg(rhs->data_type)) + writemask = (1 << rhs->data_type->dimx) - 1; + + if (!(assign = vkd3d_malloc(sizeof(*assign)))) + return NULL; + + init_node(&assign->node, HLSL_IR_ASSIGNMENT, NULL, loc); + assign->lhs.var = var; + hlsl_src_from_node(&assign->lhs.offset, offset); + hlsl_src_from_node(&assign->rhs, rhs); + assign->writemask = writemask; + return assign; +} + +struct hlsl_ir_assignment *new_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) +{ + return new_assignment(lhs, NULL, rhs, 0, rhs->loc); +} + +struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) +{ + struct hlsl_ir_constant *c; + + if (!(c = vkd3d_malloc(sizeof(*c)))) + return NULL; + init_node(&c->node, HLSL_IR_CONSTANT, hlsl_ctx.builtin_types.scalar[HLSL_TYPE_UINT], loc); + c->value.u[0] = n; + return c; +} + +struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, struct source_location loc) +{ + struct hlsl_ir_expr *expr; + + if (!(expr = vkd3d_calloc(1, sizeof(*expr)))) + return NULL; + init_node(&expr->node, HLSL_IR_EXPR, arg->data_type, loc); + expr->op = op; + hlsl_src_from_node(&expr->operands[0], arg); + return &expr->node; +} + +struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, + struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2) +{ + struct hlsl_ir_expr *expr; + + assert(compare_hlsl_types(arg1->data_type, arg2->data_type)); + + if (!(expr = vkd3d_calloc(1, sizeof(*expr)))) + return NULL; + init_node(&expr->node, HLSL_IR_EXPR, arg1->data_type, arg1->loc); + expr->op = op; + hlsl_src_from_node(&expr->operands[0], arg1); + hlsl_src_from_node(&expr->operands[1], arg2); + return &expr->node; +} + +struct hlsl_ir_if *new_if(struct hlsl_ir_node *condition, struct source_location loc) +{ + struct hlsl_ir_if *iff; + + if (!(iff = vkd3d_malloc(sizeof(*iff)))) + return NULL; + init_node(&iff->node, HLSL_IR_IF, NULL, loc); + hlsl_src_from_node(&iff->condition, condition); + list_init(&iff->then_instrs); + list_init(&iff->else_instrs); + return iff; +} + +struct hlsl_ir_load *new_var_load(struct hlsl_ir_var *var, const struct source_location loc) +{ + struct hlsl_ir_load *load; + + if (!(load = vkd3d_calloc(1, sizeof(*load)))) + return NULL; + init_node(&load->node, HLSL_IR_LOAD, var->data_type, loc); + load->src.var = var; + return load; +} + +struct hlsl_ir_swizzle *new_swizzle(DWORD s, unsigned int components, + struct hlsl_ir_node *val, struct source_location *loc) +{ + struct hlsl_ir_swizzle *swizzle; + + if (!(swizzle = vkd3d_malloc(sizeof(*swizzle)))) + return NULL; + init_node(&swizzle->node, HLSL_IR_SWIZZLE, + new_hlsl_type(NULL, HLSL_CLASS_VECTOR, val->data_type->base_type, components, 1), *loc); + hlsl_src_from_node(&swizzle->val, val); + swizzle->swizzle = s; + return swizzle; +} + +BOOL type_is_void(const struct hlsl_type *type) +{ + return type->type == HLSL_CLASS_OBJECT && type->base_type == HLSL_TYPE_VOID; +} + +struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, + struct list *parameters, const char *semantic, struct source_location loc) +{ + struct hlsl_ir_function_decl *decl; + + if (!(decl = vkd3d_calloc(1, sizeof(*decl)))) + return NULL; + decl->return_type = return_type; + decl->parameters = parameters; + decl->semantic = semantic; + decl->loc = loc; + + if (!type_is_void(return_type)) + { + struct hlsl_ir_var *return_var; + char name[28]; + + sprintf(name, "<retval-%p>", decl); + if (!(return_var = new_synthetic_var(name, return_type, loc))) + { + vkd3d_free(decl); + return NULL; + } + decl->return_var = return_var; + } + + return decl; +} + static int compare_hlsl_types_rb(const void *key, const struct rb_entry *entry) { const struct hlsl_type *type = RB_ENTRY_VALUE(entry, const struct hlsl_type, scope_entry); diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 128de1d6..aabfbaf9 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -599,19 +599,34 @@ struct hlsl_ir_expr *add_expr(struct list *instrs, enum hlsl_ir_expr_op op, stru struct hlsl_ir_node *add_implicit_conversion(struct list *instrs, struct hlsl_ir_node *node, struct hlsl_type *type, struct source_location *loc) DECLSPEC_HIDDEN; -struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, - struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size) DECLSPEC_HIDDEN; +struct hlsl_ir_assignment *new_assignment(struct hlsl_ir_var *var, struct hlsl_ir_node *offset, + struct hlsl_ir_node *rhs, unsigned int writemask, struct source_location loc) DECLSPEC_HIDDEN; struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *new_cast(struct hlsl_ir_node *node, struct hlsl_type *type, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, + struct list *parameters, const char *semantic, struct source_location loc) DECLSPEC_HIDDEN; +struct hlsl_ir_if *new_if(struct hlsl_ir_node *condition, struct source_location loc) DECLSPEC_HIDDEN; +struct hlsl_ir_assignment *new_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) DECLSPEC_HIDDEN; +struct hlsl_type *new_struct_type(const char *name, struct list *fields) DECLSPEC_HIDDEN; +struct hlsl_ir_swizzle *new_swizzle(DWORD s, unsigned int components, + struct hlsl_ir_node *val, struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, + const struct source_location loc) DECLSPEC_HIDDEN; +struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) DECLSPEC_HIDDEN; struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, struct source_location loc) DECLSPEC_HIDDEN; +struct hlsl_ir_var *new_var(const char *name, struct hlsl_type *type, const struct source_location loc, + const char *semantic, unsigned int modifiers, const struct reg_reservation *reg_reservation) DECLSPEC_HIDDEN; +struct hlsl_ir_load *new_var_load(struct hlsl_ir_var *var, const struct source_location loc) DECLSPEC_HIDDEN; BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN; struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN; void free_declaration(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN; struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_class, enum hlsl_base_type base_type, unsigned dimx, unsigned dimy) DECLSPEC_HIDDEN; -struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size) DECLSPEC_HIDDEN; struct hlsl_type *clone_hlsl_type(struct hlsl_type *old, unsigned int default_majority) DECLSPEC_HIDDEN; struct hlsl_type *get_type(struct hlsl_scope *scope, const char *name, BOOL recursive) DECLSPEC_HIDDEN; BOOL is_row_major(const struct hlsl_type *type) DECLSPEC_HIDDEN; @@ -624,6 +639,7 @@ BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; void init_functions_tree(struct rb_tree *funcs) DECLSPEC_HIDDEN; void add_function_decl(struct rb_tree *funcs, char *name, struct hlsl_ir_function_decl *decl, BOOL intrinsic) DECLSPEC_HIDDEN; +BOOL type_is_void(const struct hlsl_type *type) DECLSPEC_HIDDEN; int hlsl_lexer_compile(const char *text, enum vkd3d_shader_type type, DWORD major, DWORD minor, const char *entrypoint, struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context) DECLSPEC_HIDDEN; diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 4e2218c5..df155a08 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -77,11 +77,6 @@ static void check_invalid_matrix_modifiers(DWORD modifiers, struct source_locati "'row_major' or 'column_major' modifiers are only allowed for matrices."); } -static BOOL type_is_single_reg(const struct hlsl_type *type) -{ - return type->type == HLSL_CLASS_SCALAR || type->type == HLSL_CLASS_VECTOR; -} - static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local) { BOOL ret; @@ -232,24 +227,6 @@ static void declare_predefined_types(struct hlsl_scope *scope) add_type_to_scope(scope, type); } -static BOOL type_is_void(const struct hlsl_type *type) -{ - return type->type == HLSL_CLASS_OBJECT && type->base_type == HLSL_TYPE_VOID; -} - -static struct hlsl_ir_if *new_if(struct hlsl_ir_node *condition, struct source_location loc) -{ - struct hlsl_ir_if *iff; - - if (!(iff = vkd3d_malloc(sizeof(*iff)))) - return NULL; - init_node(&iff->node, HLSL_IR_IF, NULL, loc); - hlsl_src_from_node(&iff->condition, condition); - list_init(&iff->then_instrs); - list_init(&iff->else_instrs); - return iff; -} - static BOOL append_conditional_break(struct list *cond_list) { struct hlsl_ir_node *condition, *not; @@ -352,20 +329,6 @@ static void free_parse_initializer(struct parse_initializer *initializer) vkd3d_free(initializer->args); } -static struct hlsl_ir_swizzle *new_swizzle(DWORD s, unsigned int components, - struct hlsl_ir_node *val, struct source_location *loc) -{ - struct hlsl_ir_swizzle *swizzle; - - if (!(swizzle = vkd3d_malloc(sizeof(*swizzle)))) - return NULL; - init_node(&swizzle->node, HLSL_IR_SWIZZLE, - new_hlsl_type(NULL, HLSL_CLASS_VECTOR, val->data_type->base_type, components, 1), *loc); - hlsl_src_from_node(&swizzle->val, val); - swizzle->swizzle = s; - return swizzle; -} - static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const char *swizzle, struct source_location *loc) { @@ -448,60 +411,6 @@ static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const cha return NULL; } -static struct hlsl_ir_var *new_var(const char *name, struct hlsl_type *type, const struct source_location loc, - const char *semantic, unsigned int modifiers, const struct reg_reservation *reg_reservation) -{ - struct hlsl_ir_var *var; - - if (!(var = vkd3d_calloc(1, sizeof(*var)))) - { - hlsl_ctx.status = PARSE_ERR; - return NULL; - } - - var->name = name; - var->data_type = type; - var->loc = loc; - var->semantic = semantic; - var->modifiers = modifiers; - var->reg_reservation = reg_reservation; - return var; -} - -static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, - const struct source_location loc) -{ - struct hlsl_ir_var *var = new_var(vkd3d_strdup(name), type, loc, NULL, 0, NULL); - - if (var) - list_add_tail(&hlsl_ctx.globals->vars, &var->scope_entry); - return var; -} - -static struct hlsl_ir_assignment *new_assignment(struct hlsl_ir_var *var, struct hlsl_ir_node *offset, - struct hlsl_ir_node *rhs, unsigned int writemask, struct source_location loc) -{ - struct hlsl_ir_assignment *assign; - - if (!writemask && type_is_single_reg(rhs->data_type)) - writemask = (1 << rhs->data_type->dimx) - 1; - - if (!(assign = vkd3d_malloc(sizeof(*assign)))) - return NULL; - - init_node(&assign->node, HLSL_IR_ASSIGNMENT, NULL, loc); - assign->lhs.var = var; - hlsl_src_from_node(&assign->lhs.offset, offset); - hlsl_src_from_node(&assign->rhs, rhs); - assign->writemask = writemask; - return assign; -} - -static struct hlsl_ir_assignment *new_simple_assignment(struct hlsl_ir_var *lhs, struct hlsl_ir_node *rhs) -{ - return new_assignment(lhs, NULL, rhs, 0, rhs->loc); -} - static struct hlsl_ir_jump *add_return(struct list *instrs, struct hlsl_ir_node *return_value, struct source_location loc) { @@ -534,56 +443,6 @@ static struct hlsl_ir_jump *add_return(struct list *instrs, return jump; } -static struct hlsl_ir_constant *new_uint_constant(unsigned int n, const struct source_location loc) -{ - struct hlsl_ir_constant *c; - - if (!(c = vkd3d_malloc(sizeof(*c)))) - return NULL; - init_node(&c->node, HLSL_IR_CONSTANT, hlsl_ctx.builtin_types.scalar[HLSL_TYPE_UINT], loc); - c->value.u[0] = n; - return c; -} - -struct hlsl_ir_node *new_unary_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, struct source_location loc) -{ - struct hlsl_ir_expr *expr; - - if (!(expr = vkd3d_calloc(1, sizeof(*expr)))) - return NULL; - init_node(&expr->node, HLSL_IR_EXPR, arg->data_type, loc); - expr->op = op; - hlsl_src_from_node(&expr->operands[0], arg); - return &expr->node; -} - -struct hlsl_ir_node *new_binary_expr(enum hlsl_ir_expr_op op, - struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2) -{ - struct hlsl_ir_expr *expr; - - assert(compare_hlsl_types(arg1->data_type, arg2->data_type)); - - if (!(expr = vkd3d_calloc(1, sizeof(*expr)))) - return NULL; - init_node(&expr->node, HLSL_IR_EXPR, arg1->data_type, arg1->loc); - expr->op = op; - hlsl_src_from_node(&expr->operands[0], arg1); - hlsl_src_from_node(&expr->operands[1], arg2); - return &expr->node; -} - -static struct hlsl_ir_load *new_var_load(struct hlsl_ir_var *var, const struct source_location loc) -{ - struct hlsl_ir_load *load; - - if (!(load = vkd3d_calloc(1, sizeof(*load)))) - return NULL; - init_node(&load->node, HLSL_IR_LOAD, var->data_type, loc); - load->src.var = var; - return load; -} - static struct hlsl_ir_load *add_load(struct list *instrs, struct hlsl_ir_node *var_node, struct hlsl_ir_node *offset, struct hlsl_type *data_type, const struct source_location loc) { @@ -777,41 +636,6 @@ static struct list *gen_struct_fields(struct hlsl_type *type, DWORD modifiers, s return list; } -static DWORD get_array_size(const struct hlsl_type *type) -{ - if (type->type == HLSL_CLASS_ARRAY) - return get_array_size(type->e.array.type) * type->e.array.elements_count; - return 1; -} - -static struct hlsl_type *new_struct_type(const char *name, struct list *fields) -{ - struct hlsl_struct_field *field; - unsigned int reg_size = 0; - struct hlsl_type *type; - - if (!(type = vkd3d_calloc(1, sizeof(*type)))) - return NULL; - type->type = HLSL_CLASS_STRUCT; - type->base_type = HLSL_TYPE_VOID; - type->name = name; - type->dimx = 0; - type->dimy = 1; - type->e.elements = fields; - - LIST_FOR_EACH_ENTRY(field, fields, struct hlsl_struct_field, entry) - { - field->reg_offset = reg_size; - reg_size += field->type->reg_size; - type->dimx += field->type->dimx * field->type->dimy * get_array_size(field->type); - } - type->reg_size = reg_size; - - list_add_tail(&hlsl_ctx.types, &type->entry); - - return type; -} - static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct list *list) { struct parse_variable_def *v, *v_next; @@ -1203,35 +1027,6 @@ static struct list *declare_vars(struct hlsl_type *basic_type, DWORD modifiers, return statements_list; } -static struct hlsl_ir_function_decl *new_func_decl(struct hlsl_type *return_type, - struct list *parameters, const char *semantic, struct source_location loc) -{ - struct hlsl_ir_function_decl *decl; - - if (!(decl = vkd3d_calloc(1, sizeof(*decl)))) - return NULL; - decl->return_type = return_type; - decl->parameters = parameters; - decl->semantic = semantic; - decl->loc = loc; - - if (!type_is_void(return_type)) - { - struct hlsl_ir_var *return_var; - char name[28]; - - sprintf(name, "<retval-%p>", decl); - if (!(return_var = new_synthetic_var(name, return_type, loc))) - { - vkd3d_free(decl); - return NULL; - } - decl->return_var = return_var; - } - - return decl; -} - %} %locations -- 2.30.0
[View Less]
3
14
0
0
[PATCH v2] gdi32: Fail in ExtTextOut if count is larger than INT_MAX.
by Gabriel Ivăncescu
02 Feb '21
02 Feb '21
Some applications pass values like -1 and crash when BIDI_Reorder can't allocate the memory. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/gdi32/font.c | 3 +++ dlls/gdi32/tests/font.c | 2 ++ dlls/gdi32/tests/metafile.c | 8 +++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 74ca482..de50bf0 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -5823,6 +5823,8 @@ BOOL WINAPI
…
[View More]
ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, BOOL ret; LPINT lpDxW = NULL; + if (count > INT_MAX) return FALSE; + if (flags & ETO_GLYPH_INDEX) return ExtTextOutW( hdc, x, y, flags, lprect, (LPCWSTR)str, count, lpDx ); @@ -5932,6 +5934,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, static int quietfixme = 0; if (!dc) return FALSE; + if (count > INT_MAX) return FALSE; align = dc->textAlign; breakRem = dc->breakRem; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 461eecf..3e1f1e9 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -6916,6 +6916,8 @@ static void test_bitmap_font_glyph_index(void) hBmpPrev = SelectObject(hdc, hBmp[j]); switch (j) { case 0: + ret = ExtTextOutW(hdc, 0, 0, 0, NULL, text, -1, NULL); + ok(!ret, "ExtTextOutW succeeded\n"); ret = ExtTextOutW(hdc, 0, 0, 0, NULL, text, lstrlenW(text), NULL); break; case 1: diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 8dae908..15af24a 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -222,7 +222,13 @@ static void test_ExtTextOut(void) ret = ExtTextOutA(hdcMetafile, 0, 40, 0, NULL, text, lstrlenA(text), NULL); ok( ret, "ExtTextOutA error %d\n", GetLastError()); - /* 4. test with unmatched BeginPath/EndPath calls */ + /* 4. pass -1 to length */ + SetLastError(0xdeadbeef); + ret = ExtTextOutA(hdcMetafile, 0, 0, 0, &rc, text, -1, NULL); + ok( !ret, "ExtTextOutA succeeded\n"); + ok( GetLastError() == 0xdeadbeef, "ExtTextOutA error %d\n", GetLastError()); + + /* 5. test with unmatched BeginPath/EndPath calls */ ret = BeginPath(hdcMetafile); ok( ret, "BeginPath error %d\n", GetLastError()); ret = BeginPath(hdcMetafile); -- 2.29.2
[View Less]
2
2
0
0
[PATCH] d3dx9: Return D3DFMT_A8R8G8B8 in D3DXGetImageInfoFromFileInMemory for 32 bpp BMP with alpha.
by Zebediah Figura
02 Feb '21
02 Feb '21
From: Christian Costa <titan.costa(a)gmail.com> Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48563
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> --- Changes from staging patch: use malloc()/free(); move the code into a helper function. dlls/d3dx9_36/surface.c | 38 +++++++++++++++++++++++++++++++++++ dlls/d3dx9_36/tests/surface.c | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index
…
[View More]
045d7267c96..362113386ea 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -887,6 +887,41 @@ static BOOL convert_dib_to_bmp(const void **data, unsigned int *size) return TRUE; } +/* windowscodecs always returns xRGB, but we should return ARGB if and only if + * at least one pixel has a non-zero alpha component. */ +static BOOL image_is_argb(IWICBitmapFrameDecode *frame, const D3DXIMAGE_INFO *info) +{ + unsigned int size, i; + BYTE *buffer; + HRESULT hr; + + if (info->Format != D3DFMT_X8R8G8B8 || info->ImageFileFormat != D3DXIFF_BMP) + return FALSE; + + size = info->Width * info->Height * 4; + if (!(buffer = malloc(size))) + return FALSE; + + if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, info->Width * 4, size, buffer))) + { + ERR("Failed to copy pixels, hr %#x.\n", hr); + free(buffer); + return FALSE; + } + + for (i = 0; i < info->Width * info->Height; ++i) + { + if (buffer[i * 4 + 3]) + { + free(buffer); + return TRUE; + } + } + + free(buffer); + return FALSE; +} + /************************************************************ * D3DXGetImageInfoFromFileInMemory * @@ -1006,6 +1041,9 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, } } + if (SUCCEEDED(hr) && image_is_argb(frame, info)) + info->Format = D3DFMT_A8R8G8B8; + if (frame) IWICBitmapFrameDecode_Release(frame); diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 4590a758d78..1d32b68c3a6 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -698,7 +698,7 @@ static void test_D3DXGetImageInfo(void) ok(info.Format == D3DFMT_X8R8G8B8, "Got unexpected format %u.\n", info.Format); hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_argb, sizeof(bmp_32bpp_argb), &info); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - todo_wine ok(info.Format == D3DFMT_A8R8G8B8, "Got unexpected format %u.\n", info.Format); + ok(info.Format == D3DFMT_A8R8G8B8, "Got unexpected format %u.\n", info.Format); /* Grayscale PNG */ hr = D3DXGetImageInfoFromFileInMemory(png_grayscale, sizeof(png_grayscale), &info); -- 2.30.0
[View Less]
2
1
0
0
[PATCH v2 2/2] winmm/tests: Get rid of unused functions.
by Akihiro Sagawa
01 Feb '21
01 Feb '21
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/winmm/tests/wave.c | 12 ------------ dlls/winmm/tests/winmm_test.h | 1 - 2 files changed, 13 deletions(-)
3
2
0
0
[PATCH v2 1/2] winmm/tests: Strictly test returned time format of waveInGetPostion().
by Akihiro Sagawa
01 Feb '21
01 Feb '21
In v2, split the patch into two parts. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/winmm/tests/capture.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-)
2
1
0
0
[PATCH] conhost: Keep horizontal position of cursor within screen width.
by Roman Pišl
01 Feb '21
01 Feb '21
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50581
Signed-off-by: Roman Pišl <rpisl(a)seznam.cz> --- programs/conhost/conhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 0ac1c5f507b..418098420c6 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -357,7 +357,9 @@ static void update_output( struct screen_buffer *screen_buffer, RECT *rect ) size =
…
[View More]
WideCharToMultiByte( get_tty_cp( screen_buffer->console ), 0, &ch->ch, 1, buf, sizeof(buf), NULL, NULL ); tty_write( screen_buffer->console, buf, size ); - screen_buffer->console->tty_cursor_x++; + + if (screen_buffer->console->tty_cursor_x < screen_buffer->width - 1) + screen_buffer->console->tty_cursor_x++; } } -- 2.20.1
[View Less]
2
1
0
0
[PATCH V3 1/2] msxml3/tests: Test mxwriter DOMDocument output.
by Jefferson Carpenter
01 Feb '21
01 Feb '21
Re-submit
2
6
0
0
← Newer
1
2
3
4
5
...
44
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
Results per page:
10
25
50
100
200