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
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
September 2011
----- 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
996 discussions
Start a n
N
ew thread
Octavian Voicu : vbscript: Fix possible memory leak/ crash caused by race condition in VBScriptParse_InitNew.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 2f053965a2dd8f167b0f0189f312b229e5372a69 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f053965a2dd8f167b0f0189f…
Author: Octavian Voicu <octavian.voicu(a)gmail.com> Date: Thu Sep 1 05:23:12 2011 +0300 vbscript: Fix possible memory leak/crash caused by race condition in VBScriptParse_InitNew. --- dlls/vbscript/vbscript.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 084337f..caee4d4 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -348,7 +348,7 @@ static ULONG WINAPI VBScriptParse_Release(IActiveScriptParse *iface) static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface) { VBScript *This = impl_from_IActiveScriptParse(iface); - script_ctx_t *ctx; + script_ctx_t *ctx, *old_ctx; TRACE("(%p)\n", This); @@ -359,8 +359,8 @@ static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface) if(!ctx) return E_OUTOFMEMORY; - ctx = InterlockedCompareExchangePointer((void**)&This->ctx, ctx, NULL); - if(ctx) { + old_ctx = InterlockedCompareExchangePointer((void**)&This->ctx, ctx, NULL); + if(old_ctx) { destroy_script(ctx); return E_UNEXPECTED; }
1
0
0
0
Dan Kegel : configure: Fix configure failures under -Werror -Wall.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 45725be9d5c721710f69a576dbc80cea6738ed13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45725be9d5c721710f69a576d…
Author: Dan Kegel <dank(a)kegel.com> Date: Wed Aug 31 17:35:49 2011 -0700 configure: Fix configure failures under -Werror -Wall. --- configure | 10 +++++----- configure.ac | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 7ac2d12..563117e 100755 --- a/configure +++ b/configure @@ -8425,7 +8425,7 @@ fi int main () { -static typeof(XRRSetScreenConfigAndRate) * func; +static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0; ; return 0; } @@ -8502,7 +8502,7 @@ fi int main () { -static typeof(XineramaQueryScreens) * func; +static typeof(XineramaQueryScreens) * func; if (func) return 0; ; return 0; } @@ -8691,7 +8691,7 @@ else int main () { -GLenum test = GL_UNSIGNED_SHORT_5_6_5; +GLenum test = GL_UNSIGNED_SHORT_5_6_5; return (test == GL_UNSIGNED_SHORT_5_6_5); ; return 0; } @@ -9520,7 +9520,7 @@ if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : int main () { -typeof(gnutls_mac_get_key_size) *pfunc; +static typeof(gnutls_mac_get_key_size) *func; if (func) return 0; ; return 0; } @@ -10535,7 +10535,7 @@ $as_echo_n "checking whether gint64 defined by gst/app/gstappsink.h is indeed 64 int main () { -int a[sizeof(gint64) > 4 ? 1 : -1] +static int a[sizeof(gint64) > 4 ? 1 : -1]; if (a[0]) return 0; ; return 0; } diff --git a/configure.ac b/configure.ac index c824206..ed7a60c 100644 --- a/configure.ac +++ b/configure.ac @@ -1024,7 +1024,7 @@ then if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x" then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h> -#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func;]])], +#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0;]])], [WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,,,[$X_LIBS $XLIB $X_EXTRA_LIBS])]) fi WINE_NOTICE_WITH(xrandr,[test "x$ac_cv_lib_soname_Xrandr" = "x"], @@ -1034,7 +1034,7 @@ then if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h> -#include <X11/extensions/Xinerama.h>]], [[static typeof(XineramaQueryScreens) * func;]])], +#include <X11/extensions/Xinerama.h>]], [[static typeof(XineramaQueryScreens) * func; if (func) return 0;]])], [WINE_CHECK_SONAME(Xinerama,XineramaQueryScreens,,,[$X_LIBS $XLIB $X_EXTRA_LIBS])]) fi WINE_NOTICE_WITH(xinerama,[test "x$ac_cv_lib_soname_Xinerama" = "x"], @@ -1068,7 +1068,7 @@ then then dnl Check for some problems due to old Mesa versions AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_header_version_OK, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h>]], [[GLenum test = GL_UNSIGNED_SHORT_5_6_5;]])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h>]], [[GLenum test = GL_UNSIGNED_SHORT_5_6_5; return (test == GL_UNSIGNED_SHORT_5_6_5);]])], [wine_cv_opengl_header_version_OK="yes"], [wine_cv_opengl_header_version_OK="no"])) @@ -1235,7 +1235,7 @@ then CPPFLAGS="$CPPFLAGS $ac_gnutls_cflags" fi AC_CHECK_HEADER(gnutls/gnutls.h, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[typeof(gnutls_mac_get_key_size) *pfunc;]])], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[static typeof(gnutls_mac_get_key_size) *func; if (func) return 0;]])], [WINE_CHECK_SONAME(gnutls,gnutls_global_init, [AC_SUBST(GNUTLSINCL,"$ac_gnutls_cflags")],,[$ac_gnutls_libs])])]) CPPFLAGS="$ac_save_CPPFLAGS" @@ -1458,7 +1458,7 @@ then [AC_CHECK_HEADER([gst/app/gstappsink.h], [AC_MSG_CHECKING([whether gint64 defined by gst/app/gstappsink.h is indeed 64-bit]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gst/app/gstappsink.h>]], - [[int a[sizeof(gint64) > 4 ? 1 : -1]]])], + [[static int a[sizeof(gint64) > 4 ? 1 : -1]; if (a[0]) return 0;]])], [AC_MSG_RESULT([yes]) AC_CHECK_LIB(gstreamer-0.10,gst_pad_get_caps_reffed, [AC_CHECK_LIB(gstapp-0.10,gst_app_buffer_new,
1
0
0
0
Dan Kegel : configure: AC_C_CONST is obsolete.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 82954d45de710f3399f56ef0005cb307c3a5f09a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82954d45de710f3399f56ef00…
Author: Dan Kegel <dank(a)kegel.com> Date: Wed Aug 31 17:17:44 2011 -0700 configure: AC_C_CONST is obsolete. --- configure | 80 --------------------------------------------------- configure.ac | 1 - include/config.h.in | 3 -- 3 files changed, 0 insertions(+), 84 deletions(-) diff --git a/configure b/configure index c421b2a..7ac2d12 100755 --- a/configure +++ b/configure @@ -13108,86 +13108,6 @@ $as_echo "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : diff --git a/configure.ac b/configure.ac index ae89108..c824206 100644 --- a/configure.ac +++ b/configure.ac @@ -2055,7 +2055,6 @@ fi dnl **** Check for types **** -AC_C_CONST AC_C_INLINE AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t]) AC_CHECK_TYPES([sigset_t],,,[#include <sys/types.h> diff --git a/include/config.h.in b/include/config.h.in index 26528b7..f0016c8 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1327,9 +1327,6 @@ convention */ #undef __ASM_STDCALL_FUNC -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus
1
0
0
0
Andrew Eikum : winecfg: Remove driver selection from Audio tab.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: dfe73cda4a6c08911deacb09d2752545ab32849f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfe73cda4a6c08911deacb09d…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Wed Aug 31 15:16:16 2011 -0500 winecfg: Remove driver selection from Audio tab. --- po/ar.po | 224 ++++-------- po/bg.po | 230 ++++-------- po/ca.po | 223 ++++-------- po/cs.po | 233 ++++-------- po/da.po | 232 ++++-------- po/de.po | 233 ++++-------- po/el.po | 224 ++++-------- po/en.po | 223 ++++-------- po/en_US.po | 232 ++++-------- po/eo.po | 224 ++++-------- po/es.po | 233 ++++-------- po/fa.po | 224 ++++-------- po/fi.po | 227 ++++-------- po/fr.po | 234 ++++-------- po/he.po | 247 ++++--------- po/hi.po | 223 ++++-------- po/hu.po | 230 ++++-------- po/it.po | 233 ++++-------- po/ja.po | 232 ++++-------- po/ko.po | 232 ++++-------- po/lt.po | 232 ++++-------- po/ml.po | 223 ++++-------- po/nb_NO.po | 232 ++++-------- po/nl.po | 235 ++++-------- po/or.po | 223 ++++-------- po/pa.po | 223 ++++-------- po/pl.po | 232 ++++-------- po/pt_BR.po | 233 ++++-------- po/pt_PT.po | 233 ++++-------- po/rm.po | 224 ++++-------- po/ro.po | 233 ++++-------- po/ru.po | 232 ++++-------- po/sk.po | 225 ++++-------- po/sl.po | 233 ++++-------- po/sr_RS(a)cyrillic.po | 226 ++++-------- po/sr_RS(a)latin.po | 233 ++++-------- po/sv.po | 233 ++++-------- po/te.po | 223 ++++-------- po/th.po | 224 ++++-------- po/tr.po | 233 ++++-------- po/uk.po | 232 ++++-------- po/wa.po | 224 ++++-------- po/wine.pot | 223 ++++-------- po/zh_CN.po | 233 ++++-------- po/zh_TW.po | 233 ++++-------- programs/winecfg/Bg.rc | 20 +- programs/winecfg/Cs.rc | 20 +- programs/winecfg/Da.rc | 20 +- programs/winecfg/De.rc | 20 +- programs/winecfg/En.rc | 20 +- programs/winecfg/Es.rc | 20 +- programs/winecfg/Fi.rc | 20 +- programs/winecfg/Fr.rc | 20 +- programs/winecfg/Hu.rc | 20 +- programs/winecfg/It.rc | 20 +- programs/winecfg/Ja.rc | 20 +- programs/winecfg/Ko.rc | 20 +- programs/winecfg/Lt.rc | 20 +- programs/winecfg/Nl.rc | 20 +- programs/winecfg/No.rc | 20 +- programs/winecfg/Pl.rc | 20 +- programs/winecfg/Pt.rc | 40 +-- programs/winecfg/Ro.rc | 20 +- programs/winecfg/Ru.rc | 20 +- programs/winecfg/Si.rc | 20 +- programs/winecfg/Sr.rc | 20 +- programs/winecfg/Sv.rc | 20 +- programs/winecfg/Tr.rc | 20 +- programs/winecfg/Uk.rc | 20 +- programs/winecfg/Zh.rc | 40 +-- programs/winecfg/audio.c | 744 +++---------------------------------- programs/winecfg/idb_checkbox.bmp | Bin 502 -> 0 bytes programs/winecfg/resource.h | 22 -- programs/winecfg/winecfg.c | 3 - programs/winecfg/winecfg.rc | 25 -- 75 files changed, 3728 insertions(+), 7929 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dfe73cda4a6c08911deac…
1
0
0
0
Andrew Eikum : mmdevapi: Automatically select the correct driver.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: c4b94b1ba4ee1664c0a14515d6fbc6d648e9175b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4b94b1ba4ee1664c0a14515d…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Wed Aug 31 15:04:37 2011 -0500 mmdevapi: Automatically select the correct driver. --- dlls/mmdevapi/main.c | 97 ++++++++++++++++--------- dlls/mmdevapi/mmdevapi.h | 15 ++++ dlls/winealsa.drv/mmdevdrv.c | 13 ++++ dlls/winealsa.drv/winealsa.drv.spec | 1 + dlls/winecoreaudio.drv/mmdevdrv.c | 13 ++++ dlls/winecoreaudio.drv/winecoreaudio.drv.spec | 1 + dlls/wineoss.drv/mmdevdrv.c | 48 ++++++++++++ dlls/wineoss.drv/wineoss.drv.spec | 1 + 8 files changed, 155 insertions(+), 34 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c4b94b1ba4ee1664c0a14…
1
0
0
0
Andrew Eikum : winmm: Determine the driver from MMDevAPI.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: f6890ef0e227afd12ce2325497d0cae478602c7d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f6890ef0e227afd12ce232549…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Wed Aug 31 15:04:23 2011 -0500 winmm: Determine the driver from MMDevAPI. This uses a half-implemented, Wine-specific IMMDevice object to extract the driver name. --- dlls/mmdevapi/devenum.c | 95 +++++++++++++++++++++++++++++++++++++++++++++- dlls/mmdevapi/main.c | 1 + dlls/mmdevapi/mmdevapi.h | 1 + dlls/winmm/lolvldrv.c | 80 +++++++++++++++++++++++++++++--------- 4 files changed, 157 insertions(+), 20 deletions(-) diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index 8a71262..0cb471b 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -85,6 +85,8 @@ static const IMMDeviceVtbl MMDeviceVtbl; static const IPropertyStoreVtbl MMDevPropVtbl; static const IMMEndpointVtbl MMEndpointVtbl; +static IMMDevice info_device; + typedef struct MMDevColImpl { IMMDeviceCollection IMMDeviceCollection_iface; @@ -935,10 +937,19 @@ static HRESULT WINAPI MMDevEnum_GetDevice(IMMDeviceEnumerator *iface, const WCHA DWORD i=0; IMMDevice *dev = NULL; + static const WCHAR wine_info_deviceW[] = {'W','i','n','e',' ', + 'i','n','f','o',' ','d','e','v','i','c','e',0}; + + TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), device); + if(!name || !device) return E_POINTER; - TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), device); + if(!lstrcmpW(name, wine_info_deviceW)){ + *device = &info_device; + return S_OK; + } + for (i = 0; i < MMDevice_count; ++i) { WCHAR *str; @@ -1211,3 +1222,85 @@ static const IPropertyBagVtbl PB_Vtbl = PB_Read, PB_Write }; + +static ULONG WINAPI info_device_ps_AddRef(IPropertyStore *iface) +{ + return 2; +} + +static ULONG WINAPI info_device_ps_Release(IPropertyStore *iface) +{ + return 1; +} + +static HRESULT WINAPI info_device_ps_GetValue(IPropertyStore *iface, + REFPROPERTYKEY key, PROPVARIANT *pv) +{ + MMDevPropStore *This = impl_from_IPropertyStore(iface); + + if (!key || !pv) + return E_POINTER; + if (This->access != STGM_READ + && This->access != STGM_READWRITE) + return STG_E_ACCESSDENIED; + + if (IsEqualPropertyKey(*key, DEVPKEY_Device_Driver)) + { + pv->vt = VT_LPWSTR; + pv->u.pwszVal = CoTaskMemAlloc(lstrlenW(drvs.module_name) * sizeof(WCHAR)); + if (!pv->u.pwszVal) + return E_OUTOFMEMORY; + lstrcpyW(pv->u.pwszVal, drvs.module_name); + return S_OK; + } + + return E_INVALIDARG; +} + +static const IPropertyStoreVtbl info_device_ps_Vtbl = +{ + NULL, + info_device_ps_AddRef, + info_device_ps_Release, + NULL, + NULL, + info_device_ps_GetValue, + NULL, + NULL +}; + +static IPropertyStore info_device_ps = { + &info_device_ps_Vtbl +}; + +static ULONG WINAPI info_device_AddRef(IMMDevice *iface) +{ + return 2; +} + +static ULONG WINAPI info_device_Release(IMMDevice *iface) +{ + return 1; +} + +static HRESULT WINAPI info_device_OpenPropertyStore(IMMDevice *iface, + DWORD access, IPropertyStore **ppv) +{ + *ppv = &info_device_ps; + return S_OK; +} + +static const IMMDeviceVtbl info_device_Vtbl = +{ + NULL, + info_device_AddRef, + info_device_Release, + NULL, + info_device_OpenPropertyStore, + NULL, + NULL +}; + +static IMMDevice info_device = { + &info_device_Vtbl +}; diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index c694c6e..57541ab 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -79,6 +79,7 @@ static BOOL load_driver(const WCHAR *name) LDFC(GetAudioSessionManager); #undef LDFC + lstrcpyW(drvs.module_name, driver_module); TRACE("Successfully loaded %s\n", wine_dbgstr_w(driver_module)); return TRUE; diff --git a/dlls/mmdevapi/mmdevapi.h b/dlls/mmdevapi/mmdevapi.h index 2c3cd2d..e61c539 100644 --- a/dlls/mmdevapi/mmdevapi.h +++ b/dlls/mmdevapi/mmdevapi.h @@ -27,6 +27,7 @@ extern HRESULT MMDevice_GetPropValue(const GUID *devguid, DWORD flow, REFPROPERT typedef struct _DriverFuncs { HMODULE module; + WCHAR module_name[64]; /* ids gets an array of human-friendly endpoint names * keys gets an array of driver-specific stuff that is used diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c index 907d356..b8f1b54 100644 --- a/dlls/winmm/lolvldrv.c +++ b/dlls/winmm/lolvldrv.c @@ -23,6 +23,9 @@ #include "config.h" #include "wine/port.h" +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#define COBJMACROS #include <string.h> #include <stdarg.h> #include <stdio.h> @@ -30,10 +33,16 @@ #include "windef.h" #include "winbase.h" #include "winreg.h" +#include "winnls.h" #include "winemm.h" #include "wine/debug.h" #include "wine/exception.h" +#include "wingdi.h" +#include "ole2.h" +#include "devpkey.h" +#include "mmdeviceapi.h" + WINE_DEFAULT_DEBUG_CHANNEL(winmm); /* Default set of drivers to be loaded */ @@ -509,34 +518,67 @@ static BOOL MMDRV_Install(LPCSTR drvRegName, LPCSTR drvFileName, BOOL bIsMapper) */ static void MMDRV_Init(void) { - HKEY hKey; - char driver_buffer[256]; - char *p, *next; + IMMDeviceEnumerator *devenum; + IMMDevice *device; + IPropertyStore *ps; + PROPVARIANT pv; + DWORD size; + char *drvA; + HRESULT init_hr, hr; + + static const WCHAR wine_info_deviceW[] = {'W','i','n','e',' ', + 'i','n','f','o',' ','d','e','v','i','c','e',0}; + TRACE("()\n"); - strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER); + init_hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - /* @@ Wine registry key: HKCU\Software\Wine\Drivers */ - if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hKey)) - { - DWORD size = sizeof(driver_buffer); - if (RegQueryValueExA(hKey, "Audio", 0, NULL, (BYTE*)driver_buffer, &size)) - strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER); + hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, + CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&devenum); + if(FAILED(hr)){ + ERR("CoCreateInstance failed: %08x\n", hr); + goto exit; } - for (p = driver_buffer; p; p = next) - { - char filename[sizeof(driver_buffer)+10]; - next = strchr(p, ','); - if (next) *next++ = 0; - sprintf( filename, "wine%s.drv", p ); - if (MMDRV_Install(filename, filename, FALSE)) - break; - p = next; + hr = IMMDeviceEnumerator_GetDevice(devenum, wine_info_deviceW, &device); + IMMDeviceEnumerator_Release(devenum); + if(FAILED(hr)){ + ERR("GetDevice failed: %08x\n", hr); + goto exit; + } + + hr = IMMDevice_OpenPropertyStore(device, STGM_READ, &ps); + if(FAILED(hr)){ + ERR("OpenPropertyStore failed: %08x\n", hr); + IMMDevice_Release(device); + goto exit; } + hr = IPropertyStore_GetValue(ps, + (const PROPERTYKEY *)&DEVPKEY_Device_Driver, &pv); + IPropertyStore_Release(ps); + IMMDevice_Release(device); + if(FAILED(hr)){ + ERR("GetValue failed: %08x\n", hr); + goto exit; + } + + size = WideCharToMultiByte(CP_ACP, 0, pv.u.pwszVal, -1, + NULL, 0, NULL, NULL); + drvA = HeapAlloc(GetProcessHeap(), 0, size); + WideCharToMultiByte(CP_ACP, 0, pv.u.pwszVal, -1, drvA, size, NULL, NULL); + + MMDRV_Install(drvA, drvA, FALSE); + + HeapFree(GetProcessHeap(), 0, drvA); + PropVariantClear(&pv); + MMDRV_Install("wavemapper", "msacm32.drv", TRUE); MMDRV_Install("midimapper", "midimap.dll", TRUE); + +exit: + if(SUCCEEDED(init_hr)) + CoUninitialize(); } /******************************************************************
1
0
0
0
Henri Verbeet : wined3d: Make the device parameter to wined3d_device_get_light() const.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 9d9baef789361754b0dfc40ac75b6e3c133dc477 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d9baef789361754b0dfc40ac…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 31 20:40:45 2011 +0200 wined3d: Make the device parameter to wined3d_device_get_light() const. --- dlls/wined3d/device.c | 2 +- include/wine/wined3d.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index ed8afc8..c64ac9e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2091,7 +2091,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light return WINED3D_OK; } -HRESULT CDECL wined3d_device_get_light(struct wined3d_device *device, UINT light_idx, WINED3DLIGHT *light) +HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, WINED3DLIGHT *light) { UINT hash_idx = LIGHTMAP_HASHFUNC(light_idx); struct wined3d_light_info *light_info = NULL; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a5342bc..7b9a576 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2222,7 +2222,7 @@ HRESULT __cdecl wined3d_device_get_front_buffer_data(struct wined3d_device *devi UINT swapchain_idx, struct wined3d_surface *dst_surface); void __cdecl wined3d_device_get_gamma_ramp(struct wined3d_device *device, UINT swapchain_idx, WINED3DGAMMARAMP *ramp); HRESULT __cdecl wined3d_device_get_index_buffer(struct wined3d_device *device, struct wined3d_buffer **index_buffer); -HRESULT __cdecl wined3d_device_get_light(struct wined3d_device *device, UINT light_idx, WINED3DLIGHT *light); +HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, WINED3DLIGHT *light); HRESULT __cdecl wined3d_device_get_light_enable(struct wined3d_device *device, UINT light_idx, BOOL *enable); HRESULT __cdecl wined3d_device_get_material(struct wined3d_device *device, WINED3DMATERIAL *material); float __cdecl wined3d_device_get_npatch_mode(struct wined3d_device *device);
1
0
0
0
Henri Verbeet : wined3d: Make the device parameter to wined3d_device_get_transform() const.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 82150458b470621bec8a52395d3bae0c4900f79b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82150458b470621bec8a52395…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 31 20:40:44 2011 +0200 wined3d: Make the device parameter to wined3d_device_get_transform() const. --- dlls/wined3d/device.c | 2 +- include/wine/wined3d.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index ba68866..ed8afc8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1899,7 +1899,7 @@ HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device, } -HRESULT CDECL wined3d_device_get_transform(struct wined3d_device *device, +HRESULT CDECL wined3d_device_get_transform(const struct wined3d_device *device, WINED3DTRANSFORMSTATETYPE state, WINED3DMATRIX *matrix) { TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index a038260..a5342bc 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2259,7 +2259,7 @@ HRESULT __cdecl wined3d_device_get_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture **texture); HRESULT __cdecl wined3d_device_get_texture_stage_state(struct wined3d_device *device, UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD *value); -HRESULT __cdecl wined3d_device_get_transform(struct wined3d_device *device, +HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device, WINED3DTRANSFORMSTATETYPE state, WINED3DMATRIX *matrix); HRESULT __cdecl wined3d_device_get_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration **declaration);
1
0
0
0
Henri Verbeet : wined3d: Merge the wined3d_surface_flip() implementations.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: 55ce85ad291decf7856875cc6eeae62458514c9d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=55ce85ad291decf7856875cc6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 31 20:40:43 2011 +0200 wined3d: Merge the wined3d_surface_flip() implementations. --- dlls/wined3d/surface.c | 57 +++++++++++++-------------------------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index cd01ae6..4d7e35e 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1057,31 +1057,6 @@ static HRESULT surface_getdc(struct wined3d_surface *surface) return hr; } -static HRESULT surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override) -{ - TRACE("surface %p, override %p.\n", surface, override); - - /* Flipping is only supported on render targets and overlays. */ - if (!(surface->resource.usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_OVERLAY))) - { - WARN("Tried to flip a non-render target, non-overlay surface.\n"); - return WINEDDERR_NOTFLIPPABLE; - } - - if (surface->resource.usage & WINED3DUSAGE_OVERLAY) - { - flip_surface(surface, override); - - /* Update the overlay if it is visible */ - if (surface->overlay_dest) - return surface->surface_ops->surface_draw_overlay(surface); - else - return WINED3D_OK; - } - - return WINED3D_OK; -} - static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) { if ((r->left && r->right) || abs(r->right - r->left) != surface->resource.width) @@ -1884,7 +1859,6 @@ static const struct wined3d_surface_ops surface_ops = surface_map, surface_unmap, surface_getdc, - surface_flip, }; /***************************************************************************** @@ -2060,13 +2034,6 @@ static HRESULT gdi_surface_getdc(struct wined3d_surface *surface) return hr; } -static HRESULT gdi_surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override) -{ - TRACE("surface %p, override %p.\n", surface, override); - - return WINED3D_OK; -} - static const struct wined3d_surface_ops gdi_surface_ops = { gdi_surface_private_setup, @@ -2077,7 +2044,6 @@ static const struct wined3d_surface_ops gdi_surface_ops = gdi_surface_map, gdi_surface_unmap, gdi_surface_getdc, - gdi_surface_flip, }; void surface_set_texture_name(struct wined3d_surface *surface, GLuint new_name, BOOL srgb) @@ -3779,10 +3745,11 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc) HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override, DWORD flags) { struct wined3d_swapchain *swapchain; - HRESULT hr; TRACE("surface %p, override %p, flags %#x.\n", surface, override, flags); + /* FIXME: This will also prevent overlay flips, since overlays aren't on + * a swapchain either. */ if (surface->container.type != WINED3D_CONTAINER_SWAPCHAIN) { ERR("Flipped surface is not on a swapchain.\n"); @@ -3790,9 +3757,23 @@ HRESULT CDECL wined3d_surface_flip(struct wined3d_surface *surface, struct wined } swapchain = surface->container.u.swapchain; - hr = surface->surface_ops->surface_flip(surface, override); - if (FAILED(hr)) - return hr; + /* Flipping is only supported on render targets and overlays. */ + if (!(surface->resource.usage & (WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_OVERLAY))) + { + WARN("Tried to flip a non-render target, non-overlay surface.\n"); + return WINEDDERR_NOTFLIPPABLE; + } + + if (surface->resource.usage & WINED3DUSAGE_OVERLAY) + { + flip_surface(surface, override); + + /* Update the overlay if it is visible */ + if (surface->overlay_dest) + return surface->surface_ops->surface_draw_overlay(surface); + else + return WINED3D_OK; + } /* Just overwrite the swapchain presentation interval. This is ok because * only ddraw apps can call Flip, and only d3d8 and d3d9 applications diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ac21a89..40e7345 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1997,7 +1997,6 @@ struct wined3d_surface_ops void (*surface_map)(struct wined3d_surface *surface, const RECT *rect, DWORD flags); void (*surface_unmap)(struct wined3d_surface *surface); HRESULT (*surface_getdc)(struct wined3d_surface *surface); - HRESULT (*surface_flip)(struct wined3d_surface *surface, struct wined3d_surface *override); }; struct wined3d_surface
1
0
0
0
Henri Verbeet : wined3d: Merge the wined3d_surface_set_mem() implementations.
by Alexandre Julliard
01 Sep '11
01 Sep '11
Module: wine Branch: master Commit: b587b85394114383b0310343821979f507236c36 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b587b85394114383b03103438…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 31 20:40:42 2011 +0200 wined3d: Merge the wined3d_surface_set_mem() implementations. --- dlls/wined3d/surface.c | 173 ++++++++++++++------------------------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 62 insertions(+), 112 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 7c31a47..cd01ae6 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1759,67 +1759,6 @@ HRESULT CDECL wined3d_surface_bltfast(struct wined3d_surface *dst_surface, DWORD return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, NULL, WINED3DTEXF_POINT); } -static HRESULT surface_set_mem(struct wined3d_surface *surface, void *mem) -{ - TRACE("surface %p, mem %p.\n", surface, mem); - - if (mem && mem != surface->resource.allocatedMemory) - { - void *release = NULL; - - /* Do I have to copy the old surface content? */ - if (surface->flags & SFLAG_DIBSECTION) - { - SelectObject(surface->hDC, surface->dib.holdbitmap); - DeleteDC(surface->hDC); - /* Release the DIB section. */ - DeleteObject(surface->dib.DIBsection); - surface->dib.bitmap_data = NULL; - surface->resource.allocatedMemory = NULL; - surface->hDC = NULL; - surface->flags &= ~SFLAG_DIBSECTION; - } - else if (!(surface->flags & SFLAG_USERPTR)) - { - release = surface->resource.heapMemory; - surface->resource.heapMemory = NULL; - } - surface->resource.allocatedMemory = mem; - surface->flags |= SFLAG_USERPTR; - - /* Now the surface memory is most up do date. Invalidate drawable and texture. */ - surface_modify_location(surface, SFLAG_INSYSMEM, TRUE); - - /* For client textures OpenGL has to be notified. */ - if (surface->flags & SFLAG_CLIENT) - surface_release_client_storage(surface); - - /* Now free the old memory if any. */ - HeapFree(GetProcessHeap(), 0, release); - } - else if (surface->flags & SFLAG_USERPTR) - { - /* HeapMemory should be NULL already. */ - if (surface->resource.heapMemory) - ERR("User pointer surface has heap memory allocated.\n"); - - if (!mem) - { - surface->resource.allocatedMemory = NULL; - surface->flags &= ~(SFLAG_USERPTR | SFLAG_INSYSMEM); - - if (surface->flags & SFLAG_CLIENT) - surface_release_client_storage(surface); - - surface_prepare_system_memory(surface); - } - - surface_modify_location(surface, SFLAG_INSYSMEM, TRUE); - } - - return WINED3D_OK; -} - /* Context activation is done by the caller. */ static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { @@ -1946,7 +1885,6 @@ static const struct wined3d_surface_ops surface_ops = surface_unmap, surface_getdc, surface_flip, - surface_set_mem, }; /***************************************************************************** @@ -2129,53 +2067,6 @@ static HRESULT gdi_surface_flip(struct wined3d_surface *surface, struct wined3d_ return WINED3D_OK; } -static HRESULT gdi_surface_set_mem(struct wined3d_surface *surface, void *mem) -{ - TRACE("surface %p, mem %p.\n", surface, mem); - - /* Render targets depend on their hdc, and we can't create an hdc on a user pointer. */ - if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET) - { - ERR("Not supported on render targets.\n"); - return WINED3DERR_INVALIDCALL; - } - - if (mem && mem != surface->resource.allocatedMemory) - { - void *release = NULL; - - /* Do I have to copy the old surface content? */ - if (surface->flags & SFLAG_DIBSECTION) - { - SelectObject(surface->hDC, surface->dib.holdbitmap); - DeleteDC(surface->hDC); - /* Release the DIB section. */ - DeleteObject(surface->dib.DIBsection); - surface->dib.bitmap_data = NULL; - surface->resource.allocatedMemory = NULL; - surface->hDC = NULL; - surface->flags &= ~SFLAG_DIBSECTION; - } - else if (!(surface->flags & SFLAG_USERPTR)) - { - release = surface->resource.allocatedMemory; - } - surface->resource.allocatedMemory = mem; - surface->flags |= SFLAG_USERPTR | SFLAG_INSYSMEM; - - /* Now free the old memory, if any. */ - HeapFree(GetProcessHeap(), 0, release); - } - else if (surface->flags & SFLAG_USERPTR) - { - /* Map() and GetDC() will re-create the dib section and allocated memory. */ - surface->resource.allocatedMemory = NULL; - surface->flags &= ~SFLAG_USERPTR; - } - - return WINED3D_OK; -} - static const struct wined3d_surface_ops gdi_surface_ops = { gdi_surface_private_setup, @@ -2187,7 +2078,6 @@ static const struct wined3d_surface_ops gdi_surface_ops = gdi_surface_unmap, gdi_surface_getdc, gdi_surface_flip, - gdi_surface_set_mem, }; void surface_set_texture_name(struct wined3d_surface *surface, GLuint new_name, BOOL srgb) @@ -3159,7 +3049,68 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem return WINED3DERR_INVALIDCALL; } - return surface->surface_ops->surface_set_mem(surface, mem); + /* Render targets depend on their hdc, and we can't create an hdc on a user pointer. */ + if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET) + { + ERR("Not supported on render targets.\n"); + return WINED3DERR_INVALIDCALL; + } + + if (mem && mem != surface->resource.allocatedMemory) + { + void *release = NULL; + + /* Do I have to copy the old surface content? */ + if (surface->flags & SFLAG_DIBSECTION) + { + SelectObject(surface->hDC, surface->dib.holdbitmap); + DeleteDC(surface->hDC); + /* Release the DIB section. */ + DeleteObject(surface->dib.DIBsection); + surface->dib.bitmap_data = NULL; + surface->resource.allocatedMemory = NULL; + surface->hDC = NULL; + surface->flags &= ~SFLAG_DIBSECTION; + } + else if (!(surface->flags & SFLAG_USERPTR)) + { + release = surface->resource.heapMemory; + surface->resource.heapMemory = NULL; + } + surface->resource.allocatedMemory = mem; + surface->flags |= SFLAG_USERPTR; + + /* Now the surface memory is most up do date. Invalidate drawable and texture. */ + surface_modify_location(surface, SFLAG_INSYSMEM, TRUE); + + /* For client textures OpenGL has to be notified. */ + if (surface->flags & SFLAG_CLIENT) + surface_release_client_storage(surface); + + /* Now free the old memory if any. */ + HeapFree(GetProcessHeap(), 0, release); + } + else if (surface->flags & SFLAG_USERPTR) + { + /* HeapMemory should be NULL already. */ + if (surface->resource.heapMemory) + ERR("User pointer surface has heap memory allocated.\n"); + + if (!mem) + { + surface->resource.allocatedMemory = NULL; + surface->flags &= ~(SFLAG_USERPTR | SFLAG_INSYSMEM); + + if (surface->flags & SFLAG_CLIENT) + surface_release_client_storage(surface); + + surface_prepare_system_memory(surface); + } + + surface_modify_location(surface, SFLAG_INSYSMEM, TRUE); + } + + return WINED3D_OK; } HRESULT CDECL wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a474c33..ac21a89 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1998,7 +1998,6 @@ struct wined3d_surface_ops void (*surface_unmap)(struct wined3d_surface *surface); HRESULT (*surface_getdc)(struct wined3d_surface *surface); HRESULT (*surface_flip)(struct wined3d_surface *surface, struct wined3d_surface *override); - HRESULT (*surface_set_mem)(struct wined3d_surface *surface, void *mem); }; struct wined3d_surface
1
0
0
0
← Newer
1
...
96
97
98
99
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200