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
February 2007
----- 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
839 discussions
Start a n
N
ew thread
Mikołaj Zalewski : shlwapi: Test string functions when buffer is too small.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 2270cc2994ff742c937a61e2c53c06a997c1b965 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2270cc2994ff742c937a61e2c…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl> Date: Sun Feb 4 23:55:35 2007 +0100 shlwapi: Test string functions when buffer is too small. --- dlls/shlwapi/tests/string.c | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index 6369a87..6f7b511 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -30,6 +30,11 @@ #include "shlwapi.h" #include "shtypes.h" +#define expect_eq(expr, val, type, fmt) do { \ + type ret = expr; \ + ok(ret == val, "Unexpected value of '" #expr "': " #fmt " instead of " #val "\n", ret); \ +} while (0); + static HMODULE hShlwapi; static LPSTR (WINAPI *pStrCpyNXA)(LPSTR,LPCSTR,int); static LPWSTR (WINAPI *pStrCpyNXW)(LPWSTR,LPCWSTR,int); @@ -755,6 +760,65 @@ static void test_SHUnicodeToUnicode(void dwRet, dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]); } +static void test_StrXXX_overflows() +{ + CHAR str1[2*MAX_PATH+1], buf[2*MAX_PATH]; + WCHAR wstr1[2*MAX_PATH+1], wbuf[2*MAX_PATH]; + const WCHAR fmt[] = {'%','s',0}; + STRRET strret; + int ret; + int i; + + for (i=0; i<2*MAX_PATH; i++) + { + str1[i] = '0'+(i%10); + wstr1[i] = '0'+(i%10); + } + str1[2*MAX_PATH] = 0; + wstr1[2*MAX_PATH] = 0; + + memset(buf, 0xbf, sizeof(buf)); + expect_eq(StrCpyNA(buf, str1, 10), buf, PCHAR, "%p"); + expect_eq(buf[9], 0, CHAR, "%x"); + expect_eq(buf[10], '\xbf', CHAR, "%x"); + expect_eq(StrCatBuffA(buf, str1, 100), buf, PCHAR, "%p"); + expect_eq(buf[99], 0, CHAR, "%x"); + expect_eq(buf[100], '\xbf', CHAR, "%x"); + + memset(wbuf, 0xbf, sizeof(wbuf)); + expect_eq(StrCpyNW(wbuf, wstr1, 10), wbuf, PWCHAR, "%p"); + expect_eq(wbuf[9], 0, WCHAR, "%x"); + expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); + expect_eq(StrCatBuffW(wbuf, wstr1, 100), wbuf, PWCHAR, "%p"); + expect_eq(wbuf[99], 0, WCHAR, "%x"); + expect_eq(wbuf[100], (WCHAR)0xbfbf, WCHAR, "%x"); + + memset(wbuf, 0xbf, sizeof(wbuf)); + strret.uType = STRRET_WSTR; + U(strret).pOleStr = StrDupW(wstr1); + expect_eq(StrRetToBufW(&strret, NULL, wbuf, 10), S_OK, HRESULT, "%x"); + expect_eq(wbuf[9], 0, WCHAR, "%x"); + expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); + + memset(buf, 0xbf, sizeof(buf)); + strret.uType = STRRET_CSTR; + StrCpyN(U(strret).cStr, str1, MAX_PATH); + expect_eq(StrRetToBufA(&strret, NULL, buf, 10), S_OK, HRESULT, "%x"); + expect_eq(buf[9], 0, CHAR, "%x"); + expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); + + memset(buf, 0xbf, sizeof(buf)); + ret = wnsprintfA(buf, 10, "%s", str1); + todo_wine ok(ret == 9, "Unexpected wsnprintfA return %d, expected 9\n", ret); + expect_eq(buf[9], 0, CHAR, "%x"); + expect_eq(buf[10], (CHAR)0xbf, CHAR, "%x"); + memset(wbuf, 0xbf, sizeof(wbuf)); + ret = wnsprintfW(wbuf, 10, fmt, wstr1); + todo_wine ok(ret == 9, "Unexpected wsnprintfW return %d, expected 9\n", ret); + expect_eq(wbuf[9], 0, WCHAR, "%x"); + expect_eq(wbuf[10], (WCHAR)0xbfbf, WCHAR, "%x"); +} + START_TEST(string) { TCHAR thousandDelim[8]; @@ -802,4 +866,5 @@ START_TEST(string) test_StrRStrI(); test_SHAnsiToAnsi(); test_SHUnicodeToUnicode(); + test_StrXXX_overflows(); }
1
0
0
0
Felix Nawothnig : gdi32: Fix offset calculation in PATH_ExtTextOut for > 1 chars.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 7777a8eaf781b3a2b688db2542f43107af96004c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7777a8eaf781b3a2b688db254…
Author: Felix Nawothnig <flexo(a)holycrap.org> Date: Sat Feb 3 22:04:38 2007 +0100 gdi32: Fix offset calculation in PATH_ExtTextOut for >1 chars. --- dlls/gdi32/path.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index 306ed37..edce62c 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -1350,6 +1350,7 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT LOGFONTW lf; POINT org; HDC hdc = dc->hSelf; + INT offset = 0, xoff = 0, yoff = 0; TRACE("%p, %d, %d, %08x, %s, %s, %d, %p)\n", hdc, x, y, flags, wine_dbgstr_rect(lprc), debugstr_wn(str, count), count, dx); @@ -1372,7 +1373,6 @@ BOOL PATH_ExtTextOut(DC *dc, INT x, INT for (idx = 0; idx < count; idx++) { - INT offset = 0, xoff = 0, yoff = 0; GLYPHMETRICS gm; DWORD dwSize; void *outline;
1
0
0
0
Dmitry Timoshkov : gdi32: Make sure that we don't read/ write beyond the provided buffer in GetOutlineTextMetricsA, add a test case .
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: e915a3cfb102870ed71843844b62c337af758ac4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e915a3cfb102870ed71843844…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Fri Feb 2 18:18:15 2007 +0800 gdi32: Make sure that we don't read/write beyond the provided buffer in GetOutlineTextMetricsA, add a test case. --- dlls/gdi32/font.c | 32 +++++++++++++---- dlls/gdi32/tests/font.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 8 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 527a0d9..ee57ba8 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1484,17 +1484,33 @@ UINT WINAPI GetOutlineTextMetricsA( /* check if the string offsets really fit into the provided size */ /* FIXME: should we check string length as well? */ - if ((UINT_PTR)lpOTM->otmpFamilyName >= lpOTM->otmSize) - lpOTM->otmpFamilyName = 0; /* doesn't fit */ + /* make sure that we don't read/write beyond the provided buffer */ + if (lpOTM->otmSize >= FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFamilyName) + sizeof(LPSTR)) + { + if ((UINT_PTR)lpOTM->otmpFamilyName >= lpOTM->otmSize) + lpOTM->otmpFamilyName = 0; /* doesn't fit */ + } - if ((UINT_PTR)lpOTM->otmpFaceName >= lpOTM->otmSize) - lpOTM->otmpFaceName = 0; /* doesn't fit */ + /* make sure that we don't read/write beyond the provided buffer */ + if (lpOTM->otmSize >= FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFaceName) + sizeof(LPSTR)) + { + if ((UINT_PTR)lpOTM->otmpFaceName >= lpOTM->otmSize) + lpOTM->otmpFaceName = 0; /* doesn't fit */ + } - if ((UINT_PTR)lpOTM->otmpStyleName >= lpOTM->otmSize) - lpOTM->otmpStyleName = 0; /* doesn't fit */ + /* make sure that we don't read/write beyond the provided buffer */ + if (lpOTM->otmSize >= FIELD_OFFSET(OUTLINETEXTMETRICA, otmpStyleName) + sizeof(LPSTR)) + { + if ((UINT_PTR)lpOTM->otmpStyleName >= lpOTM->otmSize) + lpOTM->otmpStyleName = 0; /* doesn't fit */ + } - if ((UINT_PTR)lpOTM->otmpFullName >= lpOTM->otmSize) - lpOTM->otmpFullName = 0; /* doesn't fit */ + /* make sure that we don't read/write beyond the provided buffer */ + if (lpOTM->otmSize >= FIELD_OFFSET(OUTLINETEXTMETRICA, otmpFullName) + sizeof(LPSTR)) + { + if ((UINT_PTR)lpOTM->otmpFullName >= lpOTM->otmSize) + lpOTM->otmpFullName = 0; /* doesn't fit */ + } } end: diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index e18bffe..670ec36 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -732,6 +732,91 @@ todo_wine { ReleaseDC(0, hdc); } +static void test_GetOutlineTextMetrics(void) +{ + OUTLINETEXTMETRIC *otm; + LOGFONT lf; + HFONT hfont, hfont_old; + HDC hdc; + DWORD ret, otm_size; + + hdc = GetDC(0); + + if (!is_font_installed("Arial")) + { + skip("Arial is not installed\n"); + return; + } + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Arial"); + lf.lfHeight = -13; + lf.lfWeight = FW_NORMAL; + lf.lfPitchAndFamily = DEFAULT_PITCH; + lf.lfQuality = PROOF_QUALITY; + hfont = CreateFontIndirect(&lf); + assert(hfont != 0); + + hfont_old = SelectObject(hdc, hfont); + otm_size = GetOutlineTextMetrics(hdc, 0, NULL); + trace("otm buffer size %u (0x%x)\n", otm_size, otm_size); + + otm = HeapAlloc(GetProcessHeap(), 0, otm_size); + + memset(otm, 0xAA, otm_size); + SetLastError(0xdeadbeef); + otm->otmSize = sizeof(*otm); /* just in case for Win9x compatibility */ + ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ok(ret == 1 /* Win9x */ || + ret == otm->otmSize /* XP*/, + "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + if (ret != 1) /* Win9x doesn't care about pointing beyond of the buffer */ + { + ok(otm->otmpFamilyName == NULL, "expected NULL got %p\n", otm->otmpFamilyName); + ok(otm->otmpFaceName == NULL, "expected NULL got %p\n", otm->otmpFaceName); + ok(otm->otmpStyleName == NULL, "expected NULL got %p\n", otm->otmpStyleName); + ok(otm->otmpFullName == NULL, "expected NULL got %p\n", otm->otmpFullName); + } + + memset(otm, 0xAA, otm_size); + SetLastError(0xdeadbeef); + otm->otmSize = otm_size; /* just in case for Win9x compatibility */ + ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ok(ret == 1 /* Win9x */ || + ret == otm->otmSize /* XP*/, + "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + if (ret != 1) /* Win9x doesn't care about pointing beyond of the buffer */ + { + ok(otm->otmpFamilyName != NULL, "expected not NULL got %p\n", otm->otmpFamilyName); + ok(otm->otmpFaceName != NULL, "expected not NULL got %p\n", otm->otmpFaceName); + ok(otm->otmpStyleName != NULL, "expected not NULL got %p\n", otm->otmpStyleName); + ok(otm->otmpFullName != NULL, "expected not NULL got %p\n", otm->otmpFullName); + } + + /* ask about truncated data */ + memset(otm, 0xAA, otm_size); + SetLastError(0xdeadbeef); + otm->otmSize = sizeof(*otm) - sizeof(LPSTR); /* just in case for Win9x compatibility */ + ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ok(ret == 1 /* Win9x */ || + ret == otm->otmSize /* XP*/, + "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); + if (ret != 1) /* Win9x doesn't care about pointing beyond of the buffer */ + { + ok(otm->otmpFamilyName == NULL, "expected NULL got %p\n", otm->otmpFamilyName); + ok(otm->otmpFaceName == NULL, "expected NULL got %p\n", otm->otmpFaceName); + ok(otm->otmpStyleName == NULL, "expected NULL got %p\n", otm->otmpStyleName); + } + ok(otm->otmpFullName == (LPSTR)0xAAAAAAAA, "expected 0xAAAAAAAA got %p\n", otm->otmpFullName); + + HeapFree(GetProcessHeap(), 0, otm); + + SelectObject(hdc, hfont_old); + DeleteObject(hfont); + + ReleaseDC(0, hdc); +} + START_TEST(font) { test_logfont(); @@ -742,4 +827,5 @@ START_TEST(font) test_text_extents(); test_GetGlyphIndices(); test_GetKerningPairs(); + test_GetOutlineTextMetrics(); }
1
0
0
0
Anatoly Lyutin : comdlg32: Update Russian translation.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: b18cc0596503decfccf10481af79293433a9c831 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b18cc0596503decfccf10481a…
Author: Anatoly Lyutin <vostok(a)etersoft.ru> Date: Fri Feb 2 16:48:44 2007 +0300 comdlg32: Update Russian translation. --- dlls/comdlg32/cdlg_Ru.rc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/comdlg32/cdlg_Ru.rc b/dlls/comdlg32/cdlg_Ru.rc index 8514e62..7afe4e3 100644 --- a/dlls/comdlg32/cdlg_Ru.rc +++ b/dlls/comdlg32/cdlg_Ru.rc @@ -141,7 +141,7 @@ FONT 8, "MS Shell Dlg" CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP GROUPBOX "�������",grp2,98,72,120,36,WS_GROUP CTEXT "����AaBb",stc5,103,80,109,24,SS_NOPREFIX | NOT WS_VISIBLE - LTEXT "Scr&ipt (translate):",stc7 ,98,114,80,9 + LTEXT "��&��� ��������:",stc7 ,98,114,80,9 COMBOBOX cmb5,98,124,120,90,CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP }
1
0
0
0
Vitaliy Margolen : dinput: Don' t reset user specified range in SetDataFormat. With tests.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 45b8d865b46d1083dc65731c9e33623559e5fa06 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45b8d865b46d1083dc65731c9…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Fri Feb 2 00:49:55 2007 -0700 dinput: Don't reset user specified range in SetDataFormat. With tests. --- dlls/dinput/joystick_linux.c | 2 -- dlls/dinput/tests/joystick.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index ba63d9c..4c542ad 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -664,8 +664,6 @@ static HRESULT WINAPI JoystickAImpl_SetD for (i = 0; i < This->base.data_format.wine_df->dwNumObjs; i++) { - This->props[i].lMin = 0; - This->props[i].lMax = 0xffff; This->props[i].lDeadZone = 1000; This->props[i].lSaturation = 0; } diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 05be5d6..7ca690a 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -258,6 +258,14 @@ static BOOL CALLBACK EnumJoysticks( ok(caps.dwButtons == info.button, "Number of enumerated buttons doesn't match capabilities\n"); ok(caps.dwPOVs == info.pov, "Number of enumerated POVs doesn't match capabilities\n"); + /* Set format and check limits again */ + hr = IDirectInputDevice_SetDataFormat(pJoystick, &c_dfDIJoystick2); + ok(hr==DI_OK,"IDirectInputDevice_SetDataFormat() failed: %s\n", DXGetErrorString8(hr)); + info.lMin = -2000; + info.lMax = +2000; + hr = IDirectInputDevice_EnumObjects(pJoystick, EnumAxes, (VOID*)&info, DIDFT_ALL); + ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %s\n", DXGetErrorString8(hr)); + hr = IDirectInputDevice_GetDeviceInfo(pJoystick, 0); ok(hr==E_POINTER, "IDirectInputDevice_GetDeviceInfo() " "should have returned E_POINTER, returned: %s\n",
1
0
0
0
Vitaliy Margolen : dinput: Initialize user limits with the default 0.. 65535 range. Add tests.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: b8b03b54b79fcc45fb0662aea30033cfb4d04cde URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8b03b54b79fcc45fb0662aea…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Fri Feb 2 00:47:19 2007 -0700 dinput: Initialize user limits with the default 0..65535 range. Add tests. --- dlls/dinput/joystick_linuxinput.c | 6 ++++-- dlls/dinput/tests/joystick.c | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 0011398..12fcf6d 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -387,8 +387,10 @@ static JoystickImpl *alloc_device(REFGUI memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i], df->dwObjSize); newDevice->axes[i] = idx; - newDevice->props[idx].wantmin = newDevice->props[idx].havemin = newDevice->joydev->axes[i][AXIS_ABSMIN]; - newDevice->props[idx].wantmax = newDevice->props[idx].havemax = newDevice->joydev->axes[i][AXIS_ABSMAX]; + newDevice->props[idx].havemin = newDevice->joydev->axes[i][AXIS_ABSMIN]; + newDevice->props[idx].havemax = newDevice->joydev->axes[i][AXIS_ABSMAX]; + newDevice->props[idx].wantmin = 0; + newDevice->props[idx].wantmax = 0xffff; newDevice->props[idx].deadzone = 0; df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(newDevice->numAxes++) | DIDFT_ABSAXIS; } diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index df12529..05be5d6 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -81,6 +81,7 @@ typedef struct tagJoystickInfo DWORD axis; DWORD pov; DWORD button; + LONG lMin, lMax; } JoystickInfo; static BOOL CALLBACK EnumAxes( @@ -102,8 +103,14 @@ static BOOL CALLBACK EnumAxes( diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER); diprg.diph.dwHow = DIPH_BYID; diprg.diph.dwObj = pdidoi->dwType; - diprg.lMin = -1000; - diprg.lMax = +1000; + + hr = IDirectInputDevice_GetProperty(info->pJoystick, DIPROP_RANGE, &diprg.diph); + ok(SUCCEEDED(hr), "IDirectInputDevice_GetProperty() failed: %s\n", DXGetErrorString8(hr)); + ok(info->lMin == diprg.lMin && info->lMax == diprg.lMax, "Min/Max range invalid: " + "expected %d..%d got %d..%d\n", info->lMin, info->lMax, diprg.lMin, diprg.lMax); + + diprg.lMin = -2000; + diprg.lMax = +2000; hr = IDirectInputDevice_SetProperty(info->pJoystick, DIPROP_RANGE, NULL); ok(hr==E_INVALIDARG,"IDirectInputDevice_SetProperty() should have returned " @@ -239,6 +246,9 @@ static BOOL CALLBACK EnumJoysticks( ZeroMemory(&info, sizeof(info)); info.pJoystick = pJoystick; + /* default min/max limits */ + info.lMin = 0; + info.lMax = 0xffff; /* enumerate objects */ hr = IDirectInputDevice_EnumObjects(pJoystick, EnumAxes, (VOID*)&info, DIDFT_ALL); ok(hr==DI_OK,"IDirectInputDevice_EnumObjects() failed: %s\n",
1
0
0
0
Vitaliy Margolen : dinput: Return user set limits not the device limits.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 575ede974dcf159ca77cf354730b35ff3d0fd8d5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=575ede974dcf159ca77cf3547…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Fri Feb 2 00:47:01 2007 -0700 dinput: Return user set limits not the device limits. --- dlls/dinput/joystick_linuxinput.c | 31 ++++++++++++++----------------- 1 files changed, 14 insertions(+), 17 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 9c05500..0011398 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -901,35 +901,32 @@ static HRESULT WINAPI JoystickAImpl_GetP REFGUID rguid, LPDIPROPHEADER pdiph) { - JoystickImpl *This = (JoystickImpl *)iface; - - TRACE("(this=%p,%s,%p)\n", - iface, debugstr_guid(rguid), pdiph); + JoystickImpl *This = (JoystickImpl *)iface; - if (TRACE_ON(dinput)) + TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); _dump_DIPROPHEADER(pdiph); - if (!HIWORD(rguid)) { + if (HIWORD(rguid)) return DI_OK; + switch (LOWORD(rguid)) { - case (DWORD) DIPROP_RANGE: { - LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph; - int obj = find_property(&This->base.data_format, pdiph); + case (DWORD) DIPROP_RANGE: + { + LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph; + int obj = find_property(&This->base.data_format, pdiph); + + if (obj < 0) return DIERR_OBJECTNOTFOUND; - if (obj >= 0) { - pr->lMin = This->props[obj].havemin; - pr->lMax = This->props[obj].havemax; + pr->lMin = This->props[obj].wantmin; + pr->lMax = This->props[obj].wantmax; TRACE("range(%d, %d) obj=%d\n", pr->lMin, pr->lMax, obj); - } - break; + break; } default: return IDirectInputDevice2AImpl_GetProperty(iface, rguid, pdiph); } - } - - return DI_OK; + return DI_OK; } /******************************************************************************
1
0
0
0
Vitaliy Margolen : dinput: Don't close fd before we done with it.
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 15e0ccab9bc549841c6440b8ebf130f5324758ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15e0ccab9bc549841c6440b8e…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Fri Feb 2 00:46:17 2007 -0700 dinput: Don't close fd before we done with it. --- dlls/dinput/joystick_linuxinput.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 3815c22..9c05500 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -242,16 +242,14 @@ static void find_joydevs(void) ); #ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION - if (!no_ff_check) { - if ((!test_bit(joydev.evbits,EV_FF)) - || (-1==ioctl(fd,EVIOCGBIT(EV_FF,sizeof(joydev.ffbits)),joydev.ffbits)) - || (-1==ioctl(fd,EVIOCGEFFECTS,&joydev.num_effects)) - || (joydev.num_effects <= 0)) { - close(fd); - } else { + if (!no_ff_check && + test_bit(joydev.evbits, EV_FF) && + ioctl(fd, EVIOCGBIT(EV_FF, sizeof(joydev.ffbits)), joydev.ffbits) != -1 && + ioctl(fd, EVIOCGEFFECTS, &joydev.num_effects) != -1 && + joydev.num_effects > 0) + { TRACE(" ... with force feedback\n"); joydev.has_ff = 1; - } } #endif
1
0
0
0
Marcus Meissner : kernel32: Initialize owner_exists (Coverity).
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 67b6044de79a91971eeab1f68ccc29b4cec271a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=67b6044de79a91971eeab1f68…
Author: Marcus Meissner <meissner(a)suse.de> Date: Thu Feb 1 17:02:38 2007 +0100 kernel32: Initialize owner_exists (Coverity). --- dlls/kernel32/ne_module.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c index 80b8295..25b0dcf 100644 --- a/dlls/kernel32/ne_module.c +++ b/dlls/kernel32/ne_module.c @@ -1050,7 +1050,7 @@ static HINSTANCE16 MODULE_LoadModule16( const char *file_name = NULL; char dllname[20], owner[20], *p; const char *basename; - int owner_exists; + int owner_exists = FALSE; /* strip path information */
1
0
0
0
Marcus Meissner : dinput: Fix dereference pointer after NULL check ( Coverity).
by Alexandre Julliard
05 Feb '07
05 Feb '07
Module: wine Branch: master Commit: 1fc5160ce885a38348d7ebb1d364541785088c4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fc5160ce885a38348d7ebb1d…
Author: Marcus Meissner <meissner(a)suse.de> Date: Thu Feb 1 16:08:21 2007 +0100 dinput: Fix dereference pointer after NULL check (Coverity). --- dlls/dinput/device.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 3a32ca5..ee3832b 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -955,7 +955,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_ DWORD dwHow) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - DWORD dwSize = pdidoi->dwSize; + DWORD dwSize; LPDIOBJECTDATAFORMAT odf; int idx = -1; @@ -990,6 +990,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_ if (idx < 0) return DIERR_OBJECTNOTFOUND; odf = dataformat_to_odf(This->data_format.wine_df, idx); + dwSize = pdidoi->dwSize; /* save due to memset below */ memset(pdidoi, 0, pdidoi->dwSize); pdidoi->dwSize = dwSize; if (odf->pguid) pdidoi->guidType = *odf->pguid;
1
0
0
0
← Newer
1
...
75
76
77
78
79
80
81
...
84
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
74
75
76
77
78
79
80
81
82
83
84
Results per page:
10
25
50
100
200