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 2014
----- 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
378 discussions
Start a n
N
ew thread
Alexander Almaleh : gdi32: Fix XFORM.eM22 calculation in PlgBlt.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 8762842cd337a809a6504420da2aeeeb5d3618b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8762842cd337a809a6504420d…
Author: Alexander Almaleh <sashoalm(a)gmail.com> Date: Thu Jun 26 14:56:49 2014 +0300 gdi32: Fix XFORM.eM22 calculation in PlgBlt. --- dlls/gdi32/bitblt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index 4750d1b..762ca0f 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -1037,7 +1037,7 @@ BOOL WINAPI PlgBlt( HDC hdcDest, const POINT *lpPoint, /* Y components */ xf.eM12 = (plg[1].y*(rect[2].y - rect[0].y) - plg[2].y*(rect[1].y - rect[0].y) - plg[0].y*(rect[2].y - rect[1].y)) / det; - xf.eM22 = (plg[1].x*(rect[2].y - rect[0].y) - plg[2].x*(rect[1].y - rect[0].y) - plg[0].x*(rect[2].y - rect[1].y)) / det; + xf.eM22 = (rect[1].x*(plg[2].y - plg[0].y) - rect[2].x*(plg[1].y - plg[0].y) - rect[0].x*(plg[2].y - plg[1].y)) / det; xf.eDy = (rect[0].x*(rect[1].y*plg[2].y - rect[2].y*plg[1].y) - rect[1].x*(rect[0].y*plg[2].y - rect[2].y*plg[0].y) + rect[2].x*(rect[0].y*plg[1].y - rect[1].y*plg[0].y)
1
0
0
0
Matteo Bruni : d3dx9: Correctly set parent_data for direct includes from the main file.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: d64ec66b416a9ee0ecff5a5a1387f67b1387fa7f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d64ec66b416a9ee0ecff5a5a1…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Thu Jun 26 19:52:33 2014 +0200 d3dx9: Correctly set parent_data for direct includes from the main file. --- dlls/d3dx9_36/shader.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 68e7474..b36e7bb 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -219,6 +219,20 @@ HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMAC return hr; } +static const void *main_file_data; + +static CRITICAL_SECTION from_file_mutex; +static CRITICAL_SECTION_DEBUG from_file_mutex_debug = +{ + 0, 0, &from_file_mutex, + { + &from_file_mutex_debug.ProcessLocksList, + &from_file_mutex_debug.ProcessLocksList + }, + 0, 0, {(DWORD_PTR)(__FILE__ ": from_file_mutex")} +}; +static CRITICAL_SECTION from_file_mutex = {&from_file_mutex_debug, -1, 0, 0, 0, 0}; + /* D3DXInclude private implementation, used to implement * D3DXAssembleShaderFromFile() from D3DXAssembleShader(). */ /* To be able to correctly resolve include search paths we have to store the @@ -233,8 +247,15 @@ static HRESULT WINAPI d3dincludefromfile_open(ID3DXInclude *iface, D3DXINCLUDE_T HANDLE file; UINT size; - if(parent_data != NULL) + if (parent_data) + { parent_name = *((const char **)parent_data - 1); + } + else + { + if (main_file_data) + parent_name = *((const char **)main_file_data - 1); + } TRACE("Looking up for include file %s, parent %s\n", debugstr_a(filename), debugstr_a(parent_name)); @@ -265,6 +286,8 @@ static HRESULT WINAPI d3dincludefromfile_open(ID3DXInclude *iface, D3DXINCLUDE_T goto error; *data = buffer + 1; + if (!main_file_data) + main_file_data = *data; CloseHandle(file); return S_OK; @@ -280,6 +303,8 @@ static HRESULT WINAPI d3dincludefromfile_close(ID3DXInclude *iface, const void * { HeapFree(GetProcessHeap(), 0, *((char **)data - 1)); HeapFree(GetProcessHeap(), 0, (char **)data - 1); + if (main_file_data == data) + main_file_data = NULL; return S_OK; } @@ -339,9 +364,11 @@ HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACR return E_OUTOFMEMORY; WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL); + EnterCriticalSection(&from_file_mutex); hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); if (FAILED(hr)) { + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return D3DXERR_INVALIDDATA; } @@ -349,6 +376,7 @@ HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACR hr = D3DXAssembleShader(buffer, len, defines, include, flags, shader, error_messages); ID3DXInclude_Close(include, buffer); + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return hr; } @@ -471,9 +499,11 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO return E_OUTOFMEMORY; WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, filename_len, NULL, NULL); + EnterCriticalSection(&from_file_mutex); hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); if (FAILED(hr)) { + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return D3DXERR_INVALIDDATA; } @@ -487,6 +517,7 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO constant_table); ID3DXInclude_Close(include, buffer); + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return hr; } @@ -591,9 +622,11 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMA return E_OUTOFMEMORY; WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL); + EnterCriticalSection(&from_file_mutex); hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); if (FAILED(hr)) { + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return D3DXERR_INVALIDDATA; } @@ -604,6 +637,7 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMA (ID3DBlob **)shader, (ID3DBlob **)error_messages); ID3DXInclude_Close(include, buffer); + LeaveCriticalSection(&from_file_mutex); HeapFree(GetProcessHeap(), 0, filename_a); return hr; }
1
0
0
0
Matteo Bruni : wpp: Correctly handle OOM in pop_buffer().
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: b5db97ac51cf3ec962d7f26c87130c1b5ac747b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5db97ac51cf3ec962d7f26c8…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Thu Jun 26 19:52:32 2014 +0200 wpp: Correctly handle OOM in pop_buffer(). --- libs/wpp/ppl.l | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 0ce64c2..243049a 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -1354,19 +1354,20 @@ static bufferstackentry_t *pop_buffer(void) if(ppp) { iep = pp_xmalloc(sizeof(includelogicentry_t)); - if(!iep) - return NULL; - - iep->ppp = ppp; - ppp->iep = iep; - iep->filename = bufferstack[bufferstackidx].include_filename; - iep->prev = NULL; - iep->next = pp_includelogiclist; - if(iep->next) - iep->next->prev = iep; - pp_includelogiclist = iep; - if(pp_status.debug) - fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename); + if (iep) + { + iep->ppp = ppp; + ppp->iep = iep; + iep->filename = bufferstack[bufferstackidx].include_filename; + iep->prev = NULL; + iep->next = pp_includelogiclist; + if(iep->next) + iep->next->prev = iep; + pp_includelogiclist = iep; + if(pp_status.debug) + fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", + bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename); + } } } free(pp_incl_state.ppp);
1
0
0
0
Matteo Bruni : wpp: Free some filename strings after processing an include (Valgrind).
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 1b79df4e80c4135217ea56a20ab6c3dee5144b2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1b79df4e80c4135217ea56a20…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Thu Jun 26 19:52:31 2014 +0200 wpp: Free some filename strings after processing an include (Valgrind). --- libs/wpp/ppl.l | 16 +++++++++++----- libs/wpp/wpp.c | 8 ++++++-- libs/wpp/wpp_private.h | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 9655e34..0ce64c2 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -213,7 +213,7 @@ typedef struct bufferstackentry { pp_entry_t *define; /* Points to expanding define or NULL if handling includes */ int line_number; /* Line that we were handling */ int char_number; /* The current position on that line */ - const char *filename; /* Filename that we were handling */ + char *filename; /* Filename that we were handling */ int if_depth; /* How many #if:s deep to check matching #endif:s */ int ncontinuations; /* Remember the continuation state */ int should_pop; /* Set if we must pop the start-state on EOF */ @@ -1340,6 +1340,8 @@ static bufferstackentry_t *pop_buffer(void) bufferstack[bufferstackidx].define->expanding = 0; else { + includelogicentry_t *iep = NULL; + if(!bufferstack[bufferstackidx].should_pop) { wpp_callbacks->close(pp_status.file); @@ -1351,7 +1353,7 @@ static bufferstackentry_t *pop_buffer(void) pp_entry_t *ppp = pplookup(pp_incl_state.ppp); if(ppp) { - includelogicentry_t *iep = pp_xmalloc(sizeof(includelogicentry_t)); + iep = pp_xmalloc(sizeof(includelogicentry_t)); if(!iep) return NULL; @@ -1366,17 +1368,21 @@ static bufferstackentry_t *pop_buffer(void) if(pp_status.debug) fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename); } - else - free(bufferstack[bufferstackidx].include_filename); } free(pp_incl_state.ppp); pp_incl_state = bufferstack[bufferstackidx].incl; } + if (bufferstack[bufferstackidx].include_filename) + { + free(pp_status.input); + pp_status.input = bufferstack[bufferstackidx].filename; + } pp_status.line_number = bufferstack[bufferstackidx].line_number; pp_status.char_number = bufferstack[bufferstackidx].char_number; - pp_status.input = bufferstack[bufferstackidx].filename; ncontinuations = bufferstack[bufferstackidx].ncontinuations; + if (!iep) + free(bufferstack[bufferstackidx].include_filename); } if(ppy_debug) diff --git a/libs/wpp/wpp.c b/libs/wpp/wpp.c index 66eb026..60b2d38 100644 --- a/libs/wpp/wpp.c +++ b/libs/wpp/wpp.c @@ -206,7 +206,7 @@ int wpp_parse( const char *input, FILE *output ) return 2; } - pp_status.input = input; + pp_status.input = input ? pp_xstrdup(input) : NULL; ppy_out = output; pp_writestring("# 1 \"%s\" 1\n", input ? input : ""); @@ -215,7 +215,11 @@ int wpp_parse( const char *input, FILE *output ) /* If there were errors during processing, return an error code */ if (!ret && pp_status.state) ret = pp_status.state; - if (input) wpp_callbacks->close(pp_status.file); + if (input) + { + wpp_callbacks->close(pp_status.file); + free(pp_status.input); + } /* Clean if_stack, it could remain dirty on errors */ while (pp_get_if_depth()) pp_pop_if(); del_special_defines(); diff --git a/libs/wpp/wpp_private.h b/libs/wpp/wpp_private.h index 4e2aa5b..caa52b9 100644 --- a/libs/wpp/wpp_private.h +++ b/libs/wpp/wpp_private.h @@ -228,7 +228,7 @@ void pp_internal_error(const char *file, int line, const char *s, ...) __attribu /* everything is in this structure to avoid polluting the global symbol space */ struct pp_status { - const char *input; /* current input file name */ + char *input; /* current input file name */ void *file; /* current input file descriptor */ int line_number; /* current line number */ int char_number; /* current char number in line */
1
0
0
0
Piotr Caban : msvcrt: Support NULL buffer in setvbuf.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 18a416f7d5a7d900aaea784b8298cb8ad5d3d13e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18a416f7d5a7d900aaea784b8…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jun 26 12:29:59 2014 +0200 msvcrt: Support NULL buffer in setvbuf. --- dlls/msvcrt/file.c | 53 ++++++++++++++++++++++++++++++------------------ dlls/msvcrt/msvcrt.h | 1 + dlls/msvcrt/tests/file.c | 4 ++++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index fe2d144..465a417 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -4478,26 +4478,39 @@ int CDECL MSVCRT__wrename(const MSVCRT_wchar_t *oldpath,const MSVCRT_wchar_t *ne */ int CDECL MSVCRT_setvbuf(MSVCRT_FILE* file, char *buf, int mode, MSVCRT_size_t size) { - MSVCRT__lock_file(file); - if(file->_bufsiz) { - if(file->_flag & MSVCRT__IOMYBUF) - MSVCRT_free(file->_base); - file->_flag &= ~MSVCRT__IOMYBUF; - file->_base = file->_ptr = NULL; - file->_bufsiz = 0; - file->_cnt = 0; - } - if(mode == MSVCRT__IOFBF) { - file->_flag &= ~MSVCRT__IONBF; - file->_base = file->_ptr = buf; - if(buf) { - file->_bufsiz = size; - } - } else { - file->_flag |= MSVCRT__IONBF; - } - MSVCRT__unlock_file(file); - return 0; + if(!MSVCRT_CHECK_PMT(file != NULL)) return -1; + if(!MSVCRT_CHECK_PMT(mode==MSVCRT__IONBF || mode==MSVCRT__IOFBF || mode==MSVCRT__IOLBF)) return -1; + if(!MSVCRT_CHECK_PMT(mode==MSVCRT__IONBF || (size>=2 && size<=INT_MAX))) return -1; + + MSVCRT__lock_file(file); + + MSVCRT_fflush(file); + if(file->_flag & MSVCRT__IOMYBUF) + MSVCRT_free(file->_base); + file->_flag &= ~(MSVCRT__IONBF | MSVCRT__IOMYBUF | MSVCRT__USERBUF); + file->_cnt = 0; + + if(mode == MSVCRT__IONBF) { + file->_flag |= MSVCRT__IONBF; + file->_base = file->_ptr = (char*)&file->_charbuf; + file->_bufsiz = 2; + }else if(buf) { + file->_base = file->_ptr = buf; + file->_flag |= MSVCRT__USERBUF; + file->_bufsiz = size; + }else { + file->_base = file->_ptr = malloc(size); + if(!file->_base) { + file->_bufsiz = 0; + MSVCRT__unlock_file(file); + return -1; + } + + file->_flag |= MSVCRT__IOMYBUF; + file->_bufsiz = size; + } + MSVCRT__unlock_file(file); + return 0; } /********************************************************************* diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 22ba0d4..3349c9f 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -740,6 +740,7 @@ struct MSVCRT__stat64 { #define MSVCRT__IOERR 0x0020 #define MSVCRT__IOSTRG 0x0040 #define MSVCRT__IORW 0x0080 +#define MSVCRT__USERBUF 0x0100 #define MSVCRT__IOCOMMIT 0x4000 #define MSVCRT__S_IEXEC 0x0040 diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 422e41d..2fd46f2 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -144,6 +144,9 @@ static void test_fileops( void ) fd = open ("fdopen.tst", O_RDONLY | O_BINARY); file = fdopen (fd, "rb"); setvbuf(file,NULL,bufmodes[bufmode],2048); + if(bufmodes[bufmode] == _IOFBF) + ok(file->_bufsiz == 2048, "file->_bufsiz = %d\n", file->_bufsiz); + ok(file->_base != NULL, "file->_base = NULL\n"); ok(strlen(outbuffer) == (sizeof(outbuffer)-1),"strlen/sizeof error for bufmode=%x\n", bufmodes[bufmode]); ok(fgets(buffer,sizeof(buffer),file) !=0,"fgets failed unexpected for bufmode=%x\n", bufmodes[bufmode]); ok(fgets(buffer,sizeof(buffer),file) ==0,"fgets didn't signal EOF for bufmode=%x\n", bufmodes[bufmode]); @@ -629,6 +632,7 @@ static void test_flsbuf( void ) ok(tempfh->_cnt == 0, "_cnt on freshly opened file was %d\n", tempfh->_cnt); setbuf(tempfh, NULL); ok(tempfh->_cnt == 0, "_cnt on unbuffered file was %d\n", tempfh->_cnt); + ok(tempfh->_bufsiz == 2, "_bufsiz = %d\n", tempfh->_bufsiz); /* Inlined putchar sets _cnt to -1. Native seems to ignore the value... */ tempfh->_cnt = 1234; ret = _flsbuf('Q',tempfh);
1
0
0
0
Piotr Caban : msvcrt: Fix ungetc on files with empty buffer.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 1ae475dae8ea927a659dca762cd3f51b6c894a1c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ae475dae8ea927a659dca762…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jun 26 12:29:54 2014 +0200 msvcrt: Fix ungetc on files with empty buffer. --- dlls/msvcrt/file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 70b908a..fe2d144 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -4859,12 +4859,17 @@ int CDECL MSVCRT_printf_s(const char *format, ...) */ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file) { - if (c == MSVCRT_EOF) + if(!MSVCRT_CHECK_PMT(file != NULL)) return MSVCRT_EOF; + + if (c == MSVCRT_EOF || !(file->_flag&MSVCRT__IOREAD || + (file->_flag&MSVCRT__IORW && !(file->_flag&MSVCRT__IOWRT)))) return MSVCRT_EOF; MSVCRT__lock_file(file); - if(file->_bufsiz == 0 && msvcrt_alloc_buffer(file)) + if((!file->_bufsiz && msvcrt_alloc_buffer(file)) + || (!file->_cnt && file->_ptr==file->_base)) file->_ptr++; + if(file->_ptr>file->_base) { file->_ptr--; if(file->_flag & MSVCRT__IOSTRG) { @@ -4878,6 +4883,7 @@ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file) } file->_cnt++; MSVCRT_clearerr(file); + file->_flag |= MSVCRT__IOREAD; MSVCRT__unlock_file(file); return c; }
1
0
0
0
Piotr Caban : msvcrt: Fix _flsbuf behavior on streams with MSVCRT__IONBF flag.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: f91f24f6e739db14950514db99bab614dd11fe50 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f91f24f6e739db14950514db9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jun 26 12:29:48 2014 +0200 msvcrt: Fix _flsbuf behavior on streams with MSVCRT__IONBF flag. --- dlls/msvcrt/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index b60e306..70b908a 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -3656,7 +3656,7 @@ int CDECL MSVCRT__flsbuf(int c, MSVCRT_FILE* file) else return MSVCRT_EOF; } - if(file->_bufsiz) { + if(file->_bufsiz && !(file->_flag&MSVCRT__IONBF)) { int res = 0; if(file->_cnt <= 0) {
1
0
0
0
Piotr Caban : msvcr110: Add __crtInitializeCriticalSectionEx implementation.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 8715d89c4942bb19914243347d470248b4f8cfe3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8715d89c4942bb19914243347…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jun 26 14:23:07 2014 +0200 msvcr110: Add __crtInitializeCriticalSectionEx implementation. --- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcrt/misc.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 4127725..2f9ad70 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -921,7 +921,7 @@ @ cdecl __crtGetShowWindowMode() MSVCR110__crtGetShowWindowMode @ stub -arch=i386,win64 __crtGetTimeFormatEx @ stub -arch=i386,win64 __crtGetUserDefaultLocaleName -@ stub -arch=i386,win64 __crtInitializeCriticalSectionEx +@ cdecl -arch=i386,win64 __crtInitializeCriticalSectionEx(ptr long long) MSVCR110__crtInitializeCriticalSectionEx @ stub __crtIsPackagedApp @ stub -arch=i386,win64 __crtIsValidLocaleName @ cdecl __crtLCMapStringA(long long str long ptr long long long) diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index 4e67cba..d791699 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -480,3 +480,13 @@ int CDECL MSVCR110__crtGetShowWindowMode(void) TRACE("window=%d\n", si.wShowWindow); return si.wShowWindow; } + +/********************************************************************* + * __crtInitializeCriticalSectionEx (MSVCR110.@) + */ +BOOL CDECL MSVCR110__crtInitializeCriticalSectionEx( + CRITICAL_SECTION *cs, DWORD spin_count, DWORD flags) +{ + TRACE("(%p %x %x)\n", cs, spin_count, flags); + return InitializeCriticalSectionEx(cs, spin_count, flags); +}
1
0
0
0
Piotr Caban : msvcp110: Add _Mtx_{destroy, getconcrtcs, init, lock, unlock, trylock} implementation.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 3fa2bb2dce9b52b24e512580241185888716fc0f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3fa2bb2dce9b52b24e5125802…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jun 26 13:46:09 2014 +0200 msvcp110: Add _Mtx_{destroy,getconcrtcs,init,lock,unlock,trylock} implementation. --- dlls/msvcp110/msvcp110.spec | 12 ++--- dlls/msvcp90/misc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++ dlls/msvcp90/msvcp90.h | 25 +++++++++++ dlls/msvcp90/msvcp_main.c | 32 ++++++++++++++ dlls/msvcrt/lock.c | 1 + 5 files changed, 168 insertions(+), 6 deletions(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 331df11..5fc5348 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -3819,14 +3819,14 @@ @ cdecl _Mbrtowc(ptr ptr long ptr ptr) @ stub _Mtx_clear_owner @ stub _Mtx_current_owns -@ stub _Mtx_destroy -@ stub _Mtx_getconcrtcs -@ stub _Mtx_init -@ stub _Mtx_lock +@ cdecl _Mtx_destroy(ptr) +@ cdecl _Mtx_getconcrtcs(ptr) +@ cdecl _Mtx_init(ptr long) +@ cdecl _Mtx_lock(ptr) @ stub _Mtx_reset_owner @ stub _Mtx_timedlock -@ stub _Mtx_trylock -@ stub _Mtx_unlock +@ cdecl _Mtx_trylock(ptr) +@ cdecl _Mtx_unlock(ptr) @ stub _Mtxdst @ stub _Mtxinit @ stub _Mtxlock diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index 1c3bd2f..abd53d7 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -374,3 +374,107 @@ unsigned int __cdecl _Random_device(void) return ret; } #endif + +#if _MSVCP_VER >= 110 +#if defined(__i386__) && !defined(__arm__) + +#define THISCALL(func) __thiscall_ ## func +#define __thiscall __stdcall +#define DEFINE_THISCALL_WRAPPER(func,args) \ + extern void THISCALL(func)(void); \ + __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ + "popl %eax\n\t" \ + "pushl %ecx\n\t" \ + "pushl %eax\n\t" \ + "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) + +extern void *call_thiscall_func; +__ASM_GLOBAL_FUNC(call_thiscall_func, + "popl %eax\n\t" + "popl %edx\n\t" + "popl %ecx\n\t" + "pushl %eax\n\t" + "jmp *%edx\n\t") + +#define call_func1(func,this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)(func,this) + +#else /* __i386__ */ + +#define __thiscall __cdecl +#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ + +#define call_func1(func,this) func(this) + +#endif /* __i386__ */ + +#define MTX_MULTI_LOCK 0x100 +#define MTX_LOCKED 3 +typedef struct +{ + DWORD flags; + critical_section cs; + DWORD thread_id; + DWORD count; +} *_Mtx_t; + +int __cdecl _Mtx_init(_Mtx_t *mtx, int flags) +{ + if(flags & ~MTX_MULTI_LOCK) + FIXME("unknown flags ignorred: %x\n", flags); + + *mtx = MSVCRT_operator_new(sizeof(**mtx)); + (*mtx)->flags = flags; + call_func1(critical_section_ctor, &(*mtx)->cs); + (*mtx)->thread_id = -1; + (*mtx)->count = 0; + return 0; +} + +void __cdecl _Mtx_destroy(_Mtx_t *mtx) +{ + call_func1(critical_section_dtor, &(*mtx)->cs); + MSVCRT_operator_delete(*mtx); +} + +int __cdecl _Mtx_lock(_Mtx_t *mtx) +{ + if((*mtx)->thread_id != GetCurrentThreadId()) { + call_func1(critical_section_lock, &(*mtx)->cs); + (*mtx)->thread_id = GetCurrentThreadId(); + }else if(!((*mtx)->flags & MTX_MULTI_LOCK)) { + return MTX_LOCKED; + } + + (*mtx)->count++; + return 0; +} + +int __cdecl _Mtx_unlock(_Mtx_t *mtx) +{ + if(--(*mtx)->count) + return 0; + + (*mtx)->thread_id = -1; + call_func1(critical_section_unlock, &(*mtx)->cs); + return 0; +} + +int __cdecl _Mtx_trylock(_Mtx_t *mtx) +{ + if((*mtx)->thread_id != GetCurrentThreadId()) { + if(!call_func1(critical_section_trylock, &(*mtx)->cs)) + return MTX_LOCKED; + (*mtx)->thread_id = GetCurrentThreadId(); + }else if(!((*mtx)->flags & MTX_MULTI_LOCK)) { + return MTX_LOCKED; + } + + (*mtx)->count++; + return 0; +} + +critical_section* __cdecl _Mtx_getconcrtcs(_Mtx_t *mtx) +{ + return &(*mtx)->cs; +} +#endif diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 0d5e124..5062bdc 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -45,6 +45,31 @@ extern void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t); extern void (__cdecl *MSVCRT_operator_delete)(void*); extern void* (__cdecl *MSVCRT_set_new_handler)(void*); +#if _MSVCP_VER >= 110 +/* keep in sync with msvcrt/lock.c */ +typedef struct cs_queue +{ + struct cs_queue *next; + BOOL free; + int unknown; +} cs_queue; + +typedef struct +{ + ULONG_PTR unk_thread_id; + cs_queue unk_active; + void *unknown[2]; + cs_queue *head; + void *tail; +} critical_section; + +extern critical_section* (__thiscall *critical_section_ctor)(critical_section*); +extern void (__thiscall *critical_section_dtor)(critical_section*); +extern void (__thiscall *critical_section_lock)(critical_section*); +extern void (__thiscall *critical_section_unlock)(critical_section*); +extern MSVCP_bool (__thiscall *critical_section_trylock)(critical_section*); +#endif + /* basic_string<char, char_traits<char>, allocator<char>> */ #define BUF_SIZE_CHAR 16 typedef struct diff --git a/dlls/msvcp90/msvcp_main.c b/dlls/msvcp90/msvcp_main.c index 489aacb..edbdd50 100644 --- a/dlls/msvcp90/msvcp_main.c +++ b/dlls/msvcp90/msvcp_main.c @@ -60,6 +60,14 @@ void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t); void (__cdecl *MSVCRT_operator_delete)(void*); void* (__cdecl *MSVCRT_set_new_handler)(void*); +#if _MSVCP_VER >= 110 +critical_section* (__thiscall *critical_section_ctor)(critical_section*); +void (__thiscall *critical_section_dtor)(critical_section*); +void (__thiscall *critical_section_lock)(critical_section*); +void (__thiscall *critical_section_unlock)(critical_section*); +MSVCP_bool (__thiscall *critical_section_trylock)(critical_section*); +#endif + #define VERSION_STRING(ver) #ver #define MSVCRT_NAME(ver) "msvcr" VERSION_STRING(ver) ".dll" @@ -74,12 +82,36 @@ static void init_cxx_funcs(void) MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z"); MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z"); + +#if _MSVCP_VER >= 110 + critical_section_ctor = (void*)GetProcAddress(hmod, "??0critical_section@Concurrency@@QEAA@XZ"); + critical_section_dtor = (void*)GetProcAddress(hmod, "??1critical_section@Concurrency@@QEAA@XZ"); + critical_section_lock = (void*)GetProcAddress(hmod, "?lock@critical_section@Concurrency@@QEAAXXZ"); + critical_section_unlock = (void*)GetProcAddress(hmod, "?unlock@critical_section@Concurrency@@QEAAXXZ"); + critical_section_trylock = (void*)GetProcAddress(hmod, "?try_lock@critical_section@Concurrency@@QEAA_NXZ"); +#endif } else { MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z"); MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z"); + +#if _MSVCP_VER >= 110 +#ifdef __arm__ + critical_section_ctor = (void*)GetProcAddress(hmod, "??0critical_section@Concurrency@@QAA@XZ"); + critical_section_dtor = (void*)GetProcAddress(hmod, "??1critical_section@Concurrency@@QAA@XZ"); + critical_section_lock = (void*)GetProcAddress(hmod, "?lock@critical_section@Concurrency@@QAAXXZ"); + critical_section_unlock = (void*)GetProcAddress(hmod, "?unlock@critical_section@Concurrency@@QAAXXZ"); + critical_section_trylock = (void*)GetProcAddress(hmod, "?try_lock@critical_section@Concurrency@@QAA_NXZ"); +#else + critical_section_ctor = (void*)GetProcAddress(hmod, "??0critical_section@Concurrency@@QAE@XZ"); + critical_section_dtor = (void*)GetProcAddress(hmod, "??1critical_section@Concurrency@@QAE@XZ"); + critical_section_lock = (void*)GetProcAddress(hmod, "?lock@critical_section@Concurrency@@QAEXXZ"); + critical_section_unlock = (void*)GetProcAddress(hmod, "?unlock@critical_section@Concurrency@@QAEXXZ"); + critical_section_trylock = (void*)GetProcAddress(hmod, "?try_lock@critical_section@Concurrency@@QAE_NXZ"); +#endif +#endif /* _MSVCP_VER >= 110 */ } } diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index aee8d2b..328b5b5 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -287,6 +287,7 @@ MSVCRT_bool __thiscall SpinWait__SpinOnce(SpinWait *this) static HANDLE keyed_event; +/* keep in sync with msvcp90/msvcp90.h */ typedef struct cs_queue { struct cs_queue *next;
1
0
0
0
Jacek Caban : ieframe: Use URL_APPLY_DEFAULT in UrlApplyScheme call.
by Alexandre Julliard
26 Jun '14
26 Jun '14
Module: wine Branch: master Commit: 333fbba681ec2214d57bddb6c2ddf6b249090218 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=333fbba681ec2214d57bddb6c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 26 11:58:57 2014 +0200 ieframe: Use URL_APPLY_DEFAULT in UrlApplyScheme call. --- dlls/ieframe/navigate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ieframe/navigate.c b/dlls/ieframe/navigate.c index 886fa01..f3e0d0d 100644 --- a/dlls/ieframe/navigate.c +++ b/dlls/ieframe/navigate.c @@ -667,7 +667,7 @@ static HRESULT create_moniker(LPCWSTR url, IMoniker **mon) return CreateURLMoniker(NULL, url, mon); size = sizeof(new_url)/sizeof(WCHAR); - hres = UrlApplySchemeW(url, new_url, &size, URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE); + hres = UrlApplySchemeW(url, new_url, &size, URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE | URL_APPLY_DEFAULT); TRACE("was %s got %s\n", debugstr_w(url), debugstr_w(new_url)); if(FAILED(hres)) { WARN("UrlApplyScheme failed: %08x\n", hres);
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
38
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
Results per page:
10
25
50
100
200