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
Matteo Bruni : d3dcompiler/tests: Add a couple more checks for parent data values.
by Alexandre Julliard
25 Jun '14
25 Jun '14
Module: wine Branch: master Commit: 342eec7f7de223ebb1d350bab4c6900d7bea3bc2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=342eec7f7de223ebb1d350bab…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Jun 24 22:25:30 2014 +0200 d3dcompiler/tests: Add a couple more checks for parent data values. --- dlls/d3dcompiler_43/compiler.c | 5 +++-- dlls/d3dcompiler_43/tests/asm.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index d09b5f6..114b4c1 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -145,11 +145,12 @@ static void wpp_warning(const char *file, int line, int col, const char *near, static char *wpp_lookup_mem(const char *filename, int type, const char *parent_name, char **include_path, int include_path_count) { - /* Here we return always ok. We will maybe fail on the next wpp_open_mem */ + /* We don't check for file existence here. We will potentially fail on + * the following wpp_open_mem(). */ char *path; int i; - TRACE("Looking for include %s.\n", debugstr_a(filename)); + TRACE("Looking for include %s, parent %s.\n", debugstr_a(filename), debugstr_a(parent_name)); parent_include = NULL; if (strcmp(parent_name, initial_filename)) diff --git a/dlls/d3dcompiler_43/tests/asm.c b/dlls/d3dcompiler_43/tests/asm.c index 331b864..618a541 100644 --- a/dlls/d3dcompiler_43/tests/asm.c +++ b/dlls/d3dcompiler_43/tests/asm.c @@ -1446,12 +1446,14 @@ static HRESULT WINAPI testD3DInclude_open(ID3DInclude *iface, D3D_INCLUDE_TYPE i buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include)); CopyMemory(buffer, include, sizeof(include)); *bytes = sizeof(include); + ok(!parent_data, "Wrong parent_data value.\n"); } else if (!strcmp(filename, "incl2.vsh")) { buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2)); CopyMemory(buffer, include2, sizeof(include2)); *bytes = sizeof(include2); + ok(!parent_data, "Wrong parent_data value.\n"); ok(include_type == D3D_INCLUDE_LOCAL, "Wrong include type %d.\n", include_type); } else if (!strcmp(filename, "incl3.vsh"))
1
0
0
0
Matteo Bruni : wpp: Free the include filename on error (Valgrind).
by Alexandre Julliard
25 Jun '14
25 Jun '14
Module: wine Branch: master Commit: efcaad3911858be0a52a3b0606ef20ff75b8b0a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=efcaad3911858be0a52a3b060…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Jun 24 22:25:27 2014 +0200 wpp: Free the include filename on error (Valgrind). --- libs/wpp/ppl.l | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 70bd213..9655e34 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -1586,6 +1586,7 @@ void pp_do_include(char *fname, int type) * If the define was deleted, then this entry would have * been deleted too. */ + free(fname); return; } } @@ -1595,6 +1596,7 @@ void pp_do_include(char *fname, int type) if(n <= 2) { ppy_error("Empty include filename"); + free(fname); return; } @@ -1604,6 +1606,7 @@ void pp_do_include(char *fname, int type) if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL) { ppy_error("Unable to open include file %s", fname+1); + free(fname); return; }
1
0
0
0
Matteo Bruni : wpp: Properly free defines (Valgrind).
by Alexandre Julliard
25 Jun '14
25 Jun '14
Module: wine Branch: master Commit: f91fa3722167f4ebefaa5fa9f856bd9a15ce7eb3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f91fa3722167f4ebefaa5fa9f…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Jun 24 22:25:26 2014 +0200 wpp: Properly free defines (Valgrind). --- libs/wpp/preproc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/wpp/preproc.c b/libs/wpp/preproc.c index 33f69c8..21830d6 100644 --- a/libs/wpp/preproc.c +++ b/libs/wpp/preproc.c @@ -292,7 +292,7 @@ void pp_pop_define_state(void) for (i = 0; i < HASHKEY; i++) { - while ((ppp = pp_def_state->defines[i]) != NULL) free_pp_entry( ppp, i ); + while ((ppp = pp_def_state->defines[i]) != NULL) pp_del_define( ppp->ident ); } state = pp_def_state; pp_def_state = state->next; @@ -302,6 +302,7 @@ void pp_pop_define_state(void) void pp_del_define(const char *name) { pp_entry_t *ppp; + int idx = pphash(name); if((ppp = pplookup(name)) == NULL) { @@ -310,13 +311,13 @@ void pp_del_define(const char *name) return; } + if(pp_status.debug) + printf("Deleting (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name); + free( ppp->ident ); free( ppp->subst.text ); free( ppp->filename ); - free_pp_entry( ppp, pphash(name) ); - - if(pp_status.debug) - printf("Deleted (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name); + free_pp_entry( ppp, idx ); } pp_entry_t *pp_add_define(const char *def, const char *text)
1
0
0
0
Bruno Jesus : bcrypt: Add a stub for BCryptCloseAlgorithmProvider.
by Alexandre Julliard
25 Jun '14
25 Jun '14
Module: wine Branch: master Commit: c8c609b59dec2482abfe401414f06a80378834c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8c609b59dec2482abfe40141…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Jun 24 23:53:42 2014 -0300 bcrypt: Add a stub for BCryptCloseAlgorithmProvider. --- dlls/bcrypt/bcrypt.spec | 2 +- dlls/bcrypt/bcrypt_main.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec index 185f950..3b154f5 100644 --- a/dlls/bcrypt/bcrypt.spec +++ b/dlls/bcrypt/bcrypt.spec @@ -1,6 +1,6 @@ @ stub BCryptAddContextFunction @ stub BCryptAddContextFunctionProvider -@ stub BCryptCloseAlgorithmProvider +@ stdcall BCryptCloseAlgorithmProvider(ptr long) @ stub BCryptConfigureContext @ stub BCryptConfigureContextFunction @ stub BCryptCreateContext diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index ee203a6..5ccb9f1 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -90,3 +90,10 @@ NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *algorithm, LPCWST return STATUS_NOT_IMPLEMENTED; } + +NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE algorithm, DWORD flags) +{ + FIXME("%p, %08x - stub\n", algorithm, flags); + + return STATUS_NOT_IMPLEMENTED; +}
1
0
0
0
Bruno Jesus : wininet/tests: Add more HTTP_QUERY_RAW_HEADERS tests.
by Alexandre Julliard
25 Jun '14
25 Jun '14
Module: wine Branch: master Commit: f3b0f488b8233ea6b8fd7b768d93141d641ff6a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3b0f488b8233ea6b8fd7b768…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Tue Jun 24 22:34:17 2014 -0300 wininet/tests: Add more HTTP_QUERY_RAW_HEADERS tests. --- dlls/wininet/tests/http.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index f3340df..6e30ad4 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -465,7 +465,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test) char *post_data = NULL; BOOL res, on_async = TRUE; CHAR buffer[4000]; - DWORD length, index, exlen = 0, post_len = 0; + DWORD length, length2, index, exlen = 0, post_len = 0; const char *types[2] = { "*", NULL }; HINTERNET hi, hic = 0, hor = 0; @@ -626,9 +626,28 @@ static void InternetReadFile_test(int flags, const test_data_t *test) ok(res, "InternetQueryOptionA(INTERNET_OPTION_URL) failed with error %d\n", GetLastError()); length = sizeof(buffer)-1; + memset(buffer, 0x77, sizeof(buffer)); res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length,0x0); ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); - buffer[length]=0; + /* show that the function writes data past the length returned */ + ok(buffer[length-2], "Expected any header character, got 0x00\n"); + ok(!buffer[length-1], "Expected 0x00, got %02X\n", buffer[length-1]); + ok(!buffer[length], "Expected 0x00, got %02X\n", buffer[length]); + ok(buffer[length+1] == 0x77, "Expected 0x77, got %02X\n", buffer[length+1]); + + length2 = length; + res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length2,0x0); + ok(!res, "Expected 0x00, got %d\n", res); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected last error: %d\n", GetLastError()); + ok(length2 == length+1, "Expected %d, got %d\n", length+1, length2); + /* the in length of the buffer must be +1 but the length returned does not count this */ + length2 = length+1; + memset(buffer, 0x77, sizeof(buffer)); + res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length2,0x0); + ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); + ok(buffer[length2] == 0x00, "Expected 0x00, got %02X\n", buffer[length2]); + ok(buffer[length2+1] == 0x77, "Expected 0x77, got %02X\n", buffer[length2+1]); + ok(length2 == length, "Value should not have changed: %d != %d\n", length2, length); length = sizeof(buffer); res = InternetQueryOptionA(hor, INTERNET_OPTION_URL, buffer, &length);
1
0
0
0
Akihiro Sagawa : jscript: Improve CollectGarbage stub.
by Alexandre Julliard
24 Jun '14
24 Jun '14
Module: wine Branch: master Commit: e29fd5429234a3e03a58ec146ccfe0b9290a0213 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e29fd5429234a3e03a58ec146…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Jun 19 23:16:39 2014 +0900 jscript: Improve CollectGarbage stub. --- dlls/jscript/global.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 64546bd..4d1350f 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -753,8 +753,10 @@ static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, vdisp_t *jst static HRESULT JSGlobal_CollectGarbage(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - FIXME("\n"); - return E_NOTIMPL; + static int once = 0; + if (!once++) + FIXME(": stub\n"); + return S_OK; } static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
1
0
0
0
Vincent Povirk : windowscodecs: Fix interlaced PNG writing.
by Alexandre Julliard
24 Jun '14
24 Jun '14
Module: wine Branch: master Commit: e2d6b28a1b2ed064fe14409220e9fce3c0573987 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e2d6b28a1b2ed064fe1440922…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Jun 20 15:11:01 2014 -0500 windowscodecs: Fix interlaced PNG writing. --- dlls/windowscodecs/pngformat.c | 58 ++++++++++++++++++++++++++++++++++++ dlls/windowscodecs/tests/converter.c | 57 ++++++++++++++++++++++++++++++----- 2 files changed, 107 insertions(+), 8 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e2d6b28a1b2ed064fe144…
1
0
0
0
Piotr Caban : msvcp110: Add missing exports to msvcp110.spec file.
by Alexandre Julliard
24 Jun '14
24 Jun '14
Module: wine Branch: master Commit: 1211ffd76e375b17cb2b5f3ed67a33b12579a3c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1211ffd76e375b17cb2b5f3ed…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jun 24 14:59:06 2014 +0200 msvcp110: Add missing exports to msvcp110.spec file. --- dlls/msvcp110/msvcp110.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 40f5577..331df11 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -2372,7 +2372,7 @@ @ cdecl -arch=win64 ?epptr@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEBAPEAGXZ(ptr) basic_streambuf_wchar_epptr @ cdecl -arch=arm ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBAPA_WXZ(ptr) basic_streambuf_wchar_epptr @ thiscall -arch=i386 ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IBEPA_WXZ(ptr) basic_streambuf_wchar_epptr -@ cdecl -arch=win64 ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IcoutEBAPEA_WXZ(ptr) basic_streambuf_wchar_epptr +@ cdecl -arch=win64 ?epptr@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IEBAPEA_WXZ(ptr) basic_streambuf_wchar_epptr @ cdecl -arch=arm ?exceptions@ios_base@std@@QAAXH@Z(ptr long) ios_base_exceptions_set @ thiscall -arch=i386 ?exceptions@ios_base@std@@QAEXH@Z(ptr long) ios_base_exceptions_set @ cdecl -arch=win64 ?exceptions@ios_base@std@@QEAAXH@Z(ptr long) ios_base_exceptions_set @@ -3822,9 +3822,11 @@ @ stub _Mtx_destroy @ stub _Mtx_getconcrtcs @ stub _Mtx_init +@ stub _Mtx_lock @ stub _Mtx_reset_owner @ stub _Mtx_timedlock @ stub _Mtx_trylock +@ stub _Mtx_unlock @ stub _Mtxdst @ stub _Mtxinit @ stub _Mtxlock
1
0
0
0
Piotr Caban : msvcr110: Add critical_section::try_lock_for implementation.
by Alexandre Julliard
24 Jun '14
24 Jun '14
Module: wine Branch: master Commit: 5175037b635d638e16396bee7890e4512031f866 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5175037b635d638e16396bee7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jun 24 11:57:53 2014 +0200 msvcr110: Add critical_section::try_lock_for implementation. --- dlls/msvcr110/msvcr110.spec | 6 ++-- dlls/msvcrt/lock.c | 72 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 6 deletions(-) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 57d7950..4127725 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -794,9 +794,9 @@ @ stub -arch=arm ?try_lock@reader_writer_lock@Concurrency@@QAA_NXZ @ stub -arch=i386 ?try_lock@reader_writer_lock@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock@reader_writer_lock@Concurrency@@QEAA_NXZ -@ stub -arch=arm ?try_lock_for@critical_section@Concurrency@@QAA_NI@Z -@ stub -arch=i386 ?try_lock_for@critical_section@Concurrency@@QAE_NI@Z -@ stub -arch=win64 ?try_lock_for@critical_section@Concurrency@@QEAA_NI@Z +@ cdecl -arch=arm ?try_lock_for@critical_section@Concurrency@@QAA_NI@Z(ptr long) critical_section_try_lock_for +@ thiscall -arch=i386 ?try_lock_for@critical_section@Concurrency@@QAE_NI@Z(ptr long) critical_section_try_lock_for +@ cdecl -arch=win64 ?try_lock_for@critical_section@Concurrency@@QEAA_NI@Z(ptr long) critical_section_try_lock_for @ stub -arch=arm ?try_lock_read@reader_writer_lock@Concurrency@@QAA_NXZ @ stub -arch=i386 ?try_lock_read@reader_writer_lock@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock_read@reader_writer_lock@Concurrency@@QEAA_NXZ diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 94599d1..aee8d2b 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -290,6 +290,10 @@ static HANDLE keyed_event; typedef struct cs_queue { struct cs_queue *next; +#if _MSVCR_VER >= 110 + BOOL free; + int unknown; +#endif } cs_queue; typedef struct @@ -298,7 +302,6 @@ typedef struct cs_queue unk_active; #if _MSVCR_VER >= 110 void *unknown[2]; - int unknown2[2]; #else void *unknown[1]; #endif @@ -373,7 +376,7 @@ void __thiscall critical_section_lock(critical_section *this) return; } - q.next = NULL; + memset(&q, 0, sizeof(q)); last = InterlockedExchangePointer(&this->tail, &q); if(last) { last->next = &q; @@ -400,7 +403,7 @@ MSVCRT_bool __thiscall critical_section_try_lock(critical_section *this) return FALSE; } - q.next = NULL; + memset(&q, 0, sizeof(q)); if(!InterlockedCompareExchangePointer(&this->tail, &q, NULL)) { this->unk_active.next = NULL; if(InterlockedCompareExchangePointer(&this->tail, &this->unk_active, &q) != &q) @@ -425,6 +428,23 @@ void __thiscall critical_section_unlock(critical_section *this) == &this->unk_active) return; spin_wait_for_next_cs(&this->unk_active); +#if _MSVCR_VER >= 110 + while(1) { + cs_queue *next; + + if(!InterlockedExchange(&this->unk_active.next->free, TRUE)) + break; + + next = this->unk_active.next; + if(InterlockedCompareExchangePointer(&this->tail, NULL, next) == next) + return; + spin_wait_for_next_cs(next); + + this->unk_active.next = next->next; + HeapFree(GetProcessHeap(), 0, next); + } +#endif + NtReleaseKeyedEvent(keyed_event, this->unk_active.next, 0, NULL); } @@ -437,6 +457,52 @@ critical_section* __thiscall critical_section_native_handle(critical_section *th return this; } +#if _MSVCR_VER >= 110 +/* ?try_lock_for@critical_section@Concurrency@@QAE_NI@Z */ +/* ?try_lock_for@critical_section@Concurrency@@QEAA_NI@Z */ +DEFINE_THISCALL_WRAPPER(critical_section_try_lock_for, 8) +MSVCRT_bool __thiscall critical_section_try_lock_for( + critical_section *this, unsigned int timeout) +{ + cs_queue *q, *last; + + TRACE("(%p %d)\n", this, timeout); + + if(this->unk_thread_id == GetCurrentThreadId()) { + FIXME("throw exception\n"); + return FALSE; + } + + if(!(q = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*q)))) + return critical_section_try_lock(this); + + last = InterlockedExchangePointer(&this->tail, q); + if(last) { + LARGE_INTEGER to; + NTSTATUS status; + FILETIME ft; + + last->next = q; + GetSystemTimeAsFileTime(&ft); + to.QuadPart = ((LONGLONG)ft.dwHighDateTime<<32) + + ft.dwLowDateTime + (LONGLONG)timeout*10000; + status = NtWaitForKeyedEvent(keyed_event, q, 0, &to); + if(status == STATUS_TIMEOUT) { + if(!InterlockedExchange(&q->free, TRUE)) + return FALSE; + } + } + + this->unk_active.next = NULL; + if(InterlockedCompareExchangePointer(&this->tail, &this->unk_active, q) != q) + spin_wait_for_next_cs(q); + + cs_set_head(this, q); + HeapFree(GetProcessHeap(), 0, q); + return TRUE; +} +#endif + typedef struct { critical_section *cs;
1
0
0
0
Piotr Caban : msvcr100: Add critical_section class implementation.
by Alexandre Julliard
24 Jun '14
24 Jun '14
Module: wine Branch: master Commit: 7f23c57d09746ee8d14893f982052b08a2c675ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f23c57d09746ee8d14893f98…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Jun 24 11:57:47 2014 +0200 msvcr100: Add critical_section class implementation. --- dlls/msvcrt/lock.c | 160 +++++++++++++++++++++++++++++++++++++++++---------- dlls/msvcrt/main.c | 4 +- dlls/msvcrt/msvcrt.h | 2 +- 3 files changed, 132 insertions(+), 34 deletions(-) diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c index 09ff1af..94599d1 100644 --- a/dlls/msvcrt/lock.c +++ b/dlls/msvcrt/lock.c @@ -83,30 +83,6 @@ void msvcrt_init_mt_locks(void) } /********************************************************************** - * msvcrt_free_mt_locks (internal) - * - * Uninitialize all mt locks. Assume that neither _lock or _unlock will - * be called once we're calling this routine (ie _LOCKTAB_LOCK can be deleted) - * - */ -void msvcrt_free_mt_locks(void) -{ - int i; - - TRACE( ": uninitializing all mtlocks\n" ); - - /* Uninitialize the table */ - for( i=0; i < _TOTAL_LOCKS; i++ ) - { - if( lock_table[ i ].bInit ) - { - msvcrt_uninitialize_mlock( i ); - } - } -} - - -/********************************************************************** * _lock (MSVCRT.@) */ void CDECL _lock( int locknum ) @@ -309,10 +285,24 @@ MSVCRT_bool __thiscall SpinWait__SpinOnce(SpinWait *this) } } +static HANDLE keyed_event; + +typedef struct cs_queue +{ + struct cs_queue *next; +} cs_queue; + typedef struct { - void *unknown[3]; - void *head; + ULONG_PTR unk_thread_id; + cs_queue unk_active; +#if _MSVCR_VER >= 110 + void *unknown[2]; + int unknown2[2]; +#else + void *unknown[1]; +#endif + cs_queue *head; void *tail; } critical_section; @@ -321,7 +311,18 @@ typedef struct DEFINE_THISCALL_WRAPPER(critical_section_ctor, 4) critical_section* __thiscall critical_section_ctor(critical_section *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + if(!keyed_event) { + HANDLE event; + + NtCreateKeyedEvent(&event, GENERIC_READ|GENERIC_WRITE, NULL, 0); + if(InterlockedCompareExchangePointer(&keyed_event, event, NULL) != NULL) + NtClose(event); + } + + this->unk_thread_id = 0; + this->head = this->tail = NULL; return this; } @@ -330,7 +331,32 @@ critical_section* __thiscall critical_section_ctor(critical_section *this) DEFINE_THISCALL_WRAPPER(critical_section_dtor, 4) void __thiscall critical_section_dtor(critical_section *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); +} + +static void __cdecl spin_wait_yield(void) +{ + Sleep(0); +} + +static inline void spin_wait_for_next_cs(cs_queue *q) +{ + SpinWait sw; + + if(q->next) return; + + SpinWait_ctor(&sw, &spin_wait_yield); + SpinWait__Reset(&sw); + while(!q->next) + SpinWait__SpinOnce(&sw); + SpinWait_dtor(&sw); +} + +static inline void cs_set_head(critical_section *cs, cs_queue *q) +{ + cs->unk_thread_id = GetCurrentThreadId(); + cs->unk_active.next = q->next; + cs->head = &cs->unk_active; } /* ?lock@critical_section@Concurrency@@QAEXXZ */ @@ -338,7 +364,26 @@ void __thiscall critical_section_dtor(critical_section *this) DEFINE_THISCALL_WRAPPER(critical_section_lock, 4) void __thiscall critical_section_lock(critical_section *this) { - FIXME("(%p) stub\n", this); + cs_queue q, *last; + + TRACE("(%p)\n", this); + + if(this->unk_thread_id == GetCurrentThreadId()) { + FIXME("throw exception\n"); + return; + } + + q.next = NULL; + last = InterlockedExchangePointer(&this->tail, &q); + if(last) { + last->next = &q; + NtWaitForKeyedEvent(keyed_event, &q, 0, NULL); + } + + this->unk_active.next = NULL; + if(InterlockedCompareExchangePointer(&this->tail, &this->unk_active, &q) != &q) + spin_wait_for_next_cs(&q); + cs_set_head(this, &q); } /* ?try_lock@critical_section@Concurrency@@QAE_NXZ */ @@ -346,7 +391,24 @@ void __thiscall critical_section_lock(critical_section *this) DEFINE_THISCALL_WRAPPER(critical_section_try_lock, 4) MSVCRT_bool __thiscall critical_section_try_lock(critical_section *this) { - FIXME("(%p) stub\n", this); + cs_queue q; + + TRACE("(%p)\n", this); + + if(this->unk_thread_id == GetCurrentThreadId()) { + FIXME("throw exception\n"); + return FALSE; + } + + q.next = NULL; + if(!InterlockedCompareExchangePointer(&this->tail, &q, NULL)) { + this->unk_active.next = NULL; + if(InterlockedCompareExchangePointer(&this->tail, &this->unk_active, &q) != &q) + spin_wait_for_next_cs(&q); + + cs_set_head(this, &q); + return TRUE; + } return FALSE; } @@ -355,7 +417,15 @@ MSVCRT_bool __thiscall critical_section_try_lock(critical_section *this) DEFINE_THISCALL_WRAPPER(critical_section_unlock, 4) void __thiscall critical_section_unlock(critical_section *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + this->unk_thread_id = 0; + this->head = NULL; + if(InterlockedCompareExchangePointer(&this->tail, NULL, &this->unk_active) + == &this->unk_active) return; + spin_wait_for_next_cs(&this->unk_active); + + NtReleaseKeyedEvent(keyed_event, this->unk_active.next, 0, NULL); } /* ?native_handle@critical_section@Concurrency@@QAEAAV12@XZ */ @@ -394,3 +464,31 @@ void __thiscall critical_section_scoped_lock_dtor(critical_section_scoped_lock * critical_section_unlock(this->cs); } #endif + +/********************************************************************** + * msvcrt_free_locks (internal) + * + * Uninitialize all mt locks. Assume that neither _lock or _unlock will + * be called once we're calling this routine (ie _LOCKTAB_LOCK can be deleted) + * + */ +void msvcrt_free_locks(void) +{ + int i; + + TRACE( ": uninitializing all mtlocks\n" ); + + /* Uninitialize the table */ + for( i=0; i < _TOTAL_LOCKS; i++ ) + { + if( lock_table[ i ].bInit ) + { + msvcrt_uninitialize_mlock( i ); + } + } + +#if _MSVCR_VER >= 100 + if(keyed_event) + NtClose(keyed_event); +#endif +} diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c index 5a3bba7..1deb080 100644 --- a/dlls/msvcrt/main.c +++ b/dlls/msvcrt/main.c @@ -106,7 +106,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } msvcrt_init_mt_locks(); if(!msvcrt_init_locale()) { - msvcrt_free_mt_locks(); + msvcrt_free_locks(); msvcrt_free_tls_mem(); msvcrt_destroy_heap(); return FALSE; @@ -130,7 +130,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) msvcrt_free_io(); if (lpvReserved) break; msvcrt_free_popen_data(); - msvcrt_free_mt_locks(); + msvcrt_free_locks(); msvcrt_free_console(); msvcrt_free_args(); msvcrt_free_signals(); diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 9069b79..22ba0d4 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -261,7 +261,7 @@ typedef void (__cdecl *free_func_t)(void*); /* Setup and teardown multi threaded locks */ extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN; -extern void msvcrt_free_mt_locks(void) DECLSPEC_HIDDEN; +extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN; extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN; extern BOOL msvcrt_init_locale(void) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
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