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
March 2013
----- 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
531 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Reuse static instance of 'undefined' string.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: d7f24b095663a960d949d1d72d2e7db8fbe58416 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7f24b095663a960d949d1d72…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Mar 8 11:37:56 2013 +0100 jscript: Reuse static instance of 'undefined' string. --- dlls/jscript/engine.c | 6 +--- dlls/jscript/global.c | 59 +++++++++------------------------------------- dlls/jscript/jsregexp.c | 11 +------- dlls/jscript/jsstr.c | 11 ++++++++- dlls/jscript/jsstr.h | 1 + dlls/jscript/jsutils.c | 5 +-- dlls/jscript/lex.c | 1 - dlls/jscript/string.c | 19 +++------------ 8 files changed, 33 insertions(+), 80 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index eb15be4..52cdc88 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1698,13 +1698,11 @@ static HRESULT interp_typeofid(exec_ctx_t *ctx) DISPID id; HRESULT hres; - static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - TRACE("\n"); obj = stack_pop_objid(ctx, &id); if(!obj) - return stack_push_string(ctx, undefinedW); + return stack_push(ctx, jsval_string(jsstr_undefined())); hres = disp_propget(ctx->script, obj, id, &v); IDispatch_Release(obj); @@ -1735,7 +1733,7 @@ static HRESULT interp_typeofident(exec_ctx_t *ctx) return hres; if(exprval.type == EXPRVAL_INVALID) { - hres = stack_push_string(ctx, undefinedW); + hres = stack_push(ctx, jsval_string(jsstr_undefined())); exprval_release(&exprval); return hres; } diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 0668e86..739a831 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -286,14 +286,8 @@ static HRESULT JSGlobal_escape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, u TRACE("\n"); if(!argc) { - if(r) { - ret_str = jsstr_alloc(undefinedW); - if(!ret_str) - return E_OUTOFMEMORY; - - *r = jsval_string(ret_str); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } @@ -640,13 +634,8 @@ static HRESULT JSGlobal_unescape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, TRACE("\n"); if(!argc) { - if(r) { - ret_str = jsstr_alloc(undefinedW); - if(!ret_str) - return E_OUTOFMEMORY; - *r = jsval_string(ret_str); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } @@ -781,14 +770,8 @@ static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags TRACE("\n"); if(!argc) { - if(r) { - ret = jsstr_alloc(undefinedW); - if(!ret) - return E_OUTOFMEMORY; - - *r = jsval_string(ret); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } @@ -853,14 +836,8 @@ static HRESULT JSGlobal_decodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags TRACE("\n"); if(!argc) { - if(r) { - ret = jsstr_alloc(undefinedW); - if(!ret) - return E_OUTOFMEMORY; - - *r = jsval_string(ret); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } @@ -944,14 +921,8 @@ static HRESULT JSGlobal_encodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W TRACE("\n"); if(!argc) { - if(r) { - ret = jsstr_alloc(undefinedW); - if(!ret) - return E_OUTOFMEMORY; - - *r = jsval_string(ret); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } @@ -1014,14 +985,8 @@ static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, W TRACE("\n"); if(!argc) { - if(r) { - ret = jsstr_alloc(undefinedW); - if(!ret) - return E_OUTOFMEMORY; - - *r = jsval_string(ret); - } - + if(r) + *r = jsval_string(jsstr_undefined()); return S_OK; } diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 43df35a..61e9a95 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -58,7 +58,6 @@ static const WCHAR idx7W[] = {'$','7',0}; static const WCHAR idx8W[] = {'$','8',0}; static const WCHAR idx9W[] = {'$','9',0}; -static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; static const WCHAR emptyW[] = {0}; static inline RegExpInstance *regexp_from_vdisp(vdisp_t *vdisp) @@ -487,21 +486,15 @@ static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsig jsval_t *r) { match_state_t *match; - heap_pool_t *mark; jsstr_t *undef_str; + heap_pool_t *mark; BOOL b; HRESULT hres; TRACE("\n"); - if(!argc) { - undef_str = jsstr_alloc(undefinedW); - if(!undef_str) - return E_OUTOFMEMORY; - } - mark = heap_pool_mark(&ctx->tmp_heap); - hres = run_exec(ctx, jsthis, argc ? argv[0] : jsval_string(undef_str), NULL, &match, &b); + hres = run_exec(ctx, jsthis, argc ? argv[0] : jsval_string(undef_str = jsstr_undefined()), NULL, &match, &b); heap_pool_clear(mark); if(!argc) jsstr_release(undef_str); diff --git a/dlls/jscript/jsstr.c b/dlls/jscript/jsstr.c index 59dfe98..3fb50b4 100644 --- a/dlls/jscript/jsstr.c +++ b/dlls/jscript/jsstr.c @@ -88,7 +88,7 @@ jsstr_t *jsstr_concat(jsstr_t *str1, jsstr_t *str2) return ret; } -static jsstr_t *empty_str, *nan_str; +static jsstr_t *empty_str, *nan_str, *undefined_str; jsstr_t *jsstr_nan(void) { @@ -100,14 +100,22 @@ jsstr_t *jsstr_empty(void) return jsstr_addref(empty_str); } +jsstr_t *jsstr_undefined(void) +{ + return jsstr_addref(undefined_str); +} + BOOL init_strings(void) { static const WCHAR NaNW[] = { 'N','a','N',0 }; + static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; if(!(empty_str = jsstr_alloc_buf(0))) return FALSE; if(!(nan_str = jsstr_alloc(NaNW))) return FALSE; + if(!(undefined_str = jsstr_alloc(undefinedW))) + return FALSE; return TRUE; } @@ -115,4 +123,5 @@ void free_strings(void) { jsstr_release(empty_str); jsstr_release(nan_str); + jsstr_release(undefined_str); } diff --git a/dlls/jscript/jsstr.h b/dlls/jscript/jsstr.h index cbe68ef..c71cbea 100644 --- a/dlls/jscript/jsstr.h +++ b/dlls/jscript/jsstr.h @@ -76,6 +76,7 @@ jsstr_t *jsstr_concat(jsstr_t*,jsstr_t*) DECLSPEC_HIDDEN; jsstr_t *jsstr_nan(void) DECLSPEC_HIDDEN; jsstr_t *jsstr_empty(void) DECLSPEC_HIDDEN; +jsstr_t *jsstr_undefined(void) DECLSPEC_HIDDEN; BOOL init_strings(void) DECLSPEC_HIDDEN; void free_strings(void) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 5900d81..60260bb 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -738,15 +738,14 @@ HRESULT double_to_string(double n, jsstr_t **str) /* ECMA-262 3rd Edition 9.8 */ HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsstr_t **str) { - const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; const WCHAR nullW[] = {'n','u','l','l',0}; const WCHAR trueW[] = {'t','r','u','e',0}; const WCHAR falseW[] = {'f','a','l','s','e',0}; switch(jsval_type(val)) { case JSV_UNDEFINED: - *str = jsstr_alloc(undefinedW); - break; + *str = jsstr_undefined(); + return S_OK; case JSV_NULL: *str = jsstr_alloc(nullW); break; diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c index 8823a30..54c8fcf 100644 --- a/dlls/jscript/lex.c +++ b/dlls/jscript/lex.c @@ -59,7 +59,6 @@ static const WCHAR throwW[] = {'t','h','r','o','w',0}; static const WCHAR trueW[] = {'t','r','u','e',0}; static const WCHAR tryW[] = {'t','r','y',0}; static const WCHAR typeofW[] = {'t','y','p','e','o','f',0}; -static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; static const WCHAR varW[] = {'v','a','r',0}; static const WCHAR voidW[] = {'v','o','i','d',0}; static const WCHAR whileW[] = {'w','h','i','l','e',0}; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 8f38621..2aa9e58 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -188,10 +188,7 @@ static HRESULT do_attributeless_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, j static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsigned argc, jsval_t *argv, jsval_t *r, const WCHAR *tagname, const WCHAR *attrname) { - static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - jsstr_t *str, *attr_value = NULL; - unsigned attr_len; HRESULT hres; hres = get_string_val(ctx, jsthis, &str); @@ -204,9 +201,8 @@ static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsig jsstr_release(str); return hres; } - attr_len = jsstr_length(attr_value); }else { - attr_len = sizeof(undefinedW)/sizeof(WCHAR)-1; + attr_value = jsstr_undefined(); } if(r) { @@ -214,7 +210,7 @@ static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsig unsigned tagname_len = strlenW(tagname); jsstr_t *ret; - ret = jsstr_alloc_buf(2*tagname_len + attrname_len + attr_len + jsstr_length(str) + 9); + ret = jsstr_alloc_buf(2*tagname_len + attrname_len + jsstr_length(attr_value) + jsstr_length(str) + 9); if(ret) { WCHAR *ptr = ret->str; @@ -226,13 +222,7 @@ static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsig ptr += attrname_len; *ptr++ = '='; *ptr++ = '"'; - - if(attr_value) - jsstr_flush(attr_value, ptr); - else - memcpy(ptr, undefinedW, attr_len*sizeof(WCHAR)); - ptr += attr_len; - + ptr += jsstr_flush(attr_value, ptr); *ptr++ = '"'; *ptr++ = '>'; ptr += jsstr_flush(str, ptr); @@ -249,8 +239,7 @@ static HRESULT do_attribute_tag_format(script_ctx_t *ctx, vdisp_t *jsthis, unsig } } - if(attr_value) - jsstr_release(attr_value); + jsstr_release(attr_value); jsstr_release(str); return hres; }
1
0
0
0
Jacek Caban : jscript: Pass msg as jsstr_t to create_error.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: c7c71b87b894bb67d8b9a136162a66a273bedf61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7c71b87b894bb67d8b9a1361…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Mar 8 11:37:30 2013 +0100 jscript: Pass msg as jsstr_t to create_error. --- dlls/jscript/error.c | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 3e15144..41cba5a 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -180,10 +180,9 @@ static HRESULT alloc_error(script_ctx_t *ctx, jsdisp_t *prototype, } static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr, - UINT number, const WCHAR *msg, jsdisp_t **ret) + UINT number, jsstr_t *msg, jsdisp_t **ret) { jsdisp_t *err; - jsstr_t *str; HRESULT hres; hres = alloc_error(ctx, NULL, constr, &err); @@ -196,16 +195,9 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr, return hres; } - if(msg) str = jsstr_alloc(msg); - else str = jsstr_empty(); - if(str) { - hres = jsdisp_propput_name(err, messageW, jsval_string(str)); - if(SUCCEEDED(hres)) - hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(str)); - jsstr_release(str); - }else { - hres = E_OUTOFMEMORY; - } + hres = jsdisp_propput_name(err, messageW, jsval_string(msg)); + if(SUCCEEDED(hres)) + hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(msg)); if(FAILED(hres)) { jsdisp_release(err); return hres; @@ -235,19 +227,21 @@ static HRESULT error_constr(script_ctx_t *ctx, WORD flags, unsigned argc, jsval_ num = n; } - if(argc>1 && !msg) { - hres = to_string(ctx, argv[1], &msg); - if(FAILED(hres)) - return hres; + if(!msg) { + if(argc > 1) { + hres = to_string(ctx, argv[1], &msg); + if(FAILED(hres)) + return hres; + }else { + msg = jsstr_empty(); + } } switch(flags) { case INVOKE_FUNC: case DISPATCH_CONSTRUCT: - hres = create_error(ctx, constr, num, msg ? msg->str : NULL, &err); - if(msg) - jsstr_release(msg); - + hres = create_error(ctx, constr, num, msg, &err); + jsstr_release(msg); if(FAILED(hres)) return hres; @@ -375,6 +369,7 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j { WCHAR buf[1024], *pos = NULL; jsdisp_t *err; + jsstr_t *msg; HRESULT hres; if(!is_jscript_error(error)) @@ -392,7 +387,12 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j WARN("%s\n", debugstr_w(buf)); - hres = create_error(ctx, constr, error, buf, &err); + msg = jsstr_alloc(buf); + if(!msg) + return E_OUTOFMEMORY; + + hres = create_error(ctx, constr, error, msg, &err); + jsstr_release(msg); if(FAILED(hres)) return hres;
1
0
0
0
Piotr Caban : cryptnet: Don' t ignore HttpEndRequestW error in HTTP_RetrieveEncodedObjectW.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: b8e2edf19c27c91641a6c26d07b94ecf33839467 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8e2edf19c27c91641a6c26d0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Mar 8 11:17:53 2013 +0100 cryptnet: Don't ignore HttpEndRequestW error in HTTP_RetrieveEncodedObjectW. --- dlls/cryptnet/cryptnet_main.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 64af80c..ddfdbce 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -941,19 +941,15 @@ static BOOL WINAPI HTTP_RetrieveEncodedObjectW(LPCWSTR pszURL, else ret = TRUE; } - /* We don't set ret to TRUE in this block to avoid masking - * an error from HttpSendRequestExW. - */ if (ret && - !HttpEndRequestW(hHttp, NULL, 0, (DWORD_PTR)context) && + !(ret = HttpEndRequestW(hHttp, NULL, 0, (DWORD_PTR)context)) && GetLastError() == ERROR_IO_PENDING) { if (WaitForSingleObject(context->event, context->timeout) == WAIT_TIMEOUT) - { SetLastError(ERROR_TIMEOUT); - ret = FALSE; - } + else + ret = TRUE; } if (ret) ret = CRYPT_DownloadObject(dwRetrievalFlags, hHttp,
1
0
0
0
Piotr Caban : cryptnet: Open file with FILE_SHARE_READ flag in File_RetrieveEncodedObjectW.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 437df58dce20b3d52d1a103b60b4f7d33e76ac3d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=437df58dce20b3d52d1a103b6…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Mar 8 11:17:30 2013 +0100 cryptnet: Open file with FILE_SHARE_READ flag in File_RetrieveEncodedObjectW. --- dlls/cryptnet/cryptnet_main.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 75dce9d..64af80c 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1032,8 +1032,8 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL, /* Try to create the file directly - Wine handles / in pathnames */ lstrcpynW(path, components.lpszUrlPath, components.dwUrlPathLength + 1); - hFile = CreateFileW(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { /* Try again on the current drive */ @@ -1042,8 +1042,8 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL, { lstrcpynW(path + 2, components.lpszUrlPath, components.dwUrlPathLength + 1); - hFile = CreateFileW(path, GENERIC_READ, 0, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); } if (hFile == INVALID_HANDLE_VALUE) { @@ -1053,8 +1053,8 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL, { lstrcpynW(path + 2, components.lpszUrlPath, components.dwUrlPathLength + 1); - hFile = CreateFileW(path, GENERIC_READ, 0, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); } } }
1
0
0
0
Piotr Caban : cryptnet: Lock cache file while accessing it.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 4f8932157799e4d7e2c182bb0b66aa4e161992fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4f8932157799e4d7e2c182bb0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Mar 8 11:17:11 2013 +0100 cryptnet: Lock cache file while accessing it. --- dlls/cryptnet/cryptnet_main.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 46eac4e..75dce9d 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -503,24 +503,26 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject, TRACE("(%s, %p, %p)\n", debugstr_w(pszURL), pObject, pAuxInfo); - ret = GetUrlCacheEntryInfoW(pszURL, NULL, &size); - if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + RetrieveUrlCacheEntryFileW(pszURL, NULL, &size, 0); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return FALSE; + + pCacheInfo = CryptMemAlloc(size); + if (!pCacheInfo) { - pCacheInfo = CryptMemAlloc(size); - if (pCacheInfo) - ret = TRUE; - else - SetLastError(ERROR_OUTOFMEMORY); + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; } - if (ret && (ret = GetUrlCacheEntryInfoW(pszURL, pCacheInfo, &size))) + + if ((ret = RetrieveUrlCacheEntryFileW(pszURL, pCacheInfo, &size, 0))) { FILETIME ft; GetSystemTimeAsFileTime(&ft); if (CompareFileTime(&pCacheInfo->ExpireTime, &ft) >= 0) { - HANDLE hFile = CreateFileW(pCacheInfo->lpszLocalFileName, - GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile = CreateFileW(pCacheInfo->lpszLocalFileName, GENERIC_READ, + FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { @@ -547,6 +549,7 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject, DeleteUrlCacheEntryW(pszURL); ret = FALSE; } + UnlockUrlCacheEntryFileW(pszURL, 0); } CryptMemFree(pCacheInfo); TRACE("returning %d\n", ret);
1
0
0
0
Volkan Gezer : po: Updated Turkish translation.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 81e48cd0fa6050f1bbd86a7bbb8a0e445b80afa6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81e48cd0fa6050f1bbd86a7bb…
Author: Volkan Gezer <volkangezer(a)gmail.com> Date: Tue Mar 5 20:57:20 2013 +0100 po: Updated Turkish translation. --- po/tr.po | 1094 +++++++++++++++++++++++++++++++------------------------------- 1 files changed, 554 insertions(+), 540 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=81e48cd0fa6050f1bbd86…
1
0
0
0
Hans Leidekker : user32: Add a stub implementation of UserHandleGrantAccess .
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 6493d6abbcbcdee2ec5e25ac8e04ce368b904f00 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6493d6abbcbcdee2ec5e25ac8…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Mar 8 09:26:42 2013 +0100 user32: Add a stub implementation of UserHandleGrantAccess. --- dlls/user32/misc.c | 10 ++++++++++ dlls/user32/user32.spec | 2 +- include/winuser.h | 1 + 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index ef7fff6..50bb79a 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -651,3 +651,13 @@ VOID WINAPI DisableProcessWindowsGhosting(VOID) SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return; } + +/********************************************************************** + * UserHandleGrantAccess [USER32.@] + * + */ +BOOL WINAPI UserHandleGrantAccess(HANDLE handle, HANDLE job, BOOL grant) +{ + FIXME("(%p,%p,%d): stub\n", handle, job, grant); + return TRUE; +} diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 231d3b1..1ad59d9 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -734,7 +734,7 @@ @ stdcall UpdateWindow(long) @ stdcall User32InitializeImmEntryTable(ptr) @ stdcall UserClientDllInitialize(long long ptr) DllMain -@ stub UserHandleGrantAccess +@ stdcall UserHandleGrantAccess(ptr ptr long) # @ stub UserIsSystemResumeAutomatic # @ stub UserLpkPSMTextOut # @ stub UserLpkTabbedTextOut diff --git a/include/winuser.h b/include/winuser.h index c8ffe6d..59d5b8e 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3988,6 +3988,7 @@ WINUSERAPI BOOL WINAPI UnregisterClassW(LPCWSTR,HINSTANCE); WINUSERAPI BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY); WINUSERAPI BOOL WINAPI UnregisterHotKey(HWND,INT); WINUSERAPI BOOL WINAPI UpdateWindow(HWND); +WINUSERAPI BOOL WINAPI UserHandleGrantAccess(HANDLE,HANDLE,BOOL); WINUSERAPI UINT WINAPI UserRealizePalette(HDC); WINUSERAPI BOOL WINAPI ValidateRect(HWND,const RECT*); WINUSERAPI BOOL WINAPI ValidateRgn(HWND,HRGN);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Fix handling of a tRNS PNG chunk in the frame CopyPalette method.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 18e76792a76291c7a8211b6daa433ba6532c840f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18e76792a76291c7a8211b6da…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Fri Mar 8 13:18:06 2013 +0900 windowscodecs: Fix handling of a tRNS PNG chunk in the frame CopyPalette method. --- dlls/windowscodecs/pngformat.c | 17 ++++++----------- dlls/windowscodecs/tests/pngformat.c | 2 -- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 2f6a9e3..1708580 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -798,7 +798,7 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, png_colorp png_palette; int num_palette; WICColor palette[256]; - png_bytep trans; + png_bytep trans_alpha; int num_trans; png_color_16p trans_values; int i; @@ -822,23 +822,18 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, goto end; } + ret = ppng_get_tRNS(This->png_ptr, This->info_ptr, &trans_alpha, &num_trans, &trans_values); + if (!ret) num_trans = 0; + for (i=0; i<num_palette; i++) { - palette[i] = (0xff000000| + BYTE alpha = (i < num_trans) ? trans_alpha[i] : 0xff; + palette[i] = (alpha << 24 | png_palette[i].red << 16| png_palette[i].green << 8| png_palette[i].blue); } - ret = ppng_get_tRNS(This->png_ptr, This->info_ptr, &trans, &num_trans, &trans_values); - if (ret) - { - for (i=0; i<num_trans; i++) - { - palette[trans[i]] = 0x00000000; - } - } - end: LeaveCriticalSection(&This->lock); diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c index 61c56b3..a222ebc 100644 --- a/dlls/windowscodecs/tests/pngformat.c +++ b/dlls/windowscodecs/tests/pngformat.c @@ -577,9 +577,7 @@ static void test_png_palette(void) hr = IWICPalette_GetColors(palette, 256, color, &ret); ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); -todo_wine ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); -todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); IWICPalette_Release(palette);
1
0
0
0
Ken Thomases : winemac: Improve handling of "invert" pixels in monochrome cursors.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 37b33a9de83d0942616f08c9eb66203296ae6ff0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37b33a9de83d0942616f08c9e…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Mar 7 20:37:02 2013 -0600 winemac: Improve handling of "invert" pixels in monochrome cursors. --- dlls/winemac.drv/mouse.c | 109 +++++++++++++++++++++++++++++++++------------- 1 files changed, 79 insertions(+), 30 deletions(-) diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index cfbb274..66214fe 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -258,21 +258,6 @@ done: } /*********************************************************************** - * release_provider_cfdata - * - * Helper for create_monochrome_cursor. A CFData is used by two - * different CGDataProviders, using different offsets. One of them is - * constructed with a pointer to the bytes, not a reference to the - * CFData object (because of the offset). So, the CFData is CFRetain'ed - * on its behalf at creation and released here. - */ -void release_provider_cfdata(void *info, const void *data, size_t size) -{ - CFRelease(info); -} - - -/*********************************************************************** * create_monochrome_cursor */ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width, int height) @@ -280,6 +265,9 @@ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width, char buffer[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; BITMAPINFO *info = (BITMAPINFO *)buffer; unsigned int width_bytes = (width + 31) / 32 * 4; + unsigned long *and_bits = NULL, *xor_bits; + unsigned long *data_bits; + int count, i; CGColorSpaceRef colorspace; CFMutableDataRef data; CGDataProviderRef provider; @@ -306,43 +294,86 @@ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width, info->bmiHeader.biClrUsed = 0; info->bmiHeader.biClrImportant = 0; - /* This will be owned by the data provider for the mask image and released - when it is destroyed. */ - data = CFDataCreateMutable(NULL, info->bmiHeader.biSizeImage); - if (!data) + and_bits = HeapAlloc(GetProcessHeap(), 0, info->bmiHeader.biSizeImage); + if (!and_bits) { - WARN("failed to create data\n"); + WARN("failed to allocate and_bits\n"); return NULL; } - CFDataSetLength(data, info->bmiHeader.biSizeImage); + xor_bits = (unsigned long*)((char*)and_bits + info->bmiHeader.biSizeImage / 2); - if (!GetDIBits(hdc, icon->hbmMask, 0, height * 2, CFDataGetMutableBytePtr(data), info, DIB_RGB_COLORS)) + if (!GetDIBits(hdc, icon->hbmMask, 0, height * 2, and_bits, info, DIB_RGB_COLORS)) { WARN("GetDIBits failed\n"); - CFRelease(data); + HeapFree(GetProcessHeap(), 0, and_bits); return NULL; } + /* On Windows, the pixels of a monochrome cursor can have four effects: + draw black, draw white, leave unchanged (transparent), or invert. The Mac + only supports the first three. It can't do pixels which invert the + background. Since the background is usually white, I am arbitrarily + mapping "invert" to "draw black". This entails bitwise math between the + cursor's AND mask and XOR mask: + + AND | XOR | Windows cursor pixel + -------------------------------- + 0 | 0 | black + 0 | 1 | white + 1 | 0 | transparent + 1 | 1 | invert + + AND | XOR | Mac image + --------------------- + 0 | 0 | black (0) + 0 | 1 | white (1) + 1 | 0 | don't care + 1 | 1 | black (0) + + AND | XOR | Mac mask + --------------------------- + 0 | 0 | paint (0) + 0 | 1 | paint (0) + 1 | 0 | don't paint (1) + 1 | 1 | paint (0) + + So, Mac image = AND ^ XOR and Mac mask = AND & ~XOR. + */ + /* Create data for Mac image. */ + data = CFDataCreateMutable(NULL, info->bmiHeader.biSizeImage / 2); + if (!data) + { + WARN("failed to create data\n"); + HeapFree(GetProcessHeap(), 0, and_bits); + return NULL; + } + + /* image data = AND mask */ + CFDataAppendBytes(data, (UInt8*)and_bits, info->bmiHeader.biSizeImage / 2); + /* image data ^= XOR mask */ + data_bits = (unsigned long*)CFDataGetMutableBytePtr(data); + count = (info->bmiHeader.biSizeImage / 2) / sizeof(*data_bits); + for (i = 0; i < count; i++) + data_bits[i] ^= xor_bits[i]; + colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericGray); if (!colorspace) { WARN("failed to create colorspace\n"); CFRelease(data); + HeapFree(GetProcessHeap(), 0, and_bits); return NULL; } - /* The data object needs to live as long as this provider, so retain it an - extra time and have the provider's data-release callback release it. */ - provider = CGDataProviderCreateWithData(data, CFDataGetBytePtr(data) + width_bytes * height, - width_bytes * height, release_provider_cfdata); + provider = CGDataProviderCreateWithCFData(data); + CFRelease(data); if (!provider) { WARN("failed to create data provider\n"); CGColorSpaceRelease(colorspace); - CFRelease(data); + HeapFree(GetProcessHeap(), 0, and_bits); return NULL; } - CFRetain(data); cgimage = CGImageCreate(width, height, 1, 1, width_bytes, colorspace, kCGImageAlphaNone | kCGBitmapByteOrderDefault, @@ -352,10 +383,28 @@ CFArrayRef create_monochrome_cursor(HDC hdc, const ICONINFOEXW *icon, int width, if (!cgimage) { WARN("failed to create image\n"); - CFRelease(data); + HeapFree(GetProcessHeap(), 0, and_bits); + return NULL; + } + + /* Create data for mask. */ + data = CFDataCreateMutable(NULL, info->bmiHeader.biSizeImage / 2); + if (!data) + { + WARN("failed to create data\n"); + CGImageRelease(cgimage); + HeapFree(GetProcessHeap(), 0, and_bits); return NULL; } + /* mask data = AND mask */ + CFDataAppendBytes(data, (UInt8*)and_bits, info->bmiHeader.biSizeImage / 2); + /* mask data &= ~XOR mask */ + data_bits = (unsigned long*)CFDataGetMutableBytePtr(data); + for (i = 0; i < count; i++) + data_bits[i] &= ~xor_bits[i]; + HeapFree(GetProcessHeap(), 0, and_bits); + provider = CGDataProviderCreateWithCFData(data); CFRelease(data); if (!provider)
1
0
0
0
Andrew Talbot : ws2_32: Avoid signed-unsigned integer comparisons.
by Alexandre Julliard
08 Mar '13
08 Mar '13
Module: wine Branch: master Commit: 05d5654237c1af93661a3f5e21c792f6e431883d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=05d5654237c1af93661a3f5e2…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Thu Mar 7 22:22:31 2013 +0000 ws2_32: Avoid signed-unsigned integer comparisons. --- dlls/ws2_32/socket.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 05c7aac..f9e8a6c 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2881,7 +2881,8 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, { struct irda_device_list *src = (struct irda_device_list *)buf; DEVICELIST *dst = (DEVICELIST *)optval; - INT needed = sizeof(DEVICELIST), i; + INT needed = sizeof(DEVICELIST); + unsigned int i; if (src->len > 0) needed += (src->len - 1) * sizeof(IRDA_DEVICE_INFO); @@ -4605,6 +4606,7 @@ struct WS_hostent* WINAPI WS_gethostbyaddr(const char *addr, int len, int type) static struct WS_hostent* WS_get_local_ips( char *hostname ) { int last_metric, numroutes = 0, i, j; + DWORD n; PIP_ADAPTER_INFO adapters = NULL, k; struct WS_hostent *hostlist = NULL; PMIB_IPFORWARDTABLE routes = NULL; @@ -4627,15 +4629,15 @@ static struct WS_hostent* WS_get_local_ips( char *hostname ) if (GetIpForwardTable(routes, &route_size, FALSE) != NO_ERROR) goto cleanup; /* Store the interface associated with each route */ - for (i = 0; i < routes->dwNumEntries; i++) + for (n = 0; n < routes->dwNumEntries; n++) { IF_INDEX ifindex; DWORD ifmetric, exists = FALSE; - if (routes->table[i].u1.ForwardType != MIB_IPROUTE_TYPE_DIRECT) + if (routes->table[n].u1.ForwardType != MIB_IPROUTE_TYPE_DIRECT) continue; - ifindex = routes->table[i].dwForwardIfIndex; - ifmetric = routes->table[i].dwForwardMetric1; + ifindex = routes->table[n].dwForwardIfIndex; + ifmetric = routes->table[n].dwForwardMetric1; /* Only store the lowest valued metric for an interface */ for (j = 0; j < numroutes; j++) {
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
54
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
Results per page:
10
25
50
100
200