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
February 2021
- 81 participants
- 1707 messages
[PATCH 2/5] widl: Support using qualified names for interfaces.
by Rémi Bernon
And make qualified name lookup more robust:
* Either parse a non-qualified name directly from
the current (or global) namespace, or start
parsing a qualified name.
* Qualified name parsing uses the lookup namespace
stack only to find types or sub-namespaces.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
include/windows.media.speechsynthesis.idl | 2 +-
tools/widl/parser.y | 58 +++++++++++++++--------
2 files changed, 38 insertions(+), 22 deletions(-)
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl
index 71c51b74c0c..502261f79c6 100644
--- a/include/windows.media.speechsynthesis.idl
+++ b/include/windows.media.speechsynthesis.idl
@@ -64,7 +64,7 @@ namespace Windows {
]
runtimeclass VoiceInformation
{
- [default] interface IVoiceInformation;
+ [default] interface Windows.Media.SpeechSynthesis.IVoiceInformation;
}
}
}
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 480552e3723..1e3e254ec8c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -75,6 +75,8 @@ static void append_chain_callconv(type_t *chain, char *callconv);
static warning_list_t *append_warning(warning_list_t *, int);
static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs);
+static type_t *get_qualified_type(enum type_type type, char *name, int t);
+static type_t *find_qualified_type_or_error(const char *name, int t);
static type_t *find_type_or_error(const char *name, int t);
static type_t *find_type_or_error2(char *name, int t);
@@ -82,7 +84,6 @@ static var_t *reg_const(var_t *var);
static void push_namespace(const char *name);
static void pop_namespace(const char *name);
-static void init_lookup_namespace(const char *name);
static void push_lookup_namespace(const char *name);
static void check_arg_attrs(const var_t *arg);
@@ -295,7 +296,7 @@ static typelib_t *current_typelib;
%type <str> namespacedef
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
-%type <type> type qualified_seq qualified_type
+%type <type> type qualified_type
%type <ifref> class_interface
%type <ifref_list> class_interfaces
%type <var> arg ne_union_field union_field s_field case enum enum_member declaration
@@ -888,15 +889,15 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
| tINT3264 { $$ = type_new_int(TYPE_BASIC_INT3264, 0); }
;
-qualified_seq:
- aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
- | aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; }
- ;
+namespace_pfx:
+ aNAMESPACE '.' { push_lookup_namespace($1); }
+ | namespace_pfx aNAMESPACE '.' { push_lookup_namespace($2); }
+ ;
qualified_type:
- aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
- | aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; }
- ;
+ aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
+ | namespace_pfx aKNOWNTYPE { $$ = find_qualified_type_or_error($2, 0); }
+ ;
coclass: tCOCLASS aIDENTIFIER { $$ = type_new_coclass($2); }
| tCOCLASS aKNOWNTYPE { $$ = find_type($2, NULL, 0);
@@ -994,6 +995,8 @@ inherit: { $$ = NULL; }
interface: tINTERFACE aIDENTIFIER { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); }
| tINTERFACE aKNOWNTYPE { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); }
+ | tINTERFACE namespace_pfx aIDENTIFIER { $$ = get_qualified_type(TYPE_INTERFACE, $3, 0); }
+ | tINTERFACE namespace_pfx aKNOWNTYPE { $$ = get_qualified_type(TYPE_INTERFACE, $3, 0); }
;
interfacehdr: attributes interface { $$ = $2;
@@ -1970,12 +1973,6 @@ static void pop_namespace(const char *name)
current_namespace = current_namespace->parent;
}
-static void init_lookup_namespace(const char *name)
-{
- if (!(lookup_namespace = find_sub_namespace(&global_namespace, name)))
- error_loc("namespace '%s' not found\n", name);
-}
-
static void push_lookup_namespace(const char *name)
{
struct namespace *namespace;
@@ -2093,11 +2090,29 @@ type_t *find_type(const char *name, struct namespace *namespace, int t)
return NULL;
}
+static type_t *get_qualified_type(enum type_type type_type, char *name, int t)
+{
+ type_t *type = get_type(type_type, name, lookup_namespace, t);
+ lookup_namespace = &global_namespace;
+ return type;
+}
+
+static type_t *find_qualified_type_or_error(const char *name, int t)
+{
+ type_t *type;
+ if (!(type = find_type(name, lookup_namespace, t)))
+ {
+ error_loc("type '%s' not found\n", name);
+ return NULL;
+ }
+ lookup_namespace = &global_namespace;
+ return type;
+}
+
static type_t *find_type_or_error(const char *name, int t)
{
type_t *type;
- if (!(type = find_type(name, current_namespace, t)) &&
- !(type = find_type(name, lookup_namespace, t)))
+ if (!(type = find_type(name, current_namespace, t)))
{
error_loc("type '%s' not found\n", name);
return NULL;
@@ -2114,15 +2129,16 @@ static type_t *find_type_or_error2(char *name, int t)
int is_type(const char *name)
{
- return find_type(name, current_namespace, 0) != NULL ||
- find_type(name, lookup_namespace, 0) != NULL;
+ if (lookup_namespace != &global_namespace)
+ return find_type(name, lookup_namespace, 0) != NULL;
+ else
+ return find_type(name, current_namespace, 0) != NULL;
}
int is_namespace(const char *name)
{
if (!winrt_mode) return 0;
- return find_sub_namespace(current_namespace, name) != NULL ||
- find_sub_namespace(&global_namespace, name) != NULL;
+ return find_sub_namespace(lookup_namespace, name) != NULL;
}
type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t)
--
2.30.0
Feb. 2, 2021
[PATCH 1/5] widl: Generate WinRT runtimeclass name constants.
by Rémi Bernon
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
Updating this patch with the suggested change, and adding a few more.
tools/widl/header.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 63389440c94..e6394991317 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1702,6 +1702,7 @@ static void write_runtimeclass(FILE *header, type_t *runtimeclass)
{
expr_t *contract = get_attrp(runtimeclass->attrs, ATTR_CONTRACT);
char *name, *c_name;
+ size_t i, len;
name = format_namespace(runtimeclass->namespace, "", ".", runtimeclass->name, NULL);
c_name = format_namespace(runtimeclass->namespace, "", "_", runtimeclass->name, NULL);
fprintf(header, "/*\n");
@@ -1710,6 +1711,14 @@ static void write_runtimeclass(FILE *header, type_t *runtimeclass)
if (contract) write_apicontract_guard_start(header, contract);
fprintf(header, "#ifndef RUNTIMECLASS_%s_DEFINED\n", c_name);
fprintf(header, "#define RUNTIMECLASS_%s_DEFINED\n", c_name);
+ fprintf(header, "#if defined(_MSC_VER) || defined(__MINGW32__)\n");
+ /* FIXME: MIDL generates extern const here but GCC warns if extern is initialized */
+ fprintf(header, "const DECLSPEC_SELECTANY WCHAR RuntimeClass_%s[] = L\"%s\";\n", c_name, name);
+ fprintf(header, "#else\n");
+ fprintf(header, "static const WCHAR RuntimeClass_%s[] = {", c_name);
+ for (i = 0, len = strlen(name); i < len; ++i) fprintf(header, "'%c',", name[i]);
+ fprintf(header, "0};\n");
+ fprintf(header, "#endif\n");
fprintf(header, "#endif /* RUNTIMECLASS_%s_DEFINED */\n", c_name);
free(c_name);
free(name);
--
2.30.0
Feb. 2, 2021
Re: [PATCH 2/2] conhost: Improve notification when resizing window.
by Roman Pišl
Dne 01. 02. 21 v 18:43 Jacek Caban napsal(a):
> On 01.02.2021 18:29, Roman Pišl wrote:
>> diff --git a/programs/conhost/window.c b/programs/conhost/window.c
>> index 5e94a1d454e..01917ee8b67 100644
>> --- a/programs/conhost/window.c
>> +++ b/programs/conhost/window.c
>> @@ -1901,6 +1901,8 @@ static void apply_config( struct console
>> *console, const struct console_config *
>> }
>> update_window( console );
>> +
>> + notify_screen_buffer_size( console->active );
>
>
> Should we do this only when the size actually changed?
Good point. But the application usually updates also viewport within
this event. And since there is no event for viewport change, not sending
this event if there is only viewport change without buffer change is a
half solution.
I also found this: https://github.com/microsoft/terminal/issues/281
Yes, there could be a test for viewport and buffer change, but isn't
such complexity superfluous considering that apply_config is only called
on init, config dialog and resize event?
Roman
>
>
> Thanks,
>
> Jacek
>
Feb. 2, 2021
[PATCH v2 resend 2/2] gdi32: Create a bitmap of the size of the virtual screen for display DCs.
by Zhiyi Zhang
Fix a bug that WeChat screenshot is black when there is only one monitor.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdi32/dc.c | 11 ++++++-
dlls/gdi32/driver.c | 2 +-
dlls/gdi32/gdi_private.h | 5 +++
dlls/gdi32/gdiobj.c | 61 +++++++++++++++++++++++++++++++++++--
dlls/gdi32/tests/bitmap.c | 1 -
dlls/user32/tests/monitor.c | 3 --
6 files changed, 74 insertions(+), 9 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 830fabf6e78..16aea2933aa 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -649,7 +649,16 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
if (!(dc = alloc_dc_ptr( OBJ_DC ))) return 0;
hdc = dc->hSelf;
- dc->hBitmap = GDI_inc_ref_count( GetStockObject( DEFAULT_BITMAP ));
+ if (!lstrcmpiW( driver, L"DISPLAY" ) || is_display_device( driver ) || is_display_device( device ))
+ {
+ dc->display_dc = 1;
+ dc->hBitmap = GDI_inc_ref_count( GetStockObject( DISPLAY_BITMAP ));
+ }
+ else
+ {
+ dc->display_dc = 0;
+ dc->hBitmap = GDI_inc_ref_count( GetStockObject( DEFAULT_BITMAP ));
+ }
TRACE("(driver=%s, device=%s, output=%s): returning %p\n",
debugstr_w(driver), debugstr_w(device), debugstr_w(output), dc->hSelf );
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index e146a3a4f85..d59061066a3 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -85,7 +85,7 @@ static BOOL (WINAPI *pEnumDisplayMonitors)(HDC, LPRECT, MONITORENUMPROC, LPARAM)
static BOOL (WINAPI *pEnumDisplaySettingsW)(LPCWSTR, DWORD, LPDEVMODEW);
static HWND (WINAPI *pGetDesktopWindow)(void);
static BOOL (WINAPI *pGetMonitorInfoW)(HMONITOR, LPMONITORINFO);
-static INT (WINAPI *pGetSystemMetrics)(INT);
+INT (WINAPI *pGetSystemMetrics)(INT) = NULL;
static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
/**********************************************************************
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index 2bf16e8eaf8..13865f37ecc 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -47,6 +47,8 @@ typedef struct {
/* extra stock object: default 1x1 bitmap for memory DCs */
#define DEFAULT_BITMAP (STOCK_LAST+1)
+/* extra stock object: the bitmap for display DCs */
+#define DISPLAY_BITMAP (STOCK_LAST+2)
struct gdi_obj_funcs
{
@@ -72,6 +74,7 @@ typedef struct tagDC
DCHOOKPROC hookProc; /* DC hook */
BOOL bounds_enabled:1; /* bounds tracking is enabled */
BOOL path_open:1; /* path is currently open (only for saved DCs) */
+ BOOL display_dc:1; /* Whether this DC is a display DC */
POINT wnd_org; /* Window origin */
SIZE wnd_ext; /* Window extent */
@@ -761,4 +764,6 @@ extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
extern HMODULE gdi32_module DECLSPEC_HIDDEN;
+extern INT (WINAPI *pGetSystemMetrics)( INT ) DECLSPEC_HIDDEN;
+
#endif /* __WINE_GDI_PRIVATE_H */
diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c
index 2309fdac582..bda1cf387be 100644
--- a/dlls/gdi32/gdiobj.c
+++ b/dlls/gdi32/gdiobj.c
@@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
+#include "winuser.h"
#include "winreg.h"
#include "winnls.h"
#include "winerror.h"
@@ -101,12 +102,13 @@ static const LOGPEN NullPen = { PS_NULL, { 0, 0 }, 0 };
static const LOGBRUSH DCBrush = { BS_SOLID, RGB(255,255,255), 0 };
static const LOGPEN DCPen = { PS_SOLID, { 0, 0 }, RGB(0,0,0) };
-/* reserve one extra entry for the stock default bitmap */
+/* reserve extra entries for the stock default bitmap and a bitmap for display DCs */
/* this is what Windows does too */
-#define NB_STOCK_OBJECTS (STOCK_LAST+2)
+#define NB_STOCK_OBJECTS (STOCK_LAST+3)
static HGDIOBJ stock_objects[NB_STOCK_OBJECTS];
static HGDIOBJ scaled_stock_objects[NB_STOCK_OBJECTS];
+static SIZE display_bitmap_size = { 1, 1 };
static CRITICAL_SECTION gdi_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
@@ -642,6 +644,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
stock_objects[DEFAULT_PALETTE] = PALETTE_Init();
stock_objects[DEFAULT_BITMAP] = CreateBitmap( 1, 1, 1, 1, NULL );
+ stock_objects[DISPLAY_BITMAP] = CreateBitmap( 1, 1, 1, 1, NULL );
/* language-independent stock fonts */
stock_objects[OEM_FIXED_FONT] = CreateFontIndirectW( &OEMFixedFont );
@@ -1007,6 +1010,9 @@ void GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc)
*/
HGDIOBJ WINAPI GetStockObject( INT obj )
{
+ HBITMAP bitmap;
+ SIZE size;
+
if ((obj < 0) || (obj >= NB_STOCK_OBJECTS)) return 0;
switch (obj)
{
@@ -1016,6 +1022,32 @@ HGDIOBJ WINAPI GetStockObject( INT obj )
case DEFAULT_GUI_FONT:
if (get_system_dpi() != 96) return scaled_stock_objects[obj];
break;
+ case DISPLAY_BITMAP:
+ {
+ EnterCriticalSection( &gdi_section );
+
+ if (pGetSystemMetrics)
+ {
+ size.cx = pGetSystemMetrics( SM_CXVIRTUALSCREEN );
+ size.cy = pGetSystemMetrics( SM_CYVIRTUALSCREEN );
+ if (size.cx != display_bitmap_size.cx || size.cy != display_bitmap_size.cy)
+ {
+ if ((bitmap = CreateBitmap( size.cx, size.cy, 1, 32, NULL )))
+ {
+ __wine_make_gdi_object_system( stock_objects[DISPLAY_BITMAP], FALSE );
+ if (!GDI_get_ref_count( stock_objects[DISPLAY_BITMAP] ))
+ DeleteObject( stock_objects[DISPLAY_BITMAP] );
+ stock_objects[DISPLAY_BITMAP] = bitmap;
+ display_bitmap_size = size;
+ __wine_make_gdi_object_system( stock_objects[DISPLAY_BITMAP], TRUE );
+ }
+ }
+ }
+
+ bitmap = stock_objects[DISPLAY_BITMAP];
+ LeaveCriticalSection( &gdi_section );
+ return bitmap;
+ }
}
return stock_objects[obj];
}
@@ -1125,6 +1157,7 @@ HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type)
{
HGDIOBJ ret = 0;
DC * dc = get_dc_ptr( hdc );
+ HBITMAP display_bitmap;
if (!dc) return 0;
@@ -1134,7 +1167,29 @@ HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type)
case OBJ_BRUSH: ret = dc->hBrush; break;
case OBJ_PAL: ret = dc->hPalette; break;
case OBJ_FONT: ret = dc->hFont; break;
- case OBJ_BITMAP: ret = dc->hBitmap; break;
+ case OBJ_BITMAP:
+ {
+ if (dc->display_dc)
+ {
+ EnterCriticalSection( &gdi_section );
+
+ display_bitmap = GetStockObject( DISPLAY_BITMAP );
+ if (dc->hBitmap != display_bitmap)
+ {
+ GDI_dec_ref_count( dc->hBitmap );
+ dc->hBitmap = GDI_inc_ref_count( display_bitmap );
+ }
+
+ ret = dc->hBitmap;
+ LeaveCriticalSection( &gdi_section );
+ }
+ else
+ {
+ ret = dc->hBitmap;
+ }
+
+ break;
+ }
/* tests show that OBJ_REGION is explicitly ignored */
case OBJ_REGION: break;
diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c
index fe3482671b2..b8071dc2155 100644
--- a/dlls/gdi32/tests/bitmap.c
+++ b/dlls/gdi32/tests/bitmap.c
@@ -2783,7 +2783,6 @@ static void test_CreateBitmap(void)
"0: %p, 1: %p, 4: %p, 5: %p, curObj1 %p, old1 %p\n",
bm, bm1, bm4, bm5, curObj1, old1);
ok(bm != bm2 && bm != bm3, "0: %p, 2: %p, 3: %p\n", bm, bm2, bm3);
-todo_wine
ok(bm != curObj2, "0: %p, curObj2 %p\n", bm, curObj2);
ok(old2 == 0, "old2 %p\n", old2);
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index 926b288da11..adea730f65f 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -2039,13 +2039,10 @@ static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_
if (ret)
{
ok_(__FILE__, line)(bitmap.bmType == 0, "Expected bmType %d, got %d.\n", 0, bitmap.bmType);
- todo_wine
ok_(__FILE__, line)(bitmap.bmWidth == GetSystemMetrics(SM_CXVIRTUALSCREEN),
"Expected bmWidth %d, got %d.\n", GetSystemMetrics(SM_CXVIRTUALSCREEN), bitmap.bmWidth);
- todo_wine
ok_(__FILE__, line)(bitmap.bmHeight == GetSystemMetrics(SM_CYVIRTUALSCREEN),
"Expected bmHeight %d, got %d.\n", GetSystemMetrics(SM_CYVIRTUALSCREEN), bitmap.bmHeight);
- todo_wine
ok_(__FILE__, line)(bitmap.bmBitsPixel == GetDeviceCaps(hdc, BITSPIXEL),
"Expected bmBitsPixel %d, got %d.\n", GetDeviceCaps(hdc, BITSPIXEL), bitmap.bmBitsPixel);
ok_(__FILE__, line)(bitmap.bmWidthBytes == get_bitmap_stride(bitmap.bmWidth, bitmap.bmBitsPixel),
--
2.27.0
Feb. 2, 2021
[PATCH v2 resend 1/2] user32/tests: Add display DC bitmap tests.
by Zhiyi Zhang
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
v2: Supersede 198913~198914. Remove a todo_wine for a test that succeeds now.
v2 resend: Supersede 198919~198920. 198920 seems to be mistakenly marked as superseded. Thus the resend.
dlls/user32/tests/monitor.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c
index 58b3f0d5e0c..926b288da11 100644
--- a/dlls/user32/tests/monitor.c
+++ b/dlls/user32/tests/monitor.c
@@ -68,6 +68,11 @@ static void flush_events(void)
}
}
+static int get_bitmap_stride(int width, int bpp)
+{
+ return ((width * bpp + 15) >> 3) & ~1;
+}
+
static BOOL CALLBACK monitor_enum_proc(HMONITOR hmon, HDC hdc, LPRECT lprc,
LPARAM lparam)
{
@@ -1995,7 +2000,10 @@ static void test_handles(void)
#define check_display_dc(a, b, c) _check_display_dc(__LINE__, a, b, c)
static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_todo)
{
+ BITMAP bitmap;
+ HBITMAP hbmp;
INT value;
+ BOOL ret;
value = GetDeviceCaps(hdc, HORZRES);
todo_wine_if(allow_todo && dm->dmPelsWidth != GetSystemMetrics(SM_CXSCREEN))
@@ -2023,6 +2031,29 @@ static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_
todo_wine_if(allow_todo)
ok_(__FILE__, line)(value == dm->dmDisplayFrequency, "Expected VREFRESH %d, got %d.\n",
dm->dmDisplayFrequency, value);
+
+ hbmp = GetCurrentObject(hdc, OBJ_BITMAP);
+ ok_(__FILE__, line)(!!hbmp, "GetCurrentObject failed, error %#x.\n", GetLastError());
+ ret = GetObjectA(hbmp, sizeof(bitmap), &bitmap);
+ ok_(__FILE__, line)(ret || broken(!ret), /* <= Win7 */ "GetObjectA failed, error %#x.\n", GetLastError());
+ if (ret)
+ {
+ ok_(__FILE__, line)(bitmap.bmType == 0, "Expected bmType %d, got %d.\n", 0, bitmap.bmType);
+ todo_wine
+ ok_(__FILE__, line)(bitmap.bmWidth == GetSystemMetrics(SM_CXVIRTUALSCREEN),
+ "Expected bmWidth %d, got %d.\n", GetSystemMetrics(SM_CXVIRTUALSCREEN), bitmap.bmWidth);
+ todo_wine
+ ok_(__FILE__, line)(bitmap.bmHeight == GetSystemMetrics(SM_CYVIRTUALSCREEN),
+ "Expected bmHeight %d, got %d.\n", GetSystemMetrics(SM_CYVIRTUALSCREEN), bitmap.bmHeight);
+ todo_wine
+ ok_(__FILE__, line)(bitmap.bmBitsPixel == GetDeviceCaps(hdc, BITSPIXEL),
+ "Expected bmBitsPixel %d, got %d.\n", GetDeviceCaps(hdc, BITSPIXEL), bitmap.bmBitsPixel);
+ ok_(__FILE__, line)(bitmap.bmWidthBytes == get_bitmap_stride(bitmap.bmWidth, bitmap.bmBitsPixel),
+ "Expected bmWidthBytes %d, got %d.\n", get_bitmap_stride(bitmap.bmWidth, bitmap.bmBitsPixel),
+ bitmap.bmWidthBytes);
+ ok_(__FILE__, line)(bitmap.bmPlanes == 1, "Expected bmPlanes %d, got %d.\n", 1, bitmap.bmPlanes);
+ ok_(__FILE__, line)(bitmap.bmBits == NULL, "Expected bmBits %p, got %p.\n", NULL, bitmap.bmBits);
+ }
}
static void test_display_dc(void)
--
2.27.0
Feb. 2, 2021
[PATCH] include: Pack HID_DESCRIPTOR.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
include/ddk/hidport.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/ddk/hidport.h b/include/ddk/hidport.h
index 3ebe273583b..2c881c87921 100644
--- a/include/ddk/hidport.h
+++ b/include/ddk/hidport.h
@@ -49,6 +49,7 @@ typedef struct _HID_DEVICE_ATTRIBUTES
USHORT Reserved[11];
} HID_DEVICE_ATTRIBUTES, *PHID_DEVICE_ATTRIBUTES;
+#include <pshpack1.h>
typedef struct _HID_DESCRIPTOR
{
UCHAR bLength;
@@ -62,6 +63,7 @@ typedef struct _HID_DESCRIPTOR
USHORT wReportLength;
} DescriptorList[1];
} HID_DESCRIPTOR, *PHID_DESCRIPTOR;
+#include <poppack.h>
#define HID_HID_DESCRIPTOR_TYPE 0x21
#define HID_REPORT_DESCRIPTOR_TYPE 0x22
--
2.20.1
Feb. 2, 2021
[PATCH] winebus.sys: Fix the definition of ABS_TO_HID_MAP.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winebus.sys/bus_udev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 1473579c72c..74cf6a28a1a 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -141,6 +141,11 @@ static const BYTE ABS_TO_HID_MAP[][2] = {
{HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_WHEEL}, /*ABS_WHEEL*/
{HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_ACCELERATOR}, /*ABS_GAS*/
{HID_USAGE_PAGE_SIMULATION, HID_USAGE_SIMULATION_BRAKE}, /*ABS_BRAKE*/
+ {0,0},
+ {0,0},
+ {0,0},
+ {0,0},
+ {0,0},
{0,0}, /*ABS_HAT0X*/
{0,0}, /*ABS_HAT0Y*/
{0,0}, /*ABS_HAT1X*/
@@ -160,6 +165,7 @@ static const BYTE ABS_TO_HID_MAP[][2] = {
{HID_USAGE_PAGE_CONSUMER, HID_USAGE_CONSUMER_VOLUME} /*ABS_VOLUME*/
};
#define HID_ABS_MAX (ABS_VOLUME+1)
+C_ASSERT(ARRAY_SIZE(ABS_TO_HID_MAP) == HID_ABS_MAX);
#define TOP_ABS_PAGE (HID_USAGE_PAGE_DIGITIZER+1)
static const BYTE REL_TO_HID_MAP[][2] = {
--
2.20.1
Feb. 2, 2021
[PATCH] ntoskrnl: Do not destroy the device list in enumerate_new_device().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/ntoskrnl.exe/pnp.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c
index 6a0e82ec0e2..713e469ee7e 100644
--- a/dlls/ntoskrnl.exe/pnp.c
+++ b/dlls/ntoskrnl.exe/pnp.c
@@ -336,7 +336,6 @@ static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set )
&& !SetupDiOpenDeviceInfoW( set, device_instance_id, NULL, 0, &sp_device ))
{
ERR("Failed to create or open device %s, error %#x.\n", debugstr_w(device_instance_id), GetLastError());
- SetupDiDestroyDeviceInfoList( set );
return;
}
@@ -353,10 +352,7 @@ static void enumerate_new_device( DEVICE_OBJECT *device, HDEVINFO set )
}
if (need_driver && !install_device_driver( device, set, &sp_device ))
- {
- SetupDiDestroyDeviceInfoList( set );
return;
- }
start_device( device, set, &sp_device );
}
--
2.20.1
Feb. 2, 2021
[PATCH] gdiplus/tests: Test image brush transformation.
by Haoyang Chen
Signed-off-by: Haoyang Chen <chenhaoyang(a)uniontech.com>
---
dlls/gdiplus/tests/brush.c | 64 ++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c
index 78939e68991..0287078bc80 100644
--- a/dlls/gdiplus/tests/brush.c
+++ b/dlls/gdiplus/tests/brush.c
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
#include <math.h>
#include "objbase.h"
@@ -274,6 +275,37 @@ static void test_transform(void)
GpPointF start, end;
GpRectF rectf;
REAL elements[6];
+ UINT buf[15];
+ HBITMAP hbmp,old;
+ HDC dcmem;
+ BITMAP bm;
+ GpImage *image;
+ IStream *stream;
+ HGLOBAL hglob;
+ VOID *data;
+ HRESULT hr;
+ LONG size;
+
+ /* 3*5 bmp 32bit*/
+ static const unsigned char bmpimage[] = {
+ 0x42,0x4d,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,
+ 0x00,0x00,0x28,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,
+ 0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,
+ 0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0x11,0xff,0x00,0xff,0x11,0xff,0x00,0xff,0x11,0xff,0x00,
+ 0xff,0x33,0xff,0x00,0xff,0x33,0xff,0x00,0xff,0x33,0xff,0x00,
+ 0xff,0x55,0xff,0x00,0xff,0x55,0xff,0x00,0xff,0x55,0xff,0x00,
+ 0xff,0xaa,0xff,0x00,0xff,0xaa,0xff,0x00,0xff,0xaa,0xff,0x00,
+ 0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x00};
+
+ static const UINT buf_rotate_180[15] = {
+ 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffff11ff, 0xffff11ff, 0xffff11ff,
+ 0xffff33ff, 0xffff33ff, 0xffff33ff,
+ 0xffff55ff, 0xffff55ff, 0xffff55ff,
+ 0xffffaaff, 0xffffaaff, 0xffffaaff};
/* GpTexture */
status = GdipCreateMatrix2(2.0, 0.0, 0.0, 0.0, 0.0, 0.0, &m);
@@ -556,6 +588,38 @@ static void test_transform(void)
expect(Ok, status);
status = GdipDeleteBrush((GpBrush*)line);
expect(Ok,status);
+ GdipDeleteGraphics(graphics);
+
+ dcmem = CreateCompatibleDC(hdc);
+ hbmp = CreateBitmap(3, 5, 1, 32, NULL);
+ old = SelectObject(dcmem, hbmp);
+ status = GdipCreateFromHDC(dcmem, &graphics);
+ expect(Ok, status);
+ hglob = GlobalAlloc(0, sizeof(bmpimage));
+ data = GlobalLock (hglob);
+ memcpy(data, bmpimage, sizeof(bmpimage));
+ GlobalUnlock(hglob);
+ hr = CreateStreamOnHGlobal(hglob, TRUE, &stream);
+ expect(S_OK, hr);
+ status = GdipLoadImageFromStream(stream, &image);
+ expect(Ok, status);
+ status = GdipCreateTexture(image, WrapModeTile, &texture);
+ expect(Ok, status);
+ status = GdipRotateTextureTransform(texture, 180.0f, MatrixOrderPrepend);
+ expect(Ok, status);
+ status = GdipFillRectangle(graphics, (GpBrush*)texture, .0f, .0f, (REAL)3, (REAL)5);
+ expect(Ok, status);
+ GdipDeleteBrush((GpBrush*)texture);
+ GdipDisposeImage(image);
+ GdipDeleteGraphics(graphics);
+ IStream_Release(stream);
+ hbmp = SelectObject(dcmem, old);
+ GetObjectW(hbmp, sizeof(bm), &bm);
+ size = GetBitmapBits(hbmp, sizeof(buf), buf);
+ expect(sizeof(buf), size);
+ DeleteObject(hbmp);
+ DeleteDC(dcmem);
+ ok(!memcmp(buf, buf_rotate_180, sizeof(buf)), "Failed to rotate image.\n");
if(0){
/* enable to visually compare with Windows */
--
2.20.1
Feb. 2, 2021
[PATCH 5/5] winegstreamer: Duplicate the "sink_connected" field in struct wg_parser.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index ab7efc24018..1ddbc954fb4 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -69,7 +69,7 @@ struct wg_parser
GstFlowReturn ret;
} read_request;
- bool flushing;
+ bool flushing, sink_connected;
};
struct parser
@@ -1188,12 +1188,12 @@ static DWORD CALLBACK read_thread(void *arg)
pthread_mutex_lock(&filter->mutex);
- for (;;)
+ while (filter->sink_connected)
{
- while (filter->sink_connected && !parser->read_request.buffer)
+ while (parser->sink_connected && !parser->read_request.buffer)
pthread_cond_wait(&parser->read_cond, &filter->mutex);
- if (!filter->sink_connected)
+ if (!parser->sink_connected)
break;
parser->read_request.done = true;
@@ -1593,6 +1593,7 @@ static HRESULT GST_Connect(struct parser *This, IPin *pConnectPin)
parser->file_size = This->file_size;
This->sink_connected = true;
+ parser->sink_connected = true;
This->read_thread = CreateThread(NULL, 0, read_thread, This, 0, NULL);
@@ -2541,8 +2542,9 @@ static HRESULT GST_RemoveOutputPins(struct parser *This)
/* read_thread() needs to stay alive to service any read requests GStreamer
* sends, so we can only shut it down after GStreamer stops. */
- pthread_mutex_lock(&This->mutex);
This->sink_connected = false;
+ pthread_mutex_lock(&This->mutex);
+ parser->sink_connected = false;
pthread_mutex_unlock(&This->mutex);
pthread_cond_signal(&parser->read_cond);
WaitForSingleObject(This->read_thread, INFINITE);
--
2.30.0
Feb. 2, 2021