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
November 2016
----- 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
317 discussions
Start a n
N
ew thread
[akhaldi] 73280: [MSCTF] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:50:15 2016 New Revision: 73280 URL:
http://svn.reactos.org/svn/reactos?rev=73280&view=rev
Log: [MSCTF] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/msctf/threadmgr.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msctf/threadmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/threadmgr.…
============================================================================== --- trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] Thu Nov 17 22:50:15 2016 @@ -594,6 +594,12 @@ if (IsEqualIID(riid, &IID_ITfThreadMgrEventSink)) return advise_sink(&This->ThreadMgrEventSink, &IID_ITfThreadMgrEventSink, COOKIE_MAGIC_TMSINK, punk, pdwCookie); + if (IsEqualIID(riid, &IID_ITfThreadFocusSink)) + { + WARN("semi-stub for ITfThreadFocusSink: sink won't be used.\n"); + return advise_sink(&This->ThreadMgrEventSink, &IID_ITfThreadMgrEventSink, COOKIE_MAGIC_TMSINK, punk, pdwCookie); + } + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); return E_NOTIMPL; } 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] Thu Nov 17 22:50:15 2016 @@ -106,7 +106,7 @@ reactos/dll/win32/mscat32 # Synced to WineStaging-1.9.11 reactos/dll/win32/mscms # Synced to WineStaging-1.9.11 reactos/dll/win32/mscoree # Synced to Wine-1.5.4 -reactos/dll/win32/msctf # Synced to WineStaging-1.9.16 +reactos/dll/win32/msctf # Synced to WineStaging-1.9.23 reactos/dll/win32/msftedit # Synced to WineStaging-1.9.11 reactos/dll/win32/msg711.acm # Synced to WineStaging-1.9.11 reactos/dll/win32/msgsm32.acm # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73279: [MSACM32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:49:19 2016 New Revision: 73279 URL:
http://svn.reactos.org/svn/reactos?rev=73279&view=rev
Log: [MSACM32_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/msacm32/msacm.c Modified: trunk/rostests/winetests/msacm32/msacm.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msacm32/msacm.c…
============================================================================== --- trunk/rostests/winetests/msacm32/msacm.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msacm32/msacm.c [iso-8859-1] Thu Nov 17 22:49:19 2016 @@ -591,17 +591,21 @@ hdr.cbDstLength = sizeof(pcm); mr = acmStreamPrepareHeader(has, &hdr, 0); -todo_wine ok(mr == MMSYSERR_INVALPARAM, "expected 0x0b, got 0x%x\n", mr); hdr.cbSrcLength = src->wfx.nBlockAlign - 1; /* less than block align */ mr = acmStreamPrepareHeader(has, &hdr, 0); -todo_wine ok(mr == ACMERR_NOTPOSSIBLE, "expected 0x200, got 0x%x\n", mr); + + hdr.cbSrcLength = src->wfx.nBlockAlign + 1; /* more than block align */ + mr = acmStreamPrepareHeader(has, &hdr, 0); + ok(mr == MMSYSERR_NOERROR, "prepare failed: 0x%x\n", mr); + + mr = acmStreamUnprepareHeader(has, &hdr, 0); + ok(mr == MMSYSERR_NOERROR, "unprepare failed: 0x%x\n", mr); hdr.cbSrcLength = src->wfx.nBlockAlign; mr = acmStreamPrepareHeader(has, &hdr, 1); /* invalid use of reserved parameter */ -todo_wine ok(mr == MMSYSERR_INVALFLAG, "expected 0x0a, got 0x%x\n", mr); mr = acmStreamPrepareHeader(has, &hdr, 0); @@ -675,7 +679,6 @@ hdr.pbDst = pcm; hdr.cbDstLength = -4; mr = acmStreamPrepareHeader(has, &hdr, 0); -todo_wine { ok(mr == ACMERR_NOTPOSSIBLE, "expected 0x200, got 0x%x\n", mr); ok(hdr.fdwStatus == 0, "expected 0, got 0x%x\n", hdr.fdwStatus); @@ -688,7 +691,7 @@ mr = acmStreamUnprepareHeader(has, &hdr, 0); ok(mr == ACMERR_UNPREPARED, "expected 0x202, got 0x%x\n", mr); -} + /* Less output space than required */ memset(&hdr, 0, sizeof(hdr)); hdr.cbStruct = sizeof(hdr); @@ -826,9 +829,80 @@ ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); } +void test_mp3(void) +{ + MPEGLAYER3WAVEFORMAT src; + WAVEFORMATEX dst; + HACMSTREAM has; + DWORD output; + MMRESULT mr; + + src.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3; + src.wfx.nSamplesPerSec = 11025; + src.wfx.wBitsPerSample = 0; + src.wfx.nChannels = 1; + src.wfx.nBlockAlign = 576; + src.wfx.nAvgBytesPerSec = 2000; + + src.wID = MPEGLAYER3_ID_MPEG; + src.fdwFlags = 0; + src.nBlockSize = 576; + src.nFramesPerBlock = 1; + src.nCodecDelay = 0; + + dst.cbSize = 0; + dst.wFormatTag = WAVE_FORMAT_PCM; + dst.nSamplesPerSec = 11025; + dst.wBitsPerSample = 16; + dst.nChannels = 1; + dst.nBlockAlign = dst.wBitsPerSample * dst.nChannels / 8; + dst.nAvgBytesPerSec = dst.nSamplesPerSec * dst.nBlockAlign; + + src.wfx.cbSize = 0; + + mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); + ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got 0x%x\n", mr); + if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0); + + src.wfx.cbSize = MPEGLAYER3_WFX_EXTRA_BYTES; + src.wID = 0; + + mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); + ok(mr == ACMERR_NOTPOSSIBLE, "expected error ACMERR_NOTPOSSIBLE, got 0x%x\n", mr); + if (mr == MMSYSERR_NOERROR) acmStreamClose(has, 0); + + src.wID = MPEGLAYER3_ID_MPEG; + src.nBlockSize = 0; + + mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + mr = acmStreamClose(has, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + + src.nBlockSize = 576; + src.wfx.nAvgBytesPerSec = 0; + + mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + /* causes a division by zero exception */ + if (0) acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE); + mr = acmStreamClose(has, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + + src.wfx.nAvgBytesPerSec = 2000; + + mr = acmStreamOpen(&has, NULL, (WAVEFORMATEX*)&src, &dst, NULL, 0, 0, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + mr = acmStreamSize(has, 4000, &output, ACM_STREAMSIZEF_SOURCE); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); + mr = acmStreamClose(has, 0); + ok(mr == MMSYSERR_NOERROR, "failed with error 0x%x\n", mr); +} + START_TEST(msacm) { driver_tests(); test_prepareheader(); test_acmFormatSuggest(); + test_mp3(); }
8 years, 1 month
1
0
0
0
[akhaldi] 73278: [MSACM32] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:48:39 2016 New Revision: 73278 URL:
http://svn.reactos.org/svn/reactos?rev=73278&view=rev
Log: [MSACM32] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/msacm32/msacm32_main.c trunk/reactos/dll/win32/msacm32/stream.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msacm32/msacm32_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/msacm32_…
============================================================================== --- trunk/reactos/dll/win32/msacm32/msacm32_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msacm32/msacm32_main.c [iso-8859-1] Thu Nov 17 22:48:39 2016 @@ -72,6 +72,8 @@ switch (version.dwPlatformId) { case VER_PLATFORM_WIN32_NT: return 0x04000565; /* 4.0.1381 */ + case VER_PLATFORM_WIN32s: + return 0x02010000; /* 2.1 */ default: FIXME("%x not supported\n", version.dwPlatformId); /* fall through */ Modified: trunk/reactos/dll/win32/msacm32/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msacm32/stream.c…
============================================================================== --- trunk/reactos/dll/win32/msacm32/stream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msacm32/stream.c [iso-8859-1] Thu Nov 17 22:48:39 2016 @@ -37,6 +37,15 @@ return (PWINE_ACMSTREAM)has; } +static BOOL ACM_ValidatePointers(PACMDRVSTREAMHEADER padsh) +{ + /* check that pointers have not been modified */ + return !(padsh->pbPreparedSrc != padsh->pbSrc || + padsh->cbPreparedSrcLength < padsh->cbSrcLength || + padsh->pbPreparedDst != padsh->pbDst || + padsh->cbPreparedDstLength < padsh->cbDstLength); +} + /*********************************************************************** * acmStreamClose (MSACM32.@) */ @@ -95,13 +104,9 @@ */ padsh = (PACMDRVSTREAMHEADER)pash; - /* check that pointers have not been modified */ - if (padsh->pbPreparedSrc != padsh->pbSrc || - padsh->cbPreparedSrcLength < padsh->cbSrcLength || - padsh->pbPreparedDst != padsh->pbDst || - padsh->cbPreparedDstLength < padsh->cbDstLength) { - WARN("invalid parameter\n"); - return MMSYSERR_INVALPARAM; + if (!ACM_ValidatePointers(padsh)) { + WARN("invalid parameter\n"); + return MMSYSERR_INVALPARAM; } padsh->fdwConvert = fdwConvert; @@ -289,14 +294,21 @@ if ((was = ACM_GetStream(has)) == NULL) { WARN("invalid handle\n"); - return MMSYSERR_INVALHANDLE; + return MMSYSERR_INVALHANDLE; } if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER)) { WARN("invalid parameter\n"); - return MMSYSERR_INVALPARAM; - } - if (fdwPrepare) - ret = MMSYSERR_INVALFLAG; + return MMSYSERR_INVALPARAM; + } + if (fdwPrepare) { + WARN("invalid use of reserved parameter\n"); + return MMSYSERR_INVALFLAG; + } + if (pash->cbSrcLength < was->drvInst.pwfxSrc->nBlockAlign) { + WARN("source smaller than block align (%d < %d)\n", + pash->cbSrcLength, was->drvInst.pwfxSrc->nBlockAlign); + return pash->cbSrcLength ? ACMERR_NOTPOSSIBLE : MMSYSERR_INVALPARAM; + } /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same * size. some fields are private to msacm internals, and are exposed @@ -447,13 +459,9 @@ */ padsh = (PACMDRVSTREAMHEADER)pash; - /* check that pointers have not been modified */ - if (padsh->pbPreparedSrc != padsh->pbSrc || - padsh->cbPreparedSrcLength < padsh->cbSrcLength || - padsh->pbPreparedDst != padsh->pbDst || - padsh->cbPreparedDstLength < padsh->cbDstLength) { - WARN("invalid parameter\n"); - return MMSYSERR_INVALPARAM; + if (!ACM_ValidatePointers(padsh)) { + WARN("invalid parameter\n"); + return MMSYSERR_INVALPARAM; } padsh->fdwConvert = fdwUnprepare; 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] Thu Nov 17 22:48:39 2016 @@ -100,7 +100,7 @@ reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23 reactos/dll/win32/mpr # Synced to WineStaging-1.9.11 reactos/dll/win32/mprapi # Synced to WineStaging-1.9.11 -reactos/dll/win32/msacm32 # Synced to WineStaging-1.9.11 +reactos/dll/win32/msacm32 # Synced to WineStaging-1.9.23 reactos/dll/win32/msacm32.drv # Synced to WineStaging-1.9.11 reactos/dll/win32/msadp32.acm # Synced to WineStaging-1.9.11 reactos/dll/win32/mscat32 # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73277: [MMDEVAPI_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:47:02 2016 New Revision: 73277 URL:
http://svn.reactos.org/svn/reactos?rev=73277&view=rev
Log: [MMDEVAPI_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/mmdevapi/capture.c trunk/rostests/winetests/mmdevapi/propstore.c Modified: trunk/rostests/winetests/mmdevapi/capture.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mmdevapi/captur…
============================================================================== --- trunk/rostests/winetests/mmdevapi/capture.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mmdevapi/capture.c [iso-8859-1] Thu Nov 17 22:47:02 2016 @@ -309,19 +309,13 @@ if(hr == S_OK){ /* The discontinuity is reported here, but is this an old or new packet? */ - if(!(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY)){ + todo_wine_if(!(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY)) { /* FIXME: Some drivers fail */ - todo_wine ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); - todo_wine ok(pos == sum + frames, "Position %u gap %d\n", - (UINT)pos, (UINT)pos - sum); - }else{ ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); - /* Native's position is one period further than what we read. * Perhaps that's precisely the meaning of DATA_DISCONTINUITY: * signal when the position jump left a gap. */ - ok(pos == sum + frames, "Position %u gap %d\n", - (UINT)pos, (UINT)pos - sum); + ok(pos == sum + frames, "Position %u gap %d\n", (UINT)pos, (UINT)pos - sum); } ok(pad == next, "GCP %u vs. BufferSize %u\n", (UINT32)pad, next); Modified: trunk/rostests/winetests/mmdevapi/propstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/mmdevapi/propst…
============================================================================== --- trunk/rostests/winetests/mmdevapi/propstore.c [iso-8859-1] (original) +++ trunk/rostests/winetests/mmdevapi/propstore.c [iso-8859-1] Thu Nov 17 22:47:02 2016 @@ -64,7 +64,7 @@ pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv); ok(hr == S_OK, "Failed with %08x\n", hr); - ok(pv.vt == VT_EMPTY, "Key should not be found\n"); + ok(pv.vt == VT_LPWSTR && pv.u.pwszVal, "FriendlyName value had wrong type: 0x%x or was NULL\n", pv.vt); pv.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_Enabled, &pv); @@ -118,8 +118,9 @@ if (IsEqualPropertyKey(pkey, DEVPKEY_Device_DeviceDesc)) found_desc = TRUE; } - ok(found_name || broken(!found_name), "DEVPKEY_Device_FriendlyName not found\n"); - ok(found_desc == TRUE, "DEVPKEY_Device_DeviceDesc not found\n"); + ok(found_name || + broken(!found_name) /* vista */, "DEVPKEY_Device_FriendlyName not found\n"); + ok(found_desc, "DEVPKEY_Device_DeviceDesc not found\n"); } static void test_setvalue_on_wow64(IPropertyStore *store)
8 years, 1 month
1
0
0
0
[akhaldi] 73276: [MMDEVAPI] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:45:24 2016 New Revision: 73276 URL:
http://svn.reactos.org/svn/reactos?rev=73276&view=rev
Log: [MMDEVAPI] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/mmdevapi/devenum.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mmdevapi/devenum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/devenum…
============================================================================== --- trunk/reactos/dll/win32/mmdevapi/devenum.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mmdevapi/devenum.c [iso-8859-1] Thu Nov 17 22:45:24 2016 @@ -338,6 +338,7 @@ pv.vt = VT_LPWSTR; pv.u.pwszVal = name; MMDevice_SetPropValue(id, flow, (const PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &pv); + MMDevice_SetPropValue(id, flow, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv); MMDevice_SetPropValue(id, flow, (const PROPERTYKEY*)&DEVPKEY_Device_DeviceDesc, &pv); pv.u.pwszVal = guidstr; 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] Thu Nov 17 22:45:24 2016 @@ -97,7 +97,7 @@ reactos/dll/win32/mciwave # Synced to WineStaging-1.9.11 reactos/dll/win32/mgmtapi # Synced to WineStaging-1.9.11 reactos/dll/win32/mlang # Synced to WineStaging-1.9.16 -reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.16 +reactos/dll/win32/mmdevapi # Synced to WineStaging-1.9.23 reactos/dll/win32/mpr # Synced to WineStaging-1.9.11 reactos/dll/win32/mprapi # Synced to WineStaging-1.9.11 reactos/dll/win32/msacm32 # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73275: [INSENG] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:44:24 2016 New Revision: 73275 URL:
http://svn.reactos.org/svn/reactos?rev=73275&view=rev
Log: [INSENG] Sync with Wine Staging 1.9.23. CORE-12409 Added: trunk/reactos/dll/win32/inseng/guid.c (with props) trunk/reactos/dll/win32/inseng/icif.c (with props) trunk/reactos/dll/win32/inseng/inf.c (with props) trunk/reactos/dll/win32/inseng/inseng_private.h (with props) Modified: trunk/reactos/dll/win32/inseng/CMakeLists.txt trunk/reactos/dll/win32/inseng/inseng.spec trunk/reactos/dll/win32/inseng/inseng_main.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/inseng/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/CMakeList…
Added: trunk/reactos/dll/win32/inseng/guid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/guid.c?re…
Added: trunk/reactos/dll/win32/inseng/icif.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/icif.c?re…
Added: trunk/reactos/dll/win32/inseng/inf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/inf.c?rev…
Modified: trunk/reactos/dll/win32/inseng/inseng.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/inseng.sp…
Modified: trunk/reactos/dll/win32/inseng/inseng_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/inseng_ma…
Added: trunk/reactos/dll/win32/inseng/inseng_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inseng/inseng_pr…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
8 years, 1 month
1
0
0
0
[akhaldi] 73274: [PSDK] Update inseng.idl. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:42:31 2016 New Revision: 73274 URL:
http://svn.reactos.org/svn/reactos?rev=73274&view=rev
Log: [PSDK] Update inseng.idl. CORE-12409 Modified: trunk/reactos/sdk/include/psdk/inseng.idl Modified: trunk/reactos/sdk/include/psdk/inseng.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/inseng.id…
============================================================================== --- trunk/reactos/sdk/include/psdk/inseng.idl [iso-8859-1] (original) +++ trunk/reactos/sdk/include/psdk/inseng.idl [iso-8859-1] Thu Nov 17 22:42:31 2016 @@ -1,5 +1,6 @@ /* * Copyright 2015 Jacek Caban for CodeWeavers + * Copyright 2016 Michael Müller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,15 +27,231 @@ interface IStream; -/* FIXME: Add full declarations. */ -interface ICifComponent; -interface IEnumCifComponents; -interface ICifGroup; -interface IEnumCifGroups; -interface ICifMode; -interface IEnumCifModes; - -typedef struct { +cpp_quote("#define MAX_ID_LENGTH 48") +cpp_quote("#define MAX_DISPLAYNAME_LENGTH 128") + +cpp_quote("#define URLF_DEFAULT 0x0") +cpp_quote("#define URLF_EXTRACT 0x1") +cpp_quote("#define URLF_RELATIVEURL 0x2") +cpp_quote("#define URLF_DELETE_AFTER_EXTRACT 0x4") + +cpp_quote("#define ENGINESTATUS_NOTREADY 0x0") +cpp_quote("#define ENGINESTATUS_LOADING 0x1") +cpp_quote("#define ENGINESTATUS_INSTALLING 0x2") +cpp_quote("#define ENGINESTATUS_READY 0x3") + +cpp_quote("#define SETACTION_NONE 0x0") +cpp_quote("#define SETACTION_INSTALL 0x1") + +cpp_quote("#define INSTALLOPTIONS_NOCACHE 0x01") +cpp_quote("#define INSTALLOPTIONS_DOWNLOAD 0x02") +cpp_quote("#define INSTALLOPTIONS_INSTALL 0x04") +cpp_quote("#define INSTALLOPTIONS_DONTALLOWXPLATFORM 0x08") +cpp_quote("#define INSTALLOPTIONS_FORCEDEPENDENCIES 0x10") + +cpp_quote("#define EXECUTEJOB_SILENT 0x01") +cpp_quote("#define EXECUTEJOB_DELETE_JOB 0x02") +cpp_quote("#define EXECUTEJOB_VERIFYFILES 0x08") +cpp_quote("#define EXECUTEJOB_IGNORETRUST 0x10") +cpp_quote("#define EXECUTEJOB_IGNOREDOWNLOADERROR 0x20") +cpp_quote("#define EXECUTEJOB_DONTALLOWCANCEL 0x40") + +cpp_quote("#define ENGINEPROBLEM_DOWNLOADFAIL 0x1") + +cpp_quote("#define PLATFORM_WIN95 0x01") +cpp_quote("#define PLATFORM_WIN98 0x02") +cpp_quote("#define PLATFORM_NT4 0x04") +cpp_quote("#define PLATFORM_NT5 0x08") +cpp_quote("#define PLATFORM_NT4ALPHA 0x10") +cpp_quote("#define PLATFORM_NT5ALPHA 0x20") +cpp_quote("#define PLATFORM_MILLEN 0x40") +cpp_quote("#define PLATFORM_ALL (PLATFORM_WIN95 | PLATFORM_WIN98 | PLATFORM_NT4 | PLATFORM_NT5 | PLATFORM_NT4ALPHA | PLATFORM_NT5ALPHA | PLATFORM_MILLEN)") + +enum InstallStatus +{ + INSTALLSTATUS_INITIALIZING, + INSTALLSTATUS_DEPENDENCY, + INSTALLSTATUS_DOWNLOADING, + INSTALLSTATUS_COPYING, + INSTALLSTATUS_RETRYING, + INSTALLSTATUS_CHECKINGTRUST, + INSTALLSTATUS_EXTRACTING, + INSTALLSTATUS_RUNNING, + INSTALLSTATUS_FINISHED, + INSTALLSTATUS_DOWNLOADFINISHED, +}; + +enum ComponentAction +{ + ActionNone, + ActionInstall, + ActionUninstall, +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifComponent +{ + HRESULT GetID(char *id, DWORD size); + HRESULT GetGUID(char *guid, DWORD size); + HRESULT GetDescription(char *desc, DWORD size); + HRESULT GetDetails(char *details, DWORD size); + HRESULT GetUrl(UINT index, char *url, DWORD size, DWORD *flags); + HRESULT GetFileExtractList(UINT index, char *extract, DWORD size); + HRESULT GetUrlCheckRange(UINT index, DWORD *min, DWORD *max); + HRESULT GetCommand(UINT index, char *cmd, DWORD cmd_size, char *switches, DWORD switch_size, DWORD *type); + HRESULT GetVersion(DWORD *version, DWORD *build); + HRESULT GetLocale(char *pszLocale, DWORD size); + HRESULT GetUninstallKey(char *key, DWORD size); + HRESULT GetInstalledSize(DWORD *win, DWORD *app); + DWORD GetDownloadSize(); + DWORD GetExtractSize(); + HRESULT GetSuccessKey(char *key, DWORD size); + HRESULT GetProgressKeys(char *progress, DWORD progress_size, char *cancel, DWORD cancel_size); + HRESULT IsActiveSetupAware(); + HRESULT IsRebootRequired(); + HRESULT RequiresAdminRights(); + DWORD GetPriority(); + HRESULT GetDependency(UINT index, char *id, DWORD buf, char *type, DWORD *ver, DWORD *build); + DWORD GetPlatform(); + HRESULT GetMode(UINT index, char *mode, DWORD size); + HRESULT GetGroup(char *id, DWORD size); + HRESULT IsUIVisible(); + HRESULT GetPatchID(char *id, DWORD size); + HRESULT GetDetVersion(char *dll, DWORD dll_size, char *entry, DWORD entry_size); + HRESULT GetTreatAsOneComponents(UINT index, char *id, DWORD buf); + HRESULT GetCustomData(char *key, char *data, DWORD size); + DWORD IsComponentInstalled(); + HRESULT IsComponentDownloaded(); + DWORD IsThisVersionInstalled(DWORD version, DWORD build, DWORD *ret_version, DWORD *ret_build); + DWORD GetInstallQueueState(); + HRESULT SetInstallQueueState(DWORD state); + DWORD GetActualDownloadSize(); + DWORD GetCurrentPriority(); + HRESULT SetCurrentPriority(DWORD priority); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifRWComponent : ICifComponent +{ + HRESULT SetGUID(const char *guid); + HRESULT SetDescription(const char *desc); + HRESULT SetUrl(UINT index, const char *url, DWORD url_flags); + HRESULT SetCommand(UINT index, const char *cmd, const char *switches, DWORD type); + HRESULT SetVersion(const char *version); + HRESULT SetUninstallKey(const char *key); + HRESULT SetInstalledSize(DWORD win, DWORD app); + HRESULT SetDownloadSize(DWORD size); + HRESULT SetExtractSize(DWORD size); + HRESULT DeleteDependency(const char *id, char type); + HRESULT AddDependency(const char *id, char type); + HRESULT SetUIVisible(BOOL visible); + HRESULT SetGroup(const char *id); + HRESULT SetPlatform(DWORD platform); + HRESULT SetPriority(DWORD priority); + HRESULT SetReboot(BOOL reboot); + HRESULT DeleteFromModes(const char *mode); + HRESULT AddToMode(const char *mode); + HRESULT SetModes(const char *mode); + HRESULT CopyComponent(const char *ciffile); + HRESULT AddToTreatAsOne(const char *compid); + HRESULT SetDetails(const char *desc); +}; + +[ + object, + local, + pointer_default(unique) +] +interface IEnumCifComponents : IUnknown +{ + HRESULT Next(ICifComponent **); + HRESULT Reset(); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifGroup +{ + HRESULT GetID(char *id, DWORD size); + HRESULT GetDescription(char *desc, DWORD size); + DWORD GetPriority(); + + HRESULT EnumComponents(IEnumCifComponents **, DWORD filter, void *pv); + DWORD GetCurrentPriority(); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifRWGroup : ICifGroup +{ + HRESULT SetDescription(const char *desc); + HRESULT SetPriority(DWORD priority); + HRESULT SetDetails(const char *details); +}; + +[ + object, + local, + pointer_default(unique) +] +interface IEnumCifGroups : IUnknown +{ + HRESULT Next(ICifGroup **); + HRESULT Reset(); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifMode +{ + HRESULT GetID(char *id, DWORD size); + HRESULT GetDescription(char *desc, DWORD size); + HRESULT GetDetails(char *details, DWORD size); + + HRESULT EnumComponents(IEnumCifComponents **, DWORD filter, void *pv); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ICifRWMode : ICifMode +{ + HRESULT SetDescription(const char *desc); + HRESULT SetDetails(const char *details); +}; + +[ + object, + local, + pointer_default(unique) +] +interface IEnumCifModes : IUnknown +{ + HRESULT Next(ICifMode **); + HRESULT Reset(); +}; + +typedef struct +{ DWORD cbSize; DWORD dwInstallSize; DWORD dwWinDriveSize; @@ -49,6 +266,15 @@ DWORD dwTotalDownloadSize; } COMPONENT_SIZES; +typedef struct +{ + DWORD cbSize; + DWORD dwDownloadKBRemaining; + DWORD dwInstallKBRemaining; + DWORD dwDownloadSecsRemaining; + DWORD dwInstallSecsRemaining; +} INSTALLPROGRESS; + [ uuid(6e449688-c509-11cf-aafa-00aa00b6015c), local @@ -62,7 +288,24 @@ HRESULT EnumModes(IEnumCifModes **cuf_modes, DWORD filter, void *pv); HRESULT FindMode(const char *id, ICifMode **p); HRESULT GetDescription(char *desc, DWORD size); - HRESULT GetDetDlls(char **dlls, DWORD size); + HRESULT GetDetDlls(char *dlls, DWORD size); +} + +[ + object, + local, + pointer_default(unique) +] +interface ICifRWFile : ICifFile +{ + HRESULT SetDescription(const char *desc); + HRESULT CreateComponent(const char *id, ICifRWComponent **p); + HRESULT CreateGroup(const char *id, ICifRWGroup **p); + HRESULT CreateMode(const char *id, ICifRWMode **p); + HRESULT DeleteComponent(const char *id); + HRESULT DeleteGroup(const char *id); + HRESULT DeleteMode(const char *id); + HRESULT Flush(); } [ @@ -78,7 +321,7 @@ const char *msg_string, ULONG progress, ULONG max); HRESULT OnStopComponent(const char *id, HRESULT error, DWORD phrase, const char *string, DWORD status); HRESULT OnStopInstall(HRESULT error, const char *error_string, DWORD status); - HRESULT OnEngineProblem(DWORD problem, LPDWORD action); + HRESULT OnEngineProblem(DWORD problem, DWORD *action); } [ @@ -122,6 +365,16 @@ } [ + uuid(6e449687-c509-11cf-aafa-00aa00b6015c), + local +] +interface IInstallEngineTiming : IUnknown +{ + HRESULT GetRates(DWORD *download, DWORD *install); + HRESULT GetInstallProgress(INSTALLPROGRESS *progress); +} + +[ helpstring("Microsoft Active Setup Engine"), threading(apartment), uuid(6e449686-c509-11cf-aafa-00aa00b6015c) @@ -134,3 +387,6 @@ uuid(bfc880f1-7484-11d0-8309-00aa00b6015c) ] coclass DownloadSiteMgr { } + +cpp_quote("HRESULT WINAPI GetICifFileFromFile(ICifFile **, const char *);") +cpp_quote("HRESULT WINAPI GetICifRWFileFromFile(ICifRWFile **, const char *);")
8 years, 1 month
1
0
0
0
[akhaldi] 73273: [INETCOMM_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:39:46 2016 New Revision: 73273 URL:
http://svn.reactos.org/svn/reactos?rev=73273&view=rev
Log: [INETCOMM_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 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] Thu Nov 17 22:39:46 2016 @@ -338,6 +338,59 @@ hr = IMimeMessage_GetAttachments(msg, &count, &body_list); ok(hr == S_OK, "ret %08x\n", hr); ok(count == 2, "got %d\n", count); + if(count == 2) + { + ENCODINGTYPE encoding; + IMimeBody *attachment; + PROPVARIANT prop; + + PropVariantInit(&prop); + + hr = IMimeMessage_BindToObject(msg, body_list[0], &IID_IMimeBody, (void**)&attachment); + ok(hr == S_OK, "ret %08x\n", hr); + + hr = IMimeBody_IsContentType(attachment, "multipart", NULL); + ok(hr == S_FALSE, "ret %08x\n", hr); + + hr = IMimeBody_GetCurrentEncoding(attachment, &encoding); + ok(hr == S_OK, "ret %08x\n", hr); + todo_wine ok(encoding == IET_8BIT, "ret %d\n", encoding); + + prop.vt = VT_LPSTR; + hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop); + ok(hr == S_OK, "ret %08x\n", hr); + + ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); + ok(!strcmp(prop.u.pszVal, "8bit"), "got %s\n", prop.u.pszVal); + PropVariantClear(&prop); + + hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT); + todo_wine ok(hr == S_FALSE, "ret %08x\n", hr); + + IMimeBody_Release(attachment); + + hr = IMimeMessage_BindToObject(msg, body_list[1], &IID_IMimeBody, (void**)&attachment); + ok(hr == S_OK, "ret %08x\n", hr); + + hr = IMimeBody_IsContentType(attachment, "multipart", NULL); + ok(hr == S_FALSE, "ret %08x\n", hr); + + hr = IMimeBody_GetCurrentEncoding(attachment, &encoding); + ok(hr == S_OK, "ret %08x\n", hr); + todo_wine ok(encoding == IET_7BIT, "ret %d\n", encoding); + + prop.vt = VT_LPSTR; + hr = IMimeBody_GetProp(attachment, "Content-Transfer-Encoding", 0, &prop); + ok(hr == S_OK, "ret %08x\n", hr); + ok(prop.vt == VT_LPSTR, "type %d\n", prop.vt); + ok(!strcmp(prop.u.pszVal, "7bit"), "got %s\n", prop.u.pszVal); + PropVariantClear(&prop); + + hr = IMimeBody_IsType(attachment, IBT_ATTACHMENT); + ok(hr == S_OK, "ret %08x\n", hr); + + IMimeBody_Release(attachment); + } CoTaskMemFree(body_list); hr = IMimeBody_GetCharset(body, &hcs);
8 years, 1 month
1
0
0
0
[akhaldi] 73272: [INETCOMM] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:39:08 2016 New Revision: 73272 URL:
http://svn.reactos.org/svn/reactos?rev=73272&view=rev
Log: [INETCOMM] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.spec trunk/reactos/dll/win32/inetcomm/mimeole.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/inetcomm.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/inetcomm.spec [iso-8859-1] Thu Nov 17 22:39:08 2016 @@ -82,7 +82,7 @@ @ stdcall MimeOleGetPropertySchema(ptr) @ stub MimeOleGetRelatedSection @ stub MimeOleInetDateToFileTime -@ stub MimeOleObjectFromMoniker +@ stdcall MimeOleObjectFromMoniker(long ptr ptr ptr ptr ptr) @ stub MimeOleOpenFileStream @ stub MimeOleParseMhtmlUrl @ stub MimeOleParseRfc822Address 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] Thu Nov 17 22:39:08 2016 @@ -3420,3 +3420,11 @@ return E_NOTIMPL; } + +HRESULT WINAPI MimeOleObjectFromMoniker(BINDF bindf, IMoniker *moniker, IBindCtx *binding, + REFIID riid, void **out, IMoniker **moniker_new) +{ + FIXME("(0x%08x, %p, %p, %s, %p, %p) stub\n", bindf, moniker, binding, debugstr_guid(riid), out, moniker_new); + + return E_NOTIMPL; +} 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] Thu Nov 17 22:39:08 2016 @@ -78,7 +78,7 @@ reactos/dll/win32/imaadp32.acm # Synced to WineStaging-1.9.11 reactos/dll/win32/imagehlp # Synced to WineStaging-1.9.11 reactos/dll/win32/imm32 # Synced to Wine-1.7.27 -reactos/dll/win32/inetcomm # Synced to WineStaging-1.9.16 +reactos/dll/win32/inetcomm # Synced to WineStaging-1.9.23 reactos/dll/win32/inetmib1 # Synced to WineStaging-1.9.11 reactos/dll/win32/initpki # Synced to WineStaging-1.9.11 reactos/dll/win32/inseng # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73271: [GDIPLUS_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Nov 17 22:37:09 2016 New Revision: 73271 URL:
http://svn.reactos.org/svn/reactos?rev=73271&view=rev
Log: [GDIPLUS_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: 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 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] Thu Nov 17 22:37:09 2016 @@ -331,6 +331,64 @@ GdipDeleteGraphics(graphics2); log_state(state_a, &state_log); + + /* A state created by SaveGraphics cannot be restored with EndContainer. */ + GdipCreateFromHDC(hdc, &graphics1); + GdipSetInterpolationMode(graphics1, InterpolationModeBilinear); + stat = GdipSaveGraphics(graphics1, &state_a); + expect(Ok, stat); + GdipSetInterpolationMode(graphics1, InterpolationModeBicubic); + stat = GdipEndContainer(graphics1, state_a); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBicubic, mode); + stat = GdipRestoreGraphics(graphics1, state_a); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBilinear, mode); + GdipDeleteGraphics(graphics1); + + log_state(state_a, &state_log); + + /* A state created by BeginContainer cannot be restored with RestoreGraphics. */ + GdipCreateFromHDC(hdc, &graphics1); + GdipSetInterpolationMode(graphics1, InterpolationModeBilinear); + stat = GdipBeginContainer2(graphics1, &state_a); + expect(Ok, stat); + GdipSetInterpolationMode(graphics1, InterpolationModeBicubic); + stat = GdipRestoreGraphics(graphics1, state_a); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBicubic, mode); + stat = GdipEndContainer(graphics1, state_a); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBilinear, mode); + GdipDeleteGraphics(graphics1); + + log_state(state_a, &state_log); + + /* BeginContainer and SaveGraphics use the same stack. */ + GdipCreateFromHDC(hdc, &graphics1); + GdipSetInterpolationMode(graphics1, InterpolationModeBilinear); + stat = GdipBeginContainer2(graphics1, &state_a); + expect(Ok, stat); + GdipSetInterpolationMode(graphics1, InterpolationModeBicubic); + stat = GdipSaveGraphics(graphics1, &state_b); + expect(Ok, stat); + GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor); + stat = GdipEndContainer(graphics1, state_a); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBilinear, mode); + stat = GdipRestoreGraphics(graphics1, state_b); + expect(Ok, stat); + GdipGetInterpolationMode(graphics1, &mode); + expect(InterpolationModeBilinear, mode); + GdipDeleteGraphics(graphics1); + + log_state(state_a, &state_log); + log_state(state_b, &state_log); /* The same state value should never be returned twice. */ todo_wine @@ -3847,15 +3905,18 @@ REAL res_x, res_y, scale; GpUnit pen_unit, page_unit; REAL pen_width; - INT cx, cy; + INT cx, cy, path_cx, path_cy; } td[] = { - { 10.0, 10.0, 1.0, UnitPixel, UnitPixel, 1.0, 1, 1 }, - { 10.0, 10.0, 3.0, UnitPixel, UnitPixel, 2.0, 2, 2 }, - { 10.0, 10.0, 30.0, UnitPixel, UnitInch, 1.0, 1, 1 }, - { 10.0, 10.0, 1.0, UnitWorld, UnitPixel, 1.0, 1, 1 }, - { 10.0, 10.0, 3.0, UnitWorld, UnitPixel, 2.0, 6, 6 }, - { 10.0, 10.0, 2.0, UnitWorld, UnitInch, 1.0, 20, 20 }, + { 10.0, 10.0, 1.0, UnitPixel, UnitPixel, 1.0, 1, 1, 1, 1 }, + { 10.0, 10.0, 1.0, UnitPixel, UnitPixel, 0.0, 0, 0, 1, 1 }, + { 10.0, 10.0, 1.0, UnitPixel, UnitPixel, 0.1, 1, 1, 1, 1 }, + { 10.0, 10.0, 3.0, UnitPixel, UnitPixel, 2.0, 2, 2, 2, 2 }, + { 10.0, 10.0, 30.0, UnitPixel, UnitInch, 1.0, 1, 1, 1, 1 }, + { 10.0, 10.0, 1.0, UnitWorld, UnitPixel, 1.0, 1, 1, 1, 1 }, + { 10.0, 10.0, 1.0, UnitWorld, UnitPixel, 0.0, 1, 1, 1, 1 }, + { 10.0, 10.0, 3.0, UnitWorld, UnitPixel, 2.0, 6, 6, 6, 6 }, + { 10.0, 10.0, 2.0, UnitWorld, UnitInch, 1.0, 20, 20, 20, 20 }, }; GpStatus status; int i, j; @@ -3867,6 +3928,7 @@ } u; GpPen *pen; GpPointF corner; + GpPath *path; BitmapData bd; INT min, max, size; @@ -3952,6 +4014,82 @@ size = max-min+1; ok(size == td[i].cy, "%u: expected %d, got %d\n", i, td[i].cy, size); + + status = GdipBitmapUnlockBits(u.bitmap, &bd); + expect(Ok, status); + + status = GdipGraphicsClear(graphics, 0xff000000); + expect(Ok, status); + + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipAddPathLine(path, corner.X/2, 0, corner.X/2, corner.Y); + expect(Ok, status); + + status = GdipClosePathFigure(path); + expect(Ok, status); + + status = GdipAddPathLine(path, 0, corner.Y/2, corner.X, corner.Y/2); + expect(Ok, status); + + status = GdipDrawPath(graphics, pen, path); + expect(Ok, status); + + GdipDeletePath(path); + + status = GdipBitmapLockBits(u.bitmap, NULL, ImageLockModeRead, PixelFormat24bppRGB, &bd); + expect(Ok, status); + + min = -1; + max = -2; + + for (j=0; j<100; j++) + { + if (((BYTE*)bd.Scan0)[j*3] == 0xff) + { + min = j; + break; + } + } + + for (j=99; j>=0; j--) + { + if (((BYTE*)bd.Scan0)[j*3] == 0xff) + { + max = j; + break; + } + } + + size = max-min+1; + + ok(size == td[i].path_cx, "%u: expected %d, got %d\n", i, td[i].path_cx, size); + + min = -1; + max = -2; + + for (j=0; j<100; j++) + { + if (((BYTE*)bd.Scan0)[bd.Stride*j] == 0xff) + { + min = j; + break; + } + } + + for (j=99; j>=0; j--) + { + if (((BYTE*)bd.Scan0)[bd.Stride*j] == 0xff) + { + max = j; + break; + } + } + + size = max-min+1; + + ok(size == td[i].path_cy, "%u: expected %d, got %d\n", i, td[i].path_cy, size); status = GdipBitmapUnlockBits(u.bitmap, &bd); expect(Ok, status); @@ -5843,6 +5981,178 @@ DeleteObject (bmp); DeleteDC (hdc); ReleaseDC(hwnd, dc); +} + +static void test_container_rects(void) +{ + GpStatus status; + GpGraphics *graphics; + HDC hdc = GetDC( hwnd ); + GpRectF dstrect, srcrect; + GraphicsContainer state; + static const GpPointF test_points[3] = {{0.0,0.0}, {1.0,0.0}, {0.0,1.0}}; + GpPointF points[3]; + REAL dpix, dpiy; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + dstrect.X = 0.0; + dstrect.Y = 0.0; + dstrect.Width = 1.0; + dstrect.Height = 1.0; + srcrect = dstrect; + + status = GdipGetDpiX(graphics, &dpix); + expect(Ok, status); + + status = GdipGetDpiY(graphics, &dpiy); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitWorld, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitDisplay, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitMillimeter+1, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(NULL, &dstrect, &srcrect, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, NULL, &srcrect, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, NULL, UnitPixel, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, -1, &state); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, NULL); + expect(InvalidParameter, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(1.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(1.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(1.0/dpix, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(1.0/dpiy, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, status); + + dstrect.X = 1.0; + dstrect.Height = 3.0; + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(2.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(4.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(2.0, points[2].X); + expectf(6.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(0.0, points[0].X); + expectf(0.0, points[0].Y); + expectf(2.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(0.0, points[2].X); + expectf(2.0, points[2].Y); + + status = GdipResetWorldTransform(graphics); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(1.0, points[0].X); + expectf(0.0, points[0].Y); + expectf((dpix+1.0)/dpix, points[1].X); + expectf(0.0, points[1].Y); + expectf(1.0, points[2].X); + expectf(3.0/dpiy, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipSetPageUnit(graphics, UnitInch); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitPixel, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(dpix, points[0].X); + expectf(0.0, points[0].Y); + expectf(dpix*2, points[1].X); + expectf(0.0, points[1].Y); + expectf(dpix, points[2].X); + expectf(dpiy*3, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + status = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state); + expect(Ok, status); + + memcpy(points, test_points, sizeof(points)); + status = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, points, 3); + expect(Ok, status); + expectf(dpix, points[0].X); + expectf(0.0, points[0].Y); + expectf(dpix+1.0, points[1].X); + expectf(0.0, points[1].Y); + expectf(dpix, points[2].X); + expectf(3.0, points[2].Y); + + status = GdipEndContainer(graphics, state); + expect(Ok, status); + + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); } START_TEST(graphics) @@ -5918,6 +6228,7 @@ test_bitmapfromgraphics(); test_GdipFillRectangles(); test_GdipGetVisibleClipBounds_memoryDC(); + test_container_rects(); 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] Thu Nov 17 22:37:09 2016 @@ -1077,6 +1077,7 @@ GpPath *path; GpPen *pen; GpMatrix *m; + INT count=-1; status = GdipCreatePath(FillModeAlternate, &path); expect(Ok, status); @@ -1200,6 +1201,23 @@ status = GdipWidenPath(path, pen, m, 1.0); expect(Ok, status); ok_path(path, widenline_path, sizeof(widenline_path)/sizeof(path_test_t), FALSE); + + /* pen width = 0 pixels - native fails to widen but can draw with this pen */ + GdipDeletePen(pen); + status = GdipCreatePen1(0xffffffff, 0.0, UnitPixel, &pen); + expect(Ok, status); + + status = GdipResetPath(path); + expect(Ok, status); + status = GdipAddPathLine(path, 5.0, 10.0, 50.0, 10.0); + expect(Ok, status); + + status = GdipWidenPath(path, pen, m, 1.0); + expect(Ok, status); + + status = GdipGetPointCount(path, &count); + expect(Ok, status); + todo_wine expect(0, count); GdipDeleteMatrix(m); GdipDeletePen(pen); 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] Thu Nov 17 22:37:09 2016 @@ -49,6 +49,12 @@ DEFINE_GUID(ColorBalanceEffectGuid, 0x537e597d, 0x251e, 0x48da, 0x96, 0x64, 0x29, 0xca, 0x49, 0x6b, 0x70, 0xf8); DEFINE_GUID(RedEyeCorrectionEffectGuid, 0x74d29d05, 0x69a4, 0x4266, 0x95, 0x49, 0x3c, 0xc5, 0x28, 0x36, 0xb6, 0x32); DEFINE_GUID(ColorCurveEffectGuid, 0xdd6a0022, 0x58e4, 0x4a67, 0x9d, 0x9b, 0xd4, 0x8e, 0xb8, 0x81, 0xa5, 0x3d); + +static GpStatus (WINAPI *pGdipBitmapGetHistogramSize)(HistogramFormat,UINT*); +static GpStatus (WINAPI *pGdipBitmapGetHistogram)(GpBitmap*,HistogramFormat,UINT,UINT*,UINT*,UINT*,UINT*); +static GpStatus (WINAPI *pGdipImageSetAbort)(GpImage*,GdiplusAbort*); + +static GpStatus (WINGDIPAPI *pGdipInitializePalette)(ColorPalette*,PaletteType,INT,BOOL,GpBitmap*); #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (UINT)(expected), (UINT)(got)) #define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) @@ -4657,14 +4663,13 @@ { LPCWSTR mime; const GUID *format; - BOOL todo; } td[] = { - { bmp_mimetype, &ImageFormatBMP, FALSE }, - { jpeg_mimetype, &ImageFormatJPEG, FALSE }, - { gif_mimetype, &ImageFormatGIF, TRUE }, - { tiff_mimetype, &ImageFormatTIFF, FALSE }, - { png_mimetype, &ImageFormatPNG, FALSE } + { bmp_mimetype, &ImageFormatBMP }, + { jpeg_mimetype, &ImageFormatJPEG }, + { gif_mimetype, &ImageFormatGIF }, + { tiff_mimetype, &ImageFormatTIFF }, + { png_mimetype, &ImageFormatPNG } }; GUID format, clsid; BOOL ret; @@ -4690,8 +4695,7 @@ ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); - todo_wine_if (td[i].todo) - ok(status == Ok, "GdipSaveImageToStream error %d\n", status); + ok(status == Ok, "GdipSaveImageToStream error %d\n", status); IStream_Release(stream); } @@ -4803,6 +4807,158 @@ GdipFree(palette); GdipDisposeImageAttributes(imageattributes); +} + +static void test_histogram(void) +{ + UINT ch0[256], ch1[256], ch2[256], ch3[256]; + HistogramFormat test_formats[] = + { + HistogramFormatARGB, + HistogramFormatPARGB, + HistogramFormatRGB, + HistogramFormatGray, + HistogramFormatB, + HistogramFormatG, + HistogramFormatR, + HistogramFormatA, + }; + const UINT WIDTH = 8, HEIGHT = 16; + UINT num, i, x; + GpStatus stat; + GpBitmap *bm; + + if (!pGdipBitmapGetHistogramSize) + { + win_skip("GdipBitmapGetHistogramSize is not supported\n"); + return; + } + + stat = pGdipBitmapGetHistogramSize(HistogramFormatARGB, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogramSize(0xff, NULL); + expect(InvalidParameter, stat); + + num = 123; + stat = pGdipBitmapGetHistogramSize(10, &num); + expect(Ok, stat); + expect(256, num); + + for (i = 0; i < sizeof(test_formats)/sizeof(test_formats[0]); i++) + { + num = 0; + stat = pGdipBitmapGetHistogramSize(test_formats[i], &num); + expect(Ok, stat); + expect(256, num); + } + + bm = NULL; + stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm); + expect(Ok, stat); + + /* Three solid rgb rows, next three rows are rgb shades. */ + for (x = 0; x < WIDTH; x++) + { + GdipBitmapSetPixel(bm, x, 0, 0xffff0000); + GdipBitmapSetPixel(bm, x, 1, 0xff00ff00); + GdipBitmapSetPixel(bm, x, 2, 0xff0000ff); + + GdipBitmapSetPixel(bm, x, 3, 0xff010000); + GdipBitmapSetPixel(bm, x, 4, 0xff003f00); + GdipBitmapSetPixel(bm, x, 5, 0xff000020); + } + + stat = pGdipBitmapGetHistogram(NULL, HistogramFormatRGB, 256, ch0, ch1, ch2, ch3); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1, ch2, ch3); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1, ch2, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1, NULL, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, NULL, NULL, NULL); + expect(InvalidParameter, stat); + + /* Requested format matches bitmap format */ + stat = pGdipBitmapGetHistogram(bm, HistogramFormatRGB, 256, ch0, ch1, ch2, ch3); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatRGB, 100, ch0, ch1, ch2, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatRGB, 257, ch0, ch1, ch2, NULL); + expect(InvalidParameter, stat); + + /* Channel 3 is not used, must be NULL */ + stat = pGdipBitmapGetHistogram(bm, HistogramFormatRGB, 256, ch0, ch1, ch2, NULL); + expect(Ok, stat); + + ok(ch0[0xff] == WIDTH, "Got red (0xff) %u\n", ch0[0xff]); + ok(ch1[0xff] == WIDTH, "Got green (0xff) %u\n", ch1[0xff]); + ok(ch2[0xff] == WIDTH, "Got blue (0xff) %u\n", ch1[0xff]); + ok(ch0[0x01] == WIDTH, "Got red (0x01) %u\n", ch0[0x01]); + ok(ch1[0x3f] == WIDTH, "Got green (0x3f) %u\n", ch1[0x3f]); + ok(ch2[0x20] == WIDTH, "Got blue (0x20) %u\n", ch1[0x20]); + + /* ARGB histogram from RGB data. */ + stat = pGdipBitmapGetHistogram(bm, HistogramFormatARGB, 256, ch0, ch1, ch2, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatARGB, 256, ch0, ch1, ch2, ch3); + expect(Ok, stat); + + ok(ch1[0xff] == WIDTH, "Got red (0xff) %u\n", ch1[0xff]); + ok(ch2[0xff] == WIDTH, "Got green (0xff) %u\n", ch2[0xff]); + ok(ch3[0xff] == WIDTH, "Got blue (0xff) %u\n", ch3[0xff]); + ok(ch1[0x01] == WIDTH, "Got red (0x01) %u\n", ch1[0x01]); + ok(ch2[0x3f] == WIDTH, "Got green (0x3f) %u\n", ch2[0x3f]); + ok(ch3[0x20] == WIDTH, "Got blue (0x20) %u\n", ch3[0x20]); + + ok(ch0[0xff] == WIDTH * HEIGHT, "Got alpha (0xff) %u\n", ch0[0xff]); + + /* Request grayscale histogram from RGB bitmap. */ + stat = pGdipBitmapGetHistogram(bm, HistogramFormatGray, 256, ch0, ch1, ch2, ch3); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatGray, 256, ch0, ch1, ch2, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatGray, 256, ch0, ch1, NULL, NULL); + expect(InvalidParameter, stat); + + stat = pGdipBitmapGetHistogram(bm, HistogramFormatGray, 256, ch0, NULL, NULL, NULL); + expect(Ok, stat); + + GdipDisposeImage((GpImage*)bm); +} + +static void test_imageabort(void) +{ + GpStatus stat; + GpBitmap *bm; + + if (!pGdipImageSetAbort) + { + win_skip("GdipImageSetAbort() is not supported.\n"); + return; + } + + bm = NULL; + stat = GdipCreateBitmapFromScan0(8, 8, 0, PixelFormat24bppRGB, NULL, &bm); + expect(Ok, stat); + + stat = pGdipImageSetAbort(NULL, NULL); + expect(InvalidParameter, stat); + + stat = pGdipImageSetAbort((GpImage*)bm, NULL); + expect(Ok, stat); + + GdipDisposeImage((GpImage*)bm); } /* RGB 24 bpp 1x1 pixel PNG image */ @@ -4869,8 +5025,152 @@ } } +static BYTE *init_bitmap(UINT *width, UINT *height, UINT *stride) +{ + BYTE *src; + UINT i, j, scale; + + *width = 256; + *height = 256; + *stride = (*width * 3 + 3) & ~3; + trace("width %d, height %d, stride %d\n", *width, *height, *stride); + + src = HeapAlloc(GetProcessHeap(), 0, *stride * *height); + + scale = 256 / *width; + if (!scale) scale = 1; + + for (i = 0; i < *height; i++) + { + for (j = 0; j < *width; j++) + { + src[i * *stride + j*3 + 0] = scale * i; + src[i * *stride + j*3 + 1] = scale * (255 - (i+j)/2); + src[i * *stride + j*3 + 2] = scale * j; + } + } + + return src; +} + +static void test_GdipInitializePalette(void) +{ + GpStatus status; + BYTE *data; + GpBitmap *bitmap; + ColorPalette *palette; + UINT width, height, stride; + + pGdipInitializePalette = (void *)GetProcAddress(GetModuleHandleA("gdiplus.dll"), "GdipInitializePalette"); + if (!pGdipInitializePalette) + { + win_skip("GdipInitializePalette is not supported on this platform\n"); + return; + } + + data = init_bitmap(&width, &height, &stride); + + status = GdipCreateBitmapFromScan0(width, height, stride, PixelFormat24bppRGB, data, &bitmap); + expect(Ok, status); + + palette = GdipAlloc(sizeof(*palette) + sizeof(ARGB) * 255); + + palette->Flags = 0; + palette->Count = 15; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); + expect(GenericError, status); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, NULL); + expect(InvalidParameter, status); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeCustom, 16, FALSE, NULL); + expect(Ok, status); + expect(0, palette->Flags); + expect(256, palette->Count); + expect(0x11111111, palette->Entries[0]); + expect(0x11111111, palette->Entries[128]); + expect(0x11111111, palette->Entries[255]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedBW, 0, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x200, palette->Flags); + expect(2, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffffffff, palette->Entries[1]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, NULL); + expect(Ok, status); +todo_wine + expect(0x300, palette->Flags); + expect(16, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffc0c0c0, palette->Entries[8]); + expect(0xff008080, palette->Entries[15]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x300, palette->Flags); + expect(16, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffc0c0c0, palette->Entries[8]); + expect(0xff008080, palette->Entries[15]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone252, 1, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x800, palette->Flags); + expect(252, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xff990066, palette->Entries[128]); + expect(0xffffffff, palette->Entries[251]); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 1, FALSE, bitmap); + expect(InvalidParameter, status); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 2, FALSE, bitmap); + expect(Ok, status); + expect(0, palette->Flags); + expect(2, palette->Count); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); + expect(Ok, status); + expect(0, palette->Flags); + expect(16, palette->Count); + + /* passing invalid enumeration palette type crashes under most Windows versions */ + + GdipFree(palette); + GdipDisposeImage((GpImage *)bitmap); +} + START_TEST(image) { + HMODULE mod = GetModuleHandleA("gdiplus.dll"); struct GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; @@ -4881,6 +5181,11 @@ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + pGdipBitmapGetHistogramSize = (void*)GetProcAddress(mod, "GdipBitmapGetHistogramSize"); + pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); + pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); + + test_GdipInitializePalette(); test_png_color_formats(); test_supported_encoders(); test_CloneBitmapArea(); @@ -4928,6 +5233,8 @@ test_dispose(); test_createeffect(); test_getadjustedpalette(); + test_histogram(); + test_imageabort(); GdiplusShutdown(gdiplusToken); } 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] Thu Nov 17 22:37:09 2016 @@ -309,7 +309,42 @@ expectf(0.0, values[4]); expectf(0.0, values[5]); - GdipDeleteMatrix(matrix);} + GdipDeleteMatrix(matrix); +} + +static void test_isidentity(void) +{ + GpMatrix *matrix; + GpStatus stat; + BOOL result; + + stat = GdipIsMatrixIdentity(NULL, NULL); + expect(InvalidParameter, stat); + + stat = GdipIsMatrixIdentity(NULL, &result); + expect(InvalidParameter, stat); + + stat = GdipCreateMatrix2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, &matrix); + expect(Ok, stat); + + stat = GdipIsMatrixIdentity(matrix, NULL); + expect(InvalidParameter, stat); + + result = FALSE; + stat = GdipIsMatrixIdentity(matrix, &result); + expect(Ok, stat); + ok(!!result, "got %d\n", result); + + stat = GdipSetMatrixElements(matrix, 1.0, 0.0, 0.0, 1.0, 0.1, 0.0); + expect(Ok, stat); + + result = TRUE; + stat = GdipIsMatrixIdentity(matrix, &result); + expect(Ok, stat); + ok(!result, "got %d\n", result); + + GdipDeleteMatrix(matrix); +} START_TEST(matrix) { @@ -329,6 +364,7 @@ test_invert(); test_shear(); test_constructor3(); + test_isidentity(); GdiplusShutdown(gdiplusToken); } 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] Thu Nov 17 22:37:09 2016 @@ -34,12 +34,15 @@ #define expectf(expected, got) expectf_((expected), (got), 0.001) static BOOL save_metafiles; +static BOOL load_metafiles; typedef struct emfplus_record { BOOL todo; ULONG record_type; BOOL playback_todo; + void (*playback_fn)(GpMetafile* metafile, EmfPlusRecordType record_type, + unsigned int flags, unsigned int dataSize, const unsigned char *pStr); } emfplus_record; typedef struct emfplus_check_state @@ -209,18 +212,29 @@ emfplus_check_state *state = (emfplus_check_state*)userdata; GpStatus stat; - stat = GdipPlayMetafileRecord(state->metafile, record_type, flags, dataSize, pStr); - if (state->expected[state->count].record_type) { - todo_wine_if (state->expected[state->count].playback_todo) - ok(stat == Ok, "%s.%i: GdipPlayMetafileRecord failed with stat %i\n", state->desc, state->count, stat); + BOOL match = (state->expected[state->count].record_type == record_type); + + if (match && state->expected[state->count].playback_fn) + state->expected[state->count].playback_fn(state->metafile, record_type, flags, dataSize, pStr); + else + { + stat = GdipPlayMetafileRecord(state->metafile, record_type, flags, dataSize, pStr); + todo_wine_if (state->expected[state->count].playback_todo) + ok(stat == Ok, "%s.%i: GdipPlayMetafileRecord failed with stat %i\n", state->desc, state->count, stat); + } + + todo_wine_if (state->expected[state->count].todo) + ok(state->expected[state->count].record_type == record_type, + "%s.%i: expected record type 0x%x, got 0x%x\n", state->desc, state->count, + state->expected[state->count].record_type, record_type); state->count++; } else { todo_wine_if (state->expected[state->count].playback_todo) - ok(0, "%s: too many records\n", state->desc); + ok(0, "%s: unexpected record 0x%x\n", state->desc, record_type); return FALSE; } @@ -244,15 +258,17 @@ expect(Ok, stat); } -static void save_metafile(GpMetafile *metafile, const char *filename) -{ +/* When 'save' or 'load' is specified on the command line, save or + * load the specified filename. */ +static void sync_metafile(GpMetafile **metafile, const char *filename) +{ + GpStatus stat; if (save_metafiles) { GpMetafile *clone; HENHMETAFILE hemf; - GpStatus stat; - - stat = GdipCloneImage((GpImage*)metafile, (GpImage**)&clone); + + stat = GdipCloneImage((GpImage*)*metafile, (GpImage**)&clone); expect(Ok, stat); stat = GdipGetHemfFromMetafile(clone, &hemf); @@ -263,6 +279,20 @@ DeleteEnhMetaFile(hemf); stat = GdipDisposeImage((GpImage*)clone); + expect(Ok, stat); + } + else if (load_metafiles) + { + HENHMETAFILE hemf; + + stat = GdipDisposeImage((GpImage*)*metafile); + expect(Ok, stat); + *metafile = NULL; + + hemf = GetEnhMetaFileA(filename); + ok(hemf != NULL, "%s could not be opened\n", filename); + + stat = GdipCreateMetafileFromEmf(hemf, TRUE, metafile); expect(Ok, stat); } } @@ -332,7 +362,7 @@ check_metafile(metafile, empty_records, "empty metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "empty.emf"); + sync_metafile(&metafile, "empty.emf"); stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); expect(Ok, stat); @@ -348,19 +378,8 @@ stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); expect(Ok, stat); - stat = GdipGetHemfFromMetafile(metafile, &hemf); - expect(Ok, stat); - - stat = GdipGetHemfFromMetafile(metafile, &dummy); - expect(InvalidParameter, stat); - - stat = GdipDisposeImage((GpImage*)metafile); - expect(Ok, stat); - - check_emfplus(hemf, empty_records, "empty emf"); - memset(&header, 0xaa, sizeof(header)); - stat = GdipGetMetafileHeaderFromEmf(hemf, &header); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); expect(Ok, stat); expect(MetafileTypeEmfPlusOnly, header.Type); expect(U(header).EmfHeader.nBytes, header.Size); @@ -387,6 +406,45 @@ expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); + stat = GdipGetHemfFromMetafile(metafile, &hemf); + expect(Ok, stat); + + stat = GdipGetHemfFromMetafile(metafile, &dummy); + expect(InvalidParameter, stat); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); + + check_emfplus(hemf, empty_records, "empty emf"); + + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromEmf(hemf, &header); + expect(Ok, stat); + expect(MetafileTypeEmfPlusOnly, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + expect(1, header.EmfPlusFlags); /* reference device was display, not printer */ + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(28, header.EmfPlusHeaderSize); + expect(96, header.LogicalDpiX); + expect(96, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(0, U(header).EmfHeader.rclBounds.left); + expect(0, U(header).EmfHeader.rclBounds.top); + expect(-1, U(header).EmfHeader.rclBounds.right); + expect(-1, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); + stat = GdipCreateMetafileFromEmf(hemf, TRUE, &metafile); expect(Ok, stat); @@ -405,6 +463,34 @@ stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); expect(Ok, stat); expectf(header.DpiY, yres); + + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); + expect(Ok, stat); + expect(MetafileTypeEmfPlusOnly, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + expect(1, header.EmfPlusFlags); /* reference device was display, not printer */ + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(28, header.EmfPlusHeaderSize); + expect(96, header.LogicalDpiX); + expect(96, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(0, U(header).EmfHeader.rclBounds.left); + expect(0, U(header).EmfHeader.rclBounds.top); + expect(-1, U(header).EmfHeader.rclBounds.right); + expect(-1, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); stat = GdipDisposeImage((GpImage*)metafile); expect(Ok, stat); @@ -484,7 +570,7 @@ check_metafile(metafile, getdc_records, "getdc metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "getdc.emf"); + sync_metafile(&metafile, "getdc.emf"); stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -591,6 +677,13 @@ stat = GdipGetHemfFromMetafile(metafile, &hemf); expect(InvalidParameter, stat); + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); + expect(Ok, stat); + expect(MetafileTypeEmf, header.Type); + ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + /* The rest is zeroed or seemingly random/uninitialized garbage. */ + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); expect(Ok, stat); @@ -622,7 +715,7 @@ check_metafile(metafile, emfonly_records, "emfonly metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "emfonly.emf"); + sync_metafile(&metafile, "emfonly.emf"); stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); expect(Ok, stat); @@ -637,6 +730,35 @@ stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); expect(Ok, stat); + + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); + expect(Ok, stat); + expect(MetafileTypeEmf, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + /* For some reason a recoreded EMF Metafile has an EMF+ version. */ + todo_wine ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + expect(0, header.EmfPlusFlags); + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(0, header.EmfPlusHeaderSize); + expect(0, header.LogicalDpiX); + expect(0, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(25, U(header).EmfHeader.rclBounds.left); + expect(25, U(header).EmfHeader.rclBounds.top); + expect(74, U(header).EmfHeader.rclBounds.right); + expect(74, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -753,6 +875,34 @@ expect(Ok, stat); expectf(header.DpiY, yres); + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); + expect(Ok, stat); + expect(MetafileTypeEmf, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + expect(0x10000, header.Version); + expect(0, header.EmfPlusFlags); + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(0, header.EmfPlusHeaderSize); + expect(0, header.LogicalDpiX); + expect(0, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(25, U(header).EmfHeader.rclBounds.left); + expect(25, U(header).EmfHeader.rclBounds.top); + expect(74, U(header).EmfHeader.rclBounds.right); + expect(74, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); + stat = GdipDisposeImage((GpImage*)metafile); expect(Ok, stat); } @@ -811,7 +961,7 @@ check_metafile(metafile, fillrect_records, "fillrect metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "fillrect.emf"); + sync_metafile(&metafile, "fillrect.emf"); stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -915,7 +1065,7 @@ stat = GdipDeleteGraphics(graphics); expect(Ok, stat); - save_metafile(metafile, "clear.emf"); + sync_metafile(&metafile, "clear.emf"); stat = GdipCreateBitmapFromScan0(30, 30, 0, PixelFormat32bppRGB, NULL, &bitmap); expect(Ok, stat); @@ -1228,7 +1378,7 @@ check_metafile(metafile, pagetransform_records, "pagetransform metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "pagetransform.emf"); + sync_metafile(&metafile, "pagetransform.emf"); stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -1279,6 +1429,14 @@ {0, EmfPlusRecordTypeScaleWorldTransform}, {0, EmfPlusRecordTypeFillRects}, {0, EmfPlusRecordTypeResetWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeMultiplyWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeRotateWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSetWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeTranslateWorldTransform}, {0, EmfPlusRecordTypeFillRects}, {0, EmfPlusRecordTypeEndOfFile}, {0, EMR_EOF}, @@ -1379,6 +1537,112 @@ stat = GdipDeleteBrush(brush); expect(Ok, stat); + /* multiply transform */ + stat = GdipSetMatrixElements(transform, 2.0, 0.0, 0.0, 1.0, 0.0, 0.0); + expect(Ok, stat); + + stat = GdipMultiplyWorldTransform(graphics, transform, MatrixOrderPrepend); + expect(Ok, stat); + + stat = GdipGetWorldTransform(graphics, transform); + expect(Ok, stat); + + stat = GdipGetMatrixElements(transform, elements); + expect(Ok, stat); + expectf(2.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(1.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + + stat = GdipCreateSolidFill((ARGB)0xffff0000, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 1.0, 1.0, 0.5, 1.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* rotate transform */ + stat = GdipRotateWorldTransform(graphics, 90.0, MatrixOrderAppend); + expect(Ok, stat); + + stat = GdipGetWorldTransform(graphics, transform); + expect(Ok, stat); + + stat = GdipGetMatrixElements(transform, elements); + expect(Ok, stat); + expectf(0.0, elements[0]); + expectf(2.0, elements[1]); + expectf(-1.0, elements[2]); + expectf(0.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + + stat = GdipCreateSolidFill((ARGB)0xffff00ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 1.0, -1.0, 0.5, 1.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* set transform */ + stat = GdipSetMatrixElements(transform, 1.0, 0.0, 0.0, 3.0, 0.0, 0.0); + expect(Ok, stat); + + stat = GdipSetWorldTransform(graphics, transform); + expect(Ok, stat); + + stat = GdipGetWorldTransform(graphics, transform); + expect(Ok, stat); + + stat = GdipGetMatrixElements(transform, elements); + expect(Ok, stat); + expectf(1.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(3.0, elements[3]); + expectf(0.0, elements[4]); + expectf(0.0, elements[5]); + + stat = GdipCreateSolidFill((ARGB)0xffffff00, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 1.0, 1.0, 1.0, 1.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* translate transform */ + stat = GdipTranslateWorldTransform(graphics, -1.0, 0.0, MatrixOrderAppend); + expect(Ok, stat); + + stat = GdipGetWorldTransform(graphics, transform); + expect(Ok, stat); + + stat = GdipGetMatrixElements(transform, elements); + expect(Ok, stat); + expectf(1.0, elements[0]); + expectf(0.0, elements[1]); + expectf(0.0, elements[2]); + expectf(3.0, elements[3]); + expectf(-1.0, elements[4]); + expectf(0.0, elements[5]); + + stat = GdipCreateSolidFill((ARGB)0xffffffff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 1.0, 1.0, 1.0, 1.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + stat = GdipDeleteMatrix(transform); expect(Ok, stat); @@ -1387,7 +1651,7 @@ check_metafile(metafile, worldtransform_records, "worldtransform metafile", dst_points, &frame, UnitPixel); - save_metafile(metafile, "worldtransform.emf"); + sync_metafile(&metafile, "worldtransform.emf"); stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -1412,6 +1676,22 @@ stat = GdipBitmapGetPixel(bitmap, 30, 10, &color); expect(Ok, stat); expect(0xff00ffff, color); + + stat = GdipBitmapGetPixel(bitmap, 50, 30, &color); + expect(Ok, stat); + expect(0xffff0000, color); + + stat = GdipBitmapGetPixel(bitmap, 10, 50, &color); + expect(Ok, stat); + expect(0xffff00ff, color); + + stat = GdipBitmapGetPixel(bitmap, 30, 90, &color); + expect(Ok, stat); + expect(0xffffff00, color); + + stat = GdipBitmapGetPixel(bitmap, 10, 90, &color); + expect(Ok, stat); + expect(0xffffffff, color); stat = GdipDeleteGraphics(graphics); expect(Ok, stat); @@ -1567,6 +1847,436 @@ expect(Ok, stat); } +static const emfplus_record container_records[] = { + {0, EMR_HEADER}, + {0, EmfPlusRecordTypeHeader}, + {0, EmfPlusRecordTypeBeginContainerNoParams}, + {0, EmfPlusRecordTypeScaleWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndContainer}, + {0, EmfPlusRecordTypeScaleWorldTransform}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeSave}, + {0, EmfPlusRecordTypeRestore}, + {0, EmfPlusRecordTypeScaleWorldTransform}, + {0, EmfPlusRecordTypeBeginContainerNoParams}, + {0, EmfPlusRecordTypeScaleWorldTransform}, + {0, EmfPlusRecordTypeBeginContainerNoParams}, + {0, EmfPlusRecordTypeEndContainer}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeBeginContainer}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndContainer}, + {0, EmfPlusRecordTypeBeginContainerNoParams}, + {0, EmfPlusRecordTypeEndOfFile}, + {0, EMR_EOF}, + {0} +}; + +static void test_containers(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + GpBitmap *bitmap; + GpBrush *brush; + ARGB color; + HDC hdc; + 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 WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + GraphicsContainer state1, state2; + GpRectF srcrect, dstrect; + REAL dpix, dpiy; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + /* Normal usage */ + stat = GdipBeginContainer2(graphics, &state1); + expect(Ok, stat); + + stat = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff000000, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 5.0, 5.0, 5.0, 5.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipEndContainer(graphics, state1); + expect(Ok, stat); + + stat = GdipScaleWorldTransform(graphics, 1.0, 1.0, MatrixOrderPrepend); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 5.0, 5.0, 5.0, 5.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipSaveGraphics(graphics, &state1); + expect(Ok, stat); + + stat = GdipRestoreGraphics(graphics, state1); + expect(Ok, stat); + + /* Popping two states at once */ + stat = GdipScaleWorldTransform(graphics, 2.0, 2.0, MatrixOrderPrepend); + expect(Ok, stat); + + stat = GdipBeginContainer2(graphics, &state1); + expect(Ok, stat); + + stat = GdipScaleWorldTransform(graphics, 4.0, 4.0, MatrixOrderPrepend); + expect(Ok, stat); + + stat = GdipBeginContainer2(graphics, &state2); + expect(Ok, stat); + + stat = GdipEndContainer(graphics, state1); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff00ff00, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 20.0, 20.0, 5.0, 5.0); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + /* With transform applied */ + stat = GdipGetDpiX(graphics, &dpix); + expect(Ok, stat); + + stat = GdipGetDpiY(graphics, &dpiy); + expect(Ok, stat); + + srcrect.X = 0.0; + srcrect.Y = 0.0; + srcrect.Width = 1.0; + srcrect.Height = 1.0; + + dstrect.X = 25.0; + dstrect.Y = 0.0; + dstrect.Width = 5.0; + dstrect.Height = 5.0; + + stat = GdipBeginContainer(graphics, &dstrect, &srcrect, UnitInch, &state1); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff00ffff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 0.0, 0.0, dpix, dpiy); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipEndContainer(graphics, state1); + expect(Ok, stat); + + /* Restoring an invalid state seems to break the graphics object? */ + if (0) { + stat = GdipEndContainer(graphics, state1); + expect(Ok, stat); + } + + /* Ending metafile with a state open */ + stat = GdipBeginContainer2(graphics, &state1); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, container_records, "container metafile", dst_points, &frame, UnitPixel); + + sync_metafile(&metafile, "container.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, container_records, "container playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 80, 80, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 12, 12, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapGetPixel(bitmap, 8, 8, &color); + expect(Ok, stat); + expect(0xff0000ff, color); + + stat = GdipBitmapGetPixel(bitmap, 42, 42, &color); + expect(Ok, stat); + expect(0xff00ff00, color); + + stat = GdipBitmapGetPixel(bitmap, 55, 5, &color); + expect(Ok, stat); + expect(0xff00ffff, 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 clipping_records[] = { + {0, EMR_HEADER}, + {0, EmfPlusRecordTypeHeader}, + {0, EmfPlusRecordTypeSave}, + {0, EmfPlusRecordTypeSetClipRect}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeRestore}, + {0, EmfPlusRecordTypeSetClipRect}, + {0, EmfPlusRecordTypeFillRects}, + {0, EmfPlusRecordTypeEndOfFile}, + {0, EMR_EOF}, + {0} +}; + +static void test_clipping(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + GpBitmap *bitmap; + GpBrush *brush; + ARGB color; + HDC hdc; + 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 WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + GraphicsState state; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + stat = GdipSaveGraphics(graphics, &state); + expect(Ok, stat); + + stat = GdipSetClipRect(graphics, 30, 30, 10, 10, CombineModeReplace); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff000000, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 0, 0, 100, 100); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipRestoreGraphics(graphics, state); + expect(Ok, stat); + + stat = GdipSetClipRect(graphics, 30, 30, 10, 10, CombineModeXor); + expect(Ok, stat); + + stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&brush); + expect(Ok, stat); + + stat = GdipFillRectangle(graphics, brush, 30, 30, 20, 10); + expect(Ok, stat); + + stat = GdipDeleteBrush(brush); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, clipping_records, "clipping metafile", dst_points, &frame, UnitPixel); + + sync_metafile(&metafile, "clipping.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, clipping_records, "clipping playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 80, 80, &color); + expect(Ok, stat); + expect(0, color); + + stat = GdipBitmapGetPixel(bitmap, 35, 35, &color); + expect(Ok, stat); + expect(0xff000000, color); + + stat = GdipBitmapGetPixel(bitmap, 45, 35, &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 void test_gditransform_cb(GpMetafile* metafile, EmfPlusRecordType record_type, + unsigned int flags, unsigned int dataSize, const unsigned char *pStr) +{ + static const XFORM xform = {0.5, 0, 0, 0.5, 0, 0}; + static const RECTL rectangle = {0,0,100,100}; + GpStatus stat; + + stat = GdipPlayMetafileRecord(metafile, EMR_SETWORLDTRANSFORM, 0, sizeof(xform), (void*)&xform); + expect(Ok, stat); + + stat = GdipPlayMetafileRecord(metafile, EMR_RECTANGLE, 0, sizeof(rectangle), (void*)&rectangle); + expect(Ok, stat); +} + +static const emfplus_record gditransform_records[] = { + {0, EMR_HEADER}, + {0, EMR_CREATEBRUSHINDIRECT}, + {0, EMR_SELECTOBJECT}, + {0, EMR_GDICOMMENT, 0, test_gditransform_cb}, + {0, EMR_SELECTOBJECT}, + {0, EMR_DELETEOBJECT}, + {0, EMR_EOF}, + {0} +}; + +static void test_gditransform(void) +{ + GpStatus stat; + GpMetafile *metafile; + GpGraphics *graphics; + HDC hdc, metafile_dc; + HENHMETAFILE hemf; + MetafileHeader header; + static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; + static const GpPointF dst_points[3] = {{0.0,0.0},{40.0,0.0},{0.0,40.0}}; + static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; + HBRUSH hbrush, holdbrush; + GpBitmap *bitmap; + ARGB color; + + hdc = CreateCompatibleDC(0); + + stat = GdipRecordMetafile(hdc, EmfTypeEmfOnly, &frame, MetafileFrameUnitPixel, description, &metafile); + expect(Ok, stat); + + DeleteDC(hdc); + + if (stat != Ok) + return; + + stat = GdipGetHemfFromMetafile(metafile, &hemf); + expect(InvalidParameter, stat); + + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromMetafile(metafile, &header); + expect(Ok, stat); + expect(MetafileTypeEmf, header.Type); + ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + + stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics); + expect(Ok, stat); + + stat = GdipGetDC(graphics, &metafile_dc); + expect(Ok, stat); + + if (stat != Ok) + { + GdipDeleteGraphics(graphics); + GdipDisposeImage((GpImage*)metafile); + return; + } + + hbrush = CreateSolidBrush(0xff); + + holdbrush = SelectObject(metafile_dc, hbrush); + + GdiComment(metafile_dc, 8, (const BYTE*)"winetest"); + + SelectObject(metafile_dc, holdbrush); + + DeleteObject(hbrush); + + stat = GdipReleaseDC(graphics, metafile_dc); + expect(Ok, stat); + + stat = GdipDeleteGraphics(graphics); + expect(Ok, stat); + + check_metafile(metafile, gditransform_records, "gditransform metafile", dst_points, &frame, UnitPixel); + + sync_metafile(&metafile, "gditransform.emf"); + + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); + expect(Ok, stat); + + stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); + expect(Ok, stat); + + play_metafile(metafile, graphics, gditransform_records, "gditransform playback", dst_points, &frame, UnitPixel); + + stat = GdipBitmapGetPixel(bitmap, 10, 10, &color); + expect(Ok, stat); + expect(0xffff0000, color); + + stat = GdipBitmapGetPixel(bitmap, 30, 30, &color); + expect(Ok, stat); + expect(0x00000000, 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; @@ -1583,8 +2293,13 @@ myARGC = winetest_get_mainargs( &myARGV ); - if (myARGC >= 3 && !strcmp(myARGV[2], "save")) - save_metafiles = TRUE; + if (myARGC >= 3) + { + if (!strcmp(myARGV[2], "save")) + save_metafiles = TRUE; + else if (!strcmp(myARGV[2], "load")) + load_metafiles = TRUE; + } test_empty(); test_getdc(); @@ -1596,6 +2311,9 @@ test_worldtransform(); test_converttoemfplus(); test_frameunit(); + test_containers(); + test_clipping(); + test_gditransform(); GdiplusShutdown(gdiplusToken); }
8 years, 1 month
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
32
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
Results per page:
10
25
50
100
200