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
May 2019
----- 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
1019 discussions
Start a n
N
ew thread
Alexandre Julliard : include/msvcrt: Add snprintf() compatibility macro.
by Alexandre Julliard
29 May '19
29 May '19
Module: wine Branch: master Commit: 44be6a8294ea6b0a4349cbbbd33463aa511df9f2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=44be6a8294ea6b0a4349cbbb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 29 09:10:01 2019 +0200 include/msvcrt: Add snprintf() compatibility macro. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/msvcrt/stdio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h index 6506dc7..014e68a 100644 --- a/include/msvcrt/stdio.h +++ b/include/msvcrt/stdio.h @@ -298,6 +298,7 @@ static inline int unlink(const char* path) { return _unlink(path); } #define _UNLINK_DEFINED #endif static inline int vsnprintf(char *buffer, size_t size, const char *format, __ms_va_list args) { return _vsnprintf(buffer,size,format,args); } +#define snprintf _snprintf static inline wint_t fgetwchar(void) { return _fgetwchar(); } static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
1
0
0
0
Aric Stewart : winemac.drv: Use NI_COMPOSITIONSTR/ CPS_CANCEL when composition string is empty.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 6d05fae6f7ebab83a2f1c6621d9619bbe91833fd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d05fae6f7ebab83a2f1c662…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri May 24 09:07:55 2019 -0500 winemac.drv: Use NI_COMPOSITIONSTR/CPS_CANCEL when composition string is empty. This sends the expected WM_IME_ENDCOMPOSITION message. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winemac.drv/ime.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index 1f5cb6b..a071408 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -901,6 +901,7 @@ static BOOL IME_SetCompositionString(void* hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD flags = 0; WCHAR wParam = 0; LPIMEPRIVATE myPrivate; + BOOL sendMessage = TRUE; TRACE("(%p, %d, %p, %d):\n", hIMC, dwIndex, lpComp, dwCompLen); @@ -943,28 +944,29 @@ static BOOL IME_SetCompositionString(void* hIMC, DWORD dwIndex, LPCVOID lpComp, wParam = ((const WCHAR*)lpComp)[0]; flags |= GCS_COMPCLAUSE | GCS_COMPATTR | GCS_DELTASTART; + + if (cursor_valid) + { + LPCOMPOSITIONSTRING compstr; + compstr = ImmLockIMCC(lpIMC->hCompStr); + compstr->dwCursorPos = cursor_pos; + ImmUnlockIMCC(lpIMC->hCompStr); + flags |= GCS_CURSORPOS; + } } else { - newCompStr = updateCompStr(lpIMC->hCompStr, NULL, 0, &flags); - ImmDestroyIMCC(lpIMC->hCompStr); - lpIMC->hCompStr = newCompStr; - } - - if (cursor_valid) - { - LPCOMPOSITIONSTRING compstr; - compstr = ImmLockIMCC(lpIMC->hCompStr); - compstr->dwCursorPos = cursor_pos; - ImmUnlockIMCC(lpIMC->hCompStr); - flags |= GCS_CURSORPOS; + NotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0); + sendMessage = FALSE; } } - GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, wParam, flags); - ImmUnlockIMCC(lpIMC->hPrivate); - UnlockRealIMC(hIMC); + if (sendMessage) { + GenerateIMEMessage(hIMC, WM_IME_COMPOSITION, wParam, flags); + ImmUnlockIMCC(lpIMC->hPrivate); + UnlockRealIMC(hIMC); + } return TRUE; }
1
0
0
0
Jacek Caban : mshtml: Rewrite IHTMLLocation::get_pathname on top of IUri.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: e33ce7c53854c1fe179218265642e9ede4152d39 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e33ce7c53854c1fe17921826…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 28 17:33:58 2019 +0200 mshtml: Rewrite IHTMLLocation::get_pathname on top of IUri. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=37279
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmllocation.c | 23 +++++++++++++---------- dlls/mshtml/tests/elements.js | 17 +++++++++++++++++ dlls/mshtml/tests/htmllocation.c | 3 +++ dlls/mshtml/tests/script.c | 6 ++++++ 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c index 4b8a07a..06cf7e1 100644 --- a/dlls/mshtml/htmllocation.c +++ b/dlls/mshtml/htmllocation.c @@ -459,7 +459,8 @@ static HRESULT WINAPI HTMLLocation_put_pathname(IHTMLLocation *iface, BSTR v) static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p) { HTMLLocation *This = impl_from_IHTMLLocation(iface); - URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW)}; + BSTR path; + IUri *uri; HRESULT hres; TRACE("(%p)->(%p)\n", This, p); @@ -467,19 +468,21 @@ static HRESULT WINAPI HTMLLocation_get_pathname(IHTMLLocation *iface, BSTR *p) if(!p) return E_POINTER; - url.dwUrlPathLength = 1; - url.dwExtraInfoLength = 1; - hres = get_url_components(This, &url); + if(!(uri = get_uri(This))) { + FIXME("No current URI\n"); + return E_NOTIMPL; + } + + hres = IUri_GetPath(uri, &path); if(FAILED(hres)) return hres; - if(url.dwUrlPathLength && url.lpszUrlPath[0] == '/') - *p = SysAllocStringLen(url.lpszUrlPath + 1, url.dwUrlPathLength - 1); - else - *p = SysAllocStringLen(url.lpszUrlPath, url.dwUrlPathLength); + if(hres == S_FALSE) { + SysFreeString(path); + path = NULL; + } - if(!*p) - return E_OUTOFMEMORY; + *p = path; return S_OK; } diff --git a/dlls/mshtml/tests/elements.js b/dlls/mshtml/tests/elements.js index be37d90..60e4a7e 100644 --- a/dlls/mshtml/tests/elements.js +++ b/dlls/mshtml/tests/elements.js @@ -126,6 +126,22 @@ function test_iframe() { }); } +function test_iframe_location() { + document.body.innerHTML = '<iframe src="emptyfile"></iframe>' + var iframe = document.body.firstChild; + + iframe.onload = function() { + ok(iframe.contentWindow.location.pathname === "/emptyfile", + "path = " + iframe.contentWindow.location.pathname); + iframe.onload = function () { + ok(iframe.contentWindow.location.pathname === "/empty/file", + "path = " + iframe.contentWindow.location.pathname); + next_test(); + } + iframe.src = "empty/file"; + } +} + function test_anchor() { var iframe = document.body.firstChild; var anchor = document.createElement("a"); @@ -420,6 +436,7 @@ var tests = [ test_createElementNS, test_head, test_iframe, + test_iframe_location, test_anchor, test_query_selector, test_compare_position, diff --git a/dlls/mshtml/tests/htmllocation.c b/dlls/mshtml/tests/htmllocation.c index 3d81eb6..120ab7e 100644 --- a/dlls/mshtml/tests/htmllocation.c +++ b/dlls/mshtml/tests/htmllocation.c @@ -240,6 +240,9 @@ static void test_pathname(IHTMLLocation *loc, const struct location_test *test) hres = IHTMLLocation_get_pathname(loc, &str); ok(hres == S_OK, "%s: get_pathname failed: 0x%08x\n", test->name, hres); if(hres == S_OK) + /* FIXME: We seem to be testing location in a buggy state. Path names do not + * include leading slash, while other tests confirm that it should be there */ + todo_wine_if(*test->pathname == '/') ok(str_eq_wa(str, *test->pathname == '/' ? test->pathname + 1 : test->pathname), "%s: expected retrieved pathname to be L\"%s\", was: %s\n", test->name, test->pathname, wine_dbgstr_w(str)); diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 7d6afd2..e546649 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -3087,6 +3087,8 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, HRSRC src; HRESULT hres; + static const WCHAR empty_prefixW[] = {'/','e','m','p','t','y'}; + hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bindf, &This->bind_info); ok(hres == S_OK, "GetBindInfo failed: %08x\n", hres); @@ -3121,6 +3123,10 @@ static HRESULT WINAPI ProtocolEx_StartEx(IInternetProtocolEx *iface, IUri *uri, register_stream(This, query+1); SysFreeString(query); block = TRUE; + }else if(SysStringLen(path) >= ARRAY_SIZE(empty_prefixW) && !memcmp(path, empty_prefixW, sizeof(empty_prefixW))) { + static char empty_data[] = " "; + This->data = empty_data; + This->size = strlen(This->data); }else { src = FindResourceW(NULL, *path == '/' ? path+1 : path, (const WCHAR*)RT_HTML); ok(src != NULL, "Could not find resource for path %s\n", wine_dbgstr_w(path));
1
0
0
0
Jacek Caban : mshtml/tests: Include leading path slash in location test array.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: adeb76bd15a4acdd741fc7ba66239e0ba230257b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=adeb76bd15a4acdd741fc7ba…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 28 17:33:44 2019 +0200 mshtml/tests: Include leading path slash in location test array. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/tests/htmllocation.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/tests/htmllocation.c b/dlls/mshtml/tests/htmllocation.c index 4781de9..3d81eb6 100644 --- a/dlls/mshtml/tests/htmllocation.c +++ b/dlls/mshtml/tests/htmllocation.c @@ -47,7 +47,7 @@ static const struct location_test location_tests[] = { "
www.winehq.org:80
", "
www.winehq.org
", "80", - "", + "/", "?search", "#hash" }, @@ -59,7 +59,7 @@ static const struct location_test location_tests[] = { "
www.winehq.org:80
", "
www.winehq.org
", "80", - "file", + "/file", "?search", "#hash" }, @@ -71,7 +71,7 @@ static const struct location_test location_tests[] = { "ftp.winehq.org:21", "
ftp.winehq.org
", "21", - "", + "/", NULL, NULL }, @@ -83,7 +83,7 @@ static const struct location_test location_tests[] = { "ftp.winehq.org:21", "
ftp.winehq.org
", "21", - "file", + "/file", NULL, NULL }, @@ -240,7 +240,7 @@ static void test_pathname(IHTMLLocation *loc, const struct location_test *test) hres = IHTMLLocation_get_pathname(loc, &str); ok(hres == S_OK, "%s: get_pathname failed: 0x%08x\n", test->name, hres); if(hres == S_OK) - ok(str_eq_wa(str, test->pathname), + ok(str_eq_wa(str, *test->pathname == '/' ? test->pathname + 1 : test->pathname), "%s: expected retrieved pathname to be L\"%s\", was: %s\n", test->name, test->pathname, wine_dbgstr_w(str)); SysFreeString(str);
1
0
0
0
Jacek Caban : mshtml/tests: Fix tests on some recent IE versions.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 6941232d8be5b0f6e46f4a01b70ff60db9895773 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6941232d8be5b0f6e46f4a01…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 28 17:33:35 2019 +0200 mshtml/tests: Fix tests on some recent IE versions. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/tests/script.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index c0ddc81..7d6afd2 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -135,6 +135,7 @@ DEFINE_EXPECT(QS_VariantConversion); DEFINE_EXPECT(QS_IActiveScriptSite); DEFINE_EXPECT(QS_GetCaller); DEFINE_EXPECT(ChangeType); +DEFINE_EXPECT(GetTypeInfo); #define TESTSCRIPT_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80746}" #define TESTACTIVEX_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80646}" @@ -399,7 +400,7 @@ static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pcti static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { - ok(0, "unexpected call\n"); + CHECK_EXPECT2(GetTypeInfo); return E_NOTIMPL; } @@ -3453,9 +3454,12 @@ static void run_js_tests(void) { run_js_script("jstest.html"); run_js_script("exectest.html"); - run_js_script("vbtest.html"); run_js_script("events.html"); + SET_EXPECT(GetTypeInfo); + run_js_script("vbtest.html"); + CLEAR_CALLED(GetTypeInfo); + if(!is_ie9plus) { win_skip("Skipping some script tests on IE older than 9.\n"); return;
1
0
0
0
Andrey Gusev : ext-ms-win-ntuser-windowclass-l1-1-0: Update spec file.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 82a0181a59a97bb8f8de7c0d6023607c0100c314 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82a0181a59a97bb8f8de7c0d…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Tue May 28 18:22:22 2019 +0300 ext-ms-win-ntuser-windowclass-l1-1-0: Update spec file. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47280
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- .../ext-ms-win-ntuser-windowclass-l1-1-0.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ext-ms-win-ntuser-windowclass-l1-1-0/ext-ms-win-ntuser-windowclass-l1-1-0.spec b/dlls/ext-ms-win-ntuser-windowclass-l1-1-0/ext-ms-win-ntuser-windowclass-l1-1-0.spec index 8b2ab2b..ad8dafe 100644 --- a/dlls/ext-ms-win-ntuser-windowclass-l1-1-0/ext-ms-win-ntuser-windowclass-l1-1-0.spec +++ b/dlls/ext-ms-win-ntuser-windowclass-l1-1-0/ext-ms-win-ntuser-windowclass-l1-1-0.spec @@ -5,11 +5,13 @@ @ stdcall GetClassNameA(long ptr long) user32.GetClassNameA @ stdcall GetClassNameW(long ptr long) user32.GetClassNameW @ stdcall GetWindowLongA(long long) user32.GetWindowLongA +@ stdcall -arch=win64 GetWindowLongPtrW(long long) user32.GetWindowLongPtrW @ stdcall GetWindowLongW(long long) user32.GetWindowLongW @ stdcall RegisterClassA(ptr) user32.RegisterClassA @ stdcall RegisterClassExW(ptr) user32.RegisterClassExW @ stdcall RegisterClassW(ptr) user32.RegisterClassW @ stdcall SetWindowLongA(long long long) user32.SetWindowLongA +@ stdcall -arch=win64 SetWindowLongPtrW(long long long) user32.SetWindowLongPtrW @ stdcall SetWindowLongW(long long long) user32.SetWindowLongW @ stdcall UnregisterClassA(str long) user32.UnregisterClassA @ stdcall UnregisterClassW(wstr long) user32.UnregisterClassW
1
0
0
0
Nikolay Sivov : mf: Detach sink stream on sample grabber shutdown.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 5d6241fbcb470778af4b56bee12575d72f09ee04 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d6241fbcb470778af4b56be…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 28 15:08:29 2019 +0300 mf: Detach sink stream on sample grabber shutdown. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/samplegrabber.c | 65 ++++++++++++++++++++++------ dlls/mf/tests/mf.c | 112 +++++++++++++++++++++++++++--------------------- 2 files changed, 114 insertions(+), 63 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5d6241fbcb470778af4b…
1
0
0
0
Nikolay Sivov : mf: Implement presentation clock methods for sample grabber.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 2407a0f53b0e4805406fae0bd578c06fef4d9f02 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2407a0f53b0e4805406fae0b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 28 15:08:28 2019 +0300 mf: Implement presentation clock methods for sample grabber. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/samplegrabber.c | 51 +++++++++++++++++++++++++++++++++++++++++++++---- dlls/mf/tests/mf.c | 18 +++++++++++------ 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 86dcb13..755d80f 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -50,6 +50,7 @@ struct sample_grabber BOOL is_shut_down; IMFStreamSink *stream; IMFMediaEventQueue *event_queue; + IMFPresentationClock *clock; CRITICAL_SECTION cs; }; @@ -430,6 +431,8 @@ static ULONG WINAPI sample_grabber_sink_Release(IMFMediaSink *iface) IMFMediaEventQueue_Shutdown(grabber->event_queue); IMFMediaEventQueue_Release(grabber->event_queue); } + if (grabber->clock) + IMFPresentationClock_Release(grabber->clock); DeleteCriticalSection(&grabber->cs); heap_free(grabber); } @@ -539,16 +542,56 @@ static HRESULT WINAPI sample_grabber_sink_GetStreamSinkById(IMFMediaSink *iface, static HRESULT WINAPI sample_grabber_sink_SetPresentationClock(IMFMediaSink *iface, IMFPresentationClock *clock) { - FIXME("%p, %p.\n", iface, clock); + struct sample_grabber *grabber = impl_from_IMFMediaSink(iface); + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, clock); + + EnterCriticalSection(&grabber->cs); + + if (SUCCEEDED(hr = IMFSampleGrabberSinkCallback_OnSetPresentationClock(grabber->callback, clock))) + { + if (grabber->clock) + { + IMFPresentationClock_RemoveClockStateSink(grabber->clock, &grabber->IMFClockStateSink_iface); + IMFPresentationClock_Release(grabber->clock); + } + grabber->clock = clock; + if (grabber->clock) + { + IMFPresentationClock_AddRef(grabber->clock); + IMFPresentationClock_AddClockStateSink(grabber->clock, &grabber->IMFClockStateSink_iface); + } + } + + LeaveCriticalSection(&grabber->cs); + + return hr; } static HRESULT WINAPI sample_grabber_sink_GetPresentationClock(IMFMediaSink *iface, IMFPresentationClock **clock) { - FIXME("%p, %p.\n", iface, clock); + struct sample_grabber *grabber = impl_from_IMFMediaSink(iface); + HRESULT hr = S_OK; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, clock); + + if (!clock) + return E_POINTER; + + EnterCriticalSection(&grabber->cs); + + if (grabber->clock) + { + *clock = grabber->clock; + IMFPresentationClock_AddRef(*clock); + } + else + hr = MF_E_NO_CLOCK; + + LeaveCriticalSection(&grabber->cs); + + return hr; } static HRESULT WINAPI sample_grabber_sink_Shutdown(IMFMediaSink *iface) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index b381daf..2285eb8 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1605,7 +1605,7 @@ static HRESULT WINAPI grabber_callback_OnClockSetRate(IMFSampleGrabberSinkCallba static HRESULT WINAPI grabber_callback_OnSetPresentationClock(IMFSampleGrabberSinkCallback *iface, IMFPresentationClock *clock) { - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI grabber_callback_OnProcessSample(IMFSampleGrabberSinkCallback *iface, REFGUID major_type, @@ -1641,9 +1641,9 @@ static void test_sample_grabber(void) IMFMediaType *media_type, *media_type2, *media_type3; IMFMediaTypeHandler *handler, *handler2; IMFPresentationTimeSource *time_source; + IMFPresentationClock *clock, *clock2; IMFStreamSink *stream, *stream2; IMFClockStateSink *clocksink; - IMFPresentationClock *clock; IMFMediaEventGenerator *eg; IMFMediaSink *sink, *sink2; DWORD flags, count, id; @@ -1742,8 +1742,17 @@ static void test_sample_grabber(void) hr = MFCreatePresentationClock(&clock); ok(hr == S_OK, "Failed to create clock object, hr %#x.\n", hr); + hr = IMFMediaSink_GetPresentationClock(sink, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + + hr = IMFMediaSink_GetPresentationClock(sink, &clock2); + ok(hr == MF_E_NO_CLOCK, "Unexpected hr %#x.\n", hr); + + hr = IMFMediaSink_SetPresentationClock(sink, NULL); + ok(hr == S_OK, "Failed to set presentation clock, hr %#x.\n", hr); + hr = IMFMediaSink_SetPresentationClock(sink, clock); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); + ok(hr == S_OK, "Failed to set presentation clock, hr %#x.\n", hr); hr = MFCreateSystemTimeSource(&time_source); ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr); @@ -1752,9 +1761,6 @@ static void test_sample_grabber(void) ok(hr == S_OK, "Failed to set time source, hr %#x.\n", hr); IMFPresentationTimeSource_Release(time_source); - hr = IMFMediaSink_SetPresentationClock(sink, clock); - ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); - IMFPresentationClock_Release(clock); hr = IMFActivate_ShutdownObject(activate);
1
0
0
0
Jacek Caban : ntoskrnl.exe: Cancel IRPs terminated by server.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: 9157129fc86c8759e75fc6f68b49b28693c6c9ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9157129fc86c8759e75fc6f6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 28 14:10:48 2019 +0200 ntoskrnl.exe: Cancel IRPs terminated by server. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 38 +++++++++++++++++++++++++++++++++++--- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 3 --- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 04a3f31..b5d89f6 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -523,15 +523,31 @@ static void *create_file_object( HANDLE handle ) return file; } +DECLARE_CRITICAL_SECTION(irp_completion_cs); + +static void WINAPI cancel_completed_irp( DEVICE_OBJECT *device, IRP *irp ) +{ + TRACE( "(%p %p)\n", device, irp ); + + IoReleaseCancelSpinLock(irp->CancelIrql); + + irp->IoStatus.u.Status = STATUS_CANCELLED; + irp->IoStatus.Information = 0; + IoCompleteRequest(irp, IO_NO_INCREMENT); +} + /* transfer result of IRP back to wineserver */ static NTSTATUS WINAPI dispatch_irp_completion( DEVICE_OBJECT *device, IRP *irp, void *context ) { HANDLE irp_handle = context; void *out_buff = irp->UserBuffer; + NTSTATUS status; if (irp->Flags & IRP_WRITE_OPERATION) out_buff = NULL; /* do not transfer back input buffer */ + EnterCriticalSection( &irp_completion_cs ); + SERVER_START_REQ( set_irp_result ) { req->handle = wine_server_obj_handle( irp_handle ); @@ -541,16 +557,29 @@ static NTSTATUS WINAPI dispatch_irp_completion( DEVICE_OBJECT *device, IRP *irp, req->size = irp->IoStatus.Information; if (out_buff) wine_server_add_data( req, out_buff, irp->IoStatus.Information ); } - wine_server_call( req ); + status = wine_server_call( req ); } SERVER_END_REQ; + if (status == STATUS_MORE_PROCESSING_REQUIRED) + { + /* IRP is complete, but server may have already ordered cancel call. In such case, + * it will return STATUS_MORE_PROCESSING_REQUIRED, leaving the IRP alive until + * cancel frees it. */ + if (irp->Cancel) + status = STATUS_SUCCESS; + else + IoSetCancelRoutine( irp, cancel_completed_irp ); + } + if (irp->UserBuffer != irp->AssociatedIrp.SystemBuffer) { HeapFree( GetProcessHeap(), 0, irp->UserBuffer ); irp->UserBuffer = NULL; } - return STATUS_SUCCESS; + + LeaveCriticalSection( &irp_completion_cs ); + return status; } struct dispatch_context @@ -842,8 +871,11 @@ static NTSTATUS dispatch_cancel( struct dispatch_context *context ) { IRP *irp = wine_server_get_ptr( context->params.cancel.irp ); - FIXME( "%p\n", irp ); + TRACE( "%p\n", irp ); + EnterCriticalSection( &irp_completion_cs ); + IoCancelIrp( irp ); + LeaveCriticalSection( &irp_completion_cs ); return STATUS_SUCCESS; } diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index d505643..43418f3 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -234,7 +234,6 @@ static void test_overlapped(void) cancel_cnt = 0xdeadbeef; res = DeviceIoControl(file, IOCTL_WINETEST_GET_CANCEL_COUNT, NULL, 0, &cancel_cnt, sizeof(cancel_cnt), NULL, &overlapped); ok(res, "DeviceIoControl failed: %u\n", GetLastError()); - todo_wine ok(cancel_cnt == 2, "cancel_cnt = %u\n", cancel_cnt); /* test cancelling selected overlapped event */ @@ -254,7 +253,6 @@ static void test_overlapped(void) cancel_cnt = 0xdeadbeef; res = DeviceIoControl(file, IOCTL_WINETEST_GET_CANCEL_COUNT, NULL, 0, &cancel_cnt, sizeof(cancel_cnt), NULL, &overlapped); ok(res, "DeviceIoControl failed: %u\n", GetLastError()); - todo_wine ok(cancel_cnt == 1, "cancel_cnt = %u\n", cancel_cnt); pCancelIoEx(file, &overlapped2); @@ -262,7 +260,6 @@ static void test_overlapped(void) cancel_cnt = 0xdeadbeef; res = DeviceIoControl(file, IOCTL_WINETEST_GET_CANCEL_COUNT, NULL, 0, &cancel_cnt, sizeof(cancel_cnt), NULL, &overlapped); ok(res, "DeviceIoControl failed: %u\n", GetLastError()); - todo_wine ok(cancel_cnt == 2, "cancel_cnt = %u\n", cancel_cnt); }
1
0
0
0
Jacek Caban : server: Notify kernel when IRP is terminated by server.
by Alexandre Julliard
28 May '19
28 May '19
Module: wine Branch: master Commit: b724024d5a0db520f5f76a04ede604f313b4a578 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b724024d5a0db520f5f76a04…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue May 28 14:10:20 2019 +0200 server: Notify kernel when IRP is terminated by server. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 12 +++++++++- include/wine/server_protocol.h | 11 +++++++-- server/device.c | 51 ++++++++++++++++++++++++++++++++++++++++-- server/protocol.def | 9 +++++++- server/trace.c | 5 +++++ 5 files changed, 82 insertions(+), 6 deletions(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 1892809..04a3f31 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -838,6 +838,15 @@ static NTSTATUS dispatch_free( struct dispatch_context *context ) return STATUS_SUCCESS; } +static NTSTATUS dispatch_cancel( struct dispatch_context *context ) +{ + IRP *irp = wine_server_get_ptr( context->params.cancel.irp ); + + FIXME( "%p\n", irp ); + + return STATUS_SUCCESS; +} + typedef NTSTATUS (*dispatch_func)( struct dispatch_context *context ); static const dispatch_func dispatch_funcs[] = @@ -849,7 +858,8 @@ static const dispatch_func dispatch_funcs[] = dispatch_write, /* IRP_CALL_WRITE */ dispatch_flush, /* IRP_CALL_FLUSH */ dispatch_ioctl, /* IRP_CALL_IOCTL */ - dispatch_free /* IRP_CALL_FREE */ + dispatch_free, /* IRP_CALL_FREE */ + dispatch_cancel /* IRP_CALL_CANCEL */ }; /* helper function to update service status */ diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index eab5755..15ad91c 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -649,7 +649,8 @@ enum irp_type IRP_CALL_WRITE, IRP_CALL_FLUSH, IRP_CALL_IOCTL, - IRP_CALL_FREE + IRP_CALL_FREE, + IRP_CALL_CANCEL }; typedef union @@ -706,6 +707,12 @@ typedef union int __pad; client_ptr_t obj; } free; + struct + { + enum irp_type type; + int __pad; + client_ptr_t irp; + } cancel; } irp_params_t; @@ -6695,6 +6702,6 @@ union generic_reply struct resume_process_reply resume_process_reply; }; -#define SERVER_PROTOCOL_VERSION 584 +#define SERVER_PROTOCOL_VERSION 585 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/device.c b/server/device.c index 1cebc3b..ee7df5a 100644 --- a/server/device.c +++ b/server/device.c @@ -52,6 +52,7 @@ struct irp_call struct async *async; /* pending async op */ irp_params_t params; /* irp parameters */ struct iosb *iosb; /* I/O status block */ + int canceled; /* the call was canceled */ client_ptr_t user_ptr; /* client side pointer */ }; @@ -188,6 +189,7 @@ static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos ); static int device_file_flush( struct fd *fd, struct async *async ); static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); +static void device_file_reselect_async( struct fd *fd, struct async_queue *queue ); static const struct object_ops device_file_ops = { @@ -224,7 +226,7 @@ static const struct fd_ops device_file_fd_ops = no_fd_get_volume_info, /* get_volume_info */ device_file_ioctl, /* ioctl */ default_fd_queue_async, /* queue_async */ - default_fd_reselect_async /* reselect_async */ + device_file_reselect_async /* reselect_async */ }; @@ -352,6 +354,7 @@ static struct irp_call *create_irp( struct device_file *file, const irp_params_t irp->async = NULL; irp->params = *params; irp->iosb = NULL; + irp->canceled = 0; irp->user_ptr = 0; if (async) irp->iosb = async_get_iosb( async ); @@ -548,6 +551,7 @@ static int fill_irp_params( struct device_manager *manager, struct irp_call *irp { case IRP_CALL_NONE: case IRP_CALL_FREE: + case IRP_CALL_CANCEL: break; case IRP_CALL_CREATE: irp->params.create.file = alloc_handle( current->process, irp->file, @@ -653,6 +657,40 @@ static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *as return queue_irp( file, ¶ms, async ); } +static void cancel_irp_call( struct irp_call *irp ) +{ + struct irp_call *cancel_irp; + irp_params_t params; + + irp->canceled = 1; + if (!irp->user_ptr || !irp->file || !irp->file->device->manager) return; + + memset( ¶ms, 0, sizeof(params) ); + params.cancel.type = IRP_CALL_CANCEL; + params.cancel.irp = irp->user_ptr; + + if ((cancel_irp = create_irp( NULL, ¶ms, NULL ))) + { + add_irp_to_queue( irp->file->device->manager, cancel_irp, NULL ); + release_object( cancel_irp ); + } + + set_irp_result( irp, STATUS_CANCELLED, NULL, 0, 0 ); +} + +static void device_file_reselect_async( struct fd *fd, struct async_queue *queue ) +{ + struct device_file *file = get_fd_user( fd ); + struct irp_call *irp; + + LIST_FOR_EACH_ENTRY( irp, &file->requests, struct irp_call, dev_entry ) + if (irp->iosb->status != STATUS_PENDING) + { + cancel_irp_call( irp ); + return; + } +} + static struct device *create_device( struct object *root, const struct unicode_str *name, struct device_manager *manager ) { @@ -897,6 +935,10 @@ DECL_HANDLER(get_next_device_request) if (req->status) set_irp_result( irp, req->status, NULL, 0, 0 ); + if (irp->canceled) + /* if it was canceled during dispatch, we couldn't queue cancel call without client pointer, + * so we need to do it now */ + cancel_irp_call( irp ); else if (irp->async) set_async_pending( irp->async, irp->file && is_fd_overlapped( irp->file->fd ) ); @@ -947,7 +989,12 @@ DECL_HANDLER(set_irp_result) if ((irp = (struct irp_call *)get_handle_obj( current->process, req->handle, 0, &irp_call_ops ))) { - set_irp_result( irp, req->status, get_req_data(), get_req_data_size(), req->size ); + if (!irp->canceled) + set_irp_result( irp, req->status, get_req_data(), get_req_data_size(), req->size ); + else if(irp->user_ptr) /* cancel already queued */ + set_error( STATUS_MORE_PROCESSING_REQUIRED ); + else /* we may be still dispatching the IRP. don't bother queuing cancel if it's already complete */ + irp->canceled = 0; close_handle( current->process, req->handle ); /* avoid an extra round-trip for close */ release_object( irp ); } diff --git a/server/protocol.def b/server/protocol.def index 6b6e868..e450388 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -665,7 +665,8 @@ enum irp_type IRP_CALL_WRITE, IRP_CALL_FLUSH, IRP_CALL_IOCTL, - IRP_CALL_FREE + IRP_CALL_FREE, + IRP_CALL_CANCEL }; typedef union @@ -722,6 +723,12 @@ typedef union int __pad; client_ptr_t obj; /* opaque ptr for the freed object */ } free; + struct + { + enum irp_type type; /* IRP_CALL_CANCEL */ + int __pad; + client_ptr_t irp; /* opaque ptr for canceled irp */ + } cancel; } irp_params_t; /* information about a PE image mapping, roughly equivalent to SECTION_IMAGE_INFORMATION */ diff --git a/server/trace.c b/server/trace.c index 82ea93f..8d3de65 100644 --- a/server/trace.c +++ b/server/trace.c @@ -363,6 +363,11 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data ) dump_uint64( ",obj=", &data->free.obj ); fputc( '}', stderr ); break; + case IRP_CALL_CANCEL: + fprintf( stderr, "%s{CANCEL", prefix ); + dump_uint64( ",irp=", &data->cancel.irp ); + fputc( '}', stderr ); + break; } }
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
102
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
101
102
Results per page:
10
25
50
100
200