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
January 2010
----- 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
26 participants
522 discussions
Start a n
N
ew thread
[dgorbachev] 44914: Traditional and simplified Chinese translations of CSRSS by Samuel Lee (samuel_lee_1991 =AT= hotmail =DOT= com), bug #5082.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sun Jan 3 16:24:58 2010 New Revision: 44914 URL:
http://svn.reactos.org/svn/reactos?rev=44914&view=rev
Log: Traditional and simplified Chinese translations of CSRSS by Samuel Lee (samuel_lee_1991 =AT= hotmail =DOT= com), bug #5082. Added: trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-CN.rc (with props) trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-TW.rc (with props) Modified: trunk/reactos/subsystems/win32/csrss/win32csr/rsrc.rc Added: trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-CN.rc (added) +++ trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-CN.rc [iso-8859-1] Sun Jan 3 16:24:58 2010 @@ -1,0 +1,56 @@ +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED + +IDD_END_NOW DIALOGEX DISCARDABLE 0, 0, 200, 95 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÖÕÖ¹³ÌÐò - " +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "ÕýÔÚÖÕÖ¹³ÌÐò... ÇëµÈ´ý",IDC_STATIC,7,7,186,11 + CONTROL "½ø³Ì",IDC_PROGRESS,"msctls_progress32",WS_BORDER, + 7,20,186,13 + LTEXT "Èç¹ûÄúÑ¡ÔñÁ¢¼´ÖÕÖ¹³ÌÐò£¬Äú½«Ê§È¥ËùÓÐδ±£´æµÄÊý¾Ý¡£ÈôÒªÁ¢¼´½áÊø³ÌÐò£¬µ¥»÷¡°Á¢¼´ÖÕÖ¹¡±¡£", + IDC_STATIC,7,40,186,26 + DEFPUSHBUTTON "Á¢¼´ÖÕÖ¹(&E)",IDC_END_NOW,150,71,43,17 +END + +IDD_NOT_RESPONDING DIALOGEX DISCARDABLE 0, 0, 192, 122 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ÖÕÖ¹³ÌÐò - " +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "È¡Ïû",IDCANCEL,142,98,43,17 + PUSHBUTTON "Á¢¼´ÖÕÖ¹(&E)",IDC_END_NOW,78,98,43,17 + LTEXT "´Ë³ÌÐò²¢Î´ÏìÓ¦",IDC_STATIC,7,7,178,8 + LTEXT "ÈôÒª·µ»ØÖÁ ReactOS ²¢¼ì²é¸Ã³ÌÐòµÄ״̬£¬Çëµã»÷¡°È¡Ïû¡±¡£", + IDC_STATIC,7,26,178,16 + LTEXT "Èç¹ûÄúÑ¡ÔñÁ¢¼´ÖÕÖ¹³ÌÐò£¬Äú½«Ê§È¥ËùÓÐδ±£´æµÄÊý¾Ý¡£ÈôÒªÁ¢¼´½áÊø³ÌÐò£¬µ¥»÷¡°Á¢¼´ÖÕÖ¹¡±¡£", + IDC_STATIC,7,53,178,26 +END + +IDD_SWITCH_APP DIALOGEX 90, 90, 265, 170 +STYLE DS_SYSMODAL | DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE +EXSTYLE WS_EX_TOPMOST | WS_EX_WINDOWEDGE +FONT 9, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "",IDC_STATIC_CUR_APP,39,139,204,16,SS_SUNKEN,WS_EX_STATICEDGE +END + +STRINGTABLE +BEGIN + IDS_EDIT "±à¼" + IDS_MARK "±ê¼Ç" + IDS_COPY "¸´ÖÆ\tEnter" + IDS_PASTE "ð¤Ìù" + IDS_SELECTALL "È«²¿Ñ¡Ôñ" + IDS_SCROLL "¹ö¶¯" + IDS_FIND "²éÕÒ..." + IDS_DEFAULTS "ĬÈÏ" + IDS_PROPERTIES "ÊôÐÔ" + IDS_SCROLLHERE "¹ö¶¯µ½´Ë" + IDS_SCROLLTOP "¹ö¶¯ÖÁ¶¥¶Ë" + IDS_SCROLLBOTTOM "¹ö¶¯ÖÁÄ©¶Ë" + IDS_SCROLLPAGE_UP "ÉÏÒ»Ò³" + IDS_SCROLLPAGE_DOWN "ÏÂÒ»Ò³" + IDS_SCROLLUP "ÏòÉϹö¶¯" + IDS_SCROLLDOWN "ÏòϹö¶¯" +END Propchange: trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-CN.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-TW.rc (added) +++ trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-TW.rc [iso-8859-1] Sun Jan 3 16:24:58 2010 @@ -1,0 +1,56 @@ +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL + +IDD_END_NOW DIALOGEX DISCARDABLE 0, 0, 200, 95 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "µ²§ôµ{¦¡" +FONT 9, "MS Shell Dlg" +BEGIN + LTEXT "¥¿¦bµ²§ôµ{¦¡... ½Ðµyµ¥",IDC_STATIC,7,7,186,11 + CONTROL "Progress",IDC_PROGRESS,"msctls_progress32",WS_BORDER, + 7,20,186,13 + LTEXT "¦pªG±z¿ï¾Ü¥ß§Yµ²§ôµ{¦¡¡A±z±N¥¢¥h©Ò¦³¥¼Àx¦sªº¸ê®Æ¡CYn¥ß§Yµ²§ôµ{¦¡¡A½Ð«ö¤U¡§¥ß§Yµ²§ô¡¨¡C", + IDC_STATIC,7,40,186,26 + DEFPUSHBUTTON "¥ß§Yµ²§ô(&E)",IDC_END_NOW,150,71,43,17 +END + +IDD_NOT_RESPONDING DIALOGEX DISCARDABLE 0, 0, 192, 122 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "µ²§ôµ{¦¡ - " +FONT 9, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "¨ú®ø",IDCANCEL,142,98,43,17 + PUSHBUTTON "¥ß§Yµ²§ô(&E) ",IDC_END_NOW,78,98,43,17 + LTEXT "¦¹µ{¦¡¨Ã¥¼ÅTÀ³",IDC_STATIC,7,7,178,8 + LTEXT "Ynªð¦^¦Ü ReactOS ¨ÃÀ˵øµ{¦¡ªºª¬ºA¡A½Ð«ö¤U¡§¨ú®ø¡¨", + IDC_STATIC,7,26,178,16 + LTEXT "¦pªG±z¿ï¾Ü¥ß§Yµ²§ôµ{¦¡¡A±z±N¥¢¥h©Ò¦³¥¼Àx¦sªº¸ê®Æ¡CYn¥ß§Yµ²§ôµ{¦¡¡A½Ð«ö¤U¡§¥ß§Yµ²§ô¡¨¡C", + IDC_STATIC,7,53,178,26 +END + +IDD_SWITCH_APP DIALOGEX 90, 90, 265, 170 +STYLE DS_SYSMODAL | DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE +EXSTYLE WS_EX_TOPMOST | WS_EX_WINDOWEDGE +FONT 9, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "",IDC_STATIC_CUR_APP,39,139,204,16,SS_SUNKEN,WS_EX_STATICEDGE +END + +STRINGTABLE +BEGIN + IDS_EDIT "½s¿è" + IDS_MARK "¼Ð°O" + IDS_COPY "½Æ»s\tEnter" + IDS_PASTE "ÂH¶K" + IDS_SELECTALL "¥þ³¡¿ï¾Ü" + IDS_SCROLL "ºu°Ê" + IDS_FIND "´M§ä..." + IDS_DEFAULTS "¹w³]" + IDS_PROPERTIES "ÄÝ©Ê" + IDS_SCROLLHERE "ºu°Ê¨ì¦¹ " + IDS_SCROLLTOP "ºu°Ê¨ì³»¸m" + IDS_SCROLLBOTTOM "ºu°Ê¨ì¥½ºÝ" + IDS_SCROLLPAGE_UP "¤W¤@¶" + IDS_SCROLLPAGE_DOWN "¤U¤@¶" + IDS_SCROLLUP "¦V¤Wºu°Ê" + IDS_SCROLLDOWN "¦V¤Uºu°Ê" +END Propchange: trunk/reactos/subsystems/win32/csrss/win32csr/lang/zh-TW.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/subsystems/win32/csrss/win32csr/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/rsrc.rc [iso-8859-1] Sun Jan 3 16:24:58 2010 @@ -18,3 +18,6 @@ #include "lang/ru-RU.rc" #include "lang/sk-SK.rc" #include "lang/uk-UA.rc" +#include "lang/zh-CN.rc" +#include "lang/zh-TW.rc" +
14 years, 11 months
1
0
0
0
[ekohl] 44913: - Copy property data to the user-mode buffer. - Return the enumerator name without trailing backslash.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jan 3 16:24:16 2010 New Revision: 44913 URL:
http://svn.reactos.org/svn/reactos?rev=44913&view=rev
Log: - Copy property data to the user-mode buffer. - Return the enumerator name without trailing backslash. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Sun Jan 3 16:24:16 2010 @@ -268,7 +268,7 @@ { _SEH2_TRY { - memcpy(Buffer, PropertyData->Buffer, BufferSize); + memcpy(PropertyData->Buffer, Buffer, BufferSize); PropertyData->BufferSize = BufferSize; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sun Jan 3 16:24:16 2010 @@ -3236,7 +3236,7 @@ * always contains the enumerator name followed by \\ */ Ptr = wcschr(DeviceNode->InstancePath.Buffer, L'\\'); ASSERT(Ptr); - Length = (Ptr - DeviceNode->InstancePath.Buffer + 1) * sizeof(WCHAR); + Length = (Ptr - DeviceNode->InstancePath.Buffer) * sizeof(WCHAR); Data = DeviceNode->InstancePath.Buffer; break;
14 years, 11 months
1
0
0
0
[ekohl] 44912: Fix indentation. No code changes.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jan 3 16:20:09 2010 New Revision: 44912 URL:
http://svn.reactos.org/svn/reactos?rev=44912&view=rev
Log: Fix indentation. No code changes. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Sun Jan 3 16:20:09 2010 @@ -18,8 +18,8 @@ typedef struct _PNP_EVENT_ENTRY { - LIST_ENTRY ListEntry; - PLUGPLAY_EVENT_BLOCK Event; + LIST_ENTRY ListEntry; + PLUGPLAY_EVENT_BLOCK Event; } PNP_EVENT_ENTRY, *PPNP_EVENT_ENTRY; @@ -95,21 +95,21 @@ static NTSTATUS IopRemovePlugPlayEvent(VOID) { - /* Remove a pnp event entry from the tail of the queue */ - if (!IsListEmpty(&IopPnpEventQueueHead)) - { - ExFreePool(RemoveTailList(&IopPnpEventQueueHead)); - } - - /* Signal the next pnp event in the queue */ - if (!IsListEmpty(&IopPnpEventQueueHead)) - { - KeSetEvent(&IopPnpNotifyEvent, - 0, - FALSE); - } - - return STATUS_SUCCESS; + /* Remove a pnp event entry from the tail of the queue */ + if (!IsListEmpty(&IopPnpEventQueueHead)) + { + ExFreePool(RemoveTailList(&IopPnpEventQueueHead)); + } + + /* Signal the next pnp event in the queue */ + if (!IsListEmpty(&IopPnpEventQueueHead)) + { + KeSetEvent(&IopPnpNotifyEvent, + 0, + FALSE); + } + + return STATUS_SUCCESS; } static PDEVICE_OBJECT @@ -148,8 +148,7 @@ return NULL; if (DeviceInstance == NULL || - DeviceInstance->Length == 0 - ) + DeviceInstance->Length == 0) { if (IopRootDeviceNode->PhysicalDeviceObject) { @@ -173,35 +172,39 @@ Name.Buffer = NULL; _SEH2_TRY { - Name.Length = SrcName->Length; - Name.MaximumLength = SrcName->MaximumLength; - if (Name.Length > Name.MaximumLength) - { - Status = STATUS_INVALID_PARAMETER; - _SEH2_LEAVE; - } - if (Name.MaximumLength) - { - ProbeForRead(SrcName->Buffer, - Name.MaximumLength, - sizeof(WCHAR)); - Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength); - if (Name.Buffer == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - _SEH2_LEAVE; - } - memcpy(Name.Buffer, SrcName->Buffer, Name.MaximumLength); - } - *DstName = Name; + Name.Length = SrcName->Length; + Name.MaximumLength = SrcName->MaximumLength; + if (Name.Length > Name.MaximumLength) + { + Status = STATUS_INVALID_PARAMETER; + _SEH2_LEAVE; + } + + if (Name.MaximumLength) + { + ProbeForRead(SrcName->Buffer, + Name.MaximumLength, + sizeof(WCHAR)); + Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength); + if (Name.Buffer == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + _SEH2_LEAVE; + } + + memcpy(Name.Buffer, SrcName->Buffer, Name.MaximumLength); + } + + *DstName = Name; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (Name.Buffer) ExFreePool(Name.Buffer); + if (Name.Buffer) + ExFreePool(Name.Buffer); Status = _SEH2_GetExceptionCode(); } _SEH2_END; - + return Status; } @@ -221,12 +224,12 @@ Status = IopCaptureUnicodeString(&DeviceInstance, &PropertyData->DeviceInstance); if (!NT_SUCCESS(Status)) { - return Status; + return Status; } _SEH2_TRY { - Property = PropertyData->Property; + Property = PropertyData->Property; BufferSize = PropertyData->BufferSize; ProbeForWrite(PropertyData->Buffer, BufferSize, @@ -238,7 +241,7 @@ _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; - + /* Get the device object */ DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance); ExFreePool(DeviceInstance.Buffer); @@ -250,9 +253,8 @@ Buffer = ExAllocatePool(NonPagedPool, BufferSize); if (Buffer == NULL) { - return STATUS_INSUFFICIENT_RESOURCES; - } - + return STATUS_INSUFFICIENT_RESOURCES; + } Status = IoGetDeviceProperty(DeviceObject, Property, @@ -264,17 +266,18 @@ if (NT_SUCCESS(Status)) { - _SEH2_TRY - { - memcpy(Buffer, PropertyData->Buffer, BufferSize); - PropertyData->BufferSize = BufferSize; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - } + _SEH2_TRY + { + memcpy(Buffer, PropertyData->Buffer, BufferSize); + PropertyData->BufferSize = BufferSize; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + } + ExFreePool(Buffer); return Status; } @@ -298,16 +301,16 @@ Status = IopCaptureUnicodeString(&TargetDeviceInstance, &RelatedDeviceData->TargetDeviceInstance); if (!NT_SUCCESS(Status)) { - return Status; + return Status; } _SEH2_TRY { - Relation = RelatedDeviceData->Relation; - MaximumLength = RelatedDeviceData->RelatedDeviceInstanceLength; - ProbeForWrite(RelatedDeviceData->RelatedDeviceInstance, - MaximumLength, - sizeof(WCHAR)); + Relation = RelatedDeviceData->Relation; + MaximumLength = RelatedDeviceData->RelatedDeviceInstanceLength; + ProbeForWrite(RelatedDeviceData->RelatedDeviceInstance, + MaximumLength, + sizeof(WCHAR)); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -323,13 +326,13 @@ TRUE)) { DeviceNode = IopRootDeviceNode; - ExFreePool(TargetDeviceInstance.Buffer); + ExFreePool(TargetDeviceInstance.Buffer); } else { /* Get the device object */ DeviceObject = IopGetDeviceObjectFromDeviceInstance(&TargetDeviceInstance); - ExFreePool(TargetDeviceInstance.Buffer); + ExFreePool(TargetDeviceInstance.Buffer); if (DeviceObject == NULL) return STATUS_NO_SUCH_DEVICE; @@ -424,12 +427,12 @@ _SEH2_TRY { - Operation = StatusData->Operation; - if (Operation == PNP_SET_DEVICE_STATUS) - { - DeviceStatus = StatusData->DeviceStatus; - DeviceProblem = StatusData->DeviceProblem; - } + Operation = StatusData->Operation; + if (Operation == PNP_SET_DEVICE_STATUS) + { + DeviceStatus = StatusData->DeviceStatus; + DeviceProblem = StatusData->DeviceProblem; + } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -469,16 +472,16 @@ if (Operation == PNP_GET_DEVICE_STATUS) { - _SEH2_TRY - { - StatusData->DeviceStatus = DeviceStatus; - StatusData->DeviceProblem = DeviceProblem; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; + _SEH2_TRY + { + StatusData->DeviceStatus = DeviceStatus; + StatusData->DeviceProblem = DeviceProblem; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; } return Status; @@ -499,7 +502,7 @@ Status = IopCaptureUnicodeString(&DeviceInstance, &DepthData->DeviceInstance); if (!NT_SUCCESS(Status)) { - return Status; + return Status; } /* Get the device object */ @@ -512,7 +515,7 @@ _SEH2_TRY { - DepthData->Depth = DeviceNode->Level; + DepthData->Depth = DeviceNode->Level; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -630,59 +633,59 @@ OUT PPLUGPLAY_EVENT_BLOCK Buffer, IN ULONG BufferSize) { - PPNP_EVENT_ENTRY Entry; - NTSTATUS Status; - - DPRINT("NtGetPlugPlayEvent() called\n"); - - /* Function can only be called from user-mode */ - if (KeGetPreviousMode() == KernelMode) - { - DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n"); - return STATUS_ACCESS_DENIED; - } - - /* Check for Tcb privilege */ - if (!SeSinglePrivilegeCheck(SeTcbPrivilege, - UserMode)) - { - DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); - return STATUS_PRIVILEGE_NOT_HELD; - } - - /* Wait for a PnP event */ - DPRINT("Waiting for pnp notification event\n"); - Status = KeWaitForSingleObject(&IopPnpNotifyEvent, - UserRequest, - KernelMode, - FALSE, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status); - return Status; - } - - /* Get entry from the tail of the queue */ - Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink, - PNP_EVENT_ENTRY, - ListEntry); - - /* Check the buffer size */ - if (BufferSize < Entry->Event.TotalSize) - { - DPRINT1("Buffer is too small for the pnp-event\n"); - return STATUS_BUFFER_TOO_SMALL; - } - - /* Copy event data to the user buffer */ - memcpy(Buffer, - &Entry->Event, - Entry->Event.TotalSize); - - DPRINT("NtGetPlugPlayEvent() done\n"); - - return STATUS_SUCCESS; + PPNP_EVENT_ENTRY Entry; + NTSTATUS Status; + + DPRINT("NtGetPlugPlayEvent() called\n"); + + /* Function can only be called from user-mode */ + if (KeGetPreviousMode() == KernelMode) + { + DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n"); + return STATUS_ACCESS_DENIED; + } + + /* Check for Tcb privilege */ + if (!SeSinglePrivilegeCheck(SeTcbPrivilege, + UserMode)) + { + DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); + return STATUS_PRIVILEGE_NOT_HELD; + } + + /* Wait for a PnP event */ + DPRINT("Waiting for pnp notification event\n"); + Status = KeWaitForSingleObject(&IopPnpNotifyEvent, + UserRequest, + KernelMode, + FALSE, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status); + return Status; + } + + /* Get entry from the tail of the queue */ + Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink, + PNP_EVENT_ENTRY, + ListEntry); + + /* Check the buffer size */ + if (BufferSize < Entry->Event.TotalSize) + { + DPRINT1("Buffer is too small for the pnp-event\n"); + return STATUS_BUFFER_TOO_SMALL; + } + + /* Copy event data to the user buffer */ + memcpy(Buffer, + &Entry->Event, + Entry->Event.TotalSize); + + DPRINT("NtGetPlugPlayEvent() done\n"); + + return STATUS_SUCCESS; } /*
14 years, 11 months
1
0
0
0
[mkupfer] 44911: - add some German translations
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sun Jan 3 14:34:20 2010 New Revision: 44911 URL:
http://svn.reactos.org/svn/reactos?rev=44911&view=rev
Log: - add some German translations Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc Modified: trunk/reactos/base/applications/rapps/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/la…
============================================================================== --- trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/lang/de-DE.rc [iso-8859-1] Sun Jan 3 14:34:20 2010 @@ -14,7 +14,7 @@ MENUITEM "&Deinstallieren",ID_UNINSTALL MENUITEM "&Ändern", ID_MODIFY MENUITEM SEPARATOR - MENUITEM "&Remove from Registry", ID_REGREMOVE + MENUITEM "Aus &Registry entfernen", ID_REGREMOVE MENUITEM SEPARATOR MENUITEM "&Aktualisieren", ID_REFRESH END @@ -50,23 +50,23 @@ IDD_SETTINGS_DIALOG DIALOGEX DISCARDABLE 0, 0, 250, 144 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Settings" +CAPTION "Einstellungen" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "General", -1, 4, 2, 240, 61 - AUTOCHECKBOX "&Save window position", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 - AUTOCHECKBOX "&Update the list of accessible programs at start", IDC_UPDATE_AVLIST, 15, 29, 219, 12 - AUTOCHECKBOX "&Log of installation and removal of programs", IDC_LOG_ENABLED, 15, 46, 219, 12 + GROUPBOX "Allgemein", -1, 4, 2, 240, 61 + AUTOCHECKBOX "Fensterposition &speichern", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 + AUTOCHECKBOX "Beim Start Liste der verfügbaren Programme &aktualisieren", IDC_UPDATE_AVLIST, 15, 29, 219, 12 + AUTOCHECKBOX "Hinzufügen und Entfernen von Programmen mit&loggen", IDC_LOG_ENABLED, 15, 46, 219, 12 - GROUPBOX "Downloading", -1, 4, 65, 240, 51 - LTEXT "Folder for downloadings:", -1, 16, 75, 100, 9 + GROUPBOX "Download", -1, 4, 65, 240, 51 + LTEXT "Ordner für Downloads:", -1, 16, 75, 100, 9 EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP - PUSHBUTTON "&Choose", IDC_CHOOSE, 187, 85, 50, 14 - AUTOCHECKBOX "&Delete installers of programs after installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 + PUSHBUTTON "&Wählen", IDC_CHOOSE, 187, 85, 50, 14 + AUTOCHECKBOX "&Installer nach Programminstallation löschen", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 - PUSHBUTTON "Default", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 + PUSHBUTTON "Vorgabe", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 PUSHBUTTON "OK", IDOK, 116, 124, 60, 14 - PUSHBUTTON "Cancel", IDCANCEL, 181, 124, 60, 14 + PUSHBUTTON "Abbrechen", IDCANCEL, 181, 124, 60, 14 END IDD_INSTALL_DIALOG DIALOGEX DISCARDABLE 0, 0, 216, 97
14 years, 11 months
1
0
0
0
[cwittich] 44910: [crypt32_winetest] sync crypt32_winetest to wine 1.1.35
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 12:59:59 2010 New Revision: 44910 URL:
http://svn.reactos.org/svn/reactos?rev=44910&view=rev
Log: [crypt32_winetest] sync crypt32_winetest to wine 1.1.35 Modified: trunk/rostests/winetests/crypt32/cert.c trunk/rostests/winetests/crypt32/chain.c trunk/rostests/winetests/crypt32/protectdata.c Modified: trunk/rostests/winetests/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/cert.c?…
============================================================================== --- trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] Sun Jan 3 12:59:59 2010 @@ -1639,16 +1639,16 @@ /* Tests signing the certificate described by toBeSigned with the CSP passed in, * using the algorithm with OID sigOID. The CSP is assumed to be empty, and a - * keyset named AT_SIGNATURE will be added to it. The signing key will be - * stored in *key, and the signature will be stored in sig. sigLen should be - * at least 64 bytes. + * keyset named AT_SIGNATURE will be added to it. The signature will be stored + * in sig. sigLen should be at least 64 bytes. */ static void testSignCert(HCRYPTPROV csp, const CRYPT_DATA_BLOB *toBeSigned, - LPCSTR sigOID, HCRYPTKEY *key, BYTE *sig, DWORD *sigLen) + LPCSTR sigOID, BYTE *sig, DWORD *sigLen) { BOOL ret; DWORD size = 0; CRYPT_ALGORITHM_IDENTIFIER algoID = { NULL, { 0, NULL } }; + HCRYPTKEY key; /* These all crash ret = CryptSignCertificate(0, 0, 0, NULL, 0, NULL, NULL, NULL, NULL); @@ -1680,7 +1680,7 @@ ok(!ret && (GetLastError() == NTE_BAD_KEYSET || GetLastError() == NTE_NO_KEY), "Expected NTE_BAD_KEYSET or NTE_NO_KEY, got %08x\n", GetLastError()); - ret = CryptGenKey(csp, AT_SIGNATURE, 0, key); + ret = CryptGenKey(csp, AT_SIGNATURE, 0, &key); ok(ret, "CryptGenKey failed: %08x\n", GetLastError()); if (ret) { @@ -1700,6 +1700,7 @@ size); } } + CryptDestroyKey(key); } } @@ -1809,7 +1810,6 @@ HCRYPTPROV csp; CRYPT_DATA_BLOB toBeSigned = { sizeof(emptyCert), emptyCert }; BOOL ret; - HCRYPTKEY key; BYTE sig[64]; DWORD sigSize = sizeof(sig); @@ -1820,10 +1820,9 @@ CRYPT_NEWKEYSET); ok(ret, "CryptAcquireContext failed: %08x\n", GetLastError()); - testSignCert(csp, &toBeSigned, szOID_RSA_SHA1RSA, &key, sig, &sigSize); + testSignCert(csp, &toBeSigned, szOID_RSA_SHA1RSA, sig, &sigSize); testVerifyCertSig(csp, &toBeSigned, szOID_RSA_SHA1RSA, sig, sigSize); - CryptDestroyKey(key); CryptReleaseContext(csp, 0); ret = pCryptAcquireContextA(&csp, cspNameA, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_DELETEKEYSET); Modified: trunk/rostests/winetests/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/chain.c…
============================================================================== --- trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] Sun Jan 3 12:59:59 2010 @@ -4018,7 +4018,7 @@ /* And again authenticating a client, but specify the size of the policy * parameter. */ - sslPolicyPara.cbSize = sizeof(sslPolicyCheck); + U(sslPolicyPara).cbSize = sizeof(sslPolicyCheck); sslPolicyPara.dwAuthType = AUTHTYPE_CLIENT; for (i = 0; i < sizeof(sslPolicyCheck) / sizeof(sslPolicyCheck[0]); i++) Modified: trunk/rostests/winetests/crypt32/protectdata.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/protect…
============================================================================== --- trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/protectdata.c [iso-8859-1] Sun Jan 3 12:59:59 2010 @@ -235,8 +235,10 @@ res = pCryptUnprotectData(&encrypted, NULL, NULL, NULL, NULL, 0, &output); ok(res != 0, "can't unprotect; last error %u\n", GetLastError()); - ok(output.cbData == strlen(plaintext), "output wrong length %d for input '%s', wanted %d\n", output.cbData, plaintext, strlen(plaintext)); + ok(output.cbData == strlen(plaintext), "output wrong length %d for input '%s', wanted %d\n", output.cbData, plaintext, lstrlenA(plaintext)); ok(!memcmp(plaintext, (char *)output.pbData, output.cbData), "output wrong contents for input '%s'\n", plaintext); + LocalFree(output.pbData); + LocalFree(encrypted.pbData); } START_TEST(protectdata)
14 years, 11 months
1
0
0
0
[cwittich] 44909: [crypt32] sync crypt32 to wine 1.1.35
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 12:59:38 2010 New Revision: 44909 URL:
http://svn.reactos.org/svn/reactos?rev=44909&view=rev
Log: [crypt32] sync crypt32 to wine 1.1.35 Modified: trunk/reactos/dll/win32/crypt32/cert.c trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/crl.c trunk/reactos/dll/win32/crypt32/ctl.c trunk/reactos/dll/win32/crypt32/store.c Modified: trunk/reactos/dll/win32/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/cert.c?r…
============================================================================== --- trunk/reactos/dll/win32/crypt32/cert.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/cert.c [iso-8859-1] Sun Jan 3 12:59:38 2010 @@ -2854,7 +2854,7 @@ { info.pwszContainerName = CryptMemAlloc(len * sizeof(WCHAR)); - len = MultiByteToWideChar(CP_ACP, 0, szContainer, -1, + MultiByteToWideChar(CP_ACP, 0, szContainer, -1, info.pwszContainerName, len); } } @@ -2878,7 +2878,7 @@ { info.pwszProvName = CryptMemAlloc(len * sizeof(WCHAR)); - len = MultiByteToWideChar(CP_ACP, 0, szProvider, -1, + MultiByteToWideChar(CP_ACP, 0, szProvider, -1, info.pwszProvName, len); } } @@ -2898,7 +2898,7 @@ pInfo = &info; } - ret = CertSetCertificateContextProperty(context, CERT_KEY_PROV_INFO_PROP_ID, + CertSetCertificateContextProperty(context, CERT_KEY_PROV_INFO_PROP_ID, 0, pInfo); if (pInfo == &info) Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/chain.c [iso-8859-1] Sun Jan 3 12:59:38 2010 @@ -230,10 +230,118 @@ LONG ref; } CertificateChain, *PCertificateChain; -static inline BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) -{ - return CertCompareCertificateName(cert->dwCertEncodingType, - &cert->pCertInfo->Subject, &cert->pCertInfo->Issuer); +static BOOL CRYPT_IsCertificateSelfSigned(PCCERT_CONTEXT cert) +{ + PCERT_EXTENSION ext; + DWORD size; + BOOL ret; + + if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER2, + cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension))) + { + CERT_AUTHORITY_KEY_ID2_INFO *info; + + ret = CryptDecodeObjectEx(cert->dwCertEncodingType, + X509_AUTHORITY_KEY_ID2, ext->Value.pbData, ext->Value.cbData, + CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, + &info, &size); + if (ret) + { + if (info->AuthorityCertIssuer.cAltEntry && + info->AuthorityCertSerialNumber.cbData) + { + PCERT_ALT_NAME_ENTRY directoryName = NULL; + DWORD i; + + for (i = 0; !directoryName && + i < info->AuthorityCertIssuer.cAltEntry; i++) + if (info->AuthorityCertIssuer.rgAltEntry[i].dwAltNameChoice + == CERT_ALT_NAME_DIRECTORY_NAME) + directoryName = + &info->AuthorityCertIssuer.rgAltEntry[i]; + if (directoryName) + { + ret = CertCompareCertificateName(cert->dwCertEncodingType, + &directoryName->u.DirectoryName, &cert->pCertInfo->Issuer) + && CertCompareIntegerBlob(&info->AuthorityCertSerialNumber, + &cert->pCertInfo->SerialNumber); + } + else + { + FIXME("no supported name type in authority key id2\n"); + ret = FALSE; + } + } + else if (info->KeyId.cbData) + { + ret = CertGetCertificateContextProperty(cert, + CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size); + if (ret && size == info->KeyId.cbData) + { + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + CertGetCertificateContextProperty(cert, + CERT_KEY_IDENTIFIER_PROP_ID, buf, &size); + ret = !memcmp(buf, info->KeyId.pbData, size); + CryptMemFree(buf); + } + } + else + ret = FALSE; + } + LocalFree(info); + } + } + else if ((ext = CertFindExtension(szOID_AUTHORITY_KEY_IDENTIFIER, + cert->pCertInfo->cExtension, cert->pCertInfo->rgExtension))) + { + CERT_AUTHORITY_KEY_ID_INFO *info; + + ret = CryptDecodeObjectEx(cert->dwCertEncodingType, + X509_AUTHORITY_KEY_ID, ext->Value.pbData, ext->Value.cbData, + CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, NULL, + &info, &size); + if (ret) + { + if (info->CertIssuer.cbData && info->CertSerialNumber.cbData) + { + ret = CertCompareCertificateName(cert->dwCertEncodingType, + &info->CertIssuer, &cert->pCertInfo->Issuer) && + CertCompareIntegerBlob(&info->CertSerialNumber, + &cert->pCertInfo->SerialNumber); + } + else if (info->KeyId.cbData) + { + ret = CertGetCertificateContextProperty(cert, + CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size); + if (ret && size == info->KeyId.cbData) + { + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + CertGetCertificateContextProperty(cert, + CERT_KEY_IDENTIFIER_PROP_ID, buf, &size); + ret = !memcmp(buf, info->KeyId.pbData, size); + CryptMemFree(buf); + } + else + ret = FALSE; + } + else + ret = FALSE; + } + else + ret = FALSE; + LocalFree(info); + } + } + else + ret = CertCompareCertificateName(cert->dwCertEncodingType, + &cert->pCertInfo->Subject, &cert->pCertInfo->Issuer); + return ret; } static void CRYPT_FreeChainElement(PCERT_CHAIN_ELEMENT element) @@ -619,7 +727,7 @@ *trustErrorStatus |= CERT_TRUST_INVALID_NAME_CONSTRAINTS; else if (!name) ; /* no match */ - else if ((at = strchrW(constraint, '@'))) + else if (strchrW(constraint, '@')) match = !lstrcmpiW(constraint, name); else { @@ -2541,10 +2649,11 @@ * key usage extension be present and that a particular purpose * be indicated in order for the certificate to be acceptable to * that application." - * For now I'm being more conservative and disallowing it. + * Not all web sites include the extended key usage extension, so + * accept chains without it. */ - WARN_(chain)("requested usage from a certificate with no usages\n"); - validForUsage = FALSE; + TRACE_(chain)("requested usage from certificate with no usages\n"); + validForUsage = TRUE; } if (!validForUsage) { @@ -2641,6 +2750,8 @@ if (!pChain->TrustStatus.dwErrorStatus) CRYPT_VerifyChainRevocation(pChain, pTime, pChainPara, dwFlags); CRYPT_CheckUsages(pChain, pChainPara); + TRACE_(chain)("error status: %08x\n", + pChain->TrustStatus.dwErrorStatus); if (ppChainContext) *ppChainContext = pChain; else Modified: trunk/reactos/dll/win32/crypt32/crl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crl.c?re…
============================================================================== --- trunk/reactos/dll/win32/crypt32/crl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/crl.c [iso-8859-1] Sun Jan 3 12:59:38 2010 @@ -167,14 +167,21 @@ } else if (info->KeyId.cbData) { - if ((ext = CertFindExtension( - szOID_SUBJECT_KEY_IDENTIFIER, - issuer->pCertInfo->cExtension, - issuer->pCertInfo->rgExtension))) + DWORD size; + + ret = CertGetCertificateContextProperty(issuer, + CERT_KEY_IDENTIFIER_PROP_ID, NULL, &size); + if (ret && size == info->KeyId.cbData) { - if (info->KeyId.cbData == ext->Value.cbData) - ret = !memcmp(info->KeyId.pbData, - ext->Value.pbData, info->KeyId.cbData); + LPBYTE buf = CryptMemAlloc(size); + + if (buf) + { + CertGetCertificateContextProperty(issuer, + CERT_KEY_IDENTIFIER_PROP_ID, buf, &size); + ret = !memcmp(buf, info->KeyId.pbData, size); + CryptMemFree(buf); + } else ret = FALSE; } Modified: trunk/reactos/dll/win32/crypt32/ctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/ctl.c?re…
============================================================================== --- trunk/reactos/dll/win32/crypt32/ctl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/ctl.c [iso-8859-1] Sun Jan 3 12:59:38 2010 @@ -113,7 +113,13 @@ break; case CERT_STORE_ADD_USE_EXISTING: if (existing) + { CtlContext_CopyProperties(existing, pCtlContext); + if (ppStoreContext) + *ppStoreContext = CertDuplicateCTLContext(existing); + } + else + toAdd = CertDuplicateCTLContext(pCtlContext); break; default: FIXME("Unimplemented add disposition %d\n", dwAddDisposition); Modified: trunk/reactos/dll/win32/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/store.c?…
============================================================================== --- trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/store.c [iso-8859-1] Sun Jan 3 12:59:38 2010 @@ -899,7 +899,8 @@ if (existing) { CertContext_CopyProperties(existing, pCertContext); - *ppStoreContext = CertDuplicateCertificateContext(existing); + if (ppStoreContext) + *ppStoreContext = CertDuplicateCertificateContext(existing); } else toAdd = CertDuplicateCertificateContext(pCertContext); @@ -1090,7 +1091,13 @@ break; case CERT_STORE_ADD_USE_EXISTING: if (existing) + { CrlContext_CopyProperties(existing, pCrlContext); + if (ppStoreContext) + *ppStoreContext = CertDuplicateCRLContext(existing); + } + else + toAdd = CertDuplicateCRLContext(pCrlContext); break; default: FIXME("Unimplemented add disposition %d\n", dwAddDisposition);
14 years, 11 months
1
0
0
0
[cwittich] 44908: [cabinet] sync cabinet to wine 1.1.35
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 12:51:39 2010 New Revision: 44908 URL:
http://svn.reactos.org/svn/reactos?rev=44908&view=rev
Log: [cabinet] sync cabinet to wine 1.1.35 Modified: trunk/reactos/dll/win32/cabinet/fdi.c Modified: trunk/reactos/dll/win32/cabinet/fdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cabinet/fdi.c?re…
============================================================================== --- trunk/reactos/dll/win32/cabinet/fdi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/cabinet/fdi.c [iso-8859-1] Sun Jan 3 12:51:39 2010 @@ -2519,6 +2519,7 @@ /* slight overestimation here to save CPU cycles in the developer's brain */ if ((pathlen + filenamelen + 3) > MAX_PATH) { ERR("MAX_PATH exceeded.\n"); + PFDI_FREE(hfdi, decomp_state); PFDI_INT(hfdi)->perf->erfOper = FDIERROR_CABINET_NOT_FOUND; PFDI_INT(hfdi)->perf->erfType = ERROR_FILE_NOT_FOUND; PFDI_INT(hfdi)->perf->fError = TRUE; @@ -2540,6 +2541,7 @@ /* get a handle to the cabfile */ cabhf = PFDI_OPEN(hfdi, fullpath, _O_RDONLY|_O_BINARY, _S_IREAD | _S_IWRITE); if (cabhf == -1) { + PFDI_FREE(hfdi, decomp_state); PFDI_INT(hfdi)->perf->erfOper = FDIERROR_CABINET_NOT_FOUND; PFDI_INT(hfdi)->perf->fError = TRUE; SetLastError(ERROR_FILE_NOT_FOUND); @@ -2548,6 +2550,7 @@ if (cabhf == 0) { ERR("PFDI_OPEN returned zero for %s.\n", fullpath); + PFDI_FREE(hfdi, decomp_state); PFDI_INT(hfdi)->perf->erfOper = FDIERROR_CABINET_NOT_FOUND; PFDI_INT(hfdi)->perf->erfType = ERROR_FILE_NOT_FOUND; PFDI_INT(hfdi)->perf->fError = TRUE; @@ -2558,6 +2561,7 @@ /* check if it's really a cabfile. Note that this doesn't implement the bug */ if (!FDI_read_entries(hfdi, cabhf, &fdici, &(CAB(mii)))) { ERR("FDIIsCabinet failed.\n"); + PFDI_FREE(hfdi, decomp_state); PFDI_CLOSE(hfdi, cabhf); return FALSE; }
14 years, 11 months
1
0
0
0
[cwittich] 44907: [advapi32] reorder functions in cred.c to match wine code for easier syncing
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 12:20:54 2010 New Revision: 44907 URL:
http://svn.reactos.org/svn/reactos?rev=44907&view=rev
Log: [advapi32] reorder functions in cred.c to match wine code for easier syncing Modified: trunk/reactos/dll/win32/advapi32/sec/cred.c Modified: trunk/reactos/dll/win32/advapi32/sec/cred.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/cre…
============================================================================== --- trunk/reactos/dll/win32/advapi32/sec/cred.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/sec/cred.c [iso-8859-1] Sun Jan 3 12:20:54 2010 @@ -911,6 +911,13 @@ } #endif +/****************************************************************************** + * convert_PCREDENTIALW_to_PCREDENTIALA [internal] + * + * convert a Credential struct from UNICODE to ANSI and return the needed size in Bytes + * + */ + static INT convert_PCREDENTIALW_to_PCREDENTIALA(const CREDENTIALW *CredentialW, PCREDENTIALA CredentialA, INT len) { char *buffer; @@ -996,6 +1003,12 @@ return needed; } +/****************************************************************************** + * convert_PCREDENTIALA_to_PCREDENTIALW [internal] + * + * convert a Credential struct from ANSI to UNICODE and return the needed size in Bytes + * + */ static INT convert_PCREDENTIALA_to_PCREDENTIALW(const CREDENTIALA *CredentialA, PCREDENTIALW CredentialW, INT len) { char *buffer; @@ -1556,186 +1569,6 @@ } /****************************************************************************** - * CredWriteA [ADVAPI32.@] - */ -BOOL WINAPI CredWriteA(PCREDENTIALA Credential, DWORD Flags) -{ - BOOL ret; - INT len; - PCREDENTIALW CredentialW; - - TRACE("(%p, 0x%x)\n", Credential, Flags); - - if (!Credential || !Credential->TargetName) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - len = convert_PCREDENTIALA_to_PCREDENTIALW(Credential, NULL, 0); - CredentialW = HeapAlloc(GetProcessHeap(), 0, len); - if (!CredentialW) - { - SetLastError(ERROR_OUTOFMEMORY); - return FALSE; - } - - convert_PCREDENTIALA_to_PCREDENTIALW(Credential, CredentialW, len); - - ret = CredWriteW(CredentialW, Flags); - - HeapFree(GetProcessHeap(), 0, CredentialW); - - return ret; -} - -/****************************************************************************** - * CredWriteW [ADVAPI32.@] - */ -BOOL WINAPI CredWriteW(PCREDENTIALW Credential, DWORD Flags) -{ - HKEY hkeyMgr; - HKEY hkeyCred; - DWORD ret; - LPWSTR key_name; - BYTE key_data[KEY_SIZE]; - - TRACE("(%p, 0x%x)\n", Credential, Flags); - - if (!Credential || !Credential->TargetName) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (Flags & ~CRED_PRESERVE_CREDENTIAL_BLOB) - { - FIXME("unhandled flags 0x%x\n", Flags); - SetLastError(ERROR_INVALID_FLAGS); - return FALSE; - } - - if (Credential->Type != CRED_TYPE_GENERIC && Credential->Type != CRED_TYPE_DOMAIN_PASSWORD) - { - FIXME("unhandled type %d\n", Credential->Type); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - TRACE("Credential->TargetName = %s\n", debugstr_w(Credential->TargetName)); - TRACE("Credential->UserName = %s\n", debugstr_w(Credential->UserName)); - - if (Credential->Type == CRED_TYPE_DOMAIN_PASSWORD) - { - if (!Credential->UserName || - (!strchrW(Credential->UserName, '\\') && !strchrW(Credential->UserName, '@'))) - { - ERR("bad username %s\n", debugstr_w(Credential->UserName)); - SetLastError(ERROR_BAD_USERNAME); - return FALSE; - } - } - -#ifdef __APPLE__ - if (!Credential->AttributeCount && - Credential->Type == CRED_TYPE_DOMAIN_PASSWORD && - (Credential->Persist == CRED_PERSIST_LOCAL_MACHINE || Credential->Persist == CRED_PERSIST_ENTERPRISE)) - { - ret = mac_write_credential(Credential, Flags & CRED_PRESERVE_CREDENTIAL_BLOB); - if (ret != ERROR_SUCCESS) - { - SetLastError(ret); - return FALSE; - } - return TRUE; - } -#endif - - ret = open_cred_mgr_key(&hkeyMgr, FALSE); - if (ret != ERROR_SUCCESS) - { - WARN("couldn't open/create manager key, error %d\n", ret); - SetLastError(ERROR_NO_SUCH_LOGON_SESSION); - return FALSE; - } - - ret = get_cred_mgr_encryption_key(hkeyMgr, key_data); - if (ret != ERROR_SUCCESS) - { - RegCloseKey(hkeyMgr); - SetLastError(ret); - return FALSE; - } - - key_name = get_key_name_for_target(Credential->TargetName, Credential->Type); - ret = RegCreateKeyExW(hkeyMgr, key_name, 0, NULL, - Credential->Persist == CRED_PERSIST_SESSION ? REG_OPTION_VOLATILE : REG_OPTION_NON_VOLATILE, - KEY_READ|KEY_WRITE, NULL, &hkeyCred, NULL); - HeapFree(GetProcessHeap(), 0, key_name); - if (ret != ERROR_SUCCESS) - { - TRACE("credentials for target name %s not found\n", - debugstr_w(Credential->TargetName)); - SetLastError(ERROR_NOT_FOUND); - return FALSE; - } - - ret = registry_write_credential(hkeyCred, Credential, key_data, - Flags & CRED_PRESERVE_CREDENTIAL_BLOB); - - RegCloseKey(hkeyCred); - RegCloseKey(hkeyMgr); - - if (ret != ERROR_SUCCESS) - { - SetLastError(ret); - return FALSE; - } - return TRUE; -} - -/****************************************************************************** - * CredGetSessionTypes [ADVAPI32.@] - */ -BOOL WINAPI CredGetSessionTypes(DWORD persistCount, LPDWORD persists) -{ - TRACE("(%u, %p)\n", persistCount, persists); - - memset(persists, CRED_PERSIST_NONE, persistCount*sizeof(*persists)); - if (CRED_TYPE_GENERIC < persistCount) - { - persists[CRED_TYPE_GENERIC] = CRED_PERSIST_ENTERPRISE; - - if (CRED_TYPE_DOMAIN_PASSWORD < persistCount) - { - persists[CRED_TYPE_DOMAIN_PASSWORD] = CRED_PERSIST_ENTERPRISE; - } - } - return TRUE; -} - -/****************************************************************************** - * CredReadDomainCredentialsW [ADVAPI32.@] - */ -BOOL WINAPI CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInformation, DWORD Flags, - DWORD *Size, PCREDENTIALW **Credentials) -{ - FIXME("(%p, 0x%x, %p, %p) stub\n", TargetInformation, Flags, Size, Credentials); - - /* follow Windows behavior - do not test for NULL, initialize early */ - *Size = 0; - *Credentials = NULL; - if (!TargetInformation) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - SetLastError(ERROR_NOT_FOUND); - return FALSE; -} - -/****************************************************************************** * CredReadDomainCredentialsA [ADVAPI32.@] */ BOOL WINAPI CredReadDomainCredentialsA(PCREDENTIAL_TARGET_INFORMATIONA TargetInformation, @@ -1880,6 +1713,186 @@ return ret; } +/****************************************************************************** + * CredReadDomainCredentialsW [ADVAPI32.@] + */ +BOOL WINAPI CredReadDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInformation, DWORD Flags, + DWORD *Size, PCREDENTIALW **Credentials) +{ + FIXME("(%p, 0x%x, %p, %p) stub\n", TargetInformation, Flags, Size, Credentials); + + /* follow Windows behavior - do not test for NULL, initialize early */ + *Size = 0; + *Credentials = NULL; + if (!TargetInformation) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + SetLastError(ERROR_NOT_FOUND); + return FALSE; +} + +/****************************************************************************** + * CredWriteA [ADVAPI32.@] + */ +BOOL WINAPI CredWriteA(PCREDENTIALA Credential, DWORD Flags) +{ + BOOL ret; + INT len; + PCREDENTIALW CredentialW; + + TRACE("(%p, 0x%x)\n", Credential, Flags); + + if (!Credential || !Credential->TargetName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + len = convert_PCREDENTIALA_to_PCREDENTIALW(Credential, NULL, 0); + CredentialW = HeapAlloc(GetProcessHeap(), 0, len); + if (!CredentialW) + { + SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + + convert_PCREDENTIALA_to_PCREDENTIALW(Credential, CredentialW, len); + + ret = CredWriteW(CredentialW, Flags); + + HeapFree(GetProcessHeap(), 0, CredentialW); + + return ret; +} + +/****************************************************************************** + * CredWriteW [ADVAPI32.@] + */ +BOOL WINAPI CredWriteW(PCREDENTIALW Credential, DWORD Flags) +{ + HKEY hkeyMgr; + HKEY hkeyCred; + DWORD ret; + LPWSTR key_name; + BYTE key_data[KEY_SIZE]; + + TRACE("(%p, 0x%x)\n", Credential, Flags); + + if (!Credential || !Credential->TargetName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (Flags & ~CRED_PRESERVE_CREDENTIAL_BLOB) + { + FIXME("unhandled flags 0x%x\n", Flags); + SetLastError(ERROR_INVALID_FLAGS); + return FALSE; + } + + if (Credential->Type != CRED_TYPE_GENERIC && Credential->Type != CRED_TYPE_DOMAIN_PASSWORD) + { + FIXME("unhandled type %d\n", Credential->Type); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + TRACE("Credential->TargetName = %s\n", debugstr_w(Credential->TargetName)); + TRACE("Credential->UserName = %s\n", debugstr_w(Credential->UserName)); + + if (Credential->Type == CRED_TYPE_DOMAIN_PASSWORD) + { + if (!Credential->UserName || + (!strchrW(Credential->UserName, '\\') && !strchrW(Credential->UserName, '@'))) + { + ERR("bad username %s\n", debugstr_w(Credential->UserName)); + SetLastError(ERROR_BAD_USERNAME); + return FALSE; + } + } + +#ifdef __APPLE__ + if (!Credential->AttributeCount && + Credential->Type == CRED_TYPE_DOMAIN_PASSWORD && + (Credential->Persist == CRED_PERSIST_LOCAL_MACHINE || Credential->Persist == CRED_PERSIST_ENTERPRISE)) + { + ret = mac_write_credential(Credential, Flags & CRED_PRESERVE_CREDENTIAL_BLOB); + if (ret != ERROR_SUCCESS) + { + SetLastError(ret); + return FALSE; + } + return TRUE; + } +#endif + + ret = open_cred_mgr_key(&hkeyMgr, FALSE); + if (ret != ERROR_SUCCESS) + { + WARN("couldn't open/create manager key, error %d\n", ret); + SetLastError(ERROR_NO_SUCH_LOGON_SESSION); + return FALSE; + } + + ret = get_cred_mgr_encryption_key(hkeyMgr, key_data); + if (ret != ERROR_SUCCESS) + { + RegCloseKey(hkeyMgr); + SetLastError(ret); + return FALSE; + } + + key_name = get_key_name_for_target(Credential->TargetName, Credential->Type); + ret = RegCreateKeyExW(hkeyMgr, key_name, 0, NULL, + Credential->Persist == CRED_PERSIST_SESSION ? REG_OPTION_VOLATILE : REG_OPTION_NON_VOLATILE, + KEY_READ|KEY_WRITE, NULL, &hkeyCred, NULL); + HeapFree(GetProcessHeap(), 0, key_name); + if (ret != ERROR_SUCCESS) + { + TRACE("credentials for target name %s not found\n", + debugstr_w(Credential->TargetName)); + SetLastError(ERROR_NOT_FOUND); + return FALSE; + } + + ret = registry_write_credential(hkeyCred, Credential, key_data, + Flags & CRED_PRESERVE_CREDENTIAL_BLOB); + + RegCloseKey(hkeyCred); + RegCloseKey(hkeyMgr); + + if (ret != ERROR_SUCCESS) + { + SetLastError(ret); + return FALSE; + } + return TRUE; +} + +/****************************************************************************** + * CredGetSessionTypes [ADVAPI32.@] + */ +BOOL WINAPI CredGetSessionTypes(DWORD persistCount, LPDWORD persists) +{ + TRACE("(%u, %p)\n", persistCount, persists); + + memset(persists, CRED_PERSIST_NONE, persistCount*sizeof(*persists)); + if (CRED_TYPE_GENERIC < persistCount) + { + persists[CRED_TYPE_GENERIC] = CRED_PERSIST_ENTERPRISE; + + if (CRED_TYPE_DOMAIN_PASSWORD < persistCount) + { + persists[CRED_TYPE_DOMAIN_PASSWORD] = CRED_PERSIST_ENTERPRISE; + } + } + return TRUE; +} + BOOL WINAPI CredWriteDomainCredentialsW(PCREDENTIAL_TARGET_INFORMATIONW TargetInfo,
14 years, 11 months
1
0
0
0
[cwittich] 44906: [gdiplus_winetest] sync gdiplus_winetest with wine 1.1.35
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 11:54:40 2010 New Revision: 44906 URL:
http://svn.reactos.org/svn/reactos?rev=44906&view=rev
Log: [gdiplus_winetest] sync gdiplus_winetest with wine 1.1.35 Modified: trunk/rostests/winetests/gdiplus/brush.c trunk/rostests/winetests/gdiplus/customlinecap.c trunk/rostests/winetests/gdiplus/font.c trunk/rostests/winetests/gdiplus/graphics.c trunk/rostests/winetests/gdiplus/graphicspath.c trunk/rostests/winetests/gdiplus/image.c trunk/rostests/winetests/gdiplus/pathiterator.c trunk/rostests/winetests/gdiplus/pen.c Modified: trunk/rostests/winetests/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/brush.c…
============================================================================== --- trunk/rostests/winetests/gdiplus/brush.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/brush.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -310,9 +310,9 @@ memset(&rectf, 0, sizeof(GpRectF)); status = GdipGetLineRect(brush, &rectf); expect(Ok, status); - todo_wine expectf(-5.0, rectf.X); + expectf(-5.0, rectf.X); expectf(0.0, rectf.Y); - todo_wine expectf(10.0, rectf.Width); + expectf(10.0, rectf.Width); expectf(10.0, rectf.Height); status = GdipDeleteBrush((GpBrush*)brush); /* horizontal gradient */ @@ -324,9 +324,9 @@ status = GdipGetLineRect(brush, &rectf); expect(Ok, status); expectf(0.0, rectf.X); - todo_wine expectf(-5.0, rectf.Y); + expectf(-5.0, rectf.Y); expectf(10.0, rectf.Width); - todo_wine expectf(10.0, rectf.Height); + expectf(10.0, rectf.Height); status = GdipDeleteBrush((GpBrush*)brush); /* slope = -1 */ pt1.X = pt1.Y = 0.0; @@ -395,8 +395,11 @@ int i; const REAL factors[5] = {0.0f, 0.1f, 0.5f, 0.9f, 1.0f}; const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f}; + const REAL two_positions[2] = {0.0f, 1.0f}; + const ARGB colors[5] = {0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffffffff}; REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f}; REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f}; + ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0}; pt1.X = pt1.Y = 1.0; pt2.X = pt2.Y = 100.0; @@ -488,6 +491,156 @@ status = GdipGetLineBlend(brush, res_factors, res_positions, 1); expect(Ok, status); + + status = GdipGetLinePresetBlendCount(NULL, &count); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlendCount(brush, NULL); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlendCount(brush, &count); + expect(Ok, status); + expect(0, count); + + status = GdipGetLinePresetBlend(NULL, res_colors, res_positions, 1); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, NULL, res_positions, 1); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, res_colors, NULL, 1); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 0); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, -1); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 1); + expect(InvalidParameter, status); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 2); + expect(GenericError, status); + + status = GdipSetLinePresetBlend(NULL, colors, positions, 5); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, NULL, positions, 5); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, colors, NULL, 5); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, colors, positions, 0); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, colors, positions, -1); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, colors, positions, 1); + expect(InvalidParameter, status); + + /* leave off the 0.0 position */ + status = GdipSetLinePresetBlend(brush, &colors[1], &positions[1], 4); + expect(InvalidParameter, status); + + /* leave off the 1.0 position */ + status = GdipSetLinePresetBlend(brush, colors, positions, 4); + expect(InvalidParameter, status); + + status = GdipSetLinePresetBlend(brush, colors, positions, 5); + expect(Ok, status); + + status = GdipGetLinePresetBlendCount(brush, &count); + expect(Ok, status); + expect(5, count); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 4); + expect(InsufficientBuffer, status); + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 5); + expect(Ok, status); + + for (i=0; i<5; i++) + { + expect(colors[i], res_colors[i]); + expectf(positions[i], res_positions[i]); + } + + status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 6); + expect(Ok, status); + + status = GdipSetLinePresetBlend(brush, colors, two_positions, 2); + expect(Ok, status); + + status = GdipDeleteBrush((GpBrush*)brush); + expect(Ok, status); +} + +static void test_linelinearblend(void) +{ + GpLineGradient *brush; + GpStatus status; + GpPointF pt1, pt2; + INT count=10; + REAL res_factors[3] = {0.3f}; + REAL res_positions[3] = {0.3f}; + + status = GdipSetLineLinearBlend(NULL, 0.6, 0.8); + expect(InvalidParameter, status); + + pt1.X = pt1.Y = 1.0; + pt2.X = pt2.Y = 100.0; + status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush); + expect(Ok, status); + + + status = GdipSetLineLinearBlend(brush, 0.6, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(3, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.0, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.8, res_factors[1]); + expectf(0.6, res_positions[1]); + expectf(0.0, res_factors[2]); + expectf(1.0, res_positions[2]); + + + status = GdipSetLineLinearBlend(brush, 0.0, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(2, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.8, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.0, res_factors[1]); + expectf(1.0, res_positions[1]); + + + status = GdipSetLineLinearBlend(brush, 1.0, 0.8); + expect(Ok, status); + + status = GdipGetLineBlendCount(brush, &count); + expect(Ok, status); + expect(2, count); + + status = GdipGetLineBlend(brush, res_factors, res_positions, 3); + expect(Ok, status); + expectf(0.0, res_factors[0]); + expectf(0.0, res_positions[0]); + expectf(0.8, res_factors[1]); + expectf(1.0, res_positions[1]); status = GdipDeleteBrush((GpBrush*)brush); expect(Ok, status); @@ -515,6 +668,7 @@ test_texturewrap(); test_gradientgetrect(); test_lineblend(); + test_linelinearblend(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/customlinecap.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/customl…
============================================================================== --- trunk/rostests/winetests/gdiplus/customlinecap.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/customlinecap.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -59,8 +59,11 @@ stat = GdipDeleteCustomLineCap(custom); expect(Ok, stat); /* it's strange but native returns NotImplemented on stroke == NULL */ + custom = NULL; stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 10.0, &custom); todo_wine expect(NotImplemented, stat); + todo_wine ok(custom == NULL, "Expected a failure on creation\n"); + if(stat == Ok) GdipDeleteCustomLineCap(custom); GdipDeletePath(path2); GdipDeletePath(path); Modified: trunk/rostests/winetests/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/font.c?…
============================================================================== --- trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/font.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -31,14 +31,6 @@ static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'}; static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'}; -static const char *debugstr_w(LPCWSTR str) -{ - static char buf[1024]; - WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); - return buf; -} - - static void test_createfont(void) { GpFontFamily* fontfamily = NULL, *fontfamily2; @@ -71,7 +63,7 @@ stat = GdipGetFamilyName(fontfamily2, familyname, 0); expect(Ok, stat); ok (lstrcmpiW(arial, familyname) == 0, "Expected arial, got %s\n", - debugstr_w(familyname)); + wine_dbgstr_w(familyname)); stat = GdipDeleteFontFamily(fontfamily2); expect(Ok, stat); @@ -201,6 +193,7 @@ { stat = GdipCreateFontFamilyFromName (MSSansSerif, NULL, &family); expect (FontFamilyNotFound, stat); + if(stat == Ok) GdipDeleteFontFamily(family); } stat = GdipCreateFontFamilyFromName (arial, NULL, &family); @@ -302,10 +295,9 @@ expect (Ok, stat); stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); expect (Ok, stat); - ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0) || - (lstrcmpiW(familyName,MSSansSerif) == 0), - "Expected Microsoft Sans Serif or MS Sans Serif, got %s\n", - debugstr_w(familyName)); + todo_wine ok ((lstrcmpiW(familyName, MicrosoftSansSerif) == 0), + "Expected Microsoft Sans Serif, got %s\n", + wine_dbgstr_w(familyName)); stat = GdipDeleteFontFamily (family); expect (Ok, stat); @@ -320,7 +312,7 @@ stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); expect (Ok, stat); ok (lstrcmpiW(familyName, TimesNewRoman) == 0, - "Expected Times New Roman, got %s\n", debugstr_w(familyName)); + "Expected Times New Roman, got %s\n", wine_dbgstr_w(familyName)); stat = GdipDeleteFontFamily (family); expect (Ok, stat); @@ -335,7 +327,7 @@ stat = GdipGetFamilyName (family, familyName, LANG_NEUTRAL); expect (Ok, stat); ok (lstrcmpiW(familyName, CourierNew) == 0, - "Expected Courier New, got %s\n", debugstr_w(familyName)); + "Expected Courier New, got %s\n", wine_dbgstr_w(familyName)); stat = GdipDeleteFontFamily (family); expect (Ok, stat); } Modified: trunk/rostests/winetests/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphic…
============================================================================== --- trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/graphics.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -137,8 +137,7 @@ stat = GdipRestoreGraphics(graphics1, state_a); expect(Ok, stat); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBilinear, mode); + expect(InterpolationModeBilinear, mode); GdipDeleteGraphics(graphics1); log_state(state_a, &state_log); @@ -154,12 +153,10 @@ expect(Ok, stat); GdipRestoreGraphics(graphics1, state_b); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBicubic, mode); + expect(InterpolationModeBicubic, mode); GdipRestoreGraphics(graphics1, state_a); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBilinear, mode); + expect(InterpolationModeBilinear, mode); GdipDeleteGraphics(graphics1); log_state(state_a, &state_log); @@ -176,16 +173,13 @@ GdipSetInterpolationMode(graphics1, InterpolationModeHighQualityBilinear); GdipRestoreGraphics(graphics1, state_b); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBicubic, mode); + expect(InterpolationModeBicubic, mode); GdipRestoreGraphics(graphics1, state_c); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBicubic, mode); + expect(InterpolationModeBicubic, mode); GdipRestoreGraphics(graphics1, state_a); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBilinear, mode); + expect(InterpolationModeBilinear, mode); GdipDeleteGraphics(graphics1); log_state(state_a, &state_log); @@ -204,12 +198,10 @@ GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor); GdipRestoreGraphics(graphics1, state_a); GdipGetInterpolationMode(graphics1, &mode); - todo_wine - expect(InterpolationModeBilinear, mode); + expect(InterpolationModeBilinear, mode); GdipRestoreGraphics(graphics2, state_b); GdipGetInterpolationMode(graphics2, &mode); - todo_wine - expect(InterpolationModeBicubic, mode); + expect(InterpolationModeBicubic, mode); GdipDeleteGraphics(graphics1); GdipDeleteGraphics(graphics2); @@ -243,8 +235,6 @@ HDC hdc = GetDC(0); /* make a graphics object and pen object */ - status = GdipCreateFromHDC(hdc, &graphics); - expect(Ok, status); ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -289,8 +279,6 @@ HDC hdc = GetDC(0); /* make a graphics object and pen object */ - status = GdipCreateFromHDC(hdc, &graphics); - expect(Ok, status); ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -324,6 +312,191 @@ GdipDeletePen(pen); GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + +static void test_BeginContainer2(void) +{ + GpMatrix *transform; + GpRectF clip; + REAL defClip[] = {5, 10, 15, 20}; + REAL elems[6], defTrans[] = {1, 2, 3, 4, 5, 6}; + GraphicsContainer cont1, cont2, cont3, cont4; + CompositingQuality compqual, defCompqual = CompositingQualityHighSpeed; + CompositingMode compmode, defCompmode = CompositingModeSourceOver; + InterpolationMode interp, defInterp = InterpolationModeHighQualityBicubic; + REAL scale, defScale = 17; + GpUnit unit, defUnit = UnitPixel; + PixelOffsetMode offsetmode, defOffsetmode = PixelOffsetModeHighSpeed; + SmoothingMode smoothmode, defSmoothmode = SmoothingModeAntiAlias; + UINT contrast, defContrast = 5; + TextRenderingHint texthint, defTexthint = TextRenderingHintAntiAlias; + + GpStatus status; + GpGraphics *graphics = NULL; + HDC hdc = GetDC(0); + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + /* null graphics, null container */ + status = GdipBeginContainer2(NULL, &cont1); + expect(InvalidParameter, status); + + status = GdipBeginContainer2(graphics, NULL); + expect(InvalidParameter, status); + + status = GdipEndContainer(NULL, cont1); + expect(InvalidParameter, status); + + /* test all quality-related values */ + GdipSetCompositingMode(graphics, defCompmode); + GdipSetCompositingQuality(graphics, defCompqual); + GdipSetInterpolationMode(graphics, defInterp); + GdipSetPageScale(graphics, defScale); + GdipSetPageUnit(graphics, defUnit); + GdipSetPixelOffsetMode(graphics, defOffsetmode); + GdipSetSmoothingMode(graphics, defSmoothmode); + GdipSetTextContrast(graphics, defContrast); + GdipSetTextRenderingHint(graphics, defTexthint); + + status = GdipBeginContainer2(graphics, &cont1); + expect(Ok, status); + + GdipSetCompositingMode(graphics, CompositingModeSourceCopy); + GdipSetCompositingQuality(graphics, CompositingQualityHighQuality); + GdipSetInterpolationMode(graphics, InterpolationModeBilinear); + GdipSetPageScale(graphics, 10); + GdipSetPageUnit(graphics, UnitDocument); + GdipSetPixelOffsetMode(graphics, PixelOffsetModeHalf); + GdipSetSmoothingMode(graphics, SmoothingModeNone); + GdipSetTextContrast(graphics, 7); + GdipSetTextRenderingHint(graphics, TextRenderingHintClearTypeGridFit); + + status = GdipEndContainer(graphics, cont1); + expect(Ok, status); + + GdipGetCompositingMode(graphics, &compmode); + ok(defCompmode == compmode, "Expected Compositing Mode to be restored to %d, got %d\n", defCompmode, compmode); + + GdipGetCompositingQuality(graphics, &compqual); + ok(defCompqual == compqual, "Expected Compositing Quality to be restored to %d, got %d\n", defCompqual, compqual); + + GdipGetInterpolationMode(graphics, &interp); + ok(defInterp == interp, "Expected Interpolation Mode to be restored to %d, got %d\n", defInterp, interp); + + GdipGetPageScale(graphics, &scale); + ok(fabs(defScale - scale) < 0.0001, "Expected Page Scale to be restored to %f, got %f\n", defScale, scale); + + GdipGetPageUnit(graphics, &unit); + ok(defUnit == unit, "Expected Page Unit to be restored to %d, got %d\n", defUnit, unit); + + GdipGetPixelOffsetMode(graphics, &offsetmode); + ok(defOffsetmode == offsetmode, "Expected Pixel Offset Mode to be restored to %d, got %d\n", defOffsetmode, offsetmode); + + GdipGetSmoothingMode(graphics, &smoothmode); + ok(defSmoothmode == smoothmode, "Expected Smoothing Mode to be restored to %d, got %d\n", defSmoothmode, smoothmode); + + GdipGetTextContrast(graphics, &contrast); + ok(defContrast == contrast, "Expected Text Contrast to be restored to %d, got %d\n", defContrast, contrast); + + GdipGetTextRenderingHint(graphics, &texthint); + ok(defTexthint == texthint, "Expected Text Hint to be restored to %d, got %d\n", defTexthint, texthint); + + /* test world transform */ + status = GdipBeginContainer2(graphics, &cont1); + expect(Ok, status); + + GdipCreateMatrix2(defTrans[0], defTrans[1], defTrans[2], defTrans[3], + defTrans[4], defTrans[5], &transform); + GdipSetWorldTransform(graphics, transform); + GdipDeleteMatrix(transform); + transform = NULL; + + status = GdipBeginContainer2(graphics, &cont2); + expect(Ok, status); + + GdipCreateMatrix2(10, 20, 30, 40, 50, 60, &transform); + GdipSetWorldTransform(graphics, transform); + GdipDeleteMatrix(transform); + transform = NULL; + + status = GdipEndContainer(graphics, cont2); + expect(Ok, status); + + GdipCreateMatrix(&transform); + GdipGetWorldTransform(graphics, transform); + GdipGetMatrixElements(transform, elems); + ok(fabs(defTrans[0] - elems[0]) < 0.0001 && + fabs(defTrans[1] - elems[1]) < 0.0001 && + fabs(defTrans[2] - elems[2]) < 0.0001 && + fabs(defTrans[3] - elems[3]) < 0.0001 && + fabs(defTrans[4] - elems[4]) < 0.0001 && + fabs(defTrans[5] - elems[5]) < 0.0001, + "Expected World Transform Matrix to be restored to [%f, %f, %f, %f, %f, %f], got [%f, %f, %f, %f, %f, %f]\n", + defTrans[0], defTrans[1], defTrans[2], defTrans[3], defTrans[4], defTrans[5], + elems[0], elems[1], elems[2], elems[3], elems[4], elems[5]); + GdipDeleteMatrix(transform); + transform = NULL; + + status = GdipEndContainer(graphics, cont1); + expect(Ok, status); + + /* test clipping */ + status = GdipBeginContainer2(graphics, &cont1); + expect(Ok, status); + + GdipSetClipRect(graphics, defClip[0], defClip[1], defClip[2], defClip[3], CombineModeReplace); + + status = GdipBeginContainer2(graphics, &cont2); + expect(Ok, status); + + GdipSetClipRect(graphics, 2, 4, 6, 8, CombineModeReplace); + + status = GdipEndContainer(graphics, cont2); + + GdipGetClipBounds(graphics, &clip); + ok(fabs(defClip[0] - clip.X) < 0.0001 && + fabs(defClip[1] - clip.Y) < 0.0001 && + fabs(defClip[2] - clip.Width) < 0.0001 && + fabs(defClip[3] - clip.Height) < 0.0001, + "Expected Clipping Rectangle to be restored to [%f, %f, %f, %f], got [%f, %f, %f, %f]\n", + defClip[0], defClip[1], defClip[2], defClip[3], + clip.X, clip.Y, clip.Width, clip.Height); + + status = GdipEndContainer(graphics, cont1); + + /* nesting */ + status = GdipBeginContainer2(graphics, &cont1); + expect(Ok, status); + + status = GdipBeginContainer2(graphics, &cont2); + expect(Ok, status); + + status = GdipBeginContainer2(graphics, &cont3); + expect(Ok, status); + + status = GdipEndContainer(graphics, cont3); + expect(Ok, status); + + status = GdipBeginContainer2(graphics, &cont4); + expect(Ok, status); + + status = GdipEndContainer(graphics, cont4); + expect(Ok, status); + + /* skip cont2 */ + status = GdipEndContainer(graphics, cont1); + expect(Ok, status); + + /* end an already-ended container */ + status = GdipEndContainer(graphics, cont1); + expect(Ok, status); + + GdipDeleteGraphics(graphics); ReleaseDC(0, hdc); } @@ -335,8 +508,6 @@ HDC hdc = GetDC(0); /* make a graphics object and pen object */ - status = GdipCreateFromHDC(hdc, &graphics); - expect(Ok, status); ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -367,16 +538,430 @@ ReleaseDC(0, hdc); } -static void test_GdipDrawLineI(void) +static void test_GdipDrawCurve3(void) { GpStatus status; GpGraphics *graphics = NULL; GpPen *pen = NULL; HDC hdc = GetDC(0); + GpPointF points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurve3(NULL, NULL, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, NULL, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(NULL, pen, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurve3(graphics, pen, points, -1, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, pen, points, 0, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, pen, points, 1, 0, 0, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, pen, points, 3, 4, 2, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid number of segments */ + status = GdipDrawCurve3(graphics, pen, points, 3, 0, -1, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, pen, points, 3, 1, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3(graphics, pen, points, 2, 0, 2, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurve3(graphics, pen, points, 2, 0, 1, 1); + expect(Ok, status); + + status = GdipDrawCurve3(graphics, pen, points, 3, 0, 2, 2); + expect(Ok, status); + + status = GdipDrawCurve3(graphics, pen, points, 2, 0, 1, -2); + expect(Ok, status); + + status = GdipDrawCurve3(graphics, pen, points, 3, 1, 1, 0); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawCurve3I(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + GpPoint points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurve3I(NULL, NULL, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(graphics, NULL, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(NULL, pen, points, 3, 0, 2, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurve3I(graphics, pen, points, -1, -1, -1, 1); + expect(OutOfMemory, status); + + status = GdipDrawCurve3I(graphics, pen, points, 0, 0, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(graphics, pen, points, 1, 0, 0, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(graphics, pen, points, 3, 4, 2, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid number of segments */ + status = GdipDrawCurve3I(graphics, pen, points, 3, 0, -1, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(graphics, pen, points, 3, 1, 2, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve3I(graphics, pen, points, 2, 0, 2, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurve3I(graphics, pen, points, 2, 0, 1, 1); + expect(Ok, status); + + status = GdipDrawCurve3I(graphics, pen, points, 3, 0, 2, 2); + expect(Ok, status); + + status = GdipDrawCurve3I(graphics, pen, points, 2, 0, 1, -2); + expect(Ok, status); + + status = GdipDrawCurve3I(graphics, pen, points, 3, 1, 1, 0); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawCurve2(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + GpPointF points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurve2(NULL, NULL, points, 3, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2(graphics, NULL, points, 3, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2(NULL, pen, points, 3, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurve2(graphics, pen, points, -1, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2(graphics, pen, points, 0, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2(graphics, pen, points, 1, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurve2(graphics, pen, points, 2, 1); + expect(Ok, status); + + status = GdipDrawCurve2(graphics, pen, points, 3, 2); + expect(Ok, status); + + status = GdipDrawCurve2(graphics, pen, points, 3, -2); + expect(Ok, status); + + status = GdipDrawCurve2(graphics, pen, points, 3, 0); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawCurve2I(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + GpPoint points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurve2I(NULL, NULL, points, 3, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2I(graphics, NULL, points, 3, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2I(NULL, pen, points, 3, 1); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurve2I(graphics, pen, points, -1, 1); + expect(OutOfMemory, status); + + status = GdipDrawCurve2I(graphics, pen, points, 0, 1); + expect(InvalidParameter, status); + + status = GdipDrawCurve2I(graphics, pen, points, 1, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurve2I(graphics, pen, points, 2, 1); + expect(Ok, status); + + status = GdipDrawCurve2I(graphics, pen, points, 3, 2); + expect(Ok, status); + + status = GdipDrawCurve2I(graphics, pen, points, 3, -2); + expect(Ok, status); + + status = GdipDrawCurve2I(graphics, pen, points, 3, 0); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawCurve(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + GpPointF points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurve(NULL, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipDrawCurve(graphics, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipDrawCurve(NULL, pen, points, 3); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurve(graphics, pen, points, -1); + expect(InvalidParameter, status); + + status = GdipDrawCurve(graphics, pen, points, 0); + expect(InvalidParameter, status); + + status = GdipDrawCurve(graphics, pen, points, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurve(graphics, pen, points, 2); + expect(Ok, status); + + status = GdipDrawCurve(graphics, pen, points, 3); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawCurveI(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + GpPoint points[3]; + + points[0].X = 0; + points[0].Y = 0; + + points[1].X = 40; + points[1].Y = 20; + + points[2].X = 10; + points[2].Y = 40; + + /* make a graphics object and pen object */ + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); + expect(Ok, status); + ok(pen != NULL, "Expected pen to be initialized\n"); + + /* InvalidParameter cases: null graphics, null pen */ + status = GdipDrawCurveI(NULL, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipDrawCurveI(graphics, NULL, points, 3); + expect(InvalidParameter, status); + + status = GdipDrawCurveI(NULL, pen, points, 3); + expect(InvalidParameter, status); + + /* InvalidParameter cases: invalid count */ + status = GdipDrawCurveI(graphics, pen, points, -1); + expect(OutOfMemory, status); + + status = GdipDrawCurveI(graphics, pen, points, 0); + expect(InvalidParameter, status); + + status = GdipDrawCurveI(graphics, pen, points, 1); + expect(InvalidParameter, status); + + /* Valid test cases */ + status = GdipDrawCurveI(graphics, pen, points, 2); + expect(Ok, status); + + status = GdipDrawCurveI(graphics, pen, points, 3); + expect(Ok, status); + + GdipDeletePen(pen); + GdipDeleteGraphics(graphics); + + ReleaseDC(0, hdc); +} + +static void test_GdipDrawLineI(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpPen *pen = NULL; + HDC hdc = GetDC(0); + + /* make a graphics object and pen object */ ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -416,8 +1001,6 @@ HDC hdc = GetDC(0); /* make a graphics object and pen object */ - status = GdipCreateFromHDC(hdc, &graphics); - expect(Ok, status); ok(hdc != NULL, "Expected HDC to be initialized\n"); status = GdipCreateFromHDC(hdc, &graphics); @@ -755,6 +1338,7 @@ GdipDeletePen(pen); GdipDeleteGraphics(graphics); + GdipDeleteRegion(clip); GdipDeletePath(path); GdipDeleteBrush((GpBrush*)brush); GdipDeleteRegion(region); @@ -1077,6 +1661,614 @@ ReleaseDC(0, hdc); } +static void test_GdipGetVisibleClipBounds_screen(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + HDC hdc = GetDC(0); + GpRectF rectf, exp, clipr; + GpRect recti; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + /* no clipping rect */ + exp.X = 0; + exp.Y = 0; + exp.Width = GetDeviceCaps(hdc, HORZRES); + exp.Height = GetDeviceCaps(hdc, VERTRES); + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == exp.X && + rectf.Y == exp.Y && + rectf.Width == exp.Width && + rectf.Height == exp.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the screen (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + /* clipping rect entirely within window */ + exp.X = clipr.X = 10; + exp.Y = clipr.Y = 12; + exp.Width = clipr.Width = 14; + exp.Height = clipr.Height = 16; + + status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace); + expect(Ok, status); + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == exp.X && + rectf.Y == exp.Y && + rectf.Width == exp.Width && + rectf.Height == exp.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + /* clipping rect partially outside of screen */ + clipr.X = -10; + clipr.Y = -12; + clipr.Width = 20; + clipr.Height = 24; + + status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace); + expect(Ok, status); + + exp.X = 0; + exp.Y = 0; + exp.Width = 10; + exp.Height = 12; + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == exp.X && + rectf.Y == exp.Y && + rectf.Width == exp.Width && + rectf.Height == exp.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + status = GdipGetVisibleClipBoundsI(graphics, &recti); + expect(Ok, status); + ok(recti.X == exp.X && + recti.Y == exp.Y && + recti.Width == exp.Width && + recti.Height == exp.Height, + "Expected clip bounds (%d, %d, %d, %d) to be the size of " + "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + recti.X, recti.Y, recti.Width, recti.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + +static void test_GdipGetVisibleClipBounds_window(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpRectF rectf, window, exp, clipr; + GpRect recti; + HWND hwnd; + WNDCLASSA class; + HDC hdc; + PAINTSTRUCT ps; + HINSTANCE hInstance = GetModuleHandle(NULL); + RECT wnd_rect; + + window.X = 0; + window.Y = 0; + window.Width = 200; + window.Height = 300; + + class.lpszClassName = "ClipBoundsTestClass"; + class.style = CS_HREDRAW | CS_VREDRAW; + class.lpfnWndProc = DefWindowProcA; + class.hInstance = hInstance; + class.hIcon = LoadIcon(0, IDI_APPLICATION); + class.hCursor = LoadCursor(NULL, IDC_ARROW); + class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + class.lpszMenuName = 0; + class.cbClsExtra = 0; + class.cbWndExtra = 0; + RegisterClass(&class); + + hwnd = CreateWindow(class.lpszClassName, "ClipboundsTest", + WS_OVERLAPPEDWINDOW, window.X, window.Y, window.Width, window.Height, + NULL, NULL, hInstance, NULL); + + ok(hwnd != NULL, "Expected window to be created\n"); + + /* get client area size */ + ok(GetClientRect(hwnd, &wnd_rect), "GetClientRect should have succeeded\n"); + window.X = wnd_rect.left; + window.Y = wnd_rect.top; + window.Width = wnd_rect.right - wnd_rect.left; + window.Height = wnd_rect.bottom - wnd_rect.top; + + hdc = BeginPaint(hwnd, &ps); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == window.X && + rectf.Y == window.Y && + rectf.Width == window.Width && + rectf.Height == window.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the window (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + window.X, window.Y, window.Width, window.Height); + + /* clipping rect entirely within window */ + exp.X = clipr.X = 20; + exp.Y = clipr.Y = 8; + exp.Width = clipr.Width = 30; + exp.Height = clipr.Height = 20; + + status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace); + expect(Ok, status); + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == exp.X && + rectf.Y == exp.Y && + rectf.Width == exp.Width && + rectf.Height == exp.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + /* clipping rect partially outside of window */ + clipr.X = window.Width - 10; + clipr.Y = window.Height - 15; + clipr.Width = 20; + clipr.Height = 30; + + status = GdipSetClipRect(graphics, clipr.X, clipr.Y, clipr.Width, clipr.Height, CombineModeReplace); + expect(Ok, status); + + exp.X = window.Width - 10; + exp.Y = window.Height - 15; + exp.Width = 10; + exp.Height = 15; + + status = GdipGetVisibleClipBounds(graphics, &rectf); + expect(Ok, status); + ok(rectf.X == exp.X && + rectf.Y == exp.Y && + rectf.Width == exp.Width && + rectf.Height == exp.Height, + "Expected clip bounds (%0.f, %0.f, %0.f, %0.f) to be the size of " + "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + rectf.X, rectf.Y, rectf.Width, rectf.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + status = GdipGetVisibleClipBoundsI(graphics, &recti); + expect(Ok, status); + ok(recti.X == exp.X && + recti.Y == exp.Y && + recti.Width == exp.Width && + recti.Height == exp.Height, + "Expected clip bounds (%d, %d, %d, %d) to be the size of " + "the visible clipping rect (%0.f, %0.f, %0.f, %0.f)\n", + recti.X, recti.Y, recti.Width, recti.Height, + exp.X, exp.Y, exp.Width, exp.Height); + + GdipDeleteGraphics(graphics); + EndPaint(hwnd, &ps); + DestroyWindow(hwnd); +} + +static void test_GdipGetVisibleClipBounds(void) +{ + GpGraphics* graphics = NULL; + GpRectF rectf; + GpRect rect; + HDC hdc = GetDC(0); + GpStatus status; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + /* test null parameters */ + status = GdipGetVisibleClipBounds(graphics, NULL); + expect(InvalidParameter, status); + + status = GdipGetVisibleClipBounds(NULL, &rectf); + expect(InvalidParameter, status); + + status = GdipGetVisibleClipBoundsI(graphics, NULL); + expect(InvalidParameter, status); + + status = GdipGetVisibleClipBoundsI(NULL, &rect); + expect(InvalidParameter, status); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); + + test_GdipGetVisibleClipBounds_screen(); + test_GdipGetVisibleClipBounds_window(); +} + +static void test_fromMemoryBitmap(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpBitmap *bitmap = NULL; + BYTE bits[48] = {0}; + + status = GdipCreateBitmapFromScan0(4, 4, 12, PixelFormat24bppRGB, bits, &bitmap); + expect(Ok, status); + + status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, status); + + status = GdipGraphicsClear(graphics, 0xff686868); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + /* drawing writes to the memory provided */ + todo_wine expect(0x68, bits[10]); + + GdipDisposeImage((GpImage*)bitmap); +} + +static void test_GdipIsVisiblePoint(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + HDC hdc = GetDC(0); + REAL x, y; + BOOL val; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + /* null parameters */ + status = GdipIsVisiblePoint(NULL, 0, 0, &val); + expect(InvalidParameter, status); + + status = GdipIsVisiblePoint(graphics, 0, 0, NULL); + expect(InvalidParameter, status); + + status = GdipIsVisiblePointI(NULL, 0, 0, &val); + expect(InvalidParameter, status); + + status = GdipIsVisiblePointI(graphics, 0, 0, NULL); + expect(InvalidParameter, status); + + x = 0; + y = 0; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = -10; + y = 0; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 0; + y = -5; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 1; + y = 1; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + status = GdipSetClipRect(graphics, 10, 20, 30, 40, CombineModeReplace); + expect(Ok, status); + + x = 1; + y = 1; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 15.5; + y = 40.5; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + /* translate into the center of the rect */ + GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend); + + x = 0; + y = 0; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f) to be visible\n", x, y); + + x = 25; + y = 40; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f) not to be visible\n", x, y); + + GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend); + + /* corner cases */ + x = 9; + y = 19; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 9.25; + y = 19.25; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 9.5; + y = 19.5; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 9.75; + y = 19.75; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 10; + y = 20; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 40; + y = 20; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 39; + y = 59; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 39.25; + y = 59.25; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 39.5; + y = 39.5; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 39.75; + y = 59.75; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 40; + y = 60; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 40.15; + y = 60.15; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + x = 10; + y = 60; + status = GdipIsVisiblePoint(graphics, x, y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + /* integer version */ + x = 25; + y = 30; + status = GdipIsVisiblePointI(graphics, (INT)x, (INT)y, &val); + expect(Ok, status); + ok(val == TRUE, "After clipping, expected (%.2f, %.2f) to be visible\n", x, y); + + x = 50; + y = 100; + status = GdipIsVisiblePointI(graphics, (INT)x, (INT)y, &val); + expect(Ok, status); + ok(val == FALSE, "After clipping, expected (%.2f, %.2f) not to be visible\n", x, y); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + +static void test_GdipIsVisibleRect(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + HDC hdc = GetDC(0); + REAL x, y, width, height; + BOOL val; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipIsVisibleRect(NULL, 0, 0, 0, 0, &val); + expect(InvalidParameter, status); + + status = GdipIsVisibleRect(graphics, 0, 0, 0, 0, NULL); + expect(InvalidParameter, status); + + status = GdipIsVisibleRectI(NULL, 0, 0, 0, 0, &val); + expect(InvalidParameter, status); + + status = GdipIsVisibleRectI(graphics, 0, 0, 0, 0, NULL); + expect(InvalidParameter, status); + + /* entirely within the visible region */ + x = 0; width = 10; + y = 0; height = 10; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* partially outside */ + x = -10; width = 20; + y = -10; height = 20; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* entirely outside */ + x = -10; width = 5; + y = -10; height = 5; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + status = GdipSetClipRect(graphics, 10, 20, 30, 40, CombineModeReplace); + expect(Ok, status); + + /* entirely within the visible region */ + x = 12; width = 10; + y = 22; height = 10; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* partially outside */ + x = 35; width = 10; + y = 55; height = 10; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* entirely outside */ + x = 45; width = 5; + y = 65; height = 5; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + /* translate into center of clipping rect */ + GdipTranslateWorldTransform(graphics, 25, 40, MatrixOrderAppend); + + x = 0; width = 10; + y = 0; height = 10; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + x = 25; width = 5; + y = 40; height = 5; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + GdipTranslateWorldTransform(graphics, -25, -40, MatrixOrderAppend); + + /* corners entirely outside, but some intersections */ + x = 0; width = 70; + y = 0; height = 90; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + x = 0; width = 70; + y = 0; height = 30; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + x = 0; width = 30; + y = 0; height = 90; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* edge cases */ + x = 0; width = 10; + y = 20; height = 40; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + x = 10; width = 30; + y = 0; height = 20; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + x = 40; width = 10; + y = 20; height = 40; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + x = 10; width = 30; + y = 60; height = 10; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == FALSE, "Expected (%.2f, %.2f, %.2f, %.2f) not to be visible\n", x, y, width, height); + + /* rounding tests */ + x = 0.4; width = 10.4; + y = 20; height = 40; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + x = 10; width = 30; + y = 0.4; height = 20.4; + status = GdipIsVisibleRect(graphics, x, y, width, height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + /* integer version */ + x = 0; width = 30; + y = 0; height = 90; + status = GdipIsVisibleRectI(graphics, (INT)x, (INT)y, (INT)width, (INT)height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + x = 12; width = 10; + y = 22; height = 10; + status = GdipIsVisibleRectI(graphics, (INT)x, (INT)y, (INT)width, (INT)height, &val); + expect(Ok, status); + ok(val == TRUE, "Expected (%.2f, %.2f, %.2f, %.2f) to be visible\n", x, y, width, height); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} START_TEST(graphics) { @@ -1095,15 +2287,26 @@ test_GdipDrawBezierI(); test_GdipDrawArc(); test_GdipDrawArcI(); + test_GdipDrawCurve(); + test_GdipDrawCurveI(); + test_GdipDrawCurve2(); + test_GdipDrawCurve2I(); + test_GdipDrawCurve3(); + test_GdipDrawCurve3I(); test_GdipDrawLineI(); test_GdipDrawLinesI(); test_GdipDrawString(); + test_GdipGetVisibleClipBounds(); + test_GdipIsVisiblePoint(); + test_GdipIsVisibleRect(); test_Get_Release_DC(); + test_BeginContainer2(); test_transformpoints(); test_get_set_clip(); test_isempty(); test_clear(); test_textcontrast(); + test_fromMemoryBitmap(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/graphicspath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/graphic…
============================================================================== --- trunk/rostests/winetests/gdiplus/graphicspath.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/graphicspath.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -410,11 +410,14 @@ status = GdipGetPathWorldBounds(path, &bounds, matrix, NULL); expect(Ok, status); GdipDeletePath(path); + GdipDeleteMatrix(matrix); expectf(-209.6, bounds.X); expectf(-1274.8, bounds.Y); expectf(705.0, bounds.Width); expectf(945.0, bounds.Height); + + GdipDeletePen(pen); } static path_test_t pathpath_path[] = { Modified: trunk/rostests/winetests/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/image.c…
============================================================================== --- trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/image.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -27,28 +27,34 @@ #include "gdiplus.h" #include "wine/test.h" -#define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got) +#define expect(expected, got) ok((UINT)(got) == (UINT)(expected), "Expected %.8x, got %.8x\n", (UINT)(expected), (UINT)(got)) #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got) -static void expect_rawformat(REFGUID expected, GpImage *img, int line, BOOL todo) -{ - GUID raw; +static void expect_guid(REFGUID expected, REFGUID got, int line, BOOL todo) +{ WCHAR bufferW[39]; char buffer[39]; char buffer2[39]; - GpStatus stat; - - stat = GdipGetImageRawFormat(img, &raw); - ok_(__FILE__, line)(stat == Ok, "GdipGetImageRawFormat failed with %d\n", stat); - if(stat != Ok) return; - StringFromGUID2(&raw, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); + + StringFromGUID2(got, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer, sizeof(buffer), NULL, NULL); StringFromGUID2(expected, bufferW, sizeof(bufferW)/sizeof(bufferW[0])); WideCharToMultiByte(CP_ACP, 0, bufferW, sizeof(bufferW)/sizeof(bufferW[0]), buffer2, sizeof(buffer2), NULL, NULL); if(todo) - todo_wine ok_(__FILE__, line)(IsEqualGUID(&raw, expected), "Expected format %s, got %s\n", buffer2, buffer); + todo_wine ok_(__FILE__, line)(IsEqualGUID(expected, got), "Expected %s, got %s\n", buffer2, buffer); else - ok_(__FILE__, line)(IsEqualGUID(&raw, expected), "Expected format %s, got %s\n", buffer2, buffer); + ok_(__FILE__, line)(IsEqualGUID(expected, got), "Expected %s, got %s\n", buffer2, buffer); +} + +static void expect_rawformat(REFGUID expected, GpImage *img, int line, BOOL todo) +{ + GUID raw; + GpStatus stat; + + stat = GdipGetImageRawFormat(img, &raw); + ok_(__FILE__, line)(stat == Ok, "GdipGetImageRawFormat failed with %d\n", stat); + if(stat != Ok) return; + expect_guid(expected, &raw, line, todo); } static void test_bufferrawformat(void* buff, int size, REFGUID expected, int line, BOOL todo) @@ -177,6 +183,9 @@ GpStatus stat; const REAL WIDTH = 10.0, HEIGHT = 20.0; UINT w; + GUID dimension = {0}; + UINT count; + ARGB color; bm = (GpBitmap*)0xdeadbeef; stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB,NULL, &bm); @@ -194,6 +203,26 @@ stat = GdipImageGetFrameDimensionsCount((GpImage*)bm,&w); expect(Ok, stat); expect(1, w); + + stat = GdipImageGetFrameDimensionsList((GpImage*)bm, &dimension, 1); + expect(Ok, stat); + expect_guid(&FrameDimensionPage, &dimension, __LINE__, TRUE); + + count = 12345; + stat = GdipImageGetFrameCount((GpImage*)bm, &dimension, &count); + todo_wine expect(Ok, stat); + todo_wine expect(1, count); + + GdipBitmapSetPixel(bm, 0, 0, 0xffffffff); + + stat = GdipImageSelectActiveFrame((GpImage*)bm, &dimension, 0); + expect(Ok, stat); + + /* SelectActiveFrame has no effect on image data of memory bitmaps */ + color = 0xdeadbeef; + GdipBitmapGetPixel(bm, 0, 0, &color); + expect(0xffffffff, color); + GdipDisposeImage((GpImage*)bm); } @@ -465,6 +494,7 @@ const REAL HEIGHT2 = 20; HDC hdc; BITMAPINFO bmi; + BYTE *bits; stat = GdipCreateBitmapFromHBITMAP(NULL, NULL, NULL); expect(InvalidParameter, stat); @@ -486,7 +516,7 @@ stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); expect(Ok, stat); /* raw format */ - expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)gpbm, __LINE__, TRUE); + expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)gpbm, __LINE__, FALSE); expect(Ok, GdipGetImageDimension((GpImage*) gpbm, &width, &height)); expectf(WIDTH2, width); @@ -504,8 +534,10 @@ bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biCompression = BI_RGB; - hbm = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); + hbm = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hbm != NULL, "CreateDIBSection failed\n"); + + bits[0] = 0; stat = GdipCreateBitmapFromHBITMAP(hbm, NULL, &gpbm); expect(Ok, stat); @@ -513,11 +545,20 @@ expectf(WIDTH1, width); expectf(HEIGHT1, height); if (stat == Ok) + { + /* test whether writing to the bitmap affects the original */ + stat = GdipBitmapSetPixel(gpbm, 0, 0, 0xffffffff); + expect(Ok, stat); + + expect(0, bits[0]); + GdipDisposeImage((GpImage*)gpbm); + } LogPal = GdipAlloc(sizeof(LOGPALETTE)); ok(LogPal != NULL, "unable to allocate LOGPALETTE\n"); LogPal->palVersion = 0x300; + LogPal->palNumEntries = 1; hpal = CreatePalette(LogPal); ok(hpal != NULL, "CreatePalette failed\n"); GdipFree(LogPal); @@ -564,12 +605,12 @@ /* Create an image, clone it, delete the original, make sure the copy works */ stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm); expect(Ok, stat); - expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bm, __LINE__, TRUE); + expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bm, __LINE__, FALSE); image_src = ((GpImage*)bm); stat = GdipCloneImage(image_src, &image_dest); expect(Ok, stat); - expect_rawformat(&ImageFormatMemoryBMP, image_dest, __LINE__, TRUE); + expect_rawformat(&ImageFormatMemoryBMP, image_dest, __LINE__, FALSE); stat = GdipDisposeImage((GpImage*)bm); expect(Ok, stat); @@ -646,7 +687,7 @@ stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); expect(PixelFormat32bppARGB, format); /* raw format */ - expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, TRUE); + expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, FALSE); GdipDisposeImage((GpImage*)bitmap); } DestroyIcon(hIcon); @@ -682,7 +723,7 @@ stat = GdipGetImagePixelFormat((GpImage*)bitmap, &format); expect(PixelFormat32bppARGB, format); /* raw format */ - expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, TRUE); + expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bitmap, __LINE__, FALSE); GdipDisposeImage((GpImage*)bitmap); } DestroyIcon(hIcon); @@ -735,10 +776,320 @@ }; static void test_getrawformat(void) { - test_bufferrawformat((void*)pngimage, sizeof(pngimage), &ImageFormatPNG, __LINE__, TRUE); - test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, TRUE); + test_bufferrawformat((void*)pngimage, sizeof(pngimage), &ImageFormatPNG, __LINE__, FALSE); + test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, FALSE); test_bufferrawformat((void*)bmpimage, sizeof(bmpimage), &ImageFormatBMP, __LINE__, FALSE); - test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, TRUE); + test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, FALSE); +} + +static void test_createhbitmap(void) +{ + GpStatus stat; + GpBitmap *bitmap; + HBITMAP hbitmap, oldhbitmap; + BITMAP bm; + int ret; + HDC hdc; + COLORREF pixel; + BYTE bits[640]; + + memset(bits, 0x68, 640); + + /* create Bitmap */ + stat = GdipCreateBitmapFromScan0(10, 20, 32, PixelFormat24bppRGB, bits, &bitmap); + expect(Ok, stat); + + /* test NULL values */ + stat = GdipCreateHBITMAPFromBitmap(NULL, &hbitmap, 0); + expect(InvalidParameter, stat); + + stat = GdipCreateHBITMAPFromBitmap(bitmap, NULL, 0); + expect(InvalidParameter, stat); + + /* create HBITMAP */ + stat = GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); + expect(Ok, stat); + + if (stat == Ok) + { + ret = GetObjectA(hbitmap, sizeof(BITMAP), &bm); + expect(sizeof(BITMAP), ret); + + expect(0, bm.bmType); + expect(10, bm.bmWidth); + expect(20, bm.bmHeight); + expect(40, bm.bmWidthBytes); + expect(1, bm.bmPlanes); + expect(32, bm.bmBitsPixel); + ok(bm.bmBits != NULL, "got DDB, expected DIB\n"); + + hdc = CreateCompatibleDC(NULL); + + oldhbitmap = SelectObject(hdc, hbitmap); + pixel = GetPixel(hdc, 5, 5); + SelectObject(hdc, oldhbitmap); + + DeleteDC(hdc); + + expect(0x686868, pixel); + + DeleteObject(hbitmap); + } + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); +} + +static void test_getsetpixel(void) +{ + GpStatus stat; + GpBitmap *bitmap; + ARGB color; + BYTE bits[16] = {0x00,0x00,0x00,0x00, 0x00,0xff,0xff,0x00, + 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00}; + + stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, bits, &bitmap); + expect(Ok, stat); + + /* null parameters */ + stat = GdipBitmapGetPixel(NULL, 1, 1, &color); + expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 1, NULL); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(NULL, 1, 1, 0); + expect(InvalidParameter, stat); + + /* out of bounds */ + stat = GdipBitmapGetPixel(bitmap, -1, 1, &color); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, -1, 1, 0); + expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, -1, &color); + ok(stat == InvalidParameter || + broken(stat == Ok), /* Older gdiplus */ + "Expected InvalidParameter, got %.8x\n", stat); + + stat = GdipBitmapSetPixel(bitmap, 1, -1, 0); + ok(stat == InvalidParameter || + broken(stat == Ok), /* Older gdiplus */ + "Expected InvalidParameter, got %.8x\n", stat); + + stat = GdipBitmapGetPixel(bitmap, 2, 1, &color); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, 2, 1, 0); + expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 2, &color); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, 1, 2, 0); + expect(InvalidParameter, stat); + + /* valid use */ + stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); + expect(Ok, stat); + expect(0xffffffff, color); + + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipBitmapSetPixel(bitmap, 1, 1, 0xff676869); + expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap, 0, 0, 0xff474849); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); + expect(Ok, stat); + expect(0xff676869, color); + + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + expect(Ok, stat); + expect(0xff474849, color); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); +} + +static void check_halftone_palette(ColorPalette *palette) +{ + static const BYTE halftone_values[6]={0x00,0x33,0x66,0x99,0xcc,0xff}; + UINT i; + + for (i=0; i<palette->Count; i++) + { + ARGB expected=0xff000000; + if (i<8) + { + if (i&1) expected |= 0x800000; + if (i&2) expected |= 0x8000; + if (i&4) expected |= 0x80; + } + else if (i == 8) + { + expected = 0xffc0c0c0; + } + else if (i < 16) + { + if (i&1) expected |= 0xff0000; + if (i&2) expected |= 0xff00; + if (i&4) expected |= 0xff; + } + else if (i < 40) + { + expected = 0x00000000; + } + else + { + expected |= halftone_values[(i-40)%6]; + expected |= halftone_values[((i-40)/6)%6] << 8; + expected |= halftone_values[((i-40)/36)%6] << 16; + } + ok(expected == palette->Entries[i], "Expected %.8x, got %.8x, i=%u/%u\n", + expected, palette->Entries[i], i, palette->Count); + } +} + +static void test_palette(void) +{ + GpStatus stat; + GpBitmap *bitmap; + INT size; + BYTE buffer[1040]; + ColorPalette *palette=(ColorPalette*)buffer; + + /* test initial palette from non-indexed bitmap */ + stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB), size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(0, palette->Count); + + /* test setting palette on not-indexed bitmap */ + palette->Count = 3; + + stat = GdipSetImagePalette((GpImage*)bitmap, palette); + expect(Ok, stat); + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*3, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(3, palette->Count); + + GdipDisposeImage((GpImage*)bitmap); + + /* test initial palette on 1-bit bitmap */ + stat = GdipCreateBitmapFromScan0(2, 2, 4, PixelFormat1bppIndexed, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*2, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(PaletteFlagsGrayScale, palette->Flags); + expect(2, palette->Count); + + expect(0xff000000, palette->Entries[0]); + expect(0xffffffff, palette->Entries[1]); + + GdipDisposeImage((GpImage*)bitmap); + + /* test initial palette on 4-bit bitmap */ + stat = GdipCreateBitmapFromScan0(2, 2, 4, PixelFormat4bppIndexed, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*16, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(0, palette->Flags); + expect(16, palette->Count); + + check_halftone_palette(palette); + + GdipDisposeImage((GpImage*)bitmap); + + /* test initial palette on 8-bit bitmap */ + stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat8bppIndexed, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*256, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(PaletteFlagsHalftone, palette->Flags); + expect(256, palette->Count); + + check_halftone_palette(palette); + + /* test setting/getting a different palette */ + palette->Entries[1] = 0xffcccccc; + + stat = GdipSetImagePalette((GpImage*)bitmap, palette); + expect(Ok, stat); + + palette->Entries[1] = 0; + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*256, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(PaletteFlagsHalftone, palette->Flags); + expect(256, palette->Count); + expect(0xffcccccc, palette->Entries[1]); + + /* test count < 256 */ + palette->Flags = 12345; + palette->Count = 3; + + stat = GdipSetImagePalette((GpImage*)bitmap, palette); + expect(Ok, stat); + + palette->Entries[1] = 0; + palette->Entries[3] = 0xdeadbeef; + + stat = GdipGetImagePaletteSize((GpImage*)bitmap, &size); + expect(Ok, stat); + expect(sizeof(UINT)*2+sizeof(ARGB)*3, size); + + stat = GdipGetImagePalette((GpImage*)bitmap, palette, size); + expect(Ok, stat); + expect(12345, palette->Flags); + expect(3, palette->Count); + expect(0xffcccccc, palette->Entries[1]); + expect(0xdeadbeef, palette->Entries[3]); + + /* test count > 256 */ + palette->Count = 257; + + stat = GdipSetImagePalette((GpImage*)bitmap, palette); + ok(stat == InvalidParameter || + broken(stat == Ok), /* Old gdiplus behavior */ + "Expected %.8x, got %.8x\n", InvalidParameter, stat); + + GdipDisposeImage((GpImage*)bitmap); } START_TEST(image) @@ -766,6 +1117,9 @@ test_testcontrol(); test_fromhicon(); test_getrawformat(); + test_createhbitmap(); + test_getsetpixel(); + test_palette(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/pathiterator.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/pathite…
============================================================================== --- trunk/rostests/winetests/gdiplus/pathiterator.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/pathiterator.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -36,8 +36,11 @@ /* NULL args */ stat = GdipCreatePathIter(NULL, NULL); expect(InvalidParameter, stat); + iter = NULL; stat = GdipCreatePathIter(&iter, NULL); expect(Ok, stat); + ok(iter != NULL, "Expected iterator to be created\n"); + GdipDeletePathIter(iter); stat = GdipCreatePathIter(NULL, path); expect(InvalidParameter, stat); stat = GdipDeletePathIter(NULL); Modified: trunk/rostests/winetests/gdiplus/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/pen.c?r…
============================================================================== --- trunk/rostests/winetests/gdiplus/pen.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/pen.c [iso-8859-1] Sun Jan 3 11:54:40 2010 @@ -33,21 +33,28 @@ Status status; struct GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; - - gdiplusStartupInput.GdiplusVersion = 1; + int gpversion; + gdiplusStartupInput.DebugEventCallback = NULL; gdiplusStartupInput.SuppressBackgroundThread = 0; gdiplusStartupInput.SuppressExternalCodecs = 0; - status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); - expect(Ok, status); - GdiplusShutdown(gdiplusToken); - - gdiplusStartupInput.GdiplusVersion = 2; - - status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); - expect(UnsupportedGdiplusVersion, status); - GdiplusShutdown(gdiplusToken); + for (gpversion=1; gpversion<256; gpversion++) + { + gdiplusStartupInput.GdiplusVersion = gpversion; + status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + ok(status == Ok || status == UnsupportedGdiplusVersion, + "GdiplusStartup returned %x\n", status); + GdiplusShutdown(gdiplusToken); + if (status != Ok) + { + gpversion--; + break; + } + } + + ok(gpversion > 0 && gpversion <= 2, "unexpected gdiplus version %i\n", gpversion); + trace("gdiplus version is %i\n", gpversion); status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen); @@ -219,7 +226,8 @@ /* Try to set with count = 0. */ GdipSetPenDashStyle(pen, DashStyleDot); status = GdipSetPenDashArray(pen, dashes, 0); - expect(OutOfMemory, status); + ok(status == OutOfMemory || status == InvalidParameter, + "Expected OutOfMemory or InvalidParameter, got %.8x\n", status); GdipGetPenDashStyle(pen, &style); expect(DashStyleDot, style);
14 years, 11 months
1
0
0
0
[cwittich] 44905: sync gdiplus with wine 1.1.35
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Jan 3 11:54:14 2010 New Revision: 44905 URL:
http://svn.reactos.org/svn/reactos?rev=44905&view=rev
Log: sync gdiplus with wine 1.1.35 Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h trunk/reactos/dll/win32/gdiplus/graphics.c trunk/reactos/dll/win32/gdiplus/image.c trunk/reactos/dll/win32/gdiplus/region.c trunk/reactos/include/psdk/gdiplusenums.h trunk/reactos/include/psdk/gdiplusflat.h trunk/reactos/include/psdk/gdiplusimaging.h Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -213,6 +213,10 @@ ImageType type; GUID format; UINT flags; + UINT palette_flags; + UINT palette_count; + UINT palette_size; + ARGB *palette_entries; }; struct GpMetafile{ Modified: trunk/reactos/dll/win32/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -1256,6 +1256,10 @@ (*metafile)->image.type = ImageTypeMetafile; memcpy(&(*metafile)->image.format, &ImageFormatWMF, sizeof(GUID)); + (*metafile)->image.palette_flags = 0; + (*metafile)->image.palette_count = 0; + (*metafile)->image.palette_size = 0; + (*metafile)->image.palette_entries = NULL; (*metafile)->bounds.X = ((REAL) placeable->BoundingBox.Left) / ((REAL) placeable->Inch); (*metafile)->bounds.Y = ((REAL) placeable->BoundingBox.Right) / ((REAL) placeable->Inch); (*metafile)->bounds.Width = ((REAL) (placeable->BoundingBox.Right @@ -4157,6 +4161,7 @@ /* free everything except root node and header */ delete_element(®ion->node); memcpy(region, clip, sizeof(GpRegion)); + GdipFree(clip); return Ok; } Modified: trunk/reactos/dll/win32/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -607,17 +607,73 @@ GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap) { - FIXME("(%f,%f,%f,%f,%i,%p,%p): stub\n", x, y, width, height, format, srcBitmap, dstBitmap); - - return NotImplemented; + BitmapData lockeddata_src, lockeddata_dst; + int i; + UINT row_size; + Rect area; + GpStatus stat; + + TRACE("(%f,%f,%f,%f,%i,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); + + if (!srcBitmap || !dstBitmap || srcBitmap->image.type != ImageTypeBitmap || + x < 0 || y < 0 || + x + width > srcBitmap->width || y + height > srcBitmap->height) + { + TRACE("<-- InvalidParameter\n"); + return InvalidParameter; + } + + if (format == PixelFormatDontCare) + format = srcBitmap->format; + + area.X = roundr(x); + area.Y = roundr(y); + area.Width = roundr(width); + area.Height = roundr(height); + + stat = GdipBitmapLockBits(srcBitmap, &area, ImageLockModeRead, format, + &lockeddata_src); + if (stat != Ok) return stat; + + stat = GdipCreateBitmapFromScan0(lockeddata_src.Width, lockeddata_src.Height, + 0, lockeddata_src.PixelFormat, NULL, dstBitmap); + if (stat == Ok) + { + stat = GdipBitmapLockBits(*dstBitmap, NULL, ImageLockModeWrite, + lockeddata_src.PixelFormat, &lockeddata_dst); + + if (stat == Ok) + { + /* copy the image data */ + row_size = (lockeddata_src.Width * PIXELFORMATBPP(lockeddata_src.PixelFormat) +7)/8; + for (i=0; i<lockeddata_src.Height; i++) + memcpy((BYTE*)lockeddata_dst.Scan0+lockeddata_dst.Stride*i, + (BYTE*)lockeddata_src.Scan0+lockeddata_src.Stride*i, + row_size); + + GdipBitmapUnlockBits(*dstBitmap, &lockeddata_dst); + } + + if (stat != Ok) + GdipDisposeImage((GpImage*)*dstBitmap); + } + + GdipBitmapUnlockBits(srcBitmap, &lockeddata_src); + + if (stat != Ok) + { + *dstBitmap = NULL; + } + + return stat; } GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap) { - FIXME("(%i,%i,%i,%i,%i,%p,%p): stub\n", x, y, width, height, format, srcBitmap, dstBitmap); - - return NotImplemented; + TRACE("(%i,%i,%i,%i,%i,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap); + + return GdipCloneBitmapArea(x, y, width, height, format, srcBitmap, dstBitmap); } GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage) @@ -690,12 +746,14 @@ GdipBitmapUnlockBits((GpBitmap*)*cloneImage, &lockeddata_dst); } - GdipBitmapUnlockBits(bitmap, &lockeddata_src); + if (stat != Ok) + GdipDisposeImage(*cloneImage); } + + GdipBitmapUnlockBits(bitmap, &lockeddata_src); if (stat != Ok) { - GdipDisposeImage(*cloneImage); *cloneImage = NULL; } else memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID)); @@ -1076,6 +1134,44 @@ return Ok; } +static void generate_halftone_palette(ARGB *entries, UINT count) +{ + static const BYTE halftone_values[6]={0x00,0x33,0x66,0x99,0xcc,0xff}; + UINT i; + + for (i=0; i<8 && i<count; i++) + { + entries[i] = 0xff000000; + if (i&1) entries[i] |= 0x800000; + if (i&2) entries[i] |= 0x8000; + if (i&4) entries[i] |= 0x80; + } + + if (8 < count) + entries[i] = 0xffc0c0c0; + + for (i=9; i<16 && i<count; i++) + { + entries[i] = 0xff000000; + if (i&1) entries[i] |= 0xff0000; + if (i&2) entries[i] |= 0xff00; + if (i&4) entries[i] |= 0xff; + } + + for (i=16; i<40 && i<count; i++) + { + entries[i] = 0; + } + + for (i=40; i<256 && i<count; i++) + { + entries[i] = 0xff000000; + entries[i] |= halftone_values[(i-40)%6]; + entries[i] |= halftone_values[((i-40)/6)%6] << 8; + entries[i] |= halftone_values[((i-40)/36)%6] << 16; + } +} + GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { @@ -1143,6 +1239,10 @@ (*bitmap)->image.type = ImageTypeBitmap; memcpy(&(*bitmap)->image.format, &ImageFormatMemoryBMP, sizeof(GUID)); (*bitmap)->image.flags = ImageFlagsNone; + (*bitmap)->image.palette_flags = 0; + (*bitmap)->image.palette_count = 0; + (*bitmap)->image.palette_size = 0; + (*bitmap)->image.palette_entries = NULL; (*bitmap)->width = width; (*bitmap)->height = height; (*bitmap)->format = format; @@ -1152,6 +1252,36 @@ (*bitmap)->bits = bits; (*bitmap)->stride = dib_stride; + if (format == PixelFormat1bppIndexed || + format == PixelFormat4bppIndexed || + format == PixelFormat8bppIndexed) + { + (*bitmap)->image.palette_size = (*bitmap)->image.palette_count = 1 << PIXELFORMATBPP(format); + (*bitmap)->image.palette_entries = GdipAlloc(sizeof(ARGB) * ((*bitmap)->image.palette_size)); + + if (!(*bitmap)->image.palette_entries) + { + GdipDisposeImage(&(*bitmap)->image); + *bitmap = NULL; + return OutOfMemory; + } + + if (format == PixelFormat1bppIndexed) + { + (*bitmap)->image.palette_flags = PaletteFlagsGrayScale; + (*bitmap)->image.palette_entries[0] = 0xff000000; + (*bitmap)->image.palette_entries[1] = 0xffffffff; + } + else + { + if (format == PixelFormat8bppIndexed) + (*bitmap)->image.palette_flags = PaletteFlagsHalftone; + + generate_halftone_palette((*bitmap)->image.palette_entries, + (*bitmap)->image.palette_count); + } + } + return Ok; } @@ -1260,6 +1390,7 @@ GdipFree(((GpBitmap*)image)->bitmapbits); DeleteDC(((GpBitmap*)image)->hdc); } + GdipFree(image->palette_entries); GdipFree(image); return Ok; @@ -1402,12 +1533,19 @@ GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size) { - FIXME("%p %p\n", image, size); + TRACE("%p %p\n", image, size); if(!image || !size) return InvalidParameter; - return NotImplemented; + if (image->palette_count == 0) + *size = sizeof(ColorPalette); + else + *size = sizeof(UINT)*2 + sizeof(ARGB)*image->palette_count; + + TRACE("<-- %u\n", *size); + + return Ok; } /* FIXME: test this function for non-bitmap types */ @@ -1833,6 +1971,10 @@ (*image)->type = ImageTypeMetafile; (*image)->picture = pic; (*image)->flags = ImageFlagsNone; + (*image)->palette_flags = 0; + (*image)->palette_count = 0; + (*image)->palette_size = 0; + (*image)->palette_entries = NULL; return Ok; } @@ -2168,15 +2310,22 @@ */ GpStatus WINGDIPAPI GdipGetImagePalette(GpImage *image, ColorPalette *palette, INT size) { - static int calls = 0; - - if(!image) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + TRACE("(%p,%p,%i)\n", image, palette, size); + + if (!image || !palette) + return InvalidParameter; + + if (size < (sizeof(UINT)*2+sizeof(ARGB)*image->palette_count)) + { + TRACE("<-- InsufficientBuffer\n"); + return InsufficientBuffer; + } + + palette->Flags = image->palette_flags; + palette->Count = image->palette_count; + memcpy(palette->Entries, image->palette_entries, sizeof(ARGB)*image->palette_count); + + return Ok; } /***************************************************************************** @@ -2185,15 +2334,28 @@ GpStatus WINGDIPAPI GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette) { - static int calls; - - if(!image || !palette) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + TRACE("(%p,%p)\n", image, palette); + + if(!image || !palette || palette->Count > 256) + return InvalidParameter; + + if (palette->Count > image->palette_size) + { + ARGB *new_palette; + + new_palette = GdipAlloc(sizeof(ARGB) * palette->Count); + if (!new_palette) return OutOfMemory; + + GdipFree(image->palette_entries); + image->palette_entries = new_palette; + image->palette_size = palette->Count; + } + + image->palette_flags = palette->Flags; + image->palette_count = palette->Count; + memcpy(image->palette_entries, palette->Entries, sizeof(ARGB)*palette->Count); + + return Ok; } /************************************************************************* @@ -2497,7 +2659,8 @@ BITMAP bm; GpStatus retval; PixelFormat format; - BYTE* bits; + BitmapData lockeddata; + INT y; TRACE("%p %p %p\n", hbm, hpal, bitmap); @@ -2538,16 +2701,75 @@ return InvalidParameter; } - if (bm.bmBits) - bits = (BYTE*)bm.bmBits + (bm.bmHeight - 1) * bm.bmWidthBytes; - else - { - FIXME("can only get image data from DIB sections\n"); - bits = NULL; - } - - retval = GdipCreateBitmapFromScan0(bm.bmWidth, bm.bmHeight, -bm.bmWidthBytes, - format, bits, bitmap); + retval = GdipCreateBitmapFromScan0(bm.bmWidth, bm.bmHeight, 0, + format, NULL, bitmap); + + if (retval == Ok) + { + retval = GdipBitmapLockBits(*bitmap, NULL, ImageLockModeWrite, + format, &lockeddata); + if (retval == Ok) + { + if (bm.bmBits) + { + for (y=0; y<bm.bmHeight; y++) + { + memcpy((BYTE*)lockeddata.Scan0+lockeddata.Stride*y, + (BYTE*)bm.bmBits+bm.bmWidthBytes*(bm.bmHeight-1-y), + bm.bmWidthBytes); + } + } + else + { + HDC hdc; + HBITMAP oldhbm; + BITMAPINFO *pbmi; + INT src_height, dst_stride; + BYTE *dst_bits; + + hdc = CreateCompatibleDC(NULL); + oldhbm = SelectObject(hdc, hbm); + + pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); + + if (pbmi) + { + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biBitCount = 0; + + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + + src_height = abs(pbmi->bmiHeader.biHeight); + + if (pbmi->bmiHeader.biHeight > 0) + { + dst_bits = (BYTE*)lockeddata.Scan0+lockeddata.Stride*(src_height-1); + dst_stride = -lockeddata.Stride; + } + else + { + dst_bits = lockeddata.Scan0; + dst_stride = lockeddata.Stride; + } + + for (y=0; y<src_height; y++) + { + GetDIBits(hdc, hbm, y, 1, dst_bits+dst_stride*y, + pbmi, DIB_RGB_COLORS); + } + + GdipFree(pbmi); + } + else + retval = OutOfMemory; + + SelectObject(hdc, oldhbm); + DeleteDC(hdc); + } + + GdipBitmapUnlockBits(*bitmap, &lockeddata); + } + } return retval; } Modified: trunk/reactos/dll/win32/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -249,6 +249,7 @@ if(mode == CombineModeReplace){ delete_element(®ion->node); memcpy(region, path_region, sizeof(GpRegion)); + GdipFree(path_region); return Ok; } @@ -295,6 +296,7 @@ if(mode == CombineModeReplace){ delete_element(®ion->node); memcpy(region, rect_region, sizeof(GpRegion)); + GdipFree(rect_region); return Ok; } Modified: trunk/reactos/include/psdk/gdiplusenums.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusenums.…
============================================================================== --- trunk/reactos/include/psdk/gdiplusenums.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/gdiplusenums.h [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -289,6 +289,13 @@ HotkeyPrefixNone = 0, HotkeyPrefixShow = 1, HotkeyPrefixHide = 2 +}; + +enum PaletteFlags +{ + PaletteFlagsHasAlpha = 1, + PaletteFlagsGrayScale = 2, + PaletteFlagsHalftone = 4 }; enum ImageCodecFlags @@ -455,6 +462,7 @@ typedef enum StringFormatFlags StringFormatFlags; typedef enum HotkeyPrefix HotkeyPrefix; typedef enum PenAlignment GpPenAlignment; +typedef enum PaletteFlags PaletteFlags; typedef enum ImageCodecFlags ImageCodecFlags; typedef enum CombineMode CombineMode; typedef enum FlushIntention FlushIntention; Modified: trunk/reactos/include/psdk/gdiplusflat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusflat.h…
============================================================================== --- trunk/reactos/include/psdk/gdiplusflat.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/gdiplusflat.h [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -45,6 +45,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap*,GDIPCONST GpRect*,UINT, PixelFormat,BitmapData*); GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap*,INT,INT,ARGB); +GpStatus WINGDIPAPI GdipBitmapSetResolution(GpBitmap*,REAL,REAL); GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap*,BitmapData*); GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL,REAL,REAL,REAL,PixelFormat,GpBitmap*,GpBitmap**); GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT,INT,INT,INT,PixelFormat,GpBitmap*,GpBitmap**); @@ -62,11 +63,18 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap*,HBITMAP*,ARGB); GpStatus WINGDIPAPI GdipCreateHICONFromBitmap(GpBitmap*,HICON*); GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect*); +GpStatus WINGDIPAPI GdipSetEffectParameters(CGpEffect*,const VOID*,const UINT); /* Brush */ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); + +/* CachedBitmap */ +GpStatus WINGDIPAPI GdipCreateCachedBitmap(GpBitmap*,GpGraphics*, + GpCachedBitmap**); +GpStatus WINGDIPAPI GdipDeleteCachedBitmap(GpCachedBitmap*); +GpStatus WINGDIPAPI GdipDrawCachedBitmap(GpGraphics*,GpCachedBitmap*,INT,INT); /* CustomLineCap */ GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap*,GpCustomLineCap**); @@ -74,12 +82,16 @@ GpCustomLineCap**); GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap*,GpLineCap*); +GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap(GpCustomLineCap*,GpLineCap); GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset(GpCustomLineCap*,REAL*); +GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap*,REAL); GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps(GpCustomLineCap*,GpLineCap, GpLineCap); GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin(GpCustomLineCap*,GpLineJoin*); GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin(GpCustomLineCap*,GpLineJoin); GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale(GpCustomLineCap*,REAL*); +GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap*,REAL); +GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset(GpCustomLineCap*,REAL); /* Font */ GpStatus WINGDIPAPI GdipCloneFont(GpFont*,GpFont**); @@ -104,6 +116,8 @@ GpStatus WINGDIPAPI GdipNewPrivateFontCollection(GpFontCollection**); GpStatus WINGDIPAPI GdipDeletePrivateFontCollection(GpFontCollection**); GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection*, GDIPCONST WCHAR*); +GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection*, + GDIPCONST void*,INT); GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount(GpFontCollection*, INT*); GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(GpFontCollection*, INT, GpFontFamily*[], INT*); @@ -134,6 +148,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC,HANDLE,GpGraphics**); GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**); GpStatus WINGDIPAPI GdipCreateFromHWNDICM(HWND,GpGraphics**); +HPALETTE WINGDIPAPI GdipCreateHalftonePalette(void); GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *); GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics*,GpPen*,INT,INT,INT,INT,REAL,REAL); @@ -151,6 +166,8 @@ GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT,REAL); GpStatus WINGDIPAPI GdipDrawCurve3(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,INT,INT,REAL); GpStatus WINGDIPAPI GdipDrawCurve3I(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT,INT,INT,REAL); +GpStatus WINGDIPAPI GdipDrawDriverString(GpGraphics*,GDIPCONST UINT16*,INT, + GDIPCONST GpFont*,GDIPCONST GpBrush*,GDIPCONST PointF*,INT,GDIPCONST GpMatrix*); GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics*,GpPen*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipDrawImage(GpGraphics*,GpImage*,REAL,REAL); @@ -217,6 +234,8 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics*,HDC*); GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics*,REAL*); GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics*,REAL*); +GpStatus WINGDIPAPI GdipGetImageDecoders(UINT,UINT,ImageCodecInfo*); +GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT*,UINT*); GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage*,GpGraphics**); GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*); GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics*,ARGB*); @@ -238,9 +257,17 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics*, GDIPCONST WCHAR*, INT, GDIPCONST GpFont*, GDIPCONST RectF*, GDIPCONST GpStringFormat*, INT, GpRegion**); +GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics*,GDIPCONST UINT16*,INT, + GDIPCONST GpFont*,GDIPCONST PointF*,INT,GDIPCONST GpMatrix*,RectF*); GpStatus WINGDIPAPI GdipMeasureString(GpGraphics*,GDIPCONST WCHAR*,INT, GDIPCONST GpFont*,GDIPCONST RectF*,GDIPCONST GpStringFormat*,RectF*,INT*,INT*); GpStatus WINGDIPAPI GdipMultiplyWorldTransform(GpGraphics*,GDIPCONST GpMatrix*,GpMatrixOrder); +GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR*,HDC,EmfType, + GDIPCONST GpRectF*,MetafileFrameUnit,GDIPCONST WCHAR*,GpMetafile**); +GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(GDIPCONST WCHAR*,HDC,EmfType, + GDIPCONST GpRect*,MetafileFrameUnit,GDIPCONST WCHAR*,GpMetafile**); +GpStatus WINGDIPAPI GdipRecordMetafileI(HDC,EmfType,GDIPCONST GpRect*, + MetafileFrameUnit,GDIPCONST WCHAR*,GpMetafile**); GpStatus WINGDIPAPI GdipReleaseDC(GpGraphics*,HDC); GpStatus WINGDIPAPI GdipResetClip(GpGraphics*); GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics*); @@ -249,6 +276,7 @@ GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics*,GraphicsState*); GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetClipHrgn(GpGraphics*,HRGN,CombineMode); +GpStatus WINGDIPAPI GdipSetClipGraphics(GpGraphics*,GpGraphics*,CombineMode); GpStatus WINGDIPAPI GdipSetClipPath(GpGraphics*,GpPath*,CombineMode); GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics*,REAL,REAL,REAL,REAL,CombineMode); GpStatus WINGDIPAPI GdipSetClipRectI(GpGraphics*,INT,INT,INT,INT,CombineMode); @@ -259,6 +287,7 @@ GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics*,REAL); GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics*,GpUnit); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); +GpStatus WINGDIPAPI GdipSetRenderingOrigin(GpGraphics*,INT,INT); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); GpStatus WINGDIPAPI GdipSetTextContrast(GpGraphics*,UINT); GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics*,TextRenderingHint); @@ -336,6 +365,15 @@ GpStatus WINGDIPAPI GdipSetPathMarker(GpPath*); GpStatus WINGDIPAPI GdipStartPathFigure(GpPath*); GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*); +GpStatus WINGDIPAPI GdipWarpPath(GpPath*,GpMatrix*,GDIPCONST GpPointF*,INT,REAL, + REAL,REAL,REAL,WarpMode,REAL); +GpStatus WINGDIPAPI GdipWidenPath(GpPath*,GpPen*,GpMatrix*,REAL); + +/* HatchBrush */ +GpStatus WINGDIPAPI GdipCreateHatchBrush(HatchStyle,ARGB,ARGB,GpHatch**); +GpStatus WINGDIPAPI GdipGetHatchBackgroundColor(GpHatch*,ARGB*); +GpStatus WINGDIPAPI GdipGetHatchForegroundColor(GpHatch*,ARGB*); +GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch*,HatchStyle*); /* Image */ GpStatus WINGDIPAPI GdipCloneImage(GpImage*, GpImage**); @@ -352,6 +390,7 @@ GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImageItemData(GpImage*,ImageItemData*); GpStatus WINGDIPAPI GdipGetImagePalette(GpImage*,ColorPalette*,INT); +GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage*,INT*); GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage*,PixelFormat*); GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage*,GUID*); GpStatus WINGDIPAPI GdipGetImageThumbnail(GpImage*,UINT,UINT,GpImage**,GetThumbnailImageAbort,VOID*); @@ -363,6 +402,7 @@ GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage*,PROPID,UINT,PropertyItem*); GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*); GpStatus WINGDIPAPI GdipGetPropertySize(GpImage*,UINT*,UINT*); +GpStatus WINGDIPAPI GdipImageForceValidation(GpImage*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage*,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage*,GUID*,UINT); @@ -382,11 +422,27 @@ /* ImageAttributes */ GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**); GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*); +GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes*, + BOOL); GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes*, ColorAdjustType,BOOL,ARGB,ARGB); GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes*, ColorAdjustType,BOOL,GDIPCONST ColorMatrix*,GDIPCONST ColorMatrix*, ColorMatrixFlags); +GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes*, + ColorAdjustType,BOOL,REAL); +GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes*, + ColorAdjustType,BOOL); +GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(GpImageAttributes*, + ColorAdjustType,BOOL,ColorChannelFlags); +GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile( + GpImageAttributes*,ColorAdjustType,BOOL,GDIPCONST WCHAR*); +GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes*, + ColorAdjustType,BOOL,UINT,GDIPCONST ColorMap*); +GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes*, + ColorAdjustType,BOOL,REAL); +GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(GpImageAttributes*, + ColorAdjustType); GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode, ARGB,BOOL); @@ -412,11 +468,22 @@ GDIPCONST REAL*,INT); GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient*,REAL*,REAL*,INT); GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient*,INT*); +GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient*,GDIPCONST ARGB*, + GDIPCONST REAL*,INT); +GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient*,ARGB*,REAL*,INT); +GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient*,INT*); +GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient*); +GpStatus WINGDIPAPI GdipRotateLineTransform(GpLineGradient*,REAL,GpMatrixOrder); +GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient*,REAL,REAL, + GpMatrixOrder); GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient*,ARGB,ARGB); GpStatus WINGDIPAPI GdipSetLineGammaCorrection(GpLineGradient*,BOOL); GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient*,REAL,REAL); +GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient*,GDIPCONST GpMatrix*); GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient*,GpWrapMode); +GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient*,REAL,REAL, + GpMatrixOrder); /* Matrix */ GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix*,GpMatrix**); @@ -462,6 +529,10 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream(IStream*,MetafileHeader*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf(HMETAFILE,GDIPCONST WmfPlaceableFileHeader*,MetafileHeader*); +/* Notification */ +GpStatus WINAPI GdiplusNotificationHook(ULONG_PTR*); +void WINAPI GdiplusNotificationUnhook(ULONG_PTR); + /* PathGradientBrush */ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF*,INT,GpWrapMode,GpPathGradient**); GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint*,INT,GpWrapMode,GpPathGradient**); @@ -475,6 +546,8 @@ GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient*,REAL*,REAL*); GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient*,BOOL*); GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*); +GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient*, + GDIPCONST ARGB*,GDIPCONST REAL*,INT); GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient*,GpRectF*); GpStatus WINGDIPAPI GdipGetPathGradientRectI(GpPathGradient*,GpRect*); GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient*, @@ -522,6 +595,8 @@ GpStatus WINGDIPAPI GdipGetPenDashOffset(GpPen*,REAL*); GpStatus WINGDIPAPI GdipGetPenDashStyle(GpPen*,GpDashStyle*); GpStatus WINGDIPAPI GdipGetPenMode(GpPen*,GpPenAlignment*); +GpStatus WINGDIPAPI GdipResetPenTransform(GpPen*); +GpStatus WINGDIPAPI GdipScalePenTransform(GpPen*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetPenBrushFill(GpPen*,GpBrush*); GpStatus WINGDIPAPI GdipSetPenColor(GpPen*,ARGB); GpStatus WINGDIPAPI GdipSetPenCompoundArray(GpPen*,GDIPCONST REAL*,INT); @@ -620,9 +695,15 @@ INT,INT,INT,INT,GpTexture**); GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture*,GpMatrix*); GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture*, GpWrapMode*); +GpStatus WINGDIPAPI GdipMultiplyTextureTransform(GpTexture*, + GDIPCONST GpMatrix*,GpMatrixOrder); GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture*); +GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture*,REAL,GpMatrixOrder); +GpStatus WINGDIPAPI GdipScaleTextureTransform(GpTexture*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *,GDIPCONST GpMatrix*); GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture*, GpWrapMode); +GpStatus WINGDIPAPI GdipTranslateTextureTransform(GpTexture*,REAL,REAL, + GpMatrixOrder); /* Without wrapper methods */ GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR*,UINT,IStream**); Modified: trunk/reactos/include/psdk/gdiplusimaging.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdiplusimagin…
============================================================================== --- trunk/reactos/include/psdk/gdiplusimaging.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/gdiplusimaging.h [iso-8859-1] Sun Jan 3 11:54:14 2010 @@ -30,6 +30,10 @@ DEFINE_GUID(ImageFormatTIFF, 0xb96b3cb1, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); DEFINE_GUID(ImageFormatEXIF, 0xb96b3cb2, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); DEFINE_GUID(ImageFormatIcon, 0xb96b3cb5, 0x728, 0x11d3, 0x9d, 0x7b, 0, 0, 0xf8, 0x1e, 0xf3, 0x2e); + +DEFINE_GUID(FrameDimensionTime, 0x6aedbd6d, 0x3fb5, 0x418a, 0x83, 0xa6, 0x7f, 0x45, 0x22, 0x9d, 0xc8, 0x72); +DEFINE_GUID(FrameDimensionPage, 0x7462dc86, 0x6180, 0x4c7e, 0x8e, 0x3f, 0xee, 0x73, 0x33, 0xa7, 0xa4, 0x83); +DEFINE_GUID(FrameDimensionResolution, 0x84236f7b, 0x3bd3, 0x428f, 0x8d, 0xab, 0x4e, 0xa1, 0x43, 0x9c, 0xa3, 0x15); enum ImageLockMode {
14 years, 11 months
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200