winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2008
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
722 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdi32: More carefully compare EMF records in tests.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 51c28a1493c844eff4f4625d3398da5ee5d707fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51c28a1493c844eff4f4625d3…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed May 7 20:34:36 2008 +0900 gdi32: More carefully compare EMF records in tests. --- dlls/gdi32/tests/metafile.c | 128 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 109 insertions(+), 19 deletions(-) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index 7c14428..78bbd8b 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -953,6 +953,81 @@ static void dump_emf_records(const HENHMETAFILE mf, const char *desc) } } +static void dump_emf_record(const ENHMETARECORD *emr, const char *desc) +{ + const BYTE *buf; + DWORD i; + + if (!winetest_debug) return; + + printf ("%s: EMF record %u has bits:\n{\n", desc, emr->iType); + buf = (const BYTE *)emr; + for (i = 0; i < emr->nSize; i++) + { + printf ("0x%02x", buf[i]); + if (i == emr->nSize - 1) + printf ("\n"); + else if (i % 8 == 7) + printf (",\n"); + else + printf (", "); + } + printf ("};\n"); +} + +static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr2, + const char *desc, BOOL todo) +{ + int diff; + + if (emr1->iType != emr2->iType && todo) + { + todo_wine + { + ok(emr1->iType == emr2->iType, "%s: emr->iType %u != %u\n", + desc, emr1->iType, emr2->iType); + } + } + else + ok(emr1->iType == emr2->iType, "%s: emr->iType %u != %u\n", + desc, emr1->iType, emr2->iType); + + if (emr1->nSize != emr2->nSize && todo) + { + todo_wine + { + ok(emr1->nSize == emr2->nSize, "%s: emr->nSize %u != %u\n", + desc, emr1->nSize, emr2->nSize); + } + } + else + ok(emr1->nSize == emr2->nSize, "%s: emr->nSize %u != %u\n", + desc, emr1->nSize, emr2->nSize); + + /* iType and nSize mismatches are fatal */ + if (emr1->iType != emr2->iType || emr1->nSize != emr2->nSize) return FALSE; + + /* contents of EMR_GDICOMMENT are not interesting */ + if (emr1->iType == EMR_GDICOMMENT) return TRUE; + + diff = memcmp(emr1->dParm, emr2->dParm, emr1->nSize - sizeof(EMR)); + if (diff && todo) + { + todo_wine + ok(diff == 0, "%s: contents of record %u don't match\n", desc, emr1->iType); + } + else + ok(diff == 0, "%s: contents of record %u don't match\n", desc, emr1->iType); + + if (diff) + { + dump_emf_record(emr1, "expected bits"); + dump_emf_record(emr2, "actual bits"); + } + + return diff == 0 || todo; /* report all non-fatal record mismatches */ +} + /* Compare the EMF produced by a test function with the * expected raw EMF data in "bits". * Return value is 0 for a perfect match, @@ -963,8 +1038,8 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits, UINT bsize, const char *desc, BOOL todo) { unsigned char buf[MF_BUFSIZE]; - UINT mfsize, i; - int diff; + UINT mfsize, offset; + const ENHMETAHEADER *emh1, *emh2; mfsize = GetEnhMetaFileBits(mf, MF_BUFSIZE, buf); ok (mfsize > 0, "%s: GetEnhMetaFileBits error %d\n", desc, GetLastError()); @@ -983,31 +1058,46 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits, ok(bsize >= MF_BUFSIZE, "%s: mfsize > bufsize (%d bytes), bsize=%d\n", desc, mfsize, bsize); - if (mfsize != bsize) - return -1; - - diff = 0; - for (i = 0; i < bsize; i++) + /* basic things must match */ + emh1 = (const ENHMETAHEADER *)bits; + emh2 = (const ENHMETAHEADER *)buf; + ok(emh1->iType == EMR_HEADER, "expected EMR_HEADER, got %u\n", emh1->iType); + ok(emh1->nSize == sizeof(ENHMETAHEADER), "expected sizeof(ENHMETAHEADER), got %u\n", emh1->nSize); + ok(emh2->nBytes == mfsize, "expected emh->nBytes %u, got %u\n", mfsize, emh2->nBytes); + ok(emh1->dSignature == ENHMETA_SIGNATURE, "expected ENHMETA_SIGNATURE, got %u\n", emh1->dSignature); + + ok(emh1->iType == emh2->iType, "expected EMR_HEADER, got %u\n", emh2->iType); + ok(emh1->nSize == emh2->nSize, "expected nSize %u, got %u\n", emh1->nSize, emh2->nSize); + ok(emh1->dSignature == emh2->dSignature, "expected dSignature %u, got %u\n", emh1->dSignature, emh2->dSignature); + if (todo && emh1->nBytes != emh2->nBytes) { - if (buf[i] != bits[i]) - diff++; + todo_wine + ok(emh1->nBytes == emh2->nBytes, "expected nBytes %u, got %u\n", emh1->nBytes, emh2->nBytes); } - if (diff != 0 && todo) + else + ok(emh1->nBytes == emh2->nBytes, "expected nBytes %u, got %u\n", emh1->nBytes, emh2->nBytes); + if (todo && emh1->nRecords != emh2->nRecords) { todo_wine - { - ok(diff == 0, "%s: mfsize=%d, bsize=%d, diff=%d\n", - desc, mfsize, bsize, diff); - } - return diff; + ok(emh1->nRecords == emh2->nRecords, "expected nBytes %u, got %u\n", emh1->nRecords, emh2->nRecords); } else + ok(emh1->nRecords == emh2->nRecords, "expected nBytes %u, got %u\n", emh1->nRecords, emh2->nRecords); + + offset = emh1->nSize; + while (offset < emh1->nBytes) { - ok(diff == 0, "%s: mfsize=%d, bsize=%d, diff=%d\n", - desc, mfsize, bsize, diff); + const ENHMETARECORD *emr1 = (const ENHMETARECORD *)(bits + offset); + const ENHMETARECORD *emr2 = (const ENHMETARECORD *)(buf + offset); + + trace("EMF record %u, size %u/record %u, size %u\n", + emr1->iType, emr1->nSize, emr2->iType, emr2->nSize); + + if (!match_emf_record(emr1, emr2, desc, todo)) return -1; - return diff; + offset += emr1->nSize; } + return 0; } /* Test a blank metafile. May be used as a template for new tests. */ @@ -1561,7 +1651,7 @@ static INT CALLBACK EmfEnumProc(HDC hdc, HANDLETABLE *lpHTable, const ENHMETAREC * until a record is played which actually outputs something */ PlayEnhMetaFileRecord(hdc, lpHTable, lpEMFR, nObj); LPtoDP(hdc, mapping, 2); - trace("Meta record: iType %d, nSize %d, (%d,%d)-(%d,%d)\n", + trace("EMF record: iType %d, nSize %d, (%d,%d)-(%d,%d)\n", lpEMFR->iType, lpEMFR->nSize, mapping[0].x, mapping[0].y, mapping[1].x, mapping[1].y);
1
0
0
0
Dmitry Timoshkov : gdi32: Set offPalEntries member of EMREOF to what XP sets it to.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 4efbf36cd5f98b0065cb528183e9d947d148ac80 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4efbf36cd5f98b0065cb52818…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed May 7 20:34:12 2008 +0900 gdi32: Set offPalEntries member of EMREOF to what XP sets it to. --- dlls/gdi32/enhmfdrv/init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index 7e68847..dafac60 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -457,7 +457,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */ emr.emr.iType = EMR_EOF; emr.emr.nSize = sizeof(emr); emr.nPalEntries = 0; - emr.offPalEntries = 0; + emr.offPalEntries = FIELD_OFFSET(EMREOF, nSizeLast); emr.nSizeLast = emr.emr.nSize; EMFDRV_WriteRecord( dc->physDev, &emr.emr );
1
0
0
0
Vitaliy Margolen : dinput: Ignore events from extra joystick buttons.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 9227e25660c80524ae9688a77cc7b93f97806d4c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9227e25660c80524ae9688a77…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Tue May 6 10:28:12 2008 -0600 dinput: Ignore events from extra joystick buttons. --- dlls/dinput/joystick_linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index a151390..9dead0a 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -698,6 +698,8 @@ static void joy_polldev(JoystickImpl *This) { jse.type,jse.number,jse.value); if (jse.type & JS_EVENT_BUTTON) { + if (jse.number >= This->devcaps.dwButtons) return; + inst_id = DIDFT_MAKEINSTANCE(jse.number) | DIDFT_PSHBUTTON; This->js.rgbButtons[jse.number] = value = jse.value ? 0x80 : 0x00; }
1
0
0
0
Vitaliy Margolen : dinput: Limit number of axes in a different way - map all extra axes to -1.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: bdbc2783a1b23b80658c74167986cf8cf9538187 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bdbc2783a1b23b80658c74167…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sat May 3 14:19:57 2008 -0600 dinput: Limit number of axes in a different way - map all extra axes to -1. We can't stop device from sending us extra axes so have to keep axes mapping around for them. --- dlls/dinput/joystick_linux.c | 102 +++++++++++++++++++---------------------- 1 files changed, 47 insertions(+), 55 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index bfb8ba0..a151390 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -289,70 +289,65 @@ static HRESULT setup_dinput_options(JoystickImpl * device) if (!device->axis_map) return DIERR_OUTOFMEMORY; if (!get_config_key( hkey, appkey, device->name, buffer, MAX_PATH )) { + static const char *axis_names[] = {"X", "Y", "Z", "Rx", "Ry", "Rz", + "Slider1", "Slider2", + "POV1", "POV2", "POV3", "POV4"}; const char *delim = ","; char * ptr; TRACE("\"%s\" = \"%s\"\n", device->name, buffer); if ((ptr = strtok(buffer, delim)) != NULL) { do { - if (strcmp(ptr, "X") == 0) { - device->axis_map[tokens] = 0; - axis++; - } else if (strcmp(ptr, "Y") == 0) { - device->axis_map[tokens] = 1; - axis++; - } else if (strcmp(ptr, "Z") == 0) { - device->axis_map[tokens] = 2; - axis++; - } else if (strcmp(ptr, "Rx") == 0) { - device->axis_map[tokens] = 3; - axis++; - } else if (strcmp(ptr, "Ry") == 0) { - device->axis_map[tokens] = 4; - axis++; - } else if (strcmp(ptr, "Rz") == 0) { - device->axis_map[tokens] = 5; - axis++; - } else if (strcmp(ptr, "Slider1") == 0) { - device->axis_map[tokens] = 6; - axis++; - } else if (strcmp(ptr, "Slider2") == 0) { - device->axis_map[tokens] = 7; - axis++; - } else if (strcmp(ptr, "POV1") == 0) { - device->axis_map[tokens++] = 8; - device->axis_map[tokens] = 8; - pov++; - } else if (strcmp(ptr, "POV2") == 0) { - device->axis_map[tokens++] = 9; - device->axis_map[tokens] = 9; - pov++; - } else if (strcmp(ptr, "POV3") == 0) { - device->axis_map[tokens++] = 10; - device->axis_map[tokens] = 10; - pov++; - } else if (strcmp(ptr, "POV4") == 0) { - device->axis_map[tokens++] = 11; - device->axis_map[tokens] = 11; - pov++; - } else { - ERR("invalid joystick axis type: %s\n", ptr); - device->axis_map[tokens] = tokens; - axis++; + int i; + + for (i = 0; i < sizeof(axis_names) / sizeof(axis_names[0]); i++) + if (!strcmp(ptr, axis_names[i])) + { + if (!strncmp(ptr, "POV", 3)) + { + if (pov >= 4) + { + WARN("Only 4 POVs supported - ignoring extra\n"); + i = -1; + } + else + { + /* Pov takes two axes */ + device->axis_map[tokens++] = i; + pov++; + } + } + else + { + if (axis >= 8) + { + FIXME("Only 8 Axes supported - ignoring extra\n"); + i = -1; + } + else + axis++; + } + break; + } + + if (i == sizeof(axis_names) / sizeof(axis_names[0])) + { + ERR("invalid joystick axis type: \"%s\"\n", ptr); + i = -1; } + device->axis_map[tokens] = i; tokens++; } while ((ptr = strtok(NULL, delim)) != NULL); - if (tokens != device->devcaps.dwAxes) { + if (tokens != device->axes) { ERR("not all joystick axes mapped: %d axes(%d,%d), %d arguments\n", device->axes, axis, pov,tokens); while (tokens < device->axes) { - device->axis_map[tokens] = tokens; + device->axis_map[tokens] = -1; tokens++; } } } - } else { @@ -360,11 +355,13 @@ static HRESULT setup_dinput_options(JoystickImpl * device) { if (tokens < 8) device->axis_map[tokens] = axis++; - else + else if (tokens < 16) { device->axis_map[tokens++] = 8 + pov; device->axis_map[tokens ] = 8 + pov++; } + else + device->axis_map[tokens] = -1; } } device->devcaps.dwAxes = axis; @@ -433,13 +430,6 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di } #endif - if (newDevice->axes > 16) - { - /* There are 24 more axes for velocity that we can use */ - FIXME("Can't support %d axes. Clamping down to 16\n", newDevice->axes); - newDevice->axes = 16; - } - if (newDevice->devcaps.dwButtons > 128) { WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->devcaps.dwButtons); @@ -472,6 +462,8 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di { int wine_obj = newDevice->axis_map[i]; + if (wine_obj < 0) continue; + memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[wine_obj], df->dwObjSize); if (wine_obj < 8) df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(wine_obj) | DIDFT_ABSAXIS;
1
0
0
0
Vitaliy Margolen : dinput: Remove redundant variable.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: b07ff6ec868caad17ff52db6f3026aad8b01f560 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b07ff6ec868caad17ff52db6f…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sat May 3 14:19:52 2008 -0600 dinput: Remove redundant variable. --- dlls/dinput/joystick_linux.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index df5d77b..bfb8ba0 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -93,7 +93,6 @@ struct JoystickImpl LONG deadzone; int *axis_map; int axes; - int buttons; POINTL povs[4]; }; @@ -428,9 +427,9 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di } #endif #ifdef JSIOCGBUTTONS - if (ioctl(newDevice->joyfd,JSIOCGBUTTONS,&newDevice->buttons) < 0) { + if (ioctl(newDevice->joyfd, JSIOCGBUTTONS, &newDevice->devcaps.dwButtons) < 0) { WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defauting to 2\n", newDevice->dev, strerror(errno)); - newDevice->buttons = 2; + newDevice->devcaps.dwButtons = 2; } #endif @@ -441,10 +440,10 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di newDevice->axes = 16; } - if (newDevice->buttons > 128) + if (newDevice->devcaps.dwButtons > 128) { - WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->buttons); - newDevice->buttons = 128; + WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->devcaps.dwButtons); + newDevice->devcaps.dwButtons = 128; } newDevice->base.lpVtbl = jvt; @@ -456,7 +455,6 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di /* setup_dinput_options may change these */ newDevice->deadzone = 0; - newDevice->devcaps.dwButtons = newDevice->buttons; /* do any user specified configuration */ hr = setup_dinput_options(newDevice); @@ -467,7 +465,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di if (!(df = HeapAlloc(GetProcessHeap(), 0, c_dfDIJoystick2.dwSize))) goto FAILED; memcpy(df, &c_dfDIJoystick2, c_dfDIJoystick2.dwSize); - df->dwNumObjs = newDevice->devcaps.dwAxes + newDevice->devcaps.dwPOVs + newDevice->buttons; + df->dwNumObjs = newDevice->devcaps.dwAxes + newDevice->devcaps.dwPOVs + newDevice->devcaps.dwButtons; if (!(df->rgodf = HeapAlloc(GetProcessHeap(), 0, df->dwNumObjs * df->dwObjSize))) goto FAILED; for (i = 0; i < newDevice->axes; i++) @@ -483,7 +481,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di i++; /* POV takes 2 axes */ } } - for (i = 0; i < newDevice->buttons; i++) + for (i = 0; i < newDevice->devcaps.dwButtons; i++) { memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize); df->rgodf[idx ].pguid = &GUID_Button;
1
0
0
0
Hans Leidekker : wininet: Deal with bogus accept types array passed into HttpOpenRequestA.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 493b6915caf78f180dfa244ab8a27f17be724c90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=493b6915caf78f180dfa244ab…
Author: Hans Leidekker <hans(a)it.vu.nl> Date: Wed May 7 13:19:37 2008 +0200 wininet: Deal with bogus accept types array passed into HttpOpenRequestA. --- dlls/wininet/http.c | 44 +++++++++++++++++++++++++++++--------------- dlls/wininet/tests/http.c | 26 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 7f336f4..3cafcae 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -964,9 +964,10 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, { LPWSTR szVerb = NULL, szObjectName = NULL; LPWSTR szVersion = NULL, szReferrer = NULL, *szAcceptTypes = NULL; - INT len; - INT acceptTypesCount; + INT len, acceptTypesCount; HINTERNET rc = FALSE; + LPCSTR *types; + TRACE("(%p, %s, %s, %s, %s, %p, %08x, %08lx)\n", hHttpSession, debugstr_a(lpszVerb), debugstr_a(lpszObjectName), debugstr_a(lpszVersion), debugstr_a(lpszReferrer), lpszAcceptTypes, @@ -1008,24 +1009,37 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, MultiByteToWideChar(CP_ACP, 0, lpszReferrer, -1, szReferrer, len ); } - acceptTypesCount = 0; if (lpszAcceptTypes) { - /* find out how many there are */ - while (lpszAcceptTypes[acceptTypesCount] && *lpszAcceptTypes[acceptTypesCount]) - acceptTypesCount++; + acceptTypesCount = 0; + types = lpszAcceptTypes; + while (*types) + { + /* find out how many there are */ + if (((ULONG_PTR)*types >> 16) && **types) + { + TRACE("accept type: %s\n", debugstr_a(*types)); + acceptTypesCount++; + } + types++; + } szAcceptTypes = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *) * (acceptTypesCount+1)); + if (!szAcceptTypes) goto end; + acceptTypesCount = 0; - while (lpszAcceptTypes[acceptTypesCount] && *lpszAcceptTypes[acceptTypesCount]) + types = lpszAcceptTypes; + while (*types) { - len = MultiByteToWideChar(CP_ACP, 0, lpszAcceptTypes[acceptTypesCount], - -1, NULL, 0 ); - szAcceptTypes[acceptTypesCount] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - if (!szAcceptTypes[acceptTypesCount] ) - goto end; - MultiByteToWideChar(CP_ACP, 0, lpszAcceptTypes[acceptTypesCount], - -1, szAcceptTypes[acceptTypesCount], len ); - acceptTypesCount++; + if (((ULONG_PTR)*types >> 16) && **types) + { + len = MultiByteToWideChar(CP_ACP, 0, *types, -1, NULL, 0 ); + szAcceptTypes[acceptTypesCount] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!szAcceptTypes[acceptTypesCount]) goto end; + + MultiByteToWideChar(CP_ACP, 0, *types, -1, szAcceptTypes[acceptTypesCount], len); + acceptTypesCount++; + } + types++; } szAcceptTypes[acceptTypesCount] = NULL; } diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index f1a67ca..705fcac 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1746,6 +1746,31 @@ static void test_user_agent_header(void) InternetCloseHandle(ses); } +static void test_bogus_accept_types_array(void) +{ + HINTERNET ses, con, req; + static const char *types[] = { (const char *)6240, "*/*", "%p", "", "*/*", NULL }; + DWORD size; + char buffer[32]; + BOOL ret; + + ses = InternetOpen("MERONG(0.9/;p)", INTERNET_OPEN_TYPE_DIRECT, "", "", 0); + con = InternetConnect(ses, "
www.winehq.org
", 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + req = HttpOpenRequest(con, "POST", "/post/post_action.php", "HTTP/1.0", "", types, INTERNET_FLAG_FORMS_SUBMIT, 0); + + ok(req != NULL, "HttpOpenRequest failed: %u\n", GetLastError()); + + buffer[0] = 0; + size = sizeof(buffer); + ret = HttpQueryInfo(req, HTTP_QUERY_ACCEPT | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL); + ok(ret, "HttpQueryInfo failed: %u\n", GetLastError()); + ok(!strcmp(buffer, "*/*, %p, */*"), "got '%s' expected '*/*, %%p, */*'\n", buffer); + + InternetCloseHandle(req); + InternetCloseHandle(con); + InternetCloseHandle(ses); +} + #define STATUS_STRING(status) \ memcpy(status_string[status], #status, sizeof(CHAR) * \ (strlen(#status) < MAX_STATUS_NAME ? \ @@ -1821,4 +1846,5 @@ START_TEST(http) HttpHeaders_test(); test_http_connection(); test_user_agent_header(); + test_bogus_accept_types_array(); }
1
0
0
0
Kai Blin : secur32: Fix ntlm tests on Vista.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 3da466a9f75076f618a5440805cd211a98c7b628 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3da466a9f75076f618a544080…
Author: Kai Blin <kai.blin(a)gmail.com> Date: Wed May 7 12:35:06 2008 +0200 secur32: Fix ntlm tests on Vista. --- dlls/secur32/tests/ntlm.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index f30f65e..b1f6c3f 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -869,8 +869,8 @@ static void testAuth(ULONG data_rep, BOOL fake) ok(sec_status == SEC_E_OK, "pQueryContextAttributesA(SECPKG_ATTR_SIZES) returned %s\n", getSecError(sec_status)); - ok(ctxt_sizes.cbMaxToken == 1904, - "cbMaxToken should be 1904 but is %lu\n", + ok((ctxt_sizes.cbMaxToken == 1904) || (ctxt_sizes.cbMaxToken == 2888), + "cbMaxToken should be 1904 or 2888 but is %lu\n", ctxt_sizes.cbMaxToken); ok(ctxt_sizes.cbMaxSignature == 16, "cbMaxSignature should be 16 but is %lu\n", @@ -1039,6 +1039,12 @@ static void testSignSeal(void) getSecError(sec_status)); sec_status = pEncryptMessage(client.ctxt, 0, &crypt, 0); + if (sec_status == SEC_E_UNSUPPORTED_FUNCTION) + { + skip("Encrypt message returned SEC_E_UNSUPPORTED_FUNCTION. " + "Expected on Vista.\n"); + goto end; + } ok(sec_status == SEC_E_OK, "EncryptMessage returned %s, not SEC_E_OK.\n", getSecError(sec_status));
1
0
0
0
Rob Shearman : rpcrt4: Add better traces for the server test.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 02c66c2312d9bf98d0fc0d5d4ce56b8564718026 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=02c66c2312d9bf98d0fc0d5d4…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Wed May 7 11:11:09 2008 +0100 rpcrt4: Add better traces for the server test. Handle failure to use one or more protocol sequences more gracefully, as ncacn_np servers aren't support on Win9x and ncacn_ip_tcp fails on some machines. --- dlls/rpcrt4/tests/server.c | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 41f3bb2..5cc9d42 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1239,22 +1239,38 @@ server(void) static unsigned char port[] = PORT; static unsigned char np[] = "ncacn_np"; static unsigned char pipe[] = PIPE; + RPC_STATUS status, iptcp_status, np_status; - ok(RPC_S_OK == RpcServerUseProtseqEp(iptcp, 20, port, NULL), "RpcServerUseProtseqEp\n"); - ok(RPC_S_OK == RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL), "RpcServerRegisterIf\n"); - ok(RPC_S_OK == RpcServerListen(1, 20, TRUE), "RpcServerListen\n"); + iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL); + ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %ld\n", iptcp_status); + np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL); + ok(np_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_np) failed with status %ld\n", np_status); + status = RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL); + ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %ld\n", status); + status = RpcServerListen(1, 20, TRUE); + ok(status == RPC_S_OK, "RpcServerListen failed with status %ld\n", status); stop_event = CreateEvent(NULL, FALSE, FALSE, NULL); - ok(stop_event != NULL, "CreateEvent failed\n"); + ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); - run_client("tcp_basic"); + if (iptcp_status == RPC_S_OK) + run_client("tcp_basic"); + else + skip("tcp_basic tests skipped due to earlier failure\n"); - ok(RPC_S_OK == RpcServerUseProtseqEp(np, 0, pipe, NULL), "RpcServerUseProtseqEp\n"); - run_client("np_basic"); + if (np_status == RPC_S_OK) + run_client("np_basic"); + else + { + skip("np_basic tests skipped due to earlier failure\n"); + /* np client is what signals stop_event, so bail out if we didn't run do it */ + return; + } ok(WAIT_OBJECT_0 == WaitForSingleObject(stop_event, 60000), "WaitForSingleObject\n"); + status = RpcMgmtWaitServerListen(); todo_wine { - ok(RPC_S_OK == RpcMgmtWaitServerListen(), "RpcMgmtWaitServerListening\n"); + ok(status == RPC_S_OK, "RpcMgmtWaitServerListening failed with status %ld\n", status); } }
1
0
0
0
Rob Shearman : winetest: Detect if an unhandled exception occurred in a child process and print an appropriate message .
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: ce42c95a1c8a651ef0cfa0ba9d3eedea3a159391 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce42c95a1c8a651ef0cfa0ba9…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Wed May 7 11:10:51 2008 +0100 winetest: Detect if an unhandled exception occurred in a child process and print an appropriate message. Avoid getting caught incrementing the failure count in this case, as it could take a very long time to complete. --- include/wine/test.h | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/wine/test.h b/include/wine/test.h index 72cd84c..1c91077 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -352,10 +352,18 @@ void winetest_wait_child_process( HANDLE process ) if (exit_code) { - fprintf( stdout, "%s: %u failures in child process\n", - current_test->name, exit_code ); - while (exit_code-- > 0) - InterlockedIncrement(&failures); + if (exit_code > 255) + { + fprintf( stdout, "%s: exception 0x%08x in child process\n", current_test->name, exit_code ); + InterlockedIncrement( &failures ); + } + else + { + fprintf( stdout, "%s: %u failures in child process\n", + current_test->name, exit_code ); + while (exit_code-- > 0) + InterlockedIncrement(&failures); + } } }
1
0
0
0
Alexandre Julliard : winedos: Print better diagnostics when a DOS app fails to start.
by Alexandre Julliard
07 May '08
07 May '08
Module: wine Branch: master Commit: 2dc9ed3006dde794113c490ba15e06af551c8788 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2dc9ed3006dde794113c490ba…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 7 17:33:50 2008 +0200 winedos: Print better diagnostics when a DOS app fails to start. --- dlls/kernel32/wowthunk.c | 2 +- dlls/winedos/dosmem.c | 2 -- dlls/winedos/dosvm.c | 13 +++++++------ dlls/winedos/module.c | 20 +++++++++++++++++--- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/dlls/kernel32/wowthunk.c b/dlls/kernel32/wowthunk.c index 791f7cf..e86c582 100644 --- a/dlls/kernel32/wowthunk.c +++ b/dlls/kernel32/wowthunk.c @@ -593,7 +593,7 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, __wine_pop_frame( &frame ); if (errno != 0) /* enter_vm86 will fall with ENOSYS on x64 kernels */ { - ERR("__wine_enter_vm86 failed (errno=%d)\n", errno); + WARN("__wine_enter_vm86 failed (errno=%d)\n", errno); if (errno == ENOSYS) SetLastError(ERROR_NOT_SUPPORTED); else diff --git a/dlls/winedos/dosmem.c b/dlls/winedos/dosmem.c index 876a3e7..76bf10c 100644 --- a/dlls/winedos/dosmem.c +++ b/dlls/winedos/dosmem.c @@ -511,8 +511,6 @@ BOOL DOSMEM_MapDosLayout(void) ERR( "Need full access to the first megabyte for DOS mode\n" ); ExitProcess(1); } - MESSAGE( "Warning: unprotecting memory to allow real-mode calls.\n" - " NULL pointer accesses will no longer be caught.\n" ); /* copy the BIOS and ISR area down */ memcpy( DOSMEM_dosmem, DOSMEM_sysmem, 0x400 + 0x100 ); DOSMEM_sysmem = DOSMEM_dosmem; diff --git a/dlls/winedos/dosvm.c b/dlls/winedos/dosvm.c index 7defba1..4a86855 100644 --- a/dlls/winedos/dosvm.c +++ b/dlls/winedos/dosvm.c @@ -569,15 +569,16 @@ static LONG WINAPI exception_handler(EXCEPTION_POINTERS *eptr) return EXCEPTION_CONTINUE_SEARCH; } -int WINAPI DOSVM_Enter( CONTEXT86 *context ) +INT WINAPI DOSVM_Enter( CONTEXT86 *context ) { + INT ret = 0; if (!ISV86(context)) ERR( "Called with protected mode context!\n" ); __TRY { - WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)context ); - TRACE_(module)( "vm86 returned: %s\n", strerror(errno) ); + if (!WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)context )) ret = -1; + TRACE_(module)( "ret %d err %u\n", ret, GetLastError() ); } __EXCEPT(exception_handler) { @@ -585,7 +586,7 @@ int WINAPI DOSVM_Enter( CONTEXT86 *context ) } __ENDTRY - return 0; + return ret; } /*********************************************************************** @@ -645,8 +646,8 @@ void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val) */ INT WINAPI DOSVM_Enter( CONTEXT86 *context ) { - ERR_(module)("DOS realmode not supported on this architecture!\n"); - return -1; + SetLastError( ERROR_NOT_SUPPORTED ); + return -1; } /*********************************************************************** diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index ade7732..ac35e85 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -614,7 +614,7 @@ void WINAPI MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg ) static DWORD WINAPI MZ_DOSVM( LPVOID lpExtra ) { CONTEXT context; - DWORD ret; + INT ret; dosvm_pid = getpid(); @@ -628,9 +628,23 @@ static DWORD WINAPI MZ_DOSVM( LPVOID lpExtra ) context.EFlags = V86_FLAG | VIF_MASK; DOSVM_SetTimer(0x10000); ret = DOSVM_Enter( &context ); - + if (ret == -1) + { + /* fetch the app name from the environment */ + PDB16 *psp = PTR_REAL_TO_LIN( DOSVM_psp, 0 ); + char *env = PTR_REAL_TO_LIN( psp->environment, 0 ); + while (*env) env += strlen(env) + 1; + env += 1 + sizeof(WORD); + + if (GetLastError() == ERROR_NOT_SUPPORTED) + MESSAGE( "wine: Cannot start DOS application %s\n" + " because vm86 mode is not supported on this platform.\n", + debugstr_a(env) ); + else + FIXME( "vm86 mode failed error %u\n", GetLastError() ); + } dosvm_pid = 0; - return ret; + return ret != 0; } static BOOL MZ_InitTask(void)
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
73
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200