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
August 2014
----- 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
304 discussions
Start a n
N
ew thread
Austin English : hid: Add HidD_GetProductString stub.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: bb25986702bf5a1749742094a8755d780f33cd51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb25986702bf5a1749742094a…
Author: Austin English <austinenglish(a)gmail.com> Date: Thu Jul 31 11:59:16 2014 -0700 hid: Add HidD_GetProductString stub. --- dlls/hid/hid.spec | 2 +- dlls/hid/main.c | 6 ++++++ include/ddk/hidsdi.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/hid/hid.spec b/dlls/hid/hid.spec index af6140a..f58953a 100644 --- a/dlls/hid/hid.spec +++ b/dlls/hid/hid.spec @@ -11,7 +11,7 @@ @ stub HidD_GetNumInputBuffers @ stub HidD_GetPhysicalDescriptor @ stub HidD_GetPreparsedData -@ stub HidD_GetProductString +@ stdcall HidD_GetProductString(long ptr long) @ stub HidD_GetSerialNumberString @ stub HidD_Hello @ stub HidD_SetConfiguration diff --git a/dlls/hid/main.c b/dlls/hid/main.c index 2493075..927b563 100644 --- a/dlls/hid/main.c +++ b/dlls/hid/main.c @@ -73,3 +73,9 @@ BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG FIXME("(%p %p %u) stub\n", HidDeviceObject, ReportBuffer, ReportBufferLength); return FALSE; } + +BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) +{ + FIXME("(%p %p %u) stub\n", HidDeviceObject, Buffer, BufferLength); + return FALSE; +} diff --git a/include/ddk/hidsdi.h b/include/ddk/hidsdi.h index 229fc14..bb49f0b 100644 --- a/include/ddk/hidsdi.h +++ b/include/ddk/hidsdi.h @@ -30,6 +30,7 @@ typedef LONG NTSTATUS; BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); void WINAPI HidD_GetHidGuid(LPGUID guid); BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); +BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); #endif /* __WINE_HIDSDI_H */
1
0
0
0
Piotr Caban : msvcp110: Add _Xbad_alloc implementation.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: 7aa53f036cb59f57fd369339aeaa545f0d77739e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7aa53f036cb59f57fd369339a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Jul 30 16:52:02 2014 -0500 msvcp110: Add _Xbad_alloc implementation. --- dlls/msvcp110/msvcp110.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 54d2ae4..593976e 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -1832,7 +1832,7 @@ @ stub ?_XLgamma@std@@YAMM@Z @ stub ?_XLgamma@std@@YANN@Z @ stub ?_XLgamma@std@@YAOO@Z -@ stub ?_Xbad_alloc@std@@YAXXZ +@ cdecl ?_Xbad_alloc@std@@YAXXZ() _Xmem @ stub ?_Xbad_function_call@std@@YAXXZ @ cdecl -arch=win32 ?_Xinvalid_argument@std@@YAXPBD@Z(str) _Xinvalid_argument @ cdecl -arch=win64 ?_Xinvalid_argument@std@@YAXPEBD@Z(str) _Xinvalid_argument
1
0
0
0
Austin English : wine.inf: Use full path to msiexec.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: 12fd631fe1f1f4ec66a16f96f683ad42f10c0335 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12fd631fe1f1f4ec66a16f96f…
Author: Austin English <austinenglish(a)gmail.com> Date: Sun Aug 3 18:52:27 2014 -0500 wine.inf: Use full path to msiexec. --- loader/wine.inf.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 25bc098..127c67c 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -204,12 +204,12 @@ HKCR,lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046}, HKCR,MediaFoundation,,16 HKCR,Msi.Package,,2,"Windows Installer Package" HKCR,Msi.Package\DefaultIcon,,2,"msiexec.exe" -HKCR,Msi.Package\shell\Open\command,,2,"msiexec /i ""%1""" -HKCR,Msi.Package\shell\Repair\command,,2,"msiexec /f ""%1""" -HKCR,Msi.Package\shell\Uninstall\command,,2,"msiexec /x ""%1""" +HKCR,Msi.Package\shell\Open\command,,2,'%11%\msiexec.exe /i ""%1""' +HKCR,Msi.Package\shell\Repair\command,,2,'%11%\msiexec.exe /f ""%1""' +HKCR,Msi.Package\shell\Uninstall\command,,2,'%11%\msiexec.exe /x ""%1""' HKCR,Msi.Patch,,2,"Windows Installer Patch" HKCR,Msi.Patch\DefaultIcon,,2,"msiexec.exe" -HKCR,Msi.Patch\shell\Open\command,,2,"msiexec /p ""%1""" +HKCR,Msi.Patch\shell\Open\command,,2,'%11%\msiexec.exe /p ""%1""' HKCR,rtffile,,2,"Rich Text Document" HKCR,rtffile\shell\open\command,,2,"%11%\wordpad.exe %1" HKCR,rtffile\shell\print\command,,2,"%11%\wordpad.exe /p %1"
1
0
0
0
Nikolay Sivov : dwrite: Implement Resize() for bitmap render target.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: c9b8a31c24c6bf855e3bdbd18672c1d184cb1f2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9b8a31c24c6bf855e3bdbd18…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Aug 1 21:11:45 2014 +0400 dwrite: Implement Resize() for bitmap render target. --- dlls/dwrite/gdiinterop.c | 73 ++++++++++++++++++++++++++++++------------------ dlls/dwrite/tests/font.c | 52 ++++++++++++++++++++++++++++++++-- 2 files changed, 96 insertions(+), 29 deletions(-) diff --git a/dlls/dwrite/gdiinterop.c b/dlls/dwrite/gdiinterop.c index bb24305..4b26197 100644 --- a/dlls/dwrite/gdiinterop.c +++ b/dlls/dwrite/gdiinterop.c @@ -40,6 +40,28 @@ struct rendertarget { HDC hdc; }; +static HRESULT create_target_dibsection(HDC hdc, UINT32 width, UINT32 height) +{ + char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; + BITMAPINFO *bmi = (BITMAPINFO*)bmibuf; + HBITMAP hbm; + + memset(bmi, 0, sizeof(bmibuf)); + bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); + bmi->bmiHeader.biHeight = height; + bmi->bmiHeader.biWidth = width; + bmi->bmiHeader.biBitCount = 32; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biCompression = BI_RGB; + + hbm = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); + if (!hbm) + hbm = CreateBitmap(1, 1, 1, 1, NULL); + + DeleteObject(SelectObject(hdc, hbm)); + return S_OK; +} + static inline struct rendertarget *impl_from_IDWriteBitmapRenderTarget(IDWriteBitmapRenderTarget *iface) { return CONTAINING_RECORD(iface, struct rendertarget, IDWriteBitmapRenderTarget_iface); @@ -145,8 +167,13 @@ static HRESULT WINAPI rendertarget_GetSize(IDWriteBitmapRenderTarget *iface, SIZ static HRESULT WINAPI rendertarget_Resize(IDWriteBitmapRenderTarget *iface, UINT32 width, UINT32 height) { struct rendertarget *This = impl_from_IDWriteBitmapRenderTarget(iface); - FIXME("(%p)->(%u %u): stub\n", This, width, height); - return E_NOTIMPL; + + TRACE("(%p)->(%u %u)\n", This, width, height); + + if (This->size.cx == width && This->size.cy == height) + return S_OK; + + return create_target_dibsection(This->hdc, width, height); } static const IDWriteBitmapRenderTargetVtbl rendertargetvtbl = { @@ -163,38 +190,30 @@ static const IDWriteBitmapRenderTargetVtbl rendertargetvtbl = { rendertarget_Resize }; -static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **target) +static HRESULT create_rendertarget(HDC hdc, UINT32 width, UINT32 height, IDWriteBitmapRenderTarget **ret) { - char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])]; - BITMAPINFO *bmi = (BITMAPINFO*)bmibuf; - struct rendertarget *This; - HBITMAP dib; - - *target = NULL; - - This = heap_alloc(sizeof(struct rendertarget)); - if (!This) return E_OUTOFMEMORY; + struct rendertarget *target; + HRESULT hr; - This->IDWriteBitmapRenderTarget_iface.lpVtbl = &rendertargetvtbl; - This->ref = 1; + *ret = NULL; - This->size.cx = width; - This->size.cy = height; + target = heap_alloc(sizeof(struct rendertarget)); + if (!target) return E_OUTOFMEMORY; - This->hdc = CreateCompatibleDC(hdc); + target->IDWriteBitmapRenderTarget_iface.lpVtbl = &rendertargetvtbl; + target->ref = 1; - memset(bmi, 0, sizeof(bmibuf)); - bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader); - bmi->bmiHeader.biHeight = height; - bmi->bmiHeader.biWidth = width; - bmi->bmiHeader.biBitCount = 32; - bmi->bmiHeader.biPlanes = 1; - bmi->bmiHeader.biCompression = BI_RGB; + target->size.cx = width; + target->size.cy = height; - dib = CreateDIBSection(This->hdc, bmi, DIB_RGB_COLORS, NULL, NULL, 0); - SelectObject(This->hdc, dib); + target->hdc = CreateCompatibleDC(hdc); + hr = create_target_dibsection(target->hdc, width, height); + if (FAILED(hr)) { + IDWriteBitmapRenderTarget_Release(&target->IDWriteBitmapRenderTarget_iface); + return hr; + } - *target = &This->IDWriteBitmapRenderTarget_iface; + *ret = &target->IDWriteBitmapRenderTarget_iface; return S_OK; } diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 1447c1c..8460f12 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -198,8 +198,8 @@ static void test_CreateBitmapRenderTarget(void) { IDWriteBitmapRenderTarget *target, *target2; IDWriteGdiInterop *interop; + HBITMAP hbm, hbm2; DIBSECTION ds; - HBITMAP hbm; HRESULT hr; SIZE size; HDC hdc; @@ -272,8 +272,56 @@ if (0) /* crashes on native */ ok(size.cx == 10, "got %d\n", size.cx); ok(size.cy == 5, "got %d\n", size.cy); - IDWriteBitmapRenderTarget_Release(target); + /* resize to same size */ + hr = IDWriteBitmapRenderTarget_Resize(target, 10, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 == hbm, "got %p, %p\n", hbm2, hbm); + + /* shrink */ + hr = IDWriteBitmapRenderTarget_Resize(target, 5, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + hr = IDWriteBitmapRenderTarget_Resize(target, 20, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + hr = IDWriteBitmapRenderTarget_Resize(target, 1, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + ret = GetObjectW(hbm2, sizeof(ds), &ds); + ok(ret == sizeof(ds), "got %d\n", ret); + ok(ds.dsBm.bmWidth == 1, "got %d\n", ds.dsBm.bmWidth); + ok(ds.dsBm.bmHeight == 5, "got %d\n", ds.dsBm.bmHeight); + ok(ds.dsBm.bmPlanes == 1, "got %d\n", ds.dsBm.bmPlanes); + ok(ds.dsBm.bmBitsPixel == 32, "got %d\n", ds.dsBm.bmBitsPixel); + ok(ds.dsBm.bmBits != NULL, "got %p\n", ds.dsBm.bmBits); + /* empty rectangle */ + hr = IDWriteBitmapRenderTarget_Resize(target, 0, 5); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hbm2 = GetCurrentObject(hdc, OBJ_BITMAP); + ok(hbm2 != hbm, "got %p, %p\n", hbm2, hbm); + + ret = GetObjectW(hbm2, sizeof(ds), &ds); + ok(ret == sizeof(BITMAP), "got %d\n", ret); + ok(ds.dsBm.bmWidth == 1, "got %d\n", ds.dsBm.bmWidth); + ok(ds.dsBm.bmHeight == 1, "got %d\n", ds.dsBm.bmHeight); + ok(ds.dsBm.bmPlanes == 1, "got %d\n", ds.dsBm.bmPlanes); + ok(ds.dsBm.bmBitsPixel == 1, "got %d\n", ds.dsBm.bmBitsPixel); + ok(!ds.dsBm.bmBits, "got %p\n", ds.dsBm.bmBits); + + IDWriteBitmapRenderTarget_Release(target); IDWriteGdiInterop_Release(interop); }
1
0
0
0
Nikolay Sivov : include: Added IDWriteLocalFontFileLoader.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: ece85fad226e132c8d227f318058d24b8299b790 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ece85fad226e132c8d227f318…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Aug 1 18:56:14 2014 +0400 include: Added IDWriteLocalFontFileLoader. --- include/dwrite.idl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/dwrite.idl b/include/dwrite.idl index a8bac59..04c523c 100644 --- a/include/dwrite.idl +++ b/include/dwrite.idl @@ -548,6 +548,18 @@ interface IDWriteFontFileLoader : IUnknown [ local, object, +uuid(b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2) +] +interface IDWriteLocalFontFileLoader : IDWriteFontFileLoader +{ + HRESULT GetFilePathLengthFromKey(void const *key, UINT32 key_size, UINT32 *length); + HRESULT GetFilePathFromKey(void const *key, UINT32 key_size, WCHAR *path, UINT32 length); + HRESULT GetLastWriteTimeFromKey(void const *key, UINT32 key_size, FILETIME *writetime); +} + +[ +local, +object, uuid(739d886a-cef5-47dc-8769-1a8b41bebbb0) ] interface IDWriteFontFile : IUnknown
1
0
0
0
Nikolay Sivov : msxml3/saxreader: Fix attributes array growing size.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: 66b5dd71e9627a4f51e4239a809e68aaa3158693 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66b5dd71e9627a4f51e4239a8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jul 31 23:07:10 2014 +0400 msxml3/saxreader: Fix attributes array growing size. --- dlls/msxml3/saxreader.c | 65 ++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 0d58db3..a926fed 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -301,8 +301,8 @@ typedef struct struct list elements; BSTR namespaceUri; - int attributesSize; - int nb_attributes; + int attr_alloc_count; + int attr_count; struct _attributes { BSTR szLocalname; @@ -1106,11 +1106,16 @@ static HRESULT WINAPI isaxattributes_getLength( { saxlocator *This = impl_from_ISAXAttributes( iface ); - *length = This->nb_attributes; + *length = This->attr_count; TRACE("Length set to %d\n", *length); return S_OK; } +static inline BOOL is_valid_attr_index(const saxlocator *locator, int index) +{ + return index < locator->attr_count && index >= 0; +} + static HRESULT WINAPI isaxattributes_getURI( ISAXAttributes* iface, int index, @@ -1120,7 +1125,7 @@ static HRESULT WINAPI isaxattributes_getURI( saxlocator *This = impl_from_ISAXAttributes( iface ); TRACE("(%p)->(%d)\n", This, index); - if(index >= This->nb_attributes || index < 0) return E_INVALIDARG; + if(!is_valid_attr_index(This, index)) return E_INVALIDARG; if(!url || !size) return E_POINTER; *size = SysStringLen(This->attributes[index].szURI); @@ -1133,36 +1138,36 @@ static HRESULT WINAPI isaxattributes_getURI( static HRESULT WINAPI isaxattributes_getLocalName( ISAXAttributes* iface, - int nIndex, + int index, const WCHAR **pLocalName, int *pLocalNameLength) { saxlocator *This = impl_from_ISAXAttributes( iface ); - TRACE("(%p)->(%d)\n", This, nIndex); + TRACE("(%p)->(%d)\n", This, index); - if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG; + if(!is_valid_attr_index(This, index)) return E_INVALIDARG; if(!pLocalName || !pLocalNameLength) return E_POINTER; - *pLocalNameLength = SysStringLen(This->attributes[nIndex].szLocalname); - *pLocalName = This->attributes[nIndex].szLocalname; + *pLocalNameLength = SysStringLen(This->attributes[index].szLocalname); + *pLocalName = This->attributes[index].szLocalname; return S_OK; } static HRESULT WINAPI isaxattributes_getQName( ISAXAttributes* iface, - int nIndex, + int index, const WCHAR **pQName, int *pQNameLength) { saxlocator *This = impl_from_ISAXAttributes( iface ); - TRACE("(%p)->(%d)\n", This, nIndex); + TRACE("(%p)->(%d)\n", This, index); - if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG; + if(!is_valid_attr_index(This, index)) return E_INVALIDARG; if(!pQName || !pQNameLength) return E_POINTER; - *pQNameLength = SysStringLen(This->attributes[nIndex].szQName); - *pQName = This->attributes[nIndex].szQName; + *pQNameLength = SysStringLen(This->attributes[index].szQName); + *pQName = This->attributes[index].szQName; return S_OK; } @@ -1180,7 +1185,7 @@ static HRESULT WINAPI isaxattributes_getName( saxlocator *This = impl_from_ISAXAttributes( iface ); TRACE("(%p)->(%d)\n", This, index); - if(index>=This->nb_attributes || index<0) return E_INVALIDARG; + if(!is_valid_attr_index(This, index)) return E_INVALIDARG; if(!uri || !pUriLength || !localName || !pLocalNameSize || !QName || !pQNameLength) return E_POINTER; @@ -1211,7 +1216,7 @@ static HRESULT WINAPI isaxattributes_getIndexFromName( if(!pUri || !pLocalName || !index) return E_POINTER; - for(i=0; i<This->nb_attributes; i++) + for(i=0; i<This->attr_count; i++) { if(cUriLength!=SysStringLen(This->attributes[i].szURI) || cocalNameLength!=SysStringLen(This->attributes[i].szLocalname)) @@ -1243,7 +1248,7 @@ static HRESULT WINAPI isaxattributes_getIndexFromQName( if(!pQName || !index) return E_POINTER; if(!nQNameLength) return E_INVALIDARG; - for(i=0; i<This->nb_attributes; i++) + for(i=0; i<This->attr_count; i++) { if(nQNameLength!=SysStringLen(This->attributes[i].szQName)) continue; if(memcmp(pQName, This->attributes[i].szQName, sizeof(WCHAR)*nQNameLength)) continue; @@ -1305,7 +1310,7 @@ static HRESULT WINAPI isaxattributes_getValue( saxlocator *This = impl_from_ISAXAttributes( iface ); TRACE("(%p)->(%d)\n", This, index); - if(index>=This->nb_attributes || index<0) return E_INVALIDARG; + if(!is_valid_attr_index(This, index)) return E_INVALIDARG; if(!value || !nValue) return E_POINTER; *nValue = SysStringLen(This->attributes[index].szValue); @@ -1423,7 +1428,7 @@ static void free_attribute_values(saxlocator *locator) { int i; - for (i = 0; i < locator->nb_attributes; i++) + for (i = 0; i < locator->attr_count; i++) { SysFreeString(locator->attributes[i].szLocalname); locator->attributes[i].szLocalname = NULL; @@ -1450,19 +1455,19 @@ static HRESULT SAXAttributes_populate(saxlocator *locator, if ((locator->saxreader->features & NamespacePrefixes) == 0) nb_namespaces = 0; - locator->nb_attributes = nb_namespaces + nb_attributes; - if(locator->nb_attributes > locator->attributesSize) + locator->attr_count = nb_namespaces + nb_attributes; + if(locator->attr_count > locator->attr_alloc_count) { - int new_size = locator->attributesSize * 2; + int new_size = locator->attr_count * 2; attrs = heap_realloc_zero(locator->attributes, new_size * sizeof(struct _attributes)); if(!attrs) { free_attribute_values(locator); - locator->nb_attributes = 0; + locator->attr_count = 0; return E_OUTOFMEMORY; } locator->attributes = attrs; - locator->attributesSize = new_size; + locator->attr_alloc_count = new_size; } else { @@ -1706,7 +1711,7 @@ static void libxmlEndElementNS( if (!saxreader_has_handler(This, SAXContentHandler)) { free_attribute_values(This); - This->nb_attributes = 0; + This->attr_count = 0; free_element_entry(element); return; } @@ -1728,7 +1733,7 @@ static void libxmlEndElementNS( element->qname, SysStringLen(element->qname)); free_attribute_values(This); - This->nb_attributes = 0; + This->attr_count = 0; if (sax_callback_failed(This, hr)) { @@ -2326,7 +2331,7 @@ static ULONG WINAPI isaxlocator_Release( SysFreeString(This->systemId); SysFreeString(This->namespaceUri); - for(index=0; index<This->attributesSize; index++) + for(index = 0; index < This->attr_alloc_count; index++) { SysFreeString(This->attributes[index].szLocalname); SysFreeString(This->attributes[index].szValue); @@ -2462,9 +2467,9 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B return E_OUTOFMEMORY; } - locator->attributesSize = 8; - locator->nb_attributes = 0; - locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attributesSize); + locator->attr_alloc_count = 8; + locator->attr_count = 0; + locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attr_alloc_count); if(!locator->attributes) { ISAXXMLReader_Release(&reader->ISAXXMLReader_iface);
1
0
0
0
Jacek Caban : mshtml: Added IHTMLElement:scrollIntoView implementation.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: bf10dd3ee4d5df7c19245bbdbee68cb6327bd133 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf10dd3ee4d5df7c19245bbdb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jul 31 20:54:23 2014 +0200 mshtml: Added IHTMLElement:scrollIntoView implementation. --- dlls/mshtml/htmlelem.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 8378d74..a02baa7 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -851,8 +851,31 @@ static HRESULT WINAPI HTMLElement_get_onselectstart(IHTMLElement *iface, VARIANT static HRESULT WINAPI HTMLElement_scrollIntoView(IHTMLElement *iface, VARIANT varargStart) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); - return E_NOTIMPL; + cpp_bool start = TRUE; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&varargStart)); + + switch(V_VT(&varargStart)) { + case VT_EMPTY: + case VT_ERROR: + break; + case VT_BOOL: + start = V_BOOL(&varargStart) != VARIANT_FALSE; + break; + default: + FIXME("Unsupported argument %s\n", debugstr_variant(&varargStart)); + } + + if(!This->nselem) { + FIXME("Unsupported for comments\n"); + return E_NOTIMPL; + } + + nsres = nsIDOMHTMLElement_ScrollIntoView(This->nselem, start, 1); + assert(nsres == NS_OK); + + return S_OK; } static HRESULT WINAPI HTMLElement_contains(IHTMLElement *iface, IHTMLElement *pChild,
1
0
0
0
Nikolay Sivov : dwrite/tests: Added some tests for inline object and ranges handling.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: edf74c0b0d822c746d52054aaf04a265759eda0f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=edf74c0b0d822c746d52054aa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 30 21:16:34 2014 +0400 dwrite/tests: Added some tests for inline object and ranges handling. --- dlls/dwrite/tests/layout.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 8305c77..5ed2bf5 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -322,7 +322,7 @@ static void test_SetInlineObject(void) static const WCHAR strW[] = {'s','t','r','i','n','g',0}; static const WCHAR ruW[] = {'r','u',0}; - IDWriteInlineObject *inlineobj, *inlineobj2; + IDWriteInlineObject *inlineobj, *inlineobj2, *inlinetest; IDWriteTextFormat *format; IDWriteTextLayout *layout; DWRITE_TEXT_RANGE range; @@ -341,18 +341,54 @@ static void test_SetInlineObject(void) hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &inlineobj2); ok(hr == S_OK, "got 0x%08x\n", hr); + inlinetest = (void*)0x1; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(inlinetest == NULL, "got %p\n", inlineobj); +} range.startPosition = 0; range.length = 2; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range); todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + inlinetest = (void*)0x1; + hr = IDWriteTextLayout_GetInlineObject(layout, 2, &inlinetest, NULL); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(inlinetest == NULL, "got %p\n", inlinetest); +} + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj2, range); todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 1, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj2, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} + inlinetest = NULL; + hr = IDWriteTextLayout_GetInlineObject(layout, 0, &inlinetest, NULL); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); +if (hr == S_OK) { + ok(inlinetest == inlineobj, "got %p\n", inlinetest); + IDWriteInlineObject_Release(inlinetest); +} range.startPosition = 1; range.length = 1; hr = IDWriteTextLayout_SetInlineObject(layout, inlineobj, range);
1
0
0
0
Nikolay Sivov : dwrite: Store maximum width/height for text layout.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: 289043f4de77e4769a732c49d6a4c2074509392b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=289043f4de77e4769a732c49d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 30 19:59:07 2014 +0400 dwrite: Store maximum width/height for text layout. --- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/layout.c | 24 +++++++++++++++--------- dlls/dwrite/main.c | 4 ++-- dlls/dwrite/tests/layout.c | 9 ++++++++- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 99fcca3..8db35a3 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -81,7 +81,7 @@ extern HRESULT create_font_from_logfont(const LOGFONTW*, IDWriteFont**) DECLSPEC extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC_HIDDEN; extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; -extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,IDWriteTextLayout**) DECLSPEC_HIDDEN; +extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; extern HRESULT create_trimmingsign(IDWriteInlineObject**) DECLSPEC_HIDDEN; extern HRESULT get_gdiinterop(IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 2ed328b..57538f5 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -64,6 +64,8 @@ struct dwrite_textlayout { WCHAR *str; UINT32 len; struct dwrite_textformat_data format; + FLOAT maxwidth; + FLOAT maxheight; }; struct dwrite_textformat { @@ -338,15 +340,17 @@ static HRESULT WINAPI dwritetextlayout_GetLocaleName(IDWriteTextLayout *iface, W static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout *iface, FLOAT maxWidth) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%f): stub\n", This, maxWidth); - return E_NOTIMPL; + TRACE("(%p)->(%.1f)\n", This, maxWidth); + This->maxwidth = maxWidth; + return S_OK; } static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout *iface, FLOAT maxHeight) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p)->(%f): stub\n", This, maxHeight); - return E_NOTIMPL; + TRACE("(%p)->(%.1f)\n", This, maxHeight); + This->maxheight = maxHeight; + return S_OK; } static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout *iface, IDWriteFontCollection* collection, DWRITE_TEXT_RANGE range) @@ -436,15 +440,15 @@ static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout *iface, W static FLOAT WINAPI dwritetextlayout_GetMaxWidth(IDWriteTextLayout *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p): stub\n", This); - return 0.0; + TRACE("(%p)\n", This); + return This->maxwidth; } static FLOAT WINAPI dwritetextlayout_GetMaxHeight(IDWriteTextLayout *iface) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); - FIXME("(%p): stub\n", This); - return 0.0; + TRACE("(%p)\n", This); + return This->maxheight; } static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayout *iface, UINT32 pos, @@ -750,7 +754,7 @@ static void layout_format_from_textformat(struct dwrite_textlayout *layout, IDWr IDWriteTextFormat_GetFontCollection(format, &layout->format.collection); } -HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, IDWriteTextLayout **layout) +HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, IDWriteTextLayout **layout) { struct dwrite_textlayout *This; @@ -763,6 +767,8 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *forma This->ref = 1; This->str = heap_strdupnW(str, len); This->len = len; + This->maxwidth = maxwidth; + This->maxheight = maxheight; layout_format_from_textformat(This, format); *layout = &This->IDWriteTextLayout_iface; diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index cf3b530..357b41f 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -510,7 +510,7 @@ static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory *iface, WCHA TRACE("(%s %u %p %f %f %p)\n", debugstr_w(string), len, format, max_width, max_height, layout); if (!format) return E_INVALIDARG; - return create_textlayout(string, len, format, layout); + return create_textlayout(string, len, format, max_width, max_height, layout); } static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory *iface, WCHAR const* string, @@ -521,7 +521,7 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory pixels_per_dip, transform, use_gdi_natural, layout); if (!format) return E_INVALIDARG; - return create_textlayout(string, len, format, layout); + return create_textlayout(string, len, format, layout_width, layout_height, layout); } static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory *iface, IDWriteTextFormat *format, diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 07e5e20..8305c77 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -65,6 +65,7 @@ static void test_CreateGdiCompatibleTextLayout(void) static const WCHAR strW[] = {'s','t','r','i','n','g',0}; IDWriteTextLayout *layout; IDWriteTextFormat *format; + FLOAT dimension; HRESULT hr; hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, NULL, 0, NULL, 0.0, 0.0, 0.0, NULL, FALSE, &layout); @@ -102,8 +103,14 @@ static void test_CreateGdiCompatibleTextLayout(void) /* zero length string is okay */ hr = IDWriteFactory_CreateGdiCompatibleTextLayout(factory, strW, 0, format, 100.0, 100.0, 1.0, NULL, FALSE, &layout); ok(hr == S_OK, "got 0x%08x\n", hr); - IDWriteTextLayout_Release(layout); + dimension = IDWriteTextLayout_GetMaxWidth(layout); + ok(dimension == 100.0, "got %f\n", dimension); + + dimension = IDWriteTextLayout_GetMaxHeight(layout); + ok(dimension == 100.0, "got %f\n", dimension); + + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); }
1
0
0
0
Piotr Caban : msvcrt: Only check for flag presence in isatty function.
by Alexandre Julliard
04 Aug '14
04 Aug '14
Module: wine Branch: master Commit: d3a48ee3427fa458de2d3830d567c8f6ee0c682c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d3a48ee3427fa458de2d3830d…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jul 31 09:51:52 2014 -0500 msvcrt: Only check for flag presence in isatty function. --- dlls/msvcrt/file.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 0e5deba..7ce8b59 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -65,7 +65,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #define WX_PIPE 0x08 #define WX_DONTINHERIT 0x10 #define WX_APPEND 0x20 -#define WX_NOSEEK 0x40 +#define WX_TTY 0x40 #define WX_TEXT 0x80 /* values for exflag - it's used differently in msvcr90.dll*/ @@ -376,7 +376,7 @@ static int msvcrt_set_fd(HANDLE hand, int flag, int fd) } fdinfo->handle = hand; - fdinfo->wxflag = WX_OPEN | (flag & (WX_DONTINHERIT | WX_APPEND | WX_TEXT | WX_PIPE | WX_NOSEEK)); + fdinfo->wxflag = WX_OPEN | (flag & (WX_DONTINHERIT | WX_APPEND | WX_TEXT | WX_PIPE | WX_TTY)); fdinfo->lookahead[0] = '\n'; fdinfo->lookahead[1] = '\n'; fdinfo->lookahead[2] = '\n'; @@ -550,7 +550,7 @@ void msvcrt_init_io(void) HANDLE h = GetStdHandle(STD_INPUT_HANDLE); DWORD type = GetFileType(h); - msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_NOSEEK : 0) + msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0) |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0), MSVCRT_STDIN_FILENO); } @@ -559,7 +559,7 @@ void msvcrt_init_io(void) HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); DWORD type = GetFileType(h); - msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_NOSEEK : 0) + msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0) |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0), MSVCRT_STDOUT_FILENO); } @@ -568,7 +568,7 @@ void msvcrt_init_io(void) HANDLE h = GetStdHandle(STD_ERROR_HANDLE); DWORD type = GetFileType(h); - msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_NOSEEK : 0) + msvcrt_set_fd(h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0) |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0), MSVCRT_STDERR_FILENO); } @@ -607,13 +607,9 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file) */ int CDECL MSVCRT__isatty(int fd) { - HANDLE hand = msvcrt_fdtoh(fd); + TRACE(":fd (%d)\n",fd); - TRACE(":fd (%d) handle (%p)\n",fd,hand); - if (hand == INVALID_HANDLE_VALUE) - return 0; - - return GetFileType(hand) == FILE_TYPE_CHAR? 1 : 0; + return msvcrt_get_ioinfo(fd)->wxflag & WX_TTY; } /* INTERNAL: Allocate stdio file buffer */ @@ -2006,7 +2002,7 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int { DWORD access = 0, creation = 0, attrib; SECURITY_ATTRIBUTES sa; - DWORD sharing; + DWORD sharing, type; int wxflag; HANDLE hand; @@ -2139,6 +2135,12 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int oflags = check_bom(hand, oflags, TRUE); } + type = GetFileType(hand); + if (type == FILE_TYPE_CHAR) + wxflag |= WX_TTY; + else if (type == FILE_TYPE_PIPE) + wxflag |= WX_PIPE; + *fd = msvcrt_alloc_fd(hand, wxflag); if (*fd == -1) return *MSVCRT__errno(); @@ -2300,7 +2302,7 @@ int CDECL MSVCRT__open_osfhandle(MSVCRT_intptr_t handle, int oflags) } if (flags == FILE_TYPE_CHAR) - flags = WX_NOSEEK; + flags = WX_TTY; else if (flags == FILE_TYPE_PIPE) flags = WX_PIPE; else @@ -2424,7 +2426,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count) buf[0] = '\n'; else { buf[0] = '\r'; - if(fdinfo->wxflag & (WX_PIPE | WX_NOSEEK)) + if(fdinfo->wxflag & (WX_PIPE | WX_TTY)) fdinfo->lookahead[0] = lookahead; else SetFilePointer(fdinfo->handle, -1, NULL, FILE_CURRENT); @@ -2472,7 +2474,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count) if(char_len+i <= pos) i += char_len; - if(fdinfo->wxflag & (WX_PIPE | WX_NOSEEK)) { + if(fdinfo->wxflag & (WX_PIPE | WX_TTY)) { if(i < pos) fdinfo->lookahead[0] = readbuf[i]; if(i+1 < pos) @@ -2500,7 +2502,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count) if(lookahead != '\n') readbuf[j++] = '\r'; - if(fdinfo->wxflag & (WX_PIPE | WX_NOSEEK)) + if(fdinfo->wxflag & (WX_PIPE | WX_TTY)) fdinfo->lookahead[0] = lookahead; else SetFilePointer(fdinfo->handle, -1, NULL, FILE_CURRENT); @@ -2634,7 +2636,7 @@ static int read_i(int fd, void *buf, unsigned int count) if(utf16) bufstart[j++] = 0; } - if (fdinfo->wxflag & (WX_PIPE | WX_NOSEEK)) + if (fdinfo->wxflag & (WX_PIPE | WX_TTY)) { if (lookahead[0]=='\n' && (!utf16 || !lookahead[1])) {
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
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
Results per page:
10
25
50
100
200