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
November 2010
----- 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
2 participants
866 discussions
Start a n
N
ew thread
David Adam : ddraw: Add tests for the foreground window set by SetCooperativeLevel.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 94f74a7caf84458d4400db46e0158b3e951f1d75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94f74a7caf84458d4400db46e…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Thu Oct 28 14:18:15 2010 +0200 ddraw: Add tests for the foreground window set by SetCooperativeLevel. --- dlls/ddraw/tests/ddrawmodes.c | 106 +++++++++++++++++++++++++++++++++------- 1 files changed, 87 insertions(+), 19 deletions(-) diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c index b6491f3..e83541a 100644 --- a/dlls/ddraw/tests/ddrawmodes.c +++ b/dlls/ddraw/tests/ddrawmodes.c @@ -33,7 +33,7 @@ static LPDIRECTDRAW lpDD = NULL; static LPDIRECTDRAWSURFACE lpDDSPrimary = NULL; static LPDIRECTDRAWSURFACE lpDDSBack = NULL; static WNDCLASS wc; -static HWND hwnd; +static HWND hwnd, hwnd2; static int modes_cnt; static int modes_size; static LPDDSURFACEDESC modes; @@ -54,31 +54,21 @@ static void init_function_pointers(void) pDirectDrawEnumerateExW = (void*)GetProcAddress(hmod, "DirectDrawEnumerateExW"); } -static void createwindow(void) +static HWND createwindow(void) { - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = DefWindowProcA; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = GetModuleHandleA(0); - wc.hIcon = LoadIconA(wc.hInstance, IDI_APPLICATION); - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); - wc.hbrBackground = GetStockObject(BLACK_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = "TestWindowClass"; - if(!RegisterClassA(&wc)) - assert(0); + HWND hwnd; hwnd = CreateWindowExA(0, "TestWindowClass", "TestWindowClass", WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, GetModuleHandleA(0), NULL); - assert(hwnd != NULL); ShowWindow(hwnd, SW_HIDE); UpdateWindow(hwnd); SetFocus(hwnd); + + return hwnd; } static BOOL createdirectdraw(void) @@ -546,6 +536,7 @@ static void testdisplaymodes(void) static void testcooperativelevels_normal(void) { + BOOL sfw; HRESULT rc; DDSURFACEDESC surfacedesc; IDirectDrawSurface *surface = (IDirectDrawSurface *) 0xdeadbeef; @@ -561,11 +552,23 @@ static void testcooperativelevels_normal(void) ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_SETFOCUSWINDOW | DDSCL_CREATEDEVICEWINDOW) returned: %x\n",rc); /* Do some tests with DDSCL_NORMAL mode */ + /* Fullscreen mode + normal mode + exclusive mode */ + sfw=FALSE; + if(hwnd2) + sfw=SetForegroundWindow(hwnd2); + else + skip("Failed to create the second window\n"); + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL); todo_wine ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x\n",rc); + + if(sfw) + todo_wine ok(GetForegroundWindow()==hwnd,"Expected the main windows (%p) for foreground, received the second one (%p)\n",hwnd, hwnd2); + /* Try creating a double buffered primary in fullscreen + exclusive + normal mode */ rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); + if (rc == DDERR_UNSUPPORTEDMODE) skip("Unsupported mode\n"); else @@ -574,12 +577,21 @@ static void testcooperativelevels_normal(void) todo_wine ok(surface!=NULL, "Returned NULL surface pointer \n"); } if(surface && surface != (IDirectDrawSurface *)0xdeadbeef) IDirectDrawSurface_Release(surface); + /* Exclusive mode + normal mode */ rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_EXCLUSIVE | DDSCL_NORMAL); ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_NORMAL) returned: %x\n",rc); + /* Fullscreen mode + normal mode */ + sfw=FALSE; + if(hwnd2) sfw=SetForegroundWindow(hwnd2); + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_FULLSCREEN | DDSCL_NORMAL); todo_wine ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_FULLSCREEN | DDSCL_NORMAL) returned: %x\n",rc); + + if(sfw) + ok(GetForegroundWindow()==hwnd2,"Expected the second windows (%p) for foreground, received the main one (%p)\n",hwnd2, hwnd); + /* Try creating a double buffered primary in fullscreen + normal mode */ rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); if (rc == DDERR_UNSUPPORTEDMODE) @@ -589,12 +601,20 @@ static void testcooperativelevels_normal(void) ok(rc == DDERR_NOEXCLUSIVEMODE, "IDirectDraw_CreateSurface returned %08x\n", rc); ok(surface == NULL, "Returned surface pointer is %p\n", surface); } + if(surface && surface != (IDirectDrawSurface *)0xdeadbeef) IDirectDrawSurface_Release(surface); - /* Normal mode */ + + /* switching from Fullscreen mode to Normal mode */ + sfw=FALSE; + if(hwnd2) sfw=SetForegroundWindow(hwnd2); + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_NORMAL); ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL) returned: %x\n",rc); + if(sfw) + ok(GetForegroundWindow()==hwnd2,"Expected the second windows (%p) for foreground, received the main one (%p)\n",hwnd2, hwnd); + /* Try creating a double buffered primary in normal mode */ rc = IDirectDraw_CreateSurface(lpDD, &surfacedesc, &surface, NULL); if (rc == DDERR_UNSUPPORTEDMODE) @@ -606,6 +626,17 @@ static void testcooperativelevels_normal(void) } if(surface && surface != (IDirectDrawSurface *)0xdeadbeef) IDirectDrawSurface_Release(surface); + /* switching from Normal mode to Fullscreen + Normal mode */ + sfw=FALSE; + if(hwnd2) sfw=SetForegroundWindow(hwnd2); + + rc = IDirectDraw_SetCooperativeLevel(lpDD, + hwnd, DDSCL_NORMAL | DDSCL_FULLSCREEN); + todo_wine ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_NORMAL | FULLSCREEN) returned: %x\n",rc); + + if(sfw) + ok(GetForegroundWindow()==hwnd2,"Expected the second windows (%p) for foreground, received the main one (%p)\n",hwnd2, hwnd); + /* Set the focus window */ rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_SETFOCUSWINDOW | DDSCL_CREATEDEVICEWINDOW); @@ -681,7 +712,7 @@ static void testcooperativelevels_normal(void) static void testcooperativelevels_exclusive(void) { - BOOL success; + BOOL sfw, success; HRESULT rc; RECT window_rect; @@ -702,11 +733,21 @@ static void testcooperativelevels_exclusive(void) ok(rc==DDERR_INVALIDPARAMS,"SetCooperativeLevel(DDSCL_FULLSCREEN) returned: %x\n",rc); /* Full screen mode + exclusive mode */ + sfw=FALSE; + if(hwnd2) + sfw=SetForegroundWindow(hwnd2); + else + skip("Failed to create the second window\n"); + rc = IDirectDraw_SetCooperativeLevel(lpDD, hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); ok(rc==DD_OK,"SetCooperativeLevel(DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) returned: %x\n",rc); - GetClientRect(hwnd, &window_rect); + + if(sfw) + ok(GetForegroundWindow()==hwnd,"Expected the main windows (%p) for foreground, received the second one (%p)\n",hwnd, hwnd2); + /* rect_before_create is assumed to hold the screen rect */ + GetClientRect(hwnd, &window_rect); rc = EqualRect(&rect_before_create, &window_rect); todo_wine ok(rc!=0, "Fullscreen window has wrong size\n"); @@ -783,9 +824,36 @@ START_TEST(ddrawmodes) { init_function_pointers(); - createwindow(); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = DefWindowProcA; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandleA(0); + wc.hIcon = LoadIconA(wc.hInstance, IDI_APPLICATION); + wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hbrBackground = GetStockObject(BLACK_BRUSH); + wc.lpszMenuName = NULL; + wc.lpszClassName = "TestWindowClass"; + if (!RegisterClassA(&wc)) + { + skip("RegisterClassA failed\n"); + return; + } + + hwnd2=createwindow(); + hwnd=createwindow(); + + if (!hwnd) + { + skip("Failed to create the main window\n"); + return; + } + if (!createdirectdraw()) + { + skip("Failed to create the direct draw object\n"); return; + } test_DirectDrawEnumerateA(); test_DirectDrawEnumerateW();
1
0
0
0
Eric Pouech : msvcrt: Use parameter checking macros in vsn(w)printf_s_l.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 5d4de2ac45574c94a40ae1d09098bf347cff2dfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d4de2ac45574c94a40ae1d09…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:42 2010 +0200 msvcrt: Use parameter checking macros in vsn(w)printf_s_l. --- dlls/msvcrt/wcs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index a100f31..1042008 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1050,7 +1050,7 @@ int CDECL MSVCRT_vsnprintf_s_l( char *str, MSVCRT_size_t sizeOfBuffer, if(ret<0 || ret==len) { if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) { - MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 ); + MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small"); *MSVCRT__errno() = MSVCRT_ERANGE; memset(str, 0, sizeOfBuffer); } else @@ -1188,7 +1188,7 @@ int CDECL MSVCRT_vsnwprintf_s_l( MSVCRT_wchar_t *str, MSVCRT_size_t sizeOfBuffer if(ret<0 || ret==len) { if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) { - MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 ); + MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small"); *MSVCRT__errno() = MSVCRT_ERANGE; memset(str, 0, sizeOfBuffer*sizeof(MSVCRT_wchar_t)); } else
1
0
0
0
Eric Pouech : msvcrt: Use parameter checking macros in wcstombs_s_l.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 4c337fb49164611a0b1842b1e7361e34768de968 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c337fb49164611a0b1842b1e…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:36 2010 +0200 msvcrt: Use parameter checking macros in wcstombs_s_l. --- dlls/msvcrt/wcs.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 3dcfa1a..a100f31 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -298,8 +298,7 @@ MSVCRT_size_t CDECL MSVCRT__wcstombs_s_l(MSVCRT_size_t *ret, char *mbstr, return 0; } - if(!wcstr || !mbstr) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(wcstr != NULL) || !MSVCRT_CHECK_PMT(mbstr != NULL)) { if(mbstr && size) mbstr[0] = '\0'; *MSVCRT__errno() = MSVCRT_EINVAL; @@ -317,7 +316,7 @@ MSVCRT_size_t CDECL MSVCRT__wcstombs_s_l(MSVCRT_size_t *ret, char *mbstr, else if(conv==size && (count==MSVCRT__TRUNCATE || mbstr[conv-1]=='\0')) mbstr[conv-1] = '\0'; else { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + MSVCRT_INVALID_PMT("mbstr[size] is too small"); if(size) mbstr[0] = '\0'; *MSVCRT__errno() = MSVCRT_ERANGE;
1
0
0
0
Eric Pouech : msvcrt: Use parameter checking macros for wcsto{number} functions.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 16c89a543a3b018da4018dc982c70ff2f4f005c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16c89a543a3b018da4018dc98…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:30 2010 +0200 msvcrt: Use parameter checking macros for wcsto{number} functions. --- dlls/msvcrt/wcs.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index d7d2fd4..3dcfa1a 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -135,8 +135,7 @@ double CDECL MSVCRT__wcstod_l(const MSVCRT_wchar_t* str, MSVCRT_wchar_t** end, double ret; BOOL found_digit = FALSE; - if(!str) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(str != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return 0; } @@ -1642,8 +1641,9 @@ __int64 CDECL MSVCRT__wcstoi64_l(const MSVCRT_wchar_t *nptr, TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale); - if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { + *MSVCRT__errno() = MSVCRT_EINVAL; return 0; } @@ -1724,8 +1724,9 @@ unsigned __int64 CDECL MSVCRT__wcstoui64_l(const MSVCRT_wchar_t *nptr, TRACE("(%s %p %d %p)\n", debugstr_w(nptr), endptr, base, locale); - if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { + *MSVCRT__errno() = MSVCRT_EINVAL; return 0; }
1
0
0
0
Eric Pouech : msvcrt: Use parameter checking macros for string to number functions.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 1da9922ac322a8917d72719ce91395eefdcb9375 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1da9922ac322a8917d72719ce…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:25 2010 +0200 msvcrt: Use parameter checking macros for string to number functions. --- dlls/msvcrt/string.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index fb02bd5..6b3725f 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -206,8 +206,7 @@ double CDECL MSVCRT_strtod_l( const char *str, char **end, MSVCRT__locale_t loca double ret; BOOL found_digit = FALSE; - if(!str) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(str != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return 0; } @@ -529,8 +528,8 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR TRACE("(%s %p %d %p)\n", nptr, endptr, base, locale); - if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { return 0; } @@ -609,8 +608,8 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b TRACE("(%s %p %d %p)\n", nptr, endptr, base, locale); - if(!nptr || base<0 || base>36 || base==1) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(nptr != NULL) || !MSVCRT_CHECK_PMT(base == 0 || base >= 2) || + !MSVCRT_CHECK_PMT(base <= 36)) { return 0; }
1
0
0
0
Eric Pouech : msvcrt: Use parameter checking macros for strtok_s.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 14187ed2aa9b2d42295519a895b511aa9bbfade0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14187ed2aa9b2d42295519a89…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:14 2010 +0200 msvcrt: Use parameter checking macros for strtok_s. --- dlls/msvcrt/string.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 944c7e6..fb02bd5 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -152,8 +152,8 @@ char * CDECL MSVCRT_strtok( char *str, const char *delim ) */ char * CDECL MSVCRT_strtok_s(char *str, const char *delim, char **ctx) { - if(!delim || !ctx || (!str && !*ctx)) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(delim != NULL) || !MSVCRT_CHECK_PMT(ctx != NULL) || + !MSVCRT_CHECK_PMT(str != NULL || *ctx != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return NULL; }
1
0
0
0
Eric Pouech : msvcrt: Use parameter validation macros for mcstowcs_s_l.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 8583bd317e25e42df592de56249997bb931a465a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8583bd317e25e42df592de562…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:08 2010 +0200 msvcrt: Use parameter validation macros for mcstowcs_s_l. --- dlls/msvcrt/mbcs.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index d92365f..5767242 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -1824,8 +1824,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr, return 0; } - if(!mbstr || !wcstr) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if(!MSVCRT_CHECK_PMT(mbstr != NULL) || !MSVCRT_CHECK_PMT(wcstr != NULL)) { if(wcstr && size) wcstr[0] = '\0'; *MSVCRT__errno() = MSVCRT_EINVAL; @@ -1843,7 +1842,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr, else if(conv==size && (count==MSVCRT__TRUNCATE || wcstr[conv-1]=='\0')) wcstr[conv-1] = '\0'; else { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + MSVCRT_INVALID_PMT("wcstr[size] is too small"); if(size) wcstr[0] = '\0'; *MSVCRT__errno() = MSVCRT_ERANGE;
1
0
0
0
Eric Pouech : msvcrt: Use the parameter checking macros for strncpy_s.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: c10a6d74d5a0df8dce3e54dec2ae98706c9b8d1d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c10a6d74d5a0df8dce3e54dec…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:39:03 2010 +0200 msvcrt: Use the parameter checking macros for strncpy_s. --- dlls/msvcrt/heap.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c index b1d4076..548dd82 100644 --- a/dlls/msvcrt/heap.c +++ b/dlls/msvcrt/heap.c @@ -572,8 +572,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements, if(!count) return 0; - if(!dest || !src || !numberOfElements) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(dest != NULL) || !MSVCRT_CHECK_PMT(src != NULL) || !MSVCRT_CHECK_PMT(numberOfElements != 0)) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL; } @@ -591,7 +590,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements, return 0; } - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + MSVCRT_INVALID_PMT("dest[numberOfElements] is too small"); dest[0] = '\0'; *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL;
1
0
0
0
Eric Pouech : msvcrt: Use the new parameter checking macros for f(w) open_s functions.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 00f07046c0be658d97c47f69e1b4c518bc06b3a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00f07046c0be658d97c47f69e…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:38:57 2010 +0200 msvcrt: Use the new parameter checking macros for f(w)open_s functions. --- dlls/msvcrt/file.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index f906401..3eb93ac 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2686,8 +2686,8 @@ MSVCRT_FILE * CDECL MSVCRT_fopen(const char *path, const char *mode) int CDECL MSVCRT_fopen_s(MSVCRT_FILE** pFile, const char *filename, const char *mode) { - if(!pFile) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(pFile != NULL) || !MSVCRT_CHECK_PMT(filename != NULL) || + MSVCRT_CHECK_PMT(mode != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL; } @@ -2713,8 +2713,8 @@ MSVCRT_FILE * CDECL MSVCRT__wfopen(const MSVCRT_wchar_t *path, const MSVCRT_wcha int CDECL MSVCRT__wfopen_s(MSVCRT_FILE** pFile, const MSVCRT_wchar_t *filename, const MSVCRT_wchar_t *mode) { - if(!pFile) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(pFile != NULL) || !MSVCRT_CHECK_PMT(filename != NULL) || + MSVCRT_CHECK_PMT(mode != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL; }
1
0
0
0
Eric Pouech : msvcrt: Moved _get_osplatform to the new macros for parameters validation.
by Alexandre Julliard
01 Nov '10
01 Nov '10
Module: wine Branch: master Commit: 4b9489074115d790cc91bd867c9d85e2f50a2627 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b9489074115d790cc91bd867…
Author: Eric Pouech <eric.pouech(a)orange.fr> Date: Fri Oct 29 15:38:51 2010 +0200 msvcrt: Moved _get_osplatform to the new macros for parameters validation. --- dlls/msvcrt/data.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/data.c b/dlls/msvcrt/data.c index 068b29f..53dd114 100644 --- a/dlls/msvcrt/data.c +++ b/dlls/msvcrt/data.c @@ -228,15 +228,14 @@ MSVCRT_wchar_t*** CDECL __p___winitenv(void) { return &MSVCRT___winitenv; } /********************************************************************* * _get_osplatform (MSVCRT.@) */ -int CDECL MSVCRT__get_osplatform(int *ret) +int CDECL MSVCRT__get_osplatform(int *pValue) { - if(!ret) { - MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0); + if (!MSVCRT_CHECK_PMT(pValue != NULL)) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL; } - *ret = MSVCRT__osplatform; + *pValue = MSVCRT__osplatform; return 0; }
1
0
0
0
← Newer
1
...
80
81
82
83
84
85
86
87
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
85
86
87
Results per page:
10
25
50
100
200