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
October 2013
----- 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
757 discussions
Start a n
N
ew thread
Qian Hong : user32/tests: Added tests for OpenInputDesktop and SwitchDesktop.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: b0cac343631f712f337d18516fef9e631770c27b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0cac343631f712f337d18516…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Fri Oct 4 00:29:55 2013 +0800 user32/tests: Added tests for OpenInputDesktop and SwitchDesktop. --- dlls/user32/tests/winstation.c | 175 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 175 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index 248b82e..7155b33 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -475,6 +475,180 @@ static void test_getuserobjectinformation(void) ok(CloseDesktop(desk), "CloseDesktop failed\n"); } +static void test_inputdesktop(void) +{ + HDESK input_desk, old_input_desk, thread_desk, old_thread_desk, new_desk; + DWORD ret; + CHAR name[1024]; + INPUT inputs[1]; + + inputs[0].type = INPUT_KEYBOARD; + inputs[0].ki.wVk = 0; + inputs[0].ki.wScan = 0x3c0; + inputs[0].ki.dwFlags = KEYEVENTF_UNICODE; + + /* OpenInputDesktop creates new handles for each calls */ + old_input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); +todo_wine + ok(old_input_desk != NULL, "OpenInputDesktop failed!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(old_input_desk, UOI_NAME, name, 1024, NULL); +todo_wine + ok(ret, "GetUserObjectInformation failed!\n"); +todo_wine + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); +todo_wine + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); +todo_wine + ok(ret, "GetUserObjectInformation failed!\n"); +todo_wine + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + +todo_wine + ok(old_input_desk != input_desk, "returned the same handle!\n"); + ret = CloseDesktop(input_desk); +todo_wine + ok(ret, "CloseDesktop failed!\n"); + + /* by default, GetThreadDesktop is the input desktop, SendInput should success. */ + old_thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(old_thread_desk != NULL, "GetThreadDesktop faile!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(old_thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Set thread desktop to the new desktop, SendInput should failed. */ + new_desk = CreateDesktopA("new_desk", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + ok(new_desk != NULL, "CreateDesktop failed!\n"); + ret = SetThreadDesktop(new_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == new_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1 || broken(ret == 0) /* Win64 */, "unexpected return count %d\n", ret); + + /* Set thread desktop back to the old thread desktop, SendInput should success. */ + ret = SetThreadDesktop(old_thread_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == old_thread_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Set thread desktop to the input desktop, SendInput should success. */ + ret = SetThreadDesktop(old_input_desk); +todo_wine + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); +todo_wine + ok(thread_desk == old_input_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Switch input desktop to the new desktop, SendInput should failed. */ + ret = SwitchDesktop(new_desk); + ok(ret, "SwitchDesktop failed!\n"); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); +todo_wine + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + ok(input_desk != new_desk, "returned the same handle!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); +todo_wine + ok(ret, "GetUserObjectInformation failed!\n"); +todo_wine + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + ret = CloseDesktop(input_desk); +todo_wine + ok(ret, "CloseDesktop failed!\n"); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1 || broken(ret == 0) /* Win64 */, "unexpected return count %d\n", ret); + + /* Set thread desktop to the new desktop, SendInput should success. */ + ret = SetThreadDesktop(new_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == new_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Switch input desktop to the old input desktop, set thread desktop to the old + * thread desktop, clean side effects. SendInput should success. */ + ret = SwitchDesktop(old_input_desk); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); +todo_wine + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); +todo_wine + ok(input_desk != old_input_desk, "returned the same handle!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); +todo_wine + ok(ret, "GetUserObjectInformation failed!\n"); +todo_wine + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + ret = SetThreadDesktop(old_thread_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == old_thread_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* free resources */ + ret = CloseDesktop(input_desk); +todo_wine + ok(ret, "CloseDesktop failed!\n"); + ret = CloseDesktop(old_input_desk); +todo_wine + ok(ret, "CloseDesktop failed!\n"); + ret = CloseDesktop(new_desk); + ok(ret, "CloseDesktop failed!\n"); +} + START_TEST(winstation) { /* Check whether this platform supports WindowStation calls */ @@ -487,6 +661,7 @@ START_TEST(winstation) return; } + test_inputdesktop(); test_enumstations(); test_enumdesktops(); test_handles();
1
0
0
0
Dmitry Timoshkov : server: Set the unix file write mode bit also for FILE_APPEND_DATA access.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: b29fbc4f00bf4ac76e6b8579bc3e08b72a9a5490 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b29fbc4f00bf4ac76e6b8579b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Oct 2 12:19:08 2013 +0900 server: Set the unix file write mode bit also for FILE_APPEND_DATA access. --- server/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/server/file.c b/server/file.c index 2ecf97c..94d3060 100644 --- a/server/file.c +++ b/server/file.c @@ -459,7 +459,7 @@ static mode_t file_access_to_mode( unsigned int access ) access = generic_file_map_access( access ); if (access & FILE_READ_DATA) mode |= 4; - if (access & FILE_WRITE_DATA) mode |= 2; + if (access & (FILE_WRITE_DATA|FILE_APPEND_DATA)) mode |= 2; if (access & FILE_EXECUTE) mode |= 1; return mode; }
1
0
0
0
Alistair Leslie-Hughes : include: Add interfaces ICLRMetaHostPolicy, ICLRDebugging.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: fcb2c9690b6e6a235c70b3407ad9d968ef3b7e21 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fcb2c9690b6e6a235c70b3407…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Oct 2 11:57:45 2013 +1000 include: Add interfaces ICLRMetaHostPolicy, ICLRDebugging. --- include/metahost.idl | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 0 deletions(-) diff --git a/include/metahost.idl b/include/metahost.idl index 51cd784..549d664 100644 --- a/include/metahost.idl +++ b/include/metahost.idl @@ -25,6 +25,30 @@ cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#undef LoadLibrary") cpp_quote("#endif") +typedef enum +{ + METAHOST_POLICY_HIGHCOMPAT = 0, + METAHOST_POLICY_APPLY_UPGRADE_POLICY = 0x08, + METAHOST_POLICY_EMULATE_EXE_LAUNCH = 0x10, + METAHOST_POLICY_SHOW_ERROR_DIALOG = 0x20, + METAHOST_POLICY_USE_PROCESS_IMAGE_PATH = 0x40, + METAHOST_POLICY_ENSURE_SKU_SUPPORTED = 0x80 +} METAHOST_POLICY_FLAGS; + +typedef enum +{ + CLR_DEBUGGING_MANAGED_EVENT_PENDING = 1 +} CLR_DEBUGGING_PROCESS_FLAGS; + +typedef struct _CLR_DEBUGGING_VERSION +{ + WORD wStructVersion; + WORD wMajor; + WORD wMinor; + WORD wBuild; + WORD wRevision; +} CLR_DEBUGGING_VERSION; + [ object, local, @@ -128,4 +152,55 @@ interface ICLRMetaHost : IUnknown [in] INT32 iExitCode); }; +[ + object, + local, + uuid(e2190695-77b2-492e-8e14-c4b3a7fdd593) +] +interface ICLRMetaHostPolicy : IUnknown +{ + HRESULT GetRequestedRuntime([in] METAHOST_POLICY_FLAGS dwPolicyFlags, + [in] LPCWSTR pwzBinary, [in] IStream *pCfgStream, + [in, out] LPWSTR pwzVersion, [in, out] DWORD *pcchVersion, + [out] LPWSTR pwzImageVersion, [out, in] DWORD *pcchImageVersion, + [out] DWORD *pdwConfigFlags, [in] REFIID riid, [retval, out] LPVOID *ppRuntime); +} + +[ + uuid(2ebcd49a-1b47-4a61-b13a-4a03701e594b) +] +coclass CLRMetaHostPolicy +{ + [default] interface ICLRMetaHostPolicy; +} + +[ + object, + local, + uuid(3151c08d-4d09-4f9b-8838-2880bf18fe51) +] +interface ICLRDebuggingLibraryProvider : IUnknown +{ + HRESULT ProvideLibrary([in] const WCHAR *pwszFileName, + [in] DWORD dwTimestamp, [in] DWORD dwSizeOfImage, + [out] HMODULE *phModule); +} + +[ + object, + local, + uuid(d28f3c5a-9634-4206-a509-477552eefb10) +] +interface ICLRDebugging : IUnknown +{ + HRESULT OpenVirtualProcess([in] ULONG64 moduleBaseAddress, + [in] IUnknown *pDataTarget, [in] ICLRDebuggingLibraryProvider *pLibraryProvider, + [in] CLR_DEBUGGING_VERSION *pMaxDebuggerSupportedVersion, + [in] REFIID riidProcess, [out] IUnknown **ppProcess, + [out, in] CLR_DEBUGGING_VERSION *pVersion, + [out] CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags); + + HRESULT CanUnloadNow(HMODULE hModule); +} + cpp_quote("HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterface);")
1
0
0
0
Alistair Leslie-Hughes : mscoree: Implement CreateInterface.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: 7028e2bbbc9a3155b71fab47d6f3288b69bd0be3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7028e2bbbc9a3155b71fab47d…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Oct 1 10:17:50 2013 +1000 mscoree: Implement CreateInterface. --- dlls/mscoree/mscoree.spec | 1 + dlls/mscoree/mscoree_main.c | 7 +++++++ dlls/mscoree/tests/mscoree.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletions(-) diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec index ad883c6..93248e2 100644 --- a/dlls/mscoree/mscoree.spec +++ b/dlls/mscoree/mscoree.spec @@ -30,6 +30,7 @@ @ stub CorTickleSvc @ stdcall CreateConfigStream(wstr ptr) @ stdcall CreateDebuggingInterfaceFromVersion(long wstr ptr) +@ stdcall CreateInterface(ptr ptr ptr) @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c index de37706..772ba01 100644 --- a/dlls/mscoree/mscoree_main.c +++ b/dlls/mscoree/mscoree_main.c @@ -594,6 +594,13 @@ HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterfac return CLASS_E_CLASSNOTAVAILABLE; } +HRESULT WINAPI CreateInterface(REFCLSID clsid, REFIID riid, LPVOID *ppInterface) +{ + TRACE("(%s,%s,%p)\n", debugstr_guid(clsid), debugstr_guid(riid), ppInterface); + + return CLRCreateInstance(clsid, riid, ppInterface); +} + HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { mscorecf *This; diff --git a/dlls/mscoree/tests/mscoree.c b/dlls/mscoree/tests/mscoree.c index f8de6fa..41844ef 100644 --- a/dlls/mscoree/tests/mscoree.c +++ b/dlls/mscoree/tests/mscoree.c @@ -21,6 +21,7 @@ #include "corerror.h" #include "mscoree.h" +#include "metahost.h" #include "shlwapi.h" #include "wine/test.h" @@ -31,6 +32,7 @@ static HRESULT (WINAPI *pGetCORSystemDirectory)(LPWSTR, DWORD, DWORD*); static HRESULT (WINAPI *pGetRequestedRuntimeInfo)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, DWORD, LPWSTR, DWORD, DWORD*, LPWSTR, DWORD, DWORD*); static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR, LPCWSTR, LPVOID, HMODULE*); static HRESULT (WINAPI *pCreateConfigStream)(LPCWSTR, IStream**); +static HRESULT (WINAPI *pCreateInterface)(REFCLSID, REFIID, VOID**); static BOOL init_functionpointers(void) { @@ -47,8 +49,10 @@ static BOOL init_functionpointers(void) pGetRequestedRuntimeInfo = (void *)GetProcAddress(hmscoree, "GetRequestedRuntimeInfo"); pLoadLibraryShim = (void *)GetProcAddress(hmscoree, "LoadLibraryShim"); pCreateConfigStream = (void *)GetProcAddress(hmscoree, "CreateConfigStream"); + pCreateInterface = (void *)GetProcAddress(hmscoree, "CreateInterface"); - if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim) + if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim || + !pCreateInterface) { win_skip("functions not available\n"); FreeLibrary(hmscoree); @@ -386,6 +390,28 @@ static void test_createconfigstream(void) DeleteFileW(file); } +void test_createinstance(void) +{ + HRESULT hr; + ICLRMetaHost *host; + + if(!pCreateInterface) + { + win_skip("Function CreateInterface not found.\n"); + return; + } + + hr = pCreateInterface(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (void**)&host); + if(SUCCEEDED(hr)) + { + ICLRMetaHost_Release(host); + } + else + { + win_skip(".NET 4 not installed.\n"); + } +} + START_TEST(mscoree) { if (!init_functionpointers()) @@ -394,6 +420,7 @@ START_TEST(mscoree) test_versioninfo(); test_loadlibraryshim(); test_createconfigstream(); + test_createinstance(); FreeLibrary(hmscoree); }
1
0
0
0
Akihiro Sagawa : gdi32: Don' t modify output glyph metrics unless the function succeeds.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: 88acc9c899f20c3ba92353b7933f0a9f64bed3b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=88acc9c899f20c3ba92353b79…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Fri Oct 4 00:56:17 2013 +0900 gdi32: Don't modify output glyph metrics unless the function succeeds. --- dlls/gdi32/freetype.c | 53 ++++++++++++++++++++++++---------------------- dlls/gdi32/tests/font.c | 5 ++++ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index ca9e18f..ab7b99f 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6184,6 +6184,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, const MAT2* lpmat) { static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)}; + GLYPHMETRICS gm; FT_Face ft_face = incoming_font->ft_face; GdiFont *font = incoming_font; FT_Glyph_Metrics metrics; @@ -6419,8 +6420,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, top = (metrics.horiBearingY + 63) & -64; bottom = (metrics.horiBearingY - metrics.height) & -64; - lpgm->gmCellIncX = adv; - lpgm->gmCellIncY = 0; + gm.gmCellIncX = adv; + gm.gmCellIncY = 0; origin_x = left; origin_y = top; } else { @@ -6492,14 +6493,14 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, vec.x = metrics.horiAdvance; vec.y = 0; pFT_Vector_Transform(&vec, &transMat); - lpgm->gmCellIncY = -((vec.y+63) >> 6); + gm.gmCellIncY = -((vec.y+63) >> 6); if (!avgAdvance || vec.y) - lpgm->gmCellIncX = (vec.x+63) >> 6; + gm.gmCellIncX = (vec.x+63) >> 6; else { vec.x = incoming_font->ntmAvgWidth; vec.y = 0; pFT_Vector_Transform(&vec, &transMat); - lpgm->gmCellIncX = pFT_MulFix(vec.x, em_scale) * 2; + gm.gmCellIncX = pFT_MulFix(vec.x, em_scale) * 2; } if (vertical_metrics) @@ -6520,28 +6521,29 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, width = (right - left) >> 6; height = (top - bottom) >> 6; - lpgm->gmBlackBoxX = width ? width : 1; - lpgm->gmBlackBoxY = height ? height : 1; - lpgm->gmptGlyphOrigin.x = origin_x >> 6; - lpgm->gmptGlyphOrigin.y = origin_y >> 6; + gm.gmBlackBoxX = width ? width : 1; + gm.gmBlackBoxY = height ? height : 1; + gm.gmptGlyphOrigin.x = origin_x >> 6; + gm.gmptGlyphOrigin.y = origin_y >> 6; abc->abcA = left >> 6; - abc->abcB = lpgm->gmBlackBoxX; + abc->abcB = gm.gmBlackBoxX; abc->abcC = adv - abc->abcA - abc->abcB; - TRACE("%u,%u,%s,%d,%d\n", lpgm->gmBlackBoxX, lpgm->gmBlackBoxY, - wine_dbgstr_point(&lpgm->gmptGlyphOrigin), - lpgm->gmCellIncX, lpgm->gmCellIncY); + TRACE("%u,%u,%s,%d,%d\n", gm.gmBlackBoxX, gm.gmBlackBoxY, + wine_dbgstr_point(&gm.gmptGlyphOrigin), + gm.gmCellIncX, gm.gmCellIncY); if ((format == GGO_METRICS || format == GGO_BITMAP || format == WINE_GGO_GRAY16_BITMAP) && is_identity_MAT2(lpmat)) /* don't cache custom transforms */ { - FONT_GM(font,original_index)->gm = *lpgm; + FONT_GM(font,original_index)->gm = gm; FONT_GM(font,original_index)->abc = *abc; FONT_GM(font,original_index)->init = TRUE; } if(format == GGO_METRICS) { + *lpgm = gm; return 1; /* FIXME */ } @@ -6626,7 +6628,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, src += ft_face->glyph->bitmap.pitch; dst += pitch; } - return needed; + break; } case ft_glyph_format_outline: { @@ -6654,7 +6656,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, start += pitch; } } - return needed; + break; } default: @@ -6717,7 +6719,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if (!width || !height) { - if (!buf || !buflen) return 0; + if (!buf || !buflen) break; return GDI_ERROR; } @@ -6725,18 +6727,18 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, { if ( render_mode == FT_RENDER_MODE_LCD) { - lpgm->gmBlackBoxX += 2; - lpgm->gmptGlyphOrigin.x -= 1; + gm.gmBlackBoxX += 2; + gm.gmptGlyphOrigin.x -= 1; } else { - lpgm->gmBlackBoxY += 2; - lpgm->gmptGlyphOrigin.y += 1; + gm.gmBlackBoxY += 2; + gm.gmptGlyphOrigin.y += 1; } } - width = lpgm->gmBlackBoxX; - height = lpgm->gmBlackBoxY; + width = gm.gmBlackBoxX; + height = gm.gmBlackBoxY; pitch = width * 4; needed = pitch * height; @@ -6771,7 +6773,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, vmul = 3; } - x_shift = ft_face->glyph->bitmap_left - lpgm->gmptGlyphOrigin.x; + x_shift = ft_face->glyph->bitmap_left - gm.gmptGlyphOrigin.x; if ( x_shift < 0 ) { src += hmul * -x_shift; @@ -6783,7 +6785,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, width -= x_shift; } - y_shift = lpgm->gmptGlyphOrigin.y - ft_face->glyph->bitmap_top; + y_shift = gm.gmptGlyphOrigin.y - ft_face->glyph->bitmap_top; if ( y_shift < 0 ) { src += src_pitch * vmul * -y_shift; @@ -7025,6 +7027,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, FIXME("Unsupported format %d\n", format); return GDI_ERROR; } + *lpgm = gm; return needed; } diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 031b86a..2343db6 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -4172,7 +4172,12 @@ static void test_GetGlyphOutline(void) ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY); } else + { ok(ret == GDI_ERROR, "%2d:GetGlyphOutlineW should return GDI_ERROR, got %d\n", fmt[i], ret); + memset(&gm2, 0xab, sizeof(gm2)); + ok(memcmp(&gm, &gm2, sizeof(GLYPHMETRICS)) == 0, + "%2d:GLYPHMETRICS shouldn't be touched on error\n", fmt[i]); + } } }
1
0
0
0
Francois Gouget : wined3d: Fix compilation on systems that don' t define INFINITY or NAN.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: b0ccc355c39bf63d9fb79cbbfbd64fb238e55fb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0ccc355c39bf63d9fb79cbbf…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Oct 3 16:03:17 2013 +0200 wined3d: Fix compilation on systems that don't define INFINITY or NAN. --- dlls/wined3d/cs.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 176f36b..e4ec0e8 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -17,6 +17,7 @@ */ #include "config.h" +#include "wine/port.h" #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d);
1
0
0
0
Henri Verbeet : d3dcompiler: Get rid of the BWRITERSHADER_PARAM_SRCMOD_TYPE typedef.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: 94dece4c0c477cd6a3a7cd92ba0fe01cd79a8ccb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94dece4c0c477cd6a3a7cd92b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Oct 3 08:54:15 2013 +0200 d3dcompiler: Get rid of the BWRITERSHADER_PARAM_SRCMOD_TYPE typedef. --- dlls/d3dcompiler_43/d3dcompiler_private.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 361845f..7900858 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -514,7 +514,8 @@ enum bwritersampler_texture_type #define BWRITERSI_TEXLD_PROJECT 1 #define BWRITERSI_TEXLD_BIAS 2 -typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { +enum bwritershader_param_srcmod_type +{ BWRITERSPSM_NONE = 0, BWRITERSPSM_NEG, BWRITERSPSM_BIAS, @@ -529,7 +530,7 @@ typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { BWRITERSPSM_ABS, BWRITERSPSM_ABSNEG, BWRITERSPSM_NOT, -} BWRITERSHADER_PARAM_SRCMOD_TYPE; +}; #define BWRITER_SM1_VS 0xfffe #define BWRITER_SM1_PS 0xffff
1
0
0
0
Henri Verbeet : d3dcompiler: Get rid of the BWRITERSAMPLER_TEXTURE_TYPE typedef.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: 540054eb3e8f9db79c7956e67c0c7dc5a3c8cacb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=540054eb3e8f9db79c7956e67…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Oct 3 08:54:14 2013 +0200 d3dcompiler: Get rid of the BWRITERSAMPLER_TEXTURE_TYPE typedef. --- dlls/d3dcompiler_43/asmshader.y | 2 +- dlls/d3dcompiler_43/d3dcompiler_private.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/d3dcompiler_43/asmshader.y b/dlls/d3dcompiler_43/asmshader.y index c0e0793..5948d57 100644 --- a/dlls/d3dcompiler_43/asmshader.y +++ b/dlls/d3dcompiler_43/asmshader.y @@ -97,7 +97,7 @@ int asmshader_lex(void); DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; } diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 0d40664..361845f 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -502,13 +502,14 @@ enum bwritershader_param_dstmod_type BWRITERSPDM_MSAMPCENTROID = 4, }; -typedef enum _BWRITERSAMPLER_TEXTURE_TYPE { +enum bwritersampler_texture_type +{ BWRITERSTT_UNKNOWN = 0, BWRITERSTT_1D = 1, BWRITERSTT_2D = 2, BWRITERSTT_CUBE = 3, BWRITERSTT_VOLUME = 4, -} BWRITERSAMPLER_TEXTURE_TYPE; +}; #define BWRITERSI_TEXLD_PROJECT 1 #define BWRITERSI_TEXLD_BIAS 2
1
0
0
0
Henri Verbeet : wined3d: Send texture binding updates through the command stream.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: 052a86301080912e79b5316d69d30f0ab508a0f4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=052a86301080912e79b5316d6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Oct 3 08:54:13 2013 +0200 wined3d: Send texture binding updates through the command stream. --- dlls/wined3d/cs.c | 78 ++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 63 +------------------------------- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 81 insertions(+), 61 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 0f060b4..176f36b 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -36,6 +36,7 @@ enum wined3d_cs_op WINED3D_CS_OP_SET_STREAM_SOURCE, WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ, WINED3D_CS_OP_SET_INDEX_BUFFER, + WINED3D_CS_OP_SET_TEXTURE, }; struct wined3d_cs_present @@ -125,6 +126,13 @@ struct wined3d_cs_set_index_buffer enum wined3d_format_id format_id; }; +struct wined3d_cs_set_texture +{ + enum wined3d_cs_op opcode; + UINT stage; + struct wined3d_texture *texture; +}; + static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_present *op = data; @@ -427,6 +435,75 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff cs->ops->submit(cs); } +static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; + const struct wined3d_cs_set_texture *op = data; + struct wined3d_texture *prev; + + prev = cs->state.textures[op->stage]; + cs->state.textures[op->stage] = op->texture; + + if (op->texture) + { + if (InterlockedIncrement(&op->texture->resource.bind_count) == 1) + op->texture->sampler = op->stage; + + if (!prev || op->texture->target != prev->target) + device_invalidate_state(cs->device, STATE_PIXELSHADER); + + if (!prev && op->stage < d3d_info->limits.ffp_blend_stages) + { + /* The source arguments for color and alpha ops have different + * meanings when a NULL texture is bound, so the COLOR_OP and + * ALPHA_OP have to be dirtified. */ + device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, WINED3D_TSS_COLOR_OP)); + device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, WINED3D_TSS_ALPHA_OP)); + } + } + + if (prev) + { + if (InterlockedDecrement(&prev->resource.bind_count) && prev->sampler == op->stage) + { + unsigned int i; + + /* Search for other stages the texture is bound to. Shouldn't + * happen if applications bind textures to a single stage only. */ + TRACE("Searching for other stages the texture is bound to.\n"); + for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) + { + if (cs->state.textures[i] == prev) + { + TRACE("Texture is also bound to stage %u.\n", i); + prev->sampler = i; + break; + } + } + } + + if (!op->texture && op->stage < d3d_info->limits.ffp_blend_stages) + { + device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, WINED3D_TSS_COLOR_OP)); + device_invalidate_state(cs->device, STATE_TEXTURESTAGE(op->stage, WINED3D_TSS_ALPHA_OP)); + } + } + + device_invalidate_state(cs->device, STATE_SAMPLER(op->stage)); +} + +void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) +{ + struct wined3d_cs_set_texture *op; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_TEXTURE; + op->stage = stage; + op->texture = texture; + + cs->ops->submit(cs); +} + static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, @@ -440,6 +517,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_STREAM_SOURCE */ wined3d_cs_exec_set_stream_source, /* WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ */ wined3d_cs_exec_set_stream_source_freq, /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, + /* WINED3D_CS_OP_SET_TEXTURE */ wined3d_cs_exec_set_texture, }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index acca498..0c2f3e8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3164,7 +3164,6 @@ DWORD CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device * HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture) { - const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; struct wined3d_texture *prev; TRACE("device %p, stage %u, texture %p.\n", device, stage, texture); @@ -3200,70 +3199,12 @@ HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device, TRACE("Setting new texture to %p.\n", texture); device->update_state->textures[stage] = texture; - if (device->recording) - { - TRACE("Recording... not performing anything\n"); - - if (texture) wined3d_texture_incref(texture); - if (prev) wined3d_texture_decref(prev); - - return WINED3D_OK; - } - if (texture) - { - LONG bind_count = InterlockedIncrement(&texture->resource.bind_count); - wined3d_texture_incref(texture); - - if (!prev || texture->target != prev->target) - device_invalidate_state(device, STATE_PIXELSHADER); - - if (!prev && stage < d3d_info->limits.ffp_blend_stages) - { - /* The source arguments for color and alpha ops have different - * meanings when a NULL texture is bound, so the COLOR_OP and - * ALPHA_OP have to be dirtified. */ - device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP)); - device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP)); - } - - if (bind_count == 1) - texture->sampler = stage; - } - + if (!device->recording) + wined3d_cs_emit_set_texture(device->cs, stage, texture); if (prev) - { - LONG bind_count = InterlockedDecrement(&prev->resource.bind_count); - - if (!texture && stage < d3d_info->limits.ffp_blend_stages) - { - device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_COLOR_OP)); - device_invalidate_state(device, STATE_TEXTURESTAGE(stage, WINED3D_TSS_ALPHA_OP)); - } - - if (bind_count && prev->sampler == stage) - { - unsigned int i; - - /* Search for other stages the texture is bound to. Shouldn't - * happen if applications bind textures to a single stage only. */ - TRACE("Searching for other stages the texture is bound to.\n"); - for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) - { - if (device->update_state->textures[i] == prev) - { - TRACE("Texture is also bound to stage %u.\n", i); - prev->sampler = i; - break; - } - } - } - wined3d_texture_decref(prev); - } - - device_invalidate_state(device, STATE_SAMPLER(stage)); return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 45ead88..6cde5b0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2496,6 +2496,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) DECLSPEC_HIDDEN; +void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
1
0
0
0
Henri Verbeet : wined3d: Send index buffer binding updates through the command stream.
by Alexandre Julliard
03 Oct '13
03 Oct '13
Module: wine Branch: master Commit: d61b14371a4d65da9106b199031d4330b546d792 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d61b14371a4d65da9106b1990…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Oct 3 08:54:12 2013 +0200 wined3d: Send index buffer binding updates through the command stream. --- dlls/wined3d/cs.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 32 ++++++++++---------------------- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 51 insertions(+), 22 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 5add94d..0f060b4 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -35,6 +35,7 @@ enum wined3d_cs_op WINED3D_CS_OP_SET_VERTEX_DECLARATION, WINED3D_CS_OP_SET_STREAM_SOURCE, WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ, + WINED3D_CS_OP_SET_INDEX_BUFFER, }; struct wined3d_cs_present @@ -117,6 +118,13 @@ struct wined3d_cs_set_stream_source_freq UINT flags; }; +struct wined3d_cs_set_index_buffer +{ + enum wined3d_cs_op opcode; + struct wined3d_buffer *buffer; + enum wined3d_format_id format_id; +}; + static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_present *op = data; @@ -389,6 +397,36 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i cs->ops->submit(cs); } +static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_set_index_buffer *op = data; + struct wined3d_buffer *prev; + + prev = cs->state.index_buffer; + cs->state.index_buffer = op->buffer; + cs->state.index_format = op->format_id; + + if (op->buffer) + InterlockedIncrement(&op->buffer->resource.bind_count); + if (prev) + InterlockedDecrement(&prev->resource.bind_count); + + device_invalidate_state(cs->device, STATE_INDEXBUFFER); +} + +void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, + enum wined3d_format_id format_id) +{ + struct wined3d_cs_set_index_buffer *op; + + op = cs->ops->require_space(cs, sizeof(*op)); + op->opcode = WINED3D_CS_OP_SET_INDEX_BUFFER; + op->buffer = buffer; + op->format_id = format_id; + + cs->ops->submit(cs); +} + static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, @@ -401,6 +439,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_VERTEX_DECLARATION */ wined3d_cs_exec_set_vertex_declaration, /* WINED3D_CS_OP_SET_STREAM_SOURCE */ wined3d_cs_exec_set_stream_source, /* WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ */ wined3d_cs_exec_set_stream_source_freq, + /* WINED3D_CS_OP_SET_INDEX_BUFFER */ wined3d_cs_exec_set_index_buffer, }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 603e5f5..acca498 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1828,42 +1828,30 @@ void CDECL wined3d_device_get_material(const struct wined3d_device *device, stru void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, struct wined3d_buffer *buffer, enum wined3d_format_id format_id) { + enum wined3d_format_id prev_format; struct wined3d_buffer *prev_buffer; TRACE("device %p, buffer %p, format %s.\n", device, buffer, debug_d3dformat(format_id)); prev_buffer = device->update_state->index_buffer; + prev_format = device->update_state->index_format; device->update_state->index_buffer = buffer; device->update_state->index_format = format_id; - /* Handle recording of state blocks. */ if (device->recording) - { - TRACE("Recording... not performing anything.\n"); device->recording->changed.indices = TRUE; - if (buffer) - wined3d_buffer_incref(buffer); - if (prev_buffer) - wined3d_buffer_decref(prev_buffer); + + if (prev_buffer == buffer && prev_format == format_id) return; - } - if (prev_buffer != buffer) - { - device_invalidate_state(device, STATE_INDEXBUFFER); - if (buffer) - { - InterlockedIncrement(&buffer->resource.bind_count); - wined3d_buffer_incref(buffer); - } - if (prev_buffer) - { - InterlockedDecrement(&prev_buffer->resource.bind_count); - wined3d_buffer_decref(prev_buffer); - } - } + if (buffer) + wined3d_buffer_incref(buffer); + if (!device->recording) + wined3d_cs_emit_set_index_buffer(device->cs, buffer, format_id); + if (prev_buffer) + wined3d_buffer_decref(prev_buffer); } struct wined3d_buffer * CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c7b014e..45ead88 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2487,6 +2487,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_depth_stencil(struct wined3d_cs *cs, struct wined3d_surface *depth_stencil) DECLSPEC_HIDDEN; +void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, + enum wined3d_format_id format_id) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_target(struct wined3d_cs *cs, UINT render_target_idx, struct wined3d_surface *render_target) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
76
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
Results per page:
10
25
50
100
200