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
December 2011
----- 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
810 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Use bytecode for typeof expression implementation.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 3caf287630279a2658dd99c0be0f9cf387a49132 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3caf287630279a2658dd99c0b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Dec 13 11:57:11 2011 +0100 jscript: Use bytecode for typeof expression implementation. --- dlls/jscript/compile.c | 23 ++++++++ dlls/jscript/engine.c | 135 ++++++++++++++++++++++++++++++++---------------- dlls/jscript/engine.h | 4 +- dlls/jscript/parser.y | 2 +- 4 files changed, 118 insertions(+), 46 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 0d4ce79..ff53c90 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -534,6 +534,27 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_ return S_OK; } +static HRESULT compile_typeof_expression(compiler_ctx_t *ctx, unary_expression_t *expr) +{ + jsop_t op; + HRESULT hres; + + if(is_memberid_expr(expr->expression->type)) { + if(expr->expression->type == EXPR_IDENT) + return push_instr_str(ctx, OP_typeofident, ((identifier_expression_t*)expr->expression)->identifier); + + op = OP_typeofid; + hres = compile_memberid_expression(ctx, expr->expression, 0); + }else { + op = OP_typeof; + hres = compile_expression(ctx, expr->expression); + } + if(FAILED(hres)) + return hres; + + return push_instr(ctx, op) == -1 ? E_OUTOFMEMORY : S_OK; +} + static HRESULT compile_literal(compiler_ctx_t *ctx, literal_t *literal) { switch(literal->type) { @@ -707,6 +728,8 @@ static HRESULT compile_expression_noret(compiler_ctx_t *ctx, expression_t *expr, return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub); case EXPR_THIS: return push_instr(ctx, OP_this) == -1 ? E_OUTOFMEMORY : S_OK; + case EXPR_TYPEOF: + return compile_typeof_expression(ctx, (unary_expression_t*)expr); case EXPR_VOID: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_void); case EXPR_BXOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index da02052..e399aa8 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -32,6 +32,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); #define EXPR_NOVAL 0x0001 #define EXPR_NEWREF 0x0002 +static const WCHAR booleanW[] = {'b','o','o','l','e','a','n',0}; +static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0}; +static const WCHAR numberW[] = {'n','u','m','b','e','r',0}; +static const WCHAR objectW[] = {'o','b','j','e','c','t',0}; +static const WCHAR stringW[] = {'s','t','r','i','n','g',0}; +static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; +static const WCHAR unknownW[] = {'u','n','k','n','o','w','n',0}; + struct _return_type_t { enum{ RT_NORMAL, @@ -102,6 +110,15 @@ static inline HRESULT stack_push_int(exec_ctx_t *ctx, INT n) return stack_push(ctx, &v); } +static inline HRESULT stack_push_string(exec_ctx_t *ctx, const WCHAR *str) +{ + VARIANT v; + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(str); + return V_BSTR(&v) ? stack_push(ctx, &v) : E_OUTOFMEMORY; +} + static HRESULT stack_push_objid(exec_ctx_t *ctx, IDispatch *disp, DISPID id) { VARIANT v; @@ -2456,34 +2473,9 @@ static HRESULT interp_void(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.4.3 */ -static HRESULT typeof_exprval(script_ctx_t *ctx, exprval_t *exprval, jsexcept_t *ei, const WCHAR **ret) +static HRESULT typeof_string(VARIANT *v, const WCHAR **ret) { - VARIANT val; - HRESULT hres; - - static const WCHAR booleanW[] = {'b','o','o','l','e','a','n',0}; - static const WCHAR functionW[] = {'f','u','n','c','t','i','o','n',0}; - static const WCHAR numberW[] = {'n','u','m','b','e','r',0}; - static const WCHAR objectW[] = {'o','b','j','e','c','t',0}; - static const WCHAR stringW[] = {'s','t','r','i','n','g',0}; - static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - static const WCHAR unknownW[] = {'u','n','k','n','o','w','n',0}; - - if(exprval->type == EXPRVAL_INVALID) { - *ret = undefinedW; - return S_OK; - } - - hres = exprval_to_value(ctx, exprval, ei, &val); - if(FAILED(hres)) { - if(exprval->type == EXPRVAL_IDREF) { - *ret = unknownW; - return S_OK; - } - return hres; - } - - switch(V_VT(&val)) { + switch(V_VT(v)) { case VT_EMPTY: *ret = undefinedW; break; @@ -2503,7 +2495,7 @@ static HRESULT typeof_exprval(script_ctx_t *ctx, exprval_t *exprval, jsexcept_t case VT_DISPATCH: { jsdisp_t *dispex; - if(V_DISPATCH(&val) && (dispex = iface_to_jsdisp((IUnknown*)V_DISPATCH(&val)))) { + if(V_DISPATCH(v) && (dispex = iface_to_jsdisp((IUnknown*)V_DISPATCH(v)))) { *ret = is_class(dispex, JSCLASS_FUNCTION) ? functionW : objectW; jsdisp_release(dispex); }else { @@ -2512,39 +2504,94 @@ static HRESULT typeof_exprval(script_ctx_t *ctx, exprval_t *exprval, jsexcept_t break; } default: - FIXME("unhandled vt %d\n", V_VT(&val)); - hres = E_NOTIMPL; + FIXME("unhandled vt %d\n", V_VT(v)); + return E_NOTIMPL; } - VariantClear(&val); - return hres; + return S_OK; } -HRESULT typeof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.4.3 */ +static HRESULT interp_typeofid(exec_ctx_t *ctx) { - unary_expression_t *expr = (unary_expression_t*)_expr; - const WCHAR *str = NULL; - exprval_t exprval; + const WCHAR *ret; + IDispatch *obj; + VARIANT v; + DISPID id; HRESULT hres; + static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; + TRACE("\n"); - hres = expr_eval(ctx, expr->expression, 0, ei, &exprval); + obj = stack_pop_objid(ctx, &id); + if(!obj) + return stack_push_string(ctx, undefinedW); + + V_VT(&v) = VT_EMPTY; + hres = disp_propget(ctx->parser->script, obj, id, &v, &ctx->ei, NULL/*FIXME*/); + IDispatch_Release(obj); + if(FAILED(hres)) + return stack_push_string(ctx, unknownW); + + hres = typeof_string(&v, &ret); + VariantClear(&v); if(FAILED(hres)) return hres; - hres = typeof_exprval(ctx, &exprval, ei, &str); + return stack_push_string(ctx, ret); +} + +/* ECMA-262 3rd Edition 11.4.3 */ +static HRESULT interp_typeofident(exec_ctx_t *ctx) +{ + const BSTR arg = ctx->parser->code->instrs[ctx->ip].arg1.bstr; + exprval_t exprval; + const WCHAR *ret; + VARIANT v; + HRESULT hres; + + TRACE("%s\n", debugstr_w(arg)); + + hres = identifier_eval(ctx->parser->script, arg, 0, &ctx->ei, &exprval); + if(FAILED(hres)) + return hres; + + if(exprval.type == EXPRVAL_INVALID) { + hres = stack_push_string(ctx, undefinedW); + exprval_release(&exprval); + return hres; + } + + hres = exprval_to_value(ctx->parser->script, &exprval, &ctx->ei, &v); exprval_release(&exprval); if(FAILED(hres)) return hres; - ret->type = EXPRVAL_VARIANT; - V_VT(&ret->u.var) = VT_BSTR; - V_BSTR(&ret->u.var) = SysAllocString(str); - if(!V_BSTR(&ret->u.var)) - return E_OUTOFMEMORY; + hres = typeof_string(&v, &ret); + VariantClear(&v); + if(FAILED(hres)) + return hres; - return S_OK; + return stack_push_string(ctx, ret); +} + +/* ECMA-262 3rd Edition 11.4.3 */ +static HRESULT interp_typeof(exec_ctx_t *ctx) +{ + const WCHAR *ret; + VARIANT *v; + HRESULT hres; + + TRACE("\n"); + + v = stack_pop(ctx); + hres = typeof_string(v, &ret); + VariantClear(v); + if(FAILED(hres)) + return hres; + + return stack_push_string(ctx, ret); } /* ECMA-262 3rd Edition 11.4.7 */ diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index b9e6441..0c46383 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -91,6 +91,9 @@ typedef struct _func_stack { X(throw, 0, ARG_UINT, 0) \ X(tonum, 1, 0,0) \ X(tree, 1, ARG_EXPR, 0) \ + X(typeof, 1, 0,0) \ + X(typeofid, 1, 0,0) \ + X(typeofident,1, 0,0) \ X(refval, 1, 0,0) \ X(ret, 0, 0,0) \ X(sub, 1, 0,0) \ @@ -567,7 +570,6 @@ HRESULT identifier_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t* HRESULT property_value_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT delete_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT typeof_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT compiled_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 88676dd..013b7fe 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1319,7 +1319,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, - typeof_expression_eval, + compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, compiled_expression_eval,
1
0
0
0
Frédéric Delanoy : msvfw32: Use appropriate abbreviation for seconds.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 519600bdf1b7ca6617c2faefeed04c3ddd727eff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=519600bdf1b7ca6617c2faefe…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Tue Dec 13 00:26:50 2011 +0100 msvfw32: Use appropriate abbreviation for seconds. --- dlls/msvfw32/msvfw32.rc | 2 +- po/ar.po | 2 +- po/bg.po | 2 +- po/ca.po | 3 ++- po/cs.po | 2 +- po/da.po | 2 +- po/de.po | 3 ++- po/el.po | 2 +- po/en.po | 2 +- po/en_US.po | 4 ++-- po/eo.po | 2 +- po/es.po | 2 +- po/fa.po | 2 +- po/fi.po | 2 +- po/fr.po | 3 ++- po/he.po | 2 +- po/hi.po | 2 +- po/hu.po | 2 +- po/it.po | 3 ++- po/ja.po | 2 +- po/ko.po | 3 ++- po/lt.po | 3 ++- po/ml.po | 2 +- po/nb_NO.po | 2 +- po/nl.po | 3 ++- po/or.po | 2 +- po/pa.po | 2 +- po/pl.po | 3 ++- po/pt_BR.po | 2 +- po/pt_PT.po | 2 +- po/rm.po | 2 +- po/ro.po | 2 +- po/ru.po | 3 ++- po/sk.po | 2 +- po/sl.po | 2 +- po/sr_RS(a)cyrillic.po | 2 +- po/sr_RS(a)latin.po | 2 +- po/sv.po | 2 +- po/te.po | 2 +- po/th.po | 2 +- po/tr.po | 2 +- po/uk.po | 2 +- po/wa.po | 2 +- po/wine.pot | 2 +- po/zh_CN.po | 2 +- po/zh_TW.po | 2 +- 46 files changed, 56 insertions(+), 47 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=519600bdf1b7ca6617c2f…
1
0
0
0
Aurimas Fišeras : po: Update Lithuanian translation.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 36072b8243f1ab02768c1cf71baba8c2e16300fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=36072b8243f1ab02768c1cf71…
Author: Aurimas Fišeras <aurimas(a)gmail.com> Date: Fri Dec 2 19:06:48 2011 +0200 po: Update Lithuanian translation. --- po/lt.po | 72 ++++++++++++++++++++++++++++--------------------------------- 1 files changed, 33 insertions(+), 39 deletions(-) diff --git a/po/lt.po b/po/lt.po index c80b804..99c238b 100644 --- a/po/lt.po +++ b/po/lt.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
http://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2011-12-02 19:05+0300\n" +"PO-Revision-Date: 2011-12-12 21:39+0300\n" "Last-Translator: Aurimas Fišeras <aurimas(a)members.fsf.org>\n" "Language-Team: komp_lt(a)konf.lt\n" "Language: Lithuanian\n" @@ -2211,7 +2211,6 @@ msgid "Welcome to the Certificate Import Wizard" msgstr "Sveiki atvėrę liudijimo importo vediklį" #: cryptui.rc:283 -#, fuzzy msgid "" "This wizard helps you import certificates, certificate revocation lists, and " "certificate trust lists from a file to a certificate store.\n" @@ -2223,10 +2222,15 @@ msgid "" "\n" "To continue, click Next." msgstr "" +"Šis vediklis padeda jums importuoti liudijimus, atšauktų liudijimų sąrašus " +"ir patikintų liudijimų sąrašus iš failo į liudijimų saugyklą.\n" +"\n" "Liudijimas gali būti naudojamas nustatyti jūsų ar kompiuterio su kuriuo " -"esate užmezgę ryšį tapatumą. Jis taip pat gali būti naudojamas pranešimų " -"pasirašymui. Liudijimų saugyklos yra liudijimų rinkiniai, atšauktų liudijimų " -"sąrašai ir patikintų liudijimų sąrašai." +"esate užmezgę ryšį tapatumą. Jis taip pat gali būti naudojamas tapatumo " +"nustatymui ir pranešimų pasirašymui. Liudijimų saugyklos yra liudijimų, " +"atšauktų liudijimų sąrašų ir patikintų liudijimų sąrašų rinkiniai.\n" +"\n" +"Jei norite tęsti, spauskite Kitas." #: cryptui.rc:291 cryptui.rc:427 msgid "&File name:" @@ -2343,7 +2347,6 @@ msgid "Welcome to the Certificate Export Wizard" msgstr "Sveiki atvėrę liudijimo eksporto vediklį" #: cryptui.rc:373 -#, fuzzy msgid "" "This wizard helps you export certificates, certificate revocation lists, and " "certificate trust lists from a certificate store to a file.\n" @@ -2355,10 +2358,15 @@ msgid "" "\n" "To continue, click Next." msgstr "" +"Šis vediklis padeda jums eksportuoti liudijimus, atšauktų liudijimų sąrašus " +"ir patikintų liudijimų sąrašus iš liudijimų saugyklos į failą.\n" +"\n" "Liudijimas gali būti naudojamas nustatyti jūsų ar kompiuterio su kuriuo " -"esate užmezgę ryšį tapatumą. Jis taip pat gali būti naudojamas pranešimų " -"pasirašymui. Liudijimų saugyklos yra liudijimų rinkiniai, atšauktų liudijimų " -"sąrašai ir patikintų liudijimų sąrašai." +"esate užmezgę ryšį tapatumą. Jis taip pat gali būti naudojamas tapatumo " +"nustatymui ir pranešimų pasirašymui. Liudijimų saugyklos yra liudijimų, " +"atšauktų liudijimų sąrašų ir patikintų liudijimų sąrašų rinkiniai.\n" +"\n" +"Jei norite tęsti, spauskite Kitas." #: cryptui.rc:381 msgid "" @@ -3005,9 +3013,8 @@ msgid "Mapping" msgstr "Susiejimas" #: dinput.rc:53 -#, fuzzy msgid "Show Assigned First" -msgstr "Rikiuoti priskirtus" +msgstr "Iš pradžių rodyti priskirtus" #: dinput.rc:34 msgid "Action" @@ -3471,9 +3478,8 @@ msgid "Subscript out of range" msgstr "Indeksas nepatenka į rėžius" #: jscript.rc:28 -#, fuzzy msgid "Object required" -msgstr "Tikėtasi objekto" +msgstr "Reikalingas objektas" #: jscript.rc:29 msgid "Automation server can't create object" @@ -8344,7 +8350,7 @@ msgstr "Yra nesklandumų su šios svetainės liudijimu." #: wininet.rc:79 msgid "Do you want to continue anyway?" -msgstr "Ar vistiek norite tęsti?" +msgstr "Ar vis tiek norite tęsti?" #: wininet.rc:25 msgid "LAN Connection" @@ -9896,19 +9902,16 @@ msgid "N" msgstr "N" #: cmd.rc:294 -#, fuzzy msgid "File association missing for extension %1\n" -msgstr "Trūksta failo susiejimo prievardžiui %s\n" +msgstr "Trūksta failo susiejimo prievardžiui %1\n" #: cmd.rc:295 -#, fuzzy msgid "No open command associated with file type '%1'\n" -msgstr "Jokia atvėrimo komanda nesusieta su failo tipu „%s“\n" +msgstr "Jokia atvėrimo komanda nesusieta su failo tipu „%1“\n" #: cmd.rc:296 -#, fuzzy msgid "Overwrite %1" -msgstr "Perrašyti %s" +msgstr "Perrašyti %1" #: cmd.rc:297 msgid "More..." @@ -9927,23 +9930,20 @@ msgid "Syntax error\n" msgstr "Sintaksės klaida\n" #: cmd.rc:303 -#, fuzzy msgid "No help available for %1\n" -msgstr "Nėra informacijos apie %s\n" +msgstr "Nėra informacijos apie %1\n" #: cmd.rc:304 msgid "Target to GOTO not found\n" msgstr "GOTO tikslas nerastas\n" #: cmd.rc:305 -#, fuzzy msgid "Current Date is %1\n" -msgstr "Dabartinė data yra %s\n" +msgstr "Dabartinė data yra %1\n" #: cmd.rc:306 -#, fuzzy msgid "Current Time is %1\n" -msgstr "Dabartinis laikas yra %s\n" +msgstr "Dabartinis laikas yra %1\n" #: cmd.rc:307 msgid "Enter new date: " @@ -9954,9 +9954,8 @@ msgid "Enter new time: " msgstr "Įveskite naują laiką: " #: cmd.rc:309 -#, fuzzy msgid "Environment variable %1 not defined\n" -msgstr "Aplinkos kintamasis %s neapibrėžtas\n" +msgstr "Aplinkos kintamasis %1 neapibrėžtas\n" #: cmd.rc:310 xcopy.rc:38 msgid "Failed to open '%1'\n" @@ -9972,19 +9971,16 @@ msgid "A" msgstr "V" #: cmd.rc:313 -#, fuzzy msgid "%1, Delete" -msgstr "%s, šalinti" +msgstr "%1, šalinti" #: cmd.rc:314 -#, fuzzy msgid "Echo is %1\n" -msgstr "ECHO yra %s\n" +msgstr "Echo yra %1\n" #: cmd.rc:315 -#, fuzzy msgid "Verify is %1\n" -msgstr "VERIFY yra %s\n" +msgstr "Verify yra %1\n" #: cmd.rc:316 msgid "Verify must be ON or OFF\n" @@ -9995,14 +9991,13 @@ msgid "Parameter error\n" msgstr "Parametro klaida\n" #: cmd.rc:318 -#, fuzzy msgid "" "Volume in drive %1!c! is %2\n" "Volume Serial Number is %3!04x!-%4!04x!\n" "\n" msgstr "" -"Tomas diske %c yra %s\n" -"Tomo serijos numeris yra %04x-%04x\n" +"Tomas diske %1!c! yra %2\n" +"Tomo serijos numeris yra %3!04x!-%4!04x!\n" "\n" #: cmd.rc:319 @@ -10022,9 +10017,8 @@ msgid "Wine Command Prompt" msgstr "Wine komandų interpretatorius" #: cmd.rc:323 -#, fuzzy msgid "CMD Version %1!S!\n" -msgstr "CMD versija %s\n" +msgstr "CMD versija %1!S!\n" #: cmd.rc:324 msgid "More? "
1
0
0
0
Francois Gouget : include: Include ipifcons.h from ifdef.h.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 07e1e0d29b9def1fe219e76249ae712c4540816b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=07e1e0d29b9def1fe219e7624…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Dec 12 23:55:43 2011 +0100 include: Include ipifcons.h from ifdef.h. --- include/ifdef.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/ifdef.h b/include/ifdef.h index 80ab755..bdda8a2 100644 --- a/include/ifdef.h +++ b/include/ifdef.h @@ -18,6 +18,8 @@ #ifndef WINE_IFDEF_H #define WINE_IFDEF_H +#include <ipifcons.h> + typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID; typedef UINT32 NET_IF_COMPARTMENT_ID, *PNET_IF_COMPARTMENT_ID; typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID;
1
0
0
0
Francois Gouget : include: Protect mstcpip.h against multiple inclusion.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: c258dc850098cbad43451ef0bbce181aea66c478 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c258dc850098cbad43451ef0b…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Dec 12 23:54:21 2011 +0100 include: Protect mstcpip.h against multiple inclusion. --- include/mstcpip.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/mstcpip.h b/include/mstcpip.h index 55fa542..147e135 100644 --- a/include/mstcpip.h +++ b/include/mstcpip.h @@ -15,6 +15,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef __WINE_MSTCPIP_H +#define __WINE_MSTCPIP_H struct tcp_keepalive { @@ -60,3 +62,5 @@ struct tcp_keepalive #define WS_RCVALL_SOCKETLEVELONLY 2 #endif /* USE_WS_PREFIX */ + +#endif /* __WINE_MSTCPIP_H */
1
0
0
0
Francois Gouget : userenv: Add a missing include directive to userenv.h.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 48515313fd60e34bf440b9cd1fd4a42201b34d7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48515313fd60e34bf440b9cd1…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Dec 12 23:54:12 2011 +0100 userenv: Add a missing include directive to userenv.h. --- dlls/userenv/userenv_main.c | 1 + include/userenv.h | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 89fedab..f0184e5 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -28,6 +28,7 @@ #include "winternl.h" #include "winnls.h" #include "sddl.h" +#include "objbase.h" #include "userenv.h" #include "wine/debug.h" diff --git a/include/userenv.h b/include/userenv.h index de8bbe0..136c7f6 100644 --- a/include/userenv.h +++ b/include/userenv.h @@ -19,7 +19,7 @@ #ifndef __WINE_USERENV_H #define __WINE_USERENV_H -/* FIXME: #include <wbemcli.h> */ +#include <wbemcli.h> #include <profinfo.h> #define PT_TEMPORARY 0x00000001
1
0
0
0
Francois Gouget : include: Add a missing wincrypt. h include directive to mprapi.h.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 644cd0ae174e439b38be883473e4f9e11b098f58 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=644cd0ae174e439b38be88347…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Dec 12 23:53:07 2011 +0100 include: Add a missing wincrypt.h include directive to mprapi.h. Also add the USE_WC_PREFIX macro so one can cleanly deal with the CMSG_DATA conflict with sys/socket.h. --- dlls/ws2_32/socket.c | 1 + include/mprapi.h | 1 + include/wincrypt.h | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 0 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 4650f64..0d44e68 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -146,6 +146,7 @@ #include "mstcpip.h" #include "af_irda.h" #include "winnt.h" +#define USE_WC_PREFIX /* For CMSG_DATA */ #include "iphlpapi.h" #include "wine/server.h" #include "wine/debug.h" diff --git a/include/mprapi.h b/include/mprapi.h index 1860f98..4e67ff0 100644 --- a/include/mprapi.h +++ b/include/mprapi.h @@ -22,6 +22,7 @@ #include <lmcons.h> #include <ras.h> #include <in6addr.h> +#include <wincrypt.h> #define MAX_DEVICE_NAME 128 #define MAX_DEVICETYPE_NAME 16 diff --git a/include/wincrypt.h b/include/wincrypt.h index ae5aa05..1311f31 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -3432,6 +3432,7 @@ typedef struct _CERT_ID #define CERT_ID_KEY_IDENTIFIER 2 #define CERT_ID_SHA1_HASH 3 +#ifndef USE_WC_PREFIX #undef CMSG_DATA /* may be defined by sys/socket.h */ #define CMSG_DATA 1 #define CMSG_SIGNED 2 @@ -3446,6 +3447,21 @@ typedef struct _CERT_ID #define CMSG_ENVELOPED_FLAG (1 << CMSG_ENVELOPED) #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED) #define CMSG_ENCRYPTED_FLAG (1 << CMSG_ENCRYPTED) +#else +#define WC_CMSG_DATA 1 +#define WC_CMSG_SIGNED 2 +#define WC_CMSG_ENVELOPED 3 +#define WC_CMSG_SIGNED_AND_ENVELOPED 4 +#define WC_CMSG_HASHED 5 +#define WC_CMSG_ENCRYPTED 6 + +#define WC_CMSG_ALL_FLAGS ~0U +#define WC_CMSG_DATA_FLAG (1 << WC_CMSG_DATA) +#define WC_CMSG_SIGNED_FLAG (1 << WC_CMSG_SIGNED) +#define WC_CMSG_ENVELOPED_FLAG (1 << WC_CMSG_ENVELOPED) +#define WC_CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << WC_CMSG_SIGNED_AND_ENVELOPED) +#define WC_CMSG_ENCRYPTED_FLAG (1 << WC_CMSG_ENCRYPTED) +#endif typedef struct _CMSG_SIGNER_ENCODE_INFO {
1
0
0
0
Nikolay Sivov : msxml3/tests: Test switching encoding after document is started already.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 302aad9cf978694eb1c0bce99875f9bd303c0f8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=302aad9cf978694eb1c0bce99…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Dec 13 01:00:44 2011 +0300 msxml3/tests: Test switching encoding after document is started already. --- dlls/msxml3/tests/saxreader.c | 59 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 7 deletions(-) diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 7b3feea..fab4cd1 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2600,26 +2600,30 @@ static void test_mxwriter_stream(void) static void test_mxwriter_encoding(void) { - IMXWriter *writer; ISAXContentHandler *content; - HRESULT hr; + IMXWriter *writer; + IStream *stream; VARIANT dest; + HRESULT hr; + HGLOBAL g; + char *ptr; + BSTR s; hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, &IID_IMXWriter, (void**)&writer); - ok(hr == S_OK, "CoCreateInstance failed: %08x\n", hr); + EXPECT_HR(hr, S_OK); hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); - ok(hr == S_OK, "QueryInterface(ISAXContentHandler) failed: %08x\n", hr); + EXPECT_HR(hr, S_OK); hr = IMXWriter_put_encoding(writer, _bstr_("UTF-8")); - ok(hr == S_OK, "put_encoding failed: %08x\n", hr); + EXPECT_HR(hr, S_OK); hr = ISAXContentHandler_startDocument(content); - ok(hr == S_OK, "startDocument failed: %08x\n", hr); + EXPECT_HR(hr, S_OK); hr = ISAXContentHandler_endDocument(content); - ok(hr == S_OK, "endDocument failed: %08x\n", hr); + EXPECT_HR(hr, S_OK); /* The content is always re-encoded to UTF-16 when the output is * retrieved as a BSTR. @@ -2632,6 +2636,47 @@ static void test_mxwriter_encoding(void) "got wrong content: %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); + /* switch encoding when something is written already */ + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_UNKNOWN; + V_UNKNOWN(&dest) = (IUnknown*)stream; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_encoding(writer, _bstr_("UTF-8")); + EXPECT_HR(hr, S_OK); + + /* write empty element */ + hr = ISAXContentHandler_startElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1, NULL); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_endElement(content, _bstr_(""), 0, _bstr_(""), 0, _bstr_("a"), 1); + EXPECT_HR(hr, S_OK); + + /* switch */ + hr = IMXWriter_put_encoding(writer, _bstr_("UTF-16")); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_flush(writer); + EXPECT_HR(hr, S_OK); + + hr = GetHGlobalFromStream(stream, &g); + EXPECT_HR(hr, S_OK); + + ptr = GlobalLock(g); + ok(!strncmp(ptr, "<a/>", 4), "got %c%c%c%c\n", ptr[0],ptr[1],ptr[2],ptr[3]); + GlobalUnlock(g); + + /* so output is unaffected, encoding name is stored however */ + hr = IMXWriter_get_encoding(writer, &s); + EXPECT_HR(hr, S_OK); + ok(!lstrcmpW(s, _bstr_("UTF-16")), "got %s\n", wine_dbgstr_w(s)); + SysFreeString(s); + + IStream_Release(stream); + ISAXContentHandler_Release(content); IMXWriter_Release(writer);
1
0
0
0
Nikolay Sivov : ole32: Simplify stream creation, remove redundant comments.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 5b533d82d2de543a1624ecbda77e2d1a7ea370dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b533d82d2de543a1624ecbda…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Dec 13 00:43:24 2011 +0300 ole32: Simplify stream creation, remove redundant comments. --- dlls/ole32/hglobalstream.c | 175 +++++++++++--------------------------------- 1 files changed, 42 insertions(+), 133 deletions(-) diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index 860fd03..ce0f34c 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -74,46 +74,6 @@ static inline HGLOBALStreamImpl *impl_from_IStream(IStream *iface) return CONTAINING_RECORD(iface, HGLOBALStreamImpl, IStream_iface); } -/*** - * This is the destructor of the HGLOBALStreamImpl class. - * - * This method will clean-up all the resources used-up by the given HGLOBALStreamImpl - * class. The pointer passed-in to this function will be freed and will not - * be valid anymore. - */ -static void HGLOBALStreamImpl_Destroy(HGLOBALStreamImpl* This) -{ - TRACE("(%p)\n", This); - - /* - * Release the HGlobal if the constructor asked for that. - */ - if (This->deleteOnRelease) - { - GlobalFree(This->supportHandle); - This->supportHandle=0; - } - - /* - * Finally, free the memory used-up by the class. - */ - HeapFree(GetProcessHeap(), 0, This); -} - -/*** - * This implements the IUnknown method AddRef for this - * class - */ -static ULONG WINAPI HGLOBALStreamImpl_AddRef(IStream* iface) -{ - HGLOBALStreamImpl* This = impl_from_IStream(iface); - return InterlockedIncrement(&This->ref); -} - -/*** - * This implements the IUnknown method QueryInterface for this - * class - */ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( IStream* iface, REFIID riid, /* [in] */ @@ -121,20 +81,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( { HGLOBALStreamImpl* This = impl_from_IStream(iface); - /* - * Perform a sanity check on the parameters. - */ if (ppvObject==0) return E_INVALIDARG; - /* - * Initialize the return parameter. - */ *ppvObject = 0; - /* - * Compare the riid with the interface IDs implemented by this object. - */ if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_ISequentialStream, riid) || IsEqualIID(&IID_IStream, riid)) @@ -142,25 +93,20 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( *ppvObject = This; } - /* - * Check that we obtained an interface. - */ if ((*ppvObject)==0) return E_NOINTERFACE; - /* - * Query Interface always increases the reference count by one when it is - * successful - */ - HGLOBALStreamImpl_AddRef(iface); + IStream_AddRef(iface); return S_OK; } -/*** - * This implements the IUnknown method Release for this - * class - */ +static ULONG WINAPI HGLOBALStreamImpl_AddRef(IStream* iface) +{ + HGLOBALStreamImpl* This = impl_from_IStream(iface); + return InterlockedIncrement(&This->ref); +} + static ULONG WINAPI HGLOBALStreamImpl_Release( IStream* iface) { @@ -168,7 +114,15 @@ static ULONG WINAPI HGLOBALStreamImpl_Release( ULONG ref = InterlockedDecrement(&This->ref); if (!ref) - HGLOBALStreamImpl_Destroy(This); + { + if (This->deleteOnRelease) + { + GlobalFree(This->supportHandle); + This->supportHandle = NULL; + } + + HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -598,14 +552,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_Clone( hr = CreateStreamOnHGlobal(This->supportHandle, FALSE, ppstm); if(FAILED(hr)) return hr; - offset.QuadPart=(LONGLONG)This->currentPosition.QuadPart; - HGLOBALStreamImpl_Seek(*ppstm,offset,STREAM_SEEK_SET,&dummy); + offset.QuadPart = (LONGLONG)This->currentPosition.QuadPart; + IStream_Seek(*ppstm, offset, STREAM_SEEK_SET, &dummy); return S_OK; } -/* - * Virtual function table for the HGLOBALStreamImpl class. - */ static const IStreamVtbl HGLOBALStreamImplVtbl = { HGLOBALStreamImpl_QueryInterface, @@ -624,62 +575,6 @@ static const IStreamVtbl HGLOBALStreamImplVtbl = HGLOBALStreamImpl_Clone }; -/****************************************************************************** -** HGLOBALStreamImpl implementation -*/ - -/*** - * This is the constructor for the HGLOBALStreamImpl class. - * - * Params: - * hGlobal - Handle that will support the stream. can be NULL. - * fDeleteOnRelease - Flag set to TRUE if the HGLOBAL will be released - * when the IStream object is destroyed. - */ -static HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( - HGLOBAL hGlobal, - BOOL fDeleteOnRelease) -{ - HGLOBALStreamImpl* This; - - This = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); - if (This) - { - This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; - This->ref = 0; - - /* - * Initialize the support. - */ - This->supportHandle = hGlobal; - This->deleteOnRelease = fDeleteOnRelease; - - /* - * This method will allocate a handle if one is not supplied. - */ - if (!This->supportHandle) - { - This->supportHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD | - GMEM_SHARE, 0); - } - - /* - * Start the stream at the beginning. - */ - This->currentPosition.u.HighPart = 0; - This->currentPosition.u.LowPart = 0; - - /* - * Initialize the size of the stream to the size of the handle. - */ - This->streamSize.u.HighPart = 0; - This->streamSize.u.LowPart = GlobalSize(This->supportHandle); - } - - return This; -} - - /*********************************************************************** * CreateStreamOnHGlobal [OLE32.@] */ @@ -688,22 +583,36 @@ HRESULT WINAPI CreateStreamOnHGlobal( BOOL fDeleteOnRelease, LPSTREAM* ppstm) { - HGLOBALStreamImpl* newStream; + HGLOBALStreamImpl* This; if (!ppstm) return E_INVALIDARG; - newStream = HGLOBALStreamImpl_Construct(hGlobal, - fDeleteOnRelease); + This = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); + if (!This) return E_OUTOFMEMORY; - if (newStream!=NULL) - { - return IUnknown_QueryInterface((IUnknown*)newStream, - &IID_IStream, - (void**)ppstm); - } + This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; + This->ref = 1; + + /* initialize the support */ + This->supportHandle = hGlobal; + This->deleteOnRelease = fDeleteOnRelease; + + /* allocate a handle if one is not supplied */ + if (!This->supportHandle) + This->supportHandle = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE, 0); - return E_OUTOFMEMORY; + /* start at the beginning */ + This->currentPosition.u.HighPart = 0; + This->currentPosition.u.LowPart = 0; + + /* initialize the size of the stream to the size of the handle */ + This->streamSize.u.HighPart = 0; + This->streamSize.u.LowPart = GlobalSize(This->supportHandle); + + *ppstm = &This->IStream_iface; + + return S_OK; } /***********************************************************************
1
0
0
0
Nikolay Sivov : ole32: COM cleanup of IStream based on HGLOBAL.
by Alexandre Julliard
13 Dec '11
13 Dec '11
Module: wine Branch: master Commit: 5f5d5e0c6573ba46728208e7b4fb46c9eab21b22 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f5d5e0c6573ba46728208e7b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Dec 13 00:22:03 2011 +0300 ole32: COM cleanup of IStream based on HGLOBAL. --- dlls/ole32/hglobalstream.c | 114 ++++++++++++++++++-------------------------- 1 files changed, 46 insertions(+), 68 deletions(-) diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index b0055e2..860fd03 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -51,39 +51,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage); * This class implements the IStream interface and represents a stream * supported by an HGLOBAL pointer. */ -struct HGLOBALStreamImpl +typedef struct { - const IStreamVtbl *lpVtbl; /* Needs to be the first item in the struct - * since we want to cast this in an IStream pointer */ + IStream IStream_iface; + LONG ref; - /* - * Reference count - */ - LONG ref; - - /* - * Support for the stream - */ + /* support for the stream */ HGLOBAL supportHandle; - /* - * This flag is TRUE if the HGLOBAL is destroyed when the stream - * is finally released. - */ - BOOL deleteOnRelease; + /* if TRUE the HGLOBAL is destroyed when the stream is finally released */ + BOOL deleteOnRelease; - /* - * Helper variable that contains the size of the stream - */ - ULARGE_INTEGER streamSize; + /* size of the stream */ + ULARGE_INTEGER streamSize; - /* - * This is the current position of the cursor in the stream - */ - ULARGE_INTEGER currentPosition; -}; + /* current position of the cursor */ + ULARGE_INTEGER currentPosition; +} HGLOBALStreamImpl; -typedef struct HGLOBALStreamImpl HGLOBALStreamImpl; +static inline HGLOBALStreamImpl *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, HGLOBALStreamImpl, IStream_iface); +} /*** * This is the destructor of the HGLOBALStreamImpl class. @@ -115,10 +104,9 @@ static void HGLOBALStreamImpl_Destroy(HGLOBALStreamImpl* This) * This implements the IUnknown method AddRef for this * class */ -static ULONG WINAPI HGLOBALStreamImpl_AddRef( - IStream* iface) +static ULONG WINAPI HGLOBALStreamImpl_AddRef(IStream* iface) { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); return InterlockedIncrement(&This->ref); } @@ -131,7 +119,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( REFIID riid, /* [in] */ void** ppvObject) /* [iid_is][out] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); /* * Perform a sanity check on the parameters. @@ -176,20 +164,13 @@ static HRESULT WINAPI HGLOBALStreamImpl_QueryInterface( static ULONG WINAPI HGLOBALStreamImpl_Release( IStream* iface) { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; - ULONG newRef; - - newRef = InterlockedDecrement(&This->ref); + HGLOBALStreamImpl* This= impl_from_IStream(iface); + ULONG ref = InterlockedDecrement(&This->ref); - /* - * If the reference count goes down to 0, perform suicide. - */ - if (newRef==0) - { + if (!ref) HGLOBALStreamImpl_Destroy(This); - } - return newRef; + return ref; } /*** @@ -207,7 +188,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( ULONG cb, /* [in] */ ULONG* pcbRead) /* [out] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); void* supportBuffer; ULONG bytesReadBuffer; @@ -281,7 +262,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( ULONG cb, /* [in] */ ULONG* pcbWritten) /* [out] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); void* supportBuffer; ULARGE_INTEGER newSize; @@ -363,7 +344,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Seek( DWORD dwOrigin, /* [in] */ ULARGE_INTEGER* plibNewPosition) /* [out] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); ULARGE_INTEGER newPosition = This->currentPosition; HRESULT hr = S_OK; @@ -428,7 +409,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_SetSize( IStream* iface, ULARGE_INTEGER libNewSize) /* [in] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); HGLOBAL supportHandle; TRACE("(%p, %d)\n", iface, libNewSize.u.LowPart); @@ -593,7 +574,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Stat( STATSTG* pstatstg, /* [out] */ DWORD grfStatFlag) /* [in] */ { - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + HGLOBALStreamImpl* This = impl_from_IStream(iface); memset(pstatstg, 0, sizeof(STATSTG)); @@ -608,12 +589,13 @@ static HRESULT WINAPI HGLOBALStreamImpl_Clone( IStream* iface, IStream** ppstm) /* [out] */ { + HGLOBALStreamImpl* This = impl_from_IStream(iface); ULARGE_INTEGER dummy; LARGE_INTEGER offset; HRESULT hr; - HGLOBALStreamImpl* const This=(HGLOBALStreamImpl*)iface; + TRACE(" Cloning %p (deleteOnRelease=%d seek position=%ld)\n",iface,This->deleteOnRelease,(long)This->currentPosition.QuadPart); - hr=CreateStreamOnHGlobal(This->supportHandle, FALSE, ppstm); + hr = CreateStreamOnHGlobal(This->supportHandle, FALSE, ppstm); if(FAILED(hr)) return hr; offset.QuadPart=(LONGLONG)This->currentPosition.QuadPart; @@ -624,7 +606,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Clone( /* * Virtual function table for the HGLOBALStreamImpl class. */ -static const IStreamVtbl HGLOBALStreamImpl_Vtbl = +static const IStreamVtbl HGLOBALStreamImplVtbl = { HGLOBALStreamImpl_QueryInterface, HGLOBALStreamImpl_AddRef, @@ -658,47 +640,43 @@ static HGLOBALStreamImpl* HGLOBALStreamImpl_Construct( HGLOBAL hGlobal, BOOL fDeleteOnRelease) { - HGLOBALStreamImpl* newStream; + HGLOBALStreamImpl* This; - newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); - - if (newStream!=0) + This = HeapAlloc(GetProcessHeap(), 0, sizeof(HGLOBALStreamImpl)); + if (This) { - /* - * Set-up the virtual function table and reference count. - */ - newStream->lpVtbl = &HGLOBALStreamImpl_Vtbl; - newStream->ref = 0; + This->IStream_iface.lpVtbl = &HGLOBALStreamImplVtbl; + This->ref = 0; /* * Initialize the support. */ - newStream->supportHandle = hGlobal; - newStream->deleteOnRelease = fDeleteOnRelease; + This->supportHandle = hGlobal; + This->deleteOnRelease = fDeleteOnRelease; /* * This method will allocate a handle if one is not supplied. */ - if (!newStream->supportHandle) + if (!This->supportHandle) { - newStream->supportHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD | + This->supportHandle = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD | GMEM_SHARE, 0); } /* * Start the stream at the beginning. */ - newStream->currentPosition.u.HighPart = 0; - newStream->currentPosition.u.LowPart = 0; + This->currentPosition.u.HighPart = 0; + This->currentPosition.u.LowPart = 0; /* * Initialize the size of the stream to the size of the handle. */ - newStream->streamSize.u.HighPart = 0; - newStream->streamSize.u.LowPart = GlobalSize(newStream->supportHandle); + This->streamSize.u.HighPart = 0; + This->streamSize.u.LowPart = GlobalSize(This->supportHandle); } - return newStream; + return This; } @@ -743,7 +721,7 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal) /* * Verify that the stream object was created with CreateStreamOnHGlobal. */ - if (pStream->lpVtbl == &HGLOBALStreamImpl_Vtbl) + if (pStream->IStream_iface.lpVtbl == &HGLOBALStreamImplVtbl) *phglobal = pStream->supportHandle; else {
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200