Wine-Devel
Threads by month
- ----- 2026 -----
- 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
- 1 participants
- 84549 discussions
The following series implements:
- fixes and dwarf4 evolutions for function range computation
- support for a few more dwarf types (restrict, rvalue ref, subrange)
A+
---
Eric Pouech (9):
dbghelp/dwarf: in DW_AT_ranges, the values are relative to the start of the CU
dbghelp/dwarf: properly detect base address selection in AT_ranges
dbghelp: removed unneeded #include <limits.h>
dbghelp/dwarf: dwarf4 integrates some tweaks in high / low pc attritbutes
dbghelp/dwarf: Added support for parsing dwarf's 3 restrict type TAG
dbghelp/dwarf: Support enumeration as index type for arrays
dbghelp/dwarf: Added support for DW_TAG_subrange_type in various places
dbghelp/dwarf: Support more dwarf's TAG related to types in udt parsing
dbghelp/dwarf: Handle C++ rvalue reference type as a reference
dlls/dbghelp/dwarf.c | 107 ++++++++++++++++++++++++++++++++++++++++--
dlls/dbghelp/stabs.c | 1 -
dlls/dbghelp/symbol.c | 1 -
3 files changed, 102 insertions(+), 7 deletions(-)
1
9
[PATCH 1/6] dinput: Fire the notification only after all events have been queued.
by Rémi Bernon Sept. 17, 2021
by Rémi Bernon Sept. 17, 2021
Sept. 17, 2021
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/device.c | 3 ---
dlls/dinput/joystick_hid.c | 2 ++
dlls/dinput/joystick_linux.c | 3 +++
dlls/dinput/joystick_linuxinput.c | 3 +++
dlls/dinput/joystick_osx.c | 6 ++++++
dlls/dinput/keyboard.c | 1 +
dlls/dinput/mouse.c | 16 ++++++++++++++++
7 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index e04d40e5a7c..17eaff69d50 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -986,9 +986,6 @@ void queue_event( IDirectInputDevice8W *iface, int inst_id, DWORD data, DWORD ti
int next_pos, ofs = id_to_offset(&This->data_format, inst_id);
ULONGLONG time_ms = GetTickCount64();
- /* Event is being set regardless of the queue state */
- if (This->hEvent) SetEvent(This->hEvent);
-
if (time_ms - notify_ms > 1000)
{
PostMessageW(GetDesktopWindow(), WM_WINE_NOTIFY_ACTIVITY, 0, 0);
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 3ef6f0db9cc..709953be8f0 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -908,6 +908,8 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
enum_value_objects( impl, &filter, DIDFT_ALL, read_device_state_value, ¶ms );
enum_button_objects( impl, &filter, DIDFT_ALL, check_device_state_button, ¶ms );
+ if (memcmp( ¶ms.old_state, &impl->state, sizeof(impl->state) ) && impl->base.hEvent)
+ SetEvent( impl->base.hEvent );
}
memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) );
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 3a8b0f07704..c439cca81c3 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -777,7 +777,10 @@ static void joy_polldev( IDirectInputDevice8W *iface )
}
}
if (inst_id >= 0)
+ {
queue_event(iface, inst_id, value, GetCurrentTime(), This->generic.base.dinput->evsequence++);
+ if (This->generic.base.hEvent) SetEvent( This->generic.base.hEvent );
+ }
}
}
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 27dd75a8b55..8279ffbf74a 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -806,8 +806,11 @@ static void joy_polldev( IDirectInputDevice8W *iface )
break;
}
if (inst_id >= 0)
+ {
queue_event(iface, inst_id,
value, GetCurrentTime(), This->generic.base.dinput->evsequence++);
+ if (This->generic.base.hEvent) SetEvent( This->generic.base.hEvent );
+ }
}
}
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 62a063b6da1..e8732bd696c 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -840,6 +840,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
inst_id = DIDFT_MAKEINSTANCE(button_idx) | DIDFT_PSHBUTTON;
queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++);
+ if (device->generic.base.hEvent)
+ SetEvent( device->generic.base.hEvent );
}
button_idx ++;
}
@@ -870,6 +872,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
inst_id = DIDFT_MAKEINSTANCE(pov_idx) | DIDFT_POV;
queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++);
+ if (device->generic.base.hEvent)
+ SetEvent( device->generic.base.hEvent );
}
pov_idx ++;
break;
@@ -947,6 +951,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
{
inst_id = DIDFT_MAKEINSTANCE(wine_obj) | DIDFT_ABSAXIS;
queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++);
+ if (device->generic.base.hEvent)
+ SetEvent( device->generic.base.hEvent );
}
break;
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 5d532ab8059..3e1cac1733f 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -127,6 +127,7 @@ int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lpa
EnterCriticalSection(&This->base.crit);
queue_event(iface, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON,
new_diks, GetCurrentTime(), This->base.dinput->evsequence++);
+ if (This->base.hEvent) SetEvent( This->base.hEvent );
LeaveCriticalSection(&This->base.crit);
return ret;
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 9f696cb414a..0ab791c69a5 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -234,6 +234,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
POINT rel, pt;
DWORD seq;
int i, wdata = 0;
+ BOOL notify = FALSE;
static const USHORT mouse_button_flags[] =
{
@@ -277,12 +278,18 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
}
if (rel.x)
+ {
queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS,
pt.x, GetCurrentTime(), seq );
+ notify = TRUE;
+ }
if (rel.y)
+ {
queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS,
pt.y, GetCurrentTime(), seq );
+ notify = TRUE;
+ }
if (rel.x || rel.y)
{
@@ -296,6 +303,7 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
This->m_state.lZ += (wdata = (SHORT)ri->data.mouse.usButtonData);
queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Z_AXIS_INSTANCE) | DIDFT_RELAXIS,
wdata, GetCurrentTime(), seq );
+ notify = TRUE;
}
for (i = 0; i < ARRAY_SIZE(mouse_button_flags); ++i)
@@ -305,9 +313,11 @@ void dinput_mouse_rawinput_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPA
This->m_state.rgbButtons[i / 2] = 0x80 - (i % 2) * 0x80;
queue_event( iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_BUTTONS_INSTANCE +(i / 2) ) | DIDFT_PSHBUTTON,
This->m_state.rgbButtons[i / 2], GetCurrentTime(), seq );
+ notify = TRUE;
}
}
+ if (notify && This->base.hEvent) SetEvent( This->base.hEvent );
LeaveCriticalSection( &This->base.crit );
}
@@ -317,6 +327,7 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
MSLLHOOKSTRUCT *hook = (MSLLHOOKSTRUCT *)lparam;
SysMouseImpl *This = impl_from_IDirectInputDevice8W( iface );
int wdata = 0, inst_id = -1, ret = 0;
+ BOOL notify = FALSE;
TRACE("msg %lx @ (%d %d)\n", wparam, hook->pt.x, hook->pt.y);
@@ -347,8 +358,11 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
{
/* Already have X, need to queue it */
if (inst_id != -1)
+ {
queue_event(iface, inst_id,
wdata, GetCurrentTime(), This->base.dinput->evsequence);
+ notify = TRUE;
+ }
inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS;
wdata = pt1.y;
}
@@ -408,8 +422,10 @@ int dinput_mouse_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam
_dump_mouse_state(&This->m_state);
queue_event(iface, inst_id,
wdata, GetCurrentTime(), This->base.dinput->evsequence++);
+ notify = TRUE;
}
+ if (notify && This->base.hEvent) SetEvent( This->base.hEvent );
LeaveCriticalSection(&This->base.crit);
return ret;
}
--
2.33.0
2
7
[PATCH 1/5] hidparse.sys: Split struct hid_value_caps start_bit into start_byte / start_bit.
by Rémi Bernon Sept. 17, 2021
by Rémi Bernon Sept. 17, 2021
Sept. 17, 2021
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
This is the first part of a series to make Wine internal HID structures
compatible (enough) with native.
dlls/hid/hidp.c | 63 +++++++++++++++++++++++++++++-----------
dlls/hidparse.sys/main.c | 16 +++++-----
include/wine/hid.h | 3 +-
3 files changed, 57 insertions(+), 25 deletions(-)
diff --git a/dlls/hid/hidp.c b/dlls/hid/hidp.c
index cd9de2148c2..a94e7b637ae 100644
--- a/dlls/hid/hidp.c
+++ b/dlls/hid/hidp.c
@@ -192,10 +192,13 @@ static NTSTATUS get_scaled_usage_value( const struct hid_value_caps *caps, void
struct usage_value_params *params = user;
ULONG unsigned_value = 0, bit_count = caps->bit_size * caps->report_count;
LONG signed_value, *value = params->value_buf;
+ unsigned char *report_buf;
if ((bit_count + 7) / 8 > sizeof(unsigned_value)) return HIDP_STATUS_BUFFER_TOO_SMALL;
if (sizeof(LONG) > params->value_len) return HIDP_STATUS_BUFFER_TOO_SMALL;
- copy_bits( (unsigned char *)&unsigned_value, params->report_buf, bit_count, -caps->start_bit );
+
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+ copy_bits( (unsigned char *)&unsigned_value, report_buf, bit_count, -caps->start_bit );
signed_value = sign_extend( unsigned_value, caps );
if (caps->logical_min > caps->logical_max || caps->physical_min > caps->physical_max)
@@ -232,9 +235,14 @@ static NTSTATUS get_usage_value( const struct hid_value_caps *caps, void *user )
{
struct usage_value_params *params = user;
ULONG bit_count = caps->bit_size * caps->report_count;
+ unsigned char *report_buf;
+
if ((bit_count + 7) / 8 > params->value_len) return HIDP_STATUS_BUFFER_TOO_SMALL;
memset( params->value_buf, 0, params->value_len );
- copy_bits( params->value_buf, params->report_buf, bit_count, -caps->start_bit );
+
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+ copy_bits( params->value_buf, report_buf, bit_count, -caps->start_bit );
+
return HIDP_STATUS_NULL;
}
@@ -285,14 +293,17 @@ struct get_usage_params
static NTSTATUS get_usage( const struct hid_value_caps *caps, void *user )
{
struct get_usage_params *params = user;
+ unsigned char *report_buf;
ULONG bit, last;
BYTE index;
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+
if (HID_VALUE_CAPS_IS_ARRAY( caps ))
{
for (bit = caps->start_bit, last = bit + caps->report_count * caps->bit_size - 1; bit <= last; bit += 8)
{
- if (!(index = params->report_buf[bit / 8])) continue;
+ if (!(index = report_buf[bit / 8])) continue;
if (params->usages < params->usages_end) *params->usages = caps->usage_min + index - caps->start_index;
params->usages++;
}
@@ -301,7 +312,7 @@ static NTSTATUS get_usage( const struct hid_value_caps *caps, void *user )
for (bit = caps->start_bit, last = bit + caps->usage_max - caps->usage_min; bit <= last; ++bit)
{
- if (!(params->report_buf[bit / 8] & (1 << (bit % 8)))) continue;
+ if (!(report_buf[bit / 8] & (1 << (bit % 8)))) continue;
if (params->usages < params->usages_end) *params->usages = caps->usage_min + bit - caps->start_bit;
params->usages++;
}
@@ -384,6 +395,7 @@ static NTSTATUS set_scaled_usage_value( const struct hid_value_caps *caps, void
{
ULONG bit_count = caps->bit_size * caps->report_count;
struct usage_value_params *params = user;
+ unsigned char *report_buf;
LONG value, log_range, phy_range;
if (caps->logical_min > caps->logical_max) return HIDP_STATUS_BAD_LOG_PHY_VALUES;
@@ -404,7 +416,8 @@ static NTSTATUS set_scaled_usage_value( const struct hid_value_caps *caps, void
value = caps->logical_min + value;
}
- copy_bits( params->report_buf, (unsigned char *)&value, bit_count, caps->start_bit );
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+ copy_bits( report_buf, (unsigned char *)&value, bit_count, caps->start_bit );
return HIDP_STATUS_NULL;
}
@@ -431,8 +444,13 @@ static NTSTATUS set_usage_value( const struct hid_value_caps *caps, void *user )
{
struct usage_value_params *params = user;
ULONG bit_count = caps->bit_size * caps->report_count;
+ unsigned char *report_buf;
+
if ((bit_count + 7) / 8 > params->value_len) return HIDP_STATUS_BUFFER_TOO_SMALL;
- copy_bits( params->report_buf, params->value_buf, bit_count, caps->start_bit );
+
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+ copy_bits( report_buf, params->value_buf, bit_count, caps->start_bit );
+
return HIDP_STATUS_NULL;
}
@@ -481,14 +499,17 @@ struct set_usage_params
static NTSTATUS set_usage( const struct hid_value_caps *caps, void *user )
{
struct set_usage_params *params = user;
+ unsigned char *report_buf;
ULONG bit, last;
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+
if (HID_VALUE_CAPS_IS_ARRAY( caps ))
{
for (bit = caps->start_bit, last = bit + caps->report_count * caps->bit_size - 1; bit <= last; bit += 8)
{
- if (params->report_buf[bit / 8]) continue;
- params->report_buf[bit / 8] = caps->start_index + params->usage - caps->usage_min;
+ if (report_buf[bit / 8]) continue;
+ report_buf[bit / 8] = caps->start_index + params->usage - caps->usage_min;
break;
}
@@ -497,7 +518,7 @@ static NTSTATUS set_usage( const struct hid_value_caps *caps, void *user )
}
bit = caps->start_bit + params->usage - caps->usage_min;
- params->report_buf[bit / 8] |= (1 << (bit % 8));
+ report_buf[bit / 8] |= (1 << (bit % 8));
return HIDP_STATUS_NULL;
}
@@ -538,15 +559,18 @@ struct unset_usage_params
static NTSTATUS unset_usage( const struct hid_value_caps *caps, void *user )
{
struct unset_usage_params *params = user;
+ unsigned char *report_buf;
ULONG bit, index, last;
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+
if (HID_VALUE_CAPS_IS_ARRAY( caps ))
{
for (bit = caps->start_bit, last = bit + caps->report_count * caps->bit_size - 1; bit <= last; bit += 8)
{
index = caps->start_index + params->usage - caps->usage_min;
- if (params->report_buf[bit / 8] != index) continue;
- params->report_buf[bit / 8] = 0;
+ if (report_buf[bit / 8] != index) continue;
+ report_buf[bit / 8] = 0;
params->found = TRUE;
break;
}
@@ -555,8 +579,8 @@ static NTSTATUS unset_usage( const struct hid_value_caps *caps, void *user )
}
bit = caps->start_bit + params->usage - caps->usage_min;
- if (params->report_buf[bit / 8] & (1 << (bit % 8))) params->found = TRUE;
- params->report_buf[bit / 8] &= ~(1 << (bit % 8));
+ if (report_buf[bit / 8] & (1 << (bit % 8))) params->found = TRUE;
+ report_buf[bit / 8] &= ~(1 << (bit % 8));
return HIDP_STATUS_NULL;
}
@@ -726,14 +750,17 @@ struct get_usage_and_page_params
static NTSTATUS get_usage_and_page( const struct hid_value_caps *caps, void *user )
{
struct get_usage_and_page_params *params = user;
+ unsigned char *report_buf;
ULONG bit, last;
BYTE index;
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+
if (HID_VALUE_CAPS_IS_ARRAY( caps ))
{
for (bit = caps->start_bit, last = bit + caps->report_count * caps->bit_size - 1; bit <= last; bit += 8)
{
- if (!(index = params->report_buf[bit / 8])) continue;
+ if (!(index = report_buf[bit / 8])) continue;
if (params->usages < params->usages_end)
{
params->usages->UsagePage = caps->usage_page;
@@ -746,7 +773,7 @@ static NTSTATUS get_usage_and_page( const struct hid_value_caps *caps, void *use
for (bit = caps->start_bit, last = bit + caps->usage_max - caps->usage_min; bit <= last; bit++)
{
- if (!(params->report_buf[bit / 8] & (1 << (bit % 8)))) continue;
+ if (!(report_buf[bit / 8] & (1 << (bit % 8)))) continue;
if (params->usages < params->usages_end)
{
params->usages->UsagePage = caps->usage_page;
@@ -813,11 +840,13 @@ static NTSTATUS find_all_data( const struct hid_value_caps *caps, void *user )
struct find_all_data_params *params = user;
HIDP_DATA *data = params->data, *data_end = params->data_end;
ULONG bit, last, bit_count = caps->bit_size * caps->report_count;
- char *report_buf = params->report_buf;
+ unsigned char *report_buf;
BYTE index;
if (!caps->bit_size) return HIDP_STATUS_SUCCESS;
+ report_buf = (unsigned char *)params->report_buf + caps->start_byte;
+
if (HID_VALUE_CAPS_IS_ARRAY( caps ))
{
for (bit = caps->start_bit, last = bit + caps->report_count * caps->bit_size - 1; bit <= last; bit += 8)
@@ -851,7 +880,7 @@ static NTSTATUS find_all_data( const struct hid_value_caps *caps, void *user )
data->DataIndex = caps->data_index_min;
data->RawValue = 0;
if ((bit_count + 7) / 8 > sizeof(data->RawValue)) return HIDP_STATUS_BUFFER_TOO_SMALL;
- copy_bits( (void *)&data->RawValue, (void *)report_buf, bit_count, -caps->start_bit );
+ copy_bits( (void *)&data->RawValue, report_buf, bit_count, -caps->start_bit );
}
data++;
}
diff --git a/dlls/hidparse.sys/main.c b/dlls/hidparse.sys/main.c
index 3a57c338165..b7326f9fe4a 100644
--- a/dlls/hidparse.sys/main.c
+++ b/dlls/hidparse.sys/main.c
@@ -333,13 +333,13 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
USHORT *byte_size = state->byte_size[type];
USHORT *value_idx = state->value_idx[type];
USHORT *data_idx = state->data_idx[type];
- ULONG *bit_size = &state->bit_size[type][state->items.report_id];
+ ULONG start_bit, *bit_size = &state->bit_size[type][state->items.report_id];
BOOL is_array;
if (!*bit_size) *bit_size = 8;
*bit_size += state->items.bit_size * state->items.report_count;
*byte_size = max( *byte_size, (*bit_size + 7) / 8 );
- state->items.start_bit = *bit_size;
+ start_bit = *bit_size;
if (!state->items.report_count)
{
@@ -356,11 +356,13 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
state->items.start_index = usages_size;
if (!(is_array = HID_VALUE_CAPS_IS_ARRAY( &state->items ))) state->items.report_count -= usages_size - 1;
- else state->items.start_bit -= state->items.report_count * state->items.bit_size;
+ else start_bit -= state->items.report_count * state->items.bit_size;
while (usages_size--)
{
- if (!is_array) state->items.start_bit -= state->items.report_count * state->items.bit_size;
+ if (!is_array) start_bit -= state->items.report_count * state->items.bit_size;
+ state->items.start_byte = start_bit / 8;
+ state->items.start_bit = start_bit % 8;
state->items.usage_page = state->usages_page[usages_size];
state->items.usage_min = state->usages_min[usages_size];
state->items.usage_max = state->usages_max[usages_size];
@@ -652,7 +654,7 @@ NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_de
caps_end = caps + preparsed->value_caps_count[HidP_Input];
for (; caps != caps_end; ++caps)
{
- len = caps->start_bit + caps->bit_size * caps->report_count;
+ len = caps->start_byte * 8 + caps->start_bit + caps->bit_size * caps->report_count;
if (!input_len[caps->report_id]) report_count++;
input_len[caps->report_id] = max(input_len[caps->report_id], len);
}
@@ -661,7 +663,7 @@ NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_de
caps_end = caps + preparsed->value_caps_count[HidP_Output];
for (; caps != caps_end; ++caps)
{
- len = caps->start_bit + caps->bit_size * caps->report_count;
+ len = caps->start_byte * 8 + caps->start_bit + caps->bit_size * caps->report_count;
if (!input_len[caps->report_id] && !output_len[caps->report_id]) report_count++;
output_len[caps->report_id] = max(output_len[caps->report_id], len);
}
@@ -670,7 +672,7 @@ NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_de
caps_end = caps + preparsed->value_caps_count[HidP_Feature];
for (; caps != caps_end; ++caps)
{
- len = caps->start_bit + caps->bit_size * caps->report_count;
+ len = caps->start_byte * 8 + caps->start_bit + caps->bit_size * caps->report_count;
if (!input_len[caps->report_id] && !output_len[caps->report_id] && !feature_len[caps->report_id]) report_count++;
feature_len[caps->report_id] = max(feature_len[caps->report_id], len);
}
diff --git a/include/wine/hid.h b/include/wine/hid.h
index e76676ac8c2..8e33745ddc4 100644
--- a/include/wine/hid.h
+++ b/include/wine/hid.h
@@ -52,7 +52,8 @@ struct hid_value_caps
USHORT bit_field;
USHORT bit_size;
USHORT report_count;
- ULONG start_bit;
+ UCHAR start_bit;
+ USHORT start_byte;
ULONG start_index;
LONG logical_min;
LONG logical_max;
--
2.33.0
1
4
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/winebus.sys/Makefile.in | 2 +-
dlls/winebus.sys/bus_iohid.c | 16 +++++++-----
dlls/winebus.sys/bus_sdl.c | 16 +++++++-----
dlls/winebus.sys/bus_udev.c | 16 +++++++-----
dlls/winebus.sys/hid.c | 4 +++
dlls/winebus.sys/main.c | 43 ++++++++++++++++++++-------------
dlls/winebus.sys/unix_private.h | 18 +++++++-------
dlls/winebus.sys/unixlib.c | 29 +++++++++++++++-------
dlls/winebus.sys/unixlib.h | 3 +--
9 files changed, 91 insertions(+), 56 deletions(-)
diff --git a/dlls/winebus.sys/Makefile.in b/dlls/winebus.sys/Makefile.in
index 658d27b70fd..1675bf1951c 100644
--- a/dlls/winebus.sys/Makefile.in
+++ b/dlls/winebus.sys/Makefile.in
@@ -2,7 +2,7 @@ MODULE = winebus.sys
IMPORTS = ntoskrnl advapi32
EXTRALIBS = $(IOKIT_LIBS) $(UDEV_LIBS)
EXTRAINCL = $(UDEV_CFLAGS) $(SDL2_CFLAGS)
-EXTRADLLFLAGS = -Wl,--subsystem,native
+EXTRADLLFLAGS = -mno-cygwin -Wl,--subsystem,native
C_SRCS = \
bus_iohid.c \
diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index 8e6cb0a5ee9..0e36eac880c 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include "wine/port.h"
@@ -371,7 +375,7 @@ static void handle_RemovalCallback(void *context, IOReturn result, void *sender,
else WARN("failed to find device for iohid device %p\n", IOHIDDevice);
}
-NTSTATUS iohid_bus_init(void *args)
+NTSTATUS WINAPI iohid_bus_init(void *args)
{
TRACE("args %p\n", args);
@@ -392,7 +396,7 @@ NTSTATUS iohid_bus_init(void *args)
return STATUS_SUCCESS;
}
-NTSTATUS iohid_bus_wait(void *args)
+NTSTATUS WINAPI iohid_bus_wait(void *args)
{
struct bus_event *result = args;
CFRunLoopRunResult ret;
@@ -416,7 +420,7 @@ NTSTATUS iohid_bus_wait(void *args)
return STATUS_SUCCESS;
}
-NTSTATUS iohid_bus_stop(void *args)
+NTSTATUS WINAPI iohid_bus_stop(void *args)
{
if (!run_loop) return STATUS_SUCCESS;
@@ -427,19 +431,19 @@ NTSTATUS iohid_bus_stop(void *args)
#else
-NTSTATUS iohid_bus_init(void *args)
+NTSTATUS WINAPI iohid_bus_init(void *args)
{
WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS iohid_bus_wait(void *args)
+NTSTATUS WINAPI iohid_bus_wait(void *args)
{
WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS iohid_bus_stop(void *args)
+NTSTATUS WINAPI iohid_bus_stop(void *args)
{
WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 785d1045622..79dff5007c0 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include "wine/port.h"
#include <errno.h>
@@ -814,7 +818,7 @@ static void process_device_event(SDL_Event *event)
RtlLeaveCriticalSection(&sdl_cs);
}
-NTSTATUS sdl_bus_init(void *args)
+NTSTATUS WINAPI sdl_bus_init(void *args)
{
const char *mapping;
int i;
@@ -917,7 +921,7 @@ failed:
return STATUS_UNSUCCESSFUL;
}
-NTSTATUS sdl_bus_wait(void *args)
+NTSTATUS WINAPI sdl_bus_wait(void *args)
{
struct bus_event *result = args;
SDL_Event event;
@@ -939,7 +943,7 @@ NTSTATUS sdl_bus_wait(void *args)
return STATUS_SUCCESS;
}
-NTSTATUS sdl_bus_stop(void *args)
+NTSTATUS WINAPI sdl_bus_stop(void *args)
{
SDL_Event event;
@@ -957,19 +961,19 @@ NTSTATUS sdl_bus_stop(void *args)
#else
-NTSTATUS sdl_bus_init(void *args)
+NTSTATUS WINAPI sdl_bus_init(void *args)
{
WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS sdl_bus_wait(void *args)
+NTSTATUS WINAPI sdl_bus_wait(void *args)
{
WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS sdl_bus_stop(void *args)
+NTSTATUS WINAPI sdl_bus_stop(void *args)
{
WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 2cb727d8216..c859d5df546 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include <errno.h>
#include <fcntl.h>
@@ -1184,7 +1188,7 @@ static void process_monitor_event(struct udev_monitor *monitor)
udev_device_unref(dev);
}
-NTSTATUS udev_bus_init(void *args)
+NTSTATUS WINAPI udev_bus_init(void *args)
{
int monitor_fd;
@@ -1229,7 +1233,7 @@ error:
return STATUS_UNSUCCESSFUL;
}
-NTSTATUS udev_bus_wait(void *args)
+NTSTATUS WINAPI udev_bus_wait(void *args)
{
struct platform_private *device;
struct bus_event *result = args;
@@ -1275,7 +1279,7 @@ NTSTATUS udev_bus_wait(void *args)
return STATUS_SUCCESS;
}
-NTSTATUS udev_bus_stop(void *args)
+NTSTATUS WINAPI udev_bus_stop(void *args)
{
if (!udev_context) return STATUS_SUCCESS;
write(deviceloop_control[1], "q", 1);
@@ -1284,19 +1288,19 @@ NTSTATUS udev_bus_stop(void *args)
#else
-NTSTATUS udev_bus_init(void *args)
+NTSTATUS WINAPI udev_bus_init(void *args)
{
WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS udev_bus_wait(void *args)
+NTSTATUS WINAPI udev_bus_wait(void *args)
{
WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS udev_bus_stop(void *args)
+NTSTATUS WINAPI udev_bus_stop(void *args)
{
WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED;
diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c
index 27c85d4f5a6..959cbf7c428 100644
--- a/dlls/winebus.sys/hid.c
+++ b/dlls/winebus.sys/hid.c
@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include <stdarg.h>
#include "ntstatus.h"
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index d19a2b7cb6c..5fd7744c259 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -17,11 +17,14 @@
* 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 "ntstatus.h"
#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
#include "winternl.h"
#include "winioctl.h"
#include "hidusage.h"
@@ -30,7 +33,6 @@
#include "ddk/hidtypes.h"
#include "wine/asm.h"
#include "wine/debug.h"
-#include "wine/unicode.h"
#include "wine/list.h"
#include "wine/unixlib.h"
@@ -109,9 +111,12 @@ static CRITICAL_SECTION device_list_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
static struct list device_list = LIST_INIT(device_list);
+static HMODULE instance;
+static const unix_entry_point *unix_funcs;
+
static NTSTATUS winebus_call(unsigned int code, void *args)
{
- return __wine_unix_call_funcs[code]( args );
+ return unix_funcs[code]( args );
}
static void unix_device_remove(DEVICE_OBJECT *device)
@@ -193,11 +198,11 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device)
{
static const WCHAR formatW[] = {'%','i','&','%','s','&','%','x','&','%','i',0};
struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
- DWORD len = strlenW(ext->serialnumber) + 33;
+ DWORD len = wcslen(ext->serialnumber) + 33;
WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR))))
- sprintfW(dst, formatW, ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index);
+ swprintf(dst, len, formatW, ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index);
return dst;
}
@@ -208,13 +213,13 @@ static WCHAR *get_device_id(DEVICE_OBJECT *device)
static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
'&','p','i','d','_','%','0','4','x',0};
struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
- DWORD len = strlenW(ext->desc.busid) + 34;
- WCHAR *dst, *tmp;
+ DWORD pos = 0, len = wcslen(ext->desc.busid) + 34;
+ WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR))))
{
- tmp = dst + sprintfW(dst, formatW, ext->desc.busid, ext->desc.vid, ext->desc.pid);
- if (ext->desc.input != -1) sprintfW(tmp, input_formatW, ext->desc.input);
+ pos += swprintf(dst + pos, len - pos, formatW, ext->desc.busid, ext->desc.vid, ext->desc.pid);
+ if (ext->desc.input != -1) pos += swprintf(dst + pos, len - pos, input_formatW, ext->desc.input);
}
return dst;
@@ -225,10 +230,10 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device)
struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
WCHAR *dst;
- if ((dst = ExAllocatePool(PagedPool, (strlenW(ext->desc.busid) + 2) * sizeof(WCHAR))))
+ if ((dst = ExAllocatePool(PagedPool, (wcslen(ext->desc.busid) + 2) * sizeof(WCHAR))))
{
- strcpyW(dst, ext->desc.busid);
- dst[strlenW(dst) + 1] = 0;
+ wcscpy(dst, ext->desc.busid);
+ dst[wcslen(dst) + 1] = 0;
}
return dst;
@@ -285,7 +290,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni
TRACE("desc %s, unix_device %p\n", debugstr_device_desc(desc), unix_device);
- sprintfW(dev_name, device_name_fmtW, desc->busid, unix_device);
+ swprintf(dev_name, ARRAY_SIZE(dev_name), device_name_fmtW, desc->busid, unix_device);
RtlInitUnicodeString(&nameW, dev_name);
status = IoCreateDevice(driver_obj, sizeof(struct device_extension), &nameW, 0, 0, FALSE, &device);
if (status)
@@ -900,17 +905,17 @@ static NTSTATUS hid_get_device_string(DEVICE_OBJECT *device, DWORD index, WCHAR
switch (index)
{
case HID_STRING_ID_IMANUFACTURER:
- len = (strlenW(ext->manufacturer) + 1) * sizeof(WCHAR);
+ len = (wcslen(ext->manufacturer) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->manufacturer, len);
return STATUS_SUCCESS;
case HID_STRING_ID_IPRODUCT:
- len = (strlenW(ext->product) + 1) * sizeof(WCHAR);
+ len = (wcslen(ext->product) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->product, len);
return STATUS_SUCCESS;
case HID_STRING_ID_ISERIALNUMBER:
- len = (strlenW(ext->serialnumber) + 1) * sizeof(WCHAR);
+ len = (wcslen(ext->serialnumber) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->serialnumber, len);
return STATUS_SUCCESS;
@@ -1012,7 +1017,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Status = hid_get_device_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len);
if (irp->IoStatus.Status == STATUS_SUCCESS)
- irp->IoStatus.Information = (strlenW((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR);
+ irp->IoStatus.Information = (wcslen((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR);
break;
}
case IOCTL_HID_GET_INPUT_REPORT:
@@ -1110,6 +1115,10 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
TRACE( "(%p, %s)\n", driver, debugstr_w(path->Buffer) );
+ RtlPcToFileHeader(&DriverEntry, (void *)&instance);
+ if ((ret = __wine_init_unix_lib(instance, DLL_PROCESS_ATTACH, NULL, &unix_funcs)))
+ return ret;
+
attr.Length = sizeof(attr);
attr.ObjectName = path;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE;
diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h
index cdc2be9b318..5e30b21955a 100644
--- a/dlls/winebus.sys/unix_private.h
+++ b/dlls/winebus.sys/unix_private.h
@@ -49,17 +49,17 @@ struct unix_device
extern void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size) DECLSPEC_HIDDEN;
-extern NTSTATUS sdl_bus_init(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS sdl_bus_wait(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS sdl_bus_stop(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI sdl_bus_init(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI sdl_bus_wait(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI sdl_bus_stop(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS udev_bus_init(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS udev_bus_wait(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS udev_bus_stop(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI udev_bus_init(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI udev_bus_wait(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI udev_bus_stop(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS iohid_bus_init(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS iohid_bus_wait(void *) DECLSPEC_HIDDEN;
-extern NTSTATUS iohid_bus_stop(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI iohid_bus_init(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI iohid_bus_wait(void *) DECLSPEC_HIDDEN;
+extern NTSTATUS WINAPI iohid_bus_stop(void *) DECLSPEC_HIDDEN;
extern void bus_event_cleanup(struct bus_event *event) DECLSPEC_HIDDEN;
extern void bus_event_queue_destroy(struct list *queue) DECLSPEC_HIDDEN;
diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c
index 651b23aa8f4..f21b5a25b04 100644
--- a/dlls/winebus.sys/unixlib.c
+++ b/dlls/winebus.sys/unixlib.c
@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#if 0
+#pragma makedep unix
+#endif
+
#include "config.h"
#include <stdarg.h>
@@ -143,7 +147,7 @@ static const struct device_desc mouse_device_desc =
.serialnumber = {"0000"},
};
-static NTSTATUS mouse_device_create(void *args)
+static NTSTATUS WINAPI mouse_device_create(void *args)
{
struct device_create_params *params = args;
params->desc = mouse_device_desc;
@@ -241,7 +245,7 @@ static const struct device_desc keyboard_device_desc =
.serialnumber = {"0000"},
};
-static NTSTATUS keyboard_device_create(void *args)
+static NTSTATUS WINAPI keyboard_device_create(void *args)
{
struct device_create_params *params = args;
params->desc = keyboard_device_desc;
@@ -274,7 +278,7 @@ static ULONG unix_device_incref(struct unix_device *iface)
return InterlockedIncrement(&iface->ref);
}
-static NTSTATUS unix_device_remove(void *args)
+static NTSTATUS WINAPI unix_device_remove(void *args)
{
struct unix_device *iface = args;
iface->vtbl->stop(iface);
@@ -282,20 +286,20 @@ static NTSTATUS unix_device_remove(void *args)
return STATUS_SUCCESS;
}
-static NTSTATUS unix_device_start(void *args)
+static NTSTATUS WINAPI unix_device_start(void *args)
{
struct unix_device *iface = args;
return iface->vtbl->start(iface);
}
-static NTSTATUS unix_device_get_report_descriptor(void *args)
+static NTSTATUS WINAPI unix_device_get_report_descriptor(void *args)
{
struct device_descriptor_params *params = args;
struct unix_device *iface = params->iface;
return iface->vtbl->get_report_descriptor(iface, params->buffer, params->length, params->out_length);
}
-static NTSTATUS unix_device_set_output_report(void *args)
+static NTSTATUS WINAPI unix_device_set_output_report(void *args)
{
struct device_report_params *params = args;
struct unix_device *iface = params->iface;
@@ -303,7 +307,7 @@ static NTSTATUS unix_device_set_output_report(void *args)
return STATUS_SUCCESS;
}
-static NTSTATUS unix_device_get_feature_report(void *args)
+static NTSTATUS WINAPI unix_device_get_feature_report(void *args)
{
struct device_report_params *params = args;
struct unix_device *iface = params->iface;
@@ -311,7 +315,7 @@ static NTSTATUS unix_device_get_feature_report(void *args)
return STATUS_SUCCESS;
}
-static NTSTATUS unix_device_set_feature_report(void *args)
+static NTSTATUS WINAPI unix_device_set_feature_report(void *args)
{
struct device_report_params *params = args;
struct unix_device *iface = params->iface;
@@ -319,7 +323,7 @@ static NTSTATUS unix_device_set_feature_report(void *args)
return STATUS_SUCCESS;
}
-const unixlib_entry_t __wine_unix_call_funcs[] =
+static const unix_entry_point unix_funcs[] =
{
sdl_bus_init,
sdl_bus_wait,
@@ -424,3 +428,10 @@ BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event)
return TRUE;
}
+
+NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+{
+ if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
+ *(const unix_entry_point **)ptr_out = unix_funcs;
+ return STATUS_SUCCESS;
+}
diff --git a/dlls/winebus.sys/unixlib.h b/dlls/winebus.sys/unixlib.h
index 55ba42500cf..e5156176c46 100644
--- a/dlls/winebus.sys/unixlib.h
+++ b/dlls/winebus.sys/unixlib.h
@@ -29,7 +29,6 @@
#include "wine/debug.h"
#include "wine/list.h"
-#include "wine/unixlib.h"
struct device_desc
{
@@ -137,7 +136,7 @@ enum unix_funcs
device_set_feature_report,
};
-extern const unixlib_entry_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN;
+typedef NTSTATUS (WINAPI *unix_entry_point)(void *);
static inline const char *debugstr_device_desc(struct device_desc *desc)
{
--
2.33.0
1
4
Basic files and required changes to configure(.ac) to create a stub version
of the robocopy utility
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43653
Signed-off-by: Florian Eder <others.meder(a)gmail.com>
---
v2: Modified according to code review, again, please feel free to give any kind
of feedback regarding the code :-)
---
configure | 2 +-
configure.ac | 1 +
programs/robocopy/Makefile.in | 8 ++++++++
programs/robocopy/main.c | 29 +++++++++++++++++++++++++++++
programs/robocopy/robocopy.rc | 34 ++++++++++++++++++++++++++++++++++
5 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 programs/robocopy/Makefile.in
create mode 100644 programs/robocopy/main.c
create mode 100644 programs/robocopy/robocopy.rc
diff --git a/configure b/configure
index 1adbf1789f3..b27b1b14e7d 100755
--- a/configure
+++ b/configure
@@ -21266,6 +21266,7 @@ wine_fn_config_makefile programs/regedit/tests enable_tests
wine_fn_config_makefile programs/regini enable_regini
wine_fn_config_makefile programs/regsvcs enable_regsvcs
wine_fn_config_makefile programs/regsvr32 enable_regsvr32
+wine_fn_config_makefile programs/robocopy enable_robocopy
wine_fn_config_makefile programs/rpcss enable_rpcss
wine_fn_config_makefile programs/rundll.exe16 enable_win16
wine_fn_config_makefile programs/rundll32 enable_rundll32
@@ -22799,4 +22800,3 @@ IFS="$ac_save_IFS"
$as_echo "
$as_me: Finished. Do '${ac_make}' to compile Wine.
" >&6
-
diff --git a/configure.ac b/configure.ac
index eb970972936..b7faae4e4c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3965,6 +3965,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
WINE_CONFIG_MAKEFILE(programs/regini)
WINE_CONFIG_MAKEFILE(programs/regsvcs)
WINE_CONFIG_MAKEFILE(programs/regsvr32)
+WINE_CONFIG_MAKEFILE(programs/robocopy)
WINE_CONFIG_MAKEFILE(programs/rpcss)
WINE_CONFIG_MAKEFILE(programs/rundll.exe16,enable_win16)
WINE_CONFIG_MAKEFILE(programs/rundll32)
diff --git a/programs/robocopy/Makefile.in b/programs/robocopy/Makefile.in
new file mode 100644
index 00000000000..5a48be3725b
--- /dev/null
+++ b/programs/robocopy/Makefile.in
@@ -0,0 +1,8 @@
+MODULE = robocopy.exe
+
+EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
+
+C_SRCS = \
+ main.c
+
+RC_SRCS = robocopy.rc
diff --git a/programs/robocopy/main.c b/programs/robocopy/main.c
new file mode 100644
index 00000000000..00dacc8ab6c
--- /dev/null
+++ b/programs/robocopy/main.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2021 Florian Eder
+ *
+ * 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 "wine/debug.h"
+WINE_DEFAULT_DEBUG_CHANNEL(robocopy);
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+int __cdecl wmain(int argc, WCHAR *argv[])
+{
+ WINE_FIXME("robocopy stub");
+ return 0;
+}
diff --git a/programs/robocopy/robocopy.rc b/programs/robocopy/robocopy.rc
new file mode 100644
index 00000000000..edae5b71d86
--- /dev/null
+++ b/programs/robocopy/robocopy.rc
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2021 Florian Eder
+ *
+ * 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 <windef.h>
+
+#pragma makedep po
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#define WINE_FILEDESCRIPTION_STR "Wine Robocopy"
+#define WINE_FILENAME_STR "robocopy.exe"
+#define WINE_FILETYPE VFT_APP
+#define WINE_FILEVERSION 5,1,10,1027
+#define WINE_FILEVERSION_STR "5.1.10.1027"
+
+#define WINE_PRODUCTVERSION 5,1,10,1027
+#define WINE_PRODUCTVERSION_STR "XP027"
+
+#include "wine/wine_common_ver.rc"
--
2.32.0
2
10
Sept. 17, 2021
2
1
Sept. 16, 2021
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
dlls/winegstreamer/quartz_parser.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index 5299f4dc2ed..a8e7e3d979f 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -982,7 +982,10 @@ static HRESULT parser_sink_connect(struct strmbase_sink *iface, IPin *peer, cons
goto err;
if (!filter->init_gst(filter))
+ {
+ hr = E_FAIL;
goto err;
+ }
for (i = 0; i < filter->source_count; ++i)
{
--
2.33.0
3
6
[PATCH v12 1/2] ntdll/socket: Implement exclusive flag for IOCTL_AFD_POLL.
by Guillaume Charifi Sept. 16, 2021
by Guillaume Charifi Sept. 16, 2021
Sept. 16, 2021
Signed-off-by: Guillaume Charifi <guillaume.charifi(a)sfr.fr>
---
dlls/ntdll/unix/socket.c | 6 ++--
include/wine/afd.h | 2 +-
server/protocol.def | 1 +
server/sock.c | 73 ++++++++++++++++++++++++++++++++++++++--
4 files changed, 75 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c
index 73d61c0d4e6..c40d0b526d7 100644
--- a/dlls/ntdll/unix/socket.c
+++ b/dlls/ntdll/unix/socket.c
@@ -736,12 +736,11 @@ static NTSTATUS sock_poll( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
|| in_size < offsetof( struct afd_poll_params, sockets[params->count] ))
return STATUS_INVALID_PARAMETER;
- TRACE( "timeout %s, count %u, unknown %#x, padding (%#x, %#x, %#x), sockets[0] {%04lx, %#x}\n",
- wine_dbgstr_longlong(params->timeout), params->count, params->unknown,
+ TRACE( "timeout %s, count %u, exclusive %u, padding (%#x, %#x, %#x), sockets[0] {%04lx, %#x}\n",
+ wine_dbgstr_longlong(params->timeout), params->count, params->exclusive,
params->padding[0], params->padding[1], params->padding[2],
params->sockets[0].socket, params->sockets[0].flags );
- if (params->unknown) FIXME( "unknown boolean is %#x\n", params->unknown );
if (params->padding[0]) FIXME( "padding[0] is %#x\n", params->padding[0] );
if (params->padding[1]) FIXME( "padding[1] is %#x\n", params->padding[1] );
if (params->padding[2]) FIXME( "padding[2] is %#x\n", params->padding[2] );
@@ -782,6 +781,7 @@ static NTSTATUS sock_poll( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
SERVER_START_REQ( poll_socket )
{
req->async = server_async( handle, &async->io, event, apc, apc_user, iosb_client_ptr(io) );
+ req->exclusive = !!params->exclusive;
req->timeout = params->timeout;
wine_server_add_data( req, input, params->count * sizeof(*input) );
wine_server_set_reply( req, async->sockets, params->count * sizeof(async->sockets[0]) );
diff --git a/include/wine/afd.h b/include/wine/afd.h
index e67ecae25a9..f4682f464e8 100644
--- a/include/wine/afd.h
+++ b/include/wine/afd.h
@@ -104,7 +104,7 @@ struct afd_poll_params
{
LONGLONG timeout;
unsigned int count;
- BOOLEAN unknown;
+ BOOLEAN exclusive;
BOOLEAN padding[3];
struct
{
diff --git a/server/protocol.def b/server/protocol.def
index a5030fcf813..6a3faf3e625 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1451,6 +1451,7 @@ struct poll_socket_output
/* Perform an async poll on a socket */
@REQ(poll_socket)
+ int exclusive;
async_data_t async; /* async I/O parameters */
timeout_t timeout; /* timeout */
VARARG(sockets,poll_socket_input); /* list of sockets to poll */
diff --git a/server/sock.c b/server/sock.c
index fc234e89865..4ceff1b943e 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -128,6 +128,7 @@ struct poll_req
struct async *async;
struct iosb *iosb;
struct timeout_user *timeout;
+ int exclusive;
unsigned int count;
struct poll_socket_output *output;
struct
@@ -205,6 +206,7 @@ struct sock
struct list accept_list; /* list of pending accept requests */
struct accept_req *accept_recv_req; /* pending accept-into request which will recv on this socket */
struct connect_req *connect_req; /* pending connection request */
+ struct poll_req *main_poll; /* main poll */
union win_sockaddr addr; /* socket name */
int addr_len; /* socket name length */
unsigned int rcvbuf; /* advisory recv buffer size */
@@ -231,6 +233,7 @@ static int sock_get_poll_events( struct fd *fd );
static void sock_poll_event( struct fd *fd, int event );
static enum server_fd_type sock_get_fd_type( struct fd *fd );
static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
+static void sock_cancel_async( struct fd *fd, struct async *async );
static void sock_queue_async( struct fd *fd, struct async *async, int type, int count );
static void sock_reselect_async( struct fd *fd, struct async_queue *queue );
@@ -274,7 +277,7 @@ static const struct fd_ops sock_fd_ops =
default_fd_get_file_info, /* get_file_info */
no_fd_get_volume_info, /* get_volume_info */
sock_ioctl, /* ioctl */
- default_fd_cancel_async, /* cancel_async */
+ sock_cancel_async, /* cancel_async */
sock_queue_async, /* queue_async */
sock_reselect_async /* reselect_async */
};
@@ -789,6 +792,7 @@ static void free_poll_req( void *private )
for (i = 0; i < req->count; ++i)
release_object( req->sockets[i].sock );
+
release_object( req->async );
release_object( req->iosb );
list_remove( &req->entry );
@@ -837,6 +841,8 @@ static void complete_async_polls( struct sock *sock, int event, int error )
int flags = get_poll_flags( sock, event );
struct poll_req *req, *next;
+ sock->main_poll = NULL;
+
LIST_FOR_EACH_ENTRY_SAFE( req, next, &poll_list, struct poll_req, entry )
{
unsigned int i;
@@ -865,11 +871,20 @@ static void complete_async_polls( struct sock *sock, int event, int error )
static void async_poll_timeout( void *private )
{
struct poll_req *req = private;
+ unsigned int i;
req->timeout = NULL;
if (req->iosb->status != STATUS_PENDING) return;
+ for (i = 0; i < req->count; ++i)
+ {
+ struct sock *sock = req->sockets[i].sock;
+
+ if (sock->main_poll == req)
+ sock->main_poll = NULL;
+ }
+
async_request_complete( req->async, STATUS_TIMEOUT, 0, req->count * sizeof(*req->output), req->output );
}
@@ -1217,6 +1232,29 @@ static enum server_fd_type sock_get_fd_type( struct fd *fd )
return FD_TYPE_SOCKET;
}
+static void sock_cancel_async( struct fd *fd, struct async *async )
+{
+ struct sock *sock = get_fd_user( fd );
+ struct poll_req *req;
+
+ if (sock->main_poll)
+ {
+ LIST_FOR_EACH_ENTRY( req, &poll_list, struct poll_req, entry )
+ {
+ if (req->async != async)
+ continue;
+
+ if (req == sock->main_poll)
+ {
+ sock->main_poll = NULL;
+ break;
+ }
+ }
+ }
+
+ async_terminate( async, STATUS_CANCELLED );
+}
+
static void sock_queue_async( struct fd *fd, struct async *async, int type, int count )
{
struct sock *sock = get_fd_user( fd );
@@ -1383,6 +1421,7 @@ static struct sock *create_socket(void)
sock->ifchange_obj = NULL;
sock->accept_recv_req = NULL;
sock->connect_req = NULL;
+ sock->main_poll = NULL;
memset( &sock->addr, 0, sizeof(sock->addr) );
sock->addr_len = 0;
sock->rd_shutdown = 0;
@@ -2840,7 +2879,32 @@ static int poll_single_socket( struct sock *sock, int mask )
return get_poll_flags( sock, pollfd.revents ) & mask;
}
-static void poll_socket( struct sock *poll_sock, struct async *async, timeout_t timeout,
+static void poll_handle_exclusive(struct poll_req *req)
+{
+ unsigned int i;
+
+ for (i = 0; i < req->count; ++i)
+ {
+ struct sock *sock = req->sockets[i].sock;
+ struct poll_req *main_poll = sock->main_poll;
+
+ if (main_poll && main_poll->exclusive && req->exclusive)
+ {
+ /* Previous exclusive main poll replaced by new exclusive poll. */
+ main_poll->iosb->status = STATUS_SUCCESS;
+ main_poll->iosb->out_data = main_poll->output;
+ main_poll->iosb->out_size = main_poll->count * sizeof(*main_poll->output);
+ async_terminate(main_poll->async, STATUS_ALERTED);
+
+ main_poll = NULL;
+ }
+
+ if (!main_poll)
+ sock->main_poll = req;
+ }
+}
+
+static void poll_socket( struct sock *poll_sock, struct async *async, int exclusive, timeout_t timeout,
unsigned int count, const struct poll_socket_input *input )
{
struct poll_socket_output *output;
@@ -2881,11 +2945,14 @@ static void poll_socket( struct sock *poll_sock, struct async *async, timeout_t
req->sockets[i].flags = input[i].flags;
}
+ req->exclusive = exclusive;
req->count = count;
req->async = (struct async *)grab_object( async );
req->iosb = async_get_iosb( async );
req->output = output;
+ poll_handle_exclusive(req);
+
list_add_tail( &poll_list, &req->entry );
async_set_completion_callback( async, free_poll_req, req );
queue_async( &poll_sock->poll_q, async );
@@ -3287,7 +3354,7 @@ DECL_HANDLER(poll_socket)
if ((async = create_request_async( sock->fd, get_fd_comp_flags( sock->fd ), &req->async )))
{
- poll_socket( sock, async, req->timeout, count, input );
+ poll_socket( sock, async, req->exclusive, req->timeout, count, input );
reply->wait = async_handoff( async, NULL, 0 );
reply->options = get_fd_options( sock->fd );
release_object( async );
--
2.33.0
2
2
Sept. 16, 2021
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
dlls/ntdll/unix/system.c | 374 +++++++++++++++++++++------------------
1 file changed, 202 insertions(+), 172 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c
index 2cdc6278f3d..145cb0810cd 100644
--- a/dlls/ntdll/unix/system.c
+++ b/dlls/ntdll/unix/system.c
@@ -1264,13 +1264,200 @@ static NTSTATUS create_cpuset_info(SYSTEM_CPU_SET_INFORMATION *info)
#ifdef linux
-static void copy_smbios_string( char **buffer, char *s, size_t len )
+static void copy_smbios_string( char **buffer, const char *s, size_t len )
{
if (!len) return;
memcpy(*buffer, s, len + 1);
*buffer += len + 1;
}
+#define S(s) const char * s, size_t s ## _len
+static NTSTATUS create_smbios_tables( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULONG available_len,
+ ULONG *required_len,
+ S(bios_vendor), S(bios_version), S(bios_date),
+ S(system_vendor), S(system_product), S(system_version),
+ S(system_serial), const GUID *system_uuid, S(system_sku),
+ S(system_family),
+ S(board_vendor), S(board_product), S(board_version),
+ S(board_serial), S(board_asset_tag),
+ S(chassis_vendor), BYTE chassis_type, S(chassis_version),
+ S(chassis_serial), S(chassis_asset_tag) )
+#undef S
+{
+ char *buffer = (char*)sfti->TableBuffer;
+ BYTE string_count;
+ BYTE handle_count = 0;
+ struct smbios_prologue *prologue;
+ struct smbios_bios *bios;
+ struct smbios_system *system;
+ struct smbios_board *board;
+ struct smbios_chassis *chassis;
+ struct smbios_boot_info *boot_info;
+ struct smbios_header *end_of_table;
+
+ *required_len = sizeof(struct smbios_prologue);
+
+#define L(l) (l + (l ? 1 : 0))
+ *required_len += sizeof(struct smbios_bios);
+ *required_len += max(L(bios_vendor_len) + L(bios_version_len) + L(bios_date_len) + 1, 2);
+
+ *required_len += sizeof(struct smbios_system);
+ *required_len += max(L(system_vendor_len) + L(system_product_len) + L(system_version_len) +
+ L(system_serial_len) + L(system_sku_len) + L(system_family_len) + 1, 2);
+
+ *required_len += sizeof(struct smbios_board);
+ *required_len += max(L(board_vendor_len) + L(board_product_len) + L(board_version_len) +
+ L(board_serial_len) + L(board_asset_tag_len) + 1, 2);
+
+ *required_len += sizeof(struct smbios_chassis);
+ *required_len += max(L(chassis_vendor_len) + L(chassis_version_len) + L(chassis_serial_len) +
+ L(chassis_asset_tag_len) + 1, 2);
+
+ *required_len += sizeof(struct smbios_boot_info);
+ *required_len += 2;
+
+ *required_len += sizeof(struct smbios_header);
+ *required_len += 2;
+#undef L
+
+ sfti->TableBufferLength = *required_len;
+
+ *required_len += FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
+
+ if (available_len < *required_len)
+ return STATUS_BUFFER_TOO_SMALL;
+
+ prologue = (struct smbios_prologue*)buffer;
+ prologue->calling_method = 0;
+ prologue->major_version = 2;
+ prologue->minor_version = 4;
+ prologue->revision = 0;
+ prologue->length = sfti->TableBufferLength - sizeof(struct smbios_prologue);
+ buffer += sizeof(struct smbios_prologue);
+
+ string_count = 0;
+ bios = (struct smbios_bios*)buffer;
+ bios->hdr.type = 0;
+ bios->hdr.length = sizeof(struct smbios_bios);
+ bios->hdr.handle = handle_count++;
+ bios->vendor = bios_vendor_len ? ++string_count : 0;
+ bios->version = bios_version_len ? ++string_count : 0;
+ bios->start = 0;
+ bios->date = bios_date_len ? ++string_count : 0;
+ bios->size = 0;
+ bios->characteristics = 0x4; /* not supported */
+ bios->characteristics_ext[0] = 0;
+ bios->characteristics_ext[1] = 0;
+ bios->system_bios_major_release = 0xFF; /* not supported */
+ bios->system_bios_minor_release = 0xFF; /* not supported */
+ bios->ec_firmware_major_release = 0xFF; /* not supported */
+ bios->ec_firmware_minor_release = 0xFF; /* not supported */
+ buffer += sizeof(struct smbios_bios);
+
+ copy_smbios_string(&buffer, bios_vendor, bios_vendor_len);
+ copy_smbios_string(&buffer, bios_version, bios_version_len);
+ copy_smbios_string(&buffer, bios_date, bios_date_len);
+ if (!string_count) *buffer++ = 0;
+ *buffer++ = 0;
+
+ string_count = 0;
+ system = (struct smbios_system*)buffer;
+ system->hdr.type = 1;
+ system->hdr.length = sizeof(struct smbios_system);
+ system->hdr.handle = handle_count++;
+ system->vendor = system_vendor_len ? ++string_count : 0;
+ system->product = system_product_len ? ++string_count : 0;
+ system->version = system_version_len ? ++string_count : 0;
+ system->serial = system_serial_len ? ++string_count : 0;
+ memcpy( system->uuid, system_uuid, sizeof(GUID) );
+ system->wake_up_type = 0x02; /* unknown */
+ system->sku_number = system_sku_len ? ++string_count : 0;
+ system->family = system_family_len ? ++string_count : 0;
+ buffer += sizeof(struct smbios_system);
+
+ copy_smbios_string(&buffer, system_vendor, system_vendor_len);
+ copy_smbios_string(&buffer, system_product, system_product_len);
+ copy_smbios_string(&buffer, system_version, system_version_len);
+ copy_smbios_string(&buffer, system_serial, system_serial_len);
+ copy_smbios_string(&buffer, system_sku, system_sku_len);
+ copy_smbios_string(&buffer, system_family, system_family_len);
+ if (!string_count) *buffer++ = 0;
+ *buffer++ = 0;
+
+ string_count = 0;
+ chassis = (struct smbios_chassis*)buffer;
+ chassis->hdr.type = 3;
+ chassis->hdr.length = sizeof(struct smbios_chassis);
+ chassis->hdr.handle = handle_count++;
+ chassis->vendor = chassis_vendor_len ? ++string_count : 0;
+ chassis->type = chassis_type;
+ chassis->version = chassis_version_len ? ++string_count : 0;
+ chassis->serial = chassis_serial_len ? ++string_count : 0;
+ chassis->asset_tag = chassis_asset_tag_len ? ++string_count : 0;
+ chassis->boot_state = 0x02; /* unknown */
+ chassis->power_supply_state = 0x02; /* unknown */
+ chassis->thermal_state = 0x02; /* unknown */
+ chassis->security_status = 0x02; /* unknown */
+ chassis->oem_defined = 0;
+ chassis->height = 0; /* undefined */
+ chassis->num_power_cords = 0; /* unspecified */
+ chassis->num_contained_elements = 0;
+ chassis->contained_element_rec_length = 3;
+ buffer += sizeof(struct smbios_chassis);
+
+ copy_smbios_string(&buffer, chassis_vendor, chassis_vendor_len);
+ copy_smbios_string(&buffer, chassis_version, chassis_version_len);
+ copy_smbios_string(&buffer, chassis_serial, chassis_serial_len);
+ copy_smbios_string(&buffer, chassis_asset_tag, chassis_asset_tag_len);
+ if (!string_count) *buffer++ = 0;
+ *buffer++ = 0;
+
+ string_count = 0;
+ board = (struct smbios_board*)buffer;
+ board->hdr.type = 2;
+ board->hdr.length = sizeof(struct smbios_board);
+ board->hdr.handle = handle_count++;
+ board->vendor = board_vendor_len ? ++string_count : 0;
+ board->product = board_product_len ? ++string_count : 0;
+ board->version = board_version_len ? ++string_count : 0;
+ board->serial = board_serial_len ? ++string_count : 0;
+ board->asset_tag = board_asset_tag_len ? ++string_count : 0;
+ board->feature_flags = 0x5; /* hosting board, removable */
+ board->location = 0;
+ board->chassis_handle = chassis->hdr.handle;
+ board->board_type = 0xa; /* motherboard */
+ board->num_contained_handles = 0;
+ buffer += sizeof(struct smbios_board);
+
+ copy_smbios_string(&buffer, board_vendor, board_vendor_len);
+ copy_smbios_string(&buffer, board_product, board_product_len);
+ copy_smbios_string(&buffer, board_version, board_version_len);
+ copy_smbios_string(&buffer, board_serial, board_serial_len);
+ copy_smbios_string(&buffer, board_asset_tag, board_asset_tag_len);
+ if (!string_count) *buffer++ = 0;
+ *buffer++ = 0;
+
+ boot_info = (struct smbios_boot_info*)buffer;
+ boot_info->hdr.type = 32;
+ boot_info->hdr.length = sizeof(struct smbios_boot_info);
+ boot_info->hdr.handle = handle_count++;
+ memset(boot_info->reserved, 0, sizeof(boot_info->reserved));
+ memset(boot_info->boot_status, 0, sizeof(boot_info->boot_status)); /* no errors detected */
+ buffer += sizeof(struct smbios_boot_info);
+ *buffer++ = 0;
+ *buffer++ = 0;
+
+ end_of_table = (struct smbios_header*)buffer;
+ end_of_table->type = 127;
+ end_of_table->length = sizeof(struct smbios_header);
+ end_of_table->handle = handle_count++;
+ buffer += sizeof(struct smbios_header);
+ *buffer++ = 0;
+ *buffer++ = 0;
+
+ return STATUS_SUCCESS;
+}
+
static size_t get_smbios_string( const char *path, char *str, size_t size )
{
FILE *file;
@@ -1343,16 +1530,7 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON
char chassis_vendor[128], chassis_version[128], chassis_serial[128], chassis_asset_tag[128];
char chassis_type[11] = "2"; /* unknown */
size_t chassis_vendor_len, chassis_version_len, chassis_serial_len, chassis_asset_tag_len;
- char *buffer = (char*)sfti->TableBuffer;
- BYTE string_count;
- BYTE handle_count = 0;
- struct smbios_prologue *prologue;
- struct smbios_bios *bios;
- struct smbios_system *system;
- struct smbios_board *board;
- struct smbios_chassis *chassis;
- struct smbios_boot_info *boot_info;
- struct smbios_header *end_of_table;
+ GUID system_uuid;
#define S(s) s, sizeof(s)
bios_vendor_len = get_smbios_string("/sys/class/dmi/id/bios_vendor", S(bios_vendor));
@@ -1376,167 +1554,19 @@ static NTSTATUS get_firmware_info( SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti, ULON
get_smbios_string("/sys/class/dmi/id/chassis_type", S(chassis_type));
#undef S
- *required_len = sizeof(struct smbios_prologue);
-
-#define L(l) (l + (l ? 1 : 0))
- *required_len += sizeof(struct smbios_bios);
- *required_len += max(L(bios_vendor_len) + L(bios_version_len) + L(bios_date_len) + 1, 2);
-
- *required_len += sizeof(struct smbios_system);
- *required_len += max(L(system_vendor_len) + L(system_product_len) + L(system_version_len) +
- L(system_serial_len) + L(system_sku_len) + L(system_family_len) + 1, 2);
-
- *required_len += sizeof(struct smbios_board);
- *required_len += max(L(board_vendor_len) + L(board_product_len) + L(board_version_len) +
- L(board_serial_len) + L(board_asset_tag_len) + 1, 2);
-
- *required_len += sizeof(struct smbios_chassis);
- *required_len += max(L(chassis_vendor_len) + L(chassis_version_len) + L(chassis_serial_len) +
- L(chassis_asset_tag_len) + 1, 2);
-
- *required_len += sizeof(struct smbios_boot_info);
- *required_len += 2;
-
- *required_len += sizeof(struct smbios_header);
- *required_len += 2;
-#undef L
-
- sfti->TableBufferLength = *required_len;
-
- *required_len += FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
-
- if (available_len < *required_len)
- return STATUS_BUFFER_TOO_SMALL;
-
- prologue = (struct smbios_prologue*)buffer;
- prologue->calling_method = 0;
- prologue->major_version = 2;
- prologue->minor_version = 4;
- prologue->revision = 0;
- prologue->length = sfti->TableBufferLength - sizeof(struct smbios_prologue);
- buffer += sizeof(struct smbios_prologue);
-
- string_count = 0;
- bios = (struct smbios_bios*)buffer;
- bios->hdr.type = 0;
- bios->hdr.length = sizeof(struct smbios_bios);
- bios->hdr.handle = handle_count++;
- bios->vendor = bios_vendor_len ? ++string_count : 0;
- bios->version = bios_version_len ? ++string_count : 0;
- bios->start = 0;
- bios->date = bios_date_len ? ++string_count : 0;
- bios->size = 0;
- bios->characteristics = 0x4; /* not supported */
- bios->characteristics_ext[0] = 0;
- bios->characteristics_ext[1] = 0;
- bios->system_bios_major_release = 0xFF; /* not supported */
- bios->system_bios_minor_release = 0xFF; /* not supported */
- bios->ec_firmware_major_release = 0xFF; /* not supported */
- bios->ec_firmware_minor_release = 0xFF; /* not supported */
- buffer += sizeof(struct smbios_bios);
-
- copy_smbios_string(&buffer, bios_vendor, bios_vendor_len);
- copy_smbios_string(&buffer, bios_version, bios_version_len);
- copy_smbios_string(&buffer, bios_date, bios_date_len);
- if (!string_count) *buffer++ = 0;
- *buffer++ = 0;
-
- string_count = 0;
- system = (struct smbios_system*)buffer;
- system->hdr.type = 1;
- system->hdr.length = sizeof(struct smbios_system);
- system->hdr.handle = handle_count++;
- system->vendor = system_vendor_len ? ++string_count : 0;
- system->product = system_product_len ? ++string_count : 0;
- system->version = system_version_len ? ++string_count : 0;
- system->serial = system_serial_len ? ++string_count : 0;
- get_system_uuid( (GUID *)system->uuid );
- system->wake_up_type = 0x02; /* unknown */
- system->sku_number = system_sku_len ? ++string_count : 0;
- system->family = system_family_len ? ++string_count : 0;
- buffer += sizeof(struct smbios_system);
-
- copy_smbios_string(&buffer, system_vendor, system_vendor_len);
- copy_smbios_string(&buffer, system_product, system_product_len);
- copy_smbios_string(&buffer, system_version, system_version_len);
- copy_smbios_string(&buffer, system_serial, system_serial_len);
- copy_smbios_string(&buffer, system_sku, system_sku_len);
- copy_smbios_string(&buffer, system_family, system_family_len);
- if (!string_count) *buffer++ = 0;
- *buffer++ = 0;
-
- string_count = 0;
- chassis = (struct smbios_chassis*)buffer;
- chassis->hdr.type = 3;
- chassis->hdr.length = sizeof(struct smbios_chassis);
- chassis->hdr.handle = handle_count++;
- chassis->vendor = chassis_vendor_len ? ++string_count : 0;
- chassis->type = atoi(chassis_type);
- chassis->version = chassis_version_len ? ++string_count : 0;
- chassis->serial = chassis_serial_len ? ++string_count : 0;
- chassis->asset_tag = chassis_asset_tag_len ? ++string_count : 0;
- chassis->boot_state = 0x02; /* unknown */
- chassis->power_supply_state = 0x02; /* unknown */
- chassis->thermal_state = 0x02; /* unknown */
- chassis->security_status = 0x02; /* unknown */
- chassis->oem_defined = 0;
- chassis->height = 0; /* undefined */
- chassis->num_power_cords = 0; /* unspecified */
- chassis->num_contained_elements = 0;
- chassis->contained_element_rec_length = 3;
- buffer += sizeof(struct smbios_chassis);
-
- copy_smbios_string(&buffer, chassis_vendor, chassis_vendor_len);
- copy_smbios_string(&buffer, chassis_version, chassis_version_len);
- copy_smbios_string(&buffer, chassis_serial, chassis_serial_len);
- copy_smbios_string(&buffer, chassis_asset_tag, chassis_asset_tag_len);
- if (!string_count) *buffer++ = 0;
- *buffer++ = 0;
-
- string_count = 0;
- board = (struct smbios_board*)buffer;
- board->hdr.type = 2;
- board->hdr.length = sizeof(struct smbios_board);
- board->hdr.handle = handle_count++;
- board->vendor = board_vendor_len ? ++string_count : 0;
- board->product = board_product_len ? ++string_count : 0;
- board->version = board_version_len ? ++string_count : 0;
- board->serial = board_serial_len ? ++string_count : 0;
- board->asset_tag = board_asset_tag_len ? ++string_count : 0;
- board->feature_flags = 0x5; /* hosting board, removable */
- board->location = 0;
- board->chassis_handle = chassis->hdr.handle;
- board->board_type = 0xa; /* motherboard */
- board->num_contained_handles = 0;
- buffer += sizeof(struct smbios_board);
-
- copy_smbios_string(&buffer, board_vendor, board_vendor_len);
- copy_smbios_string(&buffer, board_product, board_product_len);
- copy_smbios_string(&buffer, board_version, board_version_len);
- copy_smbios_string(&buffer, board_serial, board_serial_len);
- copy_smbios_string(&buffer, board_asset_tag, board_asset_tag_len);
- if (!string_count) *buffer++ = 0;
- *buffer++ = 0;
-
- boot_info = (struct smbios_boot_info*)buffer;
- boot_info->hdr.type = 32;
- boot_info->hdr.length = sizeof(struct smbios_boot_info);
- boot_info->hdr.handle = handle_count++;
- memset(boot_info->reserved, 0, sizeof(boot_info->reserved));
- memset(boot_info->boot_status, 0, sizeof(boot_info->boot_status)); /* no errors detected */
- buffer += sizeof(struct smbios_boot_info);
- *buffer++ = 0;
- *buffer++ = 0;
-
- end_of_table = (struct smbios_header*)buffer;
- end_of_table->type = 127;
- end_of_table->length = sizeof(struct smbios_header);
- end_of_table->handle = handle_count++;
- buffer += sizeof(struct smbios_header);
- *buffer++ = 0;
- *buffer++ = 0;
-
- return STATUS_SUCCESS;
+ get_system_uuid(&system_uuid);
+
+#define S(s) s, s ## _len
+ return create_smbios_tables( sfti, available_len, required_len,
+ S(bios_vendor), S(bios_version), S(bios_date),
+ S(system_vendor), S(system_product), S(system_version),
+ S(system_serial), &system_uuid, S(system_sku),
+ S(system_family),
+ S(board_vendor), S(board_product), S(board_version),
+ S(board_serial), S(board_asset_tag),
+ S(chassis_vendor), atoi(chassis_type), S(chassis_version),
+ S(chassis_serial), S(chassis_asset_tag) );
+#undef S
}
default:
FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION provider %08x\n", sfti->ProviderSignature);
--
2.30.1 (Apple Git-130)
2
3
[PATCH v3 1/6] user32/tests: Fix existing winevents in test_showwindow() message sequences.
by Connor McAdams Sept. 16, 2021
by Connor McAdams Sept. 16, 2021
Sept. 16, 2021
Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com>
---
-v3: Actually run test_mdi_messages() with winevents enabled.
dlls/user32/tests/msg.c | 46 ++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 4c9f1dc6913..420ada6e384 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -724,7 +724,7 @@ static const struct message WmCreateMaxPopupSeq[] = {
{ WM_NCCREATE, sent },
{ WM_NCCALCSIZE, sent|wparam, 0 },
{ WM_CREATE, sent },
- { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_SIZE, sent|wparam, SIZE_RESTORED },
{ WM_MOVE, sent },
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
@@ -734,12 +734,12 @@ static const struct message WmCreateMaxPopupSeq[] = {
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOREDRAW|SWP_STATECHANGED },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ HCBT_ACTIVATE, hook },
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_NCPAINT, sent|wparam|optional, 1 },
@@ -751,7 +751,7 @@ static const struct message WmCreateMaxPopupSeq[] = {
{ HCBT_SETFOCUS, hook },
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
- { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
{ WM_GETTEXT, sent|optional },
{ WM_SYNCPAINT, sent|wparam|optional, 4 },
@@ -768,7 +768,7 @@ static const struct message WmCreateInvisibleMaxPopupSeq[] = {
{ WM_NCCREATE, sent },
{ WM_NCCALCSIZE, sent|wparam, 0 },
{ WM_CREATE, sent },
- { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_SIZE, sent|wparam, SIZE_RESTORED },
{ WM_MOVE, sent },
{ HCBT_MINMAX, hook|lparam, 0, SW_MAXIMIZE },
@@ -778,7 +778,7 @@ static const struct message WmCreateInvisibleMaxPopupSeq[] = {
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOREDRAW|SWP_STATECHANGED },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ 0 }
};
/* ShowWindow(SW_SHOWMAXIMIZED) for a resized not visible popup window */
@@ -787,9 +787,9 @@ static const struct message WmShowMaxPopupResizedSeq[] = {
{ WM_GETMINMAXINFO, sent },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED, 0, SWP_STATECHANGED /* w1064v1809 */ },
{ WM_NCCALCSIZE, sent|wparam, TRUE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ HCBT_ACTIVATE, hook },
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_NCPAINT, sent|wparam|optional, 1 },
@@ -801,7 +801,7 @@ static const struct message WmShowMaxPopupResizedSeq[] = {
{ HCBT_SETFOCUS, hook },
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
- { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
{ WM_GETTEXT, sent|optional },
{ WM_NCPAINT, sent|wparam|optional, 1 },
@@ -810,7 +810,7 @@ static const struct message WmShowMaxPopupResizedSeq[] = {
/* WinNT4.0 sends WM_MOVE */
{ WM_MOVE, sent|defwinproc|optional },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ 0 }
};
/* ShowWindow(SW_SHOWMAXIMIZED) for a not visible popup window */
@@ -819,9 +819,9 @@ static const struct message WmShowMaxPopupSeq[] = {
{ WM_GETMINMAXINFO, sent },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED, 0, SWP_STATECHANGED /* w1064v1809 */ },
{ WM_NCCALCSIZE, sent|wparam, TRUE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ HCBT_ACTIVATE, hook },
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_NCPAINT, sent|wparam|optional, 1 },
@@ -833,7 +833,7 @@ static const struct message WmShowMaxPopupSeq[] = {
{ HCBT_SETFOCUS, hook },
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
- { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
{ WM_GETTEXT, sent|optional },
{ WM_SYNCPAINT, sent|wparam|optional, 4 },
@@ -842,8 +842,8 @@ static const struct message WmShowMaxPopupSeq[] = {
{ WM_NCPAINT, sent|wparam|defwinproc|optional, 1 },
{ WM_ERASEBKGND, sent|defwinproc|optional },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE, 0, SWP_STATECHANGED /* w1064v1809 */ },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_SIZE, sent|defwinproc|optional },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ 0 }
};
/* CreateWindow(WS_VISIBLE) for popup window */
@@ -852,14 +852,14 @@ static const struct message WmCreatePopupSeq[] = {
{ WM_NCCREATE, sent },
{ WM_NCCALCSIZE, sent|wparam, 0 },
{ WM_CREATE, sent },
- { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_SIZE, sent|wparam, SIZE_RESTORED },
{ WM_MOVE, sent },
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ HCBT_ACTIVATE, hook },
- { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_NCPAINT, sent|wparam|optional, 1 },
@@ -871,7 +871,7 @@ static const struct message WmCreatePopupSeq[] = {
{ HCBT_SETFOCUS, hook },
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
- { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
{ WM_GETTEXT, sent|optional },
{ WM_SYNCPAINT, sent|wparam|optional, 4 },
@@ -894,7 +894,7 @@ static const struct message WmShowVisMaxPopupSeq[] = {
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_STATECHANGED },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ 0 }
};
/* ShowWindow(hwnd, SW_RESTORE) to a minimized window */
@@ -2068,7 +2068,7 @@ static const struct message WmSHOWNAChildVisParVis[] = {
static const struct message WmSHOWNAChildInvisParVis[] = {
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_ERASEBKGND, sent|optional },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOACTIVATE|SWP_NOCLIENTMOVE },
{ 0 }
@@ -2091,7 +2091,7 @@ static const struct message WmSHOWNATopInvisible[] = {
{ WM_WINDOWPOSCHANGED, sent|optional },
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
- { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_NCPAINT, sent|wparam|optional, 1 },
{ WM_GETTEXT, sent|defwinproc|optional },
{ WM_ERASEBKGND, sent|optional },
@@ -2099,7 +2099,7 @@ static const struct message WmSHOWNATopInvisible[] = {
{ WM_NCCALCSIZE, sent|wparam|optional, 1 },
{ WM_NCPAINT, sent|wparam|optional, 1 },
{ WM_ERASEBKGND, sent|optional },
- { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
+ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Win7 sends it, but Win8+ doesn't. */
{ WM_SIZE, sent|wparam, SIZE_RESTORED },
{ WM_MOVE, sent },
{ 0 }
--
2.25.1
2
11