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 2006
----- 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
3 participants
863 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Implement IWineD3DSurface:: Flip.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: cd05f9c10c2f83c6d0be117b1827ed04be4619a9 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cd05f9c10c2f83c6d0be117…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue May 9 19:49:24 2006 +0200 wined3d: Implement IWineD3DSurface::Flip. --- dlls/wined3d/surface.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 497b22a..dbd9958 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1678,8 +1678,23 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPB } HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DSurface *override, DWORD Flags) { - FIXME("This is unimplemented for now(d3d7 merge)\n"); - return WINED3DERR_INVALIDCALL; + IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; + IWineD3DDevice *D3D = (IWineD3DDevice *) This->resource.wineD3DDevice; + TRACE("(%p)->(%p,%lx)\n", This, override, Flags); + + /* Flipping is only supported on RenderTargets */ + if( !(This->resource.usage & WINED3DUSAGE_RENDERTARGET) ) return DDERR_NOTFLIPPABLE; + + if(override) { + /* DDraw sets this for the X11 surfaces, so don't confuse the user + * FIXME("(%p) Target override is not supported by now\n", This); + * Additionally, it isn't really possible to support triple-buffering + * properly on opengl at all + */ + } + + /* Flipping a OpenGL surface -> Use WineD3DDevice::Present */ + return IWineD3DDevice_Present(D3D, NULL, NULL, 0, NULL); } HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx) {
1
0
0
0
Juan Lang : crypt32: Partially implement CertGetIssuerCertificateFromStore.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: ed66801d3ae640511ff477f91d926593d05c9711 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ed66801d3ae640511ff477f…
Author: Juan Lang <juan_lang(a)yahoo.com> Date: Tue May 9 23:25:04 2006 -0700 crypt32: Partially implement CertGetIssuerCertificateFromStore. --- dlls/crypt32/crypt32.spec | 2 - dlls/crypt32/store.c | 54 +++++++++++++++++++ dlls/crypt32/tests/store.c | 124 ++++++++++++++++++++++++++++++++++++++++++++ include/wincrypt.h | 13 +++++ 4 files changed, 192 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=ed66801d3ae640511ff…
1
0
0
0
Juan Lang : crypt32: Implement CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT in CryptVerifyCertificateSignatureEx .
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 9adcf560aef29cbdfa0d9c884b5bb697c082d499 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=9adcf560aef29cbdfa0d9c8…
Author: Juan Lang <juan_lang(a)yahoo.com> Date: Tue May 9 23:21:44 2006 -0700 crypt32: Implement CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT in CryptVerifyCertificateSignatureEx. --- dlls/crypt32/cert.c | 83 +++++++++++++++++++++++++++------------------------ 1 files changed, 44 insertions(+), 39 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index f44cc63..ca0505d 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -193,6 +193,41 @@ BOOL WINAPI CryptVerifyCertificateSignat CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY, pPublicKey, 0, NULL); } +static BOOL CRYPT_VerifyCertSignatureFromPublicKeyInfo(HCRYPTPROV hCryptProv, + DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pubKeyInfo, + PCERT_SIGNED_CONTENT_INFO signedCert) +{ + BOOL ret; + ALG_ID algID = CertOIDToAlgId(pubKeyInfo->Algorithm.pszObjId); + HCRYPTKEY key; + + /* Load the default provider if necessary */ + if (!hCryptProv) + hCryptProv = CRYPT_GetDefaultProvider(); + ret = CryptImportPublicKeyInfoEx(hCryptProv, dwCertEncodingType, + pubKeyInfo, algID, 0, NULL, &key); + if (ret) + { + HCRYPTHASH hash; + + /* Some key algorithms aren't hash algorithms, so map them */ + if (algID == CALG_RSA_SIGN || algID == CALG_RSA_KEYX) + algID = CALG_SHA1; + ret = CryptCreateHash(hCryptProv, algID, 0, 0, &hash); + if (ret) + { + ret = CryptHashData(hash, signedCert->ToBeSigned.pbData, + signedCert->ToBeSigned.cbData, 0); + if (ret) + ret = CryptVerifySignatureW(hash, signedCert->Signature.pbData, + signedCert->Signature.cbData, key, NULL, 0); + CryptDestroyHash(hash); + } + CryptDestroyKey(key); + } + return ret; +} + BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject, DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved) @@ -249,48 +284,18 @@ BOOL WINAPI CryptVerifyCertificateSignat switch (dwIssuerType) { case CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY: - { - PCERT_PUBLIC_KEY_INFO pubKeyInfo = - (PCERT_PUBLIC_KEY_INFO)pvIssuer; - ALG_ID algID = CertOIDToAlgId(pubKeyInfo->Algorithm.pszObjId); - - if (algID) - { - HCRYPTKEY key; - - ret = CryptImportPublicKeyInfoEx(hCryptProv, - dwCertEncodingType, pubKeyInfo, algID, 0, NULL, &key); - if (ret) - { - HCRYPTHASH hash; - - ret = CryptCreateHash(hCryptProv, algID, 0, 0, &hash); - if (ret) - { - ret = CryptHashData(hash, - signedCert->ToBeSigned.pbData, - signedCert->ToBeSigned.cbData, 0); - if (ret) - { - ret = CryptVerifySignatureW(hash, - signedCert->Signature.pbData, - signedCert->Signature.cbData, key, NULL, 0); - } - CryptDestroyHash(hash); - } - CryptDestroyKey(key); - } - } - else - { - SetLastError(NTE_BAD_ALGID); - ret = FALSE; - } + ret = CRYPT_VerifyCertSignatureFromPublicKeyInfo(hCryptProv, + dwCertEncodingType, (PCERT_PUBLIC_KEY_INFO)pvIssuer, + signedCert); break; - } case CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT: + ret = CRYPT_VerifyCertSignatureFromPublicKeyInfo(hCryptProv, + dwCertEncodingType, + &((PCCERT_CONTEXT)pvIssuer)->pCertInfo->SubjectPublicKeyInfo, + signedCert); + break; case CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: - FIXME("issuer type %ld: stub\n", dwIssuerType); + FIXME("CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: stub\n"); ret = FALSE; break; case CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL:
1
0
0
0
James Hawkins : ntdll: Return STATUS_NOT_IMPLEMENTED for the unimplemented port functions.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 31f29ffcc8c3ae5f3a098f7fd8de7fe287d0f125 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=31f29ffcc8c3ae5f3a098f7…
Author: James Hawkins <truiken(a)gmail.com> Date: Tue May 9 21:18:07 2006 -0500 ntdll: Return STATUS_NOT_IMPLEMENTED for the unimplemented port functions. --- dlls/ntdll/nt.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 5ee757d..8057dec 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -406,7 +406,7 @@ NTSTATUS WINAPI NtCreatePort(PHANDLE Por { FIXME("(%p,%p,%lu,%lu,%p),stub!\n",PortHandle,ObjectAttributes, MaxConnectInfoLength,MaxDataLength,reserved); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -429,7 +429,7 @@ NTSTATUS WINAPI NtConnectPort( pConnectInfoLength); if (ConnectInfo && pConnectInfoLength) TRACE("\tMessage = %s\n",debugstr_an(ConnectInfo,*pConnectInfoLength)); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -439,7 +439,7 @@ NTSTATUS WINAPI NtConnectPort( NTSTATUS WINAPI NtListenPort(HANDLE PortHandle,PLPC_MESSAGE pLpcMessage) { FIXME("(%p,%p),stub!\n",PortHandle,pLpcMessage); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -456,7 +456,7 @@ NTSTATUS WINAPI NtAcceptConnectPort( { FIXME("(%p,%lu,%p,%d,%p,%p),stub!\n", PortHandle,PortIdentifier,pLpcMessage,Accept,WriteSection,ReadSection); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -466,7 +466,7 @@ NTSTATUS WINAPI NtAcceptConnectPort( NTSTATUS WINAPI NtCompleteConnectPort(HANDLE PortHandle) { FIXME("(%p),stub!\n",PortHandle); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -476,7 +476,7 @@ NTSTATUS WINAPI NtCompleteConnectPort(HA NTSTATUS WINAPI NtRegisterThreadTerminatePort(HANDLE PortHandle) { FIXME("(%p),stub!\n",PortHandle); - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -503,7 +503,7 @@ NTSTATUS WINAPI NtRequestWaitReplyPort( TRACE("\tData = %s\n", debugstr_an((const char*)pLpcMessageIn->Data,pLpcMessageIn->DataSize)); } - return 0; + return STATUS_NOT_IMPLEMENTED; } /****************************************************************************** @@ -517,7 +517,7 @@ NTSTATUS WINAPI NtReplyWaitReceivePort( PLPC_MESSAGE Message) { FIXME("(%p,%p,%p,%p),stub!\n",PortHandle,PortIdentifier,ReplyMessage,Message); - return 0; + return STATUS_NOT_IMPLEMENTED; } /*
1
0
0
0
Michael Jung : shell32: Support BFFM_SETSELECTION[AW] and BFFM_SETEXPANDED for SHBrowseForFolder.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: b3e6faa7840d0f235db13fd452136294bd42045b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b3e6faa7840d0f235db13fd…
Author: Michael Jung <mjung(a)iss.tu-darmstadt.de> Date: Tue May 9 22:24:58 2006 +0200 shell32: Support BFFM_SETSELECTION[AW] and BFFM_SETEXPANDED for SHBrowseForFolder. --- dlls/shell32/brsfolder.c | 124 ++++++++++++++++++++++++++++++++++++++++------ dlls/shell32/pidl.h | 8 +++ 2 files changed, 117 insertions(+), 15 deletions(-) diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 6d5afe1..150b661 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -540,6 +540,112 @@ static BOOL BrsFolder_OnCommand( browse_ return FALSE; } +static BOOL BrsFolder_OnSetExpanded(browse_info *info, LPVOID selection, + BOOL is_str, HTREEITEM *pItem) +{ + LPITEMIDLIST pidlSelection = (LPITEMIDLIST)selection; + LPCITEMIDLIST pidlCurrent, pidlRoot; + TVITEMEXW item; + BOOL bResult = FALSE; + + /* If 'selection' is a string, convert to a Shell ID List. */ + if (is_str) { + IShellFolder *psfDesktop; + HRESULT hr; + + hr = SHGetDesktopFolder(&psfDesktop); + if (FAILED(hr)) + goto done; + + hr = IShellFolder_ParseDisplayName(psfDesktop, NULL, NULL, + (LPOLESTR)selection, NULL, &pidlSelection, NULL); + IShellFolder_Release(psfDesktop); + if (FAILED(hr)) + goto done; + } + + /* Move pidlCurrent behind the SHITEMIDs in pidlSelection, which are the root of + * the sub-tree currently displayed. */ + pidlRoot = info->lpBrowseInfo->pidlRoot; + pidlCurrent = pidlSelection; + while (!_ILIsEmpty(pidlRoot) && _ILIsEqualSimple(pidlRoot, pidlCurrent)) { + pidlRoot = ILGetNext(pidlRoot); + pidlCurrent = ILGetNext(pidlCurrent); + } + + /* The given ID List is not part of the SHBrowseForFolder's current sub-tree. */ + if (!_ILIsEmpty(pidlRoot)) + goto done; + + /* Initialize item to point to the first child of the root folder. */ + memset(&item, 0, sizeof(item)); + item.mask = TVIF_PARAM; + item.hItem = TreeView_GetRoot(info->hwndTreeView); + if (item.hItem) + item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem); + + /* Walk the tree along the nodes corresponding to the remaining ITEMIDLIST */ + while (item.hItem && !_ILIsEmpty(pidlCurrent)) { + LPTV_ITEMDATA pItemData; + + TreeView_GetItemW(info->hwndTreeView, &item); + pItemData = (LPTV_ITEMDATA)item.lParam; + + if (_ILIsEqualSimple(pItemData->lpi, pidlCurrent)) { + pidlCurrent = ILGetNext(pidlCurrent); + if (!_ILIsEmpty(pidlCurrent)) { + /* Only expand current node and move on to it's first child, + * if we didn't already reach the last SHITEMID */ + TreeView_Expand(info->hwndTreeView, item.hItem, TVE_EXPAND); + item.hItem = TreeView_GetChild(info->hwndTreeView, item.hItem); + } + } else { + item.hItem = TreeView_GetNextSibling(info->hwndTreeView, item.hItem); + } + } + + if (_ILIsEmpty(pidlCurrent) && item.hItem) + bResult = TRUE; + +done: + if (pidlSelection && pidlSelection != (LPITEMIDLIST)selection) + ILFree(pidlSelection); + + if (pItem) + *pItem = item.hItem; + + return bResult; +} + +static BOOL BrsFolder_OnSetSelectionW(browse_info *info, LPVOID selection, BOOL is_str) { + HTREEITEM hItem; + BOOL bResult; + + bResult = BrsFolder_OnSetExpanded(info, selection, is_str, &hItem); + if (bResult) + TreeView_Select(info->hwndTreeView, hItem, TVGN_CARET); + return bResult; +} + +static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL is_str) { + LPWSTR selectionW = NULL; + BOOL result = FALSE; + int length; + + if (!is_str) + return BrsFolder_OnSetSelectionW(info, selection, is_str); + + if ((length = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, NULL, 0)) && + (selectionW = HeapAlloc(GetProcessHeap(), 0, length)) && + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)selection, -1, selectionW, length)) + { + result = BrsFolder_OnSetSelectionW(info, selectionW, is_str); + } + + HeapFree(GetProcessHeap(), 0, selectionW); + return result; +} + /************************************************************************* * BrsFolderDlgProc32 (not an exported API function) */ @@ -584,25 +690,13 @@ static INT_PTR CALLBACK BrsFolderDlgProc break; case BFFM_SETSELECTIONA: - if (wParam) - FIXME("Set selection %s\n", debugstr_a((LPSTR)lParam)); - else - FIXME("Set selection %p\n", (void*)lParam); - break; + return BrsFolder_OnSetSelectionA(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETSELECTIONW: - if (wParam) - FIXME("Set selection %s\n", debugstr_w((LPWSTR)lParam)); - else - FIXME("Set selection %p\n", (void*)lParam); - break; + return BrsFolder_OnSetSelectionW(info, (LPVOID)lParam, (BOOL)wParam); case BFFM_SETEXPANDED: /* unicode only */ - if (wParam) - FIXME("Set expanded %s\n", debugstr_w((LPWSTR)lParam)); - else - FIXME("Set expanded %p\n", (void*)lParam); - break; + return BrsFolder_OnSetExpanded(info, (LPVOID)lParam, (BOOL)wParam, NULL); } return FALSE; } diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index e80ceaa..d033987 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -209,6 +209,14 @@ BOOL _ILIsValue (LPCITEMIDLIST pidl); BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl); BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl); BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl); +static inline +BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB) +{ + return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) || + (!pidlA->mkid.cb && !pidlB->mkid.cb); +} +static inline +BOOL _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); } /* * simple pidls
1
0
0
0
Uwe Bonnes : kernel: Comm_CheckEvents: Only warn for non-empty transmitter with EV_TXEMPTY flag set.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 5b4c15c5d3c254e41114191c8182a7cf7df05e89 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=5b4c15c5d3c254e41114191…
Author: Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> Date: Tue May 9 22:02:39 2006 +0200 kernel: Comm_CheckEvents: Only warn for non-empty transmitter with EV_TXEMPTY flag set. Noticed by Dan Armbrust. --- dlls/kernel/comm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index 8f5b9fd..2a1cb8b 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -1232,8 +1232,8 @@ #elif defined(TIOCINQ) if (!queue) #endif ret |= EV_TXEMPTY; + TRACE("OUTQUEUE %ld, Transmitter %sempty\n", queue, (ret & EV_TXEMPTY)?"":"not "); } - TRACE("OUTQUEUE %ld, Transmitter %sempty\n", queue, (ret & EV_TXEMPTY)?"":"not "); return ret; }
1
0
0
0
Alexandre Julliard : x11drv: We really need to flush the display when destroying a window.
by Alexandre Julliard
10 May '06
10 May '06
Module: wine Branch: refs/heads/master Commit: 975f1b2a6188509e0e99ae5ea71364755bd54cee URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=975f1b2a6188509e0e99ae5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 17:32:40 2006 +0200 x11drv: We really need to flush the display when destroying a window. --- dlls/x11drv/window.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index 4e010e6..faaa471 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -736,6 +736,8 @@ static void destroy_whole_window( Displa XUnsetICFocus( data->xic ); XDestroyIC( data->xic ); } + /* Outlook stops processing messages after destroying a dialog, so we need an explicit flush */ + XFlush( display ); wine_tsx11_unlock(); RemovePropA( data->hwnd, whole_window_prop ); }
1
0
0
0
Eric Pouech : ntdll/kernel32: EscapeCommFunction & associated IOCTLs
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 5f9e9836cf2d183a7645ef6d4badc362fef15f56 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=5f9e9836cf2d183a7645ef6…
Author: Eric Pouech <eric.pouech(a)wanadoo.fr> Date: Sun May 7 14:11:05 2006 +0200 ntdll/kernel32: EscapeCommFunction & associated IOCTLs - implemented ntdll's serial IOCTL: CLR_DTR, CLR_RTS, SET_DTR, SET_RTS, SET_XOFF, SET_XON, RESET_DEVICE - implemented kernel32.EscapeCommFunction on top of them --- dlls/kernel/comm.c | 134 +++++++++------------------------------------------ dlls/ntdll/serial.c | 75 +++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 110 deletions(-) diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index 8f5c18d..8f5b9fd 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -146,19 +146,6 @@ #endif return -1; } -static int COMM_WhackModem(int fd, unsigned int andy, unsigned int orrie) -{ -#ifdef TIOCMGET - unsigned int mstat, okay; - okay = ioctl(fd, TIOCMGET, &mstat); - if (okay) return okay; - if (andy) mstat &= andy; - mstat |= orrie; - return ioctl(fd, TIOCMSET, &mstat); -#else - return 0; -#endif -} /*********************************************************************** * COMM_Parse* (Internal) @@ -699,111 +686,38 @@ BOOL WINAPI ClearCommBreak(HANDLE handle * * Directs a communication device to perform an extended function. * + * PARAMS + * + * handle [in] The communication device to perform the extended function + * nFunction [in] The extended function to be performed + * * RETURNS * * True or requested data on successful completion of the command, * false if the device is not present cannot execute the command * or the command failed. */ -BOOL WINAPI EscapeCommFunction( - HANDLE handle, /* [in] The communication device to perform the extended function. */ - UINT nFunction) /* [in] The extended function to be performed. */ +BOOL WINAPI EscapeCommFunction(HANDLE handle, UINT func) { - int fd,direct=FALSE,result=FALSE; - struct termios port; - - TRACE("handle %p, function=%d\n", handle, nFunction); - fd = get_comm_fd( handle, FILE_READ_DATA ); - if(fd<0) return FALSE; - - if (tcgetattr(fd,&port) == -1) { - release_comm_fd( handle, fd ); - return FALSE; - } - - switch (nFunction) { - case RESETDEV: - TRACE("\n"); - break; - - case CLRDTR: - TRACE("CLRDTR\n"); -#ifdef TIOCM_DTR - direct=TRUE; - result= COMM_WhackModem(fd, ~TIOCM_DTR, 0); - break; -#endif - - case CLRRTS: - TRACE("CLRRTS\n"); -#ifdef TIOCM_RTS - direct=TRUE; - result= COMM_WhackModem(fd, ~TIOCM_RTS, 0); - break; -#endif + DWORD ioc; - case SETDTR: - TRACE("SETDTR\n"); -#ifdef TIOCM_DTR - direct=TRUE; - result= COMM_WhackModem(fd, 0, TIOCM_DTR); - break; -#endif - - case SETRTS: - TRACE("SETRTS\n"); -#ifdef TIOCM_RTS - direct=TRUE; - result= COMM_WhackModem(fd, 0, TIOCM_RTS); - break; -#endif - - case SETXOFF: - TRACE("SETXOFF\n"); - port.c_iflag |= IXOFF; - break; - - case SETXON: - TRACE("SETXON\n"); - port.c_iflag |= IXON; - break; - case SETBREAK: - TRACE("setbreak\n"); -#ifdef TIOCSBRK - direct=TRUE; - result = ioctl(fd,TIOCSBRK,0); - break; -#endif - case CLRBREAK: - TRACE("clrbreak\n"); -#ifdef TIOCSBRK - direct=TRUE; - result = ioctl(fd,TIOCCBRK,0); - break; -#endif - default: - WARN("(handle=%p,nFunction=%d): Unknown function\n", - handle, nFunction); - break; - } - - if (!direct) - if (tcsetattr(fd, TCSADRAIN, &port) == -1) { - release_comm_fd( handle, fd ); - return FALSE; - } else - result= TRUE; - else - { - if (result == -1) - { - result= FALSE; - } - else - result = TRUE; - } - release_comm_fd( handle, fd ); - return result; + switch (func) + { + case CLRDTR: ioc = IOCTL_SERIAL_CLR_DTR; break; + case CLRRTS: ioc = IOCTL_SERIAL_CLR_RTS; break; + case SETDTR: ioc = IOCTL_SERIAL_SET_DTR; break; + case SETRTS: ioc = IOCTL_SERIAL_SET_RTS; break; + case SETXOFF: ioc = IOCTL_SERIAL_SET_XOFF; break; + case SETXON: ioc = IOCTL_SERIAL_SET_XON; break; + case SETBREAK: ioc = IOCTL_SERIAL_SET_BREAK_ON; break; + case CLRBREAK: ioc = IOCTL_SERIAL_SET_BREAK_OFF; break; + case RESETDEV: ioc = IOCTL_SERIAL_RESET_DEVICE; break; + default: + ERR("Unknown function code (%u)\n", func); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return DeviceIoControl(handle, ioc, NULL, 0, NULL, 0, NULL, NULL); } /******************************************************************** diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 15d1941..64e181a 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -823,6 +823,44 @@ static NTSTATUS set_wait_mask(HANDLE hDe return status; } +static NTSTATUS set_XOff(int fd) +{ + struct termios port; + + if (tcgetattr(fd,&port) == -1) + { + FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + + + } + port.c_iflag |= IXOFF; + if (tcsetattr(fd, TCSADRAIN, &port) == -1) + { + FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + } + return STATUS_SUCCESS; +} + +static NTSTATUS set_XOn(int fd) +{ + struct termios port; + + if (tcgetattr(fd,&port) == -1) + { + FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + } + port.c_iflag |= IXON; + if (tcsetattr(fd, TCSADRAIN, &port) == -1) + { + FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + } + return STATUS_SUCCESS; +} + static NTSTATUS xmit_immediate(HANDLE hDevice, int fd, char* ptr) { /* FIXME: not perfect as it should bypass the in-queue */ @@ -861,6 +899,20 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDe switch (dwIoControlCode) { + case IOCTL_SERIAL_CLR_DTR: +#ifdef TIOCM_DTR + if (whack_modem(fd, ~TIOCM_DTR, 0) == -1) status = FILE_GetNtStatus(); +#else + status = STATUS_NOT_SUPPORTED; +#endif + break; + case IOCTL_SERIAL_CLR_RTS: +#ifdef TIOCM_RTS + if (whack_modem(fd, ~TIOCM_RTS, 0) == -1) status = FILE_GetNtStatus(); +#else + status = STATUS_NOT_SUPPORTED; +#endif + break; case IOCTL_SERIAL_GET_BAUD_RATE: if (lpOutBuffer && nOutBufferSize == sizeof(SERIAL_BAUD_RATE)) { @@ -943,6 +995,9 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDe else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_RESET_DEVICE: + FIXME("Unsupported\n"); + break; case IOCTL_SERIAL_SET_BAUD_RATE: if (lpInBuffer && nInBufferSize == sizeof(SERIAL_BAUD_RATE)) status = set_baud_rate(fd, (const SERIAL_BAUD_RATE*)lpInBuffer); @@ -979,6 +1034,13 @@ #endif else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_SET_DTR: +#ifdef TIOCM_DTR + if (whack_modem(fd, 0, TIOCM_DTR) == -1) status = FILE_GetNtStatus(); +#else + status = STATUS_NOT_SUPPORTED; +#endif + break; case IOCTL_SERIAL_SET_HANDFLOW: if (lpInBuffer && nInBufferSize == sizeof(SERIAL_HANDFLOW)) status = set_handflow(fd, (const SERIAL_HANDFLOW*)lpInBuffer); @@ -997,6 +1059,13 @@ #endif else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_SET_RTS: +#ifdef TIOCM_RTS + if (whack_modem(fd, 0, TIOCM_RTS) == -1) status = FILE_GetNtStatus(); +#else + status = STATUS_NOT_SUPPORTED; +#endif + break; case IOCTL_SERIAL_SET_TIMEOUTS: if (lpInBuffer && nInBufferSize == sizeof(SERIAL_TIMEOUTS)) status = set_timeouts(hDevice, fd, (const SERIAL_TIMEOUTS*)lpInBuffer); @@ -1010,6 +1079,12 @@ #endif } else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_SET_XOFF: + status = set_XOff(fd); + break; + case IOCTL_SERIAL_SET_XON: + status = set_XOn(fd); + break; default: FIXME("Unsupported IOCTL %lx (type=%lx access=%lx func=%lx meth=%lx)\n", dwIoControlCode, dwIoControlCode >> 16, (dwIoControlCode >> 14) & 3,
1
0
0
0
Eric Pouech : ntdll/kernel32: SetupComm & SET_QUEUE_SIZE
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: fcdc293bb08ab0d21f9fc48e58fde76e6b35b641 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=fcdc293bb08ab0d21f9fc48…
Author: Eric Pouech <eric.pouech(a)wanadoo.fr> Date: Sun May 7 14:11:02 2006 +0200 ntdll/kernel32: SetupComm & SET_QUEUE_SIZE - stubbed out ntdll's serial IOCTL SET_QUEUE_SIZE - implemented kernel32.SetupComm on top of it --- dlls/kernel/comm.c | 21 +++++++++++---------- dlls/ntdll/serial.c | 12 ++++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index f12043d..8f5c18d 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -883,6 +883,11 @@ BOOL WINAPI ClearCommError(HANDLE handle * Called after CreateFile to hint to the communication resource to use * specified sizes for input and output buffers rather than the default values. * + * PARAMS + * handle [in] The just created communication resource handle + * insize [in] The suggested size of the communication resources input buffer in bytes + * outsize [in] The suggested size of the communication resources output buffer in bytes + * * RETURNS * * True if successful, false if the communications resource handle is bad. @@ -891,18 +896,14 @@ BOOL WINAPI ClearCommError(HANDLE handle * * Stub. */ -BOOL WINAPI SetupComm( - HANDLE handle, /* [in] The just created communication resource handle. */ - DWORD insize, /* [in] The suggested size of the communication resources input buffer in bytes. */ - DWORD outsize) /* [in] The suggested size of the communication resources output buffer in bytes. */ +BOOL WINAPI SetupComm(HANDLE handle, DWORD insize, DWORD outsize) { - int fd; + SERIAL_QUEUE_SIZE sqs; - FIXME("insize %ld outsize %ld unimplemented stub\n", insize, outsize); - fd=get_comm_fd( handle, FILE_READ_DATA ); - if(0>fd) return FALSE; - release_comm_fd( handle, fd ); - return TRUE; + sqs.InSize = insize; + sqs.OutSize = outsize; + return DeviceIoControl(handle, IOCTL_SERIAL_SET_QUEUE_SIZE, + &sqs, sizeof(sqs), NULL, 0, NULL, NULL); } /***************************************************************************** diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 1b45a10..15d1941 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -729,6 +729,12 @@ #endif return STATUS_SUCCESS; } +static NTSTATUS set_queue_size(int fd, const SERIAL_QUEUE_SIZE* sqs) +{ + FIXME("insize %ld outsize %ld unimplemented stub\n", sqs->InSize, sqs->OutSize); + return STATUS_SUCCESS; +} + static NTSTATUS set_special_chars(int fd, const SERIAL_CHARS* sc) { struct termios port; @@ -985,6 +991,12 @@ #endif else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_SET_QUEUE_SIZE: + if (lpInBuffer && nInBufferSize == sizeof(SERIAL_QUEUE_SIZE)) + status = set_queue_size(fd, (const SERIAL_QUEUE_SIZE*)lpInBuffer); + else + status = STATUS_INVALID_PARAMETER; + break; case IOCTL_SERIAL_SET_TIMEOUTS: if (lpInBuffer && nInBufferSize == sizeof(SERIAL_TIMEOUTS)) status = set_timeouts(hDevice, fd, (const SERIAL_TIMEOUTS*)lpInBuffer);
1
0
0
0
Eric Pouech : ntdll/kernel32: [SG]etCommTimeout, SERIAL_[GS]ET_TIMEOUT
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: b53e016925301e6086bca3fd665074b0ea01d090 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b53e016925301e6086bca3f…
Author: Eric Pouech <eric.pouech(a)wanadoo.fr> Date: Sun May 7 14:10:58 2006 +0200 ntdll/kernel32: [SG]etCommTimeout, SERIAL_[GS]ET_TIMEOUT - implemented ntdll's COMM IOCTL GET_TIMEOUTS, SET_TIMEOUTS - implemented kernel32.GetCommTimeout and SetCommTimeout on top of them --- dlls/kernel/comm.c | 114 +++++++++++++++------------------------------------ dlls/ntdll/serial.c | 87 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 84 deletions(-) diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index 7d8e6da..f12043d 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -1180,39 +1180,34 @@ BOOL WINAPI TransmitCommChar(HANDLE hCom * * Obtains the request timeout values for the communications device. * + * PARAMS + * hComm [in] The communications device + * lptimeouts [out] The struct of request timeouts + * * RETURNS * * True on success, false if communications device handle is bad * or the target structure is null. */ -BOOL WINAPI GetCommTimeouts( - HANDLE hComm, /* [in] The communications device. */ - LPCOMMTIMEOUTS lptimeouts) /* [out] The struct of request timeouts. */ +BOOL WINAPI GetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts) { - BOOL ret; - - TRACE("(%p,%p)\n",hComm,lptimeouts); + SERIAL_TIMEOUTS st; - if(!lptimeouts) + TRACE("(%p, %p)\n", hComm, lptimeouts); + if (!lptimeouts) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - - SERVER_START_REQ( get_serial_info ) - { - req->handle = hComm; - if ((ret = !wine_server_call_err( req ))) - { - lptimeouts->ReadIntervalTimeout = reply->readinterval; - lptimeouts->ReadTotalTimeoutMultiplier = reply->readmult; - lptimeouts->ReadTotalTimeoutConstant = reply->readconst; - lptimeouts->WriteTotalTimeoutMultiplier = reply->writemult; - lptimeouts->WriteTotalTimeoutConstant = reply->writeconst; - } - } - SERVER_END_REQ; - return ret; + if (!DeviceIoControl(hComm, IOCTL_SERIAL_GET_TIMEOUTS, + NULL, 0, &st, sizeof(st), NULL, NULL)) + return FALSE; + lptimeouts->ReadIntervalTimeout = st.ReadIntervalTimeout; + lptimeouts->ReadTotalTimeoutMultiplier = st.ReadTotalTimeoutMultiplier; + lptimeouts->ReadTotalTimeoutConstant = st.ReadTotalTimeoutConstant; + lptimeouts->WriteTotalTimeoutMultiplier = st.WriteTotalTimeoutMultiplier; + lptimeouts->WriteTotalTimeoutConstant = st.WriteTotalTimeoutConstant; + return TRUE; } /***************************************************************************** @@ -1220,6 +1215,10 @@ BOOL WINAPI GetCommTimeouts( * * Sets the timeouts used when reading and writing data to/from COMM ports. * + * PARAMS + * hComm [in] handle of COMM device + * lptimeouts [in] pointer to COMMTIMEOUTS structure + * * ReadIntervalTimeout * - converted and passes to linux kernel as c_cc[VTIME] * ReadTotalTimeoutMultiplier, ReadTotalTimeoutConstant @@ -1231,72 +1230,25 @@ BOOL WINAPI GetCommTimeouts( * * True if the timeouts were set, false otherwise. */ -BOOL WINAPI SetCommTimeouts( - HANDLE hComm, /* [in] handle of COMM device */ - LPCOMMTIMEOUTS lptimeouts) /* [in] pointer to COMMTIMEOUTS structure */ +BOOL WINAPI SetCommTimeouts(HANDLE hComm, LPCOMMTIMEOUTS lptimeouts) { - BOOL ret; - int fd; - struct termios tios; + SERIAL_TIMEOUTS st; - TRACE("(%p,%p)\n",hComm,lptimeouts); + TRACE("(%p, %p)\n", hComm, lptimeouts); - if(!lptimeouts) + if (lptimeouts == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - - SERVER_START_REQ( set_serial_info ) - { - req->handle = hComm; - req->flags = SERIALINFO_SET_TIMEOUTS; - req->readinterval = lptimeouts->ReadIntervalTimeout ; - req->readmult = lptimeouts->ReadTotalTimeoutMultiplier ; - req->readconst = lptimeouts->ReadTotalTimeoutConstant ; - req->writemult = lptimeouts->WriteTotalTimeoutMultiplier ; - req->writeconst = lptimeouts->WriteTotalTimeoutConstant ; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - if (!ret) return FALSE; - - /* FIXME: move this stuff to the server */ - fd = get_comm_fd( hComm, FILE_READ_DATA ); - if (fd < 0) return FALSE; - - if (-1==tcgetattr(fd,&tios)) { - FIXME("tcgetattr on fd %d failed!\n",fd); - release_comm_fd( hComm, fd ); - return FALSE; - } - - /* VTIME is in 1/10 seconds */ - { - unsigned int ux_timeout; - - if(lptimeouts->ReadIntervalTimeout == 0) /* 0 means no timeout */ - { - ux_timeout = 0; - } - else - { - ux_timeout = (lptimeouts->ReadIntervalTimeout+99)/100; - if(ux_timeout == 0) - { - ux_timeout = 1; /* must be at least some timeout */ - } - } - tios.c_cc[VTIME] = ux_timeout; - } - - if (-1==tcsetattr(fd,0,&tios)) { - FIXME("tcsetattr on fd %d failed!\n",fd); - release_comm_fd( hComm, fd ); - return FALSE; - } - release_comm_fd( hComm, fd ); - return TRUE; + st.ReadIntervalTimeout = lptimeouts->ReadIntervalTimeout; + st.ReadTotalTimeoutMultiplier = lptimeouts->ReadTotalTimeoutMultiplier; + st.ReadTotalTimeoutConstant = lptimeouts->ReadTotalTimeoutConstant; + st.WriteTotalTimeoutMultiplier = lptimeouts->WriteTotalTimeoutMultiplier; + st.WriteTotalTimeoutConstant = lptimeouts->WriteTotalTimeoutConstant; + + return DeviceIoControl(hComm, IOCTL_SERIAL_SET_TIMEOUTS, + &st, sizeof(st), NULL, 0, NULL, NULL); } /*********************************************************************** diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 9b56c6b..1b45a10 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -368,6 +368,25 @@ #endif return status; } +static NTSTATUS get_timeouts(HANDLE handle, SERIAL_TIMEOUTS* st) +{ + NTSTATUS status; + SERVER_START_REQ( get_serial_info ) + { + req->handle = handle; + if (!(status = wine_server_call( req ))) + { + st->ReadIntervalTimeout = reply->readinterval; + st->ReadTotalTimeoutMultiplier = reply->readmult; + st->ReadTotalTimeoutConstant = reply->readconst; + st->WriteTotalTimeoutMultiplier = reply->writemult; + st->WriteTotalTimeoutConstant = reply->writeconst; + } + } + SERVER_END_REQ; + return status; +} + static NTSTATUS get_wait_mask(HANDLE hDevice, DWORD* mask) { NTSTATUS status; @@ -738,6 +757,51 @@ static NTSTATUS set_special_chars(int fd return STATUS_SUCCESS; } +static NTSTATUS set_timeouts(HANDLE handle, int fd, const SERIAL_TIMEOUTS* st) +{ + NTSTATUS status; + struct termios port; + unsigned int ux_timeout; + + SERVER_START_REQ( set_serial_info ) + { + req->handle = handle; + req->flags = SERIALINFO_SET_TIMEOUTS; + req->readinterval = st->ReadIntervalTimeout ; + req->readmult = st->ReadTotalTimeoutMultiplier ; + req->readconst = st->ReadTotalTimeoutConstant ; + req->writemult = st->WriteTotalTimeoutMultiplier ; + req->writeconst = st->WriteTotalTimeoutConstant ; + status = wine_server_call( req ); + } + SERVER_END_REQ; + if (status) return status; + + if (tcgetattr(fd, &port) == -1) + { + FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + } + + /* VTIME is in 1/10 seconds */ + if (st->ReadIntervalTimeout == 0) /* 0 means no timeout */ + ux_timeout = 0; + else + { + ux_timeout = (st->ReadIntervalTimeout + 99) / 100; + if (ux_timeout == 0) + ux_timeout = 1; /* must be at least some timeout */ + } + port.c_cc[VTIME] = ux_timeout; + + if (tcsetattr(fd, 0, &port) == -1) + { + FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); + return FILE_GetNtStatus(); + } + return STATUS_SUCCESS; +} + static NTSTATUS set_wait_mask(HANDLE hDevice, DWORD mask) { NTSTATUS status; @@ -777,7 +841,7 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDe { DWORD sz = 0, access = FILE_READ_DATA; NTSTATUS status = STATUS_SUCCESS; - int fd; + int fd = -1; TRACE("%p %s %p %ld %p %ld %p\n", hDevice, iocode2str(dwIoControlCode), lpInBuffer, nInBufferSize, @@ -785,7 +849,9 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDe piosb->Information = 0; - if ((status = wine_server_handle_to_fd( hDevice, access, &fd, NULL ))) goto error; + if (dwIoControlCode != IOCTL_SERIAL_GET_TIMEOUTS) + if ((status = wine_server_handle_to_fd( hDevice, access, &fd, NULL ))) + goto error; switch (dwIoControlCode) { @@ -841,6 +907,15 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDe } else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_GET_TIMEOUTS: + if (lpOutBuffer && nOutBufferSize == sizeof(SERIAL_TIMEOUTS)) + { + if (!(status = get_timeouts(hDevice, (SERIAL_TIMEOUTS*)lpInBuffer))) + sz = sizeof(SERIAL_TIMEOUTS); + } + else + status = STATUS_INVALID_PARAMETER; + break; case IOCTL_SERIAL_GET_WAIT_MASK: if (lpOutBuffer && nOutBufferSize == sizeof(DWORD)) { @@ -910,6 +985,12 @@ #endif else status = STATUS_INVALID_PARAMETER; break; + case IOCTL_SERIAL_SET_TIMEOUTS: + if (lpInBuffer && nInBufferSize == sizeof(SERIAL_TIMEOUTS)) + status = set_timeouts(hDevice, fd, (const SERIAL_TIMEOUTS*)lpInBuffer); + else + status = STATUS_INVALID_PARAMETER; + break; case IOCTL_SERIAL_SET_WAIT_MASK: if (lpInBuffer && nInBufferSize == sizeof(DWORD)) { @@ -925,7 +1006,7 @@ #endif status = STATUS_INVALID_PARAMETER; break; } - wine_server_release_fd( hDevice, fd ); + if (fd != -1) wine_server_release_fd( hDevice, fd ); error: piosb->u.Status = status; piosb->Information = sz;
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
...
87
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
Results per page:
10
25
50
100
200