winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2012
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
827 discussions
Start a n
N
ew thread
Hans Leidekker : wbemprox: Add a partial Win32_VideoController class implementation.
by Alexandre Julliard
22 Jun '12
22 Jun '12
Module: wine Branch: master Commit: 47261d63cae77fc87b040dd2802f30377f9633e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47261d63cae77fc87b040dd28…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 22 09:23:36 2012 +0200 wbemprox: Add a partial Win32_VideoController class implementation. --- dlls/wbemprox/Makefile.in | 2 +- dlls/wbemprox/builtin.c | 56 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/Makefile.in b/dlls/wbemprox/Makefile.in index f973c2f..56e3d8f 100644 --- a/dlls/wbemprox/Makefile.in +++ b/dlls/wbemprox/Makefile.in @@ -1,5 +1,5 @@ MODULE = wbemprox.dll -IMPORTS = oleaut32 ole32 advapi32 +IMPORTS = dxgi oleaut32 ole32 advapi32 C_SRCS = \ builtin.c \ diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 0c88ad5..af913d4 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -27,6 +27,8 @@ #include "winbase.h" #include "wbemcli.h" #include "tlhelp32.h" +#include "initguid.h" +#include "d3d10.h" #include "wine/debug.h" #include "wbemprox_private.h" @@ -43,13 +45,19 @@ static const WCHAR class_processW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0}; static const WCHAR class_processorW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s','o','r',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}; +static const WCHAR prop_adapterramW[] = + {'A','d','a','p','t','e','r','R','A','M',0}; static const WCHAR prop_captionW[] = {'C','a','p','t','i','o','n',0}; static const WCHAR prop_commandlineW[] = {'C','o','m','m','a','n','d','L','i','n','e',0}; static const WCHAR prop_descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; +static const WCHAR prop_deviceidW[] = + {'D','e','v','i','c','e','I','d',0}; static const WCHAR prop_handleW[] = {'H','a','n','d','l','e',0}; static const WCHAR prop_manufacturerW[] = @@ -101,6 +109,11 @@ static const struct column col_processor[] = { { prop_manufacturerW, CIM_STRING } }; +static const struct column col_videocontroller[] = +{ + { prop_adapterramW, CIM_UINT32 }, + { prop_deviceidW, CIM_STRING|COL_FLAG_KEY } +}; static const WCHAR bios_descriptionW[] = {'D','e','f','a','u','l','t',' ','S','y','s','t','e','m',' ','B','I','O','S',0}; @@ -124,6 +137,8 @@ static const WCHAR os_64bitW[] = {'6','4','-','b','i','t',0}; static const WCHAR processor_manufacturerW[] = {'G','e','n','u','i','n','e','I','n','t','e','l',0}; +static const WCHAR videocontroller_deviceidW[] = + {'V','i','d','e','o','C','o','n','t','r','o','l','l','e','r','1',0}; #include "pshpack1.h" struct record_bios @@ -158,6 +173,11 @@ struct record_processor { const WCHAR *manufacturer; }; +struct record_videocontroller +{ + UINT32 adapter_ram; + const WCHAR *device_id; +}; #include "poppack.h" static const struct record_bios data_bios[] = @@ -244,13 +264,47 @@ static void fill_os( struct table *table ) table->num_rows = 1; } +static void fill_videocontroller( struct table *table ) +{ + + struct record_videocontroller *rec; + HRESULT hr; + IDXGIFactory *factory = NULL; + IDXGIAdapter *adapter = NULL; + DXGI_ADAPTER_DESC desc; + UINT vidmem = 512 * 1024 * 1024; + + if (!(table->data = heap_alloc( sizeof(*rec) ))) return; + + hr = CreateDXGIFactory( &IID_IDXGIFactory, (void **)&factory ); + if (FAILED(hr)) goto done; + + hr = IDXGIFactory_EnumAdapters( factory, 0, &adapter ); + if (FAILED(hr)) goto done; + + hr = IDXGIAdapter_GetDesc( adapter, &desc ); + if (SUCCEEDED(hr)) vidmem = desc.DedicatedVideoMemory; + +done: + rec = (struct record_videocontroller *)table->data; + rec->device_id = videocontroller_deviceidW; + rec->adapter_ram = vidmem; + + TRACE("created 1 row\n"); + table->num_rows = 1; + + if (adapter) IDXGIAdapter_Release( adapter ); + if (factory) IDXGIFactory_Release( factory ); +} + static struct table classtable[] = { { class_biosW, SIZEOF(col_bios), col_bios, SIZEOF(data_bios), (BYTE *)data_bios, NULL }, { class_compsysW, SIZEOF(col_compsys), col_compsys, SIZEOF(data_compsys), (BYTE *)data_compsys, NULL }, { class_osW, SIZEOF(col_os), col_os, 0, NULL, fill_os }, { class_processW, SIZEOF(col_process), col_process, 0, NULL, fill_process }, - { class_processorW, SIZEOF(col_processor), col_processor, SIZEOF(data_processor), (BYTE *)data_processor, NULL } + { class_processorW, SIZEOF(col_processor), col_processor, SIZEOF(data_processor), (BYTE *)data_processor, NULL }, + { class_videocontrollerW, SIZEOF(col_videocontroller), col_videocontroller, 0, NULL, fill_videocontroller } }; struct table *get_table( const WCHAR *name )
1
0
0
0
Hans Leidekker : wbemprox: Handle more property types in get_propval.
by Alexandre Julliard
22 Jun '12
22 Jun '12
Module: wine Branch: master Commit: a827a51cc0de2bb1ea0cba54d090ae3e7fd61041 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a827a51cc0de2bb1ea0cba54d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jun 22 09:23:20 2012 +0200 wbemprox: Handle more property types in get_propval. --- dlls/wbemprox/query.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 7a2b545..181549f 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -653,6 +653,22 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR V_VT( ret ) = VT_BSTR; V_BSTR( ret ) = SysAllocString( (const WCHAR *)val ); break; + case CIM_SINT16: + V_VT( ret ) = VT_I2; + V_I2( ret ) = val; + break; + case CIM_UINT16: + V_VT( ret ) = VT_UI2; + V_UI2( ret ) = val; + break; + case CIM_SINT32: + V_VT( ret ) = VT_I4; + V_I4( ret ) = val; + break; + case CIM_UINT32: + V_VT( ret ) = VT_UI4; + V_UI4( ret ) = val; + break; default: ERR("unhandled column type %u\n", view->table->columns[column].type); return WBEM_E_FAILED;
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for loading of multiple 8-byte IFD fields.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: 4c7f6f68b9c5a94879d22f264926478aa1194341 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c7f6f68b9c5a94879d22f264…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:21:26 2012 +0900 windowscodecs: Add support for loading of multiple 8-byte IFD fields. --- dlls/windowscodecs/metadatahandler.c | 32 +++++++++++++++++++++++++++++++- dlls/windowscodecs/tests/metadata.c | 11 +++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index 83b5c88..a3eea1f 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -865,7 +865,37 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, } break; } - FIXME("loading multiple rational fields is not implemented\n"); + else + { + item->value.vt |= VT_VECTOR; + item->value.u.cauh.cElems = count; + item->value.u.cauh.pElems = HeapAlloc(GetProcessHeap(), 0, count * 8); + if (!item->value.u.cauh.pElems) return E_OUTOFMEMORY; + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.cauh.pElems); + return hr; + } + hr = IStream_Read(input, item->value.u.cauh.pElems, count * 8, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.cauh.pElems); + return hr; + } + for (i = 0; i < count; i++) + { + if (type == IFD_DOUBLE) + SWAP_ULONGLONG(item->value.u.cauh.pElems[i].QuadPart); + else + { + SWAP_ULONG(item->value.u.cauh.pElems[i].u.LowPart); + SWAP_ULONG(item->value.u.cauh.pElems[i].u.HighPart); + } + } + } break; case IFD_ASCII: item->value.u.pszVal = HeapAlloc(GetProcessHeap(), 0, count + 1); diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index f821513..76fd241 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -81,9 +81,10 @@ static const struct ifd_data SHORT short_val[4]; LONG long_val[2]; FLOAT float_val[2]; + struct IFD_rational rational[3]; } IFD_data = { - 27, + 28, { { 0xfe, IFD_SHORT, 1, 1 }, /* NEWSUBFILETYPE */ { 0x100, IFD_LONG, 1, 222 }, /* IMAGEWIDTH */ @@ -112,6 +113,7 @@ static const struct ifd_data { 0xf013, IFD_SHORT, 0, 0x11223344 }, { 0xf014, IFD_LONG, 0, 0x11223344 }, { 0xf015, IFD_FLOAT, 0, 0x11223344 }, + { 0xf016, IFD_SRATIONAL, 3, FIELD_OFFSET(struct ifd_data, rational) }, }, 0, { 900, 3 }, @@ -121,6 +123,7 @@ static const struct ifd_data { 0x0101, 0x0202, 0x0303, 0x0404 }, { 0x11223344, 0x55667788 }, { (FLOAT)1234.5678, (FLOAT)8765.4321 }, + { { 0x01020304, 0x05060708 }, { 0x10203040, 0x50607080 }, { 0x11223344, 0x55667788 } }, }; #include "poppack.h" @@ -603,7 +606,7 @@ static void compare_ifd_metadata(IWICMetadataReader *reader, const struct test_d static void test_metadata_IFD(void) { - static const struct test_data td[27] = + static const struct test_data td[28] = { { VT_UI2, 0xfe, 0, { 1 } }, { VT_UI4, 0x100, 0, { 222 } }, @@ -632,6 +635,10 @@ static void test_metadata_IFD(void) { VT_UI2, 0xf013, 0, { 0x3344 } }, { VT_UI4, 0xf014, 0, { 0x11223344 } }, { VT_R4, 0xf015, 0, { 0x11223344 } }, + { VT_I8|VT_VECTOR, 0xf016, 3, + { ((LONGLONG)0x05060708 << 32) | 0x01020304, + ((LONGLONG)0x50607080 << 32) | 0x10203040, + ((LONGLONG)0x55667788 << 32) | 0x11223344 } }, }; HRESULT hr; IWICMetadataReader *reader;
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add a test for endianness support in IFD metadata reader.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: 4d974f072effa485d29c1cf4e4a17850e8fe6d12 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d974f072effa485d29c1cf4e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:21:19 2012 +0900 windowscodecs: Add a test for endianness support in IFD metadata reader. --- dlls/windowscodecs/tests/metadata.c | 284 +++++++++++++++++++++++++++-------- 1 files changed, 219 insertions(+), 65 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4d974f072effa485d29c1…
1
0
0
0
Dmitry Timoshkov : windowscodecs: Handle IFD fields with count 0 same way as with count 1.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: b8d58650282bb3aa66515eab5ba11e16c14b95a8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8d58650282bb3aa66515eab5…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:21:13 2012 +0900 windowscodecs: Handle IFD fields with count 0 same way as with count 1. --- dlls/windowscodecs/metadatahandler.c | 20 ++++++++++++++++++++ dlls/windowscodecs/tests/metadata.c | 12 ++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index f3b8d38..83b5c88 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -718,6 +718,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, { case IFD_BYTE: case IFD_SBYTE: + if (!count) count = 1; + if (count <= 4) { const BYTE *data = (const BYTE *)&entry->value; @@ -755,6 +757,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, break; case IFD_SHORT: case IFD_SSHORT: + if (!count) count = 1; + if (count <= 2) { const SHORT *data = (const SHORT *)&entry->value; @@ -800,6 +804,8 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, case IFD_LONG: case IFD_SLONG: case IFD_FLOAT: + if (!count) count = 1; + if (count == 1) { item->value.u.ulVal = value; @@ -830,6 +836,13 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, case IFD_RATIONAL: case IFD_SRATIONAL: case IFD_DOUBLE: + if (!count) + { + FIXME("IFD field type %d, count 0\n", type); + item->value.vt = VT_EMPTY; + break; + } + if (count == 1) { ULONGLONG ull; @@ -882,6 +895,13 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, item->value.u.pszVal[count] = 0; break; case IFD_UNDEFINED: + if (!count) + { + FIXME("IFD field type %d, count 0\n", type); + item->value.vt = VT_EMPTY; + break; + } + item->value.u.blob.pBlobData = HeapAlloc(GetProcessHeap(), 0, count); if (!item->value.u.blob.pBlobData) return E_OUTOFMEMORY; diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index b144ea9..1936550 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -82,7 +82,7 @@ static const struct ifd_data FLOAT float_val[2]; } IFD_data = { - 23, + 27, { { 0xfe, IFD_SHORT, 1, 1 }, /* NEWSUBFILETYPE */ { 0x100, IFD_LONG, 1, 222 }, /* IMAGEWIDTH */ @@ -107,6 +107,10 @@ static const struct ifd_data { 0xf00f, IFD_ASCII, 4, 'a' | 'b' << 8 | 'c' << 16 | 'd' << 24 }, { 0xf010, IFD_UNDEFINED, 13, FIELD_OFFSET(struct ifd_data, string) }, { 0xf011, IFD_UNDEFINED, 4, 'a' | 'b' << 8 | 'c' << 16 | 'd' << 24 }, + { 0xf012, IFD_BYTE, 0, 0x11223344 }, + { 0xf013, IFD_SHORT, 0, 0x11223344 }, + { 0xf014, IFD_LONG, 0, 0x11223344 }, + { 0xf015, IFD_FLOAT, 0, 0x11223344 }, }, 0, { 900, 3 }, @@ -390,7 +394,7 @@ static void test_metadata_IFD(void) int count; /* if VT_VECTOR */ LONGLONG value[13]; const char *string; - } td[23] = + } td[27] = { { VT_UI2, 0xfe, 0, { 1 } }, { VT_UI4, 0x100, 0, { 222 } }, @@ -415,6 +419,10 @@ static void test_metadata_IFD(void) { VT_LPSTR, 0xf00f, 4, { 0 }, "abcd" }, { VT_BLOB, 0xf010, 13, { 0 }, "Hello World!" }, { VT_BLOB, 0xf011, 4, { 0 }, "abcd" }, + { VT_UI1, 0xf012, 0, { 0x44 } }, + { VT_UI2, 0xf013, 0, { 0x3344 } }, + { VT_UI4, 0xf014, 0, { 0x11223344 } }, + { VT_R4, 0xf015, 0, { 0x11223344 } }, }; HRESULT hr; IWICMetadataReader *reader;
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for IFD_UNDEFINED field type.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: e4af117c061b74104f40414713cc9a6785856327 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4af117c061b74104f4041471…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:21:06 2012 +0900 windowscodecs: Add support for IFD_UNDEFINED field type. --- dlls/windowscodecs/metadatahandler.c | 27 +++++++++++++++++++++++++++ dlls/windowscodecs/tests/metadata.c | 13 +++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index bd96944..f3b8d38 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -881,6 +881,33 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, } item->value.u.pszVal[count] = 0; break; + case IFD_UNDEFINED: + item->value.u.blob.pBlobData = HeapAlloc(GetProcessHeap(), 0, count); + if (!item->value.u.blob.pBlobData) return E_OUTOFMEMORY; + + item->value.u.blob.cbSize = count; + + if (count <= 4) + { + const char *data = (const char *)&entry->value; + memcpy(item->value.u.blob.pBlobData, data, count); + break; + } + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.blob.pBlobData); + return hr; + } + hr = IStream_Read(input, item->value.u.blob.pBlobData, count, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.blob.pBlobData); + return hr; + } + break; default: FIXME("loading field of type %d, count %u is not implemented\n", type, count); break; diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index 63605d4..b144ea9 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -82,7 +82,7 @@ static const struct ifd_data FLOAT float_val[2]; } IFD_data = { - 21, + 23, { { 0xfe, IFD_SHORT, 1, 1 }, /* NEWSUBFILETYPE */ { 0x100, IFD_LONG, 1, 222 }, /* IMAGEWIDTH */ @@ -105,6 +105,8 @@ static const struct ifd_data { 0xf00d, IFD_FLOAT, 2, FIELD_OFFSET(struct ifd_data, float_val) }, { 0xf00e, IFD_ASCII, 13, FIELD_OFFSET(struct ifd_data, string) }, { 0xf00f, IFD_ASCII, 4, 'a' | 'b' << 8 | 'c' << 16 | 'd' << 24 }, + { 0xf010, IFD_UNDEFINED, 13, FIELD_OFFSET(struct ifd_data, string) }, + { 0xf011, IFD_UNDEFINED, 4, 'a' | 'b' << 8 | 'c' << 16 | 'd' << 24 }, }, 0, { 900, 3 }, @@ -388,7 +390,7 @@ static void test_metadata_IFD(void) int count; /* if VT_VECTOR */ LONGLONG value[13]; const char *string; - } td[21] = + } td[23] = { { VT_UI2, 0xfe, 0, { 1 } }, { VT_UI4, 0x100, 0, { 222 } }, @@ -411,6 +413,8 @@ static void test_metadata_IFD(void) { VT_R4|VT_VECTOR, 0xf00d, 2, { 0x449a522b, 0x4608f5ba } }, { VT_LPSTR, 0xf00e, 12, { 0 }, "Hello World!" }, { VT_LPSTR, 0xf00f, 4, { 0 }, "abcd" }, + { VT_BLOB, 0xf010, 13, { 0 }, "Hello World!" }, + { VT_BLOB, 0xf011, 4, { 0 }, "abcd" }, }; HRESULT hr; IWICMetadataReader *reader; @@ -500,6 +504,11 @@ static void test_metadata_IFD(void) ok(!strcmp(td[i].string, U(value).pszVal), "%u: expected %s, got %s\n", i, td[i].string, U(value).pszVal); } + else if (value.vt == VT_BLOB) + { + ok(td[i].count == U(value).blob.cbSize, "%u: expected count %d, got %d\n", i, td[i].count, U(value).blob.cbSize); + ok(!memcmp(td[i].string, U(value).blob.pBlobData, td[i].count), "%u: expected %s, got %s\n", i, td[i].string, U(value).blob.pBlobData); + } else ok(U(value).uhVal.QuadPart == td[i].value[0], "%u: unexpected value: %d/%d\n", i, U(value).uhVal.u.LowPart, U(value).uhVal.u.HighPart);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for IFD_ASCII field type.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: f3347de57410ba547ead0affa2d6d5288e4c119e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3347de57410ba547ead0affa…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:20:59 2012 +0900 windowscodecs: Add support for IFD_ASCII field type. --- dlls/windowscodecs/metadatahandler.c | 27 +++++++++++++++++++++++++++ dlls/windowscodecs/tests/metadata.c | 23 +++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index cf356de..bd96944 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -854,6 +854,33 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, } FIXME("loading multiple rational fields is not implemented\n"); break; + case IFD_ASCII: + item->value.u.pszVal = HeapAlloc(GetProcessHeap(), 0, count + 1); + if (!item->value.u.pszVal) return E_OUTOFMEMORY; + + if (count <= 4) + { + const char *data = (const char *)&entry->value; + memcpy(item->value.u.pszVal, data, count); + item->value.u.pszVal[count] = 0; + break; + } + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.pszVal); + return hr; + } + hr = IStream_Read(input, item->value.u.pszVal, count, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.pszVal); + return hr; + } + item->value.u.pszVal[count] = 0; + break; default: FIXME("loading field of type %d, count %u is not implemented\n", type, count); break; diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index ea0dd66..63605d4 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -82,7 +82,7 @@ static const struct ifd_data FLOAT float_val[2]; } IFD_data = { - 19, + 21, { { 0xfe, IFD_SHORT, 1, 1 }, /* NEWSUBFILETYPE */ { 0x100, IFD_LONG, 1, 222 }, /* IMAGEWIDTH */ @@ -103,6 +103,8 @@ static const struct ifd_data { 0xf00b, IFD_SSHORT, 4, FIELD_OFFSET(struct ifd_data, short_val) }, { 0xf00c, IFD_SLONG, 2, FIELD_OFFSET(struct ifd_data, long_val) }, { 0xf00d, IFD_FLOAT, 2, FIELD_OFFSET(struct ifd_data, float_val) }, + { 0xf00e, IFD_ASCII, 13, FIELD_OFFSET(struct ifd_data, string) }, + { 0xf00f, IFD_ASCII, 4, 'a' | 'b' << 8 | 'c' << 16 | 'd' << 24 }, }, 0, { 900, 3 }, @@ -385,7 +387,8 @@ static void test_metadata_IFD(void) ULONG type, id; int count; /* if VT_VECTOR */ LONGLONG value[13]; - } td[19] = + const char *string; + } td[21] = { { VT_UI2, 0xfe, 0, { 1 } }, { VT_UI4, 0x100, 0, { 222 } }, @@ -406,6 +409,8 @@ static void test_metadata_IFD(void) { VT_I2|VT_VECTOR, 0xf00b, 4, { 0x0101, 0x0202, 0x0303, 0x0404 } }, { VT_I4|VT_VECTOR, 0xf00c, 2, { 0x11223344, 0x55667788 } }, { VT_R4|VT_VECTOR, 0xf00d, 2, { 0x449a522b, 0x4608f5ba } }, + { VT_LPSTR, 0xf00e, 12, { 0 }, "Hello World!" }, + { VT_LPSTR, 0xf00f, 4, { 0 }, "abcd" }, }; HRESULT hr; IWICMetadataReader *reader; @@ -476,11 +481,25 @@ static void test_metadata_IFD(void) for (j = 0; j < U(value).caul.cElems; j++) ok(td[i].value[j] == U(value).caul.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caul.pElems[j]); break; + case VT_LPSTR: + ok(td[i].count == U(value).calpstr.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caub.cElems); + for (j = 0; j < U(value).calpstr.cElems; j++) + trace("%u: %s\n", j, U(value).calpstr.pElems[j]); + /* fall through to not handled message */ default: ok(0, "%u: array of type %d is not handled\n", i, value.vt & ~VT_VECTOR); break; } } + else if (value.vt == VT_LPSTR) + { + ok(td[i].count == strlen(U(value).pszVal) || + broken(td[i].count == strlen(U(value).pszVal) + 1), /* before Win7 */ + "%u: expected count %d, got %d\n", i, td[i].count, lstrlenA(U(value).pszVal)); + if (td[i].count == strlen(U(value).pszVal)) + ok(!strcmp(td[i].string, U(value).pszVal), + "%u: expected %s, got %s\n", i, td[i].string, U(value).pszVal); + } else ok(U(value).uhVal.QuadPart == td[i].value[0], "%u: unexpected value: %d/%d\n", i, U(value).uhVal.u.LowPart, U(value).uhVal.u.HighPart);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add tests for more types of IFD fields.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: 32f9f327b2a83ddb59ce1aaca47cf42ff619efe4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32f9f327b2a83ddb59ce1aaca…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:20:53 2012 +0900 windowscodecs: Add tests for more types of IFD fields. --- dlls/windowscodecs/tests/metadata.c | 116 +++++++++++++++++++++++++++++------ 1 files changed, 97 insertions(+), 19 deletions(-) diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c index 3c433bd..ea0dd66 100644 --- a/dlls/windowscodecs/tests/metadata.c +++ b/dlls/windowscodecs/tests/metadata.c @@ -39,16 +39,26 @@ } \ } while (0) +#define IFD_BYTE 1 +#define IFD_ASCII 2 #define IFD_SHORT 3 #define IFD_LONG 4 #define IFD_RATIONAL 5 +#define IFD_SBYTE 6 +#define IFD_UNDEFINED 7 +#define IFD_SSHORT 8 +#define IFD_SLONG 9 +#define IFD_SRATIONAL 10 +#define IFD_FLOAT 11 +#define IFD_DOUBLE 12 +#define IFD_IFD 13 #include "pshpack2.h" struct IFD_entry { SHORT id; SHORT type; - ULONG length; + ULONG count; LONG value; }; @@ -58,26 +68,50 @@ struct IFD_rational LONG denominator; }; -static const struct +static const struct ifd_data { USHORT number_of_entries; - struct IFD_entry entry[6]; + struct IFD_entry entry[40]; ULONG next_IFD; struct IFD_rational xres; + DOUBLE double_val; + struct IFD_rational srational_val; + char string[14]; + SHORT short_val[4]; + LONG long_val[2]; + FLOAT float_val[2]; } IFD_data = { - 6, + 19, { { 0xfe, IFD_SHORT, 1, 1 }, /* NEWSUBFILETYPE */ { 0x100, IFD_LONG, 1, 222 }, /* IMAGEWIDTH */ { 0x101, IFD_LONG, 1, 333 }, /* IMAGELENGTH */ { 0x102, IFD_SHORT, 1, 24 }, /* BITSPERSAMPLE */ { 0x103, IFD_LONG, 1, 32773 }, /* COMPRESSION: packbits */ - { 0x11a, IFD_RATIONAL, 1, /* XRESOLUTION */ - sizeof(USHORT) + sizeof(struct IFD_entry) * 6 + sizeof(ULONG) } + { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct ifd_data, xres) }, + { 0xf001, IFD_BYTE, 1, 0x11223344 }, + { 0xf002, IFD_BYTE, 4, 0x11223344 }, + { 0xf003, IFD_SBYTE, 1, 0x11223344 }, + { 0xf004, IFD_SSHORT, 1, 0x11223344 }, + { 0xf005, IFD_SSHORT, 2, 0x11223344 }, + { 0xf006, IFD_SLONG, 1, 0x11223344 }, + { 0xf007, IFD_FLOAT, 1, 0x11223344 }, + { 0xf008, IFD_DOUBLE, 1, FIELD_OFFSET(struct ifd_data, double_val) }, + { 0xf009, IFD_SRATIONAL, 1, FIELD_OFFSET(struct ifd_data, srational_val) }, + { 0xf00a, IFD_BYTE, 13, FIELD_OFFSET(struct ifd_data, string) }, + { 0xf00b, IFD_SSHORT, 4, FIELD_OFFSET(struct ifd_data, short_val) }, + { 0xf00c, IFD_SLONG, 2, FIELD_OFFSET(struct ifd_data, long_val) }, + { 0xf00d, IFD_FLOAT, 2, FIELD_OFFSET(struct ifd_data, float_val) }, }, 0, - { 900, 3 } + { 900, 3 }, + 1234567890.0987654321, + { 0x1a2b3c4d, 0x5a6b7c8d }, + "Hello World!", + { 0x0101, 0x0202, 0x0303, 0x0404 }, + { 0x11223344, 0x55667788 }, + { (FLOAT)1234.5678, (FLOAT)8765.4321 }, }; #include "poppack.h" @@ -349,15 +383,29 @@ static void test_metadata_IFD(void) static const struct test_data { ULONG type, id; - LONGLONG value; - } td[6] = + int count; /* if VT_VECTOR */ + LONGLONG value[13]; + } td[19] = { - { VT_UI2, 0xfe, 1 }, - { VT_UI4, 0x100, 222 }, - { VT_UI4, 0x101, 333 }, - { VT_UI2, 0x102, 24 }, - { VT_UI4, 0x103, 32773 }, - { VT_UI8, 0x11a, ((LONGLONG)3 << 32) | 900 } + { VT_UI2, 0xfe, 0, { 1 } }, + { VT_UI4, 0x100, 0, { 222 } }, + { VT_UI4, 0x101, 0, { 333 } }, + { VT_UI2, 0x102, 0, { 24 } }, + { VT_UI4, 0x103, 0, { 32773 } }, + { VT_UI8, 0x11a, 0, { ((LONGLONG)3 << 32) | 900 } }, + { VT_UI1, 0xf001, 0, { 0x44 } }, + { VT_UI1|VT_VECTOR, 0xf002, 4, { 0x44, 0x33, 0x22, 0x11 } }, + { VT_I1, 0xf003, 0, { 0x44 } }, + { VT_I2, 0xf004, 0, { 0x3344 } }, + { VT_I2|VT_VECTOR, 0xf005, 2, { 0x3344, 0x1122 } }, + { VT_I4, 0xf006, 0, { 0x11223344 } }, + { VT_R4, 0xf007, 0, { 0x11223344 } }, + { VT_R8, 0xf008, 0, { ((LONGLONG)0x41d26580 << 32) | 0xb486522c } }, + { VT_I8, 0xf009, 0, { ((LONGLONG)0x5a6b7c8d << 32) | 0x1a2b3c4d } }, + { VT_UI1|VT_VECTOR, 0xf00a, 13, { 'H','e','l','l','o',' ','W','o','r','l','d','!',0 } }, + { VT_I2|VT_VECTOR, 0xf00b, 4, { 0x0101, 0x0202, 0x0303, 0x0404 } }, + { VT_I4|VT_VECTOR, 0xf00c, 2, { 0x11223344, 0x55667788 } }, + { VT_R4|VT_VECTOR, 0xf00d, 2, { 0x449a522b, 0x4608f5ba } }, }; HRESULT hr; IWICMetadataReader *reader; @@ -386,7 +434,7 @@ static void test_metadata_IFD(void) hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); - ok(count == 6, "unexpected count %u\n", count); + ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count); hr = IWICMetadataReader_GetEnumerator(reader, NULL); ok(hr == E_INVALIDARG, "GetEnumerator error %#x\n", hr); @@ -402,9 +450,39 @@ static void test_metadata_IFD(void) ok(schema.vt == VT_EMPTY, "%u: unexpected vt: %u\n", i, schema.vt); ok(id.vt == VT_UI2, "%u: unexpected vt: %u\n", i, id.vt); - ok(U(id).uiVal == td[i].id, "%u: unexpected id: %#x\n", i, U(id).uiVal); - ok(value.vt == td[i].type, "%u: unexpected vt: %u\n", i, value.vt); - ok(U(value).uhVal.QuadPart == td[i].value, "%u: unexpected id: %d/%d\n", i, U(value).uhVal.u.LowPart, U(value).uhVal.u.HighPart); + ok(U(id).uiVal == td[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, U(id).uiVal); + ok(value.vt == td[i].type, "%u: expected vt %#x, got %#x\n", i, td[i].type, value.vt); + if (value.vt & VT_VECTOR) + { + ULONG j; + switch (value.vt & ~VT_VECTOR) + { + case VT_I1: + case VT_UI1: + ok(td[i].count == U(value).caub.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caub.cElems); + for (j = 0; j < U(value).caub.cElems; j++) + ok(td[i].value[j] == U(value).caub.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caub.pElems[j]); + break; + case VT_I2: + case VT_UI2: + ok(td[i].count == U(value).caui.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caui.cElems); + for (j = 0; j < U(value).caui.cElems; j++) + ok(td[i].value[j] == U(value).caui.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caui.pElems[j]); + break; + case VT_I4: + case VT_UI4: + case VT_R4: + ok(td[i].count == U(value).caul.cElems, "%u: expected cElems %d, got %d\n", i, td[i].count, U(value).caui.cElems); + for (j = 0; j < U(value).caul.cElems; j++) + ok(td[i].value[j] == U(value).caul.pElems[j], "%u: expected value[%d] %#x/%#x, got %#x\n", i, j, (ULONG)td[i].value[j], (ULONG)(td[i].value[j] >> 32), U(value).caul.pElems[j]); + break; + default: + ok(0, "%u: array of type %d is not handled\n", i, value.vt & ~VT_VECTOR); + break; + } + } + else + ok(U(value).uhVal.QuadPart == td[i].value[0], "%u: unexpected value: %d/%d\n", i, U(value).uhVal.u.LowPart, U(value).uhVal.u.HighPart); PropVariantClear(&schema); PropVariantClear(&id);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Fix handling of 8-byte IFD fields.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: 722cb46c052892b166bcf9d9f017b07124d05a16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=722cb46c052892b166bcf9d9f…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:20:46 2012 +0900 windowscodecs: Fix handling of 8-byte IFD fields. --- dlls/windowscodecs/metadatahandler.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index 5770e12..cf356de 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -649,7 +649,6 @@ HRESULT UnknownMetadataReader_CreateInstance(IUnknown *pUnkOuter, REFIID iid, vo #define SWAP_ULONG(x) do { if (!native_byte_order) (x) = RtlUlongByteSwap(x); } while(0) #define SWAP_ULONGLONG(x) do { if (!native_byte_order) (x) = RtlUlonglongByteSwap(x); } while(0) -#include "pshpack2.h" struct IFD_entry { SHORT id; @@ -658,13 +657,6 @@ struct IFD_entry LONG value; }; -struct IFD_rational -{ - LONG numerator; - LONG denominator; -}; -#include "poppack.h" - #define IFD_BYTE 1 #define IFD_ASCII 2 #define IFD_SHORT 3 @@ -840,16 +832,24 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, case IFD_DOUBLE: if (count == 1) { - struct IFD_rational rational; + ULONGLONG ull; pos.QuadPart = value; hr = IStream_Seek(input, pos, SEEK_SET, NULL); if (FAILED(hr)) return hr; - hr = IStream_Read(input, &rational, sizeof(rational), NULL); + hr = IStream_Read(input, &ull, sizeof(ull), NULL); if (FAILED(hr)) return hr; - item->value.u.uhVal.QuadPart = ((LONGLONG)rational.denominator << 32) | rational.numerator; - SWAP_ULONGLONG(item->value.u.uhVal.QuadPart); + + item->value.u.uhVal.QuadPart = ull; + + if (type == IFD_DOUBLE) + SWAP_ULONGLONG(item->value.u.uhVal.QuadPart); + else + { + SWAP_ULONG(item->value.u.uhVal.u.LowPart); + SWAP_ULONG(item->value.u.uhVal.u.HighPart); + } break; } FIXME("loading multiple rational fields is not implemented\n");
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for loading of multiple simple IFD fields.
by Alexandre Julliard
21 Jun '12
21 Jun '12
Module: wine Branch: master Commit: aedd9271b776e037d59ade2dbec8ce1ccfd705b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aedd9271b776e037d59ade2db…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jun 21 11:20:39 2012 +0900 windowscodecs: Add support for loading of multiple simple IFD fields. --- dlls/windowscodecs/metadatahandler.c | 106 ++++++++++++++++++++++++++++++---- 1 files changed, 94 insertions(+), 12 deletions(-) diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c index eecbf65..5770e12 100644 --- a/dlls/windowscodecs/metadatahandler.c +++ b/dlls/windowscodecs/metadatahandler.c @@ -704,8 +704,10 @@ static int tag_to_vt(SHORT tag) static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, MetadataItem *item, BOOL native_byte_order) { - ULONG count, value; + ULONG count, value, i; SHORT type; + LARGE_INTEGER pos; + HRESULT hr; item->schema.vt = VT_EMPTY; item->id.vt = VT_UI2; @@ -724,22 +726,84 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, { case IFD_BYTE: case IFD_SBYTE: - if (count == 1) + if (count <= 4) { - item->value.u.bVal = *(const BYTE *)&entry->value; + const BYTE *data = (const BYTE *)&entry->value; + + if (count == 1) + item->value.u.bVal = data[0]; + else + { + item->value.vt |= VT_VECTOR; + item->value.u.caub.cElems = count; + item->value.u.caub.pElems = HeapAlloc(GetProcessHeap(), 0, count); + memcpy(item->value.u.caub.pElems, data, count); + } break; } - FIXME("loading multiple byte fields is not implemented\n"); + + item->value.vt |= VT_VECTOR; + item->value.u.caub.cElems = count; + item->value.u.caub.pElems = HeapAlloc(GetProcessHeap(), 0, count); + if (!item->value.u.caub.pElems) return E_OUTOFMEMORY; + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caub.pElems); + return hr; + } + hr = IStream_Read(input, item->value.u.caub.pElems, count, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caub.pElems); + return hr; + } break; case IFD_SHORT: case IFD_SSHORT: - if (count == 1) + if (count <= 2) { - item->value.u.uiVal = *(const SHORT *)&entry->value; - SWAP_USHORT(item->value.u.uiVal); + const SHORT *data = (const SHORT *)&entry->value; + + if (count == 1) + { + item->value.u.uiVal = data[0]; + SWAP_USHORT(item->value.u.uiVal); + } + else + { + item->value.vt |= VT_VECTOR; + item->value.u.caui.cElems = count; + item->value.u.caui.pElems = HeapAlloc(GetProcessHeap(), 0, count * 2); + memcpy(item->value.u.caui.pElems, data, count * 2); + for (i = 0; i < count; i++) + SWAP_USHORT(item->value.u.caui.pElems[i]); + } break; } - FIXME("loading multiple short fields is not implemented\n"); + + item->value.vt |= VT_VECTOR; + item->value.u.caui.cElems = count; + item->value.u.caui.pElems = HeapAlloc(GetProcessHeap(), 0, count * 2); + if (!item->value.u.caui.pElems) return E_OUTOFMEMORY; + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caui.pElems); + return hr; + } + hr = IStream_Read(input, item->value.u.caui.pElems, count * 2, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caui.pElems); + return hr; + } + for (i = 0; i < count; i++) + SWAP_USHORT(item->value.u.caui.pElems[i]); break; case IFD_LONG: case IFD_SLONG: @@ -749,15 +813,33 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, item->value.u.ulVal = value; break; } - FIXME("loading multiple long fields is not implemented\n"); + + item->value.vt |= VT_VECTOR; + item->value.u.caul.cElems = count; + item->value.u.caul.pElems = HeapAlloc(GetProcessHeap(), 0, count * 4); + if (!item->value.u.caul.pElems) return E_OUTOFMEMORY; + + pos.QuadPart = value; + hr = IStream_Seek(input, pos, SEEK_SET, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caul.pElems); + return hr; + } + hr = IStream_Read(input, item->value.u.caul.pElems, count * 4, NULL); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, item->value.u.caul.pElems); + return hr; + } + for (i = 0; i < count; i++) + SWAP_ULONG(item->value.u.caul.pElems[i]); break; case IFD_RATIONAL: case IFD_SRATIONAL: case IFD_DOUBLE: if (count == 1) { - HRESULT hr; - LARGE_INTEGER pos; struct IFD_rational rational; pos.QuadPart = value; @@ -773,7 +855,7 @@ static HRESULT load_IFD_entry(IStream *input, const struct IFD_entry *entry, FIXME("loading multiple rational fields is not implemented\n"); break; default: - FIXME("loading field of type %d is not implemented\n", entry->type); + FIXME("loading field of type %d, count %u is not implemented\n", type, count); break; } return S_OK;
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
83
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200