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
May 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
428 discussions
Start a n
N
ew thread
Nikolay Sivov : riched20: Implement GetName() for ITextFont.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: e6e16eb6323fe7d4c52012df74221d2fcb18ab43 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e6e16eb6323fe7d4c52012df7…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu May 21 11:25:24 2015 +0300 riched20: Implement GetName() for ITextFont. --- dlls/riched20/richole.c | 41 +++++++++++++++++-- dlls/riched20/tests/richole.c | 93 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 127 insertions(+), 7 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index c9c75b8..215d326 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -213,7 +213,8 @@ static const DWORD textfont_prop_masks[] = { typedef union { FLOAT f; - LONG l; + LONG l; + BSTR str; } textfont_prop_val; static inline BOOL is_equal_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *left, @@ -230,6 +231,8 @@ static inline BOOL is_equal_textfont_prop_value(enum textfont_prop_id propid, te case FONT_SUPERSCRIPT: case FONT_UNDERLINE: return left->l == right->l; + case FONT_NAME: + return !strcmpW(left->str, right->str); case FONT_SIZE: return left->f == right->f; default: @@ -252,6 +255,9 @@ static inline void init_textfont_prop_value(enum textfont_prop_id propid, textfo case FONT_UNDERLINE: v->l = tomUndefined; return; + case FONT_NAME: + v->str = NULL; + return; case FONT_SIZE: v->f = tomUndefined; return; @@ -291,6 +297,12 @@ static HRESULT get_textfont_prop_for_pos(const IRichEditOleImpl *reole, int pos, case FONT_LANGID: value->l = fmt.lcid; break; + case FONT_NAME: + /* this case is used exclusively by GetName() */ + value->str = SysAllocString(fmt.szFaceName); + if (!value->str) + return E_OUTOFMEMORY; + break; case FONT_SIZE: value->f = fmt.yHeight; break; @@ -1991,8 +2003,31 @@ static HRESULT WINAPI TextFont_SetLanguageID(ITextFont *iface, LONG value) static HRESULT WINAPI TextFont_GetName(ITextFont *iface, BSTR *value) { ITextFontImpl *This = impl_from_ITextFont(iface); - FIXME("(%p)->(%p): stub\n", This, value); - return E_NOTIMPL; + const IRichEditOleImpl *reole; + textfont_prop_val v; + LONG start; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, value); + + if (!value) + return E_INVALIDARG; + + *value = NULL; + + ITextRange_QueryInterface(This->range, &IID_Igetrichole, (void**)&reole); + if (!reole) + return CO_E_RELEASED; + + init_textfont_prop_value(FONT_NAME, &v); + + ITextRange_GetStart(This->range, &start); + hr = get_textfont_prop_for_pos(reole, start, FONT_NAME, &v); + if (FAILED(hr)) + return hr; + + *value = v.str; + return S_OK; } static HRESULT WINAPI TextFont_SetName(ITextFont *iface, BSTR value) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index a47d31f..042bef4 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -130,14 +130,12 @@ static void test_Interfaces(void) res = SendMessageA(w, EM_GETOLEINTERFACE, 0, (LPARAM)&reOle); ok(res, "SendMessage\n"); ok(reOle != NULL, "EM_GETOLEINTERFACE\n"); - refcount = get_refcount((IUnknown *)reOle); - ok(refcount == 2, "got wrong ref count: %d\n", refcount); + EXPECT_REF(reOle, 2); res = SendMessageA(w, EM_GETOLEINTERFACE, 0, (LPARAM)&reOle1); ok(res == 1, "SendMessage\n"); ok(reOle1 == reOle, "Should not return a new IRichEditOle interface\n"); - refcount = get_refcount((IUnknown *)reOle); - ok(refcount == 3, "got wrong ref count: %d\n", refcount); + EXPECT_REF(reOle, 3); hres = IRichEditOle_QueryInterface(reOle, &IID_ITextDocument, (void **) &txtDoc); @@ -147,12 +145,21 @@ static void test_Interfaces(void) hres = ITextDocument_GetSelection(txtDoc, NULL); ok(hres == E_INVALIDARG, "ITextDocument_GetSelection: 0x%x\n", hres); + EXPECT_REF(txtDoc, 4); + hres = ITextDocument_GetSelection(txtDoc, &txtSel); ok(hres == S_OK, "got 0x%08x\n", hres); + EXPECT_REF(txtDoc, 4); + EXPECT_REF(txtSel, 2); + hres = ITextDocument_GetSelection(txtDoc, &txtSel2); ok(hres == S_OK, "got 0x%08x\n", hres); ok(txtSel2 == txtSel, "got %p, %p\n", txtSel, txtSel2); + + EXPECT_REF(txtDoc, 4); + EXPECT_REF(txtSel, 3); + ITextSelection_Release(txtSel2); punk = NULL; @@ -1415,6 +1422,83 @@ todo_wine { release_interfaces(&hwnd, &reOle, &doc, NULL); } +static void test_ITextFont(void) +{ + static const WCHAR sysW[] = {'S','y','s','t','e','m',0}; + static const WCHAR arialW[] = {'A','r','i','a','l',0}; + static const CHAR test_text1[] = "TestSomeText"; + IRichEditOle *reOle = NULL; + ITextDocument *doc = NULL; + ITextRange *range = NULL; + ITextFont *font; + CHARFORMAT2A cf; + HRESULT hr; + HWND hwnd; + BOOL ret; + BSTR str; + + create_interfaces(&hwnd, &reOle, &doc, NULL); + SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)test_text1); + + hr = ITextDocument_Range(doc, 0, 10, &range); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextRange_GetFont(range, &font); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextFont_GetName(font, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + /* default font name */ + str = NULL; + hr = ITextFont_GetName(font, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, sysW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + /* change font name for an inner subrange */ + memset(&cf, 0, sizeof(cf)); + cf.cbSize = sizeof(cf); + cf.dwMask = CFM_FACE; + strcpy(cf.szFaceName, "Arial"); + + SendMessageA(hwnd, EM_SETSEL, 3, 4); + ret = SendMessageA(hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + ok(ret, "got %d\n", ret); + + /* still original name */ + str = NULL; + hr = ITextFont_GetName(font, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, sysW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + SendMessageA(hwnd, EM_SETSEL, 1, 2); + ret = SendMessageA(hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + ok(ret, "got %d\n", ret); + + str = NULL; + hr = ITextFont_GetName(font, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, sysW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + /* name is returned for first position within a range */ + SendMessageA(hwnd, EM_SETSEL, 0, 1); + ret = SendMessageA(hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + ok(ret, "got %d\n", ret); + + str = NULL; + hr = ITextFont_GetName(font, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, arialW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + ITextFont_Release(font); + ITextRange_Release(range); + release_interfaces(&hwnd, &reOle, &doc, NULL); +} + START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in @@ -1439,4 +1523,5 @@ START_TEST(richole) test_GetFont(); test_GetPara(); test_dispatch(); + test_ITextFont(); }
1
0
0
0
Hans Leidekker : rpcrt4: Remove a couple of unused assignments.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: 0877e4cbb232f5024936ab990c3028ced1aa51ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0877e4cbb232f5024936ab990…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu May 21 10:47:32 2015 +0200 rpcrt4: Remove a couple of unused assignments. --- dlls/rpcrt4/rpc_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index c6bd21e..8c0263b 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2972,9 +2972,9 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) httpc->async_data->completion_event = CreateEventW(NULL, FALSE, FALSE, NULL); - status = UuidCreate(&httpc->connection_uuid); - status = UuidCreate(&httpc->in_pipe_uuid); - status = UuidCreate(&httpc->out_pipe_uuid); + UuidCreate(&httpc->connection_uuid); + UuidCreate(&httpc->in_pipe_uuid); + UuidCreate(&httpc->out_pipe_uuid); status = rpcrt4_http_internet_connect(httpc); if (status != RPC_S_OK)
1
0
0
0
Hans Leidekker : rpcrt4: Initialize the association UUID in RpcAssoc_Alloc.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: ab6361fbbfd18747d89d8658a6ce05ade731453e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab6361fbbfd18747d89d8658a…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu May 21 10:47:08 2015 +0200 rpcrt4: Initialize the association UUID in RpcAssoc_Alloc. --- dlls/rpcrt4/rpc_assoc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/rpcrt4/rpc_assoc.c b/dlls/rpcrt4/rpc_assoc.c index 170ca44..339ac12 100644 --- a/dlls/rpcrt4/rpc_assoc.c +++ b/dlls/rpcrt4/rpc_assoc.c @@ -80,6 +80,7 @@ static RPC_STATUS RpcAssoc_Alloc(LPCSTR Protseq, LPCSTR NetworkAddr, assoc->Endpoint = RPCRT4_strdupA(Endpoint); assoc->NetworkOptions = NetworkOptions ? RPCRT4_strdupW(NetworkOptions) : NULL; assoc->assoc_group_id = 0; + UuidCreate(&assoc->http_uuid); list_init(&assoc->entry); *assoc_out = assoc; return RPC_S_OK;
1
0
0
0
Hans Leidekker : rpcrt4: Use InternetSetCookie to set the session cookie.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: 852721863abc4b807a443aef3993dc4bd63403d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=852721863abc4b807a443aef3…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu May 21 10:46:44 2015 +0200 rpcrt4: Use InternetSetCookie to set the session cookie. This ensures that the cookie is preserved when the server sets an additional cookie. --- dlls/rpcrt4/rpc_transport.c | 85 +++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index a6438a7..c6bd21e 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2873,30 +2873,6 @@ static RPC_STATUS authorize_request(RpcConnection_http *httpc, HINTERNET request return status; } -static RPC_STATUS insert_cookie_header(HINTERNET request, const WCHAR *value) -{ - static const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' '}; - WCHAR *header, *ptr; - int len; - RPC_STATUS status = RPC_S_SERVER_UNAVAILABLE; - - if (!value) return RPC_S_OK; - - len = strlenW(value); - if ((header = HeapAlloc(GetProcessHeap(), 0, sizeof(cookieW) + (len + 3) * sizeof(WCHAR)))) - { - memcpy(header, cookieW, sizeof(cookieW)); - ptr = header + sizeof(cookieW) / sizeof(cookieW[0]); - memcpy(ptr, value, len * sizeof(WCHAR)); - ptr[len++] = '\r'; - ptr[len++] = '\n'; - ptr[len] = 0; - if ((HttpAddRequestHeadersW(request, header, -1, HTTP_ADDREQ_FLAG_ADD_IF_NEW))) status = RPC_S_OK; - HeapFree(GetProcessHeap(), 0, header); - } - return status; -} - static BOOL has_credentials(RpcConnection_http *httpc) { RPC_HTTP_TRANSPORT_CREDENTIALS_W *creds; @@ -2922,6 +2898,51 @@ static BOOL is_secure(RpcConnection_http *httpc) (httpc->common.QOS->qos->u.HttpCredentials->Flags & RPC_C_HTTP_FLAG_USE_SSL); } +static RPC_STATUS set_auth_cookie(RpcConnection_http *httpc, const WCHAR *value) +{ + static WCHAR httpW[] = {'h','t','t','p',0}; + static WCHAR httpsW[] = {'h','t','t','p','s',0}; + URL_COMPONENTSW uc; + DWORD len; + WCHAR *url; + BOOL ret; + + if (!value) return RPC_S_OK; + + uc.dwStructSize = sizeof(uc); + uc.lpszScheme = is_secure(httpc) ? httpsW : httpW; + uc.dwSchemeLength = 0; + uc.lpszHostName = httpc->servername; + uc.dwHostNameLength = 0; + uc.nPort = 0; + uc.lpszUserName = NULL; + uc.dwUserNameLength = 0; + uc.lpszPassword = NULL; + uc.dwPasswordLength = 0; + uc.lpszUrlPath = NULL; + uc.dwUrlPathLength = 0; + uc.lpszExtraInfo = NULL; + uc.dwExtraInfoLength = 0; + + if (!InternetCreateUrlW(&uc, 0, NULL, &len) && (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) + return RPC_S_SERVER_UNAVAILABLE; + + if (!(url = HeapAlloc(GetProcessHeap(), 0, len))) return RPC_S_OUT_OF_MEMORY; + + len = len / sizeof(WCHAR) - 1; + if (!InternetCreateUrlW(&uc, 0, url, &len)) + { + HeapFree(GetProcessHeap(), 0, url); + return RPC_S_SERVER_UNAVAILABLE; + } + + ret = InternetSetCookieW(url, NULL, value); + HeapFree(GetProcessHeap(), 0, url); + if (!ret) return RPC_S_SERVER_UNAVAILABLE; + + return RPC_S_OK; +} + static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) { RpcConnection_http *httpc = (RpcConnection_http *)Connection; @@ -2975,6 +2996,12 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) if (secure) flags |= INTERNET_FLAG_SECURE; if (credentials) flags |= INTERNET_FLAG_NO_AUTH; + status = set_auth_cookie(httpc, Connection->CookieAuth); + if (status != RPC_S_OK) + { + HeapFree(GetProcessHeap(), 0, url); + return status; + } httpc->in_request = HttpOpenRequestW(httpc->session, wszVerbIn, url, NULL, NULL, wszAcceptTypes, flags, (DWORD_PTR)httpc->async_data); if (!httpc->in_request) @@ -2983,12 +3010,7 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) HeapFree(GetProcessHeap(), 0, url); return RPC_S_SERVER_UNAVAILABLE; } - status = insert_cookie_header(httpc->in_request, Connection->CookieAuth); - if (status != RPC_S_OK) - { - HeapFree(GetProcessHeap(), 0, url); - return status; - } + if (credentials) { status = authorize_request(httpc, httpc->in_request); @@ -3014,9 +3036,6 @@ static RPC_STATUS rpcrt4_ncacn_http_open(RpcConnection* Connection) ERR("HttpOpenRequestW failed with error %d\n", GetLastError()); return RPC_S_SERVER_UNAVAILABLE; } - status = insert_cookie_header(httpc->out_request, Connection->CookieAuth); - if (status != RPC_S_OK) - return status; if (credentials) {
1
0
0
0
Alexandre Julliard : ntdll: Remove the special case for the NUL device.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: ee1528040e47b39591a39ee42b2a6587a653e00c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee1528040e47b39591a39ee42…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:28:03 2015 +0900 ntdll: Remove the special case for the NUL device. --- dlls/ntdll/directory.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 1a8d9cc..8e4db83 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -2734,12 +2734,6 @@ static NTSTATUS get_dos_device( const WCHAR *name, UINT name_len, ANSI_STRING *u strcpy( dev, "lpt1" ); continue; } - if (!strcmp( dev, "nul" )) - { - strcpy( unix_name, "/dev/null" ); - dev = NULL; /* last try */ - continue; - } new_name = NULL; if (dev[1] == ':' && dev[2] == ':') /* drive device */
1
0
0
0
Alexandre Julliard : ntdll: Add support for file I/O on device files.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: 950c82094b34bec87b38e09fe4657df4eeeb0522 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=950c82094b34bec87b38e09fe…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:27:03 2015 +0900 ntdll: Add support for file I/O on device files. --- dlls/ntdll/file.c | 5 +++-- dlls/ntdll/tests/om.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 43e52c6..d081750 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -847,7 +847,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, goto done; } } - else if (type == FD_TYPE_SERIAL) + else if (type == FD_TYPE_SERIAL || type == FD_TYPE_DEVICE) { if (async_read && (!offset || offset->QuadPart < 0)) { @@ -872,6 +872,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, { case FD_TYPE_FILE: case FD_TYPE_CHAR: + case FD_TYPE_DEVICE: status = length ? STATUS_END_OF_FILE : STATUS_SUCCESS; goto done; case FD_TYPE_SERIAL: @@ -1265,7 +1266,7 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent, goto done; } } - else if (type == FD_TYPE_SERIAL) + else if (type == FD_TYPE_SERIAL || type == FD_TYPE_DEVICE) { if (async_write && (!offset || (offset->QuadPart < 0 && offset->QuadPart != FILE_WRITE_TO_END_OF_FILE))) diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index fa6f2c3..a7ac95f 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -1063,14 +1063,14 @@ static void test_null_device(void) SetLastError(0xdeadbeef); ret = WriteFile(null, buf, sizeof(buf), &num_bytes, NULL); - todo_wine ok(!ret, "WriteFile unexpectedly succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + ok(!ret, "WriteFile unexpectedly succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); SetLastError(0xdeadbeef); ret = ReadFile(null, buf, sizeof(buf), &num_bytes, NULL); ok(!ret, "ReadFile unexpectedly succeeded\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); num_bytes = 0xdeadbeef; @@ -1102,7 +1102,7 @@ static void test_null_device(void) ret = GetOverlappedResult(null, &ov, &num_bytes, TRUE); ok(!ret, "GetOverlappedResult unexpectedly succeeded\n"); } - todo_wine ok(GetLastError() == ERROR_HANDLE_EOF, + ok(GetLastError() == ERROR_HANDLE_EOF, "expected ERROR_HANDLE_EOF, got %u\n", GetLastError()); pNtClose(null);
1
0
0
0
Alexandre Julliard : kernel32: Get rid of the hardcoded NUL device in QueryDosDeviceW.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: c4fb1f617dbe15ce6fa1e5602de4ade764388b92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4fb1f617dbe15ce6fa1e5602…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:35:59 2015 +0900 kernel32: Get rid of the hardcoded NUL device in QueryDosDeviceW. --- dlls/kernel32/volume.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 0bbf621..d06dd05 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -1258,7 +1258,6 @@ BOOL WINAPI DefineDosDeviceA(DWORD flags, LPCSTR devname, LPCSTR targetpath) DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) { static const WCHAR auxW[] = {'A','U','X',0}; - static const WCHAR nulW[] = {'N','U','L',0}; static const WCHAR prnW[] = {'P','R','N',0}; static const WCHAR comW[] = {'C','O','M',0}; static const WCHAR lptW[] = {'L','P','T',0}; @@ -1376,7 +1375,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) WCHAR *p = target; int i; - if (bufsize <= (sizeof(auxW)+sizeof(nulW)+sizeof(prnW))/sizeof(WCHAR)) + if (bufsize <= (sizeof(auxW)+sizeof(prnW))/sizeof(WCHAR)) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); return 0; @@ -1386,8 +1385,6 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) memcpy( p, auxW, sizeof(auxW) ); p += sizeof(auxW) / sizeof(WCHAR); - memcpy( p, nulW, sizeof(nulW) ); - p += sizeof(nulW) / sizeof(WCHAR); memcpy( p, prnW, sizeof(prnW) ); p += sizeof(prnW) / sizeof(WCHAR);
1
0
0
0
Alexandre Julliard : kernel32: Check NT symlink first for all devices in QueryDosDeviceW.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: f32600d3c1ae47731b53b6a872c16c9d1d0a893d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f32600d3c1ae47731b53b6a87…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:35:06 2015 +0900 kernel32: Check NT symlink first for all devices in QueryDosDeviceW. --- dlls/kernel32/volume.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 38a72c5..0bbf621 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -1282,34 +1282,35 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) { WCHAR *p, name[5]; char *path, *link; + WCHAR *buffer; DWORD dosdev, ret = 0; if ((dosdev = RtlIsDosDeviceName_U( devname ))) { memcpy( name, devname + HIWORD(dosdev)/sizeof(WCHAR), LOWORD(dosdev) ); name[LOWORD(dosdev)/sizeof(WCHAR)] = 0; + devname = name; } - else - { - WCHAR *buffer; - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(dosdevW) + strlenW(devname)*sizeof(WCHAR) ))) - { - SetLastError( ERROR_OUTOFMEMORY ); - return 0; - } - memcpy( buffer, dosdevW, sizeof(dosdevW) ); - strcatW( buffer, devname ); - status = read_nt_symlink( buffer, target, bufsize ); - HeapFree( GetProcessHeap(), 0, buffer ); - if (status) - { - SetLastError( RtlNtStatusToDosError(status) ); - return 0; - } + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(dosdevW) + strlenW(devname)*sizeof(WCHAR) ))) + { + SetLastError( ERROR_OUTOFMEMORY ); + return 0; + } + memcpy( buffer, dosdevW, sizeof(dosdevW) ); + strcatW( buffer, devname ); + status = read_nt_symlink( buffer, target, bufsize ); + HeapFree( GetProcessHeap(), 0, buffer ); + if (!status) + { ret = strlenW( target ) + 1; goto done; } + if (!dosdev) /* not a special DOS device */ + { + SetLastError( RtlNtStatusToDosError(status) ); + return 0; + } /* FIXME: should read NT symlink for all devices */ @@ -1322,7 +1323,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) ret = MultiByteToWideChar( CP_UNIXCP, 0, link, -1, target, bufsize ); HeapFree( GetProcessHeap(), 0, link ); } - else if (dosdev) /* look for device defaults */ + else /* look for device defaults */ { if (!strcmpiW( name, auxW )) {
1
0
0
0
Alexandre Julliard : server: Create the null device and its symlink.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: c0ac2afb19ca6e5ad3999f47744b9210c22fa758 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0ac2afb19ca6e5ad3999f477…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:19:51 2015 +0900 server: Create the null device and its symlink. --- dlls/ntdll/tests/om.c | 20 ++++++-------------- server/device.c | 16 ++++++++++++++++ server/directory.c | 11 ++++++++++- server/file.h | 7 +++++++ server/object.h | 4 ---- 5 files changed, 39 insertions(+), 19 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c0ac2afb19ca6e5ad3999…
1
0
0
0
Alexandre Julliard : server: Allow a device file to be mapped directly to a Unix device.
by Alexandre Julliard
21 May '15
21 May '15
Module: wine Branch: master Commit: b414b93d5acc5629559f1e192de9034a833dda52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b414b93d5acc5629559f1e192…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 21 17:18:08 2015 +0900 server: Allow a device file to be mapped directly to a Unix device. --- server/device.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/server/device.c b/server/device.c index 6afa004..de11a9a 100644 --- a/server/device.c +++ b/server/device.c @@ -18,7 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" + #include <assert.h> +#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -120,6 +124,7 @@ struct device { struct object obj; /* object header */ struct device_manager *manager; /* manager for this device (or NULL if deleted) */ + char *unix_path; /* path to unix device if any */ client_ptr_t user_ptr; /* opaque ptr for client side */ struct list entry; /* entry in device manager list */ struct list files; /* list of open files */ @@ -326,6 +331,7 @@ static void device_destroy( struct object *obj ) assert( list_empty( &device->files )); + free( device->unix_path ); if (device->manager) list_remove( &device->entry ); } @@ -340,7 +346,17 @@ static struct object *device_open_file( struct object *obj, unsigned int access, file->device = (struct device *)grab_object( device ); list_init( &file->requests ); list_add_tail( &device->files, &file->entry ); - if (!(file->fd = alloc_pseudo_fd( &device_file_fd_ops, &file->obj, 0 ))) + if (device->unix_path) + { + mode_t mode = 0666; + access = file->obj.ops->map_access( &file->obj, access ); + file->fd = open_fd( NULL, device->unix_path, O_NONBLOCK | O_LARGEFILE, + &mode, access, sharing, options ); + if (file->fd) set_fd_user( file->fd, &device_file_fd_ops, &file->obj ); + } + else file->fd = alloc_pseudo_fd( &device_file_fd_ops, &file->obj, 0 ); + + if (!file->fd) { release_object( file ); file = NULL; @@ -509,6 +525,7 @@ static struct device *create_device( struct directory *root, const struct unicod if (get_error() != STATUS_OBJECT_NAME_EXISTS) { /* initialize it if it didn't already exist */ + device->unix_path = NULL; device->manager = manager; list_add_tail( &manager->devices, &device->entry ); list_init( &device->files );
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
43
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
Results per page:
10
25
50
100
200