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
July 2015
----- 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
13 participants
257 discussions
Start a n
N
ew thread
[akhaldi] 68544: [WINDOWSCODECS_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:45:50 2015 New Revision: 68544 URL:
http://svn.reactos.org/svn/reactos?rev=68544&view=rev
Log: [WINDOWSCODECS_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/windowscodecs/bitmap.c trunk/rostests/winetests/windowscodecs/gifformat.c trunk/rostests/winetests/windowscodecs/info.c trunk/rostests/winetests/windowscodecs/metadata.c trunk/rostests/winetests/windowscodecs/pngformat.c trunk/rostests/winetests/windowscodecs/tiffformat.c Modified: trunk/rostests/winetests/windowscodecs/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/b…
============================================================================== --- trunk/rostests/winetests/windowscodecs/bitmap.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/bitmap.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -661,7 +661,7 @@ ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA), "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); - IWICBitmap_GetSize(bitmap, &width, &height); + hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); ok(width == 16, "expected 16, got %u\n", width); ok(height == 16, "expected 16, got %u\n", height); @@ -689,7 +689,7 @@ ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA), "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); - IWICBitmap_GetSize(bitmap, &width, &height); + hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); ok(width == 16, "expected 16, got %u\n", width); ok(height == 16, "expected 16, got %u\n", height); Modified: trunk/rostests/winetests/windowscodecs/gifformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/g…
============================================================================== --- trunk/rostests/winetests/windowscodecs/gifformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/gifformat.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -31,6 +31,8 @@ #include <wincodec.h> #include <wine/test.h> +HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT, IWICImagingFactory**); + static const char gif_global_palette[] = { /* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0xa1,0x02,0x00, /* palette */0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c, @@ -61,6 +63,27 @@ 0x02,0x02,0x44,0x01,0x00,0x3b }; +/* Generated with ImageMagick: + * convert -delay 100 -size 2x2 xc:red \ + * -dispose none -page +0+0 -size 2x1 xc:white \ + * test.gif + */ +static const char gif_frame_sizes[] = { + 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x02, 0x00, + 0x02, 0x00, 0xf1, 0x00, 0x00, 0xff, 0x00, 0x00, + 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, + 0x00, 0x21, 0xf9, 0x04, 0x00, 0x64, 0x00, 0x00, + 0x00, 0x21, 0xff, 0x0b, 0x4e, 0x45, 0x54, 0x53, + 0x43, 0x41, 0x50, 0x45, 0x32, 0x2e, 0x30, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x03, + 0x44, 0x34, 0x05, 0x00, 0x21, 0xf9, 0x04, 0x04, + 0x64, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x01, 0x00, 0x80, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x0a, + 0x00, 0x3b +}; + static IWICImagingFactory *factory; static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) @@ -71,6 +94,7 @@ IWICBitmapDecoder *decoder = NULL; IStream *stream; GUID format; + LONG refcount; hmem = GlobalAlloc(0, image_size); data = GlobalLock(hmem); @@ -88,7 +112,8 @@ ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), "wrong container format %s\n", wine_dbgstr_guid(&format)); - IStream_Release(stream); + refcount = IStream_Release(stream); + ok(refcount > 0, "expected stream refcount > 0\n"); return decoder; } @@ -334,6 +359,55 @@ IWICBitmapDecoder_Release(decoder); } +static void test_gif_frame_sizes(void) +{ + static const BYTE frame0[] = {0, 1, 0xfe, 0xfe, 2, 3, 0xfe, 0xfe}; + static const BYTE frame1[] = {0, 0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe}; + + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + UINT width, height; + BYTE buf[8]; + HRESULT hr; + + decoder = create_decoder(gif_frame_sizes, sizeof(gif_frame_sizes)); + ok(decoder != 0, "Failed to load GIF image data\n"); + + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height); + ok(hr == S_OK, "GetSize error %x\n", hr); + ok(width == 2, "width = %d\n", width); + ok(height == 2, "height = %d\n", height); + + memset(buf, 0xfe, sizeof(buf)); + hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 4, sizeof(buf), buf); + ok(hr == S_OK, "CopyPixels error %x\n", hr); + ok(!memcmp(buf, frame0, sizeof(buf)), "buf = %x %x %x %x %x %x %x %x\n", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); + + IWICBitmapFrameDecode_Release(frame); + + hr = IWICBitmapDecoder_GetFrame(decoder, 1, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height); + ok(hr == S_OK, "GetSize error %x\n", hr); + ok(width == 2, "width = %d\n", width); + ok(height == 1, "height = %d\n", height); + + memset(buf, 0xfe, sizeof(buf)); + hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 4, sizeof(buf), buf); + ok(hr == S_OK, "CopyPixels error %x\n", hr); + ok(!memcmp(buf, frame1, sizeof(buf)), "buf = %x %x %x %x %x %x %x %x\n", + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); + + IWICBitmapFrameDecode_Release(frame); + + IWICBitmapDecoder_Release(decoder); +} + START_TEST(gifformat) { HRESULT hr; @@ -347,7 +421,19 @@ test_global_gif_palette(); test_global_gif_palette_2frames(); test_local_gif_palette(); + test_gif_frame_sizes(); IWICImagingFactory_Release(factory); CoUninitialize(); -} + + /* run the same tests with no COM initialization */ + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); + ok(hr == S_OK, "WICCreateImagingFactory_Proxy error %#x\n", hr); + + test_global_gif_palette(); + test_global_gif_palette_2frames(); + test_local_gif_palette(); + test_gif_frame_sizes(); + + IWICImagingFactory_Release(factory); +} Modified: trunk/rostests/winetests/windowscodecs/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/i…
============================================================================== --- trunk/rostests/winetests/windowscodecs/info.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/info.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -85,6 +85,7 @@ int i; hr = get_component_info(&CLSID_WICBmpDecoder, &info); + ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr); hr = IWICComponentInfo_QueryInterface(info, &IID_IWICBitmapDecoderInfo, (void**)&decoder_info); ok(hr == S_OK, "QueryInterface failed, hr=%x\n", hr); @@ -227,7 +228,7 @@ memset(value, 0xaa, 256 * sizeof(WCHAR)); hr = IWICComponentInfo_GetAuthor(info, len-1, value, NULL); ok(hr == E_INVALIDARG, "GetAuthor failed, hr=%x\n", hr); - ok(value[0] = 0xaaaa, "string modified\n"); + ok(value[0] == 0xaaaa, "string modified\n"); len = 0xdeadbeef; memset(value, 0xaa, 256 * sizeof(WCHAR)); Modified: trunk/rostests/winetests/windowscodecs/metadata.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/m…
============================================================================== --- trunk/rostests/winetests/windowscodecs/metadata.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/metadata.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -142,6 +142,13 @@ 0x3f,0x64,0x19,0xf3 /* chunk CRC */ }; +static const char metadata_gAMA[] = { + 0,0,0,4, /* chunk length */ + 'g','A','M','A', /* chunk type */ + 0,0,130,53, /* gamma */ + 0xff,0xff,0xff,0xff /* chunk CRC */ +}; + static const char pngimage[285] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53, @@ -406,6 +413,51 @@ hr = IWICMetadataReader_GetValueByIndex(reader, 1, NULL, NULL, NULL); ok(hr == E_INVALIDARG, "GetValueByIndex failed, hr=%x\n", hr); + + IWICMetadataReader_Release(reader); +} + +static void test_metadata_gAMA(void) +{ + HRESULT hr; + IWICMetadataReader *reader; + PROPVARIANT schema, id, value; + ULONG count; + GUID format; + static const WCHAR ImageGamma[] = {'I','m','a','g','e','G','a','m','m','a',0}; + + PropVariantInit(&schema); + PropVariantInit(&id); + PropVariantInit(&value); + + hr = CoCreateInstance(&CLSID_WICPngGamaMetadataReader, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICMetadataReader, (void**)&reader); + ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /*winxp*/, "CoCreateInstance failed, hr=%x\n", hr); + if (FAILED(hr)) return; + + load_stream((IUnknown*)reader, metadata_gAMA, sizeof(metadata_gAMA), WICPersistOptionsDefault); + + hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr); + ok(IsEqualGUID(&format, &GUID_MetadataFormatChunkgAMA), "unexpected format %s\n", wine_dbgstr_guid(&format)); + + hr = IWICMetadataReader_GetCount(reader, &count); + ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); + ok(count == 1, "unexpected count %i\n", count); + + hr = IWICMetadataReader_GetValueByIndex(reader, 0, &schema, &id, &value); + ok(hr == S_OK, "GetValue failed, hr=%x\n", hr); + + ok(schema.vt == VT_EMPTY, "unexpected vt: %i\n", schema.vt); + PropVariantClear(&schema); + + ok(id.vt == VT_LPWSTR, "unexpected vt: %i\n", id.vt); + ok(!lstrcmpW(U(id).pwszVal, ImageGamma), "unexpected value: %s\n", wine_dbgstr_w(U(id).pwszVal)); + PropVariantClear(&id); + + ok(value.vt == VT_UI4, "unexpected vt: %i\n", value.vt); + ok(U(value).ulVal == 33333, "unexpected value: %u\n", U(value).ulVal); + PropVariantClear(&value); IWICMetadataReader_Release(reader); } @@ -951,11 +1003,11 @@ ok(IsEqualGUID(&containerformat, &GUID_ContainerFormatPng), "unexpected container format\n"); hr = IWICMetadataBlockReader_GetCount(blockreader, NULL); - todo_wine ok(hr == E_INVALIDARG, "GetCount failed, hr=%x\n", hr); + ok(hr == E_INVALIDARG, "GetCount failed, hr=%x\n", hr); hr = IWICMetadataBlockReader_GetCount(blockreader, &count); - todo_wine ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); - todo_wine ok(count == 1, "unexpected count %d\n", count); + ok(hr == S_OK, "GetCount failed, hr=%x\n", hr); + ok(count == 1, "unexpected count %d\n", count); if (0) { @@ -965,18 +1017,19 @@ } hr = IWICMetadataBlockReader_GetReaderByIndex(blockreader, 0, &reader); - todo_wine ok(hr == S_OK, "GetReaderByIndex failed, hr=%x\n", hr); + ok(hr == S_OK, "GetReaderByIndex failed, hr=%x\n", hr); if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &containerformat); - ok(IsEqualGUID(&containerformat, &GUID_MetadataFormatChunktIME) || + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); + todo_wine ok(IsEqualGUID(&containerformat, &GUID_MetadataFormatChunktIME) || broken(IsEqualGUID(&containerformat, &GUID_MetadataFormatUnknown)) /* Windows XP */, "unexpected container format\n"); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); - ok(count == 6 || broken(count == 1) /* XP */, "expected 6, got %u\n", count); + todo_wine ok(count == 6 || broken(count == 1) /* XP */, "expected 6, got %u\n", count); if (count == 6) compare_metadata(reader, td, count); @@ -1114,6 +1167,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1162,6 +1216,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1215,6 +1270,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1233,6 +1289,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), /* Application Extension */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1251,6 +1308,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1269,6 +1327,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1317,6 +1376,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1335,6 +1395,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1354,6 +1415,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1372,6 +1434,7 @@ if (SUCCEEDED(hr)) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); + ok(hr == S_OK, "GetMetadataFormat failed, hr=%#x\n", hr); ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), /* Graphic Control Extension */ "wrong metadata format %s\n", wine_dbgstr_guid(&format)); @@ -1799,6 +1862,7 @@ test_metadata_unknown(); test_metadata_tEXt(); + test_metadata_gAMA(); test_metadata_IFD(); test_metadata_Exif(); test_create_reader(); Modified: trunk/rostests/winetests/windowscodecs/pngformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/p…
============================================================================== --- trunk/rostests/winetests/windowscodecs/pngformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/pngformat.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -289,6 +289,7 @@ IWICBitmapDecoder *decoder = NULL; IStream *stream; GUID format; + LONG refcount; hmem = GlobalAlloc(0, image_size); data = GlobalLock(hmem); @@ -306,7 +307,8 @@ ok(IsEqualGUID(&format, &GUID_ContainerFormatPng), "wrong container format %s\n", wine_dbgstr_guid(&format)); - IStream_Release(stream); + refcount = IStream_Release(stream); + ok(refcount > 0, "expected stream refcount > 0\n"); return decoder; } Modified: trunk/rostests/winetests/windowscodecs/tiffformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/windowscodecs/t…
============================================================================== --- trunk/rostests/winetests/windowscodecs/tiffformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/windowscodecs/tiffformat.c [iso-8859-1] Wed Jul 22 00:45:50 2015 @@ -98,7 +98,49 @@ { 900, 3 }, { 0x11, 0x22, 0x33, 0 } }; -#include <poppack.h> + +static const struct tiff_8bpp_alpha +{ + USHORT byte_order; + USHORT version; + ULONG dir_offset; + USHORT number_of_entries; + struct IFD_entry entry[15]; + ULONG next_IFD; + struct IFD_rational res; + BYTE pixel_data[8]; +} tiff_8bpp_alpha = +{ +#ifdef WORDS_BIGENDIAN + 'M' | 'M' << 8, +#else + 'I' | 'I' << 8, +#endif + 42, + FIELD_OFFSET(struct tiff_8bpp_alpha, number_of_entries), + 15, + { + { 0xff, IFD_SHORT, 1, 0 }, /* SUBFILETYPE */ + { 0x100, IFD_LONG, 1, 2 }, /* IMAGEWIDTH */ + { 0x101, IFD_LONG, 1, 2 }, /* IMAGELENGTH */ + { 0x102, IFD_SHORT, 2, MAKELONG(8, 8) }, /* BITSPERSAMPLE */ + { 0x103, IFD_SHORT, 1, 1 }, /* COMPRESSION: XP doesn't accept IFD_LONG here */ + { 0x106, IFD_SHORT, 1, 1 }, /* PHOTOMETRIC */ + { 0x111, IFD_LONG, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, pixel_data) }, /* STRIPOFFSETS */ + { 0x115, IFD_SHORT, 1, 2 }, /* SAMPLESPERPIXEL */ + { 0x116, IFD_LONG, 1, 2 }, /* ROWSPERSTRIP */ + { 0x117, IFD_LONG, 1, 8 }, /* STRIPBYTECOUNT */ + { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, + { 0x11b, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_8bpp_alpha, res) }, + { 0x11c, IFD_SHORT, 1, 1 }, /* PLANARCONFIGURATION */ + { 0x128, IFD_SHORT, 1, 2 }, /* RESOLUTIONUNIT */ + { 0x152, IFD_SHORT, 1, 1 } /* EXTRASAMPLES: 1 - Associated alpha with pre-multiplied color */ + }, + 0, + { 96, 1 }, + { 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88 } +}; +#include "poppack.h" static IWICImagingFactory *factory; @@ -270,6 +312,66 @@ IStream_Release(stream); } +static void test_tiff_8bpp_alpha(void) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + UINT frame_count, width, height, i; + double dpi_x, dpi_y; + IWICPalette *palette; + GUID format; + WICRect rc; + BYTE data[16]; + static const BYTE expected_data[16] = { 0x11,0x11,0x11,0x22,0x33,0x33,0x33,0x44, + 0x55,0x55,0x55,0x66,0x77,0x77,0x77,0x88 }; + + decoder = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha)); + ok(decoder != 0, "Failed to load TIFF image data\n"); + + hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); + ok(hr == S_OK, "GetFrameCount error %#x\n", hr); + ok(frame_count == 1, "expected 1, got %u\n", frame_count); + + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetSize(frame, &width, &height); + ok(hr == S_OK, "GetSize error %#x\n", hr); + ok(width == 2, "expected 2, got %u\n", width); + ok(height == 2, "expected 2, got %u\n", height); + + hr = IWICBitmapFrameDecode_GetResolution(frame, &dpi_x, &dpi_y); + ok(hr == S_OK, "GetResolution error %#x\n", hr); + ok(dpi_x == 96.0, "expected 96.0, got %f\n", dpi_x); + ok(dpi_y == 96.0, "expected 96.0, got %f\n", dpi_y); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA), + "got wrong format %s\n", wine_dbgstr_guid(&format)); + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "CreatePalette error %#x\n", hr); + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, + "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr); + IWICPalette_Release(palette); + + rc.X = 0; + rc.Y = 0; + rc.Width = 2; + rc.Height = 2; + hr = IWICBitmapFrameDecode_CopyPixels(frame, &rc, 8, sizeof(data), data); + ok(hr == S_OK, "CopyPixels error %#x\n", hr); + + for (i = 0; i < sizeof(data); i++) + ok(data[i] == expected_data[i], "%u: expected %02x, got %02x\n", i, expected_data[i], data[i]); + + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); +} + START_TEST(tiffformat) { HRESULT hr; @@ -283,6 +385,7 @@ test_tiff_palette(); test_QueryCapability(); + test_tiff_8bpp_alpha(); IWICImagingFactory_Release(factory); CoUninitialize();
9 years, 5 months
1
0
0
0
[akhaldi] 68543: [WINDOWSCODECS] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:45:26 2015 New Revision: 68543 URL:
http://svn.reactos.org/svn/reactos?rev=68543&view=rev
Log: [WINDOWSCODECS] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/windowscodecs/clsfactory.c trunk/reactos/dll/win32/windowscodecs/gifformat.c trunk/reactos/dll/win32/windowscodecs/icnsformat.c trunk/reactos/dll/win32/windowscodecs/imgfactory.c trunk/reactos/dll/win32/windowscodecs/info.c trunk/reactos/dll/win32/windowscodecs/metadatahandler.c trunk/reactos/dll/win32/windowscodecs/pngformat.c trunk/reactos/dll/win32/windowscodecs/regsvr.c trunk/reactos/dll/win32/windowscodecs/stream.c trunk/reactos/dll/win32/windowscodecs/tiffformat.c trunk/reactos/dll/win32/windowscodecs/ungif.c trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.idl trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/windowscodecs/clsfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/cl…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/clsfactory.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/clsfactory.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -22,7 +22,7 @@ typedef struct { REFCLSID classid; - HRESULT (*constructor)(REFIID,void**); + class_constructor constructor; } classinfo; static const classinfo wic_classes[] = { @@ -42,6 +42,7 @@ {&CLSID_WineTgaDecoder, TgaDecoder_CreateInstance}, {&CLSID_WICUnknownMetadataReader, UnknownMetadataReader_CreateInstance}, {&CLSID_WICIfdMetadataReader, IfdMetadataReader_CreateInstance}, + {&CLSID_WICPngGamaMetadataReader, PngGamaReader_CreateInstance}, {&CLSID_WICPngTextMetadataReader, PngTextReader_CreateInstance}, {&CLSID_WICLSDMetadataReader, LSDReader_CreateInstance}, {&CLSID_WICIMDMetadataReader, IMDReader_CreateInstance}, @@ -183,3 +184,14 @@ TRACE("<-- %08X\n", ret); return ret; } + +HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) +{ + int i; + + for (i=0; wic_classes[i].classid; i++) + if (IsEqualCLSID(wic_classes[i].classid, clsid)) + return wic_classes[i].constructor(iid, ppv); + + return CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, ppv); +} Modified: trunk/reactos/dll/win32/windowscodecs/gifformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/gi…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/gifformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/gifformat.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -60,7 +60,7 @@ hr = IStream_Read(stream, &lsd_data, sizeof(lsd_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(lsd_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 9); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 9); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 9; i++) @@ -165,7 +165,7 @@ hr = IStream_Read(stream, &imd_data, sizeof(imd_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(imd_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 8); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 8); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 8; i++) @@ -258,7 +258,7 @@ hr = IStream_Read(stream, &gce_data, sizeof(gce_data), &bytesread); if (FAILED(hr) || bytesread != sizeof(gce_data)) return S_OK; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 5); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 5); if (!result) return E_OUTOFMEMORY; for (i = 0; i < 5; i++) @@ -373,7 +373,7 @@ data_size += subblock_size + 1; } - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem) * 2); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem) * 2); if (!result) { HeapFree(GetProcessHeap(), 0, data); @@ -478,7 +478,7 @@ data[data_size] = 0; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); if (!result) { HeapFree(GetProcessHeap(), 0, data); @@ -530,7 +530,8 @@ } static HRESULT create_metadata_reader(const void *data, int data_size, - const CLSID *clsid, IWICMetadataReader **reader) + class_constructor constructor, + IWICMetadataReader **reader) { HRESULT hr; IWICMetadataReader *metadata_reader; @@ -539,8 +540,7 @@ /* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */ - hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICMetadataReader, (void **)&metadata_reader); + hr = constructor(&IID_IWICMetadataReader, (void**)&metadata_reader); if (FAILED(hr)) return hr; hr = IWICMetadataReader_QueryInterface(metadata_reader, &IID_IWICPersistStream, (void **)&persist); @@ -563,6 +563,7 @@ typedef struct { IWICBitmapDecoder IWICBitmapDecoder_iface; IWICMetadataBlockReader IWICMetadataBlockReader_iface; + IStream *stream; BYTE LSD_data[13]; /* Logical Screen Descriptor */ LONG ref; BOOL initialized; @@ -885,8 +886,7 @@ /* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */ - hr = CoCreateInstance(&CLSID_WICIMDMetadataReader, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICMetadataReader, (void **)&metadata_reader); + hr = IMDReader_CreateInstance(&IID_IWICMetadataReader, (void **)&metadata_reader); if (FAILED(hr)) return hr; hr = IWICMetadataReader_QueryInterface(metadata_reader, &IID_IWICPersistStream, (void **)&persist); @@ -942,7 +942,7 @@ for (i = 0; i < This->frame->Extensions.ExtensionBlockCount; i++) { - const CLSID *clsid; + class_constructor constructor; const void *data; int data_size; @@ -956,24 +956,24 @@ } else if (This->frame->Extensions.ExtensionBlocks[i].Function == COMMENT_EXT_FUNC_CODE) { - clsid = &CLSID_WICGifCommentMetadataReader; + constructor = GifCommentReader_CreateInstance; data = This->frame->Extensions.ExtensionBlocks[i].Bytes; data_size = This->frame->Extensions.ExtensionBlocks[i].ByteCount; } else { - clsid = &CLSID_WICUnknownMetadataReader; + constructor = UnknownMetadataReader_CreateInstance; data = This->frame->Extensions.ExtensionBlocks[i].Bytes; data_size = This->frame->Extensions.ExtensionBlocks[i].ByteCount; } - return create_metadata_reader(data, data_size, clsid, reader); + return create_metadata_reader(data, data_size, constructor, reader); } if (gce_index == -1) return E_INVALIDARG; return create_metadata_reader(This->frame->Extensions.ExtensionBlocks[gce_index].Bytes + 3, This->frame->Extensions.ExtensionBlocks[gce_index].ByteCount - 4, - &CLSID_WICGCEMetadataReader, reader); + GCEReader_CreateInstance, reader); } static HRESULT WINAPI GifFrameDecode_Block_GetEnumerator(IWICMetadataBlockReader *iface, @@ -1040,6 +1040,7 @@ if (ref == 0) { + IStream_Release(This->stream); This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock); DGifCloseFile(This->gif); @@ -1126,6 +1127,9 @@ seek.QuadPart = 0; IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL); IStream_Read(pIStream, This->LSD_data, sizeof(This->LSD_data), NULL); + + This->stream = pIStream; + IStream_AddRef(This->stream); This->initialized = TRUE; @@ -1361,24 +1365,24 @@ if (index == 0) return create_metadata_reader(This->LSD_data, sizeof(This->LSD_data), - &CLSID_WICLSDMetadataReader, reader); + LSDReader_CreateInstance, reader); for (i = 0; i < This->gif->Extensions.ExtensionBlockCount; i++) { - const CLSID *clsid; + class_constructor constructor; if (index != i + 1) continue; if (This->gif->Extensions.ExtensionBlocks[i].Function == APPLICATION_EXT_FUNC_CODE) - clsid = &CLSID_WICAPEMetadataReader; + constructor = APEReader_CreateInstance; else if (This->gif->Extensions.ExtensionBlocks[i].Function == COMMENT_EXT_FUNC_CODE) - clsid = &CLSID_WICGifCommentMetadataReader; + constructor = GifCommentReader_CreateInstance; else - clsid = &CLSID_WICUnknownMetadataReader; + constructor = UnknownMetadataReader_CreateInstance; return create_metadata_reader(This->gif->Extensions.ExtensionBlocks[i].Bytes, This->gif->Extensions.ExtensionBlocks[i].ByteCount, - clsid, reader); + constructor, reader); } return E_INVALIDARG; Modified: trunk/reactos/dll/win32/windowscodecs/icnsformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/ic…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/icnsformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/icnsformat.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -162,7 +162,7 @@ if (This->icns_image != NULL) HeapFree(GetProcessHeap(), 0, This->icns_image); - IUnknown_Release((IUnknown*)This->encoder); + IWICBitmapEncoder_Release(&This->encoder->IWICBitmapEncoder_iface); HeapFree(GetProcessHeap(), 0, This); } @@ -380,7 +380,7 @@ if (!This->initialized) return WINCODEC_ERR_WRONGSTATE; - hr = configure_write_source(iface, pIBitmapSource, &prc, + hr = configure_write_source(iface, pIBitmapSource, prc, &GUID_WICPixelFormat32bppBGRA, This->size, This->size, 1.0, 1.0); @@ -472,7 +472,7 @@ if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapEncoder, iid)) { - *ppv = This; + *ppv = &This->IWICBitmapEncoder_iface; } else { @@ -622,7 +622,7 @@ frameEncode->committed = FALSE; *ppIFrameEncode = &frameEncode->IWICBitmapFrameEncode_iface; This->outstanding_commits++; - IUnknown_AddRef((IUnknown*)This); + IWICBitmapEncoder_AddRef(&This->IWICBitmapEncoder_iface); end: LeaveCriticalSection(&This->lock); @@ -708,8 +708,8 @@ InitializeCriticalSection(&This->lock); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IcnsEncoder.lock"); - ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); - IUnknown_Release((IUnknown*)This); + ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv); + IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface); return ret; } Modified: trunk/reactos/dll/win32/windowscodecs/imgfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/im…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/imgfactory.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/imgfactory.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -694,7 +694,7 @@ return E_INVALIDARG; } - hr = BitmapImpl_Create(bm.bmWidth, bm.bmHeight, bm.bmWidthBytes, 0, NULL, &format, option, bitmap); + hr = BitmapImpl_Create(bm.bmWidth, bm.bmHeight, bm.bmWidthBytes, 0, NULL, &format, WICBitmapCacheOnLoad, bitmap); if (hr != S_OK) return hr; hr = IWICBitmap_Lock(*bitmap, NULL, WICBitmapLockWrite, &lock); Modified: trunk/reactos/dll/win32/windowscodecs/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/in…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/info.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/info.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -213,7 +213,7 @@ IsEqualIID(&IID_IWICBitmapCodecInfo, iid) || IsEqualIID(&IID_IWICBitmapDecoderInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICBitmapDecoderInfo_iface; } else { @@ -606,8 +606,7 @@ TRACE("(%p,%p)\n", iface, ppIBitmapDecoder); - return CoCreateInstance(&This->clsid, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICBitmapDecoder, (void**)ppIBitmapDecoder); + return create_instance(&This->clsid, &IID_IWICBitmapDecoder, (void**)ppIBitmapDecoder); } static const IWICBitmapDecoderInfoVtbl BitmapDecoderInfo_Vtbl = { @@ -655,7 +654,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapDecoderInfo_iface; return S_OK; } @@ -684,7 +683,7 @@ IsEqualIID(&IID_IWICBitmapCodecInfo, iid) || IsEqualIID(&IID_IWICBitmapEncoderInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICBitmapEncoderInfo_iface; } else { @@ -900,8 +899,7 @@ TRACE("(%p,%p)\n", iface, ppIBitmapEncoder); - return CoCreateInstance(&This->clsid, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICBitmapEncoder, (void**)ppIBitmapEncoder); + return create_instance(&This->clsid, &IID_IWICBitmapEncoder, (void**)ppIBitmapEncoder); } static const IWICBitmapEncoderInfoVtbl BitmapEncoderInfo_Vtbl = { @@ -947,7 +945,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICBitmapEncoderInfo_iface; return S_OK; } @@ -975,7 +973,7 @@ IsEqualIID(&IID_IWICComponentInfo, iid) || IsEqualIID(&IID_IWICFormatConverterInfo ,iid)) { - *ppv = This; + *ppv = &This->IWICFormatConverterInfo_iface; } else { @@ -1108,8 +1106,8 @@ TRACE("(%p,%p)\n", iface, ppIFormatConverter); - return CoCreateInstance(&This->clsid, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICFormatConverter, (void**)ppIFormatConverter); + return create_instance(&This->clsid, &IID_IWICFormatConverter, + (void**)ppIFormatConverter); } static BOOL ConverterSupportsFormat(IWICFormatConverterInfo *iface, const WCHAR *formatguid) @@ -1164,7 +1162,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICFormatConverterInfo_iface; return S_OK; } @@ -1193,7 +1191,7 @@ IsEqualIID(&IID_IWICPixelFormatInfo, iid) || IsEqualIID(&IID_IWICPixelFormatInfo2 ,iid)) { - *ppv = This; + *ppv = &This->IWICPixelFormatInfo2_iface; } else { @@ -1458,7 +1456,7 @@ This->classkey = classkey; memcpy(&This->clsid, clsid, sizeof(CLSID)); - *ppIInfo = (IWICComponentInfo*)This; + *ppIInfo = (IWICComponentInfo *)&This->IWICPixelFormatInfo2_iface; return S_OK; } @@ -1489,7 +1487,7 @@ IsEqualIID(&IID_IWICMetadataHandlerInfo, riid) || IsEqualIID(&IID_IWICMetadataReaderInfo, riid)) { - *ppv = This; + *ppv = &This->IWICMetadataReaderInfo_iface; } else { @@ -1854,8 +1852,7 @@ TRACE("(%p,%p)\n", iface, reader); - return CoCreateInstance(&This->clsid, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICMetadataReader, (void **)reader); + return create_instance(&This->clsid, &IID_IWICMetadataReader, (void **)reader); } static const IWICMetadataReaderInfoVtbl MetadataReaderInfo_Vtbl = { @@ -1898,7 +1895,7 @@ This->classkey = classkey; This->clsid = *clsid; - *info = (IWICComponentInfo *)This; + *info = (IWICComponentInfo *)&This->IWICMetadataReaderInfo_iface; return S_OK; } Modified: trunk/reactos/dll/win32/windowscodecs/metadatahandler.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/me…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/metadatahandler.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/metadatahandler.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -680,7 +680,7 @@ return hr; } - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); if (!result) { HeapFree(GetProcessHeap(), 0, data); @@ -1110,7 +1110,7 @@ return WINCODEC_ERR_BADMETADATAHEADER; } - result = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*result)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * sizeof(*result)); if (!result) { HeapFree(GetProcessHeap(), 0, entry); Modified: trunk/reactos/dll/win32/windowscodecs/pngformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/pn…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/pngformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/pngformat.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -24,6 +24,11 @@ static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}; +static inline ULONG read_ulong_be(BYTE* data) +{ + return data[0] << 24 | data[1] << 16 | data[2] << 8 | data[3]; +} + static HRESULT read_png_chunk(IStream *stream, BYTE *type, BYTE **data, ULONG *data_size) { BYTE header[8]; @@ -38,7 +43,7 @@ return hr; } - *data_size = header[0] << 24 | header[1] << 16 | header[2] << 8 | header[3]; + *data_size = read_ulong_be(&header[0]); memcpy(type, &header[4], 4); @@ -92,7 +97,7 @@ value_len = data_size - name_len - 1; - result = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataItem)); + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); name = HeapAlloc(GetProcessHeap(), 0, name_len + 1); value = HeapAlloc(GetProcessHeap(), 0, value_len + 1); if (!result || !name || !value) @@ -134,6 +139,68 @@ HRESULT PngTextReader_CreateInstance(REFIID iid, void** ppv) { return MetadataReader_Create(&TextReader_Vtbl, iid, ppv); +} + +static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor, + DWORD persist_options, MetadataItem **items, DWORD *item_count) +{ + HRESULT hr; + BYTE type[4]; + BYTE *data; + ULONG data_size; + ULONG gamma; + static const WCHAR ImageGamma[] = {'I','m','a','g','e','G','a','m','m','a',0}; + LPWSTR name; + MetadataItem *result; + + hr = read_png_chunk(stream, type, &data, &data_size); + if (FAILED(hr)) return hr; + + if (data_size < 4) + { + HeapFree(GetProcessHeap(), 0, data); + return E_FAIL; + } + + gamma = read_ulong_be(data); + + HeapFree(GetProcessHeap(), 0, data); + + result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem)); + name = HeapAlloc(GetProcessHeap(), 0, sizeof(ImageGamma)); + if (!result || !name) + { + HeapFree(GetProcessHeap(), 0, result); + HeapFree(GetProcessHeap(), 0, name); + return E_OUTOFMEMORY; + } + + PropVariantInit(&result[0].schema); + PropVariantInit(&result[0].id); + PropVariantInit(&result[0].value); + + memcpy(name, ImageGamma, sizeof(ImageGamma)); + + result[0].id.vt = VT_LPWSTR; + result[0].id.u.pwszVal = name; + result[0].value.vt = VT_UI4; + result[0].value.u.ulVal = gamma; + + *items = result; + *item_count = 1; + + return S_OK; +} + +static const MetadataHandlerVtbl GamaReader_Vtbl = { + 0, + &CLSID_WICPngGamaMetadataReader, + LoadGamaMetadata +}; + +HRESULT PngGamaReader_CreateInstance(REFIID iid, void** ppv) +{ + return MetadataReader_Create(&GamaReader_Vtbl, iid, ppv); } #ifdef SONAME_LIBPNG @@ -273,10 +340,16 @@ } typedef struct { + ULARGE_INTEGER ofs, len; + IWICMetadataReader* reader; +} metadata_block_info; + +typedef struct { IWICBitmapDecoder IWICBitmapDecoder_iface; IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; IWICMetadataBlockReader IWICMetadataBlockReader_iface; LONG ref; + IStream *stream; png_structp png_ptr; png_infop info_ptr; png_infop end_info; @@ -287,6 +360,8 @@ const WICPixelFormatGUID *format; BYTE *image_bits; CRITICAL_SECTION lock; /* must be held when png structures are accessed or initialized is set */ + ULONG metadata_count; + metadata_block_info* metadata_blocks; } PngDecoder; static inline PngDecoder *impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface) @@ -342,16 +417,25 @@ { PngDecoder *This = impl_from_IWICBitmapDecoder(iface); ULONG ref = InterlockedDecrement(&This->ref); + ULONG i; TRACE("(%p) refcount=%u\n", iface, ref); if (ref == 0) { + if (This->stream) + IStream_Release(This->stream); if (This->png_ptr) ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info); This->lock.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This->image_bits); + for (i=0; i<This->metadata_count; i++) + { + if (This->metadata_blocks[i].reader) + IWICMetadataReader_Release(This->metadata_blocks[i].reader); + } + HeapFree(GetProcessHeap(), 0, This->metadata_blocks); HeapFree(GetProcessHeap(), 0, This); } @@ -404,6 +488,10 @@ png_uint_32 transparency; png_color_16p trans_values; jmp_buf jmpbuf; + BYTE chunk_type[4]; + ULONG chunk_size; + ULARGE_INTEGER chunk_start; + ULONG metadata_blocks_size = 0; TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions); @@ -586,10 +674,60 @@ ppng_read_end(This->png_ptr, This->end_info); + /* Find the metadata chunks in the file. */ + seek.QuadPart = 8; + hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, &chunk_start); + if (FAILED(hr)) goto end; + + do + { + hr = read_png_chunk(pIStream, chunk_type, NULL, &chunk_size); + if (FAILED(hr)) goto end; + + if (chunk_type[0] >= 'a' && chunk_type[0] <= 'z' && + memcmp(chunk_type, "tRNS", 4) && memcmp(chunk_type, "pHYs", 4)) + { + /* This chunk is considered metadata. */ + if (This->metadata_count == metadata_blocks_size) + { + metadata_block_info* new_metadata_blocks; + ULONG new_metadata_blocks_size; + + new_metadata_blocks_size = 4 + metadata_blocks_size * 2; + new_metadata_blocks = HeapAlloc(GetProcessHeap(), 0, + new_metadata_blocks_size * sizeof(*new_metadata_blocks)); + + if (!new_metadata_blocks) + { + hr = E_OUTOFMEMORY; + goto end; + } + + memcpy(new_metadata_blocks, This->metadata_blocks, + This->metadata_count * sizeof(*new_metadata_blocks)); + + HeapFree(GetProcessHeap(), 0, This->metadata_blocks); + This->metadata_blocks = new_metadata_blocks; + metadata_blocks_size = new_metadata_blocks_size; + } + + This->metadata_blocks[This->metadata_count].ofs = chunk_start; + This->metadata_blocks[This->metadata_count].len.QuadPart = chunk_size + 12; + This->metadata_blocks[This->metadata_count].reader = NULL; + This->metadata_count++; + } + + seek.QuadPart = chunk_start.QuadPart + chunk_size + 12; /* skip data and CRC */ + hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, &chunk_start); + if (FAILED(hr)) goto end; + } while (memcmp(chunk_type, "IEND", 4)); + + This->stream = pIStream; + IStream_AddRef(This->stream); + This->initialized = TRUE; end: - LeaveCriticalSection(&This->lock); return hr; @@ -959,17 +1097,65 @@ static HRESULT WINAPI PngDecoder_Block_GetCount(IWICMetadataBlockReader *iface, UINT *pcCount) { - static int once; + PngDecoder *This = impl_from_IWICMetadataBlockReader(iface); + TRACE("%p,%p\n", iface, pcCount); - if (!once++) FIXME("stub\n"); - return E_NOTIMPL; + + if (!pcCount) return E_INVALIDARG; + + *pcCount = This->metadata_count; + + return S_OK; } static HRESULT WINAPI PngDecoder_Block_GetReaderByIndex(IWICMetadataBlockReader *iface, UINT nIndex, IWICMetadataReader **ppIMetadataReader) { - FIXME("%p,%d,%p\n", iface, nIndex, ppIMetadataReader); - return E_NOTIMPL; + PngDecoder *This = impl_from_IWICMetadataBlockReader(iface); + HRESULT hr; + IWICComponentFactory* factory; + IWICStream* stream; + + TRACE("%p,%d,%p\n", iface, nIndex, ppIMetadataReader); + + if (nIndex >= This->metadata_count || !ppIMetadataReader) + return E_INVALIDARG; + + if (!This->metadata_blocks[nIndex].reader) + { + hr = StreamImpl_Create(&stream); + + if (SUCCEEDED(hr)) + { + hr = IWICStream_InitializeFromIStreamRegion(stream, This->stream, + This->metadata_blocks[nIndex].ofs, This->metadata_blocks[nIndex].len); + + if (SUCCEEDED(hr)) + hr = ComponentFactory_CreateInstance(&IID_IWICComponentFactory, (void**)&factory); + + if (SUCCEEDED(hr)) + { + hr = IWICComponentFactory_CreateMetadataReaderFromContainer(factory, + &GUID_ContainerFormatPng, NULL, WICMetadataCreationAllowUnknown, + (IStream*)stream, &This->metadata_blocks[nIndex].reader); + + IWICComponentFactory_Release(factory); + } + + IWICStream_Release(stream); + } + + if (FAILED(hr)) + { + *ppIMetadataReader = NULL; + return hr; + } + } + + *ppIMetadataReader = This->metadata_blocks[nIndex].reader; + IWICMetadataReader_AddRef(*ppIMetadataReader); + + return S_OK; } static HRESULT WINAPI PngDecoder_Block_GetEnumerator(IWICMetadataBlockReader *iface, @@ -1014,10 +1200,13 @@ This->png_ptr = NULL; This->info_ptr = NULL; This->end_info = NULL; + This->stream = NULL; This->initialized = FALSE; This->image_bits = NULL; InitializeCriticalSection(&This->lock); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PngDecoder.lock"); + This->metadata_count = 0; + This->metadata_blocks = NULL; ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv); IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface); Modified: trunk/reactos/dll/win32/windowscodecs/regsvr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/re…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/regsvr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/regsvr.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -1483,6 +1483,21 @@ { NULL } /* list terminator */ }; +static const BYTE gAMA[] = "gAMA"; + +static const struct metadata_pattern pnggama_metadata_pattern[] = { + { 4, 4, gAMA, mask_all, 4 }, + { 0 } +}; + +static const struct reader_containers pnggama_containers[] = { + { + &GUID_ContainerFormatPng, + pnggama_metadata_pattern + }, + { NULL } /* list terminator */ +}; + static const struct metadata_pattern lsd_metadata_patterns[] = { { 0, 6, gif87a_magic, mask_all, 0 }, { 0, 6, gif89a_magic, mask_all, 0 }, @@ -1577,6 +1592,16 @@ &GUID_MetadataFormatIfd, 1, 1, 0, ifd_containers + }, + { &CLSID_WICPngGamaMetadataReader, + "The Wine Project", + "Chunk gAMA Reader", + "1.0.0.0", + "1.0.0.0", + &GUID_VendorMicrosoft, + &GUID_MetadataFormatChunkgAMA, + 0, 0, 0, + pnggama_containers }, { &CLSID_WICPngTextMetadataReader, "The Wine Project", Modified: trunk/reactos/dll/win32/windowscodecs/stream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/st…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/stream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/stream.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -748,7 +748,7 @@ if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IStream, iid) || IsEqualIID(&IID_ISequentialStream, iid) || IsEqualIID(&IID_IWICStream, iid)) { - *ppv = This; + *ppv = &This->IWICStream_iface; IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } Modified: trunk/reactos/dll/win32/windowscodecs/tiffformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/ti…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/tiffformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/tiffformat.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -219,7 +219,7 @@ const WICPixelFormatGUID *format; int bps; int samples; - int bpp; + int bpp, source_bpp; int planar; int indexed; int reverse_bgr; @@ -318,26 +318,54 @@ extra_sample = 0; extra_samples = &extra_sample; } - else - FIXME("ignoring extra alpha %u/%u bps %u\n", extra_sample_count, extra_samples[0], bps); } else if (samples != 1) { - FIXME("unhandled grayscale sample count %u\n", samples); + FIXME("unhandled %dbpp sample count %u\n", bps, samples); return E_FAIL; } - decode_info->bpp = bps; + decode_info->bpp = bps * samples; + decode_info->source_bpp = decode_info->bpp; switch (bps) { case 1: + if (samples != 1) + { + FIXME("unhandled 1bpp sample count %u\n", samples); + return E_FAIL; + } decode_info->format = &GUID_WICPixelFormatBlackWhite; break; case 4: + if (samples != 1) + { + FIXME("unhandled 4bpp grayscale sample count %u\n", samples); + return E_FAIL; + } decode_info->format = &GUID_WICPixelFormat4bppGray; break; case 8: - decode_info->format = &GUID_WICPixelFormat8bppGray; + if (samples == 1) + decode_info->format = &GUID_WICPixelFormat8bppGray; + else + { + decode_info->bpp = 32; + + switch(extra_samples[0]) + { + case 1: /* Associated (pre-multiplied) alpha data */ + decode_info->format = &GUID_WICPixelFormat32bppPBGRA; + break; + case 0: /* Unspecified data */ + case 2: /* Unassociated alpha data */ + decode_info->format = &GUID_WICPixelFormat32bppBGRA; + break; + default: + FIXME("unhandled extra sample type %u\n", extra_samples[0]); + return E_FAIL; + } + } break; default: FIXME("unhandled greyscale bit count %u\n", bps); @@ -938,6 +966,22 @@ hr = E_FAIL; } + /* 8bpp grayscale with extra alpha */ + if (hr == S_OK && This->decode_info.source_bpp == 16 && This->decode_info.samples == 2 && This->decode_info.bpp == 32) + { + BYTE *src; + DWORD *dst, count = This->decode_info.tile_width * This->decode_info.tile_height; + + src = This->cached_tile + This->decode_info.tile_width * This->decode_info.tile_height * 2 - 2; + dst = (DWORD *)(This->cached_tile + This->decode_info.tile_size - 4); + + while (count--) + { + *dst-- = src[0] | (src[0] << 8) | (src[0] << 16) | (src[1] << 24); + src -= 2; + } + } + if (hr == S_OK && This->decode_info.reverse_bgr) { if (This->decode_info.bps == 8) @@ -1218,8 +1262,7 @@ /* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */ - hr = CoCreateInstance(&CLSID_WICIfdMetadataReader, NULL, CLSCTX_INPROC_SERVER, - &IID_IWICMetadataReader, (void **)&metadata_reader); + hr = IfdMetadataReader_CreateInstance(&IID_IWICMetadataReader, (void **)&metadata_reader); if (FAILED(hr)) return hr; hr = IWICMetadataReader_QueryInterface(metadata_reader, &IID_IWICPersistStream, (void **)&persist); Modified: trunk/reactos/dll/win32/windowscodecs/ungif.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/un…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/ungif.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/ungif.c [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -491,7 +491,7 @@ * image until empty block (size 0) detected. We use GetCodeNext. */ do if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR) - return GIF_ERROR; + break; while (Dummy != NULL) ; } return GIF_OK; Modified: trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/wincodecs_private.h [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -94,6 +94,9 @@ }; #undef INTERFACE +HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN; + +typedef HRESULT(*class_constructor)(REFIID,void**); extern HRESULT FormatConverter_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT ComponentFactory_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT BmpDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN; @@ -175,6 +178,7 @@ extern HRESULT UnknownMetadataReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT IfdMetadataReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN; +extern HRESULT PngGamaReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT PngTextReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN; extern HRESULT LSDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN; extern HRESULT IMDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.idl [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -140,6 +140,13 @@ coclass WICIfdMetadataReader { interface IWICIfdMetadataReader; } [ + helpstring("WIC Png gAMA Metadata Reader"), + threading(both), + uuid(3692ca39-e082-4350-9e1f-3704cb083cd5) +] +coclass WICPngGamaMetadataReader { interface IWICMetadataReader; } + +[ helpstring("WIC Png tEXt Metadata Reader"), threading(both), uuid(4b59afcc-b8c3-408a-b670-89e5fab6fda7) Modified: trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs [iso-8859-1] Wed Jul 22 00:45:26 2015 @@ -203,6 +203,10 @@ { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } } + '{3692CA39-E082-4350-9E1F-3704CB083CD5}' = s 'WIC Png gAMA Metadata Reader' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } '{4B59AFCC-B8C3-408A-B670-89E5FAB6FDA7}' = s 'WIC Png tEXt Metadata Reader' { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } @@ -228,4 +232,4 @@ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } } } -} +} 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] Wed Jul 22 00:45:26 2015 @@ -202,7 +202,7 @@ reactos/dll/win32/version # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.47 -reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.37 +reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.47 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.7.37 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.7.47 reactos/dll/win32/wing32 # Out of sync
9 years, 5 months
1
0
0
0
[akhaldi] 68542: [WBEMPROX_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:43:56 2015 New Revision: 68542 URL:
http://svn.reactos.org/svn/reactos?rev=68542&view=rev
Log: [WBEMPROX_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/wbemprox/query.c trunk/rostests/winetests/wbemprox/services.c Modified: trunk/rostests/winetests/wbemprox/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/query.…
============================================================================== --- trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/query.c [iso-8859-1] Wed Jul 22 00:43:56 2015 @@ -21,6 +21,7 @@ #include <stdio.h> #include "windows.h" #include "ocidl.h" +#include "sddl.h" #include "initguid.h" #include "objidl.h" #include "wbemcli.h" @@ -95,7 +96,9 @@ {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', 'D','i','s','k','D','r','i','v','e',' ','W','H','E','R','E',' ','D','e','v','i','c','e','I','D','=', '\"','\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0','\"',0}; - static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7, query8 }; + static const WCHAR query9[] = + {'S','E','L','E','C','T','\n','a','\r','F','R','O','M','\t','b',0}; + static const WCHAR *test[] = { query1, query2, query3, query4, query5, query6, query7, query8, query9 }; HRESULT hr; IEnumWbemClassObject *result; BSTR wql = SysAllocString( wqlW ); @@ -157,7 +160,7 @@ if (hr != S_OK) { win_skip( "Win32_Service not available\n" ); - return; + goto out; } type = 0xdeadbeef; VariantInit( &state ); @@ -231,6 +234,7 @@ ok( hr == S_OK, "got %08x\n", hr ); if (service) IWbemClassObject_Release( service ); +out: SysFreeString( empty ); SysFreeString( class ); } @@ -266,6 +270,7 @@ } hr = IWbemClassObject_GetMethod( process, getownerW, 0, NULL, NULL ); ok( hr == S_OK, "failed to get GetOwner method %08x\n", hr ); + IWbemClassObject_Release( process ); out = NULL; method = SysAllocString( getownerW ); @@ -371,17 +376,17 @@ if (!compname[0] || !username[0]) { skip( "Failed to get user or computer name\n" ); - return; + goto out; } hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); if (hr != S_OK) { win_skip( "Win32_ComputerSystem not available\n" ); - return; - } - - IEnumWbemClassObject_Next( result, 10000, 1, &service, &count ); + goto out; + } + + hr = IEnumWbemClassObject_Next( result, 10000, 1, &service, &count ); ok( hr == S_OK, "got %08x\n", hr ); type = 0xdeadbeef; @@ -403,6 +408,121 @@ VariantClear( &value ); IWbemClassObject_Release( service ); + IEnumWbemClassObject_Release( result ); +out: + SysFreeString( query ); + SysFreeString( wql ); +} + +static void test_Win32_SystemEnclosure( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'S','y','s','t','e','m','E','n','c','l','o','s','u','r','e',0}; + static const WCHAR captionW[] = {'C','a','p','t','i','o','n',0}; + static const WCHAR chassistypesW[] = {'C','h','a','s','s','i','s','T','y','p','e','s',0}; + static const WCHAR descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; + static const WCHAR lockpresentW[] = {'L','o','c','k','P','r','e','s','e','n','t',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR nameW[] = {'N','a','m','e',0}; + static const WCHAR tagW[] = {'T','a','g',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + CIMTYPE type; + ULONG count; + VARIANT val; + DWORD *data; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "IWbemServices_ExecQuery failed %08x\n", hr ); + + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + ok( hr == S_OK, "IEnumWbemClassObject_Next failed %08x\n", hr ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, captionW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get caption %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "caption: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, chassistypesW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get chassis types %08x\n", hr ); + todo_wine + ok( V_VT( &val ) == (VT_I4|VT_ARRAY), "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == (CIM_UINT16|CIM_FLAG_ARRAY), "unexpected type 0x%x\n", type ); + hr = SafeArrayAccessData( V_ARRAY( &val ), (void **)&data ); + ok( hr == S_OK, "SafeArrayAccessData failed %x\n", hr ); + if (SUCCEEDED(hr)) + { + LONG i, lower, upper; + + hr = SafeArrayGetLBound( V_ARRAY( &val ), 1, &lower ); + ok( hr == S_OK, "SafeArrayGetLBound failed %x\n", hr ); + hr = SafeArrayGetUBound( V_ARRAY( &val ), 1, &upper ); + ok( hr == S_OK, "SafeArrayGetUBound failed %x\n", hr ); + if (V_VT( &val ) == (VT_I4|VT_ARRAY)) + { + for (i = 0; i < upper - lower + 1; i++) + trace( "chassis type: %u\n", data[i] ); + } + hr = SafeArrayUnaccessData( V_ARRAY( &val ) ); + ok( hr == S_OK, "SafeArrayUnaccessData failed %x\n", hr ); + } + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, descriptionW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get description %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "description: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, lockpresentW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get lockpresent %08x\n", hr ); + ok( V_VT( &val ) == VT_BOOL, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_BOOLEAN, "unexpected type 0x%x\n", type ); + trace( "lockpresent: %u\n", V_BOOL( &val ) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, manufacturerW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get manufacturer %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "manufacturer: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, nameW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get name %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "name: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, tagW, 0, &val, &type, NULL ); + ok( hr == S_OK, "failed to get tag %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "tag: %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + + IWbemClassObject_Release( obj ); IEnumWbemClassObject_Release( result ); SysFreeString( query ); SysFreeString( wql ); @@ -824,6 +944,7 @@ test_Win32_Process( services ); test_Win32_Service( services ); test_Win32_ComputerSystem( services ); + test_Win32_SystemEnclosure( services ); test_StdRegProv( services ); test_notification_query_async( services ); test_query_async( services ); Modified: trunk/rostests/winetests/wbemprox/services.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wbemprox/servic…
============================================================================== --- trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wbemprox/services.c [iso-8859-1] Wed Jul 22 00:43:56 2015 @@ -111,6 +111,8 @@ static const WCHAR path22W[] = {'r','o','o','t','\\','d','e','f','a','u','l','t',0}; static const WCHAR path23W[] = {'r','o','o','t','\\','c','i','m','v','0',0}; static const WCHAR path24W[] = {'r','o','o','t','\\','c','i','m','v','1',0}; + static const WCHAR path25W[] = {'\\','\\','l','o','c','a','l','h','o','s','t','\\','R','O','O','T',0}; + static const WCHAR path26W[] = {'\\','\\','L','O','C','A','L','H','O','S','T','\\','R','O','O','T',0}; static const struct { const WCHAR *path; @@ -144,7 +146,9 @@ { path21W, S_OK }, { path22W, S_OK }, { path23W, WBEM_E_INVALID_NAMESPACE }, - { path24W, WBEM_E_INVALID_NAMESPACE } + { path24W, WBEM_E_INVALID_NAMESPACE }, + { path25W, S_OK }, + { path26W, S_OK } }; IWbemLocator *locator; IWbemServices *services;
9 years, 5 months
1
0
0
0
[akhaldi] 68541: [WBEMPROX] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:43:39 2015 New Revision: 68541 URL:
http://svn.reactos.org/svn/reactos?rev=68541&view=rev
Log: [WBEMPROX] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/wbemprox/CMakeLists.txt trunk/reactos/dll/win32/wbemprox/builtin.c trunk/reactos/dll/win32/wbemprox/class.c trunk/reactos/dll/win32/wbemprox/query.c trunk/reactos/dll/win32/wbemprox/reg.c trunk/reactos/dll/win32/wbemprox/table.c trunk/reactos/dll/win32/wbemprox/wbemlocator.c trunk/reactos/dll/win32/wbemprox/wbemprox_private.h trunk/reactos/dll/win32/wbemprox/wql.tab.c trunk/reactos/dll/win32/wbemprox/wql.y trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wbemprox/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/CMakeLists.txt [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -31,7 +31,7 @@ set_source_files_properties(wbemprox.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wbemprox.rgs) set_module_type(wbemprox win32dll) target_link_libraries(wbemprox uuid wine) -add_importlibs(wbemprox iphlpapi dxgi oleaut32 advapi32 user32 gdi32 version ws2_32 msvcrt kernel32 ntdll) +add_importlibs(wbemprox iphlpapi dxgi oleaut32 advapi32 user32 gdi32 version winspool ws2_32 msvcrt kernel32 ntdll) add_dependencies(wbemprox d3d_idl_headers) add_pch(wbemprox wbemprox_private.h SOURCE) add_cd_file(TARGET wbemprox DESTINATION reactos/system32/wbem FOR all) Modified: trunk/reactos/dll/win32/wbemprox/builtin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/builtin…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/builtin.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -27,6 +27,7 @@ #include <winioctl.h> #include <winver.h> #include <ntsecapi.h> +#include <winspool.h> #include <sddl.h> #include <initguid.h> @@ -69,6 +70,8 @@ {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR class_qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0}; +static const WCHAR class_printerW[] = + {'W','i','n','3','2','_','P','r','i','n','t','e','r',0}; static const WCHAR class_process_getowner_outW[] = {'_','_','W','I','N','3','2','_','P','R','O','C','E','S','S','_','G','E','T','O','W', 'N','E','R','_','O','U','T',0}; @@ -80,6 +83,8 @@ {'W','i','n','3','2','_','S','I','D',0}; static const WCHAR class_sounddeviceW[] = {'W','i','n','3','2','_','S','o','u','n','d','D','e','v','i','c','e',0}; +static const WCHAR class_systemenclosureW[] = + {'W','i','n','3','2','_','S','y','s','t','e','m','E','n','c','l','o','s','u','r','e',0}; static const WCHAR class_videocontrollerW[] = {'W','i','n','3','2','_','V','i','d','e','o','C','o','n','t','r','o','l','l','e','r',0}; @@ -99,6 +104,8 @@ {'A','d','a','p','t','e','r','T','y','p','e',0}; static const WCHAR prop_addresswidthW[] = {'A','d','d','r','e','s','s','W','i','d','t','h',0}; +static const WCHAR prop_attributesW[] = + {'A','t','t','r','i','b','u','t','e','s',0}; static const WCHAR prop_availabilityW[] = {'A','v','a','i','l','a','b','i','l','i','t','y',0}; static const WCHAR prop_binaryrepresentationW[] = @@ -113,6 +120,8 @@ {'C','a','p','a','c','i','t','y',0}; static const WCHAR prop_captionW[] = {'C','a','p','t','i','o','n',0}; +static const WCHAR prop_chassistypesW[] = + {'C','h','a','s','s','i','s','T','y','p','e','s',0}; static const WCHAR prop_classW[] = {'C','l','a','s','s',0}; static const WCHAR prop_codesetW[] = @@ -131,8 +140,14 @@ {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_currenthorizontalresW[] = {'C','u','r','r','e','n','t','H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_currentrefreshrateW[] = + {'C','u','r','r','e','n','t','R','e','f','r','e','s','h','R','a','t','e',0}; +static const WCHAR prop_currentscanmodeW[] = + {'C','u','r','r','e','n','t','S','c','a','n','M','o','d','e',0}; static const WCHAR prop_currentverticalresW[] = {'C','u','r','r','e','n','t','V','e','r','t','i','c','a','l','R','e','s','o','l','u','t','i','o','n',0}; +static const WCHAR prop_datawidthW[] = + {'D','a','t','a','W','i','d','t','h',0}; static const WCHAR prop_defaultvalueW[] = {'D','e','f','a','u','l','t','V','a','l','u','e',0}; static const WCHAR prop_descriptionW[] = @@ -153,6 +168,8 @@ {'D','o','m','a','i','n','R','o','l','e',0}; static const WCHAR prop_driveW[] = {'D','r','i','v','e',0}; +static const WCHAR prop_drivernameW[] = + {'D','r','i','v','e','r','N','a','m','e',0}; static const WCHAR prop_driverversionW[] = {'D','r','i','v','e','r','V','e','r','s','i','o','n',0}; static const WCHAR prop_drivetypeW[] = @@ -167,6 +184,8 @@ {'F','r','e','e','S','p','a','c','e',0}; static const WCHAR prop_handleW[] = {'H','a','n','d','l','e',0}; +static const WCHAR prop_horizontalresolutionW[] = + {'H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; static const WCHAR prop_idW[] = {'I','D',0}; static const WCHAR prop_identificationcodeW[] = @@ -189,10 +208,14 @@ {'I','P','E','n','a','b','l','e','d',0}; static const WCHAR prop_lastbootuptimeW[] = {'L','a','s','t','B','o','o','t','U','p','T','i','m','e',0}; +static const WCHAR prop_localW[] = + {'L','o','c','a','l',0}; static const WCHAR prop_localdatetimeW[] = {'L','o','c','a','l','D','a','t','e','T','i','m','e',0}; static const WCHAR prop_localeW[] = {'L','o','c','a','l','e',0}; +static const WCHAR prop_lockpresentW[] = + {'L','o','c','k','P','r','e','s','e','n','t',0}; static const WCHAR prop_macaddressW[] = {'M','A','C','A','d','d','r','e','s','s',0}; static const WCHAR prop_manufacturerW[] = @@ -209,6 +232,8 @@ {'M','o','d','e','l',0}; static const WCHAR prop_netconnectionstatusW[] = {'N','e','t','C','o','n','n','e','c','t','i','o','n','S','t','a','t','u','s',0}; +static const WCHAR prop_networkW[] = + {'N','e','t','w','o','r','k',0}; static const WCHAR prop_numcoresW[] = {'N','u','m','b','e','r','O','f','C','o','r','e','s',0}; static const WCHAR prop_numlogicalprocessorsW[] = @@ -231,6 +256,8 @@ {'P','N','P','D','e','v','i','c','e','I','D',0}; static const WCHAR prop_pprocessidW[] = {'P','a','r','e','n','t','P','r','o','c','e','s','s','I','D',0}; +static const WCHAR prop_primaryW[] = + {'P','r','i','m','a','r','y',0}; static const WCHAR prop_processidW[] = {'P','r','o','c','e','s','s','I','D',0}; static const WCHAR prop_processoridW[] = @@ -299,12 +326,18 @@ {'V','a','r','i','a','n','t','T','y','p','e',0}; static const WCHAR prop_versionW[] = {'V','e','r','s','i','o','n',0}; +static const WCHAR prop_videoarchitectureW[] = + {'V','i','d','e','o','A','r','c','h','i','t','e','c','t','u','r','e',0}; +static const WCHAR prop_videomemorytypeW[] = + {'V','i','d','e','o','M','e','m','o','r','y','T','y','p','e',0}; static const WCHAR prop_videoprocessorW[] = {'V','i','d','e','o','P','r','o','c','e','s','s','o','r',0}; static const WCHAR prop_volumenameW[] = {'V','o','l','u','m','e','N','a','m','e',0}; static const WCHAR prop_volumeserialnumberW[] = {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; +static const WCHAR prop_workingsetsizeW[] = + {'W','o','r','k','i','n','g','S','e','t','S','i','z','e',0}; /* column definitions must be kept in sync with record structures below */ static const struct column col_baseboard[] = @@ -346,7 +379,7 @@ { prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 }, { prop_numprocessorsW, CIM_UINT32, VT_I4 }, { prop_totalphysicalmemoryW, CIM_UINT64 }, - { prop_usernameW, CIM_STRING } + { prop_usernameW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_compsysproduct[] = { @@ -436,6 +469,7 @@ { prop_oslanguageW, CIM_UINT32, VT_I4 }, { prop_osproductsuiteW, CIM_UINT32, VT_I4 }, { prop_ostypeW, CIM_UINT16, VT_I4 }, + { prop_primaryW, CIM_BOOLEAN }, { prop_serialnumberW, CIM_STRING }, { prop_servicepackmajorW, CIM_UINT16, VT_I4 }, { prop_servicepackminorW, CIM_UINT16, VT_I4 }, @@ -463,24 +497,37 @@ { { prop_capacityW, CIM_UINT64 } }; +static const struct column col_printer[] = +{ + { prop_attributesW, CIM_UINT32 }, + { prop_drivernameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_horizontalresolutionW, CIM_UINT32 }, + { prop_localW, CIM_BOOLEAN }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_networkW, CIM_BOOLEAN } +}; static const struct column col_process[] = { - { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_commandlineW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_handleW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_pprocessidW, CIM_UINT32, VT_I4 }, - { prop_processidW, CIM_UINT32, VT_I4 }, - { prop_threadcountW, CIM_UINT32, VT_I4 }, + { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_commandlineW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_handleW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_pprocessidW, CIM_UINT32, VT_I4 }, + { prop_processidW, CIM_UINT32, VT_I4 }, + { prop_threadcountW, CIM_UINT32, VT_I4 }, + { prop_workingsetsizeW, CIM_UINT64 }, /* methods */ - { method_getownerW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } + { method_getownerW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } }; static const struct column col_processor[] = { { prop_addresswidthW, CIM_UINT16, VT_I4 }, + { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_cpustatusW, CIM_UINT16 }, { prop_currentclockspeedW, CIM_UINT32, VT_I4 }, + { prop_datawidthW, CIM_UINT16, VT_I4 }, + { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { prop_familyW, CIM_UINT16, VT_I4 }, { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -490,7 +537,8 @@ { prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 }, { prop_processoridW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_processortypeW, CIM_UINT16, VT_I4 }, - { prop_uniqueidW, CIM_STRING } + { prop_uniqueidW, CIM_STRING }, + { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_qualifier[] = { @@ -539,6 +587,16 @@ { method_enumvaluesW, CIM_FLAG_ARRAY|COL_FLAG_METHOD }, { method_getstringvalueW, CIM_FLAG_ARRAY|COL_FLAG_METHOD } }; +static const struct column col_systemenclosure[] = +{ + { prop_captionW, CIM_STRING }, + { prop_chassistypesW, CIM_UINT16|CIM_FLAG_ARRAY }, + { prop_descriptionW, CIM_STRING }, + { prop_lockpresentW, CIM_BOOLEAN }, + { prop_manufacturerW, CIM_STRING }, + { prop_nameW, CIM_STRING }, + { prop_tagW, CIM_STRING }, +}; static const struct column col_systemsecurity[] = { { method_getsdW, CIM_FLAG_ARRAY|COL_FLAG_METHOD }, @@ -549,14 +607,19 @@ { prop_adapterdactypeW, CIM_STRING }, { prop_adapterramW, CIM_UINT32, VT_I4 }, { prop_availabilityW, CIM_UINT16 }, + { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_currentbitsperpixelW, CIM_UINT32, VT_I4 }, { prop_currenthorizontalresW, CIM_UINT32, VT_I4 }, + { prop_currentrefreshrateW, CIM_UINT32, VT_I4 }, + { prop_currentscanmodeW, CIM_UINT16, VT_I4 }, { prop_currentverticalresW, CIM_UINT32, VT_I4 }, { prop_descriptionW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, { prop_driverversionW, CIM_STRING }, { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_pnpdeviceidW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_videoarchitectureW, CIM_UINT16, VT_I4 }, + { prop_videomemorytypeW, CIM_UINT16, VT_I4 }, { prop_videoprocessorW, CIM_STRING|COL_FLAG_DYNAMIC } }; @@ -646,6 +709,12 @@ {'\\','\\','.','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0}; static const WCHAR sounddevice_productnameW[] = {'W','i','n','e',' ','A','u','d','i','o',' ','D','e','v','i','c','e',0}; +static const WCHAR systemenclosure_systemenclosureW[] = + {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',0}; +static const WCHAR systemenclosure_tagW[] = + {'S','y','s','t','e','m',' ','E','n','c','l','o','s','u','r','e',' ','0',0}; +static const WCHAR systemenclosure_manufacturerW[] = + {'W','i','n','e',0}; static const WCHAR videocontroller_dactypeW[] = {'I','n','t','e','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; static const WCHAR videocontroller_deviceidW[] = @@ -783,6 +852,7 @@ UINT32 oslanguage; UINT32 osproductsuite; UINT16 ostype; + int primary; const WCHAR *serialnumber; UINT16 servicepackmajor; UINT16 servicepackminor; @@ -809,6 +879,15 @@ struct record_physicalmemory { UINT64 capacity; +}; +struct record_printer +{ + UINT32 attributes; + const WCHAR *drivername; + UINT32 horizontalresolution; + int local; + const WCHAR *name; + int network; }; struct record_process { @@ -820,14 +899,18 @@ UINT32 pprocess_id; UINT32 process_id; UINT32 thread_count; + UINT64 workingsetsize; /* methods */ class_method *get_owner; }; struct record_processor { UINT16 addresswidth; + const WCHAR *caption; UINT16 cpu_status; UINT32 currentclockspeed; + UINT16 datawidth; + const WCHAR *description; const WCHAR *device_id; UINT16 family; const WCHAR *manufacturer; @@ -838,6 +921,7 @@ const WCHAR *processor_id; UINT16 processortype; const WCHAR *unique_id; + const WCHAR *version; }; struct record_qualifier { @@ -869,7 +953,7 @@ struct record_sid { const WCHAR *accountname; - const UINT8 *binaryrepresentation; + const struct array *binaryrepresentation; const WCHAR *referenceddomainname; const WCHAR *sid; UINT32 sidlength; @@ -891,19 +975,34 @@ class_method *getsd; class_method *setsd; }; +struct record_systemenclosure +{ + const WCHAR *caption; + const struct array *chassistypes; + const WCHAR *description; + int lockpresent; + const WCHAR *manufacturer; + const WCHAR *name; + const WCHAR *tag; +}; struct record_videocontroller { const WCHAR *adapter_dactype; UINT32 adapter_ram; UINT16 availability; + const WCHAR *caption; UINT32 current_bitsperpixel; UINT32 current_horizontalres; + UINT32 current_refreshrate; + UINT16 current_scanmode; UINT32 current_verticalres; const WCHAR *description; const WCHAR *device_id; const WCHAR *driverversion; const WCHAR *name; const WCHAR *pnpdevice_id; + UINT16 videoarchitecture; + UINT16 videomemorytype; const WCHAR *videoprocessor; }; #include "poppack.h" @@ -970,6 +1069,27 @@ { { reg_enum_key, reg_enum_values, reg_get_stringvalue } }; +static UINT16 systemenclosure_chassistypes[] = +{ + 1, +}; +static const struct array systemenclosure_chassistypes_array = +{ + SIZEOF(systemenclosure_chassistypes), + &systemenclosure_chassistypes +}; +static const struct record_systemenclosure data_systemenclosure[] = +{ + { + systemenclosure_systemenclosureW, + &systemenclosure_chassistypes_array, + systemenclosure_systemenclosureW, + FALSE, + systemenclosure_manufacturerW, + systemenclosure_systemenclosureW, + systemenclosure_tagW, + } +}; static const struct record_systemsecurity data_systemsecurity[] = { { security_get_sd, security_set_sd } @@ -1003,10 +1123,10 @@ table->num_rows_allocated = row_count; return TRUE; } - if (row_count >= table->num_rows_allocated) + if (row_count > table->num_rows_allocated) { BYTE *data; - UINT count = table->num_rows_allocated * 2; + UINT count = max( row_count, table->num_rows_allocated * 2 ); if (!(data = heap_realloc( table->data, count * row_size ))) return FALSE; table->data = data; table->num_rows_allocated = count; @@ -1459,6 +1579,8 @@ for (;;) { + heap_free( glob ); + heap_free( path ); path = pop_dir( dirstack, &len ); if (!(glob = build_glob( root[0], path, len ))) { @@ -1508,8 +1630,6 @@ FindClose( handle ); } if (!peek_dir( dirstack )) break; - heap_free( glob ); - heap_free( path ); } } @@ -1551,6 +1671,8 @@ for (;;) { + heap_free( glob ); + heap_free( path ); path = pop_dir( dirstack, &len ); if (!(glob = build_glob( root[0], path, len ))) { @@ -1601,8 +1723,6 @@ FindClose( handle ); } if (!peek_dir( dirstack )) break; - heap_free( glob ); - heap_free( path ); } } @@ -2000,6 +2120,51 @@ return status; } +static enum fill_status fill_printer( struct table *table, const struct expr *cond ) +{ + struct record_printer *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + PRINTER_INFO_2W *info; + DWORD i, offset = 0, count = 0, size = 0; + + EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &size, &count ); + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FILL_STATUS_FAILED; + + if (!(info = heap_alloc( size ))) return FILL_STATUS_FAILED; + if (!EnumPrintersW( PRINTER_ENUM_LOCAL, NULL, 2, (BYTE *)info, size, &size, &count )) + { + heap_free( info ); + return FILL_STATUS_FAILED; + } + if (!resize_table( table, count, sizeof(*rec) )) + { + heap_free( info ); + return FILL_STATUS_FAILED; + } + + for (i = 0; i < count; i++) + { + rec = (struct record_printer *)(table->data + offset); + rec->attributes = info[i].Attributes; + rec->drivername = heap_strdupW( info[i].pDriverName ); + rec->horizontalresolution = info[i].pDevMode->u1.s1.dmPrintQuality; + rec->local = -1; + rec->name = heap_strdupW( info[i].pPrinterName ); + rec->network = 0; + if (!match_row( table, i, cond, &status )) + { + free_row_values( table, i ); + continue; + } + offset += sizeof(*rec); + } + TRACE("created %u rows\n", count); + table->num_rows = count; + + heap_free( info ); + return status; +} + static WCHAR *get_cmdline( DWORD process_id ) { if (process_id == GetCurrentProcessId()) return heap_strdupW( GetCommandLineW() ); @@ -2028,16 +2193,17 @@ if (!resize_table( table, row + 1, sizeof(*rec) )) goto done; rec = (struct record_process *)(table->data + offset); - rec->caption = heap_strdupW( entry.szExeFile ); - rec->commandline = get_cmdline( entry.th32ProcessID ); - rec->description = heap_strdupW( entry.szExeFile ); + rec->caption = heap_strdupW( entry.szExeFile ); + rec->commandline = get_cmdline( entry.th32ProcessID ); + rec->description = heap_strdupW( entry.szExeFile ); sprintfW( handle, fmtW, entry.th32ProcessID ); - rec->handle = heap_strdupW( handle ); - rec->name = heap_strdupW( entry.szExeFile ); - rec->process_id = entry.th32ProcessID; - rec->pprocess_id = entry.th32ParentProcessID; - rec->thread_count = entry.cntThreads; - rec->get_owner = process_get_owner; + rec->handle = heap_strdupW( handle ); + rec->name = heap_strdupW( entry.szExeFile ); + rec->process_id = entry.th32ProcessID; + rec->pprocess_id = entry.th32ParentProcessID; + rec->thread_count = entry.cntThreads; + rec->workingsetsize = 0; + rec->get_owner = process_get_owner; if (!match_row( table, row, cond, &status )) { free_row_values( table, row ); @@ -2071,7 +2237,35 @@ #endif #endif } - +static const WCHAR *get_osarchitecture(void) +{ + SYSTEM_INFO info; + GetNativeSystemInfo( &info ); + if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return os_64bitW; + return os_32bitW; +} +static void get_processor_caption( WCHAR *caption ) +{ + static const WCHAR fmtW[] = + {'%','s',' ','F','a','m','i','l','y',' ','%','u',' ', + 'M','o','d','e','l',' ','%','u',' ','S','t','e','p','p','i','n','g',' ','%','u',0}; + static const WCHAR x86W[] = {'x','8','6',0}; + static const WCHAR intel64W[] = {'I','n','t','e','l','6','4',0}; + const WCHAR *arch = (get_osarchitecture() == os_32bitW) ? x86W : intel64W; + unsigned int regs[4] = {0, 0, 0, 0}; + + do_cpuid( 1, regs ); + sprintfW( caption, fmtW, arch, (regs[0] & (15 << 8)) >> 8, (regs[0] & (15 << 4)) >> 4, regs[0] & 15 ); +} +static void get_processor_version( WCHAR *version ) +{ + static const WCHAR fmtW[] = + {'M','o','d','e','l',' ','%','u',',',' ','S','t','e','p','p','i','n','g',' ','%','u',0}; + unsigned int regs[4] = {0, 0, 0, 0}; + + do_cpuid( 1, regs ); + sprintfW( version, fmtW, (regs[0] & (15 << 4)) >> 4, regs[0] & 15 ); +} static void get_processor_id( WCHAR *processor_id ) { static const WCHAR fmtW[] = {'%','0','8','X','%','0','8','X',0}; @@ -2142,27 +2336,22 @@ } return ret; } -static const WCHAR *get_osarchitecture(void) -{ - SYSTEM_INFO info; - GetNativeSystemInfo( &info ); - if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return os_64bitW; - return os_32bitW; -} static enum fill_status fill_processor( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] = {'C','P','U','%','u',0}; - WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0}; + WCHAR caption[100], device_id[14], processor_id[17], manufacturer[13], name[49] = {0}, version[50]; struct record_processor *rec; UINT i, offset = 0, num_cores, num_logical_processors, count = get_processor_count(); enum fill_status status = FILL_STATUS_UNFILTERED; if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED; + get_processor_caption( caption ); get_processor_id( processor_id ); get_processor_manufacturer( manufacturer ); get_processor_name( name ); + get_processor_version( version ); num_logical_processors = get_logical_processor_count( &num_cores ) / count; num_cores /= count; @@ -2171,8 +2360,11 @@ { rec = (struct record_processor *)(table->data + offset); rec->addresswidth = get_osarchitecture() == os_32bitW ? 32 : 64; + rec->caption = heap_strdupW( caption ); rec->cpu_status = 1; /* CPU Enabled */ rec->currentclockspeed = get_processor_currentclockspeed( i ); + rec->datawidth = get_osarchitecture() == os_32bitW ? 32 : 64; + rec->description = heap_strdupW( caption ); sprintfW( device_id, fmtW, i ); rec->device_id = heap_strdupW( device_id ); rec->family = 2; /* Unknown */ @@ -2184,6 +2376,7 @@ rec->processor_id = heap_strdupW( processor_id ); rec->processortype = 3; /* central processor */ rec->unique_id = NULL; + rec->version = heap_strdupW( version ); if (!match_row( table, i, cond, &status )) { free_row_values( table, i ); @@ -2292,6 +2485,7 @@ rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ rec->ostype = 18; /* WINNT */ + rec->primary = -1; rec->serialnumber = os_serialnumberW; rec->servicepackmajor = 3; rec->servicepackminor = 0; @@ -2468,12 +2662,22 @@ if (!name || !name->Name.Buffer) return NULL; return heap_strdupW( name->Name.Buffer ); } -static UINT8 *get_binaryrepresentation( PSID sid, UINT len ) -{ - UINT8 *ret = heap_alloc( len ); - if (!ret) return NULL; - memcpy( ret, sid, len ); - return ret; +static struct array *get_binaryrepresentation( PSID sid, UINT len ) +{ + struct array *array = heap_alloc( sizeof(struct array) ); + if (array) + { + UINT8 *ret = heap_alloc( len ); + if (ret) + { + memcpy( ret, sid, len ); + array->count = len; + array->ptr = ret; + return array; + } + heap_free( array ); + } + return NULL; } static WCHAR *get_referenceddomainname( LSA_REFERENCED_DOMAIN_LIST *domain ) { @@ -2607,14 +2811,19 @@ rec->adapter_dactype = videocontroller_dactypeW; rec->adapter_ram = vidmem; rec->availability = 3; /* Running or Full Power */ + rec->caption = heap_strdupW( name ); rec->current_bitsperpixel = get_bits_per_pixel( &hres, &vres ); rec->current_horizontalres = hres; + rec->current_refreshrate = 0; /* default refresh rate */ + rec->current_scanmode = 2; /* Unknown */ rec->current_verticalres = vres; rec->description = heap_strdupW( name ); rec->device_id = videocontroller_deviceidW; rec->driverversion = videocontroller_driverversionW; rec->name = heap_strdupW( name ); rec->pnpdevice_id = get_pnpdeviceid( &desc ); + rec->videoarchitecture = 2; /* Unknown */ + rec->videomemorytype = 2; /* Unknown */ rec->videoprocessor = heap_strdupW( name ); if (!match_row( table, row, cond, &status )) free_row_values( table, row ); else row++; @@ -2646,6 +2855,7 @@ { class_paramsW, SIZEOF(col_param), col_param, SIZEOF(data_param), 0, (BYTE *)data_param }, { class_physicalmediaW, SIZEOF(col_physicalmedia), col_physicalmedia, SIZEOF(data_physicalmedia), 0, (BYTE *)data_physicalmedia }, { class_physicalmemoryW, SIZEOF(col_physicalmemory), col_physicalmemory, 0, 0, NULL, fill_physicalmemory }, + { class_printerW, SIZEOF(col_printer), col_printer, 0, 0, NULL, fill_printer }, { class_processW, SIZEOF(col_process), col_process, 0, 0, NULL, fill_process }, { class_processorW, SIZEOF(col_processor), col_processor, 0, 0, NULL, fill_processor }, { class_processor2W, SIZEOF(col_processor), col_processor, 0, 0, NULL, fill_processor }, @@ -2655,6 +2865,7 @@ { class_sounddeviceW, SIZEOF(col_sounddevice), col_sounddevice, SIZEOF(data_sounddevice), 0, (BYTE *)data_sounddevice }, { class_stdregprovW, SIZEOF(col_stdregprov), col_stdregprov, SIZEOF(data_stdregprov), 0, (BYTE *)data_stdregprov }, { class_systemsecurityW, SIZEOF(col_systemsecurity), col_systemsecurity, SIZEOF(data_systemsecurity), 0, (BYTE *)data_systemsecurity }, + { class_systemenclosureW, SIZEOF(col_systemenclosure), col_systemenclosure, SIZEOF(data_systemenclosure), 0, (BYTE *)data_systemenclosure }, { class_videocontrollerW, SIZEOF(col_videocontroller), col_videocontroller, 0, 0, NULL, fill_videocontroller } }; Modified: trunk/reactos/dll/win32/wbemprox/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/class.c…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/class.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/class.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -107,7 +107,11 @@ if (!uCount) return WBEM_S_FALSE; if (!apObjects || !puReturned) return WBEM_E_INVALID_PARAMETER; - if (lTimeout != WBEM_INFINITE) FIXME("timeout not supported\n"); + if (lTimeout != WBEM_INFINITE) + { + static int once; + if (!once++) FIXME("timeout not supported\n"); + } *puReturned = 0; if (ec->index >= view->count) return WBEM_S_FALSE; Modified: trunk/reactos/dll/win32/wbemprox/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/query.c…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/query.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/query.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -688,6 +688,7 @@ SafeArrayDestroy( ret ); return NULL; } + SysFreeString( str ); } else if (SafeArrayPutElement( ret, &i, ptr ) != S_OK) { @@ -990,6 +991,7 @@ SafeArrayDestroy( sa ); return E_OUTOFMEMORY; } + SysFreeString( str ); j++; } *props = sa; Modified: trunk/reactos/dll/win32/wbemprox/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/reg.c?r…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/reg.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -41,6 +41,12 @@ return S_OK; } +static void free_bstr_array( BSTR *strings, DWORD count ) +{ + while (count--) + SysFreeString( *(strings++) ); +} + static HRESULT to_i4_array( DWORD *values, DWORD count, VARIANT *var ) { SAFEARRAY *sa; @@ -104,7 +110,11 @@ } i++; } - if (hr == S_OK && !res) hr = to_bstr_array( strings, i, names ); + if (hr == S_OK && !res) + { + hr = to_bstr_array( strings, i, names ); + free_bstr_array( strings, i ); + } set_variant( VT_UI4, res, NULL, retval ); RegCloseKey( hkey ); heap_free( strings ); @@ -208,6 +218,7 @@ if (hr == S_OK && !res) { hr = to_bstr_array( value_names, i, names ); + free_bstr_array( value_names, i ); if (hr == S_OK) hr = to_i4_array( value_types, i, types ); } Modified: trunk/reactos/dll/win32/wbemprox/table.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/table.c…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/table.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/table.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -278,9 +278,14 @@ if (!(table->columns[i].type & COL_FLAG_DYNAMIC)) continue; type = table->columns[i].type & COL_TYPE_MASK; - if (type == CIM_STRING || type == CIM_DATETIME || (type & CIM_FLAG_ARRAY)) + if (type == CIM_STRING || type == CIM_DATETIME) { if (get_value( table, row, i, &val ) == S_OK) heap_free( (void *)(INT_PTR)val ); + } + else if (type & CIM_FLAG_ARRAY) + { + if (get_value( table, row, i, &val ) == S_OK) + destroy_array( (void *)(INT_PTR)val, type & CIM_TYPE_MASK ); } } } Modified: trunk/reactos/dll/win32/wbemprox/wbemlocator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wbemloc…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wbemlocator.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wbemlocator.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -75,10 +75,11 @@ static BOOL is_local_machine( const WCHAR *server ) { static const WCHAR dotW[] = {'.',0}; + static const WCHAR localhostW[] = {'l','o','c','a','l','h','o','s','t',0}; WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 1]; DWORD len = sizeof(buffer) / sizeof(buffer[0]); - if (!server || !strcmpW( server, dotW )) return TRUE; + if (!server || !strcmpW( server, dotW ) || !strcmpiW( server, localhostW )) return TRUE; if (GetComputerNameW( buffer, &len ) && !strcmpiW( server, buffer )) return TRUE; return FALSE; } Modified: trunk/reactos/dll/win32/wbemprox/wbemprox_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wbempro…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wbemprox_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wbemprox_private.h [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -45,8 +45,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); -IClientSecurity client_security; -struct list *table_list; +IClientSecurity client_security DECLSPEC_HIDDEN; +struct list *table_list DECLSPEC_HIDDEN; #define SIZEOF(array) (sizeof(array)/sizeof((array)[0])) Modified: trunk/reactos/dll/win32/wbemprox/wql.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wql.tab…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wql.tab.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wql.tab.c [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -2157,6 +2157,7 @@ { case ' ': case '\t': + case '\r': case '\n': for (i = 1; isspaceW( s[i] ); i++) {} *token = TK_SPACE; Modified: trunk/reactos/dll/win32/wbemprox/wql.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemprox/wql.y?r…
============================================================================== --- trunk/reactos/dll/win32/wbemprox/wql.y [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemprox/wql.y [iso-8859-1] Wed Jul 22 00:43:39 2015 @@ -583,6 +583,7 @@ { case ' ': case '\t': + case '\r': case '\n': for (i = 1; isspaceW( s[i] ); i++) {} *token = TK_SPACE; 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] Wed Jul 22 00:43:39 2015 @@ -201,7 +201,7 @@ reactos/dll/win32/vbscript # Synced to WineStaging-1.7.47 reactos/dll/win32/version # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.47 -reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.37 +reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.47 reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.37 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.7.37 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.7.47
9 years, 5 months
1
0
0
0
[akhaldi] 68540: [WBEMDISP] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:41:30 2015 New Revision: 68540 URL:
http://svn.reactos.org/svn/reactos?rev=68540&view=rev
Log: [WBEMDISP] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/wbemdisp/locator.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wbemdisp/locator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wbemdisp/locator…
============================================================================== --- trunk/reactos/dll/win32/wbemdisp/locator.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wbemdisp/locator.c [iso-8859-1] Wed Jul 22 00:41:30 2015 @@ -21,6 +21,7 @@ #include <wbemcli.h> static HRESULT EnumVARIANT_create( IEnumWbemClassObject *, IEnumVARIANT ** ); +static HRESULT ISWbemSecurity_create( ISWbemSecurity ** ); enum type_id { @@ -28,6 +29,7 @@ ISWbemObject_tid, ISWbemObjectSet_tid, ISWbemServices_tid, + ISWbemSecurity_tid, last_tid }; @@ -39,7 +41,8 @@ &IID_ISWbemLocator, &IID_ISWbemObject, &IID_ISWbemObjectSet, - &IID_ISWbemServices + &IID_ISWbemServices, + &IID_ISWbemSecurity }; static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret ) @@ -1130,8 +1133,12 @@ ISWbemServices *iface, ISWbemSecurity **objWbemSecurity ) { - FIXME( "\n" ); - return E_NOTIMPL; + TRACE( "%p, %p\n", iface, objWbemSecurity ); + + if (!objWbemSecurity) + return E_INVALIDARG; + + return ISWbemSecurity_create( objWbemSecurity ); } static const ISWbemServicesVtbl services_vtbl = @@ -1384,8 +1391,12 @@ ISWbemLocator *iface, ISWbemSecurity **objWbemSecurity ) { - FIXME( "%p, %p\n", iface, objWbemSecurity ); - return E_NOTIMPL; + TRACE( "%p, %p\n", iface, objWbemSecurity ); + + if (!objWbemSecurity) + return E_INVALIDARG; + + return ISWbemSecurity_create( objWbemSecurity ); } static const ISWbemLocatorVtbl locator_vtbl = @@ -1416,3 +1427,231 @@ TRACE( "returning iface %p\n", *obj ); return S_OK; } + +struct security +{ + ISWbemSecurity ISWbemSecurity_iface; + LONG refs; + WbemImpersonationLevelEnum implevel; + WbemAuthenticationLevelEnum authlevel; +}; + +static inline struct security *impl_from_ISWbemSecurity( ISWbemSecurity *iface ) +{ + return CONTAINING_RECORD( iface, struct security, ISWbemSecurity_iface ); +} + +static ULONG WINAPI security_AddRef( + ISWbemSecurity *iface ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + return InterlockedIncrement( &security->refs ); +} + +static ULONG WINAPI security_Release( + ISWbemSecurity *iface ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + LONG refs = InterlockedDecrement( &security->refs ); + if (!refs) + { + TRACE( "destroying %p\n", security ); + heap_free( security ); + } + return refs; +} + +static HRESULT WINAPI security_QueryInterface( + ISWbemSecurity *iface, + REFIID riid, + void **ppvObject ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + TRACE( "%p, %s, %p\n", security, debugstr_guid( riid ), ppvObject ); + + if (IsEqualGUID( riid, &IID_ISWbemSecurity ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown )) + { + *ppvObject = iface; + } + else + { + FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + return E_NOINTERFACE; + } + ISWbemSecurity_AddRef( iface ); + return S_OK; +} + +static HRESULT WINAPI security_GetTypeInfoCount( + ISWbemSecurity *iface, + UINT *count ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + TRACE( "%p, %p\n", security, count ); + + *count = 1; + return S_OK; +} + +static HRESULT WINAPI security_GetTypeInfo( + ISWbemSecurity *iface, + UINT index, + LCID lcid, + ITypeInfo **info ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + TRACE( "%p, %u, %u, %p\n", security, index, lcid, info ); + + return get_typeinfo( ISWbemSecurity_tid, info ); +} + +static HRESULT WINAPI security_GetIDsOfNames( + ISWbemSecurity *iface, + REFIID riid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispid ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE( "%p, %s, %p, %u, %u, %p\n", security, debugstr_guid(riid), names, count, lcid, dispid ); + + if (!names || !count || !dispid) return E_INVALIDARG; + + hr = get_typeinfo( ISWbemSecurity_tid, &typeinfo ); + if (SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames( typeinfo, names, count, dispid ); + ITypeInfo_Release( typeinfo ); + } + return hr; +} + +static HRESULT WINAPI security_Invoke( + ISWbemSecurity *iface, + DISPID member, + REFIID riid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excep_info, + UINT *arg_err ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", security, member, debugstr_guid(riid), + lcid, flags, params, result, excep_info, arg_err ); + + hr = get_typeinfo( ISWbemSecurity_tid, &typeinfo ); + if (SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke( typeinfo, &security->ISWbemSecurity_iface, member, flags, + params, result, excep_info, arg_err ); + ITypeInfo_Release( typeinfo ); + } + return hr; +} + +static HRESULT WINAPI security_get_ImpersonationLevel_( + ISWbemSecurity *iface, + WbemImpersonationLevelEnum *impersonation_level ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + FIXME( "%p, %p: stub\n", security, impersonation_level ); + + if (!impersonation_level) + return E_INVALIDARG; + + *impersonation_level = security->implevel; + return S_OK; +} + +static HRESULT WINAPI security_put_ImpersonationLevel_( + ISWbemSecurity *iface, + WbemImpersonationLevelEnum impersonation_level ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + FIXME( "%p, %d: stub\n", security, impersonation_level ); + + security->implevel = impersonation_level; + return S_OK; +} + +static HRESULT WINAPI security_get_AuthenticationLevel_( + ISWbemSecurity *iface, + WbemAuthenticationLevelEnum *authentication_level ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + FIXME( "%p, %p: stub\n", security, authentication_level ); + + if (!authentication_level) + return E_INVALIDARG; + + *authentication_level = security->authlevel; + return S_OK; +} + +static HRESULT WINAPI security_put_AuthenticationLevel_( + ISWbemSecurity *iface, + WbemAuthenticationLevelEnum authentication_level ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + FIXME( "%p, %d: stub\n", security, authentication_level ); + + security->authlevel = authentication_level; + return S_OK; +} + +static HRESULT WINAPI security_get_Privileges_( + ISWbemSecurity *iface, + ISWbemPrivilegeSet **privilege_set ) +{ + struct security *security = impl_from_ISWbemSecurity( iface ); + FIXME( "%p, %p: stub\n", security, privilege_set ); + + if (!privilege_set) + return E_INVALIDARG; + + return E_NOTIMPL; +} + +static const ISWbemSecurityVtbl security_vtbl = +{ + security_QueryInterface, + security_AddRef, + security_Release, + security_GetTypeInfoCount, + security_GetTypeInfo, + security_GetIDsOfNames, + security_Invoke, + security_get_ImpersonationLevel_, + security_put_ImpersonationLevel_, + security_get_AuthenticationLevel_, + security_put_AuthenticationLevel_, + security_get_Privileges_ +}; + +static HRESULT ISWbemSecurity_create( ISWbemSecurity **obj ) +{ + struct security *security; + + TRACE( "%p\n", obj ); + + if (!(security = heap_alloc( sizeof(*security) ))) return E_OUTOFMEMORY; + security->ISWbemSecurity_iface.lpVtbl = &security_vtbl; + security->refs = 1; + security->implevel = wbemImpersonationLevelAnonymous; + security->authlevel = wbemAuthenticationLevelDefault; + + *obj = &security->ISWbemSecurity_iface; + TRACE( "returning iface %p\n", *obj ); + return S_OK; +} 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] Wed Jul 22 00:41:30 2015 @@ -200,7 +200,7 @@ reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to WineStaging-1.7.47 reactos/dll/win32/version # Synced to WineStaging-1.7.47 -reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.37 +reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.37 reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.37 reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68539: [VERSION_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:40:49 2015 New Revision: 68539 URL:
http://svn.reactos.org/svn/reactos?rev=68539&view=rev
Log: [VERSION_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/version/info.c Modified: trunk/rostests/winetests/version/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/info.c?…
============================================================================== --- trunk/rostests/winetests/version/info.c [iso-8859-1] (original) +++ trunk/rostests/winetests/version/info.c [iso-8859-1] Wed Jul 22 00:40:49 2015 @@ -574,6 +574,132 @@ HeapFree(GetProcessHeap(), 0, ver); } +static void test_VerQueryValue_InvalidLength(void) +{ + /* this buffer is created with the reactos resource compiler from this resource: +#include "winver.h" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 63 +FILEFLAGS 0 +FILEOS VOS_UNKNOWN +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +{ + BLOCK "StringFileInfo" + { + } +} +*/ + char preparedbuffer[] = { + /* VS_VERSION_INFO_STRUCT32 */ + 0x80, 0x00, /* wLength */ + 0x34, 0x00, /* wValueLength */ + 0x00, 0x00, /* wType */ + /* L"VS_VERSION_INFO" + DWORD alignment */ + 0x56, 0x00, 0x53, 0x00, 0x5f, 0x00, 0x56, 0x00, 0x45, 0x00, 0x52, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4f, + 0x00, 0x4e, 0x00, 0x5f, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x46, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* VS_FIXEDFILEINFO */ + 0xbd, 0x04, 0xef, 0xfe, /* dwSignature */ + 0x00, 0x00, 0x01, 0x00, /* dwStrucVersion */ + 0x00, 0x00, 0x01, 0x00, /* dwFileVersionMS */ + 0x00, 0x00, 0x00, 0x00, /* dwFileVersionLS */ + 0x00, 0x00, 0x01, 0x00, /* dwProductVersionMS */ + 0x00, 0x00, 0x00, 0x00, /* dwProductVersionLS */ + 0x3f, 0x00, 0x00, 0x00, /* dwFileFlagsMask */ + 0x00, 0x00, 0x00, 0x00, /* dwFileFlags */ + 0x00, 0x00, 0x00, 0x00, /* dwFileOS */ + 0x01, 0x00, 0x00, 0x00, /* dwFileType */ + 0x00, 0x00, 0x00, 0x00, /* dwFileSubtype */ + 0x00, 0x00, 0x00, 0x00, /* dwFileDateMS */ + 0x00, 0x00, 0x00, 0x00, /* dwFileDateLS */ + + /* first child: */ + 0x24, 0x00, /* wLength */ + 0x00, 0x00, /* wValueLength */ + 0x01, 0x00, /* wType */ + /* L"StringFileInfo" + DWORD alignment */ + 0x53, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x46, 0x00, 0x69, 0x00, + 0x6c, 0x00, 0x65, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x00, 0x00, + /* "FE2X" */ + 0x46, 0x45, 0x32, 0x58, + + /* Extra bytes allocated for W->A conversions. */ + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, + }; + char *p; + UINT len, ret; + WCHAR FileDescriptionW[] = { '\\', '\\', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'l', 'e', 'I', 'n', 'f', 'o', 0 }; + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueA(preparedbuffer, "StringFileInfo", (LPVOID *)&p, &len); + ok(ret, "VerQueryValueA error %u\n", GetLastError()); + todo_wine + ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueA(preparedbuffer, "\\StringFileInfo", (LPVOID *)&p, &len); + ok(ret, "VerQueryValueA error %u\n", GetLastError()); + todo_wine + ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueA(preparedbuffer, "\\\\StringFileInfo", (LPVOID *)&p, &len); + ok(ret, "VerQueryValueA error %u\n", GetLastError()); + todo_wine + ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); + + /* also test the W versions. */ + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueW(preparedbuffer, FileDescriptionW + 2, (LPVOID *)&p, &len); + ok(ret, "VerQueryValueW error %u\n", GetLastError()); + ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueW(preparedbuffer, FileDescriptionW + 1, (LPVOID *)&p, &len); + ok(ret, "VerQueryValueW error %u\n", GetLastError()); + ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = VerQueryValueW(preparedbuffer, FileDescriptionW, (LPVOID *)&p, &len); + ok(ret, "VerQueryValueW error %u\n", GetLastError()); + ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len); + todo_wine + ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer + 0x7e); +} + static void test_extra_block(void) { WORD extra_block[] = { @@ -630,5 +756,6 @@ test_info(); test_32bit_win(); test_VerQueryValueA(); + test_VerQueryValue_InvalidLength(); test_extra_block(); }
9 years, 5 months
1
0
0
0
[akhaldi] 68538: [VERSION] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:40:38 2015 New Revision: 68538 URL:
http://svn.reactos.org/svn/reactos?rev=68538&view=rev
Log: [VERSION] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/version/version.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/version/version.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/version.…
============================================================================== --- trunk/reactos/dll/win32/version/version.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/version/version.c [iso-8859-1] Wed Jul 22 00:40:38 2015 @@ -607,11 +607,34 @@ */ DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle ) { + return GetFileVersionInfoSizeExW( 0, filename, handle ); +} + +/*********************************************************************** + * GetFileVersionInfoSizeA [VERSION.@] + */ +DWORD WINAPI GetFileVersionInfoSizeA( LPCSTR filename, LPDWORD handle ) +{ + return GetFileVersionInfoSizeExA( 0, filename, handle ); +} + +/****************************************************************************** + * GetFileVersionInfoSizeExW [VERSION.@] + */ +DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, LPCWSTR filename, LPDWORD handle ) +{ DWORD len, offset, magic = 1; HFILE lzfd; HMODULE hModule; OFSTRUCT ofs; + if (flags) + { + FIXME("stub: %x %s %p\n", flags, wine_dbgstr_w(filename), handle); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; + } + TRACE("(%s,%p)\n", debugstr_w(filename), handle ); if (handle) *handle = 0; @@ -636,7 +659,7 @@ if ((magic == 1) && (hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_DATAFILE ))) { HRSRC hRsrc = FindResourceW( hModule, MAKEINTRESOURCEW(VS_VERSION_INFO), - MAKEINTRESOURCEW(VS_FILE_INFO) ); + (LPWSTR)VS_FILE_INFO ); if (hRsrc) { magic = IMAGE_NT_SIGNATURE; @@ -676,10 +699,10 @@ } } -/*********************************************************************** - * GetFileVersionInfoSizeA [VERSION.@] - */ -DWORD WINAPI GetFileVersionInfoSizeA( LPCSTR filename, LPDWORD handle ) +/****************************************************************************** + * GetFileVersionInfoSizeExA [VERSION.@] + */ +DWORD WINAPI GetFileVersionInfoSizeExA( DWORD flags, LPCSTR filename, LPDWORD handle ) { UNICODE_STRING filenameW; DWORD retval; @@ -691,7 +714,7 @@ else filenameW.Buffer = NULL; - retval = GetFileVersionInfoSizeW(filenameW.Buffer, handle); + retval = GetFileVersionInfoSizeExW(0, filenameW.Buffer, handle); RtlFreeUnicodeString(&filenameW); @@ -699,10 +722,9 @@ } /*********************************************************************** - * GetFileVersionInfoW [VERSION.@] - */ -BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle, - DWORD datasize, LPVOID data ) + * GetFileVersionInfoExW [VERSION.@] + */ +BOOL WINAPI GetFileVersionInfoExW( DWORD flags, LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data ) { static const char signature[4] = "FE2X"; DWORD len, offset, magic = 1; @@ -711,6 +733,13 @@ HMODULE hModule; VS_VERSION_INFO_STRUCT32* vvis = data; + if (flags) + { + FIXME("stub: %x %s %u %u %p\n", flags, wine_dbgstr_w(filename), handle, datasize, data); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; + } + TRACE("(%s,%d,size=%d,data=%p)\n", debugstr_w(filename), handle, datasize, data ); @@ -733,7 +762,7 @@ if ((magic == 1) && (hModule = LoadLibraryExW( filename, 0, LOAD_LIBRARY_AS_DATAFILE ))) { HRSRC hRsrc = FindResourceW( hModule, MAKEINTRESOURCEW(VS_VERSION_INFO), - MAKEINTRESOURCEW(VS_FILE_INFO) ); + (LPWSTR)VS_FILE_INFO ); if (hRsrc) { HGLOBAL hMem = LoadResource( hModule, hRsrc ); @@ -774,10 +803,9 @@ } /*********************************************************************** - * GetFileVersionInfoA [VERSION.@] - */ -BOOL WINAPI GetFileVersionInfoA( LPCSTR filename, DWORD handle, - DWORD datasize, LPVOID data ) + * GetFileVersionInfoExA [VERSION.@] + */ +BOOL WINAPI GetFileVersionInfoExA( DWORD flags, LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data ) { UNICODE_STRING filenameW; BOOL retval; @@ -790,11 +818,27 @@ else filenameW.Buffer = NULL; - retval = GetFileVersionInfoW(filenameW.Buffer, handle, datasize, data); + retval = GetFileVersionInfoExW(flags, filenameW.Buffer, handle, datasize, data); RtlFreeUnicodeString(&filenameW); return retval; +} + +/*********************************************************************** + * GetFileVersionInfoW [VERSION.@] + */ +BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data ) +{ + return GetFileVersionInfoExW(0, filename, handle, datasize, data); +} + +/*********************************************************************** + * GetFileVersionInfoA [VERSION.@] + */ +BOOL WINAPI GetFileVersionInfoA( LPCSTR filename, DWORD handle, DWORD datasize, LPVOID data ) +{ + return GetFileVersionInfoExA(0, filename, handle, datasize, data); } /*********************************************************************** @@ -1613,40 +1657,3 @@ HeapFree( GetProcessHeap(), 0, wcurd ); return ret; } - -/****************************************************************************** - * GetFileVersionInfoSizeExA [VERSION.@] - */ -DWORD WINAPI GetFileVersionInfoSizeExA(DWORD flags, LPCSTR filename, LPDWORD handle) -{ - FIXME("semi-stub: %u %s %p\n", flags, wine_dbgstr_a(filename), handle); - return GetFileVersionInfoSizeA(filename, handle); - -} - -/****************************************************************************** - * GetFileVersionInfoSizeExW [VERSION.@] - */ -DWORD WINAPI GetFileVersionInfoSizeExW(DWORD flags, LPCWSTR filename, LPDWORD handle) -{ - FIXME("semi-stub: %u %s %p\n", flags, wine_dbgstr_w(filename), handle); - return GetFileVersionInfoSizeW(filename, handle); -} - -/****************************************************************************** - * GetFileVersionInfoExA [VERSION.@] - */ -BOOL WINAPI GetFileVersionInfoExA(DWORD flags, LPCSTR filename, DWORD handle, DWORD len, LPVOID data) -{ - FIXME("semi-stub: %u %s %u %u %p\n", flags, wine_dbgstr_a(filename), handle, len, data); - return GetFileVersionInfoA(filename, handle, len, data); -} - -/****************************************************************************** - * GetFileVersionInfoExW [VERSION.@] - */ -BOOL WINAPI GetFileVersionInfoExW(DWORD flags, LPCWSTR filename, DWORD handle, DWORD len, LPVOID data) -{ - FIXME("semi-stub: %u %s %u %u %p\n", flags, wine_dbgstr_w(filename), handle, len, data); - return GetFileVersionInfoW(filename, handle, len, data); -} 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] Wed Jul 22 00:40:38 2015 @@ -199,7 +199,7 @@ reactos/dll/win32/usp10 # Synced to WineStaging-1.7.47 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to WineStaging-1.7.47 -reactos/dll/win32/version # Synced to WineStaging-1.7.37 +reactos/dll/win32/version # Synced to WineStaging-1.7.47 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.37 reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.37 reactos/dll/win32/windowscodecs # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68537: [VBSCRIPT_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:40:02 2015 New Revision: 68537 URL:
http://svn.reactos.org/svn/reactos?rev=68537&view=rev
Log: [VBSCRIPT_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/vbscript/api.vbs trunk/rostests/winetests/vbscript/regexp.vbs trunk/rostests/winetests/vbscript/run.c Modified: trunk/rostests/winetests/vbscript/api.vbs URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/api.vb…
============================================================================== --- trunk/rostests/winetests/vbscript/api.vbs [iso-8859-1] (original) +++ trunk/rostests/winetests/vbscript/api.vbs [iso-8859-1] Wed Jul 22 00:40:02 2015 @@ -233,9 +233,60 @@ TestHex -16, "FFF0" TestHex -934859845, "C8472BBB" TestHex empty, "0" +TestHex "17", "11" +TestHex 228.5, "E4" +TestHex -32767, "8001" +TestHex -32768, "FFFF8000" +TestHex 2147483647.49, "7FFFFFFF" +TestHex -2147483647.5, "80000000" +newObject.myval = 30.5 +TestHex newObject, "1E" +newObject.myval = "27" +TestHex newObject, "1B" + Call ok(getVT(hex(null)) = "VT_NULL", "getVT(hex(null)) = " & getVT(hex(null))) Call ok(getVT(hex(empty)) = "VT_BSTR", "getVT(hex(empty)) = " & getVT(hex(empty))) + +Sub TestHexError(num, err_num) + On Error Resume Next + Call Hex(num) + Call ok(Err.number = err_num, "Hex(" & num & ") returns error number " & Err.number & " expected " & err_num) +End Sub + +TestHexError 2147483647.5, 6 +TestHexError 2147483648.51, 6 +TestHexError "test", 13 + +Sub TestOct(x, ex, res_type) + Call ok(Oct(x) = ex, "Oct(" & x & ") = " & Oct(x) & " expected " & ex) + Call ok(getVT(Oct(x)) = res_type, "getVT(Oct(" &x & ")) = " & getVT(Oct(x)) & "expected " & res_type) +End Sub + +Sub TestOctError(num, err_num) + On error resume next + Call Oct(num) + Call ok(Err.number = err_num, "Oct(" & num & ") error number is " & Err.number & " expected " & err_num) +End Sub + +TestOct empty, "0", "VT_BSTR" +TestOct 0, "0", "VT_BSTR" +TestOct 9, "11", "VT_BSTR" +TestOct "9", "11", "VT_BSTR" +TestOct 8.5, "10", "VT_BSTR" +TestOct 9.5, "12", "VT_BSTR" +TestOct -1, "177777", "VT_BSTR" +TestOct -32767, "100001", "VT_BSTR" +TestOct -32768, "37777700000", "VT_BSTR" +TestOct 2147483647.49, "17777777777", "VT_BSTR" +TestOct -2147483648.5, "20000000000", "VT_BSTR" +Call ok(getVT(Oct(null)) = "VT_NULL", "getVT(Oct(null)) = " & getVT(Oct(null))) +newObject.myval = 5 +TestOct newObject, "5", "VT_BSTR" + +TestOctError 2147483647.5, 6 +TestOctError -2147483648.51, 6 +TestOctError "test", 13 x = InStr(1, "abcd", "bc") Call ok(x = 2, "InStr returned " & x) Modified: trunk/rostests/winetests/vbscript/regexp.vbs URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/regexp…
============================================================================== --- trunk/rostests/winetests/vbscript/regexp.vbs [iso-8859-1] (original) +++ trunk/rostests/winetests/vbscript/regexp.vbs [iso-8859-1] Wed Jul 22 00:40:02 2015 @@ -174,4 +174,21 @@ Call ok(x.Global = false, "RegExp.Global = " & x.Global) Call ok(x.Multiline = false, "RegExp.Multiline = " & x.Multiline) +set matches = x.execute("test") +Call ok(matches.Count = 1, "matches.Count = " & matches.Count) +x.pattern = "" +set matches = x.execute("test") +Call ok(matches.Count = 1, "matches.Count = " & matches.Count) +set match = matches.item(0) +Call ok(match.Value = "", "match.Value = " & match.Value) +x.global = true +set matches = x.execute("test") +Call ok(matches.Count = 5, "matches.Count = " & matches.Count) +set match = matches.item(0) +Call ok(match.Value = "", "match.Value = " & match.Value) +set match = matches.item(4) +Call ok(match.Value = "", "match.Value = " & match.Value) +matches = x.test("test") +Call ok(matches = true, "matches = " & matches) + Call reportSuccess() Modified: trunk/rostests/winetests/vbscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/run.c?…
============================================================================== --- trunk/rostests/winetests/vbscript/run.c [iso-8859-1] (original) +++ trunk/rostests/winetests/vbscript/run.c [iso-8859-1] Wed Jul 22 00:40:02 2015 @@ -90,6 +90,8 @@ DEFINE_EXPECT(global_success_i); DEFINE_EXPECT(global_vbvar_d); DEFINE_EXPECT(global_vbvar_i); +DEFINE_EXPECT(global_letobj_i); +DEFINE_EXPECT(global_setobj_i); DEFINE_EXPECT(testobj_propget_d); DEFINE_EXPECT(testobj_propget_i); DEFINE_EXPECT(testobj_propput_d); @@ -124,6 +126,8 @@ #define DISPID_GLOBAL_TESTARRAY 1015 #define DISPID_GLOBAL_THROWINT 1016 #define DISPID_GLOBAL_TESTOPTIONALARG 1017 +#define DISPID_GLOBAL_LETOBJ 1018 +#define DISPID_GLOBAL_SETOBJ 1019 #define DISPID_TESTOBJ_PROPGET 2000 #define DISPID_TESTOBJ_PROPPUT 2001 @@ -140,6 +144,7 @@ static const char *test_name = "(null)"; static int test_counter; static SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_NOUIERROR; +static IDispatchEx testObj; static BSTR a2bstr(const char *str) { @@ -340,9 +345,60 @@ ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres); ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v)); + SET_EXPECT(testobj_value_i); + V_VT(args) = VT_DISPATCH; + V_DISPATCH(args) = (IDispatch*)&testObj; + dp.cArgs = dp.cNamedArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + CHECK_CALLED(testobj_value_i); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I2(&v) == 0, "V_I2(v) = %d\n", V_I2(&v)); + + V_VT(args) = VT_DISPATCH; + V_DISPATCH(args) = (IDispatch*)&testObj; + dp.cArgs = dp.cNamedArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + + V_VT(args) = VT_DISPATCH; + V_DISPATCH(args) = (IDispatch*)&testObj; + dp.cArgs = dp.cNamedArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_DISPATCH(&v) == (IDispatch*)&testObj, "V_DISPATCH(v) != testObj\n"); + + V_VT(args) = VT_BOOL; + V_BOOL(args) = VARIANT_TRUE; + dp.cArgs = dp.cNamedArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + + dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v)); + + V_VT(args) = VT_BOOL; + V_BOOL(args) = VARIANT_FALSE; + dp.cArgs = dp.cNamedArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL); + ok(hres == DISP_E_EXCEPTION, "InvokeEx failed: %08x, expected DISP_E_EXCEPTION\n", hres); + V_VT(args) = VT_BOOL; V_BOOL(args) = VARIANT_FALSE; dp.cArgs = 1; + dp.cNamedArgs = 0; V_VT(&v) = VT_BOOL; hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL); ok(hres == DISP_E_PARAMNOTOPTIONAL, "InvokeEx failed: %08x, expected DISP_E_PARAMNOTOPTIONAL\n", hres); @@ -969,6 +1025,16 @@ *pid = DISPID_GLOBAL_VBVAR; return S_OK; } + if(!strcmp_wa(bstrName, "letobj")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_LETOBJ; + return S_OK; + } + if(!strcmp_wa(bstrName, "setobj")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_SETOBJ; + return S_OK; + } if(!strcmp_wa(bstrName, "isNullDisp")) { test_grfdex(grfdex, fdexNameCaseInsensitive); *pid = DISPID_GLOBAL_ISNULLDISP; @@ -1129,6 +1195,40 @@ ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); ok(V_I2(pdp->rgvarg) == 3, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg)); + return S_OK; + + case DISPID_GLOBAL_LETOBJ: + CHECK_EXPECT(global_letobj_i); + + ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n"); + return S_OK; + + case DISPID_GLOBAL_SETOBJ: + CHECK_EXPECT(global_setobj_i); + + ok(wFlags == DISPATCH_PROPERTYPUTREF, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n"); return S_OK; case DISPID_GLOBAL_TESTOBJ: @@ -2034,6 +2134,22 @@ CHECK_CALLED(global_vbvar_d); CHECK_CALLED(global_vbvar_i); + SET_EXPECT(global_letobj_i); + parse_script_a("Option Explicit\nletobj = testObj"); + CHECK_CALLED(global_letobj_i); + + SET_EXPECT(global_letobj_i); + parse_script_a("Option Explicit\ntest.letobj = testObj"); + CHECK_CALLED(global_letobj_i); + + SET_EXPECT(global_setobj_i); + parse_script_a("Option Explicit\nset setobj = testObj"); + CHECK_CALLED(global_setobj_i); + + SET_EXPECT(global_setobj_i); + parse_script_a("Option Explicit\nset test.setobj = testObj"); + CHECK_CALLED(global_setobj_i); + SET_EXPECT(testobj_propget_d); SET_EXPECT(testobj_propget_i); parse_script_a("dim x\nx = testObj.propget");
9 years, 5 months
1
0
0
0
[akhaldi] 68536: [VBSCRIPT] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:39:49 2015 New Revision: 68536 URL:
http://svn.reactos.org/svn/reactos?rev=68536&view=rev
Log: [VBSCRIPT] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/reactos/dll/win32/vbscript/global.c trunk/reactos/dll/win32/vbscript/interp.c trunk/reactos/dll/win32/vbscript/vbdisp.c trunk/reactos/dll/win32/vbscript/vbregexp.c trunk/reactos/dll/win32/vbscript/vbscript.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/vbscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/global.…
============================================================================== --- trunk/reactos/dll/win32/vbscript/global.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/global.c [iso-8859-1] Wed Jul 22 00:39:49 2015 @@ -539,26 +539,25 @@ { WCHAR buf[17], *ptr; DWORD n; + HRESULT hres; + int ret; TRACE("%s\n", debugstr_variant(arg)); switch(V_VT(arg)) { case VT_I2: n = (WORD)V_I2(arg); - break; - case VT_I4: - n = V_I4(arg); - break; - case VT_EMPTY: - n = 0; break; case VT_NULL: if(res) V_VT(res) = VT_NULL; return S_OK; default: - FIXME("unsupported type %s\n", debugstr_variant(arg)); - return E_NOTIMPL; + hres = to_int(arg, &ret); + if(FAILED(hres)) + return hres; + else + n = ret; } buf[16] = 0; @@ -579,8 +578,43 @@ static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + HRESULT hres; + WCHAR buf[23], *ptr; + DWORD n; + int ret; + + TRACE("%s\n", debugstr_variant(arg)); + + switch(V_VT(arg)) { + case VT_I2: + n = (WORD)V_I2(arg); + break; + case VT_NULL: + if(res) + V_VT(res) = VT_NULL; + return S_OK; + default: + hres = to_int(arg, &ret); + if(FAILED(hres)) + return hres; + else + n = ret; + } + + buf[22] = 0; + ptr = buf + 21; + + if(n) { + do { + *ptr-- = '0' + (n & 0x7); + n >>= 3; + }while(n); + ptr++; + }else { + *ptr = '0'; + } + + return return_string(res, ptr); } static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1298,7 +1332,7 @@ buf[len++] = c>>8; if(!len || IsDBCSLeadByteEx(cp, buf[0])) buf[len++] = c; - if(!MultiByteToWideChar(0, 0, buf, len, &ch, 1)) { + if(!MultiByteToWideChar(CP_ACP, 0, buf, len, &ch, 1)) { WARN("invalid arg %d, cp %d\n", c, cp); return E_FAIL; } @@ -1788,7 +1822,7 @@ assert(2 <= args_cnt && args_cnt <= 4); - if(V_VT(args) == VT_NULL || V_VT(args+1) == VT_NULL || V_VT(args+2) == VT_NULL) + if(V_VT(args) == VT_NULL || V_VT(args+1) == VT_NULL || (args_cnt > 2 && V_VT(args+2) == VT_NULL)) return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); hres = to_string(args, &str1); Modified: trunk/reactos/dll/win32/vbscript/interp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/interp.…
============================================================================== --- trunk/reactos/dll/win32/vbscript/interp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/interp.c [iso-8859-1] Wed Jul 22 00:39:49 2015 @@ -214,13 +214,12 @@ } static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, - BOOL is_const, VARIANT *val, BOOL own_val, VARIANT **out_var) + BOOL is_const, VARIANT **out_var) { dynamic_var_t *new_var; heap_pool_t *heap; WCHAR *str; unsigned size; - HRESULT hres; heap = ctx->func->type == FUNC_GLOBAL ? &ctx->script->heap : &ctx->heap; @@ -235,15 +234,7 @@ memcpy(str, name, size); new_var->name = str; new_var->is_const = is_const; - - if(own_val) { - new_var->v = *val; - }else { - V_VT(&new_var->v) = VT_EMPTY; - hres = VariantCopy(&new_var->v, val); - if(FAILED(hres)) - return hres; - } + V_VT(&new_var->v) = VT_EMPTY; if(ctx->func->type == FUNC_GLOBAL) { new_var->next = ctx->script->global_vars; @@ -253,9 +244,7 @@ ctx->dynamic_vars = new_var; } - if(out_var) - *out_var = &new_var->v; - + *out_var = &new_var->v; return S_OK; } @@ -328,10 +317,9 @@ stack_pop_deref(ctx, r); if(V_VT(r->v) == VT_DISPATCH) { - DISPPARAMS dp = {0}; HRESULT hres; - hres = disp_call(ctx->script, V_DISPATCH(r->v), DISPID_VALUE, &dp, &r->store); + hres = get_disp_value(ctx->script, V_DISPATCH(r->v), &r->store); if(r->owned) IDispatch_Release(V_DISPATCH(r->v)); if(FAILED(hres)) @@ -359,12 +347,10 @@ } if(V_VT(v) == VT_DISPATCH) { - DISPPARAMS dp = {0}; IDispatch *disp; disp = V_DISPATCH(v); - V_VT(v) = VT_EMPTY; - hres = disp_call(ctx->script, disp, DISPID_VALUE, &dp, v); + hres = get_disp_value(ctx->script, disp, v); IDispatch_Release(disp); if(FAILED(hres)) return hres; @@ -614,9 +600,8 @@ break; case REF_NONE: if(res && !ctx->func->code_ctx->option_explicit && arg_cnt == 0) { - VARIANT v, *new; - VariantInit(&v); - hres = add_dynamic_var(ctx, identifier, FALSE, &v, FALSE, &new); + VARIANT *new; + hres = add_dynamic_var(ctx, identifier, FALSE, &new); if(FAILED(hres)) return hres; V_VT(res) = VT_BYREF|VT_VARIANT; @@ -703,7 +688,29 @@ return do_mcall(ctx, NULL); } -static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, DISPPARAMS *dp) +static HRESULT assign_value(exec_ctx_t *ctx, VARIANT *dst, VARIANT *src, WORD flags) +{ + HRESULT hres; + + hres = VariantCopyInd(dst, src); + if(FAILED(hres)) + return hres; + + if(V_VT(dst) == VT_DISPATCH && !(flags & DISPATCH_PROPERTYPUTREF)) { + VARIANT value; + + hres = get_disp_value(ctx->script, V_DISPATCH(dst), &value); + IDispatch_Release(V_DISPATCH(dst)); + if(FAILED(hres)) + return hres; + + *dst = value; + } + + return S_OK; +} + +static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, WORD flags, DISPPARAMS *dp) { ref_t ref; HRESULT hres; @@ -752,11 +759,11 @@ return E_NOTIMPL; } - hres = VariantCopyInd(v, dp->rgvarg); + hres = assign_value(ctx, v, dp->rgvarg, flags); break; } case REF_DISP: - hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, dp); + hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, flags, dp); break; case REF_FUNC: FIXME("functions not implemented\n"); @@ -772,13 +779,17 @@ FIXME("throw exception\n"); hres = E_FAIL; }else { + VARIANT *new_var; + if(arg_cnt(dp)) { FIXME("arg_cnt %d not supported\n", arg_cnt(dp)); return E_NOTIMPL; } TRACE("creating variable %s\n", debugstr_w(name)); - hres = add_dynamic_var(ctx, name, FALSE, dp->rgvarg, FALSE, NULL); + hres = add_dynamic_var(ctx, name, FALSE, &new_var); + if(SUCCEEDED(hres)) + hres = assign_value(ctx, new_var, dp->rgvarg, flags); } } @@ -794,12 +805,8 @@ TRACE("%s\n", debugstr_w(arg)); - hres = stack_assume_val(ctx, arg_cnt); - if(FAILED(hres)) - return hres; - vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = assign_ident(ctx, arg, &dp); + hres = assign_ident(ctx, arg, DISPATCH_PROPERTYPUT, &dp); if(FAILED(hres)) return hres; @@ -826,7 +833,7 @@ return hres; vbstack_to_dp(ctx, 0, TRUE, &dp); - hres = assign_ident(ctx, ctx->instr->arg1.bstr, &dp); + hres = assign_ident(ctx, ctx->instr->arg1.bstr, DISPATCH_PROPERTYPUTREF, &dp); if(FAILED(hres)) return hres; @@ -854,14 +861,10 @@ return E_FAIL; } - hres = stack_assume_val(ctx, arg_cnt); - if(FAILED(hres)) - return hres; - hres = disp_get_id(obj, identifier, VBDISP_LET, FALSE, &id); if(SUCCEEDED(hres)) { vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = disp_propput(ctx->script, obj, id, &dp); + hres = disp_propput(ctx->script, obj, id, DISPATCH_PROPERTYPUT, &dp); } if(FAILED(hres)) return hres; @@ -902,7 +905,7 @@ hres = disp_get_id(obj, identifier, VBDISP_SET, FALSE, &id); if(SUCCEEDED(hres)) { vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = disp_propput(ctx->script, obj, id, &dp); + hres = disp_propput(ctx->script, obj, id, DISPATCH_PROPERTYPUTREF, &dp); } if(FAILED(hres)) return hres; @@ -914,7 +917,7 @@ static HRESULT interp_const(exec_ctx_t *ctx) { BSTR arg = ctx->instr->arg1.bstr; - variant_val_t val; + VARIANT *v; ref_t ref; HRESULT hres; @@ -931,11 +934,16 @@ return E_FAIL; } - hres = stack_pop_val(ctx, &val); - if(FAILED(hres)) - return hres; - - return add_dynamic_var(ctx, arg, TRUE, val.v, val.owned, NULL); + hres = stack_assume_val(ctx, 0); + if(FAILED(hres)) + return hres; + + hres = add_dynamic_var(ctx, arg, TRUE, &v); + if(FAILED(hres)) + return hres; + + *v = *stack_pop(ctx); + return S_OK; } static HRESULT interp_val(exec_ctx_t *ctx) @@ -1170,7 +1178,7 @@ return hres; do_continue = hres == S_OK; - hres = assign_ident(ctx, ident, &dp); + hres = assign_ident(ctx, ident, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp); VariantClear(&v); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/vbscript/vbdisp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/vbdisp.…
============================================================================== --- trunk/reactos/dll/win32/vbscript/vbdisp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/vbdisp.c [iso-8859-1] Wed Jul 22 00:39:49 2015 @@ -79,19 +79,43 @@ return DISP_E_UNKNOWNNAME; } -static VARIANT *get_propput_arg(const DISPPARAMS *dp) +static HRESULT get_propput_arg(script_ctx_t *ctx, const DISPPARAMS *dp, WORD flags, VARIANT *v, BOOL *is_owned) { unsigned i; for(i=0; i < dp->cNamedArgs; i++) { if(dp->rgdispidNamedArgs[i] == DISPID_PROPERTYPUT) - return dp->rgvarg+i; - } - - return NULL; -} - -static HRESULT invoke_variant_prop(VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res) + break; + } + if(i == dp->cNamedArgs) { + WARN("no value to set\n"); + return DISP_E_PARAMNOTOPTIONAL; + } + + *v = dp->rgvarg[i]; + if(V_VT(v) == (VT_VARIANT|VT_BYREF)) + *v = *V_VARIANTREF(v); + *is_owned = FALSE; + + if(V_VT(v) == VT_DISPATCH) { + if(!(flags & DISPATCH_PROPERTYPUTREF)) { + HRESULT hres; + + hres = get_disp_value(ctx, V_DISPATCH(v), v); + if(FAILED(hres)) + return hres; + + *is_owned = TRUE; + } + }else if(!(flags & DISPATCH_PROPERTYPUT)) { + WARN("%s can't be assigned without DISPATCH_PROPERTYPUT flag\n", debugstr_variant(v)); + return DISP_E_EXCEPTION; + } + + return S_OK; +} + +static HRESULT invoke_variant_prop(script_ctx_t *ctx, VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res) { HRESULT hres; @@ -106,14 +130,15 @@ hres = VariantCopyInd(res, v); break; - case DISPATCH_PROPERTYPUT: { - VARIANT *put_val; - - put_val = get_propput_arg(dp); - if(!put_val) { - WARN("no value to set\n"); - return DISP_E_PARAMNOTOPTIONAL; - } + case DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF: { + VARIANT put_val; + BOOL own_val; + + hres = get_propput_arg(ctx, dp, flags, &put_val, &own_val); + if(FAILED(hres)) + return hres; if(arg_cnt(dp)) { FIXME("Arguments not supported\n"); @@ -123,7 +148,10 @@ if(res) V_VT(res) = VT_EMPTY; - hres = VariantCopyInd(v, put_val); + if(own_val) + *v = put_val; + else + hres = VariantCopyInd(v, &put_val); break; } @@ -403,29 +431,34 @@ } return exec_script(This->desc->ctx, func, This, pdp, pvarRes); - case DISPATCH_PROPERTYPUT: { - VARIANT *put_val; + case DISPATCH_PROPERTYPUT: + case DISPATCH_PROPERTYPUTREF: + case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF: { DISPPARAMS dp = {NULL, NULL, 1, 0}; + BOOL needs_release; + VARIANT put_val; + HRESULT hres; if(arg_cnt(pdp)) { FIXME("arguments not implemented\n"); return E_NOTIMPL; } - put_val = get_propput_arg(pdp); - if(!put_val) { - WARN("no value to set\n"); - return DISP_E_PARAMNOTOPTIONAL; - } - - dp.rgvarg = put_val; - func = This->desc->funcs[id].entries[V_VT(put_val) == VT_DISPATCH ? VBDISP_SET : VBDISP_LET]; + hres = get_propput_arg(This->desc->ctx, pdp, wFlags, &put_val, &needs_release); + if(FAILED(hres)) + return hres; + + dp.rgvarg = &put_val; + func = This->desc->funcs[id].entries[V_VT(&put_val) == VT_DISPATCH ? VBDISP_SET : VBDISP_LET]; if(!func) { FIXME("no letter/setter\n"); return DISP_E_MEMBERNOTFOUND; } - return exec_script(This->desc->ctx, func, This, &dp, NULL); + hres = exec_script(This->desc->ctx, func, This, &dp, NULL); + if(needs_release) + VariantClear(&put_val); + return hres; } default: FIXME("flags %x\n", wFlags); @@ -434,7 +467,7 @@ } if(id < This->desc->prop_cnt + This->desc->func_cnt) - return invoke_variant_prop(This->props+(id-This->desc->func_cnt), wFlags, pdp, pvarRes); + return invoke_variant_prop(This->desc->ctx, This->props+(id-This->desc->func_cnt), wFlags, pdp, pvarRes); if(This->desc->builtin_prop_cnt) { unsigned min = 0, max = This->desc->builtin_prop_cnt-1, i; @@ -839,7 +872,7 @@ return E_NOTIMPL; } - return invoke_variant_prop(&ident->u.var->v, wFlags, pdp, pvarRes); + return invoke_variant_prop(This->ctx, &ident->u.var->v, wFlags, pdp, pvarRes); } switch(wFlags) { @@ -1060,7 +1093,13 @@ return hres; } -HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp) +HRESULT get_disp_value(script_ctx_t *ctx, IDispatch *disp, VARIANT *v) +{ + DISPPARAMS dp = {NULL}; + return disp_call(ctx, disp, DISPID_VALUE, &dp, v); +} + +HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *dp) { IDispatchEx *dispex; EXCEPINFO ei = {0}; @@ -1068,13 +1107,13 @@ hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); if(SUCCEEDED(hres)) { - hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, NULL /* FIXME! */); + hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, NULL, &ei, NULL /* FIXME! */); IDispatchEx_Release(dispex); }else { ULONG err = 0; TRACE("using IDispatch\n"); - hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, &err); + hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, NULL, &ei, &err); } return hres; Modified: trunk/reactos/dll/win32/vbscript/vbregexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/vbregex…
============================================================================== --- trunk/reactos/dll/win32/vbscript/vbregexp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/vbregexp.c [iso-8859-1] Wed Jul 22 00:39:49 2015 @@ -1186,29 +1186,23 @@ static HRESULT WINAPI RegExp2_put_Pattern(IRegExp2 *iface, BSTR pattern) { RegExp2 *This = impl_from_IRegExp2(iface); - WCHAR *p; - DWORD size; + WCHAR *new_pattern; TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(pattern)); - if(!pattern) { - heap_free(This->pattern); - if(This->regexp) { - regexp_destroy(This->regexp); - This->regexp = NULL; - } - This->pattern = NULL; - return S_OK; - } - - size = (SysStringLen(pattern)+1) * sizeof(WCHAR); - p = heap_alloc(size); - if(!p) - return E_OUTOFMEMORY; + if(pattern && *pattern) { + SIZE_T size = (SysStringLen(pattern)+1) * sizeof(WCHAR); + new_pattern = heap_alloc(size); + if(!new_pattern) + return E_OUTOFMEMORY; + memcpy(new_pattern, pattern, size); + }else { + new_pattern = NULL; + } heap_free(This->pattern); - This->pattern = p; - memcpy(p, pattern, size); + This->pattern = new_pattern; + if(This->regexp) { regexp_destroy(This->regexp); This->regexp = NULL; Modified: trunk/reactos/dll/win32/vbscript/vbscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/vbscript/vbscrip…
============================================================================== --- trunk/reactos/dll/win32/vbscript/vbscript.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/vbscript/vbscript.h [iso-8859-1] Wed Jul 22 00:39:49 2015 @@ -159,7 +159,8 @@ HRESULT disp_get_id(IDispatch*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN; HRESULT vbdisp_get_id(vbdisp_t*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN; HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN; -HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN; +HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,WORD,DISPPARAMS*) DECLSPEC_HIDDEN; +HRESULT get_disp_value(script_ctx_t*,IDispatch*,VARIANT*) DECLSPEC_HIDDEN; void collect_objects(script_ctx_t*) DECLSPEC_HIDDEN; HRESULT create_procedure_disp(script_ctx_t*,vbscode_t*,IDispatch**) DECLSPEC_HIDDEN; HRESULT create_script_disp(script_ctx_t*,ScriptDisp**) DECLSPEC_HIDDEN; 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] Wed Jul 22 00:39:49 2015 @@ -198,7 +198,7 @@ reactos/dll/win32/urlmon # Synced to WineStaging-1.7.47 reactos/dll/win32/usp10 # Synced to WineStaging-1.7.47 reactos/dll/win32/uxtheme # Forked -reactos/dll/win32/vbscript # Synced to WineStaging-1.7.37 +reactos/dll/win32/vbscript # Synced to WineStaging-1.7.47 reactos/dll/win32/version # Synced to WineStaging-1.7.37 reactos/dll/win32/wbemdisp # Synced to WineStaging-1.7.37 reactos/dll/win32/wbemprox # Synced to WineStaging-1.7.37
9 years, 5 months
1
0
0
0
[akhaldi] 68535: [USP10_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 22 00:38:30 2015 New Revision: 68535 URL:
http://svn.reactos.org/svn/reactos?rev=68535&view=rev
Log: [USP10_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924 Modified: trunk/rostests/winetests/usp10/usp10.c Modified: trunk/rostests/winetests/usp10/usp10.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/usp10/usp10.c?r…
============================================================================== --- trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] (original) +++ trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] Wed Jul 22 00:38:30 2015 @@ -759,7 +759,7 @@ else if (hr != S_OK) winetest_trace("ScriptShapeOpenType failed (%x)\n",hr); if (FAILED(hr)) - return; + goto cleanup; for (x = 0; x < cchString; x++) { @@ -811,6 +811,7 @@ winetest_trace("%i: fZeroWidth incorrect (%i)\n",x,glyphProp[x].sva.fZeroWidth); } +cleanup: HeapFree(GetProcessHeap(),0,logclust); HeapFree(GetProcessHeap(),0,charProp); HeapFree(GetProcessHeap(),0,glyphs);
9 years, 5 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
26
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
Results per page:
10
25
50
100
200