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
June 2022
- 68 participants
- 3274 messages
Re: [PATCH v2 2/6] d3dx10_43: Share code for file data loading.
by Matteo Bruni
On Thu, May 26, 2022 at 6:32 PM Piotr Caban <piotr(a)codeweavers.com> wrote:
>
> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
> ---
> dlls/d3dx10_43/async.c | 39 +++++++++++++++---------
> dlls/d3dx10_43/dxhelpers.h | 19 ++++++++++++
> dlls/d3dx10_43/texture.c | 62 +++++---------------------------------
> 3 files changed, 51 insertions(+), 69 deletions(-)
> create mode 100644 dlls/d3dx10_43/dxhelpers.h
>
Sorry for the long wait.
The series looks generally good but, nevertheless, I have a few
comments (one really, a few lines below). I'm sure I can be convinced
to drop or defer those to a later point though.
> + *data = HeapAlloc(GetProcessHeap(), 0, *size);
...
> - *buffer = heap_alloc(*size);
It's already a mix up of plain win32 heap allocation functions and
heap_*() helpers. This patch is moving somewhat backwards in this
sense (or maybe sideways), which wouldn't be terrible but I think it
would be nice to take the occasion to move the whole dll to the
standard C heap functions, before making other changes.
June 1, 2022
Re: [PATCH v2 4/6] d3dx10_43: Add D3DX10CreateAsyncTextureInfoProcessor stub.
by Matteo Bruni
With the subject prefix changed to "d3dx10:"
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
June 1, 2022
Re: [PATCH v2 1/6] d3dx10_43: Try loading the resource as bitmap in D3DX10CreateAsyncResourceLoader.
by Matteo Bruni
With the subject prefix changed to "d3dx10:"
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
June 1, 2022
RFC: Allow marking unreliable tests as flaky.
by Francois Gouget
Wine has many unreliable tests which makes it hard to know whether a
patch causes new failures. So one proposal was to mark unreliable tests
as flaky, and have a mode where flaky failures can ignored by setting
$WINETEST_ALLOW_FLAKY.
So one would be able to apply a patch, run 'WINETEST_ALLOW_FLAKY=1 make
test' and if that fails that means the patch introduces a new failure.
The way it works is that when a flaky test fails the message is 'Flaky
failed...' instead of 'Test failed...'. I also added the count of flaky
failures to the summary line. So the flaky failures are not totally
swept under the rug. The main difference is that if
$WINETEST_ALLOW_FLAKY is set, the exit code is 0 if the only failures
are flaky ones.
That still leaves some open questions though:
* Should the message be 'Test failed' instead of 'Flaky failed' when
$WINETEST_ALLOW_FLAKY is not set? I opted for the latter because it
adds information that the failed test has been marked as flaky.
* Should tests that fail systematically on some platforms but not others
(for instance specific Windows versions, specific locales, specific
GPUs) be marked as flaky? Or should flaky be reserved for tests that
fail randomly?
* What about failures where the message is different every time so
that the failure always looks new? Should these not be marked as flaky
since it only impacts the TestBot?
* On a related note the patch below has flaky_windows and flaky_wine
macros. Is that too fine grained? Maybe we don't want to run the risk
of marking a test as flaky_windows only to discover later that it can
also fail in Wine? But conversely, wouldn't it be valuable to know
that a test is only flaky in Wine and not in Windows?
Note: flaky_windows is a bit long but I was worried that flaky_win
would be too similar to flaky_wine.
* I decided having flaky_{windows,wine}_if() macros would be overkill.
* How does one know a flaky directive can be removed?
* Is it allowed to submit a patch that contains new flaky directives?
* Also the flaky directive cannot deal with tests that randomly crash,
prematurely exit, or time out. These issues are rarer so maybe we can
hope they can all be fixed?
* How does this impact bug 48912, aka "Allow blacklisting unreliable
and always new failures"?
https://bugs.winehq.org/show_bug.cgi?id=48912
* test.winehq.org and the TestBot will need to be updated to highlight
the new messages and, more importantly, to recognize the new summary
line.
The patch is below and I bundled it with tweaks to a few tests for
illustration purposes:
d3d8:device - Failure happens on Windows (rarely) and Wine.
dinput:mouse - Failure happens on Windows 7 and Wine.
mmdevapi:render - Timing issue.
schedsvc:atsvcapi - Wine-only failure.
---
dlls/d3d8/tests/device.c | 2 +-
dlls/dinput/tests/mouse.c | 2 +-
dlls/mmdevapi/tests/render.c | 2 +-
dlls/schedsvc/tests/atsvcapi.c | 2 +-
include/wine/test.h | 78 +++++++++++++++++++++++++++++-----
5 files changed, 72 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index cb1e83b64b3..f0e8c27fafd 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -3356,7 +3356,7 @@ static void test_wndproc(void)
expect_messages = sc_maximize_messages;
SendMessageA(focus_window, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
- ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it.\n",
+ flaky ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it.\n",
expect_messages->message, expect_messages->window);
expect_messages = NULL;
flush_events();
diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c
index 8be808e5da6..dcb5453a825 100644
--- a/dlls/dinput/tests/mouse.c
+++ b/dlls/dinput/tests/mouse.c
@@ -156,7 +156,7 @@ static void test_acquire(IDirectInputA *pDI, HWND hwnd)
SetActiveWindow( hwnd );
hr = IDirectInputDevice_Acquire(pMouse);
- ok(hr == S_OK, "Acquire() failed: %#lx\n", hr);
+ flaky ok(hr == S_OK, "Acquire() failed: %#lx\n", hr);
mouse_event(MOUSEEVENTF_MOVE, 10, 10, 0, 0);
cnt = 1;
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c
index 4e19b91c5f5..882be89b7ff 100644
--- a/dlls/mmdevapi/tests/render.c
+++ b/dlls/mmdevapi/tests/render.c
@@ -1098,7 +1098,7 @@ static void test_clock(int share)
ok(pos == 0, "GetPosition returned non-zero pos before being started\n");
hr = IAudioClient_Start(ac); /* #1 */
- ok(hr == S_OK, "Start failed: %08lx\n", hr);
+ flaky ok(hr == S_OK, "Start failed: %08lx\n", hr);
Sleep(100);
slept += 100;
diff --git a/dlls/schedsvc/tests/atsvcapi.c b/dlls/schedsvc/tests/atsvcapi.c
index 3aaad8b5cfe..83774804b40 100644
--- a/dlls/schedsvc/tests/atsvcapi.c
+++ b/dlls/schedsvc/tests/atsvcapi.c
@@ -168,7 +168,7 @@ START_TEST(atsvcapi)
skip_tests_delete:
ret = NetrJobDel(server_name, jobid, jobid);
- ok(ret == ERROR_SUCCESS, "NetrJobDel error %lu\n", ret);
+ flaky_wine ok(ret == ERROR_SUCCESS, "NetrJobDel error %lu\n", ret);
skip_tests:
SetUnhandledExceptionFilter(old_exception_filter);
diff --git a/include/wine/test.h b/include/wine/test.h
index 01ba81f4857..422ba3dce38 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -50,6 +50,9 @@ extern int winetest_time;
/* running in interactive mode? */
extern int winetest_interactive;
+/* always count flaky tests as successful (BOOL) */
+extern int winetest_allow_flaky;
+
/* report successful tests (BOOL) */
extern int winetest_report_success;
@@ -117,6 +120,13 @@ extern void winetest_pop_context(void);
#define trace trace_(__FILE__, __LINE__)
#define wait_child_process wait_child_process_(__FILE__, __LINE__)
+#define flaky_if(is_flaky) for (winetest_start_flaky(is_flaky); \
+ winetest_loop_flaky(); \
+ winetest_end_flaky())
+#define flaky flaky_if(1)
+#define flaky_windows flaky_if(!strcmp(winetest_platform, "windows"))
+#define flaky_wine flaky_if(!strcmp(winetest_platform, "wine"))
+
#define todo_if(is_todo) for (winetest_start_todo(is_todo); \
winetest_loop_todo(); \
winetest_end_todo())
@@ -200,6 +210,9 @@ int winetest_interactive = 0;
/* current platform */
const char *winetest_platform = "windows";
+/* always count flaky tests as successful (BOOL) */
+int winetest_allow_flaky;
+
/* report successful tests (BOOL) */
int winetest_report_success = 0;
@@ -214,6 +227,7 @@ static const struct test *current_test; /* test currently being run */
static LONG successes; /* number of successful tests */
static LONG failures; /* number of failures */
+static LONG flaky_failures; /* number of failures inside flaky block */
static LONG skipped; /* number of skipped test chunks */
static LONG todo_successes; /* number of successful tests inside todo block */
static LONG todo_failures; /* number of failures inside todo block */
@@ -229,6 +243,8 @@ struct tls_data
{
const char* current_file; /* file of current check */
int current_line; /* line of current check */
+ unsigned int flaky_level; /* current flaky nesting level */
+ int flaky_do_loop;
unsigned int todo_level; /* current todo nesting level */
int todo_do_loop;
char *str_pos; /* position in debug buffer */
@@ -355,9 +371,18 @@ int winetest_vok( int condition, const char *msg, va_list args )
{
if (condition)
{
- winetest_print_context( "Test succeeded inside todo block: " );
- vprintf(msg, args);
- InterlockedIncrement(&todo_failures);
+ if (data->flaky_level)
+ {
+ winetest_print_context( "Flaky succeeded inside todo block: " );
+ vprintf(msg, args);
+ InterlockedIncrement(&flaky_failures);
+ }
+ else
+ {
+ winetest_print_context( "Test succeeded inside todo block: " );
+ vprintf(msg, args);
+ InterlockedIncrement(&todo_failures);
+ }
return 0;
}
else
@@ -381,9 +406,18 @@ int winetest_vok( int condition, const char *msg, va_list args )
{
if (!condition)
{
- winetest_print_context( "Test failed: " );
- vprintf(msg, args);
- InterlockedIncrement(&failures);
+ if (data->flaky_level)
+ {
+ winetest_print_context( "Flaky failed: " );
+ vprintf(msg, args);
+ InterlockedIncrement(&flaky_failures);
+ }
+ else
+ {
+ winetest_print_context( "Test failed: " );
+ vprintf(msg, args);
+ InterlockedIncrement(&failures);
+ }
return 0;
}
else
@@ -456,6 +490,27 @@ void winetest_win_skip( const char *msg, ... )
va_end(valist);
}
+void winetest_start_flaky( int is_flaky )
+{
+ struct tls_data *data = get_tls_data();
+ data->flaky_level = (data->flaky_level << 1) | (is_flaky != 0);
+ data->flaky_do_loop=1;
+}
+
+int winetest_loop_flaky(void)
+{
+ struct tls_data *data = get_tls_data();
+ int do_flaky=data->flaky_do_loop;
+ data->flaky_do_loop=0;
+ return do_flaky;
+}
+
+void winetest_end_flaky(void)
+{
+ struct tls_data *data = get_tls_data();
+ data->flaky_level >>= 1;
+}
+
void winetest_start_todo( int is_todo )
{
struct tls_data *data = get_tls_data();
@@ -601,14 +656,16 @@ static int run_test( const char *name )
printf( "%04x:%s:%s Silenced %d todos, %d skips and %d traces.\n",
(UINT)GetCurrentProcessId(), test->name, winetest_elapsed(),
(UINT)muted_todo_successes, (UINT)muted_skipped, (UINT)muted_traces);
- printf( "%04x:%s:%s %d tests executed (%d marked as todo, %d %s), %d skipped.\n",
+ printf( "%04x:%s:%s %d tests executed (%d marked as todo, %d as flaky, %d %s), %d skipped.\n",
(UINT)GetCurrentProcessId(), test->name, winetest_elapsed(),
- (UINT)(successes + failures + todo_successes + todo_failures),
- (UINT)todo_successes, (UINT)(failures + todo_failures),
+ (UINT)(successes + failures + flaky_failures + todo_successes + todo_failures),
+ (UINT)todo_successes, (UINT)flaky_failures, (UINT)(failures + todo_failures),
(failures + todo_failures != 1) ? "failures" : "failure",
(UINT)skipped );
}
- status = (failures + todo_failures < 255) ? failures + todo_failures : 255;
+ status = failures + todo_failures;
+ if (!winetest_allow_flaky) status += flaky_failures;
+ if (status > 255) status = 255;
return status;
}
@@ -665,6 +722,7 @@ int main( int argc, char **argv )
if (GetEnvironmentVariableA( "WINETEST_DEBUG", p, sizeof(p) )) winetest_debug = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p);
+ if (GetEnvironmentVariableA( "WINETEST_ALLOW_FLAKY", p, sizeof(p) )) winetest_allow_flaky = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) winetest_report_success = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_TIME", p, sizeof(p) )) winetest_time = atoi(p);
winetest_last_time = winetest_start_time = GetTickCount();
--
2.30.2
June 1, 2022
[PATCH 4/4] winemac: Use unixlib interface for IME calls.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winemac.drv/ime.c | 11 +++++++++--
dlls/winemac.drv/keyboard.c | 17 +++++++++++------
dlls/winemac.drv/macdrv.h | 3 +--
dlls/winemac.drv/macdrv_main.c | 8 ++++++++
dlls/winemac.drv/unixlib.h | 13 +++++++++++++
5 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c
index 8b89c0089fc..d1d2002fc47 100644
--- a/dlls/winemac.drv/ime.c
+++ b/dlls/winemac.drv/ime.c
@@ -577,7 +577,7 @@ BOOL WINAPI ImeProcessKey(HIMC hIMC, UINT vKey, LPARAM lKeyData, const LPBYTE lp
return FALSE;
}
- inIME = macdrv_using_input_method();
+ inIME = MACDRV_CALL(ime_using_input_method, NULL);
lpIMC = LockRealIMC(hIMC);
if (lpIMC)
{
@@ -658,6 +658,7 @@ BOOL WINAPI ImeSetActiveContext(HIMC hIMC, BOOL fFlag)
UINT WINAPI ImeToAsciiEx(UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
LPDWORD lpdwTransKey, UINT fuState, HIMC hIMC)
{
+ struct process_text_input_params params;
UINT vkey;
LPINPUTCONTEXT lpIMC;
LPIMEPRIVATE myPrivate;
@@ -690,7 +691,13 @@ UINT WINAPI ImeToAsciiEx(UINT uVKey, UINT uScanCode, const LPBYTE lpbKeyState,
UnlockRealIMC(hIMC);
TRACE("Processing Mac 0x%04x\n", vkey);
- macdrv_process_text_input(uVKey, uScanCode, repeat, lpbKeyState, hIMC, &done);
+ params.vkey = uVKey;
+ params.scan = uScanCode;
+ params.repeat = repeat;
+ params.key_state = lpbKeyState;
+ params.himc = hIMC;
+ params.done = &done;
+ MACDRV_CALL(ime_process_text_input, ¶ms);
while (!done)
MsgWaitForMultipleObjectsEx(0, NULL, INFINITE, QS_POSTMESSAGE | QS_SENDMESSAGE, 0);
diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c
index 9574b2797b5..181e86afd4a 100644
--- a/dlls/winemac.drv/keyboard.c
+++ b/dlls/winemac.drv/keyboard.c
@@ -1187,13 +1187,16 @@ void macdrv_hotkey_press(const macdrv_event *event)
/***********************************************************************
* macdrv_process_text_input
*/
-void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state, void *himc, int* done)
+NTSTATUS macdrv_ime_process_text_input(void *arg)
{
+ struct process_text_input_params *params = arg;
struct macdrv_thread_data *thread_data = macdrv_thread_data();
+ const BYTE *key_state = params->key_state;
unsigned int flags;
int keyc;
- TRACE("vkey 0x%04x scan 0x%04x repeat %u himc %p\n", vkey, scan, repeat, himc);
+ TRACE("vkey 0x%04x scan 0x%04x repeat %u himc %p\n", params->vkey, params->scan,
+ params->repeat, params->himc);
flags = thread_data->last_modifiers;
if (key_state[VK_SHIFT] & 0x80)
@@ -1215,17 +1218,19 @@ void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *ke
/* Find the Mac keycode corresponding to the scan code */
for (keyc = 0; keyc < ARRAY_SIZE(thread_data->keyc2vkey); keyc++)
- if (thread_data->keyc2vkey[keyc] == vkey) break;
+ if (thread_data->keyc2vkey[keyc] == params->vkey) break;
if (keyc >= ARRAY_SIZE(thread_data->keyc2vkey))
{
- *done = -1;
- return;
+ *params->done = -1;
+ return 0;
}
TRACE("flags 0x%08x keyc 0x%04x\n", flags, keyc);
- macdrv_send_text_input_event(((scan & 0x8000) == 0), flags, repeat, keyc, himc, done);
+ macdrv_send_text_input_event(((params->scan & 0x8000) == 0), flags, params->repeat, keyc,
+ params->himc, params->done);
+ return 0;
}
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index a4736b2d315..2ea6cd638c3 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -287,8 +287,7 @@ extern NTSTATUS macdrv_init(void *arg) DECLSPEC_HIDDEN;
* Mac IME driver
*/
-extern void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state,
- void *himc, int* done) DECLSPEC_HIDDEN;
+extern NTSTATUS macdrv_ime_process_text_input(void *arg) DECLSPEC_HIDDEN;
extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_sent_text_input(const macdrv_event *event) DECLSPEC_HIDDEN;
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c
index 6ab7b108909..4a183747796 100644
--- a/dlls/winemac.drv/macdrv_main.c
+++ b/dlls/winemac.drv/macdrv_main.c
@@ -607,8 +607,16 @@ BOOL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param,
}
+static NTSTATUS macdrv_ime_using_input_method(void *arg)
+{
+ return macdrv_using_input_method();
+}
+
+
const unixlib_entry_t __wine_unix_call_funcs[] =
{
+ macdrv_ime_process_text_input,
+ macdrv_ime_using_input_method,
macdrv_init,
macdrv_notify_icon,
};
diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h
index c24f8192142..dc1b314c8cb 100644
--- a/dlls/winemac.drv/unixlib.h
+++ b/dlls/winemac.drv/unixlib.h
@@ -21,6 +21,8 @@
enum macdrv_funcs
{
+ unix_ime_process_text_input,
+ unix_ime_using_input_method,
unix_init,
unix_notify_icon,
unix_funcs_count
@@ -30,6 +32,17 @@ enum macdrv_funcs
extern NTSTATUS unix_call(enum macdrv_funcs code, void *params) DECLSPEC_HIDDEN;
#define MACDRV_CALL(func, params) unix_call( unix_ ## func, params )
+/* macdrv_ime_process_text_input params */
+struct process_text_input_params
+{
+ UINT vkey;
+ UINT scan;
+ UINT repeat;
+ const BYTE *key_state;
+ void *himc;
+ int *done;
+};
+
/* macdrv_init params */
struct localized_string
{
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/168
June 1, 2022
[PATCH 3/4] winemac: Move wine_notify_icon implementation to dllmain.c.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winemac.drv/dllmain.c | 7 +++++++
dlls/winemac.drv/macdrv.h | 4 ++++
dlls/winemac.drv/macdrv_main.c | 1 +
dlls/winemac.drv/systray.c | 8 +++++---
dlls/winemac.drv/unixlib.h | 8 ++++++++
5 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/dlls/winemac.drv/dllmain.c b/dlls/winemac.drv/dllmain.c
index 60ca50474d7..23a1e6e2218 100644
--- a/dlls/winemac.drv/dllmain.c
+++ b/dlls/winemac.drv/dllmain.c
@@ -21,6 +21,7 @@
#include "config.h"
#include <stdarg.h>
#include "macdrv.h"
+#include "shellapi.h"
HMODULE macdrv_module = 0;
@@ -63,3 +64,9 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
macdrv_module = instance;
return process_attach();
}
+
+int CDECL wine_notify_icon(DWORD msg, NOTIFYICONDATAW *data)
+{
+ struct notify_icon_params params = { .msg = msg, .data = data };
+ return MACDRV_CALL(notify_icon, ¶ms);
+}
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 39aff4d6a9f..a4736b2d315 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -294,6 +294,10 @@ extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_sent_text_input(const macdrv_event *event) DECLSPEC_HIDDEN;
extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN;
+/* unixlib interface */
+
+extern NTSTATUS macdrv_notify_icon(void *arg) DECLSPEC_HIDDEN;
+
/* user helpers */
static inline LRESULT send_message(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c
index adcf6f73fc7..6ab7b108909 100644
--- a/dlls/winemac.drv/macdrv_main.c
+++ b/dlls/winemac.drv/macdrv_main.c
@@ -610,6 +610,7 @@ BOOL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param,
const unixlib_entry_t __wine_unix_call_funcs[] =
{
macdrv_init,
+ macdrv_notify_icon,
};
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
diff --git a/dlls/winemac.drv/systray.c b/dlls/winemac.drv/systray.c
index a5ea7e55d79..c1901ae0036 100644
--- a/dlls/winemac.drv/systray.c
+++ b/dlls/winemac.drv/systray.c
@@ -245,12 +245,14 @@ static BOOL delete_icon(struct tray_icon *icon)
*
* Driver-side implementation of Shell_NotifyIcon.
*/
-int CDECL wine_notify_icon(DWORD msg, NOTIFYICONDATAW *data)
+NTSTATUS macdrv_notify_icon(void *arg)
{
+ struct notify_icon_params *params = arg;
+ NOTIFYICONDATAW *data = params->data;
BOOL ret = FALSE;
struct tray_icon *icon;
- switch (msg)
+ switch (params->msg)
{
case NIM_ADD:
ret = add_icon(data);
@@ -272,7 +274,7 @@ int CDECL wine_notify_icon(DWORD msg, NOTIFYICONDATAW *data)
}
break;
default:
- FIXME("unhandled tray message: %u\n", msg);
+ FIXME("unhandled tray message: %u\n", params->msg);
break;
}
return ret;
diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h
index 9f8cd4e0acb..c24f8192142 100644
--- a/dlls/winemac.drv/unixlib.h
+++ b/dlls/winemac.drv/unixlib.h
@@ -22,6 +22,7 @@
enum macdrv_funcs
{
unix_init,
+ unix_notify_icon,
unix_funcs_count
};
@@ -41,3 +42,10 @@ struct init_params
{
struct localized_string *strings;
};
+
+/* macdrv_notify_icon params */
+struct notify_icon_params
+{
+ DWORD msg;
+ struct _NOTIFYICONDATAW *data;
+};
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/168
June 1, 2022
[PATCH 2/4] winemac: Avoid PE calls in systray.c.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winemac.drv/systray.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/winemac.drv/systray.c b/dlls/winemac.drv/systray.c
index dbddbddff9a..a5ea7e55d79 100644
--- a/dlls/winemac.drv/systray.c
+++ b/dlls/winemac.drv/systray.c
@@ -135,8 +135,8 @@ static BOOL modify_icon(struct tray_icon *icon, NOTIFYICONDATAW *nid)
if (nid->uFlags & NIF_ICON)
{
- if (icon->image) DestroyIcon(icon->image);
- icon->image = CopyIcon(nid->hIcon);
+ if (icon->image) NtUserDestroyCursor(icon->image, 0);
+ icon->image = CopyImage(nid->hIcon, IMAGE_ICON, 0, 0, 0);
if (icon->status_item)
update_image = TRUE;
}
@@ -195,7 +195,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
return FALSE;
}
- if (!(icon = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*icon))))
+ if (!(icon = calloc(1, sizeof(*icon))))
{
ERR("out of memory\n");
return FALSE;
@@ -234,8 +234,8 @@ static BOOL delete_icon(struct tray_icon *icon)
macdrv_destroy_status_item(icon->status_item);
}
list_remove(&icon->entry);
- DestroyIcon(icon->image);
- HeapFree(GetProcessHeap(), 0, icon);
+ NtUserDestroyCursor(icon->image, 0);
+ free(icon);
return TRUE;
}
@@ -290,7 +290,8 @@ static BOOL notify_owner(struct tray_icon *icon, UINT msg, int x, int y)
}
TRACE("posting msg 0x%04x to hwnd %p id 0x%x\n", msg, icon->owner, icon->id);
- if (!SendNotifyMessageW(icon->owner, icon->callback_message, wp, lp) &&
+ if (!NtUserMessageCall(icon->owner, icon->callback_message, wp, lp,
+ 0, NtUserSendNotifyMessage, FALSE) &&
(GetLastError() == ERROR_INVALID_WINDOW_HANDLE))
{
WARN("window %p was destroyed, removing icon 0x%x\n", icon->owner, icon->id);
@@ -335,7 +336,7 @@ void macdrv_status_item_mouse_button(const macdrv_event *event)
else if (event->status_item_mouse_button.count % 2 == 0)
msg += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
- if (!SendMessageW(icon->owner, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, 0, 0) &&
+ if (!send_message(icon->owner, WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS, 0, 0) &&
GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
{
WARN("window %p was destroyed, removing icon 0x%x\n", icon->owner, icon->id);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/168
June 1, 2022
[PATCH 1/4] winemac: Move DllMain to separated file.
by Jacek Caban
From: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/winemac.drv/Makefile.in | 1 +
dlls/winemac.drv/dllmain.c | 65 +++++++++++++++++++++++++++
dlls/winemac.drv/macdrv.h | 2 +
dlls/winemac.drv/macdrv_main.c | 82 +++++++++++++---------------------
dlls/winemac.drv/unixlib.h | 43 ++++++++++++++++++
5 files changed, 142 insertions(+), 51 deletions(-)
create mode 100644 dlls/winemac.drv/dllmain.c
create mode 100644 dlls/winemac.drv/unixlib.h
diff --git a/dlls/winemac.drv/Makefile.in b/dlls/winemac.drv/Makefile.in
index e345249aac7..06c654344d1 100644
--- a/dlls/winemac.drv/Makefile.in
+++ b/dlls/winemac.drv/Makefile.in
@@ -9,6 +9,7 @@ EXTRADLLFLAGS = -mcygwin
C_SRCS = \
clipboard.c \
display.c \
+ dllmain.c \
dragdrop.c \
event.c \
gdi.c \
diff --git a/dlls/winemac.drv/dllmain.c b/dlls/winemac.drv/dllmain.c
new file mode 100644
index 00000000000..60ca50474d7
--- /dev/null
+++ b/dlls/winemac.drv/dllmain.c
@@ -0,0 +1,65 @@
+/*
+ * winemac.drv entry points
+ *
+ * Copyright 2022 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include <stdarg.h>
+#include "macdrv.h"
+
+
+HMODULE macdrv_module = 0;
+
+static BOOL process_attach(void)
+{
+ struct init_params params;
+
+ struct localized_string *str;
+ struct localized_string strings[] = {
+ { .id = STRING_MENU_WINE },
+ { .id = STRING_MENU_ITEM_HIDE_APPNAME },
+ { .id = STRING_MENU_ITEM_HIDE },
+ { .id = STRING_MENU_ITEM_HIDE_OTHERS },
+ { .id = STRING_MENU_ITEM_SHOW_ALL },
+ { .id = STRING_MENU_ITEM_QUIT_APPNAME },
+ { .id = STRING_MENU_ITEM_QUIT },
+
+ { .id = STRING_MENU_WINDOW },
+ { .id = STRING_MENU_ITEM_MINIMIZE },
+ { .id = STRING_MENU_ITEM_ZOOM },
+ { .id = STRING_MENU_ITEM_ENTER_FULL_SCREEN },
+ { .id = STRING_MENU_ITEM_BRING_ALL_TO_FRONT },
+
+ { .id = 0 }
+ };
+
+ for (str = strings; str->id; str++)
+ str->len = LoadStringW(macdrv_module, str->id, (WCHAR *)&str->str, 0);
+ params.strings = strings;
+
+ return !MACDRV_CALL(init, ¶ms);
+}
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+ if (reason != DLL_PROCESS_ATTACH) return TRUE;
+
+ DisableThreadLibraryCalls(instance);
+ macdrv_module = instance;
+ return process_attach();
+}
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 9cd0509a39c..39aff4d6a9f 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -33,6 +33,7 @@
#include "ntgdi.h"
#include "wine/debug.h"
#include "wine/gdi_driver.h"
+#include "unixlib.h"
extern BOOL skip_single_buffer_flushes DECLSPEC_HIDDEN;
@@ -280,6 +281,7 @@ extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HI
extern void check_retina_status(void) DECLSPEC_HIDDEN;
extern void macdrv_init_display_devices(BOOL force) DECLSPEC_HIDDEN;
extern void init_user_driver(void) DECLSPEC_HIDDEN;
+extern NTSTATUS macdrv_init(void *arg) DECLSPEC_HIDDEN;
/**************************************************************************
* Mac IME driver
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c
index a0dc9c494da..adcf6f73fc7 100644
--- a/dlls/winemac.drv/macdrv_main.c
+++ b/dlls/winemac.drv/macdrv_main.c
@@ -63,7 +63,6 @@ int cursor_clipping_locks_windows = TRUE;
int use_precise_scrolling = TRUE;
int gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE;
int retina_enabled = FALSE;
-HMODULE macdrv_module = 0;
int enable_app_nap = FALSE;
CFDictionaryRef localized_strings;
@@ -396,25 +395,9 @@ static void setup_options(void)
/***********************************************************************
* load_strings
*/
-static void load_strings(HINSTANCE instance)
+static void load_strings(struct localized_string *str)
{
- static const unsigned int ids[] = {
- STRING_MENU_WINE,
- STRING_MENU_ITEM_HIDE_APPNAME,
- STRING_MENU_ITEM_HIDE,
- STRING_MENU_ITEM_HIDE_OTHERS,
- STRING_MENU_ITEM_SHOW_ALL,
- STRING_MENU_ITEM_QUIT_APPNAME,
- STRING_MENU_ITEM_QUIT,
-
- STRING_MENU_WINDOW,
- STRING_MENU_ITEM_MINIMIZE,
- STRING_MENU_ITEM_ZOOM,
- STRING_MENU_ITEM_ENTER_FULL_SCREEN,
- STRING_MENU_ITEM_BRING_ALL_TO_FRONT,
- };
CFMutableDictionaryRef dict;
- int i;
dict = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
@@ -424,21 +407,20 @@ static void load_strings(HINSTANCE instance)
return;
}
- for (i = 0; i < ARRAY_SIZE(ids); i++)
+ while (str->id)
{
- LPCWSTR str;
- int len = LoadStringW(instance, ids[i], (LPWSTR)&str, 0);
- if (str && len)
+ if (str->str && str->len)
{
- CFNumberRef key = CFNumberCreate(NULL, kCFNumberIntType, &ids[i]);
- CFStringRef value = CFStringCreateWithCharacters(NULL, (UniChar*)str, len);
+ CFNumberRef key = CFNumberCreate(NULL, kCFNumberIntType, &str->id);
+ CFStringRef value = CFStringCreateWithCharacters(NULL, (UniChar*)str->str, str->len);
if (key && value)
CFDictionarySetValue(dict, key, value);
else
- ERR("Failed to add string ID 0x%04x %s\n", ids[i], debugstr_wn(str, len));
+ ERR("Failed to add string ID 0x%04x %s\n", str->id, debugstr_wn(str->str, str->len));
}
else
- ERR("Failed to load string ID 0x%04x\n", ids[i]);
+ ERR("Failed to load string ID 0x%04x\n", str->id);
+ str++;
}
localized_strings = dict;
@@ -446,32 +428,33 @@ static void load_strings(HINSTANCE instance)
/***********************************************************************
- * process_attach
+ * macdrv_init
*/
-static BOOL process_attach(void)
+NTSTATUS macdrv_init(void *arg)
{
+ struct init_params *params = arg;
SessionAttributeBits attributes;
OSStatus status;
status = SessionGetInfo(callerSecuritySession, NULL, &attributes);
if (status != noErr || !(attributes & sessionHasGraphicAccess))
- return FALSE;
+ return STATUS_UNSUCCESSFUL;
init_win_context();
setup_options();
- load_strings(macdrv_module);
+ load_strings(params->strings);
macdrv_err_on = ERR_ON(macdrv);
- if (macdrv_start_cocoa_app(GetTickCount64()))
+ if (macdrv_start_cocoa_app(NtGetTickCount()))
{
ERR("Failed to start Cocoa app main loop\n");
- return FALSE;
+ return STATUS_UNSUCCESSFUL;
}
init_user_driver();
macdrv_init_display_devices(FALSE);
- return TRUE;
+ return STATUS_SUCCESS;
}
@@ -559,24 +542,6 @@ struct macdrv_thread_data *macdrv_init_thread_data(void)
}
-/***********************************************************************
- * DllMain
- */
-BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
-{
- BOOL ret = TRUE;
-
- switch(reason)
- {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls( hinst );
- macdrv_module = hinst;
- ret = process_attach();
- break;
- }
- return ret;
-}
-
/***********************************************************************
* SystemParametersInfo (MACDRV.@)
*/
@@ -640,3 +605,18 @@ BOOL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param,
}
return FALSE;
}
+
+
+const unixlib_entry_t __wine_unix_call_funcs[] =
+{
+ macdrv_init,
+};
+
+C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
+
+
+/* FIXME: Use __wine_unix_call instead */
+NTSTATUS unix_call(enum macdrv_funcs code, void *params)
+{
+ return __wine_unix_call_funcs[code]( params );
+}
diff --git a/dlls/winemac.drv/unixlib.h b/dlls/winemac.drv/unixlib.h
new file mode 100644
index 00000000000..9f8cd4e0acb
--- /dev/null
+++ b/dlls/winemac.drv/unixlib.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2022 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "ntuser.h"
+#include "wine/unixlib.h"
+
+enum macdrv_funcs
+{
+ unix_init,
+ unix_funcs_count
+};
+
+/* FIXME: Use __wine_unix_call when the rest of the stack is ready */
+extern NTSTATUS unix_call(enum macdrv_funcs code, void *params) DECLSPEC_HIDDEN;
+#define MACDRV_CALL(func, params) unix_call( unix_ ## func, params )
+
+/* macdrv_init params */
+struct localized_string
+{
+ UINT id;
+ UINT len;
+ const WCHAR *str;
+};
+
+struct init_params
+{
+ struct localized_string *strings;
+};
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/168
June 1, 2022
[PATCH 0/4] MR168: winemac: PE conversion preparation
by Jacek Caban (@jacek)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/168
June 1, 2022
[tools] testbot/build: Fix passing the BuildWine() target list in Reconfig.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Broken yesterday :-(
---
testbot/bin/build/Reconfig.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/build/Reconfig.pl b/testbot/bin/build/Reconfig.pl
index 9e1043aa1..4f07eeefc 100755
--- a/testbot/bin/build/Reconfig.pl
+++ b/testbot/bin/build/Reconfig.pl
@@ -57,9 +57,9 @@ sub UpdateWineBuilds($$)
my $Configure = "--without-x --without-freetype --disable-winetest";
return BuildWine($TaskMissions, $Flags, "exe32",
- $Configure, "buildtests") &&
+ $Configure, ["buildtests"]) &&
BuildWine($TaskMissions, $Flags, "exe64",
- "$Configure --enable-win64", "buildtests");
+ "$Configure --enable-win64", ["buildtests"]);
}
--
2.30.2
June 1, 2022