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
July
June
May
April
March
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 2012
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
541 discussions
Start a n
N
ew thread
Vincent Povirk : ole32: Implement StgConvertPropertyToVariant.
by Alexandre Julliard
28 Aug '12
28 Aug '12
Module: wine Branch: master Commit: 58c2462c36b199bc36b3c4cf5546a228450e3653 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58c2462c36b199bc36b3c4cf5…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 27 17:01:24 2012 -0500 ole32: Implement StgConvertPropertyToVariant. --- dlls/ole32/ole32.spec | 1 + dlls/ole32/stg_prop.c | 78 +++++++++++++++++++++++++++++++++------ dlls/ole32/tests/propvariant.c | 12 ++++--- 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 5fcf841..a27adfb 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -253,6 +253,7 @@ @ stdcall SetConvertStg(ptr long) @ stub SetDocumentBitStg @ stdcall SetErrorInfo(long ptr) +@ stdcall StgConvertPropertyToVariant(ptr long ptr ptr) @ stdcall StgCreateDocfile(wstr long long ptr) @ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr) @ stdcall StgCreatePropSetStg(ptr long ptr) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 9e3df45..103f145 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -36,6 +36,9 @@ * PropertyStorage_ReadFromStream */ +#include "config.h" +#include "wine/port.h" + #include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -1030,11 +1033,22 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This, return hr; } +#ifdef __i386__ +#define __thiscall __stdcall +#else +#define __thiscall __cdecl +#endif + +static __thiscall void* Allocate_CoTaskMemAlloc(void *userdata, ULONG size) +{ + return CoTaskMemAlloc(size); +} + /* FIXME: there isn't any checking whether the read property extends past the * end of the buffer. */ -static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, - PROPVARIANT *prop, const BYTE *data) +static HRESULT PropertyStorage_ReadProperty(PROPVARIANT *prop, const BYTE *data, + UINT codepage, void* (__thiscall *allocate)(void *userdata, ULONG size), void *allocate_data) { HRESULT hr = S_OK; @@ -1078,21 +1092,21 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, DWORD count; StorageUtl_ReadDWord(data, 0, &count); - if (This->codePage == CP_UNICODE && count / 2) + if (codepage == CP_UNICODE && count / 2) { WARN("Unicode string has odd number of bytes\n"); hr = STG_E_INVALIDHEADER; } else { - prop->u.pszVal = CoTaskMemAlloc(count); + prop->u.pszVal = allocate(allocate_data, count); if (prop->u.pszVal) { memcpy(prop->u.pszVal, data + sizeof(DWORD), count); - /* This is stored in the code page specified in This->codePage. + /* This is stored in the code page specified in codepage. * Don't convert it, the caller will just store it as-is. */ - if (This->codePage == CP_UNICODE) + if (codepage == CP_UNICODE) { /* Make sure it's NULL-terminated */ prop->u.pszVal[count / sizeof(WCHAR) - 1] = '\0'; @@ -1117,7 +1131,7 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, StorageUtl_ReadDWord(data, 0, &count); prop->u.blob.cbSize = count; - prop->u.blob.pBlobData = CoTaskMemAlloc(count); + prop->u.blob.pBlobData = allocate(allocate_data, count); if (prop->u.blob.pBlobData) { memcpy(prop->u.blob.pBlobData, data + sizeof(DWORD), count); @@ -1132,7 +1146,7 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, DWORD count; StorageUtl_ReadDWord(data, 0, &count); - prop->u.pwszVal = CoTaskMemAlloc(count * sizeof(WCHAR)); + prop->u.pwszVal = allocate(allocate_data, count * sizeof(WCHAR)); if (prop->u.pwszVal) { memcpy(prop->u.pwszVal, data + sizeof(DWORD), @@ -1159,10 +1173,10 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This, if (len > 8) { len -= 8; - prop->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA)); + prop->u.pclipdata = allocate(allocate_data, sizeof (CLIPDATA)); prop->u.pclipdata->cbSize = len; prop->u.pclipdata->ulClipFmt = tag; - prop->u.pclipdata->pClipData = CoTaskMemAlloc(len - sizeof(prop->u.pclipdata->ulClipFmt)); + prop->u.pclipdata->pClipData = allocate(allocate_data, len - sizeof(prop->u.pclipdata->ulClipFmt)); memcpy(prop->u.pclipdata->pClipData, data+8, len - sizeof(prop->u.pclipdata->ulClipFmt)); } else @@ -1399,8 +1413,9 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This) PROPVARIANT prop; PropVariantInit(&prop); - if (SUCCEEDED(PropertyStorage_ReadProperty(This, &prop, - buf + idOffset->dwOffset - sizeof(PROPERTYSECTIONHEADER)))) + if (SUCCEEDED(PropertyStorage_ReadProperty(&prop, + buf + idOffset->dwOffset - sizeof(PROPERTYSECTIONHEADER), + This->codePage, Allocate_CoTaskMemAlloc, NULL))) { TRACE("Read property with ID 0x%08x, type %d\n", idOffset->propid, prop.vt); @@ -2673,3 +2688,42 @@ HRESULT WINAPI PropStgNameToFmtId(const LPOLESTR str, FMTID *rfmtid) end: return hr; } + +#ifdef __i386__ /* thiscall functions are i386-specific */ + +#define DEFINE_STDCALL_WRAPPER(num,func,args) \ + __ASM_STDCALL_FUNC(func, args, \ + "popl %eax\n\t" \ + "popl %ecx\n\t" \ + "pushl %eax\n\t" \ + "movl (%ecx), %eax\n\t" \ + "jmp *(4*(" #num "))(%eax)" ) + +DEFINE_STDCALL_WRAPPER(0,Allocate_PMemoryAllocator,8) +extern void* __thiscall Allocate_PMemoryAllocator(void *this, ULONG cbSize); + +#else + +static void* __thiscall Allocate_PMemoryAllocator(void *this, ULONG cbSize) +{ + void* (__thiscall *fn)(void*,ULONG) = **(void***)this; + return fn(this, cbSize); +} + +#endif + +BOOLEAN WINAPI StgConvertPropertyToVariant(const SERIALIZEDPROPERTYVALUE* prop, + USHORT CodePage, PROPVARIANT* pvar, void* pma) +{ + HRESULT hr; + + hr = PropertyStorage_ReadProperty(pvar, (const BYTE*)prop, CodePage, Allocate_PMemoryAllocator, pma); + + if (FAILED(hr)) + { + FIXME("should raise C++ exception on failure\n"); + PropVariantInit(pvar); + } + + return 0; +} diff --git a/dlls/ole32/tests/propvariant.c b/dlls/ole32/tests/propvariant.c index 29fa2f0..ec1dfd7 100644 --- a/dlls/ole32/tests/propvariant.c +++ b/dlls/ole32/tests/propvariant.c @@ -365,7 +365,7 @@ static void test_propertytovariant(void) if (!pStgConvertPropertyToVariant) { - todo_wine win_skip("StgConvertPropertyToVariant not available\n"); + win_skip("StgConvertPropertyToVariant not available\n"); return; } @@ -395,16 +395,18 @@ static void test_propertytovariant(void) CP_WINUNICODE, &propvar, &allocator); ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); - ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); - ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); + todo_wine ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); + if (propvar.vt == VT_BSTR) + ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); PropVariantClear(&propvar); ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_bstr_mb, CP_UTF8, &propvar, &allocator); ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); - ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); - ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); + todo_wine ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); + if (propvar.vt == VT_BSTR) + ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); PropVariantClear(&propvar); }
1
0
0
0
Vincent Povirk : ole32: Add tests for StgConvertPropertyToVariant.
by Alexandre Julliard
28 Aug '12
28 Aug '12
Module: wine Branch: master Commit: ae722c45ad3e670f8a0d82facd0e03381e8cab04 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae722c45ad3e670f8a0d82fac…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 27 15:50:56 2012 -0500 ole32: Add tests for StgConvertPropertyToVariant. --- dlls/ole32/tests/propvariant.c | 164 ++++++++++++++++++++++++++++++++++++++++ include/propidl.idl | 4 + 2 files changed, 168 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/tests/propvariant.c b/dlls/ole32/tests/propvariant.c index 50adfe7..29fa2f0 100644 --- a/dlls/ole32/tests/propvariant.c +++ b/dlls/ole32/tests/propvariant.c @@ -245,8 +245,172 @@ static void test_copy(void) memset(&propvarSrc, 0, sizeof(propvarSrc)); } +struct _PMemoryAllocator_vtable { + void *Allocate; /* virtual void* Allocate(ULONG cbSize); */ + void *Free; /* virtual void Free(void *pv); */ +}; + +typedef struct _PMemoryAllocator { + struct _PMemoryAllocator_vtable *vt; +} PMemoryAllocator; + +#ifdef __i386__ +#define __thiscall __stdcall +#else +#define __thiscall __cdecl +#endif + +static void * __thiscall PMemoryAllocator_Allocate(PMemoryAllocator *_this, ULONG cbSize) +{ + return CoTaskMemAlloc(cbSize); +} + +static void __thiscall PMemoryAllocator_Free(PMemoryAllocator *_this, void *pv) +{ + CoTaskMemFree(pv); +} + +#ifdef __i386__ + +#include "pshpack1.h" +typedef struct +{ + BYTE pop_eax; /* popl %eax */ + BYTE push_ecx; /* pushl %ecx */ + BYTE push_eax; /* pushl %eax */ + BYTE jmp_func; /* jmp $func */ + DWORD func; +} THISCALL_TO_STDCALL_THUNK; +#include "poppack.h" + +static THISCALL_TO_STDCALL_THUNK *wrapperCodeMem = NULL; + +static void fill_thunk(THISCALL_TO_STDCALL_THUNK *thunk, void *fn) +{ + thunk->pop_eax = 0x58; + thunk->push_ecx = 0x51; + thunk->push_eax = 0x50; + thunk->jmp_func = 0xe9; + thunk->func = (char*)fn - (char*)(&thunk->func + 1); +} + +static void setup_vtable(struct _PMemoryAllocator_vtable *vtable) +{ + wrapperCodeMem = VirtualAlloc(NULL, 2 * sizeof(*wrapperCodeMem), + MEM_COMMIT, PAGE_EXECUTE_READWRITE); + + fill_thunk(&wrapperCodeMem[0], PMemoryAllocator_Allocate); + fill_thunk(&wrapperCodeMem[1], PMemoryAllocator_Free); + + vtable->Allocate = &wrapperCodeMem[0]; + vtable->Free = &wrapperCodeMem[1]; +} + +#else + +static void setup_vtable(struct _PMemoryAllocator_vtable *vtable) +{ + vtable->Allocate = PMemoryAllocator_Allocate; + vtable->Free = PMemoryAllocator_Free; +} + +#endif + +static const char serialized_empty[] = { + 0,0, /* VT_EMPTY */ + 0,0, /* padding */ +}; + +static const char serialized_null[] = { + 1,0, /* VT_NULL */ + 0,0, /* padding */ +}; + +static const char serialized_i4[] = { + 3,0, /* VT_I4 */ + 0,0, /* padding */ + 0xef,0xcd,0xab,0xfe +}; + +static const char serialized_bstr_wc[] = { + 8,0, /* VT_BSTR */ + 0,0, /* padding */ + 10,0,0,0, /* size */ + 't',0,'e',0, + 's',0,'t',0, + 0,0,0,0 +}; + +static const char serialized_bstr_mb[] = { + 8,0, /* VT_BSTR */ + 0,0, /* padding */ + 5,0,0,0, /* size */ + 't','e','s','t', + 0,0,0,0 +}; + +static void test_propertytovariant(void) +{ + HANDLE hole32; + BOOLEAN (__stdcall *pStgConvertPropertyToVariant)(const SERIALIZEDPROPERTYVALUE*,USHORT,PROPVARIANT*,PMemoryAllocator*); + PROPVARIANT propvar; + PMemoryAllocator allocator; + struct _PMemoryAllocator_vtable vtable; + BOOLEAN ret; + static const WCHAR test_string[] = {'t','e','s','t',0}; + + hole32 = GetModuleHandleA("ole32"); + + pStgConvertPropertyToVariant = (void*)GetProcAddress(hole32, "StgConvertPropertyToVariant"); + + if (!pStgConvertPropertyToVariant) + { + todo_wine win_skip("StgConvertPropertyToVariant not available\n"); + return; + } + + setup_vtable(&vtable); + allocator.vt = &vtable; + + ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_empty, + CP_WINUNICODE, &propvar, &allocator); + + ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); + ok(propvar.vt == VT_EMPTY, "unexpected vt %x\n", propvar.vt); + + ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_null, + CP_WINUNICODE, &propvar, &allocator); + + ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); + ok(propvar.vt == VT_NULL, "unexpected vt %x\n", propvar.vt); + + ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_i4, + CP_WINUNICODE, &propvar, &allocator); + + ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); + ok(propvar.vt == VT_I4, "unexpected vt %x\n", propvar.vt); + ok(U(propvar).lVal == 0xfeabcdef, "unexpected lVal %x\n", U(propvar).lVal); + + ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_bstr_wc, + CP_WINUNICODE, &propvar, &allocator); + + ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); + ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); + ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); + PropVariantClear(&propvar); + + ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_bstr_mb, + CP_UTF8, &propvar, &allocator); + + ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret); + ok(propvar.vt == VT_BSTR, "unexpected vt %x\n", propvar.vt); + ok(!lstrcmpW(U(propvar).bstrVal, test_string), "unexpected string value\n"); + PropVariantClear(&propvar); +} + START_TEST(propvariant) { test_validtypes(); test_copy(); + test_propertytovariant(); } diff --git a/include/propidl.idl b/include/propidl.idl index 3fc7515..fbe80d8 100644 --- a/include/propidl.idl +++ b/include/propidl.idl @@ -431,6 +431,10 @@ interface IEnumSTATPROPSETSTG : IUnknown [out] IEnumSTATPROPSETSTG **ppenum); } +typedef struct SERIALIZEDPROPERTYVALUE { + DWORD dwType; + BYTE rgb[1]; +} SERIALIZEDPROPERTYVALUE; cpp_quote("HRESULT WINAPI FreePropVariantArray(ULONG,PROPVARIANT*);") cpp_quote("HRESULT WINAPI PropVariantClear(PROPVARIANT*);")
1
0
0
0
Vincent Povirk : propsys: Fix memory leak in IPropertyStore::SetValue.
by Alexandre Julliard
28 Aug '12
28 Aug '12
Module: wine Branch: master Commit: 0537454eae75efafd60964ad499af40227188a39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0537454eae75efafd60964ad4…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Aug 27 11:39:24 2012 -0500 propsys: Fix memory leak in IPropertyStore::SetValue. --- dlls/propsys/propstore.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/propsys/propstore.c b/dlls/propsys/propstore.c index e438ce3..6d4c99a 100644 --- a/dlls/propsys/propstore.c +++ b/dlls/propsys/propstore.c @@ -303,6 +303,7 @@ static HRESULT WINAPI PropertyStore_SetValue(IPropertyStoreCache *iface, PropertyStore *This = impl_from_IPropertyStoreCache(iface); propstore_value *value; HRESULT hr; + PROPVARIANT temp; TRACE("%p,%p,%p\n", iface, key, propvar); @@ -311,7 +312,13 @@ static HRESULT WINAPI PropertyStore_SetValue(IPropertyStoreCache *iface, hr = PropertyStore_LookupValue(This, key, 1, &value); if (SUCCEEDED(hr)) - hr = PropVariantCopy(&value->propvar, propvar); + hr = PropVariantCopy(&temp, propvar); + + if (SUCCEEDED(hr)) + { + PropVariantClear(&value->propvar); + value->propvar = temp; + } LeaveCriticalSection(&This->lock); @@ -405,6 +412,7 @@ static HRESULT WINAPI PropertyStore_SetValueAndState(IPropertyStoreCache *iface, PropertyStore *This = impl_from_IPropertyStoreCache(iface); propstore_value *value; HRESULT hr; + PROPVARIANT temp; TRACE("%p,%p,%p,%d\n", iface, key, ppropvar, state); @@ -413,10 +421,14 @@ static HRESULT WINAPI PropertyStore_SetValueAndState(IPropertyStoreCache *iface, hr = PropertyStore_LookupValue(This, key, 1, &value); if (SUCCEEDED(hr)) - hr = PropVariantCopy(&value->propvar, ppropvar); + hr = PropVariantCopy(&temp, ppropvar); if (SUCCEEDED(hr)) + { + PropVariantClear(&value->propvar); + value->propvar = temp; value->state = state; + } LeaveCriticalSection(&This->lock);
1
0
0
0
Michael Stefaniuc : wineconsole: Avoid TRUE:FALSE conditional expressions.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 15992994bd842dee2dfec1fe5a98000c90edc6cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15992994bd842dee2dfec1fe5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Aug 27 13:29:31 2012 +0200 wineconsole: Avoid TRUE:FALSE conditional expressions. --- programs/wineconsole/curses.c | 2 +- programs/wineconsole/dialog.c | 4 ++-- programs/wineconsole/user.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c index 4c75a6f..735ec97 100644 --- a/programs/wineconsole/curses.c +++ b/programs/wineconsole/curses.c @@ -300,7 +300,7 @@ static void WCCURSES_ShapeCursor(struct inner_data* data, int size, int vis, BOO { /* we can't do much about the size... */ data->curcfg.cursor_size = size; - data->curcfg.cursor_visible = vis ? TRUE : FALSE; + data->curcfg.cursor_visible = vis != 0; WCCURSES_PosCursor(data); } diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c index 831b2a9..d69432e 100644 --- a/programs/wineconsole/dialog.c +++ b/programs/wineconsole/dialog.c @@ -118,7 +118,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L val = GetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, &done, FALSE); if (done) di->config.history_size = val; - val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) ? TRUE : FALSE; + val = (IsDlgButtonChecked(hDlg, IDC_OPT_HIST_NODOUBLE) & BST_CHECKED) != 0; di->config.history_nodup = val; val = 0; @@ -126,7 +126,7 @@ static INT_PTR WINAPI WCUSER_OptionDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L if (IsDlgButtonChecked(hDlg, IDC_OPT_CONF_SHIFT) & BST_CHECKED) val |= MK_SHIFT; di->config.menu_mask = val; - val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) ? TRUE : FALSE; + val = (IsDlgButtonChecked(hDlg, IDC_OPT_QUICK_EDIT) & BST_CHECKED) != 0; di->config.quick_edit = val; SetWindowLongPtrW(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR); diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index 8a07e3a..9b8ad15 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -191,7 +191,7 @@ static void WCUSER_ShapeCursor(struct inner_data* data, int size, int vis, BOOL data->curcfg.cursor_visible = -1; } - vis = (vis) ? TRUE : FALSE; + vis = vis != 0; if (force || vis != data->curcfg.cursor_visible) { data->curcfg.cursor_visible = vis;
1
0
0
0
Michael Stefaniuc : dplayx: Avoid TRUE:FALSE conditional expressions.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 66bd68a809725020f1644684f5f0b86022390c0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66bd68a809725020f1644684f…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Aug 27 13:23:37 2012 +0200 dplayx: Avoid TRUE:FALSE conditional expressions. --- dlls/dplayx/dplay.c | 4 ++-- dlls/dplayx/dplobby.c | 4 ++-- dlls/dplayx/name_server.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 1bcb386..7636546 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -2853,11 +2853,11 @@ static HRESULT DP_SecureOpen FIXME( "Not all data fields are correct. Need new parameter\n" ); - data.bCreate = (dwFlags & DPOPEN_CREATE ) ? TRUE : FALSE; + data.bCreate = (dwFlags & DPOPEN_CREATE ) != 0; data.lpSPMessageHeader = (dwFlags & DPOPEN_CREATE ) ? NULL : NS_GetNSAddr( This->dp2->lpNameServerData ); data.lpISP = This->dp2->spData.lpISP; - data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) ? TRUE : FALSE; + data.bReturnStatus = (dwFlags & DPOPEN_RETURNSTATUS) != 0; data.dwOpenFlags = dwFlags; data.dwSessionFlags = This->dp2->lpSessionDesc->dwFlags; diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index 3e7efc7..9adc67a 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -1704,7 +1704,7 @@ static HRESULT WINAPI IDirectPlayLobby3WImpl_WaitForConnectionSettings ( LPDIRECTPLAYLOBBY3 iface, DWORD dwFlags ) { HRESULT hr = DP_OK; - BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE; + BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL); TRACE( "(%p)->(0x%08x)\n", iface, dwFlags ); @@ -1721,7 +1721,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_WaitForConnectionSettings ( LPDIRECTPLAYLOBBY3A iface, DWORD dwFlags ) { HRESULT hr = DP_OK; - BOOL bStartWait = (dwFlags & DPLWAIT_CANCEL) ? FALSE : TRUE; + BOOL bStartWait = !(dwFlags & DPLWAIT_CANCEL); TRACE( "(%p)->(0x%08x)\n", iface, dwFlags ); diff --git a/dlls/dplayx/name_server.c b/dlls/dplayx/name_server.c index 0acdc5f..258bdad 100644 --- a/dlls/dplayx/name_server.c +++ b/dlls/dplayx/name_server.c @@ -208,7 +208,7 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid, data.lpMessage = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, data.dwMessageSize ); data.lpISP = lpSpData->lpISP; - data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) ? TRUE : FALSE; + data.bReturnStatus = (dwFlags & DPENUMSESSIONS_RETURNSTATUS) != 0; lpMsg = (LPDPMSG_ENUMSESSIONSREQUEST)(((BYTE*)data.lpMessage)+lpSpData->dwSPHeaderSize);
1
0
0
0
Dmitry Timoshkov : gdiplus: get_log_fontW helper requires a valid graphics object.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 3f35a11426dacc21403d78285310da661f93fcd4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f35a11426dacc21403d78285…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Aug 27 14:12:01 2012 +0900 gdiplus: get_log_fontW helper requires a valid graphics object. --- dlls/gdiplus/graphicspath.c | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 80d9244..16f5e2d 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -946,6 +946,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT LOGFONTW lfw; HANDLE hfont; HDC dc; + GpGraphics *graphics; GpPath *backup; struct format_string_args args; int i; @@ -966,26 +967,40 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT scaled_layout_rect.Width = layoutRect->Width * native_height / emSize; scaled_layout_rect.Height = layoutRect->Height * native_height / emSize; + if ((status = GdipClonePath(path, &backup)) != Ok) + return status; + + dc = CreateCompatibleDC(0); + status = GdipCreateFromHDC(dc, &graphics); + if (status != Ok) + { + DeleteDC(dc); + GdipDeletePath(backup); + return status; + } + status = GdipCreateFont(family, native_height, style, UnitPixel, &font); if (status != Ok) + { + GdipDeleteGraphics(graphics); + DeleteDC(dc); + GdipDeletePath(backup); return status; + } - get_log_fontW(font, NULL, &lfw); + get_log_fontW(font, graphics, &lfw); GdipDeleteFont(font); + GdipDeleteGraphics(graphics); + hfont = CreateFontIndirectW(&lfw); if (!hfont) { WARN("Failed to create font\n"); + DeleteDC(dc); + GdipDeletePath(backup); return GenericError; } - if ((status = GdipClonePath(path, &backup)) != Ok) - { - DeleteObject(hfont); - return status; - } - - dc = CreateCompatibleDC(0); SelectObject(dc, hfont); GetTextMetricsW(dc, &textmetric);
1
0
0
0
Dmitry Timoshkov : gdiplus: Fix font leak.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 2e31f7a80a506ec4f0641aa0c228fb2a3a831093 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e31f7a80a506ec4f0641aa0c…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Aug 27 14:11:47 2012 +0900 gdiplus: Fix font leak. --- dlls/gdiplus/graphicspath.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 8533902..80d9244 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -971,6 +971,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT return status; get_log_fontW(font, NULL, &lfw); + GdipDeleteFont(font); hfont = CreateFontIndirectW(&lfw); if (!hfont) {
1
0
0
0
Dmitry Timoshkov : gdiplus/tests: Fix font leak.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 31544a73da14830da036e04e46b18fa798fce460 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31544a73da14830da036e04e4…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Aug 27 14:11:40 2012 +0900 gdiplus/tests: Fix font leak. --- dlls/gdiplus/tests/graphics.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 1cd847d..db2542b 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3836,6 +3836,8 @@ todo_wine expectf_(height, rect.Height, height / 15.0); expectf_(bounds.Width, rect.Width + margin * 2.0, bounds.Width / 15.0); } + + GdipDeleteFont(font); } status = GdipDeleteGraphics(graphics);
1
0
0
0
Jacek Caban : dsound: Use proper helpers for iface calls.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 3f353e00255110df44890b943015aa120906e4a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f353e00255110df44890b943…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 27 12:28:04 2012 +0200 dsound: Use proper helpers for iface calls. --- dlls/dsound/dsound_main.c | 4 ++-- dlls/dsound/propset.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 9c550eb..3fded64 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -655,7 +655,7 @@ static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) } static HRESULT WINAPI -DSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) +DSCF_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj); @@ -665,7 +665,7 @@ DSCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) IsEqualIID(riid, &IID_IClassFactory)) { *ppobj = iface; - IUnknown_AddRef(iface); + IClassFactory_AddRef(iface); return S_OK; } *ppobj = NULL; diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index eb4c195..d14a388 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -68,9 +68,7 @@ static IKsPrivatePropertySetImpl *impl_from_IKsPropertySet(IKsPropertySet *iface /* IUnknown methods */ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( - LPKSPROPERTYSET iface, - REFIID riid, - LPVOID *ppobj ) + IKsPropertySet *iface, REFIID riid, void **ppobj) { IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); @@ -78,7 +76,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IKsPropertySet)) { *ppobj = iface; - IUnknown_AddRef(iface); + IKsPropertySet_AddRef(iface); return S_OK; } *ppobj = NULL;
1
0
0
0
Jacek Caban : ddraw: Use proper helpers for iface calls.
by Alexandre Julliard
27 Aug '12
27 Aug '12
Module: wine Branch: master Commit: 4551135f7a42ac8de6d2e78011328b713fcc68ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4551135f7a42ac8de6d2e7801…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 27 12:27:48 2012 +0200 ddraw: Use proper helpers for iface calls. --- dlls/ddraw/material.c | 2 +- dlls/ddraw/surface.c | 20 ++++++++++---------- dlls/ddraw/vertexbuffer.c | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/ddraw/material.c b/dlls/ddraw/material.c index 4b44726..5317bf5 100644 --- a/dlls/ddraw/material.c +++ b/dlls/ddraw/material.c @@ -75,7 +75,7 @@ static HRESULT WINAPI d3d_material3_QueryInterface(IDirect3DMaterial3 *iface, RE if (IsEqualGUID(&IID_IUnknown, riid)) { - IUnknown_AddRef(iface); + IDirect3DMaterial3_AddRef(iface); *obp = iface; TRACE(" Creating IUnknown interface at %p.\n", *obp); return S_OK; diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 2357790..df85526 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5440,13 +5440,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 * if (!iface) return NULL; if (iface->lpVtbl != &ddraw_surface7_vtbl) { - HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface7, (void **)&iface); + HRESULT hr = IDirectDrawSurface7_QueryInterface(iface, &IID_IDirectDrawSurface7, (void **)&iface); if (FAILED(hr)) { WARN("Object %p doesn't expose interface IDirectDrawSurface7.\n", iface); return NULL; } - IUnknown_Release(iface); + IDirectDrawSurface7_Release(iface); } return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface7_iface); } @@ -5456,13 +5456,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 * if (!iface) return NULL; if (iface->lpVtbl != &ddraw_surface4_vtbl) { - HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface4, (void **)&iface); + HRESULT hr = IDirectDrawSurface4_QueryInterface(iface, &IID_IDirectDrawSurface4, (void **)&iface); if (FAILED(hr)) { WARN("Object %p doesn't expose interface IDirectDrawSurface4.\n", iface); return NULL; } - IUnknown_Release(iface); + IDirectDrawSurface4_Release(iface); } return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface4_iface); } @@ -5472,13 +5472,13 @@ static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSur if (!iface) return NULL; if (iface->lpVtbl != &ddraw_surface3_vtbl) { - HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface3, (void **)&iface); + HRESULT hr = IDirectDrawSurface3_QueryInterface(iface, &IID_IDirectDrawSurface3, (void **)&iface); if (FAILED(hr)) { WARN("Object %p doesn't expose interface IDirectDrawSurface3.\n", iface); return NULL; } - IUnknown_Release(iface); + IDirectDrawSurface3_Release(iface); } return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface3_iface); } @@ -5488,13 +5488,13 @@ static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSur if (!iface) return NULL; if (iface->lpVtbl != &ddraw_surface2_vtbl) { - HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface2, (void **)&iface); + HRESULT hr = IDirectDrawSurface2_QueryInterface(iface, &IID_IDirectDrawSurface2, (void **)&iface); if (FAILED(hr)) { WARN("Object %p doesn't expose interface IDirectDrawSurface2.\n", iface); return NULL; } - IUnknown_Release(iface); + IDirectDrawSurface2_Release(iface); } return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface2_iface); } @@ -5504,13 +5504,13 @@ struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *if if (!iface) return NULL; if (iface->lpVtbl != &ddraw_surface1_vtbl) { - HRESULT hr = IUnknown_QueryInterface(iface, &IID_IDirectDrawSurface, (void **)&iface); + HRESULT hr = IDirectDrawSurface_QueryInterface(iface, &IID_IDirectDrawSurface, (void **)&iface); if (FAILED(hr)) { WARN("Object %p doesn't expose interface IDirectDrawSurface.\n", iface); return NULL; } - IUnknown_Release(iface); + IDirectDrawSurface_Release(iface); } return CONTAINING_RECORD(iface, struct ddraw_surface, IDirectDrawSurface_iface); } diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 1fd33e7..29feb87 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -66,21 +66,21 @@ static HRESULT WINAPI d3d_vertex_buffer7_QueryInterface(IDirect3DVertexBuffer7 * if ( IsEqualGUID( &IID_IUnknown, riid ) ) { - IUnknown_AddRef(iface); + IDirect3DVertexBuffer7_AddRef(iface); *obj = iface; TRACE(" Creating IUnknown interface at %p.\n", *obj); return S_OK; } if ( IsEqualGUID( &IID_IDirect3DVertexBuffer, riid ) ) { - IUnknown_AddRef(iface); + IDirect3DVertexBuffer7_AddRef(iface); *obj = &buffer->IDirect3DVertexBuffer_iface; TRACE(" Creating IDirect3DVertexBuffer interface %p\n", *obj); return S_OK; } if ( IsEqualGUID( &IID_IDirect3DVertexBuffer7, riid ) ) { - IUnknown_AddRef(iface); + IDirect3DVertexBuffer7_AddRef(iface); *obj = iface; TRACE(" Creating IDirect3DVertexBuffer7 interface %p\n", *obj); return S_OK;
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
55
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
Results per page:
10
25
50
100
200