Commit 42082d4d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Avoid sending envelope report if it has been removed.

parent d05ce2e7
......@@ -2641,7 +2641,9 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
impl->params.cbTypeSpecificParams = params->cbTypeSpecificParams;
}
if ((flags & DIEP_ENVELOPE) && params->lpEnvelope)
if (!(flags & DIEP_ENVELOPE))
TRACE( "Keeping previous effect envelope\n" );
else if (params->lpEnvelope)
{
if (params->lpEnvelope->dwSize != sizeof(DIENVELOPE)) return DIERR_INVALIDPARAM;
impl->params.lpEnvelope = &impl->envelope;
......@@ -2649,6 +2651,13 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
impl->modified |= DIEP_ENVELOPE;
memcpy( impl->params.lpEnvelope, params->lpEnvelope, sizeof(DIENVELOPE) );
}
else
{
flags &= ~DIEP_ENVELOPE;
impl->flags &= ~DIEP_ENVELOPE;
impl->modified &= ~DIEP_ENVELOPE;
impl->params.lpEnvelope = NULL;
}
if (flags & DIEP_DURATION)
{
......
......@@ -458,14 +458,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
.report_len = 2,
.report_buf = {0x05,0x19},
},
/* set envelope (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
.report_id = 6,
.report_len = 7,
.report_buf = {0x06,0x19,0x4c,0x01,0x00,0x04,0x00},
.todo = TRUE, .wine_only = TRUE,
},
/* update effect */
{
.code = IOCTL_HID_WRITE_REPORT,
......@@ -5683,14 +5675,6 @@ static void test_windows_gaming_input(void)
.report_len = 10,
.report_buf = {7,0x01,0x10,0x27,0x00,0x00,0x70,0xff,0xe8,0x03},
},
/* set envelope (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
.report_id = 8,
.report_len = 8,
.report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00},
.todo = TRUE, .wine_only = TRUE,
},
/* update effect */
{
.code = IOCTL_HID_WRITE_REPORT,
......@@ -5822,14 +5806,6 @@ static void test_windows_gaming_input(void)
.report_len = 4,
.report_buf = {9,0x01,0x18,0xfc},
},
/* set envelope (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
.report_id = 8,
.report_len = 8,
.report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00},
.todo = TRUE, .wine_only = TRUE,
},
/* update effect (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
......@@ -5908,14 +5884,6 @@ static void test_windows_gaming_input(void)
.report_len = 6,
.report_buf = {10,0x01,0xe8,0x03,0xa0,0x0f},
},
/* set envelope (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
.report_id = 8,
.report_len = 8,
.report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00},
.todo = TRUE, .wine_only = TRUE,
},
/* update effect (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
......@@ -5956,14 +5924,6 @@ static void test_windows_gaming_input(void)
.report_len = 6,
.report_buf = {10,0x01,0x18,0xfc,0x60,0xf0},
},
/* set envelope (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
.report_id = 8,
.report_len = 8,
.report_buf = {8,0x01,0x00,0x00,0x00,0x00,0x00,0x00},
.todo = TRUE, .wine_only = TRUE,
},
/* update effect (wine) */
{
.code = IOCTL_HID_WRITE_REPORT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment