ReactOS.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
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
List overview
Download
Ros-diffs
April 2012
----- 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
ros-diffs@reactos.org
11 participants
156 discussions
Start a n
N
ew thread
[tfaber] 56404: [AFD] - Fix broken IP address pointer arithmetic (CID 14130) [PCNET] - Fix incorrectly truncated FullDuplex BOOLEAN
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Apr 24 07:27:59 2012 New Revision: 56404 URL:
http://svn.reactos.org/svn/reactos?rev=56404&view=rev
Log: [AFD] - Fix broken IP address pointer arithmetic (CID 14130) [PCNET] - Fix incorrectly truncated FullDuplex BOOLEAN Modified: trunk/reactos/drivers/network/afd/afd/tdi.c trunk/reactos/drivers/network/dd/pcnet/pcnet.c Modified: trunk/reactos/drivers/network/afd/afd/tdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] Tue Apr 24 07:27:59 2012 @@ -848,9 +848,7 @@ if (SnmpInfo.NumAddr != 1) { /* Skip loopback address */ - PIPADDR_ENTRY IpAddressEntry = (PIPADDR_ENTRY) - ((PCHAR)IpAddress) + sizeof(IPADDR_ENTRY); - *Address = DN2H(IpAddressEntry->Addr); + *Address = DN2H(IpAddress[1].Addr); } else { /* Select the first address returned */ *Address = DN2H(IpAddress->Addr); Modified: trunk/reactos/drivers/network/dd/pcnet/pcnet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/dd/pcnet/p…
============================================================================== --- trunk/reactos/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/dd/pcnet/pcnet.c [iso-8859-1] Tue Apr 24 07:27:59 2012 @@ -1286,7 +1286,7 @@ NdisRawWritePortUshort(Adapter->PortOffset + RAP, BCR5); NdisRawReadPortUshort(Adapter->PortOffset + BDP, &Data); - return Data & BCR5_LEDOUT; + return (Data & BCR5_LEDOUT) != 0; } UINT
12 years, 8 months
1
0
0
0
[jimtabor] 56403: - Fix message regressions from 54637.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Apr 24 02:29:07 2012 New Revision: 56403 URL:
http://svn.reactos.org/svn/reactos?rev=56403&view=rev
Log: - Fix message regressions from 54637. Modified: trunk/reactos/win32ss/user/ntuser/message.c Modified: trunk/reactos/win32ss/user/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] Tue Apr 24 02:29:07 2012 @@ -1448,17 +1448,13 @@ LPARAM lParam) { ULONG_PTR Result = 0; - if (!co_IntSendMessageWithCallBack( hWnd, - Msg, - wParam, - lParam, - NULL, - 0, - &Result)) - { - Result = ((ULONG_PTR)-1); - } - return Result; + return co_IntSendMessageWithCallBack( hWnd, + Msg, + wParam, + lParam, + NULL, + 0, + &Result); } /* MSDN: If you send a message in the range below WM_USER to the asynchronous message @@ -1507,6 +1503,15 @@ RETURN(FALSE); } + if (Msg & 0x80000000 && + Window->head.pti->MessageQueue == Win32Thread->MessageQueue) + { + ERR("SMWCB: Internal Message!\n"); + Result = (ULONG_PTR)handle_internal_message( Window, Msg, wParam, lParam ); + if (uResult) *uResult = Result; + RETURN( TRUE); + } + /* See if this message type is present in the table */ MsgMemoryEntry = FindMsgMemory(Msg); if (NULL == MsgMemoryEntry) @@ -1532,14 +1537,6 @@ UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE); /* Never send messages to exiting threads */ RETURN(FALSE); - } - - if (Msg & 0x80000000) - { - ERR("SMWCB: Internal Message!\n"); - Result = (ULONG_PTR)handle_internal_message( Window, Msg, wParam, lParam ); - if (uResult) *uResult = Result; - RETURN( TRUE); } IntCallWndProc( Window, hWnd, Msg, wParam, lParam); @@ -1784,7 +1781,6 @@ else { Ret = co_IntSendMessageNoWait( hWnd, Msg, wParam, lParam); - if (-1 == (int) Ret || !Ret) Ret = FALSE; } return Ret; }
12 years, 8 months
1
0
0
0
[tkreuzer] 56402: [GDI32_APITEST] - Add more tests for GetObject and SelectObject - Fix a bug that made gcc builds crash
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 23 22:16:50 2012 New Revision: 56402 URL:
http://svn.reactos.org/svn/reactos?rev=56402&view=rev
Log: [GDI32_APITEST] - Add more tests for GetObject and SelectObject - Fix a bug that made gcc builds crash Modified: trunk/rostests/apitests/gdi32/GetObject.c trunk/rostests/apitests/gdi32/SelectObject.c Modified: trunk/rostests/apitests/gdi32/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Mon Apr 23 22:16:50 2012 @@ -22,6 +22,7 @@ } TestStruct; PLOGBRUSH plogbrush; HBRUSH hBrush; + INT ret; /* Test null pointer and invalid handles */ SetLastError(ERROR_SUCCESS); @@ -116,6 +117,7 @@ ok(GetLastError() == ERROR_INVALID_HANDLE, "\n"); /* Test need of alignment */ + SetLastError(ERROR_SUCCESS); hBrush = GetStockObject(WHITE_BRUSH); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush); ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n"); @@ -123,6 +125,29 @@ ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n"); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1); //ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n"); // fails on win7 + + /* Test invalid buffer */ + SetLastError(ERROR_SUCCESS); + ok(GetObjectA(hBrush, sizeof(LOGBRUSH), (PVOID)0xc0000000) == 0, "\n"); + ok(GetLastError() == ERROR_NOACCESS, "expected ERROR_NOACCESS, got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); + _SEH2_TRY + { + ret = GetObjectA(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), (PVOID)0xc0000000); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + ret = -1; + } + _SEH2_END + + ok(ret == -1, "should have got an exception\n"); + + SetLastError(ERROR_SUCCESS); + ok(GetObjectW(GetStockObject(SYSTEM_FONT), sizeof(LOGFONT), (PVOID)0xc0000000) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", GetLastError()); + + } void @@ -407,19 +432,22 @@ Test_Font(void) { HFONT hFont; - LOGFONTA logfonta; - LOGFONTW logfontw; - EXTLOGFONTA extlogfonta; - EXTLOGFONTW extlogfontw; - ENUMLOGFONTEXA enumlogfontexa; - ENUMLOGFONTEXW enumlogfontexw; - ENUMLOGFONTEXDVA enumlogfontexdva; - ENUMLOGFONTEXDVW enumlogfontexdvw; - ENUMLOGFONTA enumlogfonta; - ENUMLOGFONTW enumlogfontw; - BYTE bData[270]; - - FillMemory(&logfonta, sizeof(LOGFONTA), 0x77); + union + { + LOGFONTA logfonta; + LOGFONTW logfontw; + EXTLOGFONTA extlogfonta; + EXTLOGFONTW extlogfontw; + ENUMLOGFONTEXA enumlogfontexa; + ENUMLOGFONTEXW enumlogfontexw; + ENUMLOGFONTEXDVA enumlogfontexdva; + ENUMLOGFONTEXDVW enumlogfontexdvw; + ENUMLOGFONTA enumlogfonta; + ENUMLOGFONTW enumlogfontw; + BYTE bData[270]; + } u; + + FillMemory(&u, sizeof(u), 0x77); hFont = CreateFontA(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont"); @@ -446,70 +474,70 @@ ok(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA), "\n"); ok(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA), "\n"); ok(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA), "\n"); - ok(GetObjectA(hFont, 0, &logfonta) == 0, "\n"); - ok(logfonta.lfHeight == 0x77777777, "\n"); - - ok(GetObjectA(hFont, 5, &logfonta) == 5, "\n"); - ok(logfonta.lfHeight == 8, "\n"); - ok(logfonta.lfWidth == 0x77777708, "\n"); - - ok(GetObjectA(hFont, 0, &logfonta) == 0, "\n"); - ok(GetObjectA(hFont, -1, &logfonta) == sizeof(ENUMLOGFONTEXDVA), "\n"); - ok(GetObjectA(hFont, 1, &logfonta) == 1, "\n"); // 1 -> 1 - ok(GetObjectA(hFont, sizeof(LOGFONTA) - 1, &logfonta) == sizeof(LOGFONTA) - 1, "\n"); // 59 -> 59 - ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA), "\n"); // 60 -> 60 - ok(GetObjectA(hFont, sizeof(LOGFONTA) + 1, &logfonta) == sizeof(LOGFONTA) + 1, "\n"); // 61 -> 61 - ok(GetObjectA(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 91 -> 91 - ok(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA), "\n"); // 92 -> 60 - ok(GetObjectA(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 93 -> 93 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 -> 192 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1, "\n"); // 192+1 -> 192+1 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+16*4, &extlogfonta) == sizeof(EXTLOGFONTA)+16*4, "\n"); // 192+1 -> 192+1 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 320 -> 260 - ok(GetObjectA(hFont, 261, &bData) == 260, "\n"); // no - - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA) - 1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA) - 1, "\n"); // 419 - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 420 - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 356! + ok(GetObjectA(hFont, 0, &u.logfonta) == 0, "\n"); + ok(u.logfonta.lfHeight == 0x77777777, "\n"); + + ok(GetObjectA(hFont, 5, &u.logfonta) == 5, "\n"); + ok(u.logfonta.lfHeight == 8, "\n"); + ok(u.logfonta.lfWidth == 0x77777708, "\n"); + + ok(GetObjectA(hFont, 0, &u.logfonta) == 0, "\n"); + ok(GetObjectA(hFont, -1, &u.logfonta) == sizeof(ENUMLOGFONTEXDVA), "\n"); + ok(GetObjectA(hFont, 1, &u.logfonta) == 1, "\n"); // 1 -> 1 + ok(GetObjectA(hFont, sizeof(LOGFONTA) - 1, &u.logfonta) == sizeof(LOGFONTA) - 1, "\n"); // 59 -> 59 + ok(GetObjectA(hFont, sizeof(LOGFONTA), &u.logfonta) == sizeof(LOGFONTA), "\n"); // 60 -> 60 + ok(GetObjectA(hFont, sizeof(LOGFONTA) + 1, &u.logfonta) == sizeof(LOGFONTA) + 1, "\n"); // 61 -> 61 + ok(GetObjectA(hFont, sizeof(LOGFONTW) - 1, &u.logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 91 -> 91 + ok(GetObjectA(hFont, sizeof(LOGFONTW), &u.logfontw) == sizeof(LOGFONTA), "\n"); // 92 -> 60 + ok(GetObjectA(hFont, sizeof(LOGFONTW) + 1, &u.logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 93 -> 93 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &u.extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 -> 192 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &u.extlogfonta) == sizeof(EXTLOGFONTA)+1, "\n"); // 192+1 -> 192+1 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+16*4, &u.extlogfonta) == sizeof(EXTLOGFONTA)+16*4, "\n"); // 192+1 -> 192+1 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &u.extlogfontw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 320 -> 260 + ok(GetObjectA(hFont, 261, &u.bData) == 260, "\n"); // no + + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA) - 1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA) - 1, "\n"); // 419 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 420 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 356! /* LOGFONT / GetObjectW */ - FillMemory(&logfontw, sizeof(LOGFONTW), 0x77); + FillMemory(&u.logfontw, sizeof(LOGFONTW), 0x77); ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "1\n"); ok(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW), "\n"); - ok(GetObjectW(hFont, 0, &logfontw) == 0, "\n"); - ok(logfontw.lfHeight == 0x77777777, "\n"); - - ok(GetObjectW(hFont, 5, &logfontw) == 5, "\n"); - ok(logfontw.lfHeight == 8, "\n"); - ok(logfontw.lfWidth == 0x77777708, "\n"); - - ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA), "\n"); // 60 - ok(logfonta.lfHeight == 8, "\n"); - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA), "\n"); // 156 - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA), "\n"); // 188 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260 - ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260 - - ok(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW), "\n"); // 92 - ok(GetObjectW(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 92 - ok(GetObjectW(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 92 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW), "\n"); // 284 - ok(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW), "\n"); // 320 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW), "\n"); // 348 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW) + 1, &enumlogfontexw) == sizeof(ENUMLOGFONTEXW) + 1, "\n"); // 348 - ok(GetObjectW(hFont, 355, &enumlogfontexdvw) == 355, "\n"); // 419 - ok(GetObjectW(hFont, 356, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW) - 1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 420 - ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 356! - - ok(GetObjectW(hFont, 356, &bData) == 356, "\n"); - ok(GetObjectW(hFont, 357, &bData) == 356, "\n"); + ok(GetObjectW(hFont, 0, &u.logfontw) == 0, "\n"); + ok(u.logfontw.lfHeight == 0x77777777, "\n"); + + ok(GetObjectW(hFont, 5, &u.logfontw) == 5, "\n"); + ok(u.logfontw.lfHeight == 8, "\n"); + ok(u.logfontw.lfWidth == 0x77777708, "\n"); + + ok(GetObjectA(hFont, sizeof(LOGFONTA), &u.logfonta) == sizeof(LOGFONTA), "\n"); // 60 + ok(u.logfonta.lfHeight == 8, "\n"); + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &u.enumlogfonta) == sizeof(ENUMLOGFONTA), "\n"); // 156 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &u.enumlogfontexa) == sizeof(ENUMLOGFONTEXA), "\n"); // 188 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &u.extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &u.enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &u.enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260 + + ok(GetObjectW(hFont, sizeof(LOGFONTW), &u.logfontw) == sizeof(LOGFONTW), "\n"); // 92 + ok(GetObjectW(hFont, sizeof(LOGFONTW) + 1, &u.logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 92 + ok(GetObjectW(hFont, sizeof(LOGFONTW) - 1, &u.logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 92 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &u.enumlogfontw) == sizeof(ENUMLOGFONTW), "\n"); // 284 + ok(GetObjectW(hFont, sizeof(EXTLOGFONTW), &u.extlogfontw) == sizeof(EXTLOGFONTW), "\n"); // 320 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &u.enumlogfontexw) == sizeof(ENUMLOGFONTEXW), "\n"); // 348 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW) + 1, &u.enumlogfontexw) == sizeof(ENUMLOGFONTEXW) + 1, "\n"); // 348 + ok(GetObjectW(hFont, 355, &u.enumlogfontexdvw) == 355, "\n"); // 419 + ok(GetObjectW(hFont, 356, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW) - 1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 420 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 356! + + ok(GetObjectW(hFont, 356, &u.bData) == 356, "\n"); + ok(GetObjectW(hFont, 357, &u.bData) == 356, "\n"); ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); DeleteObject(hFont); Modified: trunk/rostests/apitests/gdi32/SelectObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SelectObje…
============================================================================== --- trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] Mon Apr 23 22:16:50 2012 @@ -121,6 +121,12 @@ /* Test EMF */ /* test METAFILE */ + SetLastError(ERROR_SUCCESS); + hNewObj = CreateMetaFile(NULL); + ok(hNewObj != 0, "failed to create a meta dc\n"); + hOldObj = SelectObject(hdc1, hNewObj); + RTEST(hOldObj == NULL); + ok_err(ERROR_SUCCESS); /* Test ENHMETAFILE */
12 years, 8 months
1
0
0
0
[tkreuzer] 56401: [GDI32/WIN32K] Fix some regressions from previous commit
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 23 21:22:12 2012 New Revision: 56401 URL:
http://svn.reactos.org/svn/reactos?rev=56401&view=rev
Log: [GDI32/WIN32K] Fix some regressions from previous commit Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c trunk/reactos/win32ss/gdi/gdi32/objects/dc.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] Mon Apr 23 21:22:12 2012 @@ -479,7 +479,8 @@ int nYExtent, LPSIZE lpSize) { - PDC_ATTR Dc_Attr; + PDC_ATTR pdcattr; + #if 0 if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) { @@ -500,39 +501,44 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; + pdcattr = GdiGetDcAttr(hdc); + if (!pdcattr) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } if (lpSize) { - lpSize->cx = Dc_Attr->szlWindowExt.cx; - lpSize->cy = Dc_Attr->szlWindowExt.cy; - if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; - } - - if (Dc_Attr->dwLayout & LAYOUT_RTL) + lpSize->cx = pdcattr->szlWindowExt.cx; + lpSize->cy = pdcattr->szlWindowExt.cy; + if (pdcattr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx; + } + + if (pdcattr->dwLayout & LAYOUT_RTL) { NtGdiMirrorWindowOrg(hdc); - Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); - } - else if ((Dc_Attr->iMapMode == MM_ISOTROPIC) || (Dc_Attr->iMapMode == MM_ANISOTROPIC)) - { - if ((Dc_Attr->szlWindowExt.cx == nXExtent) && (Dc_Attr->szlWindowExt.cy == nYExtent)) + pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); + } + else if ((pdcattr->iMapMode == MM_ISOTROPIC) || (pdcattr->iMapMode == MM_ANISOTROPIC)) + { + if ((pdcattr->szlWindowExt.cx == nXExtent) && (pdcattr->szlWindowExt.cy == nYExtent)) return TRUE; if ((!nXExtent) || (!nYExtent)) return FALSE; if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { - if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY) + if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY) { NtGdiFlush(); // Sync up Dc_Attr from Kernel space. - Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY); - } - } - Dc_Attr->szlWindowExt.cx = nXExtent; - Dc_Attr->szlWindowExt.cy = nYExtent; - if (Dc_Attr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc); - Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); + pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY); + } + } + pdcattr->szlWindowExt.cx = nXExtent; + pdcattr->szlWindowExt.cy = nYExtent; + if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc); + pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); } return TRUE; // Return TRUE. } Modified: trunk/reactos/win32ss/gdi/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] Mon Apr 23 21:22:12 2012 @@ -909,9 +909,6 @@ SetLastError(ERROR_INVALID_PARAMETER); return cbResult; - case GDI_OBJECT_TYPE_METADC: - return 0; - case GDI_OBJECT_TYPE_DC: case GDI_OBJECT_TYPE_REGION: case GDI_OBJECT_TYPE_EMF: @@ -1011,25 +1008,30 @@ COLORREF WINAPI SetDCPenColor( - HDC hdc, - COLORREF crColor -) -{ - PDC_ATTR Dc_Attr; - COLORREF OldColor = CLR_INVALID; - - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor; - else - { - OldColor = (COLORREF) Dc_Attr->ulPenClr; - Dc_Attr->ulPenClr = (ULONG) crColor; - - if ( Dc_Attr->crPenClr != crColor ) - { - Dc_Attr->ulDirty_ |= DIRTY_LINE; - Dc_Attr->crPenClr = crColor; - } - } + _In_ HDC hdc, + _In_ COLORREF crColor) +{ + PDC_ATTR pdcattr; + COLORREF OldColor; + + /* Get the dc attribute */ + pdcattr = GdiGetDcAttr(hdc); + if (!pdcattr) + { + SetLastError(ERROR_INVALID_PARAMETER); + return CLR_INVALID; + } + + /* Get old color and store the new */ + OldColor = (COLORREF)pdcattr->ulPenClr; + pdcattr->ulPenClr = (ULONG)crColor; + + if (pdcattr->crPenClr != crColor) + { + pdcattr->ulDirty_ |= DIRTY_LINE; + pdcattr->crPenClr = crColor; + } + return OldColor; } @@ -1438,129 +1440,135 @@ INT WINAPI SetMapMode( - HDC hdc, - INT Mode -) + _In_ HDC hdc, + _In_ INT iMode) +{ + PDC_ATTR pdcattr; + + pdcattr = GdiGetDcAttr(hdc); + if (!pdcattr) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + +#if 0 + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetMapMode(hdc, iMode); + else + { + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } +#endif + // Force change if Isotropic is set for recompute. + if ((iMode != pdcattr->iMapMode) || (iMode == MM_ISOTROPIC)) + { + pdcattr->ulDirty_ &= ~SLOW_WIDTHS; + return GetAndSetDCDWord( hdc, GdiGetSetMapMode, iMode, 0, 0, 0 ); + } + return pdcattr->iMapMode; +} + +/* + * @implemented + * + */ +int +WINAPI +GetStretchBltMode(HDC hdc) { PDC_ATTR Dc_Attr; if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->lStretchBltMode; +} + +/* + * @implemented + */ +int +WINAPI +SetStretchBltMode(HDC hdc, int iStretchMode) +{ + INT oSMode; + PDC_ATTR Dc_Attr; #if 0 - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetMapMode(hdc, Mode); + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetStretchBltMode( hdc, iStretchMode); else { - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return 0; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_SetStretchBltMode( hdc, iStretchMode); + } + } + } #endif - // Force change if Isotropic is set for recompute. - if ((Mode != Dc_Attr->iMapMode) || (Mode == MM_ISOTROPIC)) - { - Dc_Attr->ulDirty_ &= ~SLOW_WIDTHS; - return GetAndSetDCDWord( hdc, GdiGetSetMapMode, Mode, 0, 0, 0 ); - } - return Dc_Attr->iMapMode; - } - - /* - * @implemented - * - */ - int - WINAPI - GetStretchBltMode(HDC hdc) - { - PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; - return Dc_Attr->lStretchBltMode; - } - - /* - * @implemented - */ - int - WINAPI - SetStretchBltMode(HDC hdc, int iStretchMode) - { - INT oSMode; - PDC_ATTR Dc_Attr; -#if 0 - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetStretchBltMode( hdc, iStretchMode); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return 0; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_SetStretchBltMode( hdc, iStretchMode); - } - } - } -#endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; - - oSMode = Dc_Attr->lStretchBltMode; - Dc_Attr->lStretchBltMode = iStretchMode; - - // Wine returns an error here. We set the default. - if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode = WHITEONBLACK; - - Dc_Attr->jStretchBltMode = iStretchMode; - - return oSMode; - } - - /* - * @implemented - */ - HFONT - WINAPI - GetHFONT(HDC hdc) - { - PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; - return Dc_Attr->hlfntNew; - } - - - /* - * @implemented - * - */ - HGDIOBJ - WINAPI - SelectObject(HDC hDC, - HGDIOBJ hGdiObj) - { - PDC_ATTR pDc_Attr; - HGDIOBJ hOldObj = NULL; - UINT uType; - - if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) - { - SetLastError(ERROR_INVALID_HANDLE); - return NULL; - } - - hGdiObj = GdiFixUpHandle(hGdiObj); - if (!GdiIsHandleValid(hGdiObj)) - { - return NULL; - } - - uType = GDI_HANDLE_GET_TYPE(hGdiObj); - - switch (uType) - { + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; + + oSMode = Dc_Attr->lStretchBltMode; + Dc_Attr->lStretchBltMode = iStretchMode; + + // Wine returns an error here. We set the default. + if ((iStretchMode <= 0) || (iStretchMode > MAXSTRETCHBLTMODE)) iStretchMode = WHITEONBLACK; + + Dc_Attr->jStretchBltMode = iStretchMode; + + return oSMode; +} + +/* + * @implemented + */ +HFONT +WINAPI +GetHFONT(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; + return Dc_Attr->hlfntNew; +} + + +/* + * @implemented + * + */ +HGDIOBJ +WINAPI +SelectObject(HDC hDC, + HGDIOBJ hGdiObj) +{ + PDC_ATTR pDc_Attr; + HGDIOBJ hOldObj = NULL; + UINT uType; + + if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) + { + SetLastError(ERROR_INVALID_HANDLE); + return NULL; + } + + hGdiObj = GdiFixUpHandle(hGdiObj); + if (!GdiIsHandleValid(hGdiObj)) + { + return NULL; + } + + uType = GDI_HANDLE_GET_TYPE(hGdiObj); + + switch (uType) + { case GDI_OBJECT_TYPE_REGION: return (HGDIOBJ)ExtSelectClipRgn(hDC, hGdiObj, RGN_COPY); @@ -1618,10 +1626,10 @@ return NULL; case GDI_OBJECT_TYPE_PALETTE: + SetLastError(ERROR_INVALID_FUNCTION); default: - SetLastError(ERROR_INVALID_FUNCTION); return NULL; - } - - return NULL; - } + } + + return NULL; +}
12 years, 8 months
1
0
0
0
[tkreuzer] 56400: [GDI32/WIN32K] - Rewrite GetCurrentObject and GetObject, fixes a lot of tests
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 23 19:22:17 2012 New Revision: 56400 URL:
http://svn.reactos.org/svn/reactos?rev=56400&view=rev
Log: [GDI32/WIN32K] - Rewrite GetCurrentObject and GetObject, fixes a lot of tests Modified: trunk/reactos/win32ss/gdi/gdi32/misc/misc.c trunk/reactos/win32ss/gdi/gdi32/misc/stubs.c trunk/reactos/win32ss/gdi/gdi32/misc/stubsa.c trunk/reactos/win32ss/gdi/gdi32/objects/bitmap.c trunk/reactos/win32ss/gdi/gdi32/objects/dc.c trunk/reactos/win32ss/gdi/gdi32/objects/font.c trunk/reactos/win32ss/gdi/gdi32/objects/painting.c trunk/reactos/win32ss/gdi/gdi32/objects/palette.c trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c trunk/reactos/win32ss/gdi/ntgdi/font.c trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c Modified: trunk/reactos/win32ss/gdi/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/misc/mis…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/misc/misc.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -130,7 +130,6 @@ ((Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK) != ObjectType || (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != (ObjectType & GDI_ENTRY_BASETYPE_MASK)) { - SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } Modified: trunk/reactos/win32ss/gdi/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/misc/stu…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/misc/stubs.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -1131,7 +1131,7 @@ BOOL Ret = NtGdiGetETM(hdc, petm); if (Ret && petm) - petm->emKernPairs = GetKerningPairsA(hdc, 0, 0); + petm->emKernPairs = (WORD)GetKerningPairsA(hdc, 0, 0); return Ret; } Modified: trunk/reactos/win32ss/gdi/gdi32/misc/stubsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/misc/stu…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/misc/stubsa.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/misc/stubsa.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -61,7 +61,7 @@ if (GetICMProfileW(hdc, &buflen, filenameW)) { - int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL); + ULONG len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL); if (*pBufSize >= len) { WideCharToMultiByte(CP_ACP, 0, filenameW, -1, pszFilename, *pBufSize, NULL, NULL); Modified: trunk/reactos/win32ss/gdi/gdi32/objects/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/bitmap.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -554,7 +554,7 @@ if ( hOldBitmap ) { if ( hDC ) - hPal = SelectPalette(SavehDC, (HPALETTE)GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE), FALSE); + hPal = SelectPalette(SavehDC, (HPALETTE)GetCurrentObject(hDC, OBJ_PAL), FALSE); if ( lpbmi->bmiHeader.biSize < sizeof(BITMAPINFOHEADER)) { Modified: trunk/reactos/win32ss/gdi/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -412,83 +412,62 @@ return GetAndSetDCDWord( hdc, GdiGetSetArcDirection, nDirection, 0, 0, 0 ); } - +/* + * @implemented + * + */ HGDIOBJ WINAPI -GetDCObject( HDC hDC, INT iType) -{ - if((iType == GDI_OBJECT_TYPE_BRUSH) || - (iType == GDI_OBJECT_TYPE_EXTPEN)|| - (iType == GDI_OBJECT_TYPE_PEN) || - (iType == GDI_OBJECT_TYPE_COLORSPACE)) - { - HGDIOBJ hGO = NULL; - PDC_ATTR Dc_Attr; - - if (!hDC) return hGO; - - if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL; - - switch (iType) - { - case GDI_OBJECT_TYPE_BRUSH: - hGO = Dc_Attr->hbrush; +GetCurrentObject( + _In_ HDC hdc, + _In_ UINT uObjectType) +{ + PDC_ATTR pdcattr; + + /* Check if this is a user mode object */ + if ((uObjectType == OBJ_PEN) || + (uObjectType == OBJ_EXTPEN) || + (uObjectType == OBJ_BRUSH) || + (uObjectType == OBJ_COLORSPACE)) + { + /* Get the dc attribute */ + pdcattr = GdiGetDcAttr(hdc); + if (!pdcattr) return NULL; + } + + /* Check what object was requested */ + switch (uObjectType) + { + case OBJ_EXTPEN: + case OBJ_PEN: + return pdcattr->hpen; + + case OBJ_BRUSH: + return pdcattr->hbrush; + + case OBJ_COLORSPACE: + return pdcattr->hColorSpace; + + case OBJ_PAL: + uObjectType = GDI_OBJECT_TYPE_PALETTE; break; - case GDI_OBJECT_TYPE_EXTPEN: - case GDI_OBJECT_TYPE_PEN: - hGO = Dc_Attr->hpen; + case OBJ_FONT: + uObjectType = GDI_OBJECT_TYPE_FONT; break; - case GDI_OBJECT_TYPE_COLORSPACE: - hGO = Dc_Attr->hColorSpace; + case OBJ_BITMAP: + uObjectType = GDI_OBJECT_TYPE_BITMAP; break; - } - return hGO; - } - return NtGdiGetDCObject( hDC, iType ); -} - - -/* - * @implemented - * - */ -HGDIOBJ -WINAPI -GetCurrentObject(HDC hdc, - UINT uObjectType) -{ - switch(uObjectType) - { - case OBJ_EXTPEN: - case OBJ_PEN: - uObjectType = GDI_OBJECT_TYPE_PEN; - break; - case OBJ_BRUSH: - uObjectType = GDI_OBJECT_TYPE_BRUSH; - break; - case OBJ_PAL: - uObjectType = GDI_OBJECT_TYPE_PALETTE; - break; - case OBJ_FONT: - uObjectType = GDI_OBJECT_TYPE_FONT; - break; - case OBJ_BITMAP: - uObjectType = GDI_OBJECT_TYPE_BITMAP; - break; - case OBJ_COLORSPACE: - uObjectType = GDI_OBJECT_TYPE_COLORSPACE; - break; - /* tests show that OBJ_REGION is explicitly ignored */ - case OBJ_REGION: - return NULL; - /* the SDK only mentions those above */ - default: - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - return GetDCObject(hdc, uObjectType); + + /* All others are invalid */ + default: + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + /* Pass the request to win32k */ + return NtGdiGetDCObject(hdc, uObjectType); } /* @@ -774,8 +753,7 @@ LONG WINAPI GetDCOrg( - HDC hdc -) + HDC hdc) { // Officially obsolete by Microsoft POINT Pt; @@ -784,52 +762,169 @@ return(MAKELONG(Pt.x, Pt.y)); } - +ULONG +WINAPI +GetFontObjectW(HGDIOBJ hfont, ULONG cbSize, LPVOID lpBuffer) +{ + ENUMLOGFONTEXDVW elfedvW; + ULONG cbResult, cbMaxSize; + + /* Check if size only is requested */ + if (!lpBuffer) return sizeof(LOGFONTW); + + /* Check for size 0 */ + if (cbSize == 0) + { + /* Windows does not SetLastError() */ + return 0; + } + + /* Call win32k to get the logfont (widechar) */ + cbResult = NtGdiExtGetObjectW(hfont, sizeof(ENUMLOGFONTEXDVW), &elfedvW); + if (cbResult == 0) + { + return 0; + } + + /* Calculate the maximum size according to number of axes */ + cbMaxSize = FIELD_OFFSET(ENUMLOGFONTEXDVW, + elfDesignVector.dvValues[elfedvW.elfDesignVector.dvNumAxes]); + + /* Don't copy more than the maximum */ + if (cbSize > cbMaxSize) cbSize = cbMaxSize; + if (cbSize > cbResult) cbSize = cbResult; + + /* Copy the number of bytes requested */ + memcpy(lpBuffer, &elfedvW, cbSize); + + /* Return the number of bytes copied */ + return cbSize; +} + +ULONG +WINAPI +GetFontObjectA(HGDIOBJ hfont, ULONG cbSize, LPVOID lpBuffer) +{ + ENUMLOGFONTEXDVW elfedvW; + ENUMLOGFONTEXDVA elfedvA; + ULONG cbResult; + + /* Check if size only is requested */ + if (!lpBuffer) return sizeof(LOGFONTA); + + /* Check for size 0 */ + if (cbSize == 0) + { + /* Windows does not SetLastError() */ + return 0; + } + + /* Windows does this ... */ + if (cbSize == sizeof(LOGFONTW)) cbSize = sizeof(LOGFONTA); + + /* Call win32k to get the logfont (widechar) */ + cbResult = NtGdiExtGetObjectW(hfont, sizeof(ENUMLOGFONTEXDVW), &elfedvW); + if (cbResult == 0) + { + return 0; + } + + /* Convert the logfont from widechar to ansi */ + EnumLogFontExW2A(&elfedvA.elfEnumLogfontEx, &elfedvW.elfEnumLogfontEx); + elfedvA.elfDesignVector = elfedvW.elfDesignVector; + + /* Don't copy more than maximum */ + if (cbSize > sizeof(ENUMLOGFONTEXDVA)) cbSize = sizeof(ENUMLOGFONTEXDVA); + + /* Copy the number of bytes requested */ + memcpy(lpBuffer, &elfedvA, cbSize); + + /* Return the number of bytes copied */ + return cbSize; +} + +/* + * @implemented + */ int -GetNonFontObject(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) -{ - INT dwType; - - hGdiObj = (HANDLE)GdiFixUpHandle(hGdiObj); +WINAPI +GetObjectW(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) +{ + DWORD dwType; + INT cbResult = 0; + + hGdiObj = GdiFixUpHandle(hGdiObj); + + /* Get the object type */ dwType = GDI_HANDLE_GET_TYPE(hGdiObj); - if (!lpBuffer) // Should pass it all to Win32k and let god sort it out. ;^) - { - switch(dwType) - { + /* Check what kind of object we have */ + switch(dwType) + { case GDI_OBJECT_TYPE_PEN: - return sizeof(LOGPEN); + if (!lpBuffer) return sizeof(LOGPEN); + cbResult = NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + if (cbResult == 0) + SetLastError(ERROR_INVALID_PARAMETER); + return cbResult; + case GDI_OBJECT_TYPE_BRUSH: - return sizeof(LOGBRUSH); + if (!lpBuffer) return sizeof(LOGBRUSH); + cbResult = NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + if (cbResult == 0) + SetLastError(ERROR_INVALID_PARAMETER); + return cbResult; + case GDI_OBJECT_TYPE_BITMAP: - return sizeof(BITMAP); + if (!lpBuffer) return sizeof(BITMAP); + return NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + case GDI_OBJECT_TYPE_PALETTE: - return sizeof(WORD); - case GDI_OBJECT_TYPE_EXTPEN: /* we don't know the size, ask win32k */ - break; - } - } - - switch(dwType) - { - case GDI_OBJECT_TYPE_PEN: //Check the structures and see if A & W are the same. - case GDI_OBJECT_TYPE_EXTPEN: - case GDI_OBJECT_TYPE_BRUSH: // Mixing Apples and Oranges? - case GDI_OBJECT_TYPE_BITMAP: - case GDI_OBJECT_TYPE_PALETTE: - return NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); - - case GDI_OBJECT_TYPE_DC: - case GDI_OBJECT_TYPE_REGION: - case GDI_OBJECT_TYPE_METAFILE: - case GDI_OBJECT_TYPE_ENHMETAFILE: - case GDI_OBJECT_TYPE_EMF: - SetLastError(ERROR_INVALID_HANDLE); - } + if (!lpBuffer) return sizeof(WORD); + return NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + + case GDI_OBJECT_TYPE_FONT: + return GetFontObjectW(hGdiObj, cbSize, lpBuffer); + + case GDI_OBJECT_TYPE_EXTPEN: + /* we don't know the size, ask win32k */ + cbResult = NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + if (cbResult == 0) + { + if (!GdiIsHandleValid(hGdiObj)) + SetLastError(ERROR_INVALID_PARAMETER); + else if (cbSize == 0) + SetLastError(ERROR_NOACCESS); + } + return cbResult; + + case GDI_OBJECT_TYPE_COLORSPACE: + if ((cbSize < 328) || !lpBuffer) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + cbResult = NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); + if (cbResult == 0) + SetLastError(ERROR_INVALID_PARAMETER); + return cbResult; + + case GDI_OBJECT_TYPE_METADC: + return 0; + + case GDI_OBJECT_TYPE_DC: + case GDI_OBJECT_TYPE_REGION: + case GDI_OBJECT_TYPE_EMF: + case GDI_OBJECT_TYPE_METAFILE: + case GDI_OBJECT_TYPE_ENHMETAFILE: + SetLastError(ERROR_INVALID_HANDLE); + default: + return 0; + } + return 0; } - /* * @implemented */ @@ -837,113 +932,18 @@ WINAPI GetObjectA(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) { - ENUMLOGFONTEXDVW LogFont; - DWORD dwType; - INT Result = 0; - - dwType = GDI_HANDLE_GET_TYPE(hGdiObj); - - if(dwType == GDI_OBJECT_TYPE_COLORSPACE) //Stays here, processes struct A - { - SetLastError(ERROR_NOT_SUPPORTED); - return 0; - } - + DWORD dwType = GDI_HANDLE_GET_TYPE(hGdiObj); + + /* Chjeck if this is anything else but a font */ if (dwType == GDI_OBJECT_TYPE_FONT) { - if (!lpBuffer) - { - return sizeof(LOGFONTA); - } - if (cbSize == 0) - { - /* Windows does not SetLastError() */ - return 0; - } - // ENUMLOGFONTEXDVW is the default size and should be the structure for - // Entry->KernelData for Font objects. - Result = NtGdiExtGetObjectW(hGdiObj, sizeof(ENUMLOGFONTEXDVW), &LogFont); - - if (0 == Result) - { - return 0; - } - - switch (cbSize) - { - case sizeof(ENUMLOGFONTEXDVA): - // need to move more here. - case sizeof(ENUMLOGFONTEXA): - EnumLogFontExW2A( (LPENUMLOGFONTEXA) lpBuffer, &LogFont.elfEnumLogfontEx ); - break; - - case sizeof(ENUMLOGFONTA): - // Same here, maybe? Check the structures. - case sizeof(EXTLOGFONTA): - // Same here - case sizeof(LOGFONTA): - LogFontW2A((LPLOGFONTA) lpBuffer, &LogFont.elfEnumLogfontEx.elfLogFont); - break; - - default: - SetLastError(ERROR_BUFFER_OVERFLOW); - return 0; - } - return cbSize; - } - - return GetNonFontObject(hGdiObj, cbSize, lpBuffer); -} - - -/* - * @implemented - */ -int -WINAPI -GetObjectW(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer) -{ - DWORD dwType = GDI_HANDLE_GET_TYPE(hGdiObj); - INT Result = 0; - - /* - Check List: - MSDN, "This can be a handle to one of the following: logical bitmap, a brush, - a font, a palette, a pen, or a device independent bitmap created by calling - the CreateDIBSection function." - */ - if(dwType == GDI_OBJECT_TYPE_COLORSPACE) //Stays here, processes struct W - { - SetLastError(ERROR_NOT_SUPPORTED); // Not supported yet. - return 0; - } - - if (dwType == GDI_OBJECT_TYPE_FONT) - { - if (!lpBuffer) - { - return sizeof(LOGFONTW); - } - - if (cbSize == 0) - { - /* Windows does not SetLastError() */ - return 0; - } - // Poorly written apps are not ReactOS problem! - // We fix it here if the size is larger than the default size. - if( cbSize > (int)sizeof(ENUMLOGFONTEXDVW) ) cbSize = sizeof(ENUMLOGFONTEXDVW); - - Result = NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer); // Should handle the copy. - - if (0 == Result) - { - return 0; - } - return cbSize; - } - - return GetNonFontObject(hGdiObj, cbSize, lpBuffer); + return GetFontObjectA(hGdiObj, cbSize, lpBuffer); + } + else + { + /* Simply pass it to the widechar version */ + return GetObjectW(hGdiObj, cbSize, lpBuffer); + } } Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -88,8 +88,8 @@ ptmA->tmFirstChar = ptmW->tmDefaultChar - 1; ptmA->tmLastChar = min(ptmW->tmLastChar, 0xff); } - ptmA->tmDefaultChar = ptmW->tmDefaultChar; - ptmA->tmBreakChar = ptmW->tmBreakChar; + ptmA->tmDefaultChar = (CHAR)ptmW->tmDefaultChar; + ptmA->tmBreakChar = (CHAR)ptmW->tmBreakChar; ptmA->tmItalic = ptmW->tmItalic; ptmA->tmUnderlined = ptmW->tmUnderlined; ptmA->tmStruckOut = ptmW->tmStruckOut; @@ -503,7 +503,7 @@ DWORD dwFlags ) { - INT nSet; + ULONG nSet; SIZE Size = {0,0}; if ( !lpString || uCount <= 0 || (nMaxExtent < 0 && nMaxExtent != -1 ) ) @@ -1497,14 +1497,14 @@ logfont.lfEscapement = nEscapement; logfont.lfOrientation = nOrientation; logfont.lfWeight = nWeight; - logfont.lfItalic = fnItalic; - logfont.lfUnderline = fdwUnderline; - logfont.lfStrikeOut = fdwStrikeOut; - logfont.lfCharSet = fdwCharSet; - logfont.lfOutPrecision = fdwOutputPrecision; - logfont.lfClipPrecision = fdwClipPrecision; - logfont.lfQuality = fdwQuality; - logfont.lfPitchAndFamily = fdwPitchAndFamily; + logfont.lfItalic = (BYTE)fnItalic; + logfont.lfUnderline = (BYTE)fdwUnderline; + logfont.lfStrikeOut = (BYTE)fdwStrikeOut; + logfont.lfCharSet = (BYTE)fdwCharSet; + logfont.lfOutPrecision = (BYTE)fdwOutputPrecision; + logfont.lfClipPrecision = (BYTE)fdwClipPrecision; + logfont.lfQuality = (BYTE)fdwQuality; + logfont.lfPitchAndFamily = (BYTE)fdwPitchAndFamily; if (NULL != lpszFace) { Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -382,7 +382,7 @@ } #endif // Could just use Dc_Attr->hbrush? No. - HBRUSH hBrush = (HBRUSH) GetDCObject( hDC, GDI_OBJECT_TYPE_BRUSH); + HBRUSH hBrush = (HBRUSH)GetCurrentObject(hDC, OBJ_BRUSH); return NtGdiFillRgn( hDC, hRgn, hBrush); } Modified: trunk/reactos/win32ss/gdi/gdi32/objects/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/palette.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/palette.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -145,7 +145,7 @@ return MFDRV_(hDC); else { - HPALETTE Pal = GetDCObject(hDC, GDI_OBJECT_TYPE_PALETTE); + HPALETTE Pal = GetCurrentObject(hDC, OBJ_PAL); PLDC pLDC = GdiGetLDC((HDC) Pal); if ( !pLDC ) return FALSE; if (pLDC->iType == LDC_EMFLDC) return EMFDRV_(Pal); Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -461,7 +461,6 @@ if(!(pdc = DC_LockDc(hDC))) { - EngSetLastError(ERROR_INVALID_HANDLE); return NULL; } pdcattr = pdc->pdcattr; Modified: trunk/reactos/win32ss/gdi/ntgdi/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/font.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/font.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -74,7 +74,7 @@ } /* - + It is recommended that an application use the GetFontLanguageInfo function to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE, GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the @@ -102,7 +102,7 @@ INT *tmpDxCaretPos; LONG Cx; SIZE Size = {0,0}; - + DPRINT1("GreGCPW Start\n"); if (!pgcpw) @@ -126,7 +126,7 @@ if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos ) tmpDxCaretPos = gcpwSave.lpCaretPos; else - tmpDxCaretPos = gcpwSave.lpDx; + tmpDxCaretPos = gcpwSave.lpDx; if ( !GreGetTextExtentExW( hdc, pwsz, @@ -145,7 +145,7 @@ nSet = cSet; if ( tmpDxCaretPos && nSet > 0) - { + { for (i = (nSet - 1); i > 0; i--) { tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1]; @@ -161,7 +161,7 @@ { DWORD Count; LPKERNINGPAIR pKP; - + Count = GreGetKerningPairs( hdc, 0, NULL); if (Count) { @@ -262,41 +262,43 @@ INT FASTCALL -FontGetObject(PTEXTOBJ TFont, INT Count, PVOID Buffer) -{ - if( Buffer == NULL ) return sizeof(LOGFONTW); - - switch (Count) - { - case sizeof(ENUMLOGFONTEXDVW): - RtlCopyMemory( (LPENUMLOGFONTEXDVW) Buffer, - &TFont->logfont, - sizeof(ENUMLOGFONTEXDVW)); +FontGetObject(PTEXTOBJ TFont, INT cjBuffer, PVOID pvBuffer) +{ + if (pvBuffer == NULL) return sizeof(LOGFONTW); + + switch (cjBuffer) + { + case sizeof(ENUMLOGFONTEXDVW): + RtlCopyMemory(pvBuffer, + &TFont->logfont, + sizeof(ENUMLOGFONTEXDVW)); + break; + + case sizeof(ENUMLOGFONTEXW): + RtlCopyMemory(pvBuffer, + &TFont->logfont.elfEnumLogfontEx, + sizeof(ENUMLOGFONTEXW)); break; - case sizeof(ENUMLOGFONTEXW): - RtlCopyMemory( (LPENUMLOGFONTEXW) Buffer, - &TFont->logfont.elfEnumLogfontEx, - sizeof(ENUMLOGFONTEXW)); - break; - - case sizeof(EXTLOGFONTW): - case sizeof(ENUMLOGFONTW): - RtlCopyMemory((LPENUMLOGFONTW) Buffer, + + case sizeof(EXTLOGFONTW): + case sizeof(ENUMLOGFONTW): + RtlCopyMemory((LPENUMLOGFONTW) pvBuffer, &TFont->logfont.elfEnumLogfontEx.elfLogFont, sizeof(ENUMLOGFONTW)); - break; - - case sizeof(LOGFONTW): - RtlCopyMemory((LPLOGFONTW) Buffer, + break; + + case sizeof(LOGFONTW): + RtlCopyMemory((LPLOGFONTW) pvBuffer, &TFont->logfont.elfEnumLogfontEx.elfLogFont, sizeof(LOGFONTW)); - break; - - default: - EngSetLastError(ERROR_BUFFER_OVERFLOW); - return 0; - } - return Count; + break; + + default: + EngSetLastError(ERROR_BUFFER_OVERFLOW); + return 0; + } + + return cjBuffer; } DWORD @@ -928,7 +930,7 @@ /* Allocate a safe unicode string buffer */ cbStringSize = cwc * sizeof(WCHAR); - SafeFileNames.MaximumLength = SafeFileNames.Length = cbStringSize - sizeof(WCHAR); + SafeFileNames.MaximumLength = SafeFileNames.Length = (USHORT)cbStringSize - sizeof(WCHAR); SafeFileNames.Buffer = ExAllocatePoolWithTag(PagedPool, cbStringSize, 'RTSU'); Modified: trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] Mon Apr 23 19:22:17 2012 @@ -1021,7 +1021,6 @@ if (!pvObj) { DPRINT("GreGetObject: Could not lock object\n"); - EngSetLastError(ERROR_INVALID_HANDLE); return 0; }
12 years, 8 months
1
0
0
0
[jimtabor] 56399: - Safe to test SetForegroundWindow.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Apr 23 19:09:31 2012 New Revision: 56399 URL:
http://svn.reactos.org/svn/reactos?rev=56399&view=rev
Log: - Safe to test SetForegroundWindow. Modified: trunk/rostests/winetests/user32/win.c Modified: trunk/rostests/winetests/user32/win.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
============================================================================== --- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Mon Apr 23 19:09:31 2012 @@ -6924,10 +6924,7 @@ test_Expose(); test_layered_window(); - if(!winetest_interactive) - skip("skipping test_SetForegroundWindow, Hangs on WaitForSingleObject line 2771\n"); - else - test_SetForegroundWindow(hwndMain); + test_SetForegroundWindow(hwndMain); if(!winetest_interactive) skip("bug 5957: skipping test_shell_window, it crashes ros/win7 explorer\n"); else
12 years, 8 months
1
0
0
0
[tkreuzer] 56398: fix build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 23 19:06:10 2012 New Revision: 56398 URL:
http://svn.reactos.org/svn/reactos?rev=56398&view=rev
Log: fix build Modified: trunk/rostests/apitests/gdi32/GetObject.c Modified: trunk/rostests/apitests/gdi32/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Mon Apr 23 19:06:10 2012 @@ -519,7 +519,6 @@ Test_Colorspace(void) { UCHAR buffer[1000]; - int ret = 0; SetLastError(ERROR_SUCCESS); GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL);
12 years, 8 months
1
0
0
0
[tkreuzer] 56397: [GDI32_APITEST] - Add more tests for GetCurrentObject and GetObject - Comment out tests that fail on debug builds
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Apr 23 19:02:51 2012 New Revision: 56397 URL:
http://svn.reactos.org/svn/reactos?rev=56397&view=rev
Log: [GDI32_APITEST] - Add more tests for GetCurrentObject and GetObject - Comment out tests that fail on debug builds Modified: trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c trunk/rostests/apitests/gdi32/GetCurrentObject.c trunk/rostests/apitests/gdi32/GetObject.c Modified: trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/EngDeleteS…
============================================================================== --- trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c [iso-8859-1] Mon Apr 23 19:02:51 2012 @@ -33,8 +33,8 @@ { ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type); ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex); - ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); - ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); + //ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); + //ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); } /* test EngAcquireSemaphore and release it, then delete it */ @@ -58,8 +58,8 @@ { ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n", lpcrit->DebugInfo->Type); ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0, "DebugInfo->CreatorBackTraceIndex=%d\n", lpcrit->DebugInfo->CreatorBackTraceIndex); - ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); - ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); + //ok(lpcrit->DebugInfo->EntryCount != 0, "DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount); + //ok(lpcrit->DebugInfo->ContentionCount != 0, "DebugInfo->ContentionCount=%ld\n", lpcrit->DebugInfo->ContentionCount); } } Modified: trunk/rostests/apitests/gdi32/GetCurrentObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetCurrent…
============================================================================== --- trunk/rostests/apitests/gdi32/GetCurrentObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetCurrentObject.c [iso-8859-1] Mon Apr 23 19:02:51 2012 @@ -30,7 +30,7 @@ SetLastError(ERROR_SUCCESS); hObj = GetCurrentObject(NULL, 0); ok(hObj == 0, "Expected 0, got %p\n", hObj); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_SUCCESS, got %lu\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); SetLastError(ERROR_SUCCESS); hObj = GetCurrentObject(NULL, OBJ_BITMAP); @@ -49,9 +49,9 @@ /* Test invalid DC handle */ SetLastError(ERROR_SUCCESS); - hObj = GetCurrentObject((HDC)-123, 0); + hObj = GetCurrentObject((HDC)-123, OBJ_PEN); ok(hObj == 0, "Expected 0, got %p\n", hObj); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lu\n", GetLastError()); SetLastError(ERROR_SUCCESS); hObj = GetCurrentObject((HDC)-123, OBJ_BITMAP); @@ -65,7 +65,17 @@ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); SetLastError(ERROR_SUCCESS); + hObj = GetCurrentObject((HDC)-123, 0); + ok(hObj == 0, "Expected 0, got %p\n", hObj); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); + + SetLastError(ERROR_SUCCESS); hObj = GetCurrentObject(hDC, 3); + ok(hObj == 0, "Expected 0, got %p\n", hObj); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); + + SetLastError(ERROR_SUCCESS); + hObj = GetCurrentObject(NULL, 3); ok(hObj == 0, "Expected 0, got %p\n", hObj); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); Modified: trunk/rostests/apitests/gdi32/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Mon Apr 23 19:02:51 2012 @@ -29,6 +29,60 @@ ok(GetObjectA((HANDLE)-1, 0, NULL) == 0, "\n"); ok(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0, "\n"); ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok(GetObjectA((HANDLE)0x00380000, 10, &TestStruct) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00010000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00020000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00030000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00040000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00060000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00070000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x000B0000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x000C0000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x000D0000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x000E0000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x000F0000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00110000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00120000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00130000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00140000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00150000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)0x00160000, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); SetLastError(ERROR_SUCCESS); ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0, "\n"); @@ -68,7 +122,7 @@ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2); ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n"); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1); - ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n"); + //ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n"); // fails on win7 } void @@ -89,18 +143,24 @@ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP), "\n"); ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP), "\n"); ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP), "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); ok(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP), "\n"); ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n"); + ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); ok(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, 0, Buffer) == 0, "\n"); ok(GetObjectA(hBitmap, 5, Buffer) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); ok(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP), "\n"); ok(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP), "\n"); ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), &bitmap) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", GetLastError()); // todo: test invalid handle + buffer @@ -120,8 +180,11 @@ FillMemory(&dibsection, sizeof(DIBSECTION), 0x77); hDC = GetDC(0); hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pData, NULL, 0); - ok(hBitmap != 0, "CreateDIBSection failed, skipping tests.\n"); + ok(hBitmap != 0, "CreateDIBSection failed with %ld, skipping tests.\n", GetLastError()); if (!hBitmap) return; + + ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n"); + ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n"); SetLastError(ERROR_SUCCESS); ok(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n"); @@ -165,6 +228,9 @@ ok(hPalette != 0, "CreatePalette failed, skipping tests.\n"); if (!hPalette) return; + ok(GetObjectA((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD), "\n"); + ok(GetObjectW((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD), "\n"); + SetLastError(ERROR_SUCCESS); ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD), "\n"); ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD), "\n"); @@ -179,6 +245,9 @@ ok(GetObject(hPalette, -1, &wPalette) == sizeof(WORD), "\n"); ok(GetLastError() == ERROR_SUCCESS, "\n"); DeleteObject(hPalette); + ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, sizeof(WORD), &wPalette) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + } void @@ -200,19 +269,24 @@ ok(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH), "\n"); ok(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH), "\n"); - ok(GetObject(hBrush, 0, &logbrush) == 0, "\n"); + //ok(GetObject(hBrush, 0, &logbrush) == 0, "\n"); fails on win7 ok(logbrush.lbStyle == 0x77777777, "\n"); ok(GetObject(hBrush, 5, &logbrush) == sizeof(LOGBRUSH), "\n"); ok(logbrush.lbStyle == 0, "\n"); ok(logbrush.lbColor == 0x77777701, "\n"); ok(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH), "\n"); + ok(GetObject(hBrush, sizeof(LOGBRUSH) - 1, &logbrush) == sizeof(LOGBRUSH), "\n"); + ok(GetObject(hBrush, 1, &logbrush) == sizeof(LOGBRUSH), "\n"); ok(GetObject(hBrush, sizeof(LOGBRUSH)+2, &logbrush) == sizeof(LOGBRUSH), "\n"); ok(GetObject(hBrush, -1, &logbrush) == sizeof(LOGBRUSH), "\n"); // TODO: test all members ok(GetLastError() == ERROR_SUCCESS, "\n"); DeleteObject(hBrush); + + ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, sizeof(LOGBRUSH), &logbrush) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); } void @@ -237,11 +311,13 @@ ok(GetObject(hPen, sizeof(LOGPEN)+2, &logpen) == sizeof(LOGPEN), "\n"); ok(GetObject(hPen, 0, &logpen) == 0, "\n"); ok(GetObject(hPen, -5, &logpen) == sizeof(LOGPEN), "\n"); - ok(GetLastError() == ERROR_SUCCESS, "\n"); + //ok(GetLastError() == ERROR_SUCCESS, "\n"); fails on win7 /* test if the fields are filled correctly */ ok(logpen.lopnStyle == PS_SOLID, "\n"); + ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, sizeof(LOGPEN), &logpen) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); DeleteObject(hPen); } @@ -261,6 +337,8 @@ SetLastError(ERROR_SUCCESS); ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "\n"); + SetLastError(ERROR_SUCCESS); ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "\n"); @@ -270,15 +348,31 @@ logbrush.lbHatch = 22; hPen = ExtCreatePen(PS_GEOMETRIC | PS_DASH, 5, &logbrush, 0, NULL); + SetLastError(ERROR_SUCCESS); ok(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN, "\n"); - ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n"); ok(GetObject(hPen, sizeof(EXTLOGPEN), NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n"); ok(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n"); ok(GetObject((HANDLE)GDI_HANDLE_GET_INDEX(hPen), 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n"); ok(GetObject(hPen, 5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n"); ok(GetObject(hPen, -5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n"); + ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); ok(GetObject(hPen, 0, &extlogpen) == 0, "\n"); + ok(GetLastError() == ERROR_NOACCESS, "got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); ok(GetObject(hPen, 4, &extlogpen) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); + ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, &extlogpen) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); + ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 4, &extlogpen) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError()); + SetLastError(ERROR_SUCCESS); + ok(GetObject(hPen, sizeof(EXTLOGPEN) - 5, &extlogpen) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); /* Nothing should be filled */ ok(extlogpen.elpPenStyle == 0x77777777, "\n"); @@ -346,6 +440,7 @@ ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW), "\n"); // 348 ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW), "\n"); // 420 ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW), "\n"); // 356! + ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); ok(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA), "\n"); ok(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA), "\n"); @@ -358,20 +453,32 @@ ok(logfonta.lfHeight == 8, "\n"); ok(logfonta.lfWidth == 0x77777708, "\n"); - ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA), "\n"); // 60 - ok(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA), "\n"); // 92 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1, "\n"); // 192 - ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 320 - + ok(GetObjectA(hFont, 0, &logfonta) == 0, "\n"); + ok(GetObjectA(hFont, -1, &logfonta) == sizeof(ENUMLOGFONTEXDVA), "\n"); + ok(GetObjectA(hFont, 1, &logfonta) == 1, "\n"); // 1 -> 1 + ok(GetObjectA(hFont, sizeof(LOGFONTA) - 1, &logfonta) == sizeof(LOGFONTA) - 1, "\n"); // 59 -> 59 + ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA), "\n"); // 60 -> 60 + ok(GetObjectA(hFont, sizeof(LOGFONTA) + 1, &logfonta) == sizeof(LOGFONTA) + 1, "\n"); // 61 -> 61 + ok(GetObjectA(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 91 -> 91 + ok(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA), "\n"); // 92 -> 60 + ok(GetObjectA(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 93 -> 93 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 -> 192 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1, "\n"); // 192+1 -> 192+1 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+16*4, &extlogfonta) == sizeof(EXTLOGFONTA)+16*4, "\n"); // 192+1 -> 192+1 + ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 320 -> 260 ok(GetObjectA(hFont, 261, &bData) == 260, "\n"); // no + + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA) - 1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA) - 1, "\n"); // 419 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 420 + ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 356! /* LOGFONT / GetObjectW */ FillMemory(&logfontw, sizeof(LOGFONTW), 0x77); - ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "\n"); + ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "1\n"); ok(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW), "\n"); + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW), "\n"); ok(GetObjectW(hFont, 0, &logfontw) == 0, "\n"); ok(logfontw.lfHeight == 0x77777777, "\n"); @@ -389,14 +496,21 @@ ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260 ok(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW), "\n"); // 92 + ok(GetObjectW(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 92 + ok(GetObjectW(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 92 ok(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW), "\n"); // 284 ok(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW), "\n"); // 320 ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW), "\n"); // 348 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW) + 1, &enumlogfontexw) == sizeof(ENUMLOGFONTEXW) + 1, "\n"); // 348 + ok(GetObjectW(hFont, 355, &enumlogfontexdvw) == 355, "\n"); // 419 + ok(GetObjectW(hFont, 356, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 + ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW) - 1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419 ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 420 ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 356! ok(GetObjectW(hFont, 356, &bData) == 356, "\n"); - ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok(GetObjectW(hFont, 357, &bData) == 356, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); DeleteObject(hFont); } @@ -404,12 +518,25 @@ void Test_Colorspace(void) { - SetLastError(ERROR_SUCCESS); - ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60, "\n");// FIXME: what structure? + UCHAR buffer[1000]; + int ret = 0; + + SetLastError(ERROR_SUCCESS); + GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL); + //ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60, "\n");// FIXME: what structure? fails on win7 ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "\n"); SetLastError(ERROR_SUCCESS); ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0, "\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "\n"); + SetLastError(ERROR_SUCCESS); + ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 327, buffer) == 0, "\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); + ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 328, buffer) == 0, "\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + + ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 328, NULL) == 0, "\n"); + //ok(ret == 0, "Expected ... got %d\n", ret); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError()); } void @@ -417,7 +544,7 @@ { /* Windows does not SetLastError() on a metadc, but it doesn't seem to do anything with it */ HDC hMetaDC; - BYTE buffer[100]; + BYTE buffer[1000]; hMetaDC = CreateMetaFile(NULL); ok(hMetaDC != 0, "CreateMetaFile failed, skipping tests.\n"); @@ -429,8 +556,8 @@ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0, "\n"); ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0, "\n"); ok(GetObjectA(hMetaDC, 0, NULL) == 0, "\n"); - ok(GetObjectA(hMetaDC, 100, &buffer) == 0, "\n"); - ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok(GetObjectA(hMetaDC, 1000, &buffer) == 0, "\n"); + ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError()); } void
12 years, 8 months
1
0
0
0
[jimtabor] 56396: [Win32SS] - Desktop: Added code for server side switch over and some notes. Did not include desktopbg.c. - Focus: Fixes wine Win tests for SetParent, Active, Focus and Foreground....
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Apr 23 18:51:48 2012 New Revision: 56396 URL:
http://svn.reactos.org/svn/reactos?rev=56396&view=rev
Log: [Win32SS] - Desktop: Added code for server side switch over and some notes. Did not include desktopbg.c. - Focus: Fixes wine Win tests for SetParent, Active, Focus and Foreground. Leaving the wine todos. Msg tests improved. Pop up menus are still broken see bug 6751. The tests reflect these pop up menu issues. - WinPos: (WIP) Fixed MapWindowPoints. Arrange icons is still broken. SetWindowPos sets the foreground when it should. - Implemented AllowSetForegroundWindow and LockSetForegroundWindow. - Commit to reset base lines for RegTest ComCtl32 and related bugs. - Coding credits and complements go out to the Wine team. Modified: trunk/reactos/win32ss/include/ntuser.h trunk/reactos/win32ss/user/ntuser/desktop.c trunk/reactos/win32ss/user/ntuser/desktop.h trunk/reactos/win32ss/user/ntuser/focus.c trunk/reactos/win32ss/user/ntuser/focus.h trunk/reactos/win32ss/user/ntuser/input.c trunk/reactos/win32ss/user/ntuser/kbdlayout.c trunk/reactos/win32ss/user/ntuser/keyboard.c trunk/reactos/win32ss/user/ntuser/message.c trunk/reactos/win32ss/user/ntuser/misc.c trunk/reactos/win32ss/user/ntuser/mouse.c trunk/reactos/win32ss/user/ntuser/msgqueue.c trunk/reactos/win32ss/user/ntuser/msgqueue.h trunk/reactos/win32ss/user/ntuser/simplecall.c trunk/reactos/win32ss/user/ntuser/win32.h trunk/reactos/win32ss/user/ntuser/window.c trunk/reactos/win32ss/user/ntuser/winpos.c trunk/reactos/win32ss/user/user32/include/ntwrapper.h trunk/reactos/win32ss/user/user32/include/user32p.h trunk/reactos/win32ss/user/user32/windows/window.c trunk/reactos/win32ss/user/user32/windows/winpos.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
Modified: trunk/reactos/win32ss/user/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
Modified: trunk/reactos/win32ss/user/ntuser/desktop.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
Modified: trunk/reactos/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
Modified: trunk/reactos/win32ss/user/ntuser/focus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
Modified: trunk/reactos/win32ss/user/ntuser/input.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/input.…
Modified: trunk/reactos/win32ss/user/ntuser/kbdlayout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/kbdlay…
Modified: trunk/reactos/win32ss/user/ntuser/keyboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/keyboa…
Modified: trunk/reactos/win32ss/user/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
Modified: trunk/reactos/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
Modified: trunk/reactos/win32ss/user/ntuser/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/mouse.…
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
Modified: trunk/reactos/win32ss/user/ntuser/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/win32.…
Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
Modified: trunk/reactos/win32ss/user/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
Modified: trunk/reactos/win32ss/user/user32/include/ntwrapper.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/includ…
Modified: trunk/reactos/win32ss/user/user32/include/user32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/includ…
Modified: trunk/reactos/win32ss/user/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
Modified: trunk/reactos/win32ss/user/user32/windows/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
12 years, 8 months
1
0
0
0
[akhaldi] 56395: [PSDK] * Add the missing PWIN32_FIND_DATA type.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Apr 23 16:43:05 2012 New Revision: 56395 URL:
http://svn.reactos.org/svn/reactos?rev=56395&view=rev
Log: [PSDK] * Add the missing PWIN32_FIND_DATA type. Modified: trunk/reactos/include/psdk/winbase.h Modified: trunk/reactos/include/psdk/winbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winbase.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winbase.h [iso-8859-1] Mon Apr 23 16:43:05 2012 @@ -3148,7 +3148,7 @@ #ifdef UNICODE typedef STARTUPINFOW STARTUPINFO,*LPSTARTUPINFO; -typedef WIN32_FIND_DATAW WIN32_FIND_DATA,*LPWIN32_FIND_DATA; +typedef WIN32_FIND_DATAW WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA; typedef HW_PROFILE_INFOW HW_PROFILE_INFO,*LPHW_PROFILE_INFO; typedef ENUMRESLANGPROCW ENUMRESLANGPROC; typedef ENUMRESNAMEPROCW ENUMRESNAMEPROC; @@ -3355,7 +3355,7 @@ #define WriteProfileString WriteProfileStringW #else typedef STARTUPINFOA STARTUPINFO,*LPSTARTUPINFO; -typedef WIN32_FIND_DATAA WIN32_FIND_DATA,*LPWIN32_FIND_DATA; +typedef WIN32_FIND_DATAA WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA; typedef HW_PROFILE_INFOA HW_PROFILE_INFO,*LPHW_PROFILE_INFO; #if (_WIN32_WINNT >= 0x0501) typedef ACTCTXA ACTCTX,*PACTCTX;
12 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200