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
June 2015
----- 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
610 discussions
Start a n
N
ew thread
Nikolay Sivov : mshtml: Handle allocation failure during collection creation (Coverity).
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: a260d3efc625e763c12986cc101a113ca1e4bd73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a260d3efc625e763c12986cc1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 3 14:36:02 2015 +0300 mshtml: Handle allocation failure during collection creation (Coverity). --- dlls/mshtml/htmlelemcol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index a57f39e..c6c65b1 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -824,6 +824,9 @@ static IHTMLElementCollection *HTMLElementCollection_Create(HTMLElement **elems, { HTMLElementCollection *ret = heap_alloc_zero(sizeof(HTMLElementCollection)); + if (!ret) + return NULL; + ret->IHTMLElementCollection_iface.lpVtbl = &HTMLElementCollectionVtbl; ret->ref = 1; ret->elems = elems;
1
0
0
0
Nikolay Sivov : winebuild: Remove always false condition (Coverity).
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: 233c8c163b28bb1dddc09d75eb03a257b92504f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=233c8c163b28bb1dddc09d75e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 3 14:25:52 2015 +0300 winebuild: Remove always false condition (Coverity). --- tools/winebuild/spec32.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 98060b5..c27f0dd 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -863,8 +863,6 @@ void output_def_file( DLLSPEC *spec, int include_private ) const ORDDEF *odp = &spec->entry_points[i]; int is_data = 0; - if (!odp) continue; - if (odp->name) name = odp->name; else if (odp->export_name) name = odp->export_name; else continue;
1
0
0
0
Piotr Caban : msvcrt: Get rid of msvcrt_is_valid_fd helper.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: bd6eaf918c50642423b00b4be8eaa933a9e77135 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd6eaf918c50642423b00b4be…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:26:00 2015 +0200 msvcrt: Get rid of msvcrt_is_valid_fd helper. --- dlls/msvcrt/file.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 1d144b2..5644a61 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -304,11 +304,6 @@ static inline MSVCRT_FILE* msvcrt_get_file(int i) return &ret->file; } -static inline BOOL msvcrt_is_valid_fd(int fd) -{ - return fd >= 0 && fd < MSVCRT_fdend && (get_ioinfo_nolock(fd)->wxflag & WX_OPEN); -} - /* INTERNAL: free a file entry fd */ static void msvcrt_free_fd(int fd) { @@ -454,7 +449,7 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void) static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags) { TRACE(":fd (%d) allocating FILE*\n",fd); - if (!msvcrt_is_valid_fd(fd)) + if (!(get_ioinfo_nolock(fd)->wxflag & WX_OPEN)) { WARN(":invalid fd %d\n",fd); *MSVCRT___doserrno() = 0;
1
0
0
0
Piotr Caban : msvcrt: Use fd critical section in msvcrt_create_io_inherit_block.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: 9ce2a8a60c14cfeac737f8dcfad8f8325265405a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ce2a8a60c14cfeac737f8dcf…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:52 2015 +0200 msvcrt: Use fd critical section in msvcrt_create_io_inherit_block. --- dlls/msvcrt/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index d7a8f3a..1d144b2 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -498,7 +498,7 @@ unsigned msvcrt_create_io_inherit_block(WORD *size, BYTE **block) for (fd = 0; fd < MSVCRT_fdend; fd++) { /* to be inherited, we need it to be open, and that DONTINHERIT isn't set */ - fdinfo = get_ioinfo_nolock(fd); + fdinfo = get_ioinfo(fd); if ((fdinfo->wxflag & (WX_OPEN | WX_DONTINHERIT)) == WX_OPEN) { *wxflag_ptr = fdinfo->wxflag; @@ -509,6 +509,7 @@ unsigned msvcrt_create_io_inherit_block(WORD *size, BYTE **block) *wxflag_ptr = 0; *handle_ptr = INVALID_HANDLE_VALUE; } + release_ioinfo(fdinfo); wxflag_ptr++; handle_ptr++; } return TRUE;
1
0
0
0
Piotr Caban : msvcrt: Get rid of msvcrt_fdtoh helper.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: 86baccc9ae9f79cc542c53e31edfdc9bf8f99a8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=86baccc9ae9f79cc542c53e31…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:47 2015 +0200 msvcrt: Get rid of msvcrt_fdtoh helper. --- dlls/msvcrt/file.c | 24 +++--------------------- dlls/msvcrt/tests/file.c | 5 +++++ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 7bdb468..d7a8f3a 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -309,26 +309,6 @@ static inline BOOL msvcrt_is_valid_fd(int fd) return fd >= 0 && fd < MSVCRT_fdend && (get_ioinfo_nolock(fd)->wxflag & WX_OPEN); } -/* INTERNAL: Get the HANDLE for a fd - * This doesn't lock the table, because a failure will result in - * INVALID_HANDLE_VALUE being returned, which should be handled correctly. If - * it returns a valid handle which is about to be closed, a subsequent call - * will fail, most likely in a sane way. - */ -static HANDLE msvcrt_fdtoh(int fd) -{ - if (!msvcrt_is_valid_fd(fd)) - { - WARN(":fd (%d) - no handle!\n",fd); - *MSVCRT___doserrno() = 0; - *MSVCRT__errno() = MSVCRT_EBADF; - return INVALID_HANDLE_VALUE; - } - if (get_ioinfo_nolock(fd)->handle == INVALID_HANDLE_VALUE) - WARN("returning INVALID_HANDLE_VALUE for %d\n", fd); - return get_ioinfo_nolock(fd)->handle; -} - /* INTERNAL: free a file entry fd */ static void msvcrt_free_fd(int fd) { @@ -1848,9 +1828,11 @@ int CDECL _futime(int fd, struct MSVCRT___utimbuf32 *t) */ MSVCRT_intptr_t CDECL MSVCRT__get_osfhandle(int fd) { - HANDLE hand = msvcrt_fdtoh(fd); + HANDLE hand = get_ioinfo_nolock(fd)->handle; TRACE(":fd (%d) handle (%p)\n",fd,hand); + if(hand == INVALID_HANDLE_VALUE) + *MSVCRT__errno() = MSVCRT_EBADF; return (MSVCRT_intptr_t)hand; } diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 860db6a..c4d8fa1 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -1850,6 +1850,11 @@ static void test_get_osfhandle(void) _close(fd); _unlink(fname); + + errno = 0xdeadbeef; + handle = (HANDLE)_get_osfhandle(fd); + ok(handle == INVALID_HANDLE_VALUE, "_get_osfhandle returned %p\n", handle); + ok(errno == EBADF, "errno = %d\n", errno); } static void test_setmaxstdio(void)
1
0
0
0
Piotr Caban : msvcrt: Use fd critical section in _futime64.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: 9278190d4689f0b2a9f52948975f018b5cec515e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9278190d4689f0b2a9f529489…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:40 2015 +0200 msvcrt: Use fd critical section in _futime64. --- dlls/msvcrt/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 25c5626..7bdb468 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1788,7 +1788,7 @@ int CDECL MSVCRT__fstat64i32(int fd, struct MSVCRT__stat64i32* buf) */ int CDECL _futime64(int fd, struct MSVCRT___utimbuf64 *t) { - HANDLE hand = msvcrt_fdtoh(fd); + ioinfo *info = get_ioinfo(fd); FILETIME at, wt; if (!t) @@ -1802,11 +1802,13 @@ int CDECL _futime64(int fd, struct MSVCRT___utimbuf64 *t) time_to_filetime( t->modtime, &wt ); } - if (!SetFileTime(hand, NULL, &at, &wt)) + if (!SetFileTime(info->handle, NULL, &at, &wt)) { + release_ioinfo(info); msvcrt_set_errno(GetLastError()); return -1 ; } + release_ioinfo(info); return 0; }
1
0
0
0
Piotr Caban : msvcrt: Use fd critical section in read.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: 16285f5700ff713d376b930e3bd6963d821931f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16285f5700ff713d376b930e3…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:35 2015 +0200 msvcrt: Use fd critical section in read. --- dlls/msvcrt/file.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 616e205..25c5626 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2468,9 +2468,8 @@ static inline int get_utf8_char_len(char ch) /********************************************************************* * (internal) read_utf8 */ -static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count) +static int read_utf8(ioinfo *fdinfo, MSVCRT_wchar_t *buf, unsigned int count) { - ioinfo *fdinfo = get_ioinfo_nolock(fd); HANDLE hand = fdinfo->handle; char min_buf[4], *readbuf, lookahead; DWORD readbuf_size, pos=0, num_read=1, char_len, i, j; @@ -2645,12 +2644,10 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count) * the file pointer on the \r character while getc() goes on to * the following \n */ -static int read_i(int fd, void *buf, unsigned int count) +static int read_i(int fd, ioinfo *fdinfo, void *buf, unsigned int count) { DWORD num_read, utf16; char *bufstart = buf; - HANDLE hand = msvcrt_fdtoh(fd); - ioinfo *fdinfo = get_ioinfo_nolock(fd); if (count == 0) return 0; @@ -2661,8 +2658,8 @@ static int read_i(int fd, void *buf, unsigned int count) } /* Don't trace small reads, it gets *very* annoying */ if (count > 4) - TRACE(":fd (%d) handle (%p) buf (%p) len (%d)\n",fd,hand,buf,count); - if (hand == INVALID_HANDLE_VALUE) + TRACE(":fd (%d) handle (%p) buf (%p) len (%d)\n", fd, fdinfo->handle, buf, count); + if (fdinfo->handle == INVALID_HANDLE_VALUE) { *MSVCRT__errno() = MSVCRT_EBADF; return -1; @@ -2676,9 +2673,9 @@ static int read_i(int fd, void *buf, unsigned int count) } if((fdinfo->wxflag&WX_TEXT) && (fdinfo->exflag&EF_UTF8)) - return read_utf8(fd, buf, count); + return read_utf8(fdinfo, buf, count); - if (fdinfo->lookahead[0]!='\n' || ReadFile(hand, bufstart, count, &num_read, NULL)) + if (fdinfo->lookahead[0]!='\n' || ReadFile(fdinfo->handle, bufstart, count, &num_read, NULL)) { if (fdinfo->lookahead[0] != '\n') { @@ -2691,7 +2688,7 @@ static int read_i(int fd, void *buf, unsigned int count) fdinfo->lookahead[1] = '\n'; } - if(count>1+utf16 && ReadFile(hand, bufstart+1+utf16, count-1-utf16, &num_read, NULL)) + if(count>1+utf16 && ReadFile(fdinfo->handle, bufstart+1+utf16, count-1-utf16, &num_read, NULL)) num_read += 1+utf16; else num_read = 1+utf16; @@ -2736,7 +2733,7 @@ static int read_i(int fd, void *buf, unsigned int count) DWORD len; lookahead[1] = '\n'; - if (ReadFile(hand, lookahead, 1+utf16, &len, NULL) && len) + if (ReadFile(fdinfo->handle, lookahead, 1+utf16, &len, NULL) && len) { if(lookahead[0]=='\n' && (!utf16 || lookahead[1]==0) && j==0) { @@ -2809,9 +2806,10 @@ static int read_i(int fd, void *buf, unsigned int count) */ int CDECL MSVCRT__read(int fd, void *buf, unsigned int count) { - int num_read; - num_read = read_i(fd, buf, count); - return num_read; + ioinfo *info = get_ioinfo(fd); + int num_read = read_i(fd, info, buf, count); + release_ioinfo(info); + return num_read; } /********************************************************************* @@ -3558,14 +3556,14 @@ int CDECL MSVCRT__filbuf(MSVCRT_FILE* file) if(!(file->_flag & (MSVCRT__IOMYBUF | MSVCRT__USERBUF))) { int r; - if ((r = read_i(file->_file,&c,1)) != 1) { + if ((r = MSVCRT__read(file->_file,&c,1)) != 1) { file->_flag |= (r == 0) ? MSVCRT__IOEOF : MSVCRT__IOERR; return MSVCRT_EOF; } return c; } else { - file->_cnt = read_i(file->_file, file->_base, file->_bufsiz); + file->_cnt = MSVCRT__read(file->_file, file->_base, file->_bufsiz); if(file->_cnt<=0) { file->_flag |= (file->_cnt == 0) ? MSVCRT__IOEOF : MSVCRT__IOERR; file->_cnt = 0;
1
0
0
0
Piotr Caban : msvcrt: Use fd critical section in msvcrt_free_fd.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: b052afd4afab68eb9319e2b19fb18152f395b409 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b052afd4afab68eb9319e2b19…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:23 2015 +0200 msvcrt: Use fd critical section in msvcrt_free_fd. --- dlls/msvcrt/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 1077752..616e205 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -332,10 +332,8 @@ static HANDLE msvcrt_fdtoh(int fd) /* INTERNAL: free a file entry fd */ static void msvcrt_free_fd(int fd) { - ioinfo *fdinfo; + ioinfo *fdinfo = get_ioinfo(fd); - LOCK_FILES(); - fdinfo = get_ioinfo_nolock(fd); if(fdinfo != &MSVCRT___badioinfo) { fdinfo->handle = INVALID_HANDLE_VALUE; @@ -358,7 +356,9 @@ static void msvcrt_free_fd(int fd) break; } } + release_ioinfo(fdinfo); + LOCK_FILES(); if (fd == MSVCRT_fdend - 1) MSVCRT_fdend--; if (fd < MSVCRT_fdstart)
1
0
0
0
Piotr Caban : msvcrt: Use fd critical section in dup2.
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: c7b0fb51543a166508dbbc28945b163bba4713d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7b0fb51543a166508dbbc289…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jun 3 13:25:10 2015 +0200 msvcrt: Use fd critical section in dup2. --- dlls/msvcrt/file.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c1ba5fd..1077752 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -260,8 +260,15 @@ static inline ioinfo* get_ioinfo_nolock(int fd) static inline ioinfo* get_ioinfo(int fd) { ioinfo *ret = get_ioinfo_nolock(fd); - if(ret->exflag & EF_CRIT_INIT) - EnterCriticalSection(&ret->crit); + if(!(ret->exflag & EF_CRIT_INIT)) { + LOCK_FILES(); + if(!(ret->exflag & EF_CRIT_INIT)) { + InitializeCriticalSection(&ret->crit); + ret->exflag |= EF_CRIT_INIT; + } + UNLOCK_FILES(); + } + EnterCriticalSection(&ret->crit); return ret; } @@ -1016,20 +1023,33 @@ int CDECL MSVCRT__close(int fd) */ int CDECL MSVCRT__dup2(int od, int nd) { + ioinfo *info_od, *info_nd; int ret; TRACE("(od=%d, nd=%d)\n", od, nd); LOCK_FILES(); - if (nd < MSVCRT_MAX_FILES && nd >= 0 && msvcrt_is_valid_fd(od)) + + if (od < nd) + { + info_od = get_ioinfo(od); + info_nd = get_ioinfo(nd); + } + else + { + info_nd = get_ioinfo(nd); + info_od = get_ioinfo(od); + } + + if (nd < MSVCRT_MAX_FILES && nd >= 0 && (info_od->wxflag & WX_OPEN)) { HANDLE handle; - if (DuplicateHandle(GetCurrentProcess(), get_ioinfo_nolock(od)->handle, + if (DuplicateHandle(GetCurrentProcess(), info_od->handle, GetCurrentProcess(), &handle, 0, TRUE, DUPLICATE_SAME_ACCESS)) { - int wxflag = get_ioinfo_nolock(od)->wxflag & ~MSVCRT__O_NOINHERIT; + int wxflag = info_od->wxflag & ~MSVCRT__O_NOINHERIT; - if (msvcrt_is_valid_fd(nd)) + if (info_nd->wxflag & WX_OPEN) MSVCRT__close(nd); ret = msvcrt_set_fd(handle, wxflag, nd); if (ret == -1) @@ -1054,6 +1074,9 @@ int CDECL MSVCRT__dup2(int od, int nd) *MSVCRT__errno() = MSVCRT_EBADF; ret = -1; } + + release_ioinfo(info_od); + release_ioinfo(info_nd); UNLOCK_FILES(); return ret; }
1
0
0
0
Nikolay Sivov : winex11: Remove unreachable XFreePixmap(), mask_pixmap is always NULL on failure (Coverity).
by Alexandre Julliard
03 Jun '15
03 Jun '15
Module: wine Branch: master Commit: c0af3fad4ef02ac82e472f05048e866506aae589 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0af3fad4ef02ac82e472f050…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 3 13:52:11 2015 +0300 winex11: Remove unreachable XFreePixmap(), mask_pixmap is always NULL on failure (Coverity). --- dlls/winex11.drv/window.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ea37dd7..14dc44c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -573,7 +573,6 @@ static BOOL create_icon_pixmaps( HDC hdc, const ICONINFO *icon, Pixmap *icon_ret failed: if (color_pixmap) XFreePixmap( gdi_display, color_pixmap ); - if (mask_pixmap) XFreePixmap( gdi_display, mask_pixmap ); HeapFree( GetProcessHeap(), 0, bits.ptr ); return FALSE; }
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
61
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
Results per page:
10
25
50
100
200