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
February 2017
----- 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
838 discussions
Start a n
N
ew thread
Carlo Bramini : msvcrt: Use return value of *printf() instead of calling strlen() and simplify code.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 5f2b9d5968ed11cf3213fb70c6748f56ec5acaeb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f2b9d5968ed11cf3213fb70c…
Author: Carlo Bramini <carlo.bramix(a)libero.it> Date: Sun Feb 19 15:17:57 2017 +0100 msvcrt: Use return value of *printf() instead of calling strlen() and simplify code. Signed-off-by: Carlo Bramini <carlo_bramini(a)users.sourceforge.net> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 12 ++++-------- dlls/msvcrt/printf.h | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index af3aa2a..0bb006d 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1580,7 +1580,7 @@ char * CDECL MSVCRT__fcvt( double number, int ndigits, int *decpt, int *sign ) number = -number; } else *sign = 0; - snprintf(buf, 80, "%.*f", ndigits < 0 ? 0 : ndigits, number); + stop = snprintf(buf, 80, "%.*f", ndigits < 0 ? 0 : ndigits, number); ptr1 = buf; ptr2 = data->efcvt_buffer; first = NULL; @@ -1597,9 +1597,7 @@ char * CDECL MSVCRT__fcvt( double number, int ndigits, int *decpt, int *sign ) /* If requested digits is zero or less, we will need to truncate * the returned string */ if (ndigits < 1) { - stop = strlen(buf) + ndigits; - } else { - stop = strlen(buf); + stop += ndigits; } while (*ptr1 == '0') ptr1++; /* Skip leading zeroes */ @@ -1665,7 +1663,7 @@ int CDECL MSVCRT__fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int number = -number; } else *sign = 0; - snprintf(buf, 80, "%.*f", ndigits < 0 ? 0 : ndigits, number); + stop = snprintf(buf, 80, "%.*f", ndigits < 0 ? 0 : ndigits, number); ptr1 = buf; ptr2 = outbuffer; first = NULL; @@ -1682,9 +1680,7 @@ int CDECL MSVCRT__fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int /* If requested digits is zero or less, we will need to truncate * the returned string */ if (ndigits < 1) { - stop = strlen(buf) + ndigits; - } else { - stop = strlen(buf); + stop += ndigits; } while (*ptr1 == '0') ptr1++; /* Skip leading zeroes */ diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index 392ead8..8bb3382 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -242,8 +242,7 @@ static inline void FUNC_NAME(pf_rebuild_format_string)(char *p, FUNC_NAME(pf_fla if(flags->Alternate) *p++ = flags->Alternate; if(flags->Precision >= 0) { - sprintf(p, ".%d", flags->Precision); - p += strlen(p); + p += sprintf(p, ".%d", flags->Precision); } *p++ = flags->Format; *p++ = 0;
1
0
0
0
Francois Gouget : taskschd: Simplify and standardize the heap_xxx() declarations.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 2fe91725c58f6ffa57cc30e3366572c09b2e9622 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2fe91725c58f6ffa57cc30e33…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 22 11:27:25 2017 +0100 taskschd: Simplify and standardize the heap_xxx() declarations. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/taskschd/taskschd_private.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dlls/taskschd/taskschd_private.h b/dlls/taskschd/taskschd_private.h index fd5a363..ee7e59e 100644 --- a/dlls/taskschd/taskschd_private.h +++ b/dlls/taskschd/taskschd_private.h @@ -31,27 +31,24 @@ HRESULT RegisteredTaskCollection_create(const WCHAR *path, IRegisteredTaskCollec WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path) DECLSPEC_HIDDEN; -static void *heap_alloc_zero(SIZE_T size) __WINE_ALLOC_SIZE(1); -static inline void *heap_alloc_zero(SIZE_T size) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + return HeapAlloc(GetProcessHeap(), 0, size); } -static void *heap_alloc(SIZE_T size) __WINE_ALLOC_SIZE(1); -static inline void *heap_alloc(SIZE_T size) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) { - return HeapAlloc(GetProcessHeap(), 0, size); + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); } -static void *heap_realloc(void *ptr, SIZE_T size) __WINE_ALLOC_SIZE(2); -static inline void *heap_realloc(void *ptr, SIZE_T size) +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size) { - return HeapReAlloc(GetProcessHeap(), 0, ptr, size); + return HeapReAlloc(GetProcessHeap(), 0, mem, size); } -static inline BOOL heap_free(void *ptr) +static inline BOOL heap_free(void *mem) { - return HeapFree(GetProcessHeap(), 0, ptr); + return HeapFree(GetProcessHeap(), 0, mem); } static inline WCHAR *heap_strdupW(const WCHAR *src)
1
0
0
0
Francois Gouget : oledb32: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 87f21b12b31fc03d7593c11ae6de52ee995b73e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=87f21b12b31fc03d7593c11ae…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 22 11:26:30 2017 +0100 oledb32: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. And standardize their parameter names. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oledb32/oledb_private.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/oledb32/oledb_private.h b/dlls/oledb32/oledb_private.h index 0b71a81..6f2bf76 100644 --- a/dlls/oledb32/oledb_private.h +++ b/dlls/oledb32/oledb_private.h @@ -26,24 +26,24 @@ HRESULT create_dslocator(IUnknown *outer, void **obj) DECLSPEC_HIDDEN; HRESULT get_data_source(IUnknown *outer, DWORD clsctx, LPWSTR initstring, REFIID riid, IUnknown **datasource) DECLSPEC_HIDDEN; -static inline void *heap_alloc(size_t len) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - return HeapAlloc(GetProcessHeap(), 0, len); + return HeapAlloc(GetProcessHeap(), 0, size); } -static inline void *heap_alloc_zero(size_t len) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) { - return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); } -static inline void *heap_realloc(void *mem, size_t len) +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size) { - return HeapReAlloc(GetProcessHeap(), 0, mem, len); + return HeapReAlloc(GetProcessHeap(), 0, mem, size); } -static inline void *heap_realloc_zero(void *mem, size_t len) +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size) { - return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); + return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size); } static inline BOOL heap_free(void *mem)
1
0
0
0
Francois Gouget : pdh: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 88c4d3361cf179f39b936a7dd61f7d268d45b02e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=88c4d3361cf179f39b936a7dd…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 22 11:25:56 2017 +0100 pdh: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. And standardize their formatting and type names. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/pdh/pdh_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index 39f9f25..0d7c5ef 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -47,19 +47,19 @@ static CRITICAL_SECTION_DEBUG pdh_handle_cs_debug = }; static CRITICAL_SECTION pdh_handle_cs = { &pdh_handle_cs_debug, -1, 0, 0, 0, 0 }; -static inline void *heap_alloc( SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - return HeapAlloc( GetProcessHeap(), 0, size ); + return HeapAlloc(GetProcessHeap(), 0, size); } -static inline void *heap_alloc_zero( SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) { - return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); } -static inline void heap_free( LPVOID mem ) +static inline BOOL heap_free(void *mem) { - HeapFree( GetProcessHeap(), 0, mem ); + return HeapFree(GetProcessHeap(), 0, mem); } static inline WCHAR *pdh_strdup( const WCHAR *src )
1
0
0
0
Francois Gouget : wbemdisp: Simplify and standardize the heap_xxx() declarations.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 64be3a2fe06a8d249de78c56e36118d4d36afab3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=64be3a2fe06a8d249de78c56e…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 22 11:25:18 2017 +0100 wbemdisp: Simplify and standardize the heap_xxx() declarations. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemdisp/wbemdisp_private.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/wbemdisp/wbemdisp_private.h b/dlls/wbemdisp/wbemdisp_private.h index cc84d72..2891248 100644 --- a/dlls/wbemdisp/wbemdisp_private.h +++ b/dlls/wbemdisp/wbemdisp_private.h @@ -18,13 +18,12 @@ HRESULT SWbemLocator_create(LPVOID *) DECLSPEC_HIDDEN; -static void *heap_alloc( size_t len ) __WINE_ALLOC_SIZE(1); -static inline void *heap_alloc( size_t len ) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - return HeapAlloc( GetProcessHeap(), 0, len ); + return HeapAlloc(GetProcessHeap(), 0, size); } -static inline BOOL heap_free( void *mem ) +static inline BOOL heap_free(void *mem) { - return HeapFree( GetProcessHeap(), 0, mem ); + return HeapFree(GetProcessHeap(), 0, mem); }
1
0
0
0
Francois Gouget : webservices: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 304bd8e203fe36faefc243a0a544f4b0682174d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=304bd8e203fe36faefc243a0a…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Feb 22 11:24:57 2017 +0100 webservices: Add __WINE_ALLOC_SIZE attributes to heap_xxx() functions. And standardize their formatting and type names. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/webservices_private.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/webservices/webservices_private.h b/dlls/webservices/webservices_private.h index 3aafeb1..e6fdbb1 100644 --- a/dlls/webservices/webservices_private.h +++ b/dlls/webservices/webservices_private.h @@ -147,27 +147,27 @@ static inline BOOL is_valid_parent( const struct node *node ) return (node_type( node ) == WS_XML_NODE_TYPE_ELEMENT || node_type( node ) == WS_XML_NODE_TYPE_BOF); } -static inline void *heap_alloc( SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size) { - return HeapAlloc( GetProcessHeap(), 0, size ); + return HeapAlloc(GetProcessHeap(), 0, size); } -static inline void *heap_alloc_zero( SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size) { - return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); } -static inline void *heap_realloc( void *mem, SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size) { - return HeapReAlloc( GetProcessHeap(), 0, mem, size ); + return HeapReAlloc(GetProcessHeap(), 0, mem, size); } -static inline void *heap_realloc_zero( void *mem, SIZE_T size ) +static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size) { - return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size ); + return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size); } -static inline BOOL heap_free( void *mem ) +static inline BOOL heap_free(void *mem) { - return HeapFree( GetProcessHeap(), 0, mem ); + return HeapFree(GetProcessHeap(), 0, mem); }
1
0
0
0
Alistair Leslie-Hughes : dplayx/tests: Fix memory leaks (valgrind).
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 00f6588c72f5e3bf6d5693babff6caaf13e50822 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00f6588c72f5e3bf6d5693bab…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Feb 22 05:15:02 2017 +0000 dplayx/tests: Fix memory leaks (valgrind). Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dplayx/dplay.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index cf6bd4a..f4d934f 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -245,6 +245,7 @@ static BOOL DP_DestroyDirectPlay2( LPVOID lpDP ) NS_DeleteSessionCache( This->dp2->lpNameServerData ); + HeapFree( GetProcessHeap(), 0, This->dp2->dplspData.lpCB); HeapFree( GetProcessHeap(), 0, This->dp2->lpSessionDesc ); IDirectPlaySP_Release( This->dp2->spData.lpISP ); @@ -4360,8 +4361,10 @@ static HRESULT WINAPI IDirectPlay4AImpl_EnumConnections( IDirectPlay4A *iface, if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize, &dpName, dwFlags, lpContext ) ) { + HeapFree( GetProcessHeap(), 0, lpAddressBuffer ); return DP_OK; } + HeapFree( GetProcessHeap(), 0, lpAddressBuffer ); } }
1
0
0
0
Alistair Leslie-Hughes : oledb32: Support converting to DBTYPE_BYREF | DBTYPE_STR in DataConvert.
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 98a2465abd7403b0f2581b09d9e113f73354f8b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=98a2465abd7403b0f2581b09d…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Feb 22 03:04:38 2017 +0000 oledb32: Support converting to DBTYPE_BYREF | DBTYPE_STR in DataConvert. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oledb32/convert.c | 24 +++++++++++ dlls/oledb32/tests/convert.c | 94 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c index 0a1518d..ac462f2 100644 --- a/dlls/oledb32/convert.c +++ b/dlls/oledb32/convert.c @@ -865,6 +865,30 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, return hr; } + case DBTYPE_BYREF | DBTYPE_STR: + { + BSTR b; + char **d = dst; + DBLENGTH length; + hr = IDataConvert_DataConvert(iface, src_type, DBTYPE_BSTR, src_len, &length, + src, &b, sizeof(BSTR), src_status, dst_status, + precision, scale, flags); + if(hr != S_OK) return hr; + + length = WideCharToMultiByte(CP_ACP, 0, b, -1, NULL, 0, NULL, NULL); + *dst_len = length - 1; /* Doesn't include size for '\0' */ + *dst_status = DBSTATUS_S_OK; + *d = CoTaskMemAlloc(length); + + if(*d) + WideCharToMultiByte(CP_ACP, 0, b, -1, *d, length, NULL, NULL); + else + hr = E_OUTOFMEMORY; + SysFreeString(b); + + return hr; + } + case DBTYPE_VARIANT: { VARIANT *v = dst; diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c index de852da..405e728 100644 --- a/dlls/oledb32/tests/convert.c +++ b/dlls/oledb32/tests/convert.c @@ -2103,6 +2103,99 @@ static void test_converttobyrefwstr(void) ok(dst_len == 44, "got %ld\n", dst_len); } +static void test_converttobyrefstr(void) +{ + HRESULT hr; + char *dst; + BYTE src[20]; + DBSTATUS dst_status; + DBLENGTH dst_len; + static const WCHAR ten[] = {'1','0',0}; + BSTR b; + VARIANT v; + + VariantInit(&v); + + hr = IDataConvert_DataConvert(convert, DBTYPE_EMPTY, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 0, "got %ld\n", dst_len); + ok(dst[0] == 0, "got %04x\n", dst[0]); + CoTaskMemFree(dst); + + dst = (void*)0x12345678; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_NULL, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == DB_E_UNSUPPORTEDCONVERSION, "got %08x\n", hr); + ok(dst_status == DBSTATUS_E_BADACCESSOR, "got %08x\n", dst_status); + ok(dst_len == 0x1234, "got %ld\n", dst_len); + ok(dst == (void*)0x12345678, "got %p\n", dst); + + *(short *)src = 4321; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %ld\n", dst_len); + ok(!lstrcmpA(dst, "4321"), "got %s\n", dst); + CoTaskMemFree(dst); + + *(short *)src = 4321; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_I2, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, 0, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 4, "got %ld\n", dst_len); + ok(!lstrcmpA(dst, "4321"), "got %s\n", dst); + CoTaskMemFree(dst); + + b = SysAllocString(ten); + *(BSTR *)src = b; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_BSTR, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %ld\n", dst_len); + ok(!lstrcmpA("10", dst), "got %s\n", dst); + CoTaskMemFree(dst); + SysFreeString(b); + + memcpy(src, ten, sizeof(ten)); + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR | DBTYPE_BYREF, 2, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 1, "got %ld\n", dst_len); + ok(dst[0] == '1', "got %02x\n", dst[0]); + ok(dst[1] == 0, "got %02x\n", dst[1]); + CoTaskMemFree(dst); + + memcpy(src, ten, sizeof(ten)); + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR | DBTYPE_BYREF, 4, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %ld\n", dst_len); + ok(!lstrcmpA("10", dst), "got %s\n", dst); + CoTaskMemFree(dst); + + memcpy(src, ten, sizeof(ten)); + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, DBDATACONVERT_LENGTHFROMNTS); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); + ok(dst_len == 2, "got %ld\n", dst_len); + ok(!lstrcmpA("10", dst), "got %s\n", dst); + CoTaskMemFree(dst); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_STR | DBTYPE_BYREF, 0, &dst_len, &v, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); +} + static void test_converttoguid(void) { HRESULT hr; @@ -3116,6 +3209,7 @@ START_TEST(convert) test_converttobstr(); test_converttowstr(); test_converttobyrefwstr(); + test_converttobyrefstr(); test_converttoguid(); test_converttoui1(); test_converttoui4();
1
0
0
0
Henri Verbeet : wined3d: Support depth formats in wined3d_format_convert_from_float().
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 0f304806b3e0e8b2c84a367266a56eeb980d9ac7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f304806b3e0e8b2c84a36726…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 22 00:53:23 2017 +0100 wined3d: Support depth formats in wined3d_format_convert_from_float(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/utils.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9041c53..d236847 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4930,22 +4930,27 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con } conv[] = { - {WINED3DFMT_B8G8R8A8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, - {WINED3DFMT_B8G8R8X8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, - {WINED3DFMT_B8G8R8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, - {WINED3DFMT_B5G6R5_UNORM, 31.0f, 63.0f, 31.0f, 0.0f, 11, 5, 0, 0}, - {WINED3DFMT_B5G5R5A1_UNORM, 31.0f, 31.0f, 31.0f, 1.0f, 10, 5, 0, 15}, - {WINED3DFMT_B5G5R5X1_UNORM, 31.0f, 31.0f, 31.0f, 1.0f, 10, 5, 0, 15}, - {WINED3DFMT_R8_UNORM, 255.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, - {WINED3DFMT_A8_UNORM, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0}, - {WINED3DFMT_B4G4R4A4_UNORM, 15.0f, 15.0f, 15.0f, 15.0f, 8, 4, 0, 12}, - {WINED3DFMT_B4G4R4X4_UNORM, 15.0f, 15.0f, 15.0f, 15.0f, 8, 4, 0, 12}, - {WINED3DFMT_B2G3R3_UNORM, 7.0f, 7.0f, 3.0f, 0.0f, 5, 2, 0, 0}, - {WINED3DFMT_R8G8B8A8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 0, 8, 16, 24}, - {WINED3DFMT_R8G8B8X8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 0, 8, 16, 24}, - {WINED3DFMT_B10G10R10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 20, 10, 0, 30}, - {WINED3DFMT_R10G10B10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 0, 10, 20, 30}, - {WINED3DFMT_P8_UINT, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0}, + {WINED3DFMT_B8G8R8A8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, + {WINED3DFMT_B8G8R8X8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, + {WINED3DFMT_B8G8R8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 16, 8, 0, 24}, + {WINED3DFMT_B5G6R5_UNORM, 31.0f, 63.0f, 31.0f, 0.0f, 11, 5, 0, 0}, + {WINED3DFMT_B5G5R5A1_UNORM, 31.0f, 31.0f, 31.0f, 1.0f, 10, 5, 0, 15}, + {WINED3DFMT_B5G5R5X1_UNORM, 31.0f, 31.0f, 31.0f, 1.0f, 10, 5, 0, 15}, + {WINED3DFMT_R8_UNORM, 255.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, + {WINED3DFMT_A8_UNORM, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0}, + {WINED3DFMT_B4G4R4A4_UNORM, 15.0f, 15.0f, 15.0f, 15.0f, 8, 4, 0, 12}, + {WINED3DFMT_B4G4R4X4_UNORM, 15.0f, 15.0f, 15.0f, 15.0f, 8, 4, 0, 12}, + {WINED3DFMT_B2G3R3_UNORM, 7.0f, 7.0f, 3.0f, 0.0f, 5, 2, 0, 0}, + {WINED3DFMT_R8G8B8A8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 0, 8, 16, 24}, + {WINED3DFMT_R8G8B8X8_UNORM, 255.0f, 255.0f, 255.0f, 255.0f, 0, 8, 16, 24}, + {WINED3DFMT_B10G10R10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 20, 10, 0, 30}, + {WINED3DFMT_R10G10B10A2_UNORM, 1023.0f, 1023.0f, 1023.0f, 3.0f, 0, 10, 20, 30}, + {WINED3DFMT_P8_UINT, 0.0f, 0.0f, 0.0f, 255.0f, 0, 0, 0, 0}, + {WINED3DFMT_S1_UINT_D15_UNORM, 32767.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, + {WINED3DFMT_D16_UNORM, 65535.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, + {WINED3DFMT_D24_UNORM_S8_UINT, 16777215.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, + {WINED3DFMT_X8D24_UNORM, 16777215.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, + {WINED3DFMT_D32_UNORM, 4294967295.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0}, }; unsigned int i;
1
0
0
0
Henri Verbeet : wined3d: Merge surface_convert_depth_to_float() into wined3d_format_convert_color_to_float().
by Alexandre Julliard
22 Feb '17
22 Feb '17
Module: wine Branch: master Commit: 34a123631d2c4ff3ef747a1e4603f2bf4cd8d151 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34a123631d2c4ff3ef747a1e4…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 22 00:53:22 2017 +0100 wined3d: Merge surface_convert_depth_to_float() into wined3d_format_convert_color_to_float(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 37 +++---------------------------------- dlls/wined3d/utils.c | 10 +++++++++- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 15e020e..449c1fa 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -641,37 +641,6 @@ static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined return TRUE; } -static BOOL surface_convert_depth_to_float(const struct wined3d_surface *surface, DWORD depth, float *float_depth) -{ - const struct wined3d_format *format = surface->container->resource.format; - - switch (format->id) - { - case WINED3DFMT_S1_UINT_D15_UNORM: - *float_depth = depth / (float)0x00007fff; - break; - - case WINED3DFMT_D16_UNORM: - *float_depth = depth / (float)0x0000ffff; - break; - - case WINED3DFMT_D24_UNORM_S8_UINT: - case WINED3DFMT_X8D24_UNORM: - *float_depth = depth / (float)0x00ffffff; - break; - - case WINED3DFMT_D32_UNORM: - *float_depth = depth / (float)0xffffffff; - break; - - default: - ERR("Unhandled conversion from %s to floating point.\n", debug_d3dformat(format->id)); - return FALSE; - } - - return TRUE; -} - static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const RECT *rect, float depth) { struct wined3d_resource *resource = &surface->container->resource; @@ -3814,14 +3783,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst { if (flags & WINED3D_BLT_DEPTH_FILL) { - float depth; + struct wined3d_color color; TRACE("Depth fill.\n"); - if (!surface_convert_depth_to_float(dst_surface, fx->fill_color, &depth)) + if (!wined3d_format_convert_color_to_float(dst_texture->resource.format, NULL, fx->fill_color, &color)) return WINED3DERR_INVALIDCALL; - if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, depth))) + if (SUCCEEDED(wined3d_surface_depth_fill(dst_surface, dst_rect, color.r))) return WINED3D_OK; } else diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 6c3fd5e..9041c53 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4974,7 +4974,7 @@ DWORD wined3d_format_convert_from_float(const struct wined3d_format *format, con static float color_to_float(DWORD color, DWORD size, DWORD offset) { - DWORD mask = (1u << size) - 1; + DWORD mask = size < 32 ? (1u << size) - 1 : ~0u; if (!size) return 1.0f; @@ -5030,6 +5030,14 @@ BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, float_color->a = color / 255.0f; return TRUE; + case WINED3DFMT_S1_UINT_D15_UNORM: + case WINED3DFMT_D16_UNORM: + case WINED3DFMT_D24_UNORM_S8_UINT: + case WINED3DFMT_X8D24_UNORM: + case WINED3DFMT_D32_UNORM: + float_color->r = color_to_float(color, format->depth_size, 0); + return TRUE; + default: ERR("Unhandled conversion from %s to floating point.\n", debug_d3dformat(format->id)); return FALSE;
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
84
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
Results per page:
10
25
50
100
200