ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2014
----- 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
15 participants
492 discussions
Start a n
N
ew thread
[akhaldi] 62898: [PSDK] * Add missing MAXLONGLONG definition.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:43:39 2014 New Revision: 62898 URL:
http://svn.reactos.org/svn/reactos?rev=62898&view=rev
Log: [PSDK] * Add missing MAXLONGLONG definition. Modified: trunk/reactos/include/psdk/winnt.h Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=6…
============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Tue Apr 22 21:43:39 2014 @@ -1480,6 +1480,7 @@ #define MAXBYTE 0xff #define MAXWORD 0xffff #define MAXDWORD 0xffffffff +#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff) #define PROCESSOR_INTEL_386 386 #define PROCESSOR_INTEL_486 486 #define PROCESSOR_INTEL_PENTIUM 586
10 years, 8 months
1
0
0
0
[akhaldi] 62897: [ITSS] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:30:00 2014 New Revision: 62897 URL:
http://svn.reactos.org/svn/reactos?rev=62897&view=rev
Log: [ITSS] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/itss/chm_lib.c trunk/reactos/dll/win32/itss/chm_lib.h trunk/reactos/dll/win32/itss/itss.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/itss/chm_lib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/chm_lib.c?r…
============================================================================== --- trunk/reactos/dll/win32/itss/chm_lib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/chm_lib.c [iso-8859-1] Tue Apr 22 21:30:00 2014 @@ -95,64 +95,64 @@ typedef ULONGLONG UInt64; /* utilities for unmarshalling data */ -static int _unmarshal_char_array(unsigned char **pData, - unsigned int *pLenRemain, - char *dest, - int count) +static BOOL _unmarshal_char_array(unsigned char **pData, + unsigned int *pLenRemain, + char *dest, + int count) { if (count <= 0 || (unsigned int)count > *pLenRemain) - return 0; + return FALSE; memcpy(dest, (*pData), count); *pData += count; *pLenRemain -= count; - return 1; -} - -static int _unmarshal_uchar_array(unsigned char **pData, - unsigned int *pLenRemain, - unsigned char *dest, - int count) -{ - if (count <= 0 || (unsigned int)count > *pLenRemain) - return 0; + return TRUE; +} + +static BOOL _unmarshal_uchar_array(unsigned char **pData, + unsigned int *pLenRemain, + unsigned char *dest, + int count) +{ + if (count <= 0 || (unsigned int)count > *pLenRemain) + return FALSE; memcpy(dest, (*pData), count); *pData += count; *pLenRemain -= count; - return 1; -} - -static int _unmarshal_int32(unsigned char **pData, - unsigned int *pLenRemain, - Int32 *dest) + return TRUE; +} + +static BOOL _unmarshal_int32(unsigned char **pData, + unsigned int *pLenRemain, + Int32 *dest) { if (4 > *pLenRemain) - return 0; + return FALSE; *dest = (*pData)[0] | (*pData)[1]<<8 | (*pData)[2]<<16 | (*pData)[3]<<24; *pData += 4; *pLenRemain -= 4; - return 1; -} - -static int _unmarshal_uint32(unsigned char **pData, - unsigned int *pLenRemain, - UInt32 *dest) + return TRUE; +} + +static BOOL _unmarshal_uint32(unsigned char **pData, + unsigned int *pLenRemain, + UInt32 *dest) { if (4 > *pLenRemain) - return 0; + return FALSE; *dest = (*pData)[0] | (*pData)[1]<<8 | (*pData)[2]<<16 | (*pData)[3]<<24; *pData += 4; *pLenRemain -= 4; - return 1; -} - -static int _unmarshal_int64(unsigned char **pData, - unsigned int *pLenRemain, - Int64 *dest) + return TRUE; +} + +static BOOL _unmarshal_int64(unsigned char **pData, + unsigned int *pLenRemain, + Int64 *dest) { Int64 temp; int i; if (8 > *pLenRemain) - return 0; + return FALSE; temp=0; for(i=8; i>0; i--) { @@ -162,17 +162,17 @@ *dest = temp; *pData += 8; *pLenRemain -= 8; - return 1; -} - -static int _unmarshal_uint64(unsigned char **pData, - unsigned int *pLenRemain, - UInt64 *dest) + return TRUE; +} + +static BOOL _unmarshal_uint64(unsigned char **pData, + unsigned int *pLenRemain, + UInt64 *dest) { UInt64 temp; int i; if (8 > *pLenRemain) - return 0; + return FALSE; temp=0; for(i=8; i>0; i--) { @@ -182,12 +182,12 @@ *dest = temp; *pData += 8; *pLenRemain -= 8; - return 1; -} - -static int _unmarshal_uuid(unsigned char **pData, - unsigned int *pDataLen, - unsigned char *dest) + return TRUE; +} + +static BOOL _unmarshal_uuid(unsigned char **pData, + unsigned int *pDataLen, + unsigned char *dest) { return _unmarshal_uchar_array(pData, pDataLen, dest, 16); } @@ -241,13 +241,13 @@ UInt64 data_offset; /* 58 (Not present before V3) */ }; /* __attribute__ ((aligned (1))); */ -static int _unmarshal_itsf_header(unsigned char **pData, - unsigned int *pDataLen, - struct chmItsfHeader *dest) +static BOOL _unmarshal_itsf_header(unsigned char **pData, + unsigned int *pDataLen, + struct chmItsfHeader *dest) { /* we only know how to deal with the 0x58 and 0x60 byte structures */ if (*pDataLen != _CHM_ITSF_V2_LEN && *pDataLen != _CHM_ITSF_V3_LEN) - return 0; + return FALSE; /* unmarshal common fields */ _unmarshal_char_array(pData, pDataLen, dest->signature, 4); @@ -268,19 +268,19 @@ * current MS tools do not seem to use them. */ if (memcmp(dest->signature, "ITSF", 4) != 0) - return 0; + return FALSE; if (dest->version == 2) { if (dest->header_len < _CHM_ITSF_V2_LEN) - return 0; + return FALSE; } else if (dest->version == 3) { if (dest->header_len < _CHM_ITSF_V3_LEN) - return 0; + return FALSE; } else - return 0; + return FALSE; /* now, if we have a V3 structure, unmarshal the rest. * otherwise, compute it @@ -290,12 +290,12 @@ if (*pDataLen != 0) _unmarshal_uint64(pData, pDataLen, &dest->data_offset); else - return 0; + return FALSE; } else dest->data_offset = dest->dir_offset + dest->dir_len; - return 1; + return TRUE; } /* structure of ITSP headers */ @@ -319,13 +319,13 @@ UChar unknown_0044[16]; /* 44 */ }; /* __attribute__ ((aligned (1))); */ -static int _unmarshal_itsp_header(unsigned char **pData, - unsigned int *pDataLen, - struct chmItspHeader *dest) +static BOOL _unmarshal_itsp_header(unsigned char **pData, + unsigned int *pDataLen, + struct chmItspHeader *dest) { /* we only know how to deal with a 0x54 byte structures */ if (*pDataLen != _CHM_ITSP_V1_LEN) - return 0; + return FALSE; /* unmarshal fields */ _unmarshal_char_array(pData, pDataLen, dest->signature, 4); @@ -346,13 +346,13 @@ /* error check the data */ if (memcmp(dest->signature, "ITSP", 4) != 0) - return 0; + return FALSE; if (dest->version != 1) - return 0; + return FALSE; if (dest->header_len != _CHM_ITSP_V1_LEN) - return 0; - - return 1; + return FALSE; + + return TRUE; } /* structure of PMGL headers */ @@ -367,13 +367,13 @@ Int32 block_next; /* 10 */ }; /* __attribute__ ((aligned (1))); */ -static int _unmarshal_pmgl_header(unsigned char **pData, - unsigned int *pDataLen, - struct chmPmglHeader *dest) +static BOOL _unmarshal_pmgl_header(unsigned char **pData, + unsigned int *pDataLen, + struct chmPmglHeader *dest) { /* we only know how to deal with a 0x14 byte structures */ if (*pDataLen != _CHM_PMGL_LEN) - return 0; + return FALSE; /* unmarshal fields */ _unmarshal_char_array(pData, pDataLen, dest->signature, 4); @@ -384,9 +384,9 @@ /* check structure */ if (memcmp(dest->signature, _chm_pmgl_marker, 4) != 0) - return 0; - - return 1; + return FALSE; + + return TRUE; } /* structure of PMGI headers */ @@ -398,13 +398,13 @@ UInt32 free_space; /* 4 */ }; /* __attribute__ ((aligned (1))); */ -static int _unmarshal_pmgi_header(unsigned char **pData, - unsigned int *pDataLen, - struct chmPmgiHeader *dest) +static BOOL _unmarshal_pmgi_header(unsigned char **pData, + unsigned int *pDataLen, + struct chmPmgiHeader *dest) { /* we only know how to deal with a 0x8 byte structures */ if (*pDataLen != _CHM_PMGI_LEN) - return 0; + return FALSE; /* unmarshal fields */ _unmarshal_char_array(pData, pDataLen, dest->signature, 4); @@ -412,9 +412,9 @@ /* check structure */ if (memcmp(dest->signature, _chm_pmgi_marker, 4) != 0) - return 0; - - return 1; + return FALSE; + + return TRUE; } /* structure of LZXC reset table */ @@ -430,13 +430,13 @@ UInt64 block_len; }; /* __attribute__ ((aligned (1))); */ -static int _unmarshal_lzxc_reset_table(unsigned char **pData, - unsigned int *pDataLen, - struct chmLzxcResetTable *dest) +static BOOL _unmarshal_lzxc_reset_table(unsigned char **pData, + unsigned int *pDataLen, + struct chmLzxcResetTable *dest) { /* we only know how to deal with a 0x28 byte structures */ if (*pDataLen != _CHM_LZXC_RESETTABLE_V1_LEN) - return 0; + return FALSE; /* unmarshal fields */ _unmarshal_uint32 (pData, pDataLen, &dest->version); @@ -449,9 +449,9 @@ /* check structure */ if (dest->version != 2) - return 0; - - return 1; + return FALSE; + + return TRUE; } /* structure of LZXC control data block */ @@ -468,13 +468,13 @@ UInt32 unknown_18; /* 18 */ }; -static int _unmarshal_lzxc_control_data(unsigned char **pData, - unsigned int *pDataLen, - struct chmLzxcControlData *dest) +static BOOL _unmarshal_lzxc_control_data(unsigned char **pData, + unsigned int *pDataLen, + struct chmLzxcControlData *dest) { /* we want at least 0x18 bytes */ if (*pDataLen < _CHM_LZXC_MIN_LEN) - return 0; + return FALSE; /* unmarshal fields */ _unmarshal_uint32 (pData, pDataLen, &dest->size); @@ -495,19 +495,19 @@ dest->windowSize *= 0x8000; } if (dest->windowSize == 0 || dest->resetInterval == 0) - return 0; + return FALSE; /* for now, only support resetInterval a multiple of windowSize/2 */ if (dest->windowSize == 1) - return 0; + return FALSE; if ((dest->resetInterval % (dest->windowSize/2)) != 0) - return 0; + return FALSE; /* check structure */ if (memcmp(dest->signature, "LZXC", 4) != 0) - return 0; - - return 1; + return FALSE; + + return TRUE; } /* the structure used for chm file handles */ @@ -920,7 +920,7 @@ } /* parse a utf-8 string into an ASCII char buffer */ -static int _chm_parse_UTF8(UChar **pEntry, UInt64 count, WCHAR *path) +static BOOL _chm_parse_UTF8(UChar **pEntry, UInt64 count, WCHAR *path) { /* MJM - Modified to return real Unicode strings */ while (count != 0) @@ -930,28 +930,28 @@ } *path = '\0'; - return 1; + return TRUE; } /* parse a PMGL entry into a chmUnitInfo struct; return 1 on success. */ -static int _chm_parse_PMGL_entry(UChar **pEntry, struct chmUnitInfo *ui) +static BOOL _chm_parse_PMGL_entry(UChar **pEntry, struct chmUnitInfo *ui) { UInt64 strLen; /* parse str len */ strLen = _chm_parse_cword(pEntry); if (strLen > CHM_MAX_PATHLEN) - return 0; + return FALSE; /* parse path */ if (! _chm_parse_UTF8(pEntry, strLen, ui->path)) - return 0; + return FALSE; /* parse info */ ui->space = (int)_chm_parse_cword(pEntry); ui->start = _chm_parse_cword(pEntry); ui->length = _chm_parse_cword(pEntry); - return 1; + return TRUE; } /* find an exact entry in PMGL; return NULL if we fail */ @@ -1108,11 +1108,11 @@ * utility methods for dealing with compressed data */ -/* get the bounds of a compressed block. return 0 on failure */ -static int _chm_get_cmpblock_bounds(struct chmFile *h, - UInt64 block, - UInt64 *start, - Int64 *len) +/* get the bounds of a compressed block. Returns FALSE on failure */ +static BOOL _chm_get_cmpblock_bounds(struct chmFile *h, + UInt64 block, + UInt64 *start, + Int64 *len) { UChar buffer[8], *dummy; UInt32 remain; @@ -1130,7 +1130,7 @@ + block*8, remain) != remain || !_unmarshal_uint64(&dummy, &remain, start)) - return 0; + return FALSE; /* unpack the end address */ dummy = buffer; @@ -1142,7 +1142,7 @@ + block*8 + 8, remain) != remain || !_unmarshal_int64(&dummy, &remain, len)) - return 0; + return FALSE; } /* for the last block, use the span in addition to the reset table */ @@ -1158,7 +1158,7 @@ + block*8, remain) != remain || !_unmarshal_uint64(&dummy, &remain, start)) - return 0; + return FALSE; *len = h->reset_table.compressed_len; } @@ -1167,7 +1167,7 @@ *len -= *start; *start += h->data_offset + h->cn_unit.start; - return 1; + return TRUE; } /* decompress the block. must have lzx_mutex. */ @@ -1392,11 +1392,11 @@ } } -int chm_enumerate_dir(struct chmFile *h, - const WCHAR *prefix, - int what, - CHM_ENUMERATOR e, - void *context) +BOOL chm_enumerate_dir(struct chmFile *h, + const WCHAR *prefix, + int what, + CHM_ENUMERATOR e, + void *context) { /* * XXX: do this efficiently (i.e. using the tree index) @@ -1411,8 +1411,8 @@ UChar *cur; unsigned int lenRemain; - /* set to 1 once we've started */ - int it_has_begun=0; + /* set to TRUE once we've started */ + BOOL it_has_begun = FALSE; /* the current ui */ struct chmUnitInfo ui; @@ -1454,7 +1454,7 @@ h->block_len) != h->block_len) { HeapFree(GetProcessHeap(), 0, page_buf); - return 0; + return FALSE; } /* figure out start and end for this page */ @@ -1463,7 +1463,7 @@ if (! _unmarshal_pmgl_header(&cur, &lenRemain, &header)) { HeapFree(GetProcessHeap(), 0, page_buf); - return 0; + return FALSE; } end = page_buf + h->block_len - (header.free_space); @@ -1473,14 +1473,14 @@ if (! _chm_parse_PMGL_entry(&cur, &ui)) { HeapFree(GetProcessHeap(), 0, page_buf); - return 0; + return FALSE; } /* check if we should start */ if (! it_has_begun) { if (ui.length == 0 && strncmpiW(ui.path, prefixRectified, prefixLen) == 0) - it_has_begun = 1; + it_has_begun = TRUE; else continue; @@ -1494,7 +1494,7 @@ if (strncmpiW(ui.path, prefixRectified, prefixLen) != 0) { HeapFree(GetProcessHeap(), 0, page_buf); - return 1; + return TRUE; } } @@ -1540,12 +1540,12 @@ { case CHM_ENUMERATOR_FAILURE: HeapFree(GetProcessHeap(), 0, page_buf); - return 0; + return FALSE; case CHM_ENUMERATOR_CONTINUE: break; case CHM_ENUMERATOR_SUCCESS: HeapFree(GetProcessHeap(), 0, page_buf); - return 1; + return TRUE; default: break; } @@ -1557,5 +1557,5 @@ } HeapFree(GetProcessHeap(), 0, page_buf); - return 1; -} + return TRUE; +} Modified: trunk/reactos/dll/win32/itss/chm_lib.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/chm_lib.h?r…
============================================================================== --- trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/chm_lib.h [iso-8859-1] Tue Apr 22 21:30:00 2014 @@ -105,10 +105,10 @@ #define CHM_ENUMERATOR_FAILURE (0) #define CHM_ENUMERATOR_CONTINUE (1) #define CHM_ENUMERATOR_SUCCESS (2) -int chm_enumerate_dir(struct chmFile *h, - const WCHAR *prefix, - int what, - CHM_ENUMERATOR e, - void *context) DECLSPEC_HIDDEN; +BOOL chm_enumerate_dir(struct chmFile *h, + const WCHAR *prefix, + int what, + CHM_ENUMERATOR e, + void *context) DECLSPEC_HIDDEN; #endif /* INCLUDED_CHMLIB_H */ Modified: trunk/reactos/dll/win32/itss/itss.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/itss/itss.idl?re…
============================================================================== --- trunk/reactos/dll/win32/itss/itss.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/itss/itss.idl [iso-8859-1] Tue Apr 22 21:30:00 2014 @@ -17,6 +17,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + +#pragma makedep register [ helpstring("Microsoft InfoTech Protocol for IE 3.0"), Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 21:30:00 2014 @@ -91,7 +91,7 @@ reactos/dll/win32/inseng # Synced to Wine-1.7.1 reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to Wine-1.7.1 -reactos/dll/win32/itss # Synced to Wine-1.7.1 +reactos/dll/win32/itss # Synced to Wine-1.7.17 reactos/dll/win32/jscript # Synced to Wine-1.7.1 reactos/dll/win32/loadperf # Synced to Wine-1.7.1 reactos/dll/win32/localspl # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62896: [INETCOMM_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:23:39 2014 New Revision: 62896 URL:
http://svn.reactos.org/svn/reactos?rev=62896&view=rev
Log: [INETCOMM_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/inetcomm/mimeole.c Modified: trunk/rostests/winetests/inetcomm/mimeole.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/inetcomm/mimeol…
============================================================================== --- trunk/rostests/winetests/inetcomm/mimeole.c [iso-8859-1] (original) +++ trunk/rostests/winetests/inetcomm/mimeole.c [iso-8859-1] Tue Apr 22 21:23:39 2014 @@ -32,7 +32,7 @@ #include "wine/test.h" -static char msg1[] = +static const char msg1[] = "MIME-Version: 1.0\r\n" "Content-Type: multipart/mixed;\r\n" " boundary=\"------------1.5.0.6\";\r\n" @@ -224,7 +224,7 @@ char text[] = "text"; HBODY *body_list; PROPVARIANT prop; - static char att_pritype[] = "att:pri-content-type"; + static const char att_pritype[] = "att:pri-content-type"; hr = MimeOleCreateMessage(NULL, &msg); ok(hr == S_OK, "ret %08x\n", hr);
10 years, 8 months
1
0
0
0
[akhaldi] 62895: [INETCOMM] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:23:22 2014 New Revision: 62895 URL:
http://svn.reactos.org/svn/reactos?rev=62895&view=rev
Log: [INETCOMM] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.idl trunk/reactos/dll/win32/inetcomm/mimeole.c trunk/reactos/dll/win32/inetcomm/pop3transport.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/inetcomm.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/inetcomm.idl [iso-8859-1] Tue Apr 22 21:23:22 2014 @@ -17,6 +17,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + +#pragma makedep register [ helpstring("CLSID_IMimeBody"), Modified: trunk/reactos/dll/win32/inetcomm/mimeole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeole…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] Tue Apr 22 21:23:22 2014 @@ -119,7 +119,7 @@ char *buf = NULL; DWORD size = PARSER_BUF_SIZE, offset = 0, last_end = 0; HRESULT hr; - int done = 0; + BOOL done = FALSE; *ptr = NULL; @@ -147,7 +147,7 @@ offset += read; buf[offset] = '\0'; - if(read == 0) done = 1; + if(read == 0) done = TRUE; while(!done && (end = strstr(buf + last_end, "\r\n"))) { @@ -158,7 +158,7 @@ off.QuadPart = new_end; IStream_Seek(stm, off, STREAM_SEEK_SET, NULL); buf[new_end] = '\0'; - done = 1; + done = TRUE; } else last_end = new_end; @@ -253,14 +253,14 @@ static char *unquote_string(const char *str) { - int quoted = 0; + BOOL quoted = FALSE; char *ret, *cp; while(*str == ' ' || *str == '\t') str++; if(*str == '"') { - quoted = 1; + quoted = TRUE; str++; } ret = strdupA(str); @@ -316,20 +316,19 @@ static void split_params(header_t *header, char *value) { char *cp = value, *start = value; - int in_quote = 0; - int done_value = 0; + BOOL in_quotes = FALSE, done_value = FALSE; while(*cp) { - if(!in_quote && *cp == ';') + if(!in_quotes && *cp == ';') { *cp = '\0'; if(done_value) add_param(header, start); - done_value = 1; + done_value = TRUE; start = cp + 1; } else if(*cp == '"') - in_quote = !in_quote; + in_quotes = !in_quotes; cp++; } if(done_value) add_param(header, start); Modified: trunk/reactos/dll/win32/inetcomm/pop3transport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/pop3tra…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/pop3transport.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/pop3transport.c [iso-8859-1] Tue Apr 22 21:23:22 2014 @@ -617,7 +617,7 @@ static void POP3Transport_CallbackProcessUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer) { - static char pass[] = "PASS "; + static const char pass[] = "PASS "; POP3Transport *This = (POP3Transport *)iface; POP3RESPONSE response; char *command; @@ -658,7 +658,7 @@ static void POP3Transport_CallbackSendUSERCmd(IInternetTransport *iface, char *pBuffer, int cbBuffer) { - static char user[] = "USER "; + static const char user[] = "USER "; POP3Transport *This = (POP3Transport *)iface; char *command; int len; @@ -854,7 +854,7 @@ static HRESULT WINAPI POP3Transport_CommandUSER(IPOP3Transport *iface, LPSTR username) { - static char user[] = "USER "; + static const char user[] = "USER "; POP3Transport *This = (POP3Transport *)iface; char *command; int len; @@ -877,7 +877,7 @@ static HRESULT WINAPI POP3Transport_CommandPASS(IPOP3Transport *iface, LPSTR password) { - static char pass[] = "PASS "; + static const char pass[] = "PASS "; POP3Transport *This = (POP3Transport *)iface; char *command; int len; @@ -901,7 +901,7 @@ static HRESULT WINAPI POP3Transport_CommandLIST( IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId) { - static char list[] = "LIST %u\r\n"; + static const char list[] = "LIST %u\r\n"; static char list_all[] = "LIST\r\n"; POP3Transport *This = (POP3Transport *)iface; char *command; @@ -928,7 +928,7 @@ static HRESULT WINAPI POP3Transport_CommandTOP( IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId, DWORD cPreviewLines) { - static char top[] = "TOP %u %u\r\n"; + static const char top[] = "TOP %u %u\r\n"; POP3Transport *This = (POP3Transport *)iface; char *command; int len; @@ -950,7 +950,7 @@ static HRESULT WINAPI POP3Transport_CommandQUIT(IPOP3Transport *iface) { - static char command[] = "QUIT\r\n"; + static const char command[] = "QUIT\r\n"; POP3Transport *This = (POP3Transport *)iface; TRACE("()\n"); @@ -963,7 +963,7 @@ static HRESULT WINAPI POP3Transport_CommandSTAT(IPOP3Transport *iface) { - static char stat[] = "STAT\r\n"; + static const char stat[] = "STAT\r\n"; POP3Transport *This = (POP3Transport *)iface; TRACE("\n"); @@ -975,7 +975,7 @@ static HRESULT WINAPI POP3Transport_CommandNOOP(IPOP3Transport *iface) { - static char noop[] = "NOOP\r\n"; + static const char noop[] = "NOOP\r\n"; POP3Transport *This = (POP3Transport *)iface; TRACE("\n"); @@ -987,7 +987,7 @@ static HRESULT WINAPI POP3Transport_CommandRSET(IPOP3Transport *iface) { - static char rset[] = "RSET\r\n"; + static const char rset[] = "RSET\r\n"; POP3Transport *This = (POP3Transport *)iface; TRACE("\n"); @@ -1000,7 +1000,7 @@ static HRESULT WINAPI POP3Transport_CommandUIDL( IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId) { - static char uidl[] = "UIDL %u\r\n"; + static const char uidl[] = "UIDL %u\r\n"; static char uidl_all[] = "UIDL\r\n"; POP3Transport *This = (POP3Transport *)iface; char *command; @@ -1027,7 +1027,7 @@ static HRESULT WINAPI POP3Transport_CommandDELE( IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId) { - static char dele[] = "DELE %u\r\n"; + static const char dele[] = "DELE %u\r\n"; POP3Transport *This = (POP3Transport *)iface; char *command; int len; @@ -1049,7 +1049,7 @@ static HRESULT WINAPI POP3Transport_CommandRETR( IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId) { - static char retr[] = "RETR %u\r\n"; + static const char retr[] = "RETR %u\r\n"; POP3Transport *This = (POP3Transport *)iface; char *command; int len; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 21:23:22 2014 @@ -85,7 +85,7 @@ reactos/dll/win32/imaadp32.acm # Synced to Wine-1.7.1 reactos/dll/win32/imagehlp # Synced to Wine-1.7.1 reactos/dll/win32/imm32 # Synced to Wine-1.7.1 -reactos/dll/win32/inetcomm # Synced to Wine-1.7.1 +reactos/dll/win32/inetcomm # Synced to Wine-1.7.17 reactos/dll/win32/inetmib1 # Synced to Wine-1.7.1 reactos/dll/win32/initpki # Synced to Wine-1.7.1 reactos/dll/win32/inseng # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62894: [HLINK_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:18:59 2014 New Revision: 62894 URL:
http://svn.reactos.org/svn/reactos?rev=62894&view=rev
Log: [HLINK_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/hlink/hlink.c Modified: trunk/rostests/winetests/hlink/hlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/hlink/hlink.c?r…
============================================================================== --- trunk/rostests/winetests/hlink/hlink.c [iso-8859-1] (original) +++ trunk/rostests/winetests/hlink/hlink.c [iso-8859-1] Tue Apr 22 21:18:59 2014 @@ -79,18 +79,6 @@ DEFINE_GUID(IID_IHlinkHistory,0x79eac9c8,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b); -static const char *debugstr_guid(REFIID riid) -{ - static char buf[50]; - - sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], - riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], - riid->Data4[5], riid->Data4[6], riid->Data4[7]); - - return buf; -} - static void test_HlinkIsShortcut(void) { UINT i; @@ -638,6 +626,8 @@ static const WCHAR clsid_nameW[] = {'c','l','s','i','d',':', '2','0','D','0','4','F','E','0','-','3','A','E','A','-','1','0','6','9','-','A','2','D','8', '-','0','8','0','0','2','B','3','0','3','0','9','D',':',0}; + static const WCHAR file_urlW[] = + {'f','i','l','e',':','/','/','/','c',':','\\','f','i','l','e','.','t','x','t',0}; CreateBindCtx(0, &bctx); @@ -669,7 +659,7 @@ IMoniker_Release(mon); hres = HlinkParseDisplayName(bctx, invalid_urlW, FALSE, &eaten, &mon); - ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); ok(eaten == sizeof(invalid_urlW)/sizeof(WCHAR)-1, "eaten=%d\n", eaten); ok(mon != NULL, "mon == NULL\n"); @@ -683,6 +673,22 @@ ok(issys == MKSYS_FILEMONIKER, "issys=%x\n", issys); IMoniker_Release(mon); + + hres = HlinkParseDisplayName(bctx, file_urlW, FALSE, &eaten, &mon); + ok(hres == S_OK, "HlinkParseDisplayName failed: %08x\n", hres); + ok(eaten == sizeof(file_urlW)/sizeof(WCHAR)-1, "eaten=%d\n", eaten); + ok(mon != NULL, "mon == NULL\n"); + + hres = IMoniker_GetDisplayName(mon, bctx, 0, &name); + ok(hres == S_OK, "GetDiasplayName failed: %08x\n", hres); + ok(!lstrcmpW(name, file_urlW+8), "wrong display name %s\n", wine_dbgstr_w(name)); + CoTaskMemFree(name); + + hres = IMoniker_IsSystemMoniker(mon, &issys); + ok(hres == S_OK, "IsSystemMoniker failed: %08x\n", hres); + ok(issys == MKSYS_FILEMONIKER, "issys=%x\n", issys); + + IMoniker_Release(mon); IBindCtx_Release(bctx); } @@ -707,7 +713,7 @@ static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv) { - ok(0, "unexpected service %s\n", debugstr_guid(guidService)); + ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService)); return E_NOINTERFACE; } @@ -729,7 +735,7 @@ return S_OK; } - ok(0, "unexpected interface %s\n", debugstr_guid(riid)); + ok(0, "unexpected interface %s\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -820,7 +826,7 @@ return E_NOINTERFACE; } - ok(0, "unexpected interface: %s\n", debugstr_guid(riid)); + ok(0, "unexpected interface: %s\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -964,7 +970,7 @@ return S_OK; } - ok(0, "unexpected interface: %s\n", debugstr_guid(riid)); + ok(0, "unexpected interface: %s\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -1037,7 +1043,7 @@ { *ppv = NULL; - ok(0, "unexpected riid: %s\n", debugstr_guid(riid)); + ok(0, "unexpected riid: %s\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -1089,7 +1095,7 @@ ok(pbc != _bctx, "pbc != _bctx\n"); ok(pmkToLeft == NULL, "pmkToLeft = %p\n", pmkToLeft); - ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", debugstr_guid(riid)); + ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid)); ok(ppv != NULL, "ppv == NULL\n"); ok(*ppv == NULL, "*ppv = %p\n", *ppv); @@ -1109,7 +1115,7 @@ ok(pbc == _bctx, "pbc != _bctx\n"); ok(pmkToLeft == NULL, "pmkToLeft=%p\n", pmkToLeft); - ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", debugstr_guid(riid)); + ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid)); ok(ppv != NULL, "ppv == NULL\n"); ok(*ppv == NULL, "*ppv=%p\n", *ppv); @@ -1719,8 +1725,8 @@ } } -static WCHAR site_monikerW[] = {'S','I','T','E','_','M','O','N','I','K','E','R',0}; -static WCHAR ref_monikerW[] = {'R','E','F','_','M','O','N','I','K','E','R',0}; +static const WCHAR site_monikerW[] = {'S','I','T','E','_','M','O','N','I','K','E','R',0}; +static const WCHAR ref_monikerW[] = {'R','E','F','_','M','O','N','I','K','E','R',0}; static HRESULT WINAPI hls_test_Moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *toLeft, REFIID riid, void **obj) @@ -1832,7 +1838,7 @@ static HRESULT WINAPI hls_QueryInterface(IHlinkSite *iface, REFGUID iid, void **obj) { - ok(0, "QI: %p %s %p\n", iface, debugstr_guid(iid), obj); + ok(0, "QI: %p %s %p\n", iface, wine_dbgstr_guid(iid), obj); return E_NOTIMPL; } @@ -1849,8 +1855,8 @@ static HRESULT WINAPI hls_QueryService(IHlinkSite *iface, DWORD siteData, REFGUID service, REFIID riid, IUnknown **punk) { - ok(0, "QS: %p %x %s %s %p\n", iface, siteData, debugstr_guid(service), - debugstr_guid(riid), punk); + ok(0, "QS: %p %x %s %s %p\n", iface, siteData, wine_dbgstr_guid(service), + wine_dbgstr_guid(riid), punk); return E_NOTIMPL; }
10 years, 8 months
1
0
0
0
[akhaldi] 62893: [HLINK] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 21:18:44 2014 New Revision: 62893 URL:
http://svn.reactos.org/svn/reactos?rev=62893&view=rev
Log: [HLINK] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/hlink/hlink_classes.idl trunk/reactos/dll/win32/hlink/hlink_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/hlink/hlink_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/hlink_clas…
============================================================================== --- trunk/reactos/dll/win32/hlink/hlink_classes.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hlink/hlink_classes.idl [iso-8859-1] Tue Apr 22 21:18:44 2014 @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ threading(apartment), uuid(79eac9d0-baf9-11ce-8c82-00aa004ba90b) Modified: trunk/reactos/dll/win32/hlink/hlink_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hlink/hlink_main…
============================================================================== --- trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hlink/hlink_main.c [iso-8859-1] Tue Apr 22 21:18:44 2014 @@ -375,6 +375,8 @@ HRESULT WINAPI HlinkParseDisplayName(LPBC pibc, LPCWSTR pwzDisplayName, BOOL fNoForceAbs, ULONG *pcchEaten, IMoniker **ppimk) { + static const WCHAR file_colonW[] = {'f','i','l','e',':'}; + ULONG eaten = 0; HRESULT hres; TRACE("(%p %s %x %p %p)\n", pibc, debugstr_w(pwzDisplayName), fNoForceAbs, pcchEaten, ppimk); @@ -382,17 +384,27 @@ if(fNoForceAbs) FIXME("Unsupported fNoForceAbs\n"); - hres = MkParseDisplayNameEx(pibc, pwzDisplayName, pcchEaten, ppimk); - if(SUCCEEDED(hres)) - return hres; - - hres = MkParseDisplayName(pibc, pwzDisplayName, pcchEaten, ppimk); - if(SUCCEEDED(hres)) - return hres; + if(!strncmpiW(pwzDisplayName, file_colonW, sizeof(file_colonW)/sizeof(WCHAR))) { + pwzDisplayName += sizeof(file_colonW)/sizeof(WCHAR); + eaten += sizeof(file_colonW)/sizeof(WCHAR); + + while(*pwzDisplayName == '/') { + pwzDisplayName++; + eaten++; + } + }else { + hres = MkParseDisplayNameEx(pibc, pwzDisplayName, pcchEaten, ppimk); + if(SUCCEEDED(hres)) + return hres; + + hres = MkParseDisplayName(pibc, pwzDisplayName, pcchEaten, ppimk); + if(SUCCEEDED(hres)) + return hres; + } hres = CreateFileMoniker(pwzDisplayName, ppimk); if(SUCCEEDED(hres)) - *pcchEaten = strlenW(pwzDisplayName); + *pcchEaten = eaten + strlenW(pwzDisplayName); return hres; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 21:18:44 2014 @@ -76,7 +76,7 @@ reactos/dll/win32/fusion # Synced to Wine-1.7.1 reactos/dll/win32/gdiplus # Synced to Wine-1.7.17 reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.17 -reactos/dll/win32/hlink # Synced to Wine-1.7.1 +reactos/dll/win32/hlink # Synced to Wine-1.7.17 reactos/dll/win32/hnetcfg # Synced to Wine-1.7.1 reactos/dll/win32/httpapi # Synced to Wine-1.7.1 reactos/dll/win32/iccvid # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[aandrejevic] 62892: [NTVDM] Quit when ntvdm becomes the last process attached to the console.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Tue Apr 22 20:46:50 2014 New Revision: 62892 URL:
http://svn.reactos.org/svn/reactos?rev=62892&view=rev
Log: [NTVDM] Quit when ntvdm becomes the last process attached to the console. Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c branches/ntvdm/subsystems/ntvdm/ntvdm.h Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.c [iso-8859-1] Tue Apr 22 20:46:50 2014 @@ -34,6 +34,7 @@ static DWORD OrgConsoleInputMode, OrgConsoleOutputMode; static CONSOLE_CURSOR_INFO OrgConsoleCursorInfo; static CONSOLE_SCREEN_BUFFER_INFO OrgConsoleBufferInfo; +static HANDLE CommandThread = NULL; static HMENU hConsoleMenu = NULL; static INT VdmMenuPos = -1; @@ -196,6 +197,11 @@ EmulatorInterrupt(0x23); break; } + case CTRL_LAST_CLOSE_EVENT: + { + if (CommandThread) TerminateThread(CommandThread, 0); + break; + } default: { /* Stop the VDM if the user logs out or closes the console */ @@ -278,6 +284,9 @@ { /* Set the handler routine */ SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); + + /* Enable the CTRL_LAST_CLOSE_EVENT */ + SetLastConsoleEventActive(); /* Get the input handle to the real console, and check for success */ ConsoleInput = CreateFileW(L"CONIN$", @@ -368,10 +377,8 @@ if (ConsoleInput != INVALID_HANDLE_VALUE) CloseHandle(ConsoleInput); } -INT wmain(INT argc, WCHAR *argv[]) -{ -#ifndef STANDALONE - +DWORD WINAPI CommandThreadProc(LPVOID Parameter) +{ VDM_COMMAND_INFO CommandInfo; CHAR CmdLine[MAX_PATH]; CHAR AppName[MAX_PATH]; @@ -379,54 +386,7 @@ CHAR Desktop[MAX_PATH]; CHAR Title[MAX_PATH]; -#else - - CHAR CommandLine[DOS_CMDLINE_LENGTH]; - - if (argc == 2 && argv[1] != NULL) - { - WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, sizeof(CommandLine), NULL, NULL); - } - else - { - wprintf(L"\nReactOS Virtual DOS Machine\n\n" - L"Usage: NTVDM <executable>\n"); - return 0; - } - -#endif - - DPRINT1("\n\n\nNTVDM - Starting...\n\n\n"); - - /* Initialize the console */ - if (!ConsoleInit()) - { - wprintf(L"FATAL: A problem occurred when trying to initialize the console\n"); - goto Cleanup; - } - - /* Initialize the emulator */ - if (!EmulatorInitialize(ConsoleInput, ConsoleOutput)) - { - wprintf(L"FATAL: Failed to initialize the emulator\n"); - goto Cleanup; - } - - /* Initialize the system BIOS */ - if (!BiosInitialize(NULL)) - { - wprintf(L"FATAL: Failed to initialize the VDM BIOS.\n"); - goto Cleanup; - } - - /* Initialize the VDM DOS kernel */ - if (!DosInitialize(NULL)) - { - wprintf(L"FATAL: Failed to initialize the VDM DOS kernel.\n"); - goto Cleanup; - } - -#ifndef STANDALONE + UNREFERENCED_PARAMETER(Parameter); while (TRUE) { @@ -454,7 +414,7 @@ if (!DosCreateProcess(AppName, 0)) { DisplayMessage(L"Could not start '%S'", AppName); - goto Cleanup; + break; } /* Start simulation */ @@ -463,6 +423,74 @@ /* Perform another screen refresh */ VgaRefreshDisplay(); } + + return 0; +} + +INT wmain(INT argc, WCHAR *argv[]) +{ +#ifdef STANDALONE + + CHAR CommandLine[DOS_CMDLINE_LENGTH]; + + if (argc == 2 && argv[1] != NULL) + { + WideCharToMultiByte(CP_ACP, 0, argv[1], -1, CommandLine, sizeof(CommandLine), NULL, NULL); + } + else + { + wprintf(L"\nReactOS Virtual DOS Machine\n\n" + L"Usage: NTVDM <executable>\n"); + return 0; + } + +#endif + + DPRINT1("\n\n\nNTVDM - Starting...\n\n\n"); + + /* Initialize the console */ + if (!ConsoleInit()) + { + wprintf(L"FATAL: A problem occurred when trying to initialize the console\n"); + goto Cleanup; + } + + /* Initialize the emulator */ + if (!EmulatorInitialize(ConsoleInput, ConsoleOutput)) + { + wprintf(L"FATAL: Failed to initialize the emulator\n"); + goto Cleanup; + } + + /* Initialize the system BIOS */ + if (!BiosInitialize(NULL)) + { + wprintf(L"FATAL: Failed to initialize the VDM BIOS.\n"); + goto Cleanup; + } + + /* Initialize the VDM DOS kernel */ + if (!DosInitialize(NULL)) + { + wprintf(L"FATAL: Failed to initialize the VDM DOS kernel.\n"); + goto Cleanup; + } + +#ifndef STANDALONE + + /* Create the GetNextVDMCommand thread */ + CommandThread = CreateThread(NULL, 0, &CommandThreadProc, NULL, 0, NULL); + if (CommandThread == NULL) + { + wprintf(L"FATAL: Failed to create the command processing thread: %d\n", GetLastError()); + goto Cleanup; + } + + /* Wait for the command thread to exit */ + WaitForSingleObject(CommandThread, INFINITE); + + /* Close the thread handle */ + CloseHandle(CommandThread); #else Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] Tue Apr 22 20:46:50 2014 @@ -29,6 +29,8 @@ #include <debug.h> +DWORD WINAPI SetLastConsoleEventActive(VOID); + /* FUNCTIONS ******************************************************************/ VOID DisplayMessage(LPCWSTR Format, ...);
10 years, 8 months
1
0
0
0
[dquintana] 62891: [RSHELL] * Almost working keyboard navigation on horizontal menu bar. It does not yet switch between menus when a submenu of the shell menu is currently open and you press [right...
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Apr 22 17:44:19 2014 New Revision: 62891 URL:
http://svn.reactos.org/svn/reactos?rev=62891&view=rev
Log: [RSHELL] * Almost working keyboard navigation on horizontal menu bar. It does not yet switch between menus when a submenu of the shell menu is currently open and you press [right]. CORE-7586 Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Tue Apr 22 17:44:19 2014 @@ -715,23 +715,23 @@ if (popup == NULL) return E_FAIL; - DbgPrint("Before Query\n"); + TRACE("Before Query\n"); hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL); if (FAILED_UNEXPECTEDLY(hr)) { - DbgPrint("Query failed\n"); + TRACE("Query failed\n"); DestroyMenu(popup); return hr; } HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow; - DbgPrint("Before Tracking\n"); + TRACE("Before Tracking\n"); uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, hwnd, NULL); if (uCommand != 0) { - DbgPrint("Before InvokeCommand\n"); + TRACE("Before InvokeCommand\n"); CMINVOKECOMMANDINFO cmi = { 0 }; cmi.cbSize = sizeof(cmi); cmi.lpVerb = MAKEINTRESOURCEA(uCommand); @@ -740,7 +740,7 @@ } else { - DbgPrint("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError()); + TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError()); hr = S_FALSE; } Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Tue Apr 22 17:44:19 2014 @@ -288,7 +288,7 @@ DisableMouseTrack(NULL, FALSE); if (isTracking && iHitTestResult>=0 && m_current->type == TrackedMenuEntry) SendMessage(entry->hwnd, WM_CANCELMODE, 0, 0); - PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult, isTracking); + PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult, MAKELPARAM(isTracking, TRUE)); if (m_current->type == TrackedMenuEntry) return FALSE; } @@ -359,13 +359,13 @@ callNext = ProcessMouseMove(msg); break; case WM_INITMENUPOPUP: - DbgPrint("WM_INITMENUPOPUP %p %p\n", msg->wParam, msg->lParam); + TRACE("WM_INITMENUPOPUP %p %p\n", msg->wParam, msg->lParam); m_selectedMenu = reinterpret_cast<HMENU>(msg->lParam); m_selectedItem = -1; m_selectedItemFlags = 0; break; case WM_MENUSELECT: - DbgPrint("WM_MENUSELECT %p %p\n", msg->wParam, msg->lParam); + TRACE("WM_MENUSELECT %p %p\n", msg->wParam, msg->lParam); m_selectedMenu = reinterpret_cast<HMENU>(msg->lParam); m_selectedItem = GET_X_LPARAM(msg->wParam); m_selectedItemFlags = HIWORD(msg->wParam); @@ -621,7 +621,7 @@ if (FAILED_UNEXPECTEDLY(hr)) return hr; - DbgPrint("PushTrackedPopup %p\n", popup); + TRACE("PushTrackedPopup %p\n", popup); m_selectedMenu = popup; m_selectedItem = -1; m_selectedItemFlags = 0; Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Apr 22 17:44:19 2014 @@ -131,7 +131,7 @@ return IsTrackedItem(wParam); case WM_USER_CHANGETRACKEDITEM: m_SubclassOld(hWnd, uMsg, wParam, lParam); - return ChangeTrackedItem(wParam, lParam); + return ChangeTrackedItem(wParam, LOWORD(lParam), HIWORD(lParam)); case WM_COMMAND: OnWinEvent(hWnd, uMsg, wParam, lParam, &lr); @@ -604,6 +604,7 @@ SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0); } + TRACE("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem, toolbar, item); m_hotBar = toolbar; m_hotItem = item; @@ -690,7 +691,7 @@ return S_FALSE; } -HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking) +HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse) { TBBUTTON btn; @@ -703,9 +704,9 @@ if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn))) return E_FAIL; - DbgPrint("ChangeTrackedItem %d, %d\n", index, wasTracking); + TRACE("ChangeTrackedItem %d, %d\n", index, wasTracking); m_isTrackingPopup = wasTracking; - return m_menuBand->_ChangeHotItem(this, btn.idCommand, HICF_MOUSE); + return m_menuBand->_ChangeHotItem(this, btn.idCommand, mouse ? HICF_MOUSE : 0); } HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, IShellMenu* childShellMenu) @@ -912,13 +913,13 @@ { if (prev != btn.idCommand) { - DbgPrint("Setting Hot item to %d\n", index); + TRACE("Setting Hot item to %d\n", index); if (!(m_initFlags & SMINIT_VERTICAL) && m_isTrackingPopup) { HWND tlw; m_menuBand->_GetTopLevelWindow(&tlw); SendMessage(tlw, WM_CANCELMODE, 0, 0); - PostMessage(m_hwndToolbar, WM_USER_CHANGETRACKEDITEM, index, m_isTrackingPopup); + PostMessage(m_hwndToolbar, WM_USER_CHANGETRACKEDITEM, index, MAKELPARAM(m_isTrackingPopup, FALSE)); } else m_menuBand->_ChangeHotItem(this, btn.idCommand, 0); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Apr 22 17:44:19 2014 @@ -78,7 +78,7 @@ HRESULT KeyboardItemChange(DWORD changeType); HRESULT IsTrackedItem(INT index); - HRESULT ChangeTrackedItem(INT index, BOOL wasTracking); + HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse); HRESULT GetSizes(SIZE* pMinSize, SIZE* pMaxSize, SIZE* pIntegralSize); HRESULT SetPosSize(int x, int y, int cx, int cy);
10 years, 8 months
1
0
0
0
[akhaldi] 62890: [HHCTRL.OCX] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 16:12:47 2014 New Revision: 62890 URL:
http://svn.reactos.org/svn/reactos?rev=62890&view=rev
Log: [HHCTRL.OCX] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c trunk/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl trunk/reactos/dll/win32/hhctrl.ocx/stream.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] Tue Apr 22 16:12:47 2014 @@ -188,7 +188,20 @@ case HH_DISPLAY_TOPIC: case HH_DISPLAY_TOC: if (data) - index = (const WCHAR *)data; + { + static const WCHAR delimW[] = {':',':',0}; + const WCHAR *i = (const WCHAR *)data; + + index = strstrW(i, delimW); + if(index) + { + if(memcmp(info->pCHMInfo->szFile, i, index-i)) + FIXME("Opening a CHM file in the context of another is not supported.\n"); + index += strlenW(delimW); + } + else + index = i; + } break; } @@ -258,6 +271,8 @@ url = FindContextAlias(info->pCHMInfo, data); if(!url) { + if(!data) /* there may legitimately be no context alias for id 0 */ + return info->WinType.hwndHelp; ReleaseHelpViewer(info); return NULL; } Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl [iso-8859-1] Tue Apr 22 16:12:47 2014 @@ -17,6 +17,8 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + +#pragma makedep regtypelib import "unknwn.idl"; import "objidl.idl"; Modified: trunk/reactos/dll/win32/hhctrl.ocx/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/strea…
============================================================================== --- trunk/reactos/dll/win32/hhctrl.ocx/stream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/hhctrl.ocx/stream.c [iso-8859-1] Tue Apr 22 16:12:47 2014 @@ -105,12 +105,52 @@ return TRUE; } +static BOOL find_node_end(stream_t *stream, strbuf_t *buf) +{ + int tag_count = 0, b = buf->len; + char *p; + + while(1) + { + if(!stream_chr(stream, buf, '>')) + return FALSE; + if(buf->len == 0) + break; + p = &buf->buf[b]; + while((p = memchr(p+1, '"', buf->len-(p-buf->buf))) != NULL) + tag_count++; + b = buf->len; + if(tag_count % 2 != 0) + { + if(!stream_chr(stream, buf, '"')) + return FALSE; + tag_count++; + } + else + break; + } + return TRUE; +} + BOOL next_node(stream_t *stream, strbuf_t *buf) { + strbuf_t tmpbuf; + + /* search through the end of the current node */ + strbuf_init(&tmpbuf); + if(!find_node_end(stream, &tmpbuf)) + { + strbuf_free(&tmpbuf); + return FALSE; + } + strbuf_free(&tmpbuf); + + /* find the beginning of the next node */ if(!stream_chr(stream, NULL, '<')) return FALSE; - if(!stream_chr(stream, buf, '>')) + /* read out the data of the next node */ + if(!find_node_end(stream, buf)) return FALSE; strbuf_append(buf, ">", 2); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 16:12:47 2014 @@ -75,7 +75,7 @@ reactos/dll/win32/faultrep # Synced to Wine-1.7.1 reactos/dll/win32/fusion # Synced to Wine-1.7.1 reactos/dll/win32/gdiplus # Synced to Wine-1.7.17 -reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.1 +reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.17 reactos/dll/win32/hlink # Synced to Wine-1.7.1 reactos/dll/win32/hnetcfg # Synced to Wine-1.7.1 reactos/dll/win32/httpapi # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62889: [GDIPLUS_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:43:03 2014 New Revision: 62889 URL:
http://svn.reactos.org/svn/reactos?rev=62889&view=rev
Log: [GDIPLUS_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: 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/matrix.c trunk/rostests/winetests/gdiplus/metafile.c trunk/rostests/winetests/gdiplus/region.c 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] Tue Apr 22 15:43:03 2014 @@ -742,7 +742,7 @@ WCHAR ms_shell_dlg[LF_FACESIZE]; HDC hdc; HFONT hfont; - LOGFONT lf; + LOGFONTA lf; GpStatus status; GpGraphics *graphics; GpFont *font; @@ -757,9 +757,9 @@ ok(hfont != 0, "GetStockObject(DEFAULT_GUI_FONT) failed\n"); memset(&lf, 0xfe, sizeof(lf)); - ret = GetObject(hfont, sizeof(lf), &lf); + ret = GetObjectA(hfont, sizeof(lf), &lf); ok(ret == sizeof(lf), "GetObject failed\n"); - ok(!lstrcmp(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName); + ok(!lstrcmpA(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName); MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, -1, ms_shell_dlg, LF_FACESIZE); status = GdipCreateFontFromLogfontA(hdc, &lf, &font); @@ -767,8 +767,8 @@ memset(&lf, 0xfe, sizeof(lf)); status = GdipGetLogFontA(font, graphics, &lf); expect(Ok, status); - ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") || - !lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName); + ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") || + !lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName); GdipDeleteFont(font); status = GdipCreateFontFamilyFromName(ms_shell_dlg, NULL, &family); @@ -778,21 +778,21 @@ memset(&lf, 0xfe, sizeof(lf)); status = GdipGetLogFontA(font, graphics, &lf); expect(Ok, status); - ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") || - !lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName); + ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") || + !lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName); GdipDeleteFont(font); GdipDeleteFontFamily(family); status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family); ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status); - lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist"); + lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist"); status = GdipCreateFontFromLogfontA(hdc, &lf, &font); expect(Ok, status); memset(&lf, 0xfe, sizeof(lf)); status = GdipGetLogFontA(font, graphics, &lf); expect(Ok, status); - ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName); + ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName); GdipDeleteFont(font); /* empty FaceName */ @@ -802,13 +802,13 @@ memset(&lf, 0xfe, sizeof(lf)); status = GdipGetLogFontA(font, graphics, &lf); expect(Ok, status); - ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName); + ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName); GdipDeleteFont(font); /* zeroing out lfWeight and lfCharSet leads to font creation failure */ lf.lfWeight = 0; lf.lfCharSet = 0; - lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist"); + lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist"); status = GdipCreateFontFromLogfontA(hdc, &lf, &font); todo_wine ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */ @@ -830,7 +830,7 @@ static const WCHAR string[] = { 'A',0 }; GpStatus status; HDC hdc; - LOGFONT lf; + LOGFONTA lf; GpFont *font; GpGraphics *graphics; GpMatrix *matrix; @@ -852,7 +852,7 @@ expect(Ok, status); memset(&lf, 0, sizeof(lf)); - lstrcpy(lf.lfFaceName, "Tahoma"); + lstrcpyA(lf.lfFaceName, "Tahoma"); lf.lfHeight = -100; lf.lfWidth = 100; status = GdipCreateFontFromLogfontA(hdc, &lf, &font); 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] Tue Apr 22 15:43:03 2014 @@ -20,7 +20,6 @@ */ #include <math.h> -#include <assert.h> #define WIN32_NO_STATUS #define _INC_WINDOWS @@ -66,7 +65,7 @@ case UnitMillimeter: return units * dpi / mm_per_inch; default: - assert(0); + ok(0, "Unsupported unit: %d\n", unit); return 0; } } @@ -88,7 +87,7 @@ case UnitMillimeter: return pixels * mm_per_inch / dpi; default: - assert(0); + ok(0, "Unsupported unit: %d\n", unit); return 0; } } @@ -5502,6 +5501,52 @@ DeleteDC(hdc); } + +static void test_GdipFillRectangles(void) +{ + GpStatus status; + GpGraphics *graphics = NULL; + GpBrush *brush = NULL; + HDC hdc = GetDC( hwnd ); + GpRectF rects[2] = {{0,0,10,10}, {10,10,10,10}}; + + 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 = GdipCreateSolidFill((ARGB)0xffff00ff, (GpSolidFill**)&brush); + expect(Ok, status); + ok(brush != NULL, "Expected brush to be initialized\n"); + + status = GdipFillRectangles(NULL, brush, rects, 2); + expect(InvalidParameter, status); + + status = GdipFillRectangles(graphics, NULL, rects, 2); + expect(InvalidParameter, status); + + status = GdipFillRectangles(graphics, brush, NULL, 2); + expect(InvalidParameter, status); + + status = GdipFillRectangles(graphics, brush, rects, 0); + expect(InvalidParameter, status); + + status = GdipFillRectangles(graphics, brush, rects, -1); + expect(InvalidParameter, status); + + status = GdipFillRectangles(graphics, brush, rects, 1); + expect(Ok, status); + + status = GdipFillRectangles(graphics, brush, rects, 2); + expect(Ok, status); + + GdipDeleteBrush(brush); + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -5513,8 +5558,8 @@ class.style = CS_HREDRAW | CS_VREDRAW; class.lpfnWndProc = DefWindowProcA; class.hInstance = GetModuleHandleA(0); - class.hIcon = LoadIcon(0, IDI_APPLICATION); - class.hCursor = LoadCursor(NULL, IDC_ARROW); + class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION); + class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); RegisterClassA( &class ); hwnd = CreateWindowA( "gdiplus_test", "graphics test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -5574,6 +5619,7 @@ test_getdc_scaled(); test_alpha_hdc(); test_bitmapfromgraphics(); + test_GdipFillRectangles(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd ); 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] Tue Apr 22 15:43:03 2014 @@ -162,15 +162,16 @@ GpStatus status; INT count; - GdipCreatePath(FillModeAlternate, &path); + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); status = GdipAddPathLine(path, 5.0, 5.0, 100.0, 50.0); expect(Ok, status); - /* Prepare storage. Made by wrapper class. */ status = GdipGetPointCount(path, &count); expect(Ok, status); - - data.Count = 2; + expect(2, count); + + data.Count = count; data.Types = GdipAlloc(sizeof(BYTE) * count); data.Points = GdipAlloc(sizeof(PointF) * count); 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] Tue Apr 22 15:43:03 2014 @@ -3221,8 +3221,10 @@ ok(td[i].id == prop_item->id, "%u: expected id %#x, got %#x\n", i, td[i].id, prop_item->id); prop_size -= sizeof(*prop_item); ok(prop_item->length == prop_size, "%u: expected length %u, got %u\n", i, prop_size, prop_item->length); - ok(td[i].length == prop_item->length, "%u: expected length %u, got %u\n", i, td[i].length, prop_item->length); - ok(td[i].length == prop_size, "%u: expected length %u, got %u\n", i, td[i].length, prop_size); + ok(td[i].length == prop_item->length || broken(td[i].id == 0xf00f && td[i].length == prop_item->length+1) /* XP */, + "%u: expected length %u, got %u\n", i, td[i].length, prop_item->length); + ok(td[i].length == prop_size || broken(td[i].id == 0xf00f && td[i].length == prop_size+1) /* XP */, + "%u: expected length %u, got %u\n", i, td[i].length, prop_size); if (td[i].length == prop_item->length) { int match = memcmp(td[i].value, prop_item->value, td[i].length) == 0; @@ -3231,10 +3233,10 @@ { UINT j; BYTE *data = prop_item->value; - printf("id %#x:", prop_item->id); + trace("id %#x:", prop_item->id); for (j = 0; j < prop_item->length; j++) - printf(" %02x", data[j]); - printf("\n"); + trace(" %02x", data[j]); + trace("\n"); } } HeapFree(GetProcessHeap(), 0, prop_item); @@ -3337,10 +3339,10 @@ { UINT j; BYTE *data = prop_item->value; - printf("id %#x:", prop_item->id); + trace("id %#x:", prop_item->id); for (j = 0; j < prop_item->length; j++) - printf(" %02x", data[j]); - printf("\n"); + trace(" %02x", data[j]); + trace("\n"); } } HeapFree(GetProcessHeap(), 0, prop_item); @@ -3399,10 +3401,10 @@ { UINT j; BYTE *data = prop_item[i].value; - printf("id %#x:", prop_item[i].id); + trace("id %#x:", prop_item[i].id); for (j = 0; j < prop_item[i].length; j++) - printf(" %02x", data[j]); - printf("\n"); + trace(" %02x", data[j]); + trace("\n"); } } item_data += prop_item[i].length; @@ -3631,10 +3633,10 @@ if (!match) { BYTE *bits = data.Scan0; - printf("%u: data mismatch for format %#x:", i, td[i].format); + trace("%u: data mismatch for format %#x:", i, td[i].format); for (j = 0; j < td[i].size; j++) - printf(" %02x", bits[j]); - printf("\n"); + trace(" %02x", bits[j]); + trace("\n"); } } else @@ -3662,10 +3664,10 @@ { UINT j; BYTE *bits = data.Scan0; - printf("%u: data mismatch for format %#x:", i, td[i].format); + trace("%u: data mismatch for format %#x:", i, td[i].format); for (j = 0; j < 48; j++) - printf(" %02x", bits[j]); - printf("\n"); + trace(" %02x", bits[j]); + trace("\n"); } } @@ -3717,8 +3719,8 @@ UINT i, size = sizeof(white_2x2); BYTE *bits = white_2x2; for (i = 0; i < size; i++) - printf(" %02x", bits[i]); - printf("\n"); + trace(" %02x", bits[i]); + trace("\n"); } status = GdipDeleteGraphics(graphics); @@ -3769,8 +3771,8 @@ UINT i, size = sizeof(white_2x2); BYTE *bits = white_2x2; for (i = 0; i < size; i++) - printf(" %02x", bits[i]); - printf("\n"); + trace(" %02x", bits[i]); + trace("\n"); } status = GdipDeleteGraphics(graphics); @@ -3817,7 +3819,7 @@ else { expect(Ok, status); - ret = GetObject(hbitmap, sizeof(bm), &bm); + ret = GetObjectW(hbitmap, sizeof(bm), &bm); expect(sizeof(bm), ret); expect(0, bm.bmType); expect(1, bm.bmWidth); @@ -3976,8 +3978,8 @@ UINT i, size = sizeof(dst_8x1); const BYTE *bits = dst_8x1; for (i = 0; i < size; i++) - printf(" %02x", bits[i]); - printf("\n"); + trace(" %02x", bits[i]); + trace("\n"); } } @@ -4102,10 +4104,10 @@ { UINT j; BYTE *data = prop_item->value; - printf("id %#x:", prop_item->id); + trace("id %#x:", prop_item->id); for (j = 0; j < prop_item->length; j++) - printf(" %02x", data[j]); - printf("\n"); + trace(" %02x", data[j]); + trace("\n"); } } HeapFree(GetProcessHeap(), 0, prop_item); @@ -4164,10 +4166,10 @@ { UINT j; BYTE *data = prop_item[i].value; - printf("id %#x:", prop_item[i].id); + trace("id %#x:", prop_item[i].id); for (j = 0; j < prop_item[i].length; j++) - printf(" %02x", data[j]); - printf("\n"); + trace(" %02x", data[j]); + trace("\n"); } } item_data += prop_item[i].length; @@ -4248,6 +4250,32 @@ GdipDisposeImage((GpImage *)bitmap); } + +static void test_CloneBitmapArea(void) +{ + GpStatus status; + GpBitmap *bitmap, *copy; + BitmapData data, data2; + + status = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat24bppRGB, NULL, &bitmap); + expect(Ok, status); + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead | ImageLockModeWrite, PixelFormat24bppRGB, &data); + expect(Ok, status); + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat24bppRGB, &data2); + expect(WrongState, status); + + status = GdipCloneBitmapAreaI(0, 0, 1, 1, PixelFormat24bppRGB, bitmap, ©); + expect(Ok, status); + + status = GdipBitmapUnlockBits(bitmap, &data); + expect(Ok, status); + + GdipDisposeImage((GpImage *)copy); + GdipDisposeImage((GpImage *)bitmap); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -4260,6 +4288,7 @@ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_CloneBitmapArea(); test_ARGB_conversion(); test_DrawImage_scale(); test_image_format(); Modified: trunk/rostests/winetests/gdiplus/matrix.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/matrix.…
============================================================================== --- trunk/rostests/winetests/gdiplus/matrix.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/matrix.c [iso-8859-1] Tue Apr 22 15:43:03 2014 @@ -83,6 +83,9 @@ GdipCreateMatrix2(1.0, -2.0, 30.0, 40.0, -500.0, 600.0, &matrix); + status = GdipTransformMatrixPoints(matrix, pts, 0); + expect(InvalidParameter, status); + status = GdipTransformMatrixPoints(matrix, pts, 10); expect(Ok, status); Modified: trunk/rostests/winetests/gdiplus/metafile.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/metafil…
============================================================================== --- trunk/rostests/winetests/gdiplus/metafile.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/metafile.c [iso-8859-1] Tue Apr 22 15:43:03 2014 @@ -22,19 +22,23 @@ #define _INC_WINDOWS #define COM_NO_WINDOWS_H -//#include "windows.h" +#include <math.h> + #include <wine/test.h> #include <wingdi.h> #include <objbase.h> #include <gdiplus.h> #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) +#define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) + +static BOOL save_metafiles; typedef struct emfplus_record { - ULONG todo; + BOOL todo; ULONG record_type; - ULONG playback_todo; + BOOL playback_todo; } emfplus_record; typedef struct emfplus_check_state @@ -94,7 +98,7 @@ if (state->expected[state->count].record_type) { - actual.todo = 0; + actual.todo = FALSE; actual.record_type = record->Type; check_record(state->count, state->desc, &state->expected[state->count], &actual); @@ -117,7 +121,7 @@ if (state->expected[state->count].record_type) { - actual.todo = 0; + actual.todo = FALSE; actual.record_type = lpEMFR->iType; check_record(state->count, state->desc, &state->expected[state->count], &actual); @@ -154,7 +158,7 @@ emfplus_check_state *state = (emfplus_check_state*)userdata; emfplus_record actual; - actual.todo = 0; + actual.todo = FALSE; actual.record_type = record_type; if (dataSize == 0) @@ -249,6 +253,29 @@ stat = GdipEnumerateMetafileSrcRectDestPoints(graphics, metafile, dst_points, 3, src_rect, src_unit, play_metafile_proc, &state, NULL); expect(Ok, stat); +} + +static void save_metafile(GpMetafile *metafile, const char *filename) +{ + if (save_metafiles) + { + GpMetafile *clone; + HENHMETAFILE hemf; + GpStatus stat; + + stat = GdipCloneImage((GpImage*)metafile, (GpImage**)&clone); + expect(Ok, stat); + + stat = GdipGetHemfFromMetafile(clone, &hemf); + expect(Ok, stat); + + DeleteEnhMetaFile(CopyEnhMetaFileA(hemf, filename)); + + DeleteEnhMetaFile(hemf); + + stat = GdipDisposeImage((GpImage*)clone); + expect(Ok, stat); + } } static const emfplus_record empty_records[] = { @@ -312,6 +339,8 @@ expect(Ok, stat); check_metafile(metafile, empty_records, "empty metafile", dst_points, &frame, UnitPixel); + + save_metafile(metafile, "empty.emf"); stat = GdipGetHemfFromMetafile(metafile, &hemf); expect(Ok, stat); @@ -402,6 +431,8 @@ check_metafile(metafile, getdc_records, "getdc metafile", dst_points, &frame, UnitPixel); + save_metafile(metafile, "getdc.emf"); + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -535,6 +566,8 @@ check_metafile(metafile, emfonly_records, "emfonly metafile", dst_points, &frame, UnitPixel); + save_metafile(metafile, "emfonly.emf"); + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -607,10 +640,323 @@ ok(ret != 0, "Failed to delete enhmetafile %p\n", hemf); } +static const emfplus_record fillrect_records[] = { + {0, EMR_HEADER}, + {0, EmfPlusRecordTypeHeader}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndOfFile}, + {0, EMR_EOF}, + {0} +}; + +static void test_fillrect(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + HDC hdc; + HENHMETAFILE hemf; + static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; + static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; + static const GpPointF dst_points_half[3] = {{0.0,0.0},{50.0,0.0},{0.0,50.0}}; + static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + GpBitmap *bitmap; + ARGB color; + GpBrush *brush; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetHemfFromMetafile(metafile, &hemf); + expect(InvalidParameter, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangleI(graphics, brush, 25, 25, 75, 75); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, fillrect_records, "fillrect metafile", dst_points, &frame, UnitPixel); + + save_metafile(metafile, "fillrect.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, fillrect_records, "fillrect playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 15, 15, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 50, 50, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipBitmapSetPixel(bitmap, 50, 50, 0); + expect(Ok, stat); + + play_metafile(metafile, graphics, fillrect_records, "fillrect playback", dst_points_half, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 15, 15, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipBitmapGetPixel(bitmap, 50, 50, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapSetPixel(bitmap, 15, 15, 0); + expect(Ok, stat); + + stat = GdipDrawImagePointsRect(graphics, (GpImage*)metafile, dst_points, 3, + 0.0, 0.0, 100.0, 100.0, UnitPixel, NULL, NULL, NULL); + expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap, 15, 15, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 50, 50, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); +} + +static const emfplus_record pagetransform_records[] = { + {0, EMR_HEADER}, + {0, EmfPlusRecordTypeHeader}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSetPageTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSetPageTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSetPageTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSetPageTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndOfFile}, + {0, EMR_EOF}, + {0} +}; + +static void test_pagetransform(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + HDC hdc; + static const GpRectF frame = {0.0, 0.0, 5.0, 5.0}; + static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; + static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + GpBitmap *bitmap; + ARGB color; + GpBrush *brush; + GpUnit unit; + REAL scale, dpix, dpiy; + UINT width, height; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitInch, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetImageHorizontalResolution((GpImage*)metafile, &dpix); + todo_wine expect(InvalidParameter, stat); + + stat = GdipGetImageVerticalResolution((GpImage*)metafile, &dpiy); + todo_wine expect(InvalidParameter, stat); + + stat = GdipGetImageWidth((GpImage*)metafile, &width); + todo_wine expect(InvalidParameter, stat); + + stat = GdipGetImageHeight((GpImage*)metafile, &height); + todo_wine expect(InvalidParameter, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + /* initial scale */ + stat = GdipGetPageUnit(graphics, &unit); + expect(Ok, stat); + expect(UnitDisplay, unit); + + stat = GdipGetPageScale(graphics, &scale); + expect(Ok, stat); + expectf(1.0, scale); + + stat = GdipGetDpiX(graphics, &dpix); + expect(Ok, stat); + expectf(96.0, dpix); + + stat = GdipGetDpiY(graphics, &dpiy); + expect(Ok, stat); + expectf(96.0, dpiy); + + stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangleI(graphics, brush, 1, 2, 1, 1); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* page unit = pixels */ + stat = GdipSetPageUnit(graphics, UnitPixel); + expect(Ok, stat); + + stat = GdipGetPageUnit(graphics, &unit); + expect(Ok, stat); + expect(UnitPixel, unit); + + stat = GdipCreateSolidFill((ARGB)0xff00ff00, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangleI(graphics, brush, 0, 1, 1, 1); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* page scale = 3, unit = pixels */ + stat = GdipSetPageScale(graphics, 3.0); + expect(Ok, stat); + + stat = GdipGetPageScale(graphics, &scale); + expect(Ok, stat); + expectf(3.0, scale); + + stat = GdipCreateSolidFill((ARGB)0xff00ffff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangleI(graphics, brush, 0, 1, 2, 2); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* page scale = 3, unit = inches */ + stat = GdipSetPageUnit(graphics, UnitInch); + expect(Ok, stat); + + stat = GdipGetPageUnit(graphics, &unit); + expect(Ok, stat); + expect(UnitInch, unit); + + stat = GdipCreateSolidFill((ARGB)0xffff0000, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 1.0/96.0, 0, 1, 1); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* page scale = 3, unit = display */ + stat = GdipSetPageUnit(graphics, UnitDisplay); + expect(Ok, stat); + + stat = GdipGetPageUnit(graphics, &unit); + expect(Ok, stat); + expect(UnitDisplay, unit); + + stat = GdipCreateSolidFill((ARGB)0xffff00ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 3, 3, 2, 2); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, pagetransform_records, "pagetransform metafile", dst_points, &frame, UnitPixel); + + save_metafile(metafile, "pagetransform.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, pagetransform_records, "pagetransform playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 50, 50, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 30, 50, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipBitmapGetPixel(bitmap, 10, 30, &color); + expect(Ok, stat); + expect(0xff00ff00, color); + + stat = GdipBitmapGetPixel(bitmap, 20, 80, &color); + expect(Ok, stat); + expect(0xff00ffff, color); + + stat = GdipBitmapGetPixel(bitmap, 80, 20, &color); + expect(Ok, stat); + expect(0xffff0000, color); + + stat = GdipBitmapGetPixel(bitmap, 80, 80, &color); + expect(Ok, stat); + expect(0xffff00ff, color); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); +} + START_TEST(metafile) { struct GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; + int myARGC; + char **myARGV; gdiplusStartupInput.GdiplusVersion = 1; gdiplusStartupInput.DebugEventCallback = NULL; @@ -619,9 +965,16 @@ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + myARGC = winetest_get_mainargs( &myARGV ); + + if (myARGC >= 3 && !strcmp(myARGV[2], "save")) + save_metafiles = TRUE; + test_empty(); test_getdc(); test_emfonly(); + test_fillrect(); + test_pagetransform(); GdiplusShutdown(gdiplusToken); } Modified: trunk/rostests/winetests/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdiplus/region.…
============================================================================== --- trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdiplus/region.c [iso-8859-1] Tue Apr 22 15:43:03 2014 @@ -2,6 +2,7 @@ * Unit test suite for gdiplus regions * * Copyright (C) 2008 Huw Davies + * Copyright (C) 2013 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,20 +38,13 @@ #define RGNDATA_MAGIC 0xdbc01001 #define RGNDATA_MAGIC2 0xdbc01002 -#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) - -#define expectf_(expected, got, precision) ok(fabs(expected - got) < precision, "Expected %.2f, got %.2f\n", expected, got) -#define expectf(expected, got) expectf_(expected, got, 0.0001) - -#define expect_magic(value) ok(*value == RGNDATA_MAGIC || *value == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *value) - -#define expect_dword(value, expected) ok(*(value) == expected, "expected %08x got %08x\n", expected, *(value)) - -static inline void expect_float(DWORD *value, FLOAT expected) -{ - FLOAT valuef = *(FLOAT*)value; - ok(valuef == expected, "expected %f got %f\n", expected, valuef); -} +#define expect(expected, got) ok((got) == (expected), "Expected %.8x, got %.8x\n", (expected), (got)) +#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got)) +#define expectf(expected, got) expectf_((expected), (got), 0.001) + +#define expect_magic(value) ok(*(value) == RGNDATA_MAGIC || *(value) == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *(value)) +#define expect_dword(value, expected) expect((expected), *(value)) +#define expect_float(value, expected) expectf((expected), *(FLOAT *)(value)) /* We get shorts back, not INTs like a GpPoint */ typedef struct RegionDataPoint @@ -91,7 +85,9 @@ { rect = (const RECT *)rgn.data.Buffer; trace("rect (%d,%d-%d,%d)\n", rect->left, rect->top, rect->right, rect->bottom); - ok(EqualRect(rect, rc), "rects don't match\n"); + ok(EqualRect(rect, rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", + rc->left, rc->top, rc->right, rc->bottom, + rect->left, rect->top, rect->right, rect->bottom); } ok(rgn.data.rdh.dwSize == sizeof(rgn.data.rdh), "expected sizeof(rdh), got %u\n", rgn.data.rdh.dwSize); @@ -106,7 +102,9 @@ ok(rgn.data.rdh.nCount == 1, "expected 1, got %u\n", rgn.data.rdh.nCount); ok(rgn.data.rdh.nRgnSize == sizeof(RECT), "expected sizeof(RECT), got %u\n", rgn.data.rdh.nRgnSize); } - ok(EqualRect(&rgn.data.rdh.rcBound, rc), "rects don't match\n"); + ok(EqualRect(&rgn.data.rdh.rcBound, rc), "expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)\n", + rc->left, rc->top, rc->right, rc->bottom, + rgn.data.rdh.rcBound.left, rgn.data.rdh.rcBound.top, rgn.data.rdh.rcBound.right, rgn.data.rdh.rcBound.bottom); } static void test_getregiondata(void) @@ -115,54 +113,75 @@ GpRegion *region, *region2; RegionDataPoint *point; UINT needed; - DWORD buf[100]; + DWORD buf[256]; GpRect rect; GpPath *path; + GpMatrix *matrix; + + status = GdipCreateRegion(®ion); + ok(status == Ok, "status %08x\n", status); + + needed = 0; + status = GdipGetRegionDataSize(region, &needed); + ok(status == Ok, "status %08x\n", status); + expect(20, needed); + + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, 0, &needed); + ok(status == InvalidParameter, "status %08x\n", status); memset(buf, 0xee, sizeof(buf)); - - status = GdipCreateRegion(®ion); - ok(status == Ok, "status %08x\n", status); - - status = GdipGetRegionDataSize(region, &needed); - ok(status == Ok, "status %08x\n", status); - expect(20, needed); + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, 4, &needed); + ok(status == InsufficientBuffer, "status %08x\n", status); + expect(4, needed); + expect_dword(buf, 0xeeeeeeee); + + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); + expect_dword(buf + 6, 0xeeeeeeee); status = GdipSetEmpty(region); ok(status == Ok, "status %08x\n", status); status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(20, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_EMPTY_RECT); + expect_dword(buf + 6, 0xeeeeeeee); status = GdipSetInfinite(region); ok(status == Ok, "status %08x\n", status); status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(20, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(20, needed); expect_dword(buf, 12); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); + expect_dword(buf + 6, 0xeeeeeeee); status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); @@ -176,18 +195,21 @@ status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(36, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(36, needed); expect_dword(buf, 28); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_RECT); expect_float(buf + 5, 10.0); expect_float(buf + 6, 20.0); expect_float(buf + 7, 100.0); expect_float(buf + 8, 200.0); + expect_dword(buf + 10, 0xeeeeeeee); rect.X = 50; rect.Y = 30; @@ -228,12 +250,14 @@ status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(156, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(156, needed); expect_dword(buf, 148); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 10); expect_dword(buf + 4, CombineModeExclude); expect_dword(buf + 5, CombineModeComplement); @@ -270,6 +294,7 @@ expect_float(buf + 36, 500.0); expect_float(buf + 37, 22.0); expect_float(buf + 38, 55.0); + expect_dword(buf + 39, 0xeeeeeeee); status = GdipDeleteRegion(region2); ok(status == Ok, "status %08x\n", status); @@ -287,16 +312,18 @@ status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(72, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(72, needed); expect_dword(buf, 64); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); expect_dword(buf + 5, 0x00000030); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 0x00000004); expect_dword(buf + 8, 0x00000000); expect_float(buf + 9, 12.5); @@ -308,7 +335,7 @@ expect_float(buf + 15, 12.5); expect_float(buf + 16, 28.0); expect_dword(buf + 17, 0x81010100); - + expect_dword(buf + 18, 0xeeeeeeee); rect.X = 50; rect.Y = 30; @@ -319,17 +346,19 @@ status = GdipGetRegionDataSize(region, &needed); ok(status == Ok, "status %08x\n", status); expect(96, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); ok(status == Ok, "status %08x\n", status); expect(96, needed); expect_dword(buf, 88); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeIntersect); expect_dword(buf + 5, RGNDATA_PATH); expect_dword(buf + 6, 0x00000030); - expect_magic((DWORD*)(buf + 7)); + expect_magic(buf + 7); expect_dword(buf + 8, 0x00000004); expect_dword(buf + 9, 0x00000000); expect_float(buf + 10, 12.5); @@ -346,6 +375,7 @@ expect_float(buf + 21, 30.0); expect_float(buf + 22, 10.0); expect_float(buf + 23, 20.0); + expect_dword(buf + 24, 0xeeeeeeee); status = GdipDeleteRegion(region); ok(status == Ok, "status %08x\n", status); @@ -360,22 +390,31 @@ status = GdipGetRegionDataSize(region, &needed); expect(Ok, status); expect(36, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); expect(Ok, status); expect(36, needed); expect_dword(buf, 28); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); - /* Second signature for pathdata */ expect_dword(buf + 5, 12); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 0); - /* flags 0x4000 means its a path of shorts instead of FLOAT */ - ok((*(buf + 8) & (~ 0x00004000)) == 0x00000000, - "expected 00000000 got %08x\n", *(buf + 8) & (~ 0x00004000)); + /* flags 0 means that a path is an array of FLOATs */ + ok(*(buf + 8) == 0x4000 /* before win7 */ || *(buf + 8) == 0, + "expected 0x4000 or 0, got %08x\n", *(buf + 8)); + expect_dword(buf + 10, 0xeeeeeeee); + + /* Transform an empty region */ + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + GdipDeleteMatrix(matrix); status = GdipDeleteRegion(region); expect(Ok, status); @@ -392,21 +431,23 @@ status = GdipGetRegionDataSize(region, &needed); expect(Ok, status); expect(56, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); expect(Ok, status); expect(56, needed); expect_dword(buf, 48); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3 , 0); expect_dword(buf + 4 , RGNDATA_PATH); - expect_dword(buf + 5, 32); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 4); - expect_dword(buf + 8, 0x00004000); /* ?? */ - - point = (RegionDataPoint*)buf + 9; + /* flags 0x4000 means that a path is an array of shorts instead of FLOATs */ + expect_dword(buf + 8, 0x4000); + + point = (RegionDataPoint*)(buf + 9); expect(5, point[0].X); expect(6, point[0].Y); expect(7, point[1].X); /* buf + 10 */ @@ -416,6 +457,34 @@ expect(5, point[3].X); /* buf + 12 */ expect(6, point[3].Y); expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ + expect_dword(buf + 14, 0xeeeeeeee); + + status = GdipTranslateRegion(region, 0.6, 0.8); + expect(Ok, status); + memset(buf, 0xee, sizeof(buf)); + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); + expect(Ok, status); + expect(72, needed); + expect_dword(buf, 64); + expect_magic(buf + 2); + expect_dword(buf + 3 , 0); + expect_dword(buf + 4 , RGNDATA_PATH); + expect_dword(buf + 5, 48); + expect_magic(buf + 6); + expect_dword(buf + 7, 4); + /* flags 0 means that a path is an array of FLOATs */ + expect_dword(buf + 8, 0); + expect_float(buf + 9, 5.6); + expect_float(buf + 10, 6.8); + expect_float(buf + 11, 7.6); + expect_float(buf + 12, 8.8); + expect_float(buf + 13, 8.6); + expect_float(buf + 14, 1.8); + expect_float(buf + 15, 5.6); + expect_float(buf + 16, 6.8); + expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ + expect_dword(buf + 18, 0xeeeeeeee); status = GdipDeletePath(path); expect(Ok, status); @@ -434,17 +503,18 @@ status = GdipGetRegionDataSize(region, &needed); expect(Ok, status); expect(72, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); expect(Ok, status); expect(72, needed); expect_dword(buf, 64); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); - expect_dword(buf + 5, 48); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 4); expect_dword(buf + 8, 0); expect_float(buf + 9, 5.6); @@ -455,6 +525,8 @@ expect_float(buf + 14, 1.6); expect_float(buf + 15, 5.6); expect_float(buf + 16, 6.2); + expect_dword(buf + 17, 0x01010100); + expect_dword(buf + 18, 0xeeeeeeee); status = GdipDeletePath(path); expect(Ok, status); @@ -481,29 +553,29 @@ status = GdipGetRegionDataSize(region, &needed); expect(Ok, status); expect(116, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); expect(Ok, status); expect(116, needed); expect_dword(buf, 108); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeUnion); expect_dword(buf + 5, RGNDATA_RECT); - expect_float(buf + 6, 20); - expect_float(buf + 7, 25); - expect_float(buf + 8, 60); - expect_float(buf + 9, 120); + expect_float(buf + 6, 20.0); + expect_float(buf + 7, 25.0); + expect_float(buf + 8, 60.0); + expect_float(buf + 9, 120.0); expect_dword(buf + 10, RGNDATA_PATH); - expect_dword(buf + 11, 68); - expect_magic((DWORD*)(buf + 12)); + expect_magic(buf + 12); expect_dword(buf + 13, 6); - expect_float(buf + 14, 0x0); - - expect_float(buf + 15, 50); + expect_float(buf + 14, 0.0); + expect_float(buf + 15, 50.0); expect_float(buf + 16, 70.2); - expect_float(buf + 17, 60); + expect_float(buf + 17, 60.0); expect_float(buf + 18, 102.8); expect_float(buf + 19, 55.4); expect_float(buf + 20, 122.4); @@ -511,11 +583,160 @@ expect_float(buf + 22, 60.2); expect_float(buf + 23, 45.6); expect_float(buf + 24, 20.2); - expect_float(buf + 25, 50); + expect_float(buf + 25, 50.0); expect_float(buf + 26, 70.2); expect_dword(buf + 27, 0x01010100); ok(*(buf + 28) == 0x00000101 || *(buf + 28) == 0x43050101 /* Win 7 */, "expected 00000101 or 43050101 got %08x\n", *(buf + 28)); + expect_dword(buf + 29, 0xeeeeeeee); + + status = GdipDeletePath(path); + expect(Ok, status); + status = GdipDeleteRegion(region); + expect(Ok, status); + + /* Test how shorts are stored in the region path data */ + status = GdipCreatePath(FillModeAlternate, &path); + ok(status == Ok, "status %08x\n", status); + GdipAddPathRectangleI(path, -1969, -1974, 1995, 1997); + + status = GdipCreateRegionPath(path, ®ion); + ok(status == Ok, "status %08x\n", status); + needed = 0; + status = GdipGetRegionDataSize(region, &needed); + ok(status == Ok, "status %08x\n", status); + expect(56, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); + ok(status == Ok, "status %08x\n", status); + expect(56, needed); + expect_dword(buf, 48); + trace("buf[1] = %08x\n", buf[1]); + expect_magic(buf + 2); + expect_dword(buf + 3, 0); + expect_dword(buf + 4, RGNDATA_PATH); + expect_dword(buf + 5, 32); + expect_magic(buf + 6); + expect_dword(buf + 7, 4); + /* flags 0x4000 means that a path is an array of shorts instead of FLOATs */ + expect_dword(buf + 8, 0x4000); + point = (RegionDataPoint*)(buf + 9); + expect(-1969, point[0].X); + expect(-1974, point[0].Y); + expect(26, point[1].X); /* buf + 10 */ + expect(-1974, point[1].Y); + expect(26, point[2].X); /* buf + 11 */ + expect(23, point[2].Y); + expect(-1969, point[3].X); /* buf + 12 */ + expect(23, point[3].Y); + expect_dword(buf + 13, 0x81010100); /* 0x01010100 if we don't close the path */ + expect_dword(buf + 14, 0xeeeeeeee); + + status = GdipDeletePath(path); + expect(Ok, status); + status = GdipDeleteRegion(region); + expect(Ok, status); + + /* Test with integers that can't be stored as shorts */ + status = GdipCreatePath(FillModeAlternate, &path); + ok(status == Ok, "status %08x\n", status); + GdipAddPathRectangleI(path, -196900, -197400, 199500, 199700); + + status = GdipCreateRegionPath(path, ®ion); + ok(status == Ok, "status %08x\n", status); + needed = 0; + status = GdipGetRegionDataSize(region, &needed); + ok(status == Ok, "status %08x\n", status); + expect(72, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); + ok(status == Ok, "status %08x\n", status); + expect(72, needed); + expect_dword(buf, 64); + trace("buf[1] = %08x\n", buf[1]); + expect_magic(buf + 2); + expect_dword(buf + 3, 0); + expect_dword(buf + 4, RGNDATA_PATH); + expect_dword(buf + 5, 48); + expect_magic(buf + 6); + expect_dword(buf + 7, 4); + /* flags 0 means that a path is an array of FLOATs */ + expect_dword(buf + 8, 0); + expect_float(buf + 9, -196900.0); + expect_float(buf + 10, -197400.0); + expect_float(buf + 11, 2600.0); + expect_float(buf + 12, -197400.0); + expect_float(buf + 13, 2600.0); + expect_float(buf + 14, 2300.0); + expect_float(buf + 15, -196900.0); + expect_float(buf + 16, 2300.0); + expect_dword(buf + 17, 0x81010100); /* 0x01010100 if we don't close the path */ + expect_dword(buf + 18, 0xeeeeeeee); + + status = GdipDeletePath(path); + expect(Ok, status); + status = GdipDeleteRegion(region); + expect(Ok, status); + + /* Test beziers */ + GdipCreatePath(FillModeAlternate, &path); + /* Exactly 90 degrees */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 0.0, 90.0); + expect(Ok, status); + /* Over 90 degrees */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 0.0, 100.0); + expect(Ok, status); + status = GdipCreateRegionPath(path, ®ion); + ok(status == Ok, "status %08x\n", status); + needed = 0; + status = GdipGetRegionDataSize(region, &needed); + ok(status == Ok, "status %08x\n", status); + expect(136, needed); + memset(buf, 0xee, sizeof(buf)); + needed = 0; + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); + ok(status == Ok, "status %08x\n", status); + expect(136, needed); + expect_dword(buf, 128); + trace("buf[1] = %08x\n", buf[1]); + expect_magic(buf + 2); + expect_dword(buf + 3, 0); + expect_dword(buf + 4, RGNDATA_PATH); + expect_dword(buf + 5, 112); + expect_magic(buf + 6); + expect_dword(buf + 7, 11); + /* flags 0 means that a path is an array of FLOATs */ + expect_dword(buf + 8, 0); + expect_float(buf + 9, 600.0); + expect_float(buf + 10, 450.0); + expect_float(buf + 11, 600.0); + expect_float(buf + 12, 643.299561); + expect_float(buf + 13, 488.071198); + expect_float(buf + 14, 800.0); + expect_float(buf + 15, 350.0); + expect_float(buf + 16, 800.0); + expect_float(buf + 17, 600.0); + expect_float(buf + 18, 450.0); + expect_float(buf + 19, 600.0); + expect_float(buf + 20, 643.299622); + expect_float(buf + 21, 488.071167); + expect_float(buf + 22, 800.0); + expect_float(buf + 23, 350.0); + expect_float(buf + 24, 800.0); + expect_float(buf + 25, 329.807129); + expect_float(buf + 26, 800.0); + expect_float(buf + 27, 309.688568); + expect_float(buf + 28, 796.574890); + expect_float(buf + 29, 290.084167); + expect_float(buf + 30, 789.799561); + expect_dword(buf + 31, 0x03030300); + expect_dword(buf + 32, 0x03030301); + ok(*(buf + 33) == 0x00030303 /* before win7 */ || + *(buf + 33) == 0x43030303 /* 32-bit win7 */ || *(buf + 33) == 0x4c030303 /* 64-bit win7 */, + "expected 0x00030303 or 0x43030303 or 0x4c030303 got %08x\n", *(buf + 33)); + expect_dword(buf + 34, 0xeeeeeeee); status = GdipDeletePath(path); expect(Ok, status); @@ -640,7 +861,7 @@ expect(36, needed); expect_dword(buf, 28); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_RECT); @@ -660,7 +881,7 @@ expect(156, needed); expect_dword(buf, 148); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); GdipDeletePath(path); @@ -679,7 +900,7 @@ expect(20, needed); expect_dword(buf, 12); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_INFINITE_RECT); GdipDeleteRegion(region2); @@ -706,7 +927,7 @@ expect(180, needed); expect_dword(buf, 172); trace("buf[1] = %08x\n", buf[1]); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 2); expect_dword(buf + 4, CombineModeUnion); @@ -770,11 +991,11 @@ expect(56, needed); expect_dword(buf, 48); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); expect_dword(buf + 5, 0x00000020); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 0x00000004); todo_wine expect_dword(buf + 8, 0x00006000); /* ?? */ @@ -817,11 +1038,11 @@ expect(Ok, status); expect(216, needed); expect_dword(buf, 208); - expect_magic((DWORD*)(buf + 2)); + expect_magic(buf + 2); expect_dword(buf + 3, 0); expect_dword(buf + 4, RGNDATA_PATH); expect_dword(buf + 5, 0x000000C0); - expect_magic((DWORD*)(buf + 6)); + expect_magic(buf + 6); expect_dword(buf + 7, 0x00000024); todo_wine expect_dword(buf + 8, 0x00006000); /* ?? */ } @@ -861,12 +1082,10 @@ status = GdipGetRegionHRgn(region, NULL, &hrgn); ok(status == Ok, "status %08x\n", status); ok(hrgn == NULL, "hrgn=%p\n", hrgn); - DeleteObject(hrgn); status = GdipGetRegionHRgn(region, graphics, &hrgn); ok(status == Ok, "status %08x\n", status); ok(hrgn == NULL, "hrgn=%p\n", hrgn); - DeleteObject(hrgn); status = GdipSetEmpty(region); ok(status == Ok, "status %08x\n", status); @@ -1866,6 +2085,56 @@ GdipDeleteRegion(region); GdipDeleteGraphics(graphics); ReleaseDC(0, hdc); +} + +static void test_excludeinfinite(void) +{ + GpStatus status; + GpRegion *region; + UINT count=0xdeadbeef; + GpRectF scans[4]; + GpMatrix *identity; + static const RectF rect_exclude = {0.0, 0.0, 1.0, 1.0}; + + status = GdipCreateMatrix(&identity); + expect(Ok, status); + + status = GdipCreateRegion(®ion); + expect(Ok, status); + + status = GdipCombineRegionRect(region, &rect_exclude, CombineModeExclude); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, identity); + expect(Ok, status); + expect(4, count); + + count = 4; + status = GdipGetRegionScans(region, scans, (INT*)&count, identity); + expect(Ok, status); + + expectf(-4194304.0, scans[0].X); + expectf(-4194304.0, scans[0].Y); + expectf(8388608.0, scans[0].Width); + expectf(4194304.0, scans[0].Height); + + expectf(-4194304.0, scans[1].X); + expectf(0.0, scans[1].Y); + expectf(4194304.0, scans[1].Width); + expectf(1.0, scans[1].Height); + + expectf(1.0, scans[2].X); + expectf(0.0, scans[2].Y); + expectf(4194303.0, scans[2].Width); + expectf(1.0, scans[2].Height); + + expectf(-4194304.0, scans[3].X); + expectf(1.0, scans[3].Y); + expectf(8388608.0, scans[3].Width); + expectf(4194303.0, scans[3].Height); + + GdipDeleteRegion(region); + GdipDeleteMatrix(identity); } START_TEST(region) @@ -1893,6 +2162,7 @@ test_getbounds(); test_isvisiblepoint(); test_isvisiblerect(); + test_excludeinfinite(); GdiplusShutdown(gdiplusToken); }
10 years, 8 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
50
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
Results per page:
10
25
50
100
200