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
March 2015
----- 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
775 discussions
Start a n
N
ew thread
Vincent Povirk : ole32: Don' t use real synchronous locks for storage synchronization.
by Alexandre Julliard
11 Mar '15
11 Mar '15
Module: wine Branch: master Commit: c8791edbdf58adcb5b83c82f30aec89edfb32438 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8791edbdf58adcb5b83c82f3…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Mar 10 14:37:09 2015 -0500 ole32: Don't use real synchronous locks for storage synchronization. --- dlls/ole32/filelockbytes.c | 18 ------------------ dlls/ole32/storage32.c | 5 ----- dlls/ole32/storage32.h | 2 -- 3 files changed, 25 deletions(-) diff --git a/dlls/ole32/filelockbytes.c b/dlls/ole32/filelockbytes.c index 7dc4843..594da1b 100644 --- a/dlls/ole32/filelockbytes.c +++ b/dlls/ole32/filelockbytes.c @@ -346,24 +346,6 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface, return get_lock_error(); } -HRESULT FileLockBytesImpl_LockRegionSync(ILockBytes* iface, - ULARGE_INTEGER libOffset, ULARGE_INTEGER cb) -{ - FileLockBytesImpl* This = impl_from_ILockBytes(iface); - OVERLAPPED ol; - - if (iface->lpVtbl != &FileLockBytesImpl_Vtbl) - return E_NOTIMPL; - - ol.hEvent = 0; - ol.u.s.Offset = libOffset.u.LowPart; - ol.u.s.OffsetHigh = libOffset.u.HighPart; - - if (LockFileEx(This->hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, cb.u.LowPart, cb.u.HighPart, &ol)) - return S_OK; - return get_lock_error(); -} - static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 5e434e0..0a9b1ad 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -2876,11 +2876,6 @@ static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offs HRESULT hr; int delay = 0; - /* if it's a FileLockBytesImpl use LockFileEx in blocking mode */ - if (SUCCEEDED(FileLockBytesImpl_LockRegionSync(This->lockBytes, offset, cb))) - return S_OK; - - /* otherwise we have to fake it based on an async lock */ do { hr = ILockBytes_LockRegion(This->lockBytes, offset, cb, dwLockType); diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index a49add9..e03bf31 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -159,8 +159,6 @@ struct DirEntry HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN; -HRESULT FileLockBytesImpl_LockRegionSync(ILockBytes* iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb) DECLSPEC_HIDDEN; - /************************************************************************* * Ole Convert support */
1
0
0
0
Vincent Povirk : ole32: Test the entire range lock block for synchronization.
by Alexandre Julliard
11 Mar '15
11 Mar '15
Module: wine Branch: master Commit: 06b735ae769c15f85d56edd2aa79c767900730dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=06b735ae769c15f85d56edd2a…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Mar 10 14:29:17 2015 -0500 ole32: Test the entire range lock block for synchronization. --- dlls/ole32/storage32.h | 7 +++++-- dlls/ole32/tests/storage32.c | 45 +++++++++++++++++++++++--------------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 9831a27..a49add9 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -505,7 +505,10 @@ StgStreamImpl* StgStreamImpl_Construct( /* Range lock constants. * * The storage format reserves the region from 0x7fffff00-0x7fffffff for - * locking and synchronization. Unfortunately, the spec doesn't say which bytes + * locking and synchronization. Because it reserves the entire block containing + * that range, and the minimum block size is 512 bytes, 0x7ffffe00-0x7ffffeff + * also cannot be used for any other purpose. + * Unfortunately, the spec doesn't say which bytes * within that range are used, and for what. These are guesses based on testing. * In particular, ends of ranges may be wrong. @@ -524,7 +527,7 @@ StgStreamImpl* StgStreamImpl_Construct( 0xe2 through 0xff: Unknown. Causes read-only exclusive opens to fail. */ -#define RANGELOCK_UNK1_FIRST 0x7fffff00 +#define RANGELOCK_UNK1_FIRST 0x7ffffe00 #define RANGELOCK_UNK1_LAST 0x7fffff57 #define RANGELOCK_PRIORITY1_FIRST 0x7fffff58 #define RANGELOCK_PRIORITY1_LAST 0x7fffff6b diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index a373249..e83ae2a 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -3153,22 +3153,22 @@ struct lock_test BOOL todo; }; -static const int priority_locked_bytes[] = { 0x58, 0x81, 0x93, -1 }; -static const int rwex_locked_bytes[] = { 0x93, 0xa7, 0xbb, 0xcf, -1 }; -static const int rw_locked_bytes[] = { 0x93, 0xa7, -1 }; -static const int nosn_locked_bytes[] = { 0x6c, 0x93, 0xa7, 0xcf, -1 }; -static const int rwdw_locked_bytes[] = { 0x93, 0xa7, 0xcf, -1 }; -static const int wodw_locked_bytes[] = { 0xa7, 0xcf, -1 }; -static const int tr_locked_bytes[] = { 0x93, -1 }; +static const int priority_locked_bytes[] = { 0x158, 0x181, 0x193, -1 }; +static const int rwex_locked_bytes[] = { 0x193, 0x1a7, 0x1bb, 0x1cf, -1 }; +static const int rw_locked_bytes[] = { 0x193, 0x1a7, -1 }; +static const int nosn_locked_bytes[] = { 0x16c, 0x193, 0x1a7, 0x1cf, -1 }; +static const int rwdw_locked_bytes[] = { 0x193, 0x1a7, 0x1cf, -1 }; +static const int wodw_locked_bytes[] = { 0x1a7, 0x1cf, -1 }; +static const int tr_locked_bytes[] = { 0x193, -1 }; static const int no_locked_bytes[] = { -1 }; -static const int roex_locked_bytes[] = { 0x93, 0xbb, 0xcf, -1 }; - -static const int rwex_fail_ranges[] = { 0x93,0xe3, -1 }; -static const int rw_fail_ranges[] = { 0xbb,0xe3, -1 }; -static const int rwdw_fail_ranges[] = { 0xa7,0xe3, -1 }; -static const int dw_fail_ranges[] = { 0xa7,0xcf, -1 }; -static const int tr_fail_ranges[] = { 0xbb,0xcf, -1 }; -static const int pr_fail_ranges[] = { 0x80,0x81, 0xbb,0xcf, -1 }; +static const int roex_locked_bytes[] = { 0x193, 0x1bb, 0x1cf, -1 }; + +static const int rwex_fail_ranges[] = { 0x193,0x1e3, -1 }; +static const int rw_fail_ranges[] = { 0x1bb,0x1e3, -1 }; +static const int rwdw_fail_ranges[] = { 0x1a7,0x1e3, -1 }; +static const int dw_fail_ranges[] = { 0x1a7,0x1cf, -1 }; +static const int tr_fail_ranges[] = { 0x1bb,0x1cf, -1 }; +static const int pr_fail_ranges[] = { 0x180,0x181, 0x1bb,0x1cf, -1 }; static const int roex_fail_ranges[] = { 0x0,-1 }; static const struct lock_test lock_tests[] = { @@ -3313,7 +3313,7 @@ static void test_locking(void) ol.u.s.OffsetHigh = 0; ol.hEvent = NULL; - for (ol.u.s.Offset = 0x7fffff00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) + for (ol.u.s.Offset = 0x7ffffe00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) { if (LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY, 0, 1, 0, &ol)) locked = FALSE; @@ -3325,7 +3325,7 @@ static void test_locking(void) UnlockFileEx(hfile, 0, 1, 0, &ol); - if ((ol.u.s.Offset&0xff) == *next_lock) + if ((ol.u.s.Offset&0x1ff) == *next_lock) { expect_locked = TRUE; next_lock++; @@ -3362,14 +3362,17 @@ static void test_locking(void) ol.u.s.OffsetHigh = 0; ol.hEvent = NULL; - for (ol.u.s.Offset = 0x7fffff00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) + for (ol.u.s.Offset = 0x7ffffe00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) { if (ol.u.s.Offset == 0x7fffff92 || (ol.u.s.Offset == 0x7fffff80 && current->stg_mode == (STGM_TRANSACTED|STGM_READWRITE)) || (ol.u.s.Offset == 0x7fffff80 && current->stg_mode == (STGM_TRANSACTED|STGM_READ))) continue; /* This makes opens hang */ - LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ol); + if (ol.u.s.Offset < 0x7fffff00) + LockFileEx(hfile, 0, 0, 1, 0, &ol); + else + LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ol); hr = StgOpenStorage(filename, NULL, current->stg_mode, NULL, 0, &stg); ok(hr == S_OK || hr == STG_E_LOCKVIOLATION || hr == STG_E_SHAREVIOLATION, "failed with unexpected hr %x\n", hr); @@ -3379,11 +3382,11 @@ static void test_locking(void) failed = FAILED(hr); - if (!expect_failed && (ol.u.s.Offset&0xff) == next_range[0]) + if (!expect_failed && (ol.u.s.Offset&0x1ff) == next_range[0]) { expect_failed = TRUE; } - else if (expect_failed && (ol.u.s.Offset&0xff) == next_range[1]) + else if (expect_failed && (ol.u.s.Offset&0x1ff) == next_range[1]) { expect_failed = FALSE; next_range += 2;
1
0
0
0
Matteo Bruni : include: Pack structures to 4-bytes alignment on x86 in D3D headers.
by Alexandre Julliard
11 Mar '15
11 Mar '15
Module: wine Branch: master Commit: 6dfcb29664d044faa709ee7edb9a79bd0db0eff1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6dfcb29664d044faa709ee7ed…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue Mar 10 19:29:36 2015 +0100 include: Pack structures to 4-bytes alignment on x86 in D3D headers. --- include/d3d8caps.h | 8 ++++++++ include/d3d8types.h | 7 +++++++ include/d3dcaps.h | 8 +++++++- include/d3dtypes.h | 8 ++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/d3d8caps.h b/include/d3d8caps.h index 019d346..d11a46f 100644 --- a/include/d3d8caps.h +++ b/include/d3d8caps.h @@ -19,6 +19,10 @@ #ifndef __WINE_D3D8CAPS_H #define __WINE_D3D8CAPS_H +#ifdef __i386__ +#include <pshpack4.h> +#endif + /* * Definitions */ @@ -283,4 +287,8 @@ typedef struct _D3DCAPS8 { float MaxPixelShaderValue; } D3DCAPS8; +#ifdef __i386__ +#include <poppack.h> +#endif + #endif /* __WINE_D3D8CAPS_H */ diff --git a/include/d3d8types.h b/include/d3d8types.h index e848a45..0ffa2db 100644 --- a/include/d3d8types.h +++ b/include/d3d8types.h @@ -19,6 +19,9 @@ #ifndef __WINE_D3D8TYPES_H #define __WINE_D3D8TYPES_H +#ifdef __i386__ +#include <pshpack4.h> +#endif /***************************************************************************** * Direct 3D v8 #defines @@ -1210,4 +1213,8 @@ typedef struct _D3DVOLUME_DESC { UINT Depth; } D3DVOLUME_DESC; +#ifdef __i386__ +#include <poppack.h> +#endif + #endif /* __WINE_D3D8TYPES_H */ diff --git a/include/d3dcaps.h b/include/d3dcaps.h index c36577e..4fc76ba 100644 --- a/include/d3dcaps.h +++ b/include/d3dcaps.h @@ -21,6 +21,10 @@ #include <ddraw.h> +#ifdef __i386__ +#include <pshpack4.h> +#endif + typedef struct _D3DTRANSFORMCAPS { DWORD dwSize; DWORD dwCaps; @@ -428,6 +432,8 @@ typedef struct _D3DDEVINFO_TEXTURING { DWORD dwNumGetDCs; } D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING; - +#ifdef __i386__ +#include <poppack.h> +#endif #endif diff --git a/include/d3dtypes.h b/include/d3dtypes.h index 4119c0f..75aee55 100644 --- a/include/d3dtypes.h +++ b/include/d3dtypes.h @@ -29,6 +29,10 @@ #include <float.h> #include <ddraw.h> +#ifdef __i386__ +#include <pshpack4.h> +#endif + #define D3DVALP(val, prec) ((float)(val)) #define D3DVAL(val) ((float)(val)) #define D3DDivide(a, b) (float)((double) (a) / (double) (b)) @@ -1356,4 +1360,8 @@ typedef enum _D3DTEXTURETRANSFORMFLAGS { #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)) #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) +#ifdef __i386__ +#include <poppack.h> +#endif + #endif
1
0
0
0
Jacek Caban : mshtml: Allow setting event handlers to strings.
by Alexandre Julliard
11 Mar '15
11 Mar '15
Module: wine Branch: master Commit: 144056bce0f1195ab8f4bdd8b2c40bf5b39e9d50 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=144056bce0f1195ab8f4bdd8b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Mar 10 18:27:31 2015 +0100 mshtml: Allow setting event handlers to strings. --- dlls/mshtml/htmlevent.c | 62 +++++++++++++++++++++++++++++++++---------- dlls/mshtml/htmlevent.h | 8 +++--- dlls/mshtml/htmlwindow.c | 5 ++-- dlls/mshtml/tests/events.c | 2 +- dlls/mshtml/tests/events.html | 19 +++++++++++++ 5 files changed, 75 insertions(+), 21 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index e1ece61..a14ce72 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1367,23 +1367,29 @@ void detach_events(HTMLDocumentNode *doc) } -static HRESULT remove_event_handler(event_target_t **event_target, eventid_t eid) +static void remove_event_handler(DispatchEx *dispex, event_target_t **event_target, eventid_t eid) { + VARIANT *store; + HRESULT hres; + + hres = dispex_get_dprop_ref(dispex, event_info[eid].attr_name, FALSE, &store); + if(SUCCEEDED(hres)) + VariantClear(store); + if(*event_target && (*event_target)->event_table[eid] && (*event_target)->event_table[eid]->handler_prop) { IDispatch_Release((*event_target)->event_table[eid]->handler_prop); (*event_target)->event_table[eid]->handler_prop = NULL; } - - return S_OK; } -static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode *doc, +static HRESULT set_event_handler_disp(DispatchEx *dispex, event_target_t **event_target_ptr, HTMLDocumentNode *doc, eventid_t eid, IDispatch *disp) { event_target_t *event_target; + remove_event_handler(dispex, event_target_ptr, eid); if(!disp) - return remove_event_handler(event_target_ptr, eid); + return S_OK; event_target = get_event_target(event_target_ptr); if(!event_target) @@ -1392,23 +1398,44 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDoc if(!alloc_handler_vector(event_target, eid, 0)) return E_OUTOFMEMORY; - if(event_target->event_table[eid]->handler_prop) - IDispatch_Release(event_target->event_table[eid]->handler_prop); - event_target->event_table[eid]->handler_prop = disp; IDispatch_AddRef(disp); return ensure_nsevent_handler(doc, event_target, eid); } -HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) +HRESULT set_event_handler(DispatchEx *dispex, event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) { switch(V_VT(var)) { case VT_NULL: - return remove_event_handler(event_target, eid); + remove_event_handler(dispex, event_target, eid); + return S_OK; case VT_DISPATCH: - return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var)); + return set_event_handler_disp(dispex, event_target, doc, eid, V_DISPATCH(var)); + + case VT_BSTR: { + VARIANT *v; + HRESULT hres; + + /* + * Setting event handler to string is a rare case and we don't want to + * complicate nor increase memory of event_target_t for that. Instead, + * we store the value in DispatchEx, which can already handle custom + * properties. + */ + remove_event_handler(dispex, event_target, eid); + + hres = dispex_get_dprop_ref(dispex, event_info[eid].attr_name, TRUE, &v); + if(FAILED(hres)) + return hres; + + V_BSTR(v) = SysAllocString(V_BSTR(var)); + if(!V_BSTR(v)) + return E_OUTOFMEMORY; + V_VT(v) = VT_BSTR; + return S_OK; + } default: FIXME("not handler %s\n", debugstr_variant(var)); @@ -1420,8 +1447,15 @@ HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, return S_OK; } -HRESULT get_event_handler(event_target_t **event_target, eventid_t eid, VARIANT *var) +HRESULT get_event_handler(DispatchEx *dispex, event_target_t **event_target, eventid_t eid, VARIANT *var) { + VARIANT *v; + HRESULT hres; + + hres = dispex_get_dprop_ref(dispex, event_info[eid].attr_name, FALSE, &v); + if(SUCCEEDED(hres) && V_VT(v) != VT_EMPTY) + return VariantCopy(var, v); + if(*event_target && (*event_target)->event_table[eid] && (*event_target)->event_table[eid]->handler_prop) { V_VT(var) = VT_DISPATCH; V_DISPATCH(var) = (*event_target)->event_table[eid]->handler_prop; @@ -1507,7 +1541,7 @@ void bind_node_event(HTMLDocumentNode *doc, event_target_t **event_target, HTMLD return; } - set_event_handler_disp(event_target, doc, eid, disp); + set_event_handler_disp(&node->dispex, event_target, doc, eid, disp); } void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp) @@ -1547,7 +1581,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem) if(disp) { hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node); if(SUCCEEDED(hres)) { - set_event_handler_disp(get_node_event_target(node), node->doc, i, disp); + set_event_handler_disp(&node->dispex, get_node_event_target(node), node->doc, i, disp); node_release(node); } IDispatch_Release(disp); diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index e312a9c..0517834 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -54,8 +54,8 @@ eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN; void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN; void release_event_target(event_target_t*) DECLSPEC_HIDDEN; void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN; -HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; -HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; +HRESULT set_event_handler(DispatchEx*,event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; +HRESULT get_event_handler(DispatchEx*,event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN; HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN; @@ -78,12 +78,12 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node) static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) { - return set_event_handler(get_node_event_target(node), node->doc, eid, var); + return set_event_handler(&node->dispex, get_node_event_target(node), node->doc, eid, var); } static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) { - return get_event_handler(get_node_event_target(node), eid, var); + return get_event_handler(&node->dispex, get_node_event_target(node), eid, var); } static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 6f3cbd4..3a31301 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -95,7 +95,8 @@ static inline HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIAN return E_FAIL; } - return set_event_handler(&window->inner_window->doc->body_event_target, window->inner_window->doc, eid, var); + return set_event_handler(&window->inner_window->dispex, &window->inner_window->doc->body_event_target, + window->inner_window->doc, eid, var); } static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var) @@ -105,7 +106,7 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN return E_FAIL; } - return get_event_handler(&window->inner_window->doc->body_event_target, eid, var); + return get_event_handler(&window->inner_window->dispex, &window->inner_window->doc->body_event_target, eid, var); } static void detach_inner_window(HTMLInnerWindow *window) diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 8f4e15e..e3e7f72 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -1571,7 +1571,7 @@ static void test_onclick(IHTMLDocument2 *doc) V_VT(&v) = VT_BSTR; V_BSTR(&v) = a2bstr("function();"); hres = IHTMLElement_put_onclick(div, v); - todo_wine ok(hres == S_OK, "put_onclick failed: %08x\n", hres); + ok(hres == S_OK, "put_onclick failed: %08x\n", hres); if(hres == S_OK) { V_VT(&v) = VT_EMPTY; diff --git a/dlls/mshtml/tests/events.html b/dlls/mshtml/tests/events.html index ae83ebe..5a0bbfb 100644 --- a/dlls/mshtml/tests/events.html +++ b/dlls/mshtml/tests/events.html @@ -139,6 +139,24 @@ function test_insert_script() { readystatechange_log = "append"; } +var string_handler_called = false; + +function test_string_event_handler() { + var e = document.createElement("div"); + var event_str = "string_handler_called = true;"; + + document.body.appendChild(e); + e.onclick = event_str; + ok(e.onclick === event_str, "e.onclick = " + e.onclick); + e.click(); + ok(string_handler_called === false, "string handler called"); + + e.setAttribute("onclick", event_str); + ok(e.onclick === event_str, "e.onclick = " + e.onclick); + e.click(); + ok(string_handler_called === false, "string handler called"); +} + window.onload = function() { try { ok(inlscr_complete_called, "onreadystatechange not fired"); @@ -159,6 +177,7 @@ window.onload = function() { ondataavailable_test(); test_handler_this(); test_insert_script(); + test_string_event_handler(); }catch(e) { ok(false, "Got an exception: " + e.message); }
1
0
0
0
Qian Hong : ntdll: Removed incorrect stub message in NtQueryObject and NtSetInformationObject.
by Alexandre Julliard
11 Mar '15
11 Mar '15
Module: wine Branch: master Commit: c61407f6516adc1d52a2957b8b0984245ba1d85d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c61407f6516adc1d52a2957b8…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Tue Mar 10 23:21:24 2015 +0800 ntdll: Removed incorrect stub message in NtQueryObject and NtSetInformationObject. --- dlls/ntdll/om.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index 47a2614..f5f75c6 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -56,8 +56,7 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle, { NTSTATUS status; - TRACE("(%p,0x%08x,%p,0x%08x,%p): stub\n", - handle, info_class, ptr, len, used_len); + TRACE("(%p,0x%08x,%p,0x%08x,%p)\n", handle, info_class, ptr, len, used_len); if (used_len) *used_len = 0; @@ -192,8 +191,7 @@ NTSTATUS WINAPI NtSetInformationObject(IN HANDLE handle, { NTSTATUS status; - TRACE("(%p,0x%08x,%p,0x%08x): stub\n", - handle, info_class, ptr, len); + TRACE("(%p,0x%08x,%p,0x%08x)\n", handle, info_class, ptr, len); switch (info_class) {
1
0
0
0
Mark Harmstone : dsound: Implement GetObjectInPath.
by Alexandre Julliard
10 Mar '15
10 Mar '15
Module: wine Branch: master Commit: 862d7dae75d70ea23acf78c68e8129b46e200aaf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=862d7dae75d70ea23acf78c68…
Author: Mark Harmstone <hellas(a)burntcomma.com> Date: Tue Mar 3 07:47:52 2015 +0000 dsound: Implement GetObjectInPath. --- dlls/dsound/buffer.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 51796b7..92849a6 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -844,10 +844,23 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetObjectInPath(IDirectSoundBuffer8 { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); - FIXME("(%p,%s,%u,%s,%p): stub\n",This,debugstr_guid(rguidObject),dwIndex,debugstr_guid(rguidInterface),ppObject); + TRACE("(%p,%s,%u,%s,%p)\n",This,debugstr_guid(rguidObject),dwIndex,debugstr_guid(rguidInterface),ppObject); - WARN("control unavailable\n"); - return DSERR_CONTROLUNAVAIL; + if (dwIndex >= This->num_filters) + return DSERR_OBJECTNOTFOUND; + + if (!ppObject) + return E_INVALIDARG; + + if (IsEqualGUID(rguidObject, &This->filters[dwIndex].guid) || IsEqualGUID(rguidObject, &GUID_All_Objects)) { + if (SUCCEEDED(IMediaObject_QueryInterface(This->filters[dwIndex].obj, rguidInterface, ppObject))) + return DS_OK; + else + return E_NOINTERFACE; + } else { + WARN("control unavailable\n"); + return DSERR_OBJECTNOTFOUND; + } } static HRESULT WINAPI IDirectSoundBufferImpl_Initialize(IDirectSoundBuffer8 *iface,
1
0
0
0
Mark Harmstone : dsound: Implement SetFX.
by Alexandre Julliard
10 Mar '15
10 Mar '15
Module: wine Branch: master Commit: 17056b9f30b61c1b31055135aded1a4ecbea4ea0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=17056b9f30b61c1b31055135a…
Author: Mark Harmstone <hellas(a)burntcomma.com> Date: Tue Mar 3 07:47:36 2015 +0000 dsound: Implement SetFX. --- dlls/dsound/buffer.c | 133 ++++++++++++++++++++++++++++++++++++++++++- dlls/dsound/dsound_main.c | 1 + dlls/dsound/dsound_private.h | 10 ++++ 3 files changed, 141 insertions(+), 3 deletions(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index 680075e..51796b7 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -21,6 +21,8 @@ #include <stdarg.h> +#define COBJMACROS + #define NONAMELESSSTRUCT #define NONAMELESSUNION #include "windef.h" @@ -697,14 +699,129 @@ static HRESULT WINAPI IDirectSoundBufferImpl_SetFX(IDirectSoundBuffer8 *iface, D { IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer8(iface); DWORD u; + DSFilter *filters; + HRESULT hr, hr2; + DMO_MEDIA_TYPE dmt; + WAVEFORMATEX wfx; - FIXME("(%p,%u,%p,%p): stub\n",This,dwEffectsCount,pDSFXDesc,pdwResultCodes); + TRACE("(%p,%u,%p,%p)\n", This, dwEffectsCount, pDSFXDesc, pdwResultCodes); if (pdwResultCodes) for (u=0; u<dwEffectsCount; u++) pdwResultCodes[u] = DSFXR_UNKNOWN; - WARN("control unavailable\n"); - return DSERR_CONTROLUNAVAIL; + if ((dwEffectsCount > 0 && !pDSFXDesc) || + (dwEffectsCount == 0 && (pDSFXDesc || pdwResultCodes)) + ) + return E_INVALIDARG; + + if (!(This->dsbd.dwFlags & DSBCAPS_CTRLFX)) { + WARN("attempted to call SetFX on buffer without DSBCAPS_CTRLFX\n"); + return DSERR_CONTROLUNAVAIL; + } + + if (This->state != STATE_STOPPED) + return DSERR_INVALIDCALL; + + if (This->buffer->lockedbytes > 0) + return DSERR_INVALIDCALL; + + if (dwEffectsCount == 0) { + if (This->num_filters > 0) { + for (u = 0; u < This->num_filters; u++) { + IMediaObject_Release(This->filters[u].obj); + } + HeapFree(GetProcessHeap(), 0, This->filters); + + This->filters = NULL; + This->num_filters = 0; + } + + return DS_OK; + } + + filters = HeapAlloc(GetProcessHeap(), 0, dwEffectsCount * sizeof(DSFilter)); + if (!filters) { + WARN("out of memory\n"); + return DSERR_OUTOFMEMORY; + } + + hr = DS_OK; + + wfx.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + wfx.nChannels = This->pwfx->nChannels; + wfx.nSamplesPerSec = This->pwfx->nSamplesPerSec; + wfx.wBitsPerSample = sizeof(float) * 8; + wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample)/8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + wfx.cbSize = sizeof(wfx); + + dmt.majortype = KSDATAFORMAT_TYPE_AUDIO; + dmt.subtype = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + dmt.bFixedSizeSamples = TRUE; + dmt.bTemporalCompression = FALSE; + dmt.lSampleSize = sizeof(float) * This->pwfx->nChannels / 8; + dmt.formattype = FORMAT_WaveFormatEx; + dmt.pUnk = NULL; + dmt.cbFormat = sizeof(WAVEFORMATEX); + dmt.pbFormat = (BYTE*)&wfx; + + for (u = 0; u < dwEffectsCount; u++) { + hr2 = CoCreateInstance(&pDSFXDesc[u].guidDSFXClass, NULL, CLSCTX_INPROC_SERVER, &IID_IMediaObject, (LPVOID*)&filters[u].obj); + + if (SUCCEEDED(hr2)) { + hr2 = IMediaObject_SetInputType(filters[u].obj, 0, &dmt, 0); + if (FAILED(hr2)) + WARN("Could not set DMO input type\n"); + } + + if (SUCCEEDED(hr2)) { + hr2 = IMediaObject_SetOutputType(filters[u].obj, 0, &dmt, 0); + if (FAILED(hr2)) + WARN("Could not set DMO output type\n"); + } + + if (FAILED(hr2)) { + if (hr == DS_OK) + hr = hr2; + + if (pdwResultCodes) + pdwResultCodes[u] = (hr2 == REGDB_E_CLASSNOTREG) ? DSFXR_UNKNOWN : DSFXR_FAILED; + } else { + if (pdwResultCodes) + pdwResultCodes[u] = DSFXR_LOCSOFTWARE; + } + } + + if (FAILED(hr)) { + for (u = 0; u < dwEffectsCount; u++) { + if (pdwResultCodes) + pdwResultCodes[u] = (pdwResultCodes[u] != DSFXR_UNKNOWN) ? DSFXR_PRESENT : DSFXR_UNKNOWN; + + if (filters[u].obj) + IMediaObject_Release(filters[u].obj); + } + + HeapFree(GetProcessHeap(), 0, filters); + } else { + if (This->num_filters > 0) { + for (u = 0; u < This->num_filters; u++) { + IMediaObject_Release(This->filters[u].obj); + if (This->filters[u].inplace) IMediaObjectInPlace_Release(This->filters[u].inplace); + } + HeapFree(GetProcessHeap(), 0, This->filters); + } + + for (u = 0; u < dwEffectsCount; u++) { + memcpy(&filters[u].guid, &pDSFXDesc[u].guidDSFXClass, sizeof(GUID)); + if (FAILED(IMediaObject_QueryInterface(filters[u].obj, &IID_IMediaObjectInPlace, (void*)&filters[u].inplace))) + filters[u].inplace = NULL; + } + + This->filters = filters; + This->num_filters = dwEffectsCount; + } + + return hr; } static HRESULT WINAPI IDirectSoundBufferImpl_AcquireResources(IDirectSoundBuffer8 *iface, @@ -1024,6 +1141,16 @@ void secondarybuffer_destroy(IDirectSoundBufferImpl *This) HeapFree(GetProcessHeap(), 0, This->notifies); HeapFree(GetProcessHeap(), 0, This->pwfx); + + if (This->filters) { + int i; + for (i = 0; i < This->num_filters; i++) { + IMediaObject_Release(This->filters[i].obj); + if (This->filters[i].inplace) IMediaObjectInPlace_Release(This->filters[i].inplace); + } + HeapFree(GetProcessHeap(), 0, This->filters); + } + HeapFree(GetProcessHeap(), 0, This); TRACE("(%p) released\n", This); diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 0130607..d6be926 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -55,6 +55,7 @@ #include "unknwn.h" #include "oleidl.h" #include "shobjidl.h" +#include "strmif.h" #include "initguid.h" #include "ksmedia.h" diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 715c5f3..9c58679 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -26,7 +26,9 @@ #include "wingdi.h" #include "mmdeviceapi.h" #include "audioclient.h" +#include "mediaobj.h" #include "mmsystem.h" +#include "uuids.h" #include "wine/list.h" @@ -57,6 +59,12 @@ typedef struct _DSVOLUMEPAN LONG lPan; } DSVOLUMEPAN,*PDSVOLUMEPAN; +typedef struct DSFilter { + GUID guid; + IMediaObject* obj; + IMediaObjectInPlace* inplace; +} DSFilter; + /***************************************************************************** * IDirectSoundDevice implementation structure */ @@ -160,6 +168,8 @@ struct IDirectSoundBufferImpl int mix_channels; bitsgetfunc get, get_aux; bitsputfunc put, put_aux; + int num_filters; + DSFilter* filters; struct list entry; };
1
0
0
0
Mark Harmstone : dsound: Keep track of locked bytes.
by Alexandre Julliard
10 Mar '15
10 Mar '15
Module: wine Branch: master Commit: e6ae73359fbefa02cbd92f41531cdbaf6a94b121 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6ae73359fbefa02cbd92f415…
Author: Mark Harmstone <hellas(a)burntcomma.com> Date: Tue Mar 3 07:47:27 2015 +0000 dsound: Keep track of locked bytes. --- dlls/dsound/buffer.c | 17 ++++++++++++++++- dlls/dsound/dsound_private.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dlls/dsound/buffer.c b/dlls/dsound/buffer.c index b1eb9a3..680075e 100644 --- a/dlls/dsound/buffer.c +++ b/dlls/dsound/buffer.c @@ -519,16 +519,20 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Lock(IDirectSoundBuffer8 *iface, DW TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); TRACE("->%d.0\n",writebytes); + This->buffer->lockedbytes += writebytes; } else { DWORD remainder = writebytes + writecursor - This->buflen; *(LPBYTE*)lplpaudioptr1 = This->buffer->memory+writecursor; *audiobytes1 = This->buflen-writecursor; + This->buffer->lockedbytes += *audiobytes1; if (This->sec_mixpos >= writecursor && This->sec_mixpos < writecursor + writebytes && This->state == STATE_PLAYING) WARN("Overwriting mixing position, case 2\n"); if (lplpaudioptr2) *(LPBYTE*)lplpaudioptr2 = This->buffer->memory; - if (audiobytes2) + if (audiobytes2) { *audiobytes2 = writebytes-(This->buflen-writecursor); + This->buffer->lockedbytes += *audiobytes2; + } if (audiobytes2 && This->sec_mixpos < remainder && This->state == STATE_PLAYING) WARN("Overwriting mixing position, case 3\n"); TRACE("Locked %p(%i bytes) and %p(%i bytes) writecursor=%d\n", *(LPBYTE*)lplpaudioptr1, *audiobytes1, lplpaudioptr2 ? *(LPBYTE*)lplpaudioptr2 : NULL, audiobytes2 ? *audiobytes2: 0, writecursor); @@ -644,7 +648,17 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Unlock(IDirectSoundBuffer8 *iface, { if(x1 + (DWORD_PTR)p1 - (DWORD_PTR)iter->buffer->memory > iter->buflen) hres = DSERR_INVALIDPARAM; + else + iter->buffer->lockedbytes -= x1; } + + if (x2) + { + if(x2 + (DWORD_PTR)p2 - (DWORD_PTR)iter->buffer->memory > iter->buflen) + hres = DSERR_INVALIDPARAM; + else + iter->buffer->lockedbytes -= x2; + } RtlReleaseResource(&iter->lock); } RtlReleaseResource(&This->device->buffer_list_lock); @@ -927,6 +941,7 @@ HRESULT IDirectSoundBufferImpl_Create( } dsb->buffer->ref = 1; + dsb->buffer->lockedbytes = 0; list_init(&dsb->buffer->buffers); list_add_head(&dsb->buffer->buffers, &dsb->entry); FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0); diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 3de0068..715c5f3 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -107,6 +107,7 @@ struct DirectSoundDevice typedef struct BufferMemory { LONG ref; + LONG lockedbytes; LPBYTE memory; struct list buffers; } BufferMemory;
1
0
0
0
Stefan Dösinger : wined3d: Support WINED3DFMT_R5G5_SNORM_L6_UNORM with EXT_texture_snorm.
by Alexandre Julliard
10 Mar '15
10 Mar '15
Module: wine Branch: master Commit: d4db09d0e91adfdda19fa5b118e39dee2f0ab4f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d4db09d0e91adfdda19fa5b11…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sat Mar 7 10:03:39 2015 +0100 wined3d: Support WINED3DFMT_R5G5_SNORM_L6_UNORM with EXT_texture_snorm. From: Stefan Dösinger <stefandoesinger(a)gmx.at> --- dlls/wined3d/utils.c | 66 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 5cd52b3..725318f 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -322,6 +322,45 @@ static void convert_r5g5_snorm_l6_unorm(const BYTE *src, BYTE *dst, UINT src_row } } +static void convert_r5g5_snorm_l6_unorm_ext(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch, + UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth) +{ + unsigned int x, y, z; + unsigned char *texel_out, r_out, g_out, r_in, g_in, l_in; + const unsigned short *texel_in; + + for (z = 0; z < depth; z++) + { + for (y = 0; y < height; y++) + { + texel_in = (const unsigned short *)(src + z * src_slice_pitch + y * src_row_pitch); + texel_out = dst + z * dst_slice_pitch + y * dst_row_pitch; + for (x = 0; x < width; x++ ) + { + l_in = (*texel_in & 0xfc00) >> 10; + g_in = (*texel_in & 0x03e0) >> 5; + r_in = *texel_in & 0x001f; + + r_out = r_in << 3; + if (!(r_in & 0x10)) /* r > 0 */ + r_out |= r_in >> 1; + + g_out = g_in << 3; + if (!(g_in & 0x10)) /* g > 0 */ + g_out |= g_in >> 1; + + texel_out[0] = r_out; + texel_out[1] = g_out; + texel_out[2] = l_in << 1 | l_in >> 5; + texel_out[3] = 0; + + texel_out += 4; + texel_in++; + } + } + } +} + static void convert_r5g5_snorm_l6_unorm_nv(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch, UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth) { @@ -331,8 +370,12 @@ static void convert_r5g5_snorm_l6_unorm_nv(const BYTE *src, BYTE *dst, UINT src_ /* This makes the gl surface bigger(24 bit instead of 16), but it works with * fixed function and shaders without further conversion once the surface is - * loaded - */ + * loaded. + * + * The difference between this function and convert_r5g5_snorm_l6_unorm_ext + * is that convert_r5g5_snorm_l6_unorm_ext creates a 32 bit XRGB texture and + * this function creates a 24 bit DSDT_MAG texture. Trying to load a DSDT_MAG + * internal with a 32 bit DSDT_MAG_INTENSITY or DSDT_MAG_VIB format fails. */ for (z = 0; z < depth; z++) { for (y = 0; y < height; y++) @@ -1080,6 +1123,11 @@ static const struct wined3d_format_texture_info format_texture_info[] = WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_BUMPMAP, NV_TEXTURE_SHADER, convert_r5g5_snorm_l6_unorm_nv}, + {WINED3DFMT_R5G5_SNORM_L6_UNORM, GL_RGB8_SNORM, GL_RGB8_SNORM, 0, + GL_RGBA, GL_BYTE, 4, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_BUMPMAP, + EXT_TEXTURE_SNORM, convert_r5g5_snorm_l6_unorm_ext}, {WINED3DFMT_R8G8_SNORM_L8X8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING @@ -2020,25 +2068,17 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ idx = getFmtIdx(WINED3DFMT_R8G8B8A8_SNORM); gl_info->formats[idx].color_fixup = create_color_fixup_desc( 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 1, CHANNEL_SOURCE_Z, 1, CHANNEL_SOURCE_W); + idx = getFmtIdx(WINED3DFMT_R5G5_SNORM_L6_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE); } if (!gl_info->supported[NV_TEXTURE_SHADER]) { - /* If GL_NV_texture_shader is not supported, R5G5_SNORM_L6_UNORM and R8G8_SNORM_L8X8_UNORM - * are converted, incompatiby with each other. */ - idx = getFmtIdx(WINED3DFMT_R5G5_SNORM_L6_UNORM); - gl_info->formats[idx].color_fixup = create_color_fixup_desc( - 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_ONE); idx = getFmtIdx(WINED3DFMT_R8G8_SNORM_L8X8_UNORM); gl_info->formats[idx].color_fixup = create_color_fixup_desc( 1, CHANNEL_SOURCE_X, 1, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_Z, 0, CHANNEL_SOURCE_W); } - else - { - /* If GL_NV_texture_shader is supported, WINED3DFMT_L6V5U5 and WINED3DFMT_X8L8V8U8 - * are converted at surface loading time, but they do not need any modification in - * the shader, thus they are compatible with all WINED3DFMT_UNKNOWN group formats. */ - } if (gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC]) {
1
0
0
0
Gerald Pfeifer : twain_32: Avoid using an uninitialized variable in the failure path in path in a couple of cases.
by Alexandre Julliard
10 Mar '15
10 Mar '15
Module: wine Branch: master Commit: fc324d97bcc59ec7ee1ce5f73a563ba69fb436ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc324d97bcc59ec7ee1ce5f73…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Sat Feb 28 14:39:34 2015 +0100 twain_32: Avoid using an uninitialized variable in the failure path in path in a couple of cases. --- dlls/twain_32/tests/dsm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/twain_32/tests/dsm.c b/dlls/twain_32/tests/dsm.c index b8f1c9e..ab6e84f 100644 --- a/dlls/twain_32/tests/dsm.c +++ b/dlls/twain_32/tests/dsm.c @@ -71,6 +71,8 @@ static BOOL get_onevalue(TW_HANDLE hcontainer, TW_UINT32 *ret, TW_UINT16 *type) GlobalUnlock(hcontainer); return TRUE; } + else + *ret = 0; return FALSE; }
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
78
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
Results per page:
10
25
50
100
200