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 2019
----- 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
1 participants
635 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : jscript: Implement ScriptTypeInfo_GetTypeAttr.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 89c0b42fc6d71577bb34480c58e27a2630eac7b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=89c0b42fc6d71577bb34480c…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Dec 12 14:53:56 2019 +0200 jscript: Implement ScriptTypeInfo_GetTypeAttr. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/dispex.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 6c6d25a9c1..ef002e4c7e 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -25,6 +25,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); +static const GUID GUID_JScriptTypeInfo = {0xc59c6b12,0xf6c1,0x11cf,{0x88,0x35,0x00,0xa0,0xc9,0x11,0xe8,0xb2}}; + #define FDEX_VERSION_MASK 0xf0000000 #define GOLDEN_RATIO 0x9E3779B9U @@ -678,10 +680,32 @@ static ULONG WINAPI ScriptTypeInfo_Release(ITypeInfo *iface) static HRESULT WINAPI ScriptTypeInfo_GetTypeAttr(ITypeInfo *iface, TYPEATTR **ppTypeAttr) { ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface); - - FIXME("(%p)->(%p)\n", This, ppTypeAttr); - - return E_NOTIMPL; + TYPEATTR *attr; + + TRACE("(%p)->(%p)\n", This, ppTypeAttr); + + if (!ppTypeAttr) return E_INVALIDARG; + + attr = heap_alloc_zero(sizeof(*attr)); + if (!attr) return E_OUTOFMEMORY; + + attr->guid = GUID_JScriptTypeInfo; + attr->lcid = LOCALE_USER_DEFAULT; + attr->memidConstructor = MEMBERID_NIL; + attr->memidDestructor = MEMBERID_NIL; + attr->cbSizeInstance = 4; + attr->typekind = TKIND_DISPATCH; + attr->cFuncs = This->num_funcs; + attr->cVars = This->num_vars; + attr->cImplTypes = 1; + attr->cbSizeVft = sizeof(IDispatchVtbl); + attr->cbAlignment = 4; + attr->wTypeFlags = TYPEFLAG_FDISPATCHABLE; + attr->wMajorVerNum = JSCRIPT_MAJOR_VERSION; + attr->wMinorVerNum = JSCRIPT_MINOR_VERSION; + + *ppTypeAttr = attr; + return S_OK; } static HRESULT WINAPI ScriptTypeInfo_GetTypeComp(ITypeInfo *iface, ITypeComp **ppTComp) @@ -829,7 +853,9 @@ static void WINAPI ScriptTypeInfo_ReleaseTypeAttr(ITypeInfo *iface, TYPEATTR *pT { ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface); - FIXME("(%p)->(%p)\n", This, pTypeAttr); + TRACE("(%p)->(%p)\n", This, pTypeAttr); + + heap_free(pTypeAttr); } static void WINAPI ScriptTypeInfo_ReleaseFuncDesc(ITypeInfo *iface, FUNCDESC *pFuncDesc)
1
0
0
0
Gabriel Ivăncescu : jscript: Store the necessary function and variable info in the TypeInfo.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 94bd9ab8a900e5c6e82b392bc53002dd7e693d46 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=94bd9ab8a900e5c6e82b392b…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Dec 12 14:53:55 2019 +0200 jscript: Store the necessary function and variable info in the TypeInfo. The TypeInfo is built when it is retrieved and frozen at that moment, even if the script changes after that and more identifiers are added to it, or existing ones deleted. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/dispex.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/function.c | 31 ++++++++++++++ dlls/jscript/jscript.h | 1 + 3 files changed, 142 insertions(+) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 92e9b968da..6c6d25a9c1 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -19,6 +19,7 @@ #include <assert.h> #include "jscript.h" +#include "engine.h" #include "wine/debug.h" @@ -70,6 +71,20 @@ static inline dispex_prop_t *get_prop(jsdisp_t *This, DISPID id) return This->props+id; } +static inline BOOL is_function_prop(dispex_prop_t *prop) +{ + BOOL ret = FALSE; + + if (is_object_instance(prop->u.val)) + { + jsdisp_t *jsdisp = iface_to_jsdisp(get_object(prop->u.val)); + + if (jsdisp) ret = is_class(jsdisp, JSCLASS_FUNCTION); + jsdisp_release(jsdisp); + } + return ret; +} + static DWORD get_flags(jsdisp_t *This, dispex_prop_t *prop) { if(prop->type == PROP_PROTREF) { @@ -590,9 +605,21 @@ static HRESULT fill_protrefs(jsdisp_t *This) return S_OK; } +struct typeinfo_func { + dispex_prop_t *prop; + function_code_t *code; +}; + typedef struct { ITypeInfo ITypeInfo_iface; LONG ref; + + UINT num_funcs; + UINT num_vars; + struct typeinfo_func *funcs; + dispex_prop_t **vars; + + jsdisp_t *jsdisp; } ScriptTypeInfo; static inline ScriptTypeInfo *ScriptTypeInfo_from_ITypeInfo(ITypeInfo *iface) @@ -632,11 +659,17 @@ static ULONG WINAPI ScriptTypeInfo_Release(ITypeInfo *iface) { ScriptTypeInfo *This = ScriptTypeInfo_from_ITypeInfo(iface); LONG ref = InterlockedDecrement(&This->ref); + UINT i; TRACE("(%p) ref=%d\n", This, ref); if (!ref) { + for (i = This->num_funcs; i--;) + release_bytecode(This->funcs[i].code->bytecode); + IDispatchEx_Release(&This->jsdisp->IDispatchEx_iface); + heap_free(This->funcs); + heap_free(This->vars); heap_free(This); } return ref; @@ -897,17 +930,94 @@ static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LC ITypeInfo **ppTInfo) { jsdisp_t *This = impl_from_IDispatchEx(iface); + dispex_prop_t *prop, *cur, *end, **typevar; + UINT num_funcs = 0, num_vars = 0; + struct typeinfo_func *typefunc; + function_code_t *func_code; ScriptTypeInfo *typeinfo; + unsigned pos; TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); if (iTInfo != 0) return DISP_E_BADINDEX; + for (prop = This->props, end = prop + This->prop_cnt; prop != end; prop++) + { + if (!prop->name || prop->type != PROP_JSVAL || !(prop->flags & PROPF_ENUMERABLE)) + continue; + + /* If two identifiers differ only by case, the TypeInfo fails */ + pos = This->props[get_props_idx(This, prop->hash)].bucket_head; + while (pos) + { + cur = This->props + pos; + + if (prop->hash == cur->hash && prop != cur && + cur->type == PROP_JSVAL && (cur->flags & PROPF_ENUMERABLE) && + !wcsicmp(prop->name, cur->name)) + { + return TYPE_E_AMBIGUOUSNAME; + } + pos = cur->bucket_next; + } + + if (is_function_prop(prop)) + { + if (Function_get_code(as_jsdisp(get_object(prop->u.val)))) + num_funcs++; + } + else num_vars++; + } + if (!(typeinfo = heap_alloc(sizeof(*typeinfo)))) return E_OUTOFMEMORY; typeinfo->ITypeInfo_iface.lpVtbl = &ScriptTypeInfoVtbl; typeinfo->ref = 1; + typeinfo->num_vars = num_vars; + typeinfo->num_funcs = num_funcs; + typeinfo->jsdisp = This; + + typeinfo->funcs = heap_alloc(sizeof(*typeinfo->funcs) * num_funcs); + if (!typeinfo->funcs) + { + heap_free(typeinfo); + return E_OUTOFMEMORY; + } + + typeinfo->vars = heap_alloc(sizeof(*typeinfo->vars) * num_vars); + if (!typeinfo->vars) + { + heap_free(typeinfo->funcs); + heap_free(typeinfo); + return E_OUTOFMEMORY; + } + + typefunc = typeinfo->funcs; + typevar = typeinfo->vars; + for (prop = This->props; prop != end; prop++) + { + if (!prop->name || prop->type != PROP_JSVAL || !(prop->flags & PROPF_ENUMERABLE)) + continue; + + if (is_function_prop(prop)) + { + func_code = Function_get_code(as_jsdisp(get_object(prop->u.val))); + if (!func_code) continue; + + typefunc->prop = prop; + typefunc->code = func_code; + typefunc++; + + /* The function may be deleted, so keep a ref */ + bytecode_addref(func_code->bytecode); + } + else + *typevar++ = prop; + } + + /* Keep a ref to the props and their names */ + IDispatchEx_AddRef(&This->IDispatchEx_iface); *ppTInfo = &typeinfo->ITypeInfo_iface; return S_OK; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 7a44f5092b..52c12676dc 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -37,6 +37,7 @@ typedef struct { struct _function_vtbl_t { HRESULT (*call)(script_ctx_t*,FunctionInstance*,IDispatch*,unsigned,unsigned,jsval_t*,jsval_t*); HRESULT (*toString)(FunctionInstance*,jsstr_t**); + function_code_t* (*get_code)(FunctionInstance*); void (*destructor)(FunctionInstance*); }; @@ -524,6 +525,16 @@ static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval return S_OK; } +function_code_t *Function_get_code(jsdisp_t *jsthis) +{ + FunctionInstance *function; + + assert(is_class(jsthis, JSCLASS_FUNCTION)); + function = function_from_jsdisp(jsthis); + + return function->vtbl->get_code(function); +} + static void Function_destructor(jsdisp_t *dispex) { FunctionInstance *function = function_from_jsdisp(dispex); @@ -638,6 +649,11 @@ static HRESULT NativeFunction_toString(FunctionInstance *func, jsstr_t **ret) return S_OK; } +static function_code_t *NativeFunction_get_code(FunctionInstance *function) +{ + return NULL; +} + static void NativeFunction_destructor(FunctionInstance *function) { } @@ -645,6 +661,7 @@ static void NativeFunction_destructor(FunctionInstance *function) static const function_vtbl_t NativeFunctionVtbl = { NativeFunction_call, NativeFunction_toString, + NativeFunction_get_code, NativeFunction_destructor }; @@ -749,6 +766,13 @@ static HRESULT InterpretedFunction_toString(FunctionInstance *func, jsstr_t **re return *ret ? S_OK : E_OUTOFMEMORY; } +static function_code_t *InterpretedFunction_get_code(FunctionInstance *func) +{ + InterpretedFunction *function = (InterpretedFunction*)func; + + return function->func_code; +} + static void InterpretedFunction_destructor(FunctionInstance *func) { InterpretedFunction *function = (InterpretedFunction*)func; @@ -761,6 +785,7 @@ static void InterpretedFunction_destructor(FunctionInstance *func) static const function_vtbl_t InterpretedFunctionVtbl = { InterpretedFunction_call, InterpretedFunction_toString, + InterpretedFunction_get_code, InterpretedFunction_destructor }; @@ -842,6 +867,11 @@ static HRESULT BindFunction_toString(FunctionInstance *function, jsstr_t **ret) return *ret ? S_OK : E_OUTOFMEMORY; } +static function_code_t *BindFunction_get_code(FunctionInstance *function) +{ + return NULL; +} + static void BindFunction_destructor(FunctionInstance *func) { BindFunction *function = (BindFunction*)func; @@ -858,6 +888,7 @@ static void BindFunction_destructor(FunctionInstance *func) static const function_vtbl_t BindFunctionVtbl = { BindFunction_call, BindFunction_toString, + BindFunction_get_code, BindFunction_destructor }; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 5d635b7f41..7174db8e0c 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -307,6 +307,7 @@ HRESULT Function_invoke(jsdisp_t*,IDispatch*,WORD,unsigned,jsval_t*,jsval_t*) DE HRESULT Function_value(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_t*) DECLSPEC_HIDDEN; HRESULT Function_get_value(script_ctx_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; +struct _function_code_t *Function_get_code(jsdisp_t*) DECLSPEC_HIDDEN; #define DEFAULT_FUNCTION_VALUE {NULL, Function_value,0, Function_get_value} HRESULT throw_eval_error(script_ctx_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
1
0
0
0
Vijay Kiran Kamuju : include: Add missing defines for tokens in winnt.h.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 0f23cf61dacade1bddf0cb122c31d487d52a793b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0f23cf61dacade1bddf0cb12…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Thu Dec 12 12:43:34 2019 +0100 include: Add missing defines for tokens in winnt.h. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/winnt.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index 1db7fdd28e..56734f178d 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -4177,6 +4177,11 @@ typedef enum _TOKEN_INFORMATION_CLASS { MaxTokenInfoClass } TOKEN_INFORMATION_CLASS; +#define DISABLE_MAX_PRIVILEGE 0x1 +#define SANDBOX_INERT 0x2 +#define LUA_TOKEN 0x4 +#define WRITE_RESTRICTED 0x8 + #define TOKEN_TOKEN_ADJUST_DEFAULT 0x0080 #define TOKEN_ADJUST_GROUPS 0x0040 #define TOKEN_ADJUST_PRIVILEGES 0x0020
1
0
0
0
Nikolay Sivov : ole32/tests: Fix return value trace.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 3cf31c86807f97a5d9cc93d1034f8e1c9eaa2f5e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3cf31c86807f97a5d9cc93d1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 12 14:38:59 2019 +0300 ole32/tests: Fix return value trace. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/clipboard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 8901758034..b97c2646bf 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -1014,7 +1014,8 @@ static void test_set_clipboard(void) test_cf_dataobject(data_cmpl); test_enum_fmtetc(data_cmpl); - ok(OleSetClipboard(NULL) == S_OK, "failed to clear clipboard, hr = 0x%08x\n", hr); + hr = OleSetClipboard(NULL); + ok(hr == S_OK, "failed to clear clipboard, hr = 0x%08x.\n", hr); test_no_cf_dataobject(); test_enum_fmtetc(NULL);
1
0
0
0
Nikolay Sivov : ole32: Get rid of casts in 64-bit int serialization helper.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: d34ec97ad53ec10e5155a6d58926e331bbc55c3e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d34ec97ad53ec10e5155a6d5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 12 13:43:23 2019 +0300 ole32: Get rid of casts in 64-bit int serialization helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 5 ++--- dlls/ole32/storage32.c | 7 +++---- dlls/ole32/storage32.h | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index eeda2132dd..84eaa2aac4 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1981,9 +1981,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { FILETIME temp; - StorageUtl_WriteULargeInteger((BYTE *)&temp, 0, - (const ULARGE_INTEGER *)&var->u.filetime); - hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count); + StorageUtl_WriteULargeInteger(&temp, 0, (const ULARGE_INTEGER *)&var->u.filetime); + hr = IStream_Write(This->stm, &temp, sizeof(temp), &count); bytesWritten = count; break; } diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 5fc1f59b78..52ecf59028 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6982,17 +6982,16 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, #endif } -void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, - const ULARGE_INTEGER *value) +void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) { #ifdef WORDS_BIGENDIAN ULARGE_INTEGER tmp; tmp.u.LowPart = htole32(value->u.HighPart); tmp.u.HighPart = htole32(value->u.LowPart); - memcpy(buffer + offset, &tmp, sizeof(ULARGE_INTEGER)); + memcpy((BYTE *)buffer + offset, &tmp, sizeof(ULARGE_INTEGER)); #else - memcpy(buffer + offset, value, sizeof(ULARGE_INTEGER)); + memcpy((BYTE *)buffer + offset, value, sizeof(ULARGE_INTEGER)); #endif } diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index bfd3a3121f..f79f96e929 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -561,8 +561,7 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSP void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, ULARGE_INTEGER* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, - const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; +void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
1
0
0
0
Nikolay Sivov : ole32: Get rid of casts in GUID serialization helper.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 31c41d985538bac61efc82f364012e6bbd98b35a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=31c41d985538bac61efc82f3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 12 13:43:22 2019 +0300 ole32: Get rid of casts in GUID serialization helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 6 +++--- dlls/ole32/storage32.c | 4 ++-- dlls/ole32/storage32.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 79f1c20742..eeda2132dd 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1711,7 +1711,7 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); StorageUtl_WriteWord(&hdr->wFormat, 0, This->format); StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); - StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); + StorageUtl_WriteGUID(&hdr->clsid, 0, &This->clsid); StorageUtl_WriteDWord(&hdr->reserved, 0, 1); } @@ -1719,7 +1719,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, FORMATIDOFFSET *fmtOffset) { assert(fmtOffset); - StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); + StorageUtl_WriteGUID(fmtOffset, 0, &This->fmtid); StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)); } @@ -2008,7 +2008,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { CLSID temp; - StorageUtl_WriteGUID((BYTE *)&temp, 0, var->u.puuid); + StorageUtl_WriteGUID(&temp, 0, var->u.puuid); hr = IStream_Write(This->stm, &temp, sizeof(temp), &count); bytesWritten = count; break; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 6e0a9bb449..5fc1f59b78 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -7005,13 +7005,13 @@ void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) memcpy(value->Data4, buffer+offset+8, sizeof(value->Data4)); } -void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) { StorageUtl_WriteDWord(buffer, offset, value->Data1); StorageUtl_WriteWord(buffer, offset+4, value->Data2); StorageUtl_WriteWord(buffer, offset+6, value->Data3); - memcpy(buffer+offset+8, value->Data4, sizeof(value->Data4)); + memcpy((BYTE *)buffer + offset + 8, value->Data4, sizeof(value->Data4)); } void StorageUtl_CopyDirEntryToSTATSTG( diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 046334b98b..bfd3a3121f 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -564,7 +564,7 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination, const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
1
0
0
0
Nikolay Sivov : ole32: Get rid of casts in WORD serialization helper.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 4d605e8683b1bbf22ac6ea15cd9c9d1de7d75a55 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d605e8683b1bbf22ac6ea15…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 12 13:43:21 2019 +0300 ole32: Get rid of casts in WORD serialization helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 7 +++---- dlls/ole32/storage32.c | 6 +++--- dlls/ole32/storage32.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index d6b0d6c215..79f1c20742 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1708,9 +1708,8 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, PROPERTYSETHEADER *hdr) { assert(hdr); - StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0, - PROPSETHDR_BYTEORDER_MAGIC); - StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format); + StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); + StorageUtl_WriteWord(&hdr->wFormat, 0, This->format); StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); StorageUtl_WriteDWord(&hdr->reserved, 0, 1); @@ -1934,7 +1933,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { WORD wTemp; - StorageUtl_WriteWord((LPBYTE)&wTemp, 0, var->u.iVal); + StorageUtl_WriteWord(&wTemp, 0, var->u.iVal); hr = IStream_Write(This->stm, &wTemp, sizeof(wTemp), &count); bytesWritten = count; break; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 08a1d2201f..6e0a9bb449 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6948,10 +6948,10 @@ void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) *value = lendian16toh(tmp); } -void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) +void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value) { - value = htole16(value); - memcpy(buffer+offset, &value, sizeof(WORD)); + value = htole16(value); + memcpy((BYTE *)buffer + offset, &value, sizeof(WORD)); } void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index a54871f55b..046334b98b 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -556,7 +556,7 @@ StgStreamImpl* StgStreamImpl_Construct( * worry about bit order */ void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; +void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN; void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
1
0
0
0
Nikolay Sivov : ole32: Get rid of some casts in DWORD serialization helper.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 46ba55be860a39d249ef7027f277550f1efaa319 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=46ba55be860a39d249ef7027…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 12 13:43:20 2019 +0300 ole32: Get rid of some casts in DWORD serialization helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 39 ++++++++++++++++++--------------------- dlls/ole32/storage32.c | 8 ++++---- dlls/ole32/storage32.h | 2 +- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 095bbaab94..d6b0d6c215 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1711,9 +1711,9 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format); - StorageUtl_WriteDWord((BYTE *)&hdr->dwOSVer, 0, This->originatorOS); + StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); - StorageUtl_WriteDWord((BYTE *)&hdr->reserved, 0, 1); + StorageUtl_WriteDWord(&hdr->reserved, 0, 1); } static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, @@ -1721,7 +1721,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, { assert(fmtOffset); StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); - StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), + StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)); } @@ -1729,18 +1729,16 @@ static void PropertyStorage_MakeSectionHdr(DWORD cbSection, DWORD numProps, PROPERTYSECTIONHEADER *hdr) { assert(hdr); - StorageUtl_WriteDWord((BYTE *)hdr, 0, cbSection); - StorageUtl_WriteDWord((BYTE *)hdr, - offsetof(PROPERTYSECTIONHEADER, cProperties), numProps); + StorageUtl_WriteDWord(hdr, 0, cbSection); + StorageUtl_WriteDWord(hdr, offsetof(PROPERTYSECTIONHEADER, cProperties), numProps); } static void PropertyStorage_MakePropertyIdOffset(DWORD propid, DWORD dwOffset, PROPERTYIDOFFSET *propIdOffset) { assert(propIdOffset); - StorageUtl_WriteDWord((BYTE *)propIdOffset, 0, propid); - StorageUtl_WriteDWord((BYTE *)propIdOffset, - offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset); + StorageUtl_WriteDWord(propIdOffset, 0, propid); + StorageUtl_WriteDWord(propIdOffset, offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset); } static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm, @@ -1778,7 +1776,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, assert(key); assert(closure); - StorageUtl_WriteDWord((LPBYTE)&propid, 0, PtrToUlong(value)); + StorageUtl_WriteDWord(&propid, 0, PtrToUlong(value)); c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count); if (FAILED(c->hr)) goto end; @@ -1787,7 +1785,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, { DWORD pad = 0, pad_len; - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); + StorageUtl_WriteDWord(&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1811,7 +1809,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, } else { - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1); + StorageUtl_WriteDWord(&keyLen, 0, strlen((LPCSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1859,8 +1857,7 @@ static HRESULT PropertyStorage_WriteDictionaryToStream( hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, - dictionary_num_entries(This->name_to_propid)); + StorageUtl_WriteDWord(&dwTemp, 0, dictionary_num_entries(This->name_to_propid)); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1914,7 +1911,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwType, 0, var->vt); + StorageUtl_WriteDWord(&dwType, 0, var->vt); hr = IStream_Write(This->stm, &dwType, sizeof(dwType), &count); if (FAILED(hr)) goto end; @@ -1947,7 +1944,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { DWORD dwTemp; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, var->u.lVal); + StorageUtl_WriteDWord(&dwTemp, 0, var->u.lVal); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); bytesWritten = count; break; @@ -1960,7 +1957,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, len = (lstrlenW(var->u.pwszVal) + 1) * sizeof(WCHAR); else len = lstrlenA(var->u.pszVal) + 1; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len); + StorageUtl_WriteDWord(&dwTemp, 0, len); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1972,7 +1969,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { DWORD len = lstrlenW(var->u.pwszVal) + 1, dwTemp; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len); + StorageUtl_WriteDWord(&dwTemp, 0, len); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); if (FAILED(hr)) goto end; @@ -1996,8 +1993,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, DWORD cf_hdr[2], len; len = var->u.pclipdata->cbSize; - StorageUtl_WriteDWord((LPBYTE)&cf_hdr[0], 0, len + 8); - StorageUtl_WriteDWord((LPBYTE)&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt); + StorageUtl_WriteDWord(&cf_hdr[0], 0, len + 8); + StorageUtl_WriteDWord(&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt); hr = IStream_Write(This->stm, cf_hdr, sizeof(cf_hdr), &count); if (FAILED(hr)) goto end; @@ -2192,7 +2189,7 @@ static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *This) hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL); if (FAILED(hr)) goto end; - StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, sectionOffset); + StorageUtl_WriteDWord(&dwTemp, 0, sectionOffset); hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count); end: diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 515880ec36..08a1d2201f 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -6962,10 +6962,10 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) *value = lendian32toh(tmp); } -void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) +void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) { - value = htole32(value); - memcpy(buffer+offset, &value, sizeof(DWORD)); + value = htole32(value); + memcpy((BYTE *)buffer + offset, &value, sizeof(DWORD)); } void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, @@ -7896,7 +7896,7 @@ static void SmallBlockChainStream_SetNextBlockInChain( offsetOfBlockInDepot.QuadPart = (ULONGLONG)blockIndex * sizeof(ULONG); - StorageUtl_WriteDWord((BYTE *)&buffer, 0, nextBlock); + StorageUtl_WriteDWord(&buffer, 0, nextBlock); /* * Read those bytes in the buffer from the small block file. diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index c628523d09..a54871f55b 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -558,7 +558,7 @@ StgStreamImpl* StgStreamImpl_Construct( void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN; void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; +void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN; void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, ULARGE_INTEGER* value) DECLSPEC_HIDDEN; void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
1
0
0
0
Michael Müller : ole32: Fix property name handling for dictionary entries in CP_UNICODE case.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 3cb18cc6564530a730793933dec331998136c511 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3cb18cc6564530a730793933…
Author: Michael Müller <michael(a)fds-team.de> Date: Thu Dec 12 13:43:19 2019 +0300 ole32: Fix property name handling for dictionary entries in CP_UNICODE case. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=42046
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/stg_prop.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 505467cad5..095bbaab94 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1195,20 +1195,25 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This, ptr += sizeof(PROPID); StorageUtl_ReadDWord(ptr, 0, &cbEntry); ptr += sizeof(DWORD); - TRACE("Reading entry with ID 0x%08x, %d bytes\n", propid, cbEntry); /* Make sure the source string is NULL-terminated */ if (This->codePage != CP_UNICODE) ptr[cbEntry - 1] = '\0'; else - *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0'; + ((WCHAR *)ptr)[cbEntry - 1] = '\0'; + + TRACE("Reading entry with ID %#x, %d chars, name %s.\n", propid, cbEntry, This->codePage == CP_UNICODE ? + debugstr_wn((WCHAR *)ptr, cbEntry) : debugstr_an((char *)ptr, cbEntry)); + hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid); if (This->codePage == CP_UNICODE) { + cbEntry *= sizeof(WCHAR); + /* Unicode entries are padded to DWORD boundaries */ if (cbEntry % sizeof(DWORD)) ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD)); } - ptr += sizeof(DWORD) + cbEntry; + ptr += cbEntry; } return hr; } @@ -1753,7 +1758,7 @@ static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm, HeapFree(GetProcessHeap(), 0, leStr); return hr; #else - return IStream_Write(stm, str, len, written); + return IStream_Write(stm, str, len * sizeof(WCHAR), written); #endif } @@ -1768,7 +1773,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, { PropertyStorage_impl *This = extra; struct DictionaryClosure *c = closure; - DWORD propid; + DWORD propid, keyLen; ULONG count; assert(key); @@ -1780,10 +1785,9 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, c->bytesWritten += sizeof(DWORD); if (This->codePage == CP_UNICODE) { - DWORD keyLen, pad = 0; + DWORD pad = 0, pad_len; - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, - (lstrlenW((LPCWSTR)key) + 1) * sizeof(WCHAR)); + StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr)) goto end; @@ -1792,20 +1796,21 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key, &count); if (FAILED(c->hr)) goto end; - c->bytesWritten += keyLen * sizeof(WCHAR); - if (keyLen % sizeof(DWORD)) + keyLen *= sizeof(WCHAR); + c->bytesWritten += keyLen; + + /* Align to 4 bytes. */ + pad_len = sizeof(DWORD) - keyLen % sizeof(DWORD); + if (pad_len) { - c->hr = IStream_Write(This->stm, &pad, - sizeof(DWORD) - keyLen % sizeof(DWORD), &count); + c->hr = IStream_Write(This->stm, &pad, pad_len, &count); if (FAILED(c->hr)) goto end; - c->bytesWritten += sizeof(DWORD) - keyLen % sizeof(DWORD); + c->bytesWritten += pad_len; } } else { - DWORD keyLen; - StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1); c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count); if (FAILED(c->hr))
1
0
0
0
Francois Gouget : msxml3: Fix the spelling of some comments.
by Alexandre Julliard
12 Dec '19
12 Dec '19
Module: wine Branch: master Commit: 280cbcb28a77b90d6f41328bda2639771f90685c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=280cbcb28a77b90d6f41328b…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Dec 12 11:24:16 2019 +0100 msxml3: Fix the spelling of some comments. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msxml3/node.c | 2 +- dlls/msxml3/tests/domdoc.c | 2 +- dlls/msxml3/tests/saxreader.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 27abf94530..35777d6591 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -432,7 +432,7 @@ int xmlnode_get_inst_cnt(xmlnode *node) } /* _private field holds a number of COM instances spawned from this libxml2 node - * most significant bits are used to store information about ignorrable whitespace nodes */ + * most significant bits are used to store information about ignorable whitespace nodes */ void xmlnode_add_ref(xmlNodePtr node) { if (node->type == XML_DOCUMENT_NODE) return; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index aa4c7a2832..843343aa00 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -4865,7 +4865,7 @@ static void test_XPath(void) EXPECT_HR(hr, S_OK); expect_list_and_release(list, "E2.D1"); - /* peform xpath tests */ + /* perform xpath tests */ for ( ; xptest->query ; xptest++ ) { char *str; diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 4e77b00a63..44b5e1bcb5 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -3172,7 +3172,7 @@ static void test_mxwriter_properties(void) ok(hr == E_INVALIDARG, "got %08x\n", hr); SysFreeString(str); - /* test case sensivity */ + /* test case sensitivity */ hr = IMXWriter_put_encoding(writer, _bstr_("utf-8")); EXPECT_HR(hr, S_OK); str = (void*)0xdeadbeef; @@ -5639,7 +5639,7 @@ static void test_mxattr_localname(void) hr = ISAXAttributes_getIndexFromName(saxattr, NULL, 0, NULL, 0, &index); EXPECT_HR(hr, E_INVALIDARG); - /* add some ambiguos attribute names */ + /* add some ambiguous attribute names */ hr = IMXAttributes_addAttribute(mxattr, _bstr_("uri"), _bstr_("localname"), _bstr_("a:localname"), _bstr_(""), _bstr_("value")); EXPECT_HR(hr, S_OK);
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
64
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
Results per page:
10
25
50
100
200