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
August 2009
----- 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
1042 discussions
Start a n
N
ew thread
Piotr Caban : jscript: Inherit some Number functions from Object.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 9f0969fbcbc094c804855941c005afa693bfa8f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9f0969fbcbc094c804855941c…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Wed Aug 12 12:48:34 2009 +0200 jscript: Inherit some Number functions from Object. --- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/number.c | 42 +++++++----------------------------------- dlls/jscript/tests/api.js | 1 + 4 files changed, 10 insertions(+), 37 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 42dad41..8229f24 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -770,7 +770,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_number_constr(ctx, &ctx->number_constr); + hres = create_number_constr(ctx, object_prototype, &ctx->number_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 4db58fc..a585b4f 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -229,7 +229,7 @@ HRESULT create_array_constr(script_ctx_t*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); HRESULT create_date_constr(script_ctx_t*,DispatchEx**); HRESULT init_error_constr(script_ctx_t*); -HRESULT create_number_constr(script_ctx_t*,DispatchEx**); +HRESULT create_number_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_regexp_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_string_constr(script_ctx_t*,DispatchEx*,DispatchEx**); diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c index 0aeeab6..e6f6ef7 100644 --- a/dlls/jscript/number.c +++ b/dlls/jscript/number.c @@ -36,10 +36,6 @@ static const WCHAR toFixedW[] = {'t','o','F','i','x','e','d',0}; static const WCHAR toExponentialW[] = {'t','o','E','x','p','o','n','e','n','t','i','a','l',0}; static const WCHAR toPrecisionW[] = {'t','o','P','r','e','c','i','s','i','o','n',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; #define NUMBER_TOSTRING_BUF_SIZE 64 /* ECMA-262 3rd Edition 15.7.4.2 */ @@ -214,27 +210,6 @@ static HRESULT Number_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR return S_OK; } -static HRESULT Number_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Number_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Number_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Number_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -256,9 +231,6 @@ static HRESULT Number_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM } static const builtin_prop_t Number_props[] = { - {hasOwnPropertyW, Number_hasOwnProperty, PROPF_METHOD}, - {isPrototypeOfW, Number_isPrototypeOf, PROPF_METHOD}, - {propertyIsEnumerableW, Number_propertyIsEnumerable, PROPF_METHOD}, {toExponentialW, Number_toExponential, PROPF_METHOD}, {toFixedW, Number_toFixed, PROPF_METHOD}, {toLocaleStringW, Number_toLocaleString, PROPF_METHOD}, @@ -330,7 +302,7 @@ static HRESULT NumberConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS return S_OK; } -static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance **ret) +static HRESULT alloc_number(script_ctx_t *ctx, DispatchEx *object_prototype, NumberInstance **ret) { NumberInstance *number; HRESULT hres; @@ -339,10 +311,10 @@ static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance * if(!number) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&number->dispex, ctx, &Number_info, ctx->number_constr); + if(object_prototype) + hres = init_dispex(&number->dispex, ctx, &Number_info, object_prototype); else - hres = init_dispex(&number->dispex, ctx, &Number_info, NULL); + hres = init_dispex_from_constr(&number->dispex, ctx, &Number_info, ctx->number_constr); if(FAILED(hres)) return hres; @@ -350,12 +322,12 @@ static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance * return S_OK; } -HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { NumberInstance *number; HRESULT hres; - hres = alloc_number(ctx, FALSE, &number); + hres = alloc_number(ctx, object_prototype, &number); if(FAILED(hres)) return hres; @@ -371,7 +343,7 @@ HRESULT create_number(script_ctx_t *ctx, VARIANT *num, DispatchEx **ret) NumberInstance *number; HRESULT hres; - hres = alloc_number(ctx, TRUE, &number); + hres = alloc_number(ctx, NULL, &number); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 8db2bc9..88df15a 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1380,5 +1380,6 @@ function testObjectInherit(obj, ts, tls, vo) { Object.prototype._test = "test"; testObjectInherit(new String("test"), false, true, false); testObjectInherit(/test/g, false, true, true); +testObjectInherit(new Number(1), false, false, false); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some RegExp functions from Object.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 5d41205654ea144f99a580d8677a672d1e607a18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d41205654ea144f99a580d86…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Wed Aug 12 12:48:15 2009 +0200 jscript: Inherit some RegExp functions from Object. --- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/regexp.c | 51 ++++++-------------------------------------- dlls/jscript/tests/api.js | 5 ++- 4 files changed, 12 insertions(+), 48 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 9991f08..42dad41 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -774,7 +774,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_regexp_constr(ctx, &ctx->regexp_constr); + hres = create_regexp_constr(ctx, object_prototype, &ctx->regexp_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 63654f7..4db58fc 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -231,7 +231,7 @@ HRESULT create_date_constr(script_ctx_t*,DispatchEx**); HRESULT init_error_constr(script_ctx_t*); HRESULT create_number_constr(script_ctx_t*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); -HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**); +HRESULT create_regexp_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_string_constr(script_ctx_t*,DispatchEx*,DispatchEx**); typedef struct { diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c index a4d640e..5fe99ab 100644 --- a/dlls/jscript/regexp.c +++ b/dlls/jscript/regexp.c @@ -90,11 +90,6 @@ static const WCHAR ignoreCaseW[] = {'i','g','n','o','r','e','C','a','s','e',0}; static const WCHAR multilineW[] = {'m','u','l','t','i','l','i','n','e',0}; static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0}; static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; -static const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR execW[] = {'e','x','e','c',0}; static const WCHAR testW[] = {'t','e','s','t',0}; @@ -3471,34 +3466,6 @@ static HRESULT RegExp_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA return E_NOTIMPL; } -static HRESULT RegExp_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT RegExp_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_exec(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -3542,15 +3509,11 @@ static void RegExp_destructor(DispatchEx *dispex) static const builtin_prop_t RegExp_props[] = { {execW, RegExp_exec, PROPF_METHOD}, {globalW, RegExp_global, 0}, - {hasOwnPropertyW, RegExp_hasOwnProperty, PROPF_METHOD}, {ignoreCaseW, RegExp_ignoreCase, 0}, - {isPrototypeOfW, RegExp_isPrototypeOf, PROPF_METHOD}, {lastIndexW, RegExp_lastIndex, 0}, {multilineW, RegExp_multiline, 0}, - {propertyIsEnumerableW, RegExp_propertyIsEnumerable, PROPF_METHOD}, {sourceW, RegExp_source, 0}, {testW, RegExp_test, PROPF_METHOD}, - {toLocaleStringW, RegExp_toLocaleString, PROPF_METHOD}, {toStringW, RegExp_toString, PROPF_METHOD} }; @@ -3563,7 +3526,7 @@ static const builtin_info_t RegExp_info = { NULL }; -static HRESULT alloc_regexp(script_ctx_t *ctx, BOOL use_constr, RegExpInstance **ret) +static HRESULT alloc_regexp(script_ctx_t *ctx, DispatchEx *object_prototype, RegExpInstance **ret) { RegExpInstance *regexp; HRESULT hres; @@ -3572,10 +3535,10 @@ static HRESULT alloc_regexp(script_ctx_t *ctx, BOOL use_constr, RegExpInstance * if(!regexp) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(®exp->dispex, ctx, &RegExp_info, ctx->regexp_constr); + if(object_prototype) + hres = init_dispex(®exp->dispex, ctx, &RegExp_info, object_prototype); else - hres = init_dispex(®exp->dispex, ctx, &RegExp_info, NULL); + hres = init_dispex_from_constr(®exp->dispex, ctx, &RegExp_info, ctx->regexp_constr); if(FAILED(hres)) { heap_free(regexp); @@ -3593,7 +3556,7 @@ static HRESULT create_regexp(script_ctx_t *ctx, const WCHAR *exp, int len, DWORD TRACE("%s %x\n", debugstr_w(exp), flags); - hres = alloc_regexp(ctx, TRUE, ®exp); + hres = alloc_regexp(ctx, NULL, ®exp); if(FAILED(hres)) return hres; @@ -3694,12 +3657,12 @@ static HRESULT RegExpConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS return S_OK; } -HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_regexp_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { RegExpInstance *regexp; HRESULT hres; - hres = alloc_regexp(ctx, FALSE, ®exp); + hres = alloc_regexp(ctx, object_prototype, ®exp); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 7cb1f56..8db2bc9 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1374,10 +1374,11 @@ function testObjectInherit(obj, ts, tls, vo) { ok(obj.valueOf != Object.prototype.valueOf, "obj.valueOf == Object.prototype.valueOf"); - ok(obj.test === "test", "obj.test = " + obj.test); + ok(obj._test === "test", "obj.test = " + obj._test); } -Object.prototype.test = "test"; +Object.prototype._test = "test"; testObjectInherit(new String("test"), false, true, false); +testObjectInherit(/test/g, false, true, true); reportSuccess();
1
0
0
0
Piotr Caban : jscript: Inherit some String functions from Object.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 79f45c5374e587019feda40d6d7273c023f4e536 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79f45c5374e587019feda40d6…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Wed Aug 12 12:47:53 2009 +0200 jscript: Inherit some String functions from Object. --- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.h | 2 +- dlls/jscript/string.c | 42 +++++++----------------------------------- dlls/jscript/tests/api.js | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 37 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index ff3510f..9991f08 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -778,7 +778,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype if(FAILED(hres)) return hres; - hres = create_string_constr(ctx, &ctx->string_constr); + hres = create_string_constr(ctx, object_prototype, &ctx->string_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 70c9fea..63654f7 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -232,7 +232,7 @@ HRESULT init_error_constr(script_ctx_t*); HRESULT create_number_constr(script_ctx_t*,DispatchEx**); HRESULT create_object_constr(script_ctx_t*,DispatchEx*,DispatchEx**); HRESULT create_regexp_constr(script_ctx_t*,DispatchEx**); -HRESULT create_string_constr(script_ctx_t*,DispatchEx**); +HRESULT create_string_constr(script_ctx_t*,DispatchEx*,DispatchEx**); typedef struct { const WCHAR *str; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 4cf3783..04d5017 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -62,10 +62,6 @@ static const WCHAR toUpperCaseW[] = {'t','o','U','p','p','e','r','C','a','s','e' static const WCHAR toLocaleLowerCaseW[] = {'t','o','L','o','c','a','l','e','L','o','w','e','r','C','a','s','e',0}; static const WCHAR toLocaleUpperCaseW[] = {'t','o','L','o','c','a','l','e','U','p','p','e','r','C','a','s','e',0}; static const WCHAR localeCompareW[] = {'l','o','c','a','l','e','C','o','m','p','a','r','e',0}; -static const WCHAR hasOwnPropertyW[] = {'h','a','s','O','w','n','P','r','o','p','e','r','t','y',0}; -static const WCHAR propertyIsEnumerableW[] = - {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; -static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR fromCharCodeW[] = {'f','r','o','m','C','h','a','r','C','o','d','e',0}; static HRESULT String_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -1511,27 +1507,6 @@ static HRESULT String_localeCompare(DispatchEx *dispex, LCID lcid, WORD flags, D return E_NOTIMPL; } -static HRESULT String_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT String_propertyIsEnumerable(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT String_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, - VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT String_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { @@ -1578,16 +1553,13 @@ static const builtin_prop_t String_props[] = { {fixedW, String_fixed, PROPF_METHOD}, {fontcolorW, String_fontcolor, PROPF_METHOD}, {fontsizeW, String_fontsize, PROPF_METHOD}, - {hasOwnPropertyW, String_hasOwnProperty, PROPF_METHOD}, {indexOfW, String_indexOf, PROPF_METHOD}, - {isPrototypeOfW, String_isPrototypeOf, PROPF_METHOD}, {italicsW, String_italics, PROPF_METHOD}, {lastIndexOfW, String_lastIndexOf, PROPF_METHOD}, {lengthW, String_length, 0}, {linkW, String_link, PROPF_METHOD}, {localeCompareW, String_localeCompare, PROPF_METHOD}, {matchW, String_match, PROPF_METHOD}, - {propertyIsEnumerableW, String_propertyIsEnumerable, PROPF_METHOD}, {replaceW, String_replace, PROPF_METHOD}, {searchW, String_search, PROPF_METHOD}, {sliceW, String_slice, PROPF_METHOD}, @@ -1703,7 +1675,7 @@ static HRESULT StringConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS return S_OK; } -static HRESULT string_alloc(script_ctx_t *ctx, BOOL use_constr, StringInstance **ret) +static HRESULT string_alloc(script_ctx_t *ctx, DispatchEx *object_prototype, StringInstance **ret) { StringInstance *string; HRESULT hres; @@ -1712,10 +1684,10 @@ static HRESULT string_alloc(script_ctx_t *ctx, BOOL use_constr, StringInstance * if(!string) return E_OUTOFMEMORY; - if(use_constr) - hres = init_dispex_from_constr(&string->dispex, ctx, &String_info, ctx->string_constr); + if(object_prototype) + hres = init_dispex(&string->dispex, ctx, &String_info, object_prototype); else - hres = init_dispex(&string->dispex, ctx, &String_info, NULL); + hres = init_dispex_from_constr(&string->dispex, ctx, &String_info, ctx->string_constr); if(FAILED(hres)) { heap_free(string); return hres; @@ -1738,12 +1710,12 @@ static const builtin_info_t StringConstr_info = { NULL }; -HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx **ret) +HRESULT create_string_constr(script_ctx_t *ctx, DispatchEx *object_prototype, DispatchEx **ret) { StringInstance *string; HRESULT hres; - hres = string_alloc(ctx, FALSE, &string); + hres = string_alloc(ctx, object_prototype, &string); if(FAILED(hres)) return hres; @@ -1758,7 +1730,7 @@ HRESULT create_string(script_ctx_t *ctx, const WCHAR *str, DWORD len, DispatchEx StringInstance *string; HRESULT hres; - hres = string_alloc(ctx, TRUE, &string); + hres = string_alloc(ctx, NULL, &string); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 15b4b57..7cb1f56 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -1345,4 +1345,39 @@ exception_test(function() {eval("while(")}, "SyntaxError", -2146827286); exception_test(function() {eval("if(")}, "SyntaxError", -2146827286); exception_test(function() {eval("'unterminated")}, "SyntaxError", -2146827273); +function testObjectInherit(obj, ts, tls, vo) { + ok(obj.hasOwnProperty === Object.prototype.hasOwnProperty, + "obj.hasOwnProperty !== Object.prototype.hasOwnProprty"); + ok(obj.isPrototypeOf === Object.prototype.isPrototypeOf, + "obj.isPrototypeOf !== Object.prototype.isPrototypeOf"); + ok(obj.propertyIsEnumerable === Object.prototype.propertyIsEnumerable, + "obj.propertyIsEnumerable !== Object.prototype.propertyIsEnumerable"); + + if(ts) + ok(obj.toString === Object.prototype.toString, + "obj.toString !== Object.prototype.toString"); + else + ok(obj.toString != Object.prototype.toString, + "obj.toString == Object.prototype.toString"); + + if(tls) + ok(obj.toLocaleString === Object.prototype.toLocaleString, + "obj.toLocaleString !== Object.prototype.toLocaleString"); + else + ok(obj.toLocaleString != Object.prototype.toLocaleString, + "obj.toLocaleString == Object.prototype.toLocaleString"); + + if(vo) + ok(obj.valueOf === Object.prototype.valueOf, + "obj.valueOf !== Object.prototype.valueOf"); + else + ok(obj.valueOf != Object.prototype.valueOf, + "obj.valueOf == Object.prototype.valueOf"); + + ok(obj.test === "test", "obj.test = " + obj.test); +} + +Object.prototype.test = "test"; +testObjectInherit(new String("test"), false, true, false); + reportSuccess();
1
0
0
0
Nikolay Sivov : comctl32/treeview: Fix test failure on Vista.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 1dfd55ff9a54f3883e82772006f0d3c9a9a07d32 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1dfd55ff9a54f3883e8277200…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Aug 12 15:52:36 2009 +0400 comctl32/treeview: Fix test failure on Vista. --- dlls/comctl32/tests/treeview.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 7b45626..3091127 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -94,6 +94,7 @@ static const struct message focus_seq[] = { { WM_PAINT, sent|defwinproc }, { WM_IME_SETCONTEXT, sent|defwinproc|optional }, { WM_COMMAND, sent|wparam|defwinproc, MAKEWPARAM(0, EN_SETFOCUS) }, + { WM_ERASEBKGND, sent|defwinproc|optional }, { WM_CTLCOLOREDIT, sent|defwinproc|optional }, { WM_CTLCOLOREDIT, sent|defwinproc|optional }, { 0 }
1
0
0
0
Nikolay Sivov : comctl32/treeview: Fix some test failures on XP and higher.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 4a9a4328416d8c287d25562972c4da8021e55973 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a9a4328416d8c287d2556297…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Aug 12 14:44:54 2009 +0400 comctl32/treeview: Fix some test failures on XP and higher. --- dlls/comctl32/tests/treeview.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 5cfaf20..7b45626 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -167,6 +167,8 @@ static const struct message TestGetSetTextColorSeq[] = { static const struct message TestGetSetToolTipsSeq[] = { { WM_KILLFOCUS, sent }, + { WM_IME_SETCONTEXT, sent|optional }, + { WM_IME_NOTIFY, sent|optional }, { TVM_SETTOOLTIPS, sent|wparam|lparam, 0, 0 }, { TVM_GETTOOLTIPS, sent|wparam|lparam, 0, 0 }, { 0 }
1
0
0
0
Alexandre Julliard : ntdll: Add a ret to DEFINE_REGS_ENTRYPOINT to make copy protections happy.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: b46cf438f8366e667c08ef2d5464c08b4c656cb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b46cf438f8366e667c08ef2d5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Aug 12 14:35:43 2009 +0200 ntdll: Add a ret to DEFINE_REGS_ENTRYPOINT to make copy protections happy. --- dlls/kernel32/kernel_private.h | 3 ++- dlls/ntdll/ntdll_misc.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h index 39a5e23..20f6399 100644 --- a/dlls/kernel32/kernel_private.h +++ b/dlls/kernel32/kernel_private.h @@ -152,7 +152,8 @@ extern HANDLE get_BaseNamedObjects_handle(void); ".byte 0x68\n\t" /* pushl $__regs_func */ \ ".long " __ASM_NAME("__regs_") #name "-.-11\n\t" \ ".byte 0x6a," #args "\n\t" /* pushl $args */ \ - "call " __ASM_NAME("__wine_call_from_32_regs")) + "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \ + "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ #endif #endif diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index ea2234a..06b5d4c 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -233,7 +233,8 @@ static inline struct ntdll_thread_regs *ntdll_get_thread_regs(void) ".byte 0x68\n\t" /* pushl $__regs_func */ \ ".long " __ASM_NAME("__regs_") #name "-.-11\n\t" \ ".byte 0x6a," #args "\n\t" /* pushl $args */ \ - "call " __ASM_NAME("__wine_call_from_32_regs")) + "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \ + "ret $(4*" #args ")" ) /* fake ret to make copy protections happy */ #elif defined(__x86_64__) #define DEFINE_REGS_ENTRYPOINT( name, args ) \ __ASM_GLOBAL_FUNC( name, \
1
0
0
0
Vincent Povirk : windowscodecs: Implement WriteSource for BMP frame encoder .
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 2df20cb92160e3642f7e5ebde3ef4a490fe9be47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2df20cb92160e3642f7e5ebde…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 11 17:32:51 2009 -0500 windowscodecs: Implement WriteSource for BMP frame encoder. --- dlls/windowscodecs/bmpencode.c | 61 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 963de6e..a545103 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -246,8 +246,65 @@ static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIBitmapSource, WICRect *prc) { - FIXME("(%p,%p,%p): stub\n", iface, pIBitmapSource, prc); - return E_NOTIMPL; + BmpFrameEncode *This = (BmpFrameEncode*)iface; + HRESULT hr; + WICRect rc; + WICPixelFormatGUID guid; + TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc); + + if (!This->initialized || !This->width || !This->height) + return WINCODEC_ERR_WRONGSTATE; + + if (!This->format) + { + hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid); + if (FAILED(hr)) return hr; + hr = BmpFrameEncode_SetPixelFormat(iface, &guid); + if (FAILED(hr)) return hr; + } + + hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid); + if (FAILED(hr)) return hr; + if (memcmp(&guid, This->format->guid, sizeof(GUID)) != 0) + { + /* should use WICConvertBitmapSource to convert, but that's unimplemented */ + ERR("format %s unsupported\n", debugstr_guid(&guid)); + return E_FAIL; + } + + if (This->xres == 0.0 || This->yres == 0.0) + { + double xres, yres; + hr = IWICBitmapSource_GetResolution(pIBitmapSource, &xres, &yres); + if (FAILED(hr)) return hr; + hr = BmpFrameEncode_SetResolution(iface, xres, yres); + if (FAILED(hr)) return hr; + } + + if (!prc) + { + UINT width, height; + hr = IWICBitmapSource_GetSize(pIBitmapSource, &width, &height); + if (FAILED(hr)) return hr; + rc.X = 0; + rc.Y = 0; + rc.Width = width; + rc.Height = height; + prc = &rc; + } + + if (prc->Width != This->width) return E_INVALIDARG; + + hr = BmpFrameEncode_AllocateBits(This); + if (FAILED(hr)) return hr; + + hr = IWICBitmapSource_CopyPixels(pIBitmapSource, prc, This->stride, + This->stride*(This->height-This->lineswritten), + This->bits + This->stride*This->lineswritten); + + This->lineswritten += rc.Height; + + return S_OK; } static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
1
0
0
0
Vincent Povirk : windowscodecs: Implement Commit for BMP encoder.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 22bfe27fb0d1e46bea29b36f3c56f8a555458a00 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22bfe27fb0d1e46bea29b36f3…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 11 17:19:32 2009 -0500 windowscodecs: Implement Commit for BMP encoder. --- dlls/windowscodecs/bmpencode.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 869a60e..963de6e 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -483,8 +483,13 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + BmpEncoder *This = (BmpEncoder*)iface; + BmpFrameEncode *frame = (BmpFrameEncode*)This->frame; + TRACE("(%p)\n", iface); + + if (!frame || !frame->committed) return WINCODEC_ERR_WRONGSTATE; + + return S_OK; } static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter(IWICBitmapEncoder *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement Commit for BMP frame encoder.
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 7cc0fd4fdea26918c14f9bd6c9b8225f55256146 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7cc0fd4fdea26918c14f9bd6c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 11 17:17:31 2009 -0500 windowscodecs: Implement Commit for BMP frame encoder. --- dlls/windowscodecs/bmpencode.c | 55 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 67282b9..869a60e 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -61,6 +61,7 @@ typedef struct BmpFrameEncode { double xres, yres; UINT lineswritten; UINT stride; + BOOL committed; } BmpFrameEncode; static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, @@ -251,8 +252,57 @@ static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + BmpFrameEncode *This = (BmpFrameEncode*)iface; + BITMAPFILEHEADER bfh; + BITMAPV5HEADER bih; + UINT info_size; + LARGE_INTEGER pos; + ULONG byteswritten; + HRESULT hr; + + TRACE("(%p)\n", iface); + + if (!This->bits || This->committed || This->height != This->lineswritten) + return WINCODEC_ERR_WRONGSTATE; + + bfh.bfType = 0x4d42; /* "BM" */ + bfh.bfReserved1 = 0; + bfh.bfReserved2 = 0; + + bih.bV5Size = info_size = sizeof(BITMAPINFOHEADER); + bih.bV5Width = This->width; + bih.bV5Height = -This->height; /* top-down bitmap */ + bih.bV5Planes = 1; + bih.bV5BitCount = This->format->bpp; + bih.bV5Compression = This->format->compression; + bih.bV5SizeImage = This->stride*This->height; + bih.bV5XPelsPerMeter = (This->xres-0.0127) / 0.0254; + bih.bV5YPelsPerMeter = (This->yres-0.0127) / 0.0254; + bih.bV5ClrUsed = 0; + bih.bV5ClrImportant = 0; + + bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage; + bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size; + + pos.QuadPart = 0; + hr = IStream_Seek(This->stream, pos, STREAM_SEEK_SET, NULL);\ + if (FAILED(hr)) return hr; + + hr = IStream_Write(This->stream, &bfh, sizeof(BITMAPFILEHEADER), &byteswritten); + if (FAILED(hr)) return hr; + if (byteswritten != sizeof(BITMAPFILEHEADER)) return E_FAIL; + + hr = IStream_Write(This->stream, &bih, info_size, &byteswritten); + if (FAILED(hr)) return hr; + if (byteswritten != info_size) return E_FAIL; + + hr = IStream_Write(This->stream, This->bits, bih.bV5SizeImage, &byteswritten); + if (FAILED(hr)) return hr; + if (byteswritten != bih.bV5SizeImage) return E_FAIL; + + This->committed = TRUE; + + return S_OK; } static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, @@ -423,6 +473,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, encode->xres = 0.0; encode->yres = 0.0; encode->lineswritten = 0; + encode->committed = FALSE; *ppIFrameEncode = (IWICBitmapFrameEncode*)encode; This->frame = (IWICBitmapFrameEncode*)encode;
1
0
0
0
Vincent Povirk : windowscodecs: Implement WritePixels for BMP frame encoder .
by Alexandre Julliard
12 Aug '09
12 Aug '09
Module: wine Branch: master Commit: 4d1d92f87fe60f90443788d33155d83591a503c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d1d92f87fe60f90443788d33…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Aug 11 16:55:59 2009 -0500 windowscodecs: Implement WritePixels for BMP frame encoder. --- dlls/windowscodecs/bmpencode.c | 45 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index 8e209fb..67282b9 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -59,6 +59,8 @@ typedef struct BmpFrameEncode { BYTE *bits; const struct bmp_pixelformat *format; double xres, yres; + UINT lineswritten; + UINT stride; } BmpFrameEncode; static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, @@ -104,6 +106,7 @@ static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface) if (ref == 0) { if (This->stream) IStream_Release(This->stream); + HeapFree(GetProcessHeap(), 0, This->bits); HeapFree(GetProcessHeap(), 0, This); } @@ -195,11 +198,48 @@ static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, return WINCODEC_ERR_UNSUPPORTEDOPERATION; } +static HRESULT BmpFrameEncode_AllocateBits(BmpFrameEncode *This) +{ + if (!This->bits) + { + if (!This->initialized || !This->width || !This->height || !This->format) + return WINCODEC_ERR_WRONGSTATE; + + This->stride = (((This->width * This->format->bpp)+31)/32)*4; + This->bits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->stride * This->height); + if (!This->bits) return E_OUTOFMEMORY; + } + + return S_OK; +} + static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, UINT lineCount, UINT cbStride, UINT cbBufferSize, BYTE *pbPixels) { - FIXME("(%p,%u,%u,%u,%p): stub\n", iface, lineCount, cbStride, cbBufferSize, pbPixels); - return E_NOTIMPL; + BmpFrameEncode *This = (BmpFrameEncode*)iface; + HRESULT hr; + WICRect rc; + TRACE("(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels); + + if (!This->initialized || !This->width || !This->height || !This->format) + return WINCODEC_ERR_WRONGSTATE; + + hr = BmpFrameEncode_AllocateBits(This); + if (FAILED(hr)) return hr; + + rc.X = 0; + rc.Y = 0; + rc.Width = This->width; + rc.Height = lineCount; + + hr = copy_pixels(This->format->bpp, pbPixels, This->width, lineCount, cbStride, + &rc, This->stride, This->stride*(This->height-This->lineswritten), + This->bits + This->stride*This->lineswritten); + + if (SUCCEEDED(hr)) + This->lineswritten += lineCount; + + return hr; } static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, @@ -382,6 +422,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, encode->format = NULL; encode->xres = 0.0; encode->yres = 0.0; + encode->lineswritten = 0; *ppIFrameEncode = (IWICBitmapFrameEncode*)encode; This->frame = (IWICBitmapFrameEncode*)encode;
1
0
0
0
← Newer
1
...
66
67
68
69
70
71
72
...
105
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Results per page:
10
25
50
100
200