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
March 2019
----- 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
2 participants
1097 discussions
Start a n
N
ew thread
Józef Kucia : d3d12: Add stub for D3D12EnableExperimentalFeatures().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 8de1e92fc2ed5f3faec98c7e39a5f1dfa94272f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8de1e92fc2ed5f3faec98c7e…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 7 11:21:21 2019 +0100 d3d12: Add stub for D3D12EnableExperimentalFeatures(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d12/d3d12.spec | 1 + dlls/d3d12/d3d12_main.c | 9 +++++++++ include/d3d12.idl | 3 +++ 3 files changed, 13 insertions(+) diff --git a/dlls/d3d12/d3d12.spec b/dlls/d3d12/d3d12.spec index 3361381..9e79891 100644 --- a/dlls/d3d12/d3d12.spec +++ b/dlls/d3d12/d3d12.spec @@ -6,3 +6,4 @@ @ stub D3D12CoreRegisterLayers @ stdcall D3D12CreateRootSignatureDeserializer(ptr long ptr ptr) @ stdcall D3D12SerializeRootSignature(ptr long ptr ptr) +@ stdcall D3D12EnableExperimentalFeatures(long ptr ptr ptr) diff --git a/dlls/d3d12/d3d12_main.c b/dlls/d3d12/d3d12_main.c index f0c48ee..92a235e 100644 --- a/dlls/d3d12/d3d12_main.c +++ b/dlls/d3d12/d3d12_main.c @@ -45,6 +45,15 @@ HRESULT WINAPI D3D12GetDebugInterface(REFIID iid, void **debug) return DXGI_ERROR_SDK_COMPONENT_MISSING; } +HRESULT WINAPI D3D12EnableExperimentalFeatures(UINT feature_count, + const IID *iids, void *configurations, UINT *configurations_sizes) +{ + FIXME("feature_count %u, iids %p, configurations %p, configurations_sizes %p stub!\n", + feature_count, iids, configurations, configurations_sizes); + + return E_NOINTERFACE; +} + static HRESULT d3d12_signal_event(HANDLE event) { return SetEvent(event) ? S_OK : E_FAIL; diff --git a/include/d3d12.idl b/include/d3d12.idl index 6f515e6..307a4fd 100644 --- a/include/d3d12.idl +++ b/include/d3d12.idl @@ -2180,3 +2180,6 @@ typedef HRESULT (__stdcall *PFN_D3D12_CREATE_DEVICE)(IUnknown *adapter, typedef HRESULT (__stdcall *PFN_D3D12_GET_DEBUG_INTERFACE)(REFIID iid, void **debug); [local] HRESULT __stdcall D3D12GetDebugInterface(REFIID iid, void **debug); + +[local] HRESULT __stdcall D3D12EnableExperimentalFeatures(UINT feature_count, + const IID *iids, void *configurations, UINT *configurations_sizes);
1
0
0
0
Józef Kucia : d3d12: Remove export ordinals.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: ffe1049e54a80684c7f5111474ee2613f8fd330a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ffe1049e54a80684c7f51114…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 7 11:21:20 2019 +0100 d3d12: Remove export ordinals. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d12/d3d12.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/d3d12/d3d12.spec b/dlls/d3d12/d3d12.spec index 53151bf..3361381 100644 --- a/dlls/d3d12/d3d12.spec +++ b/dlls/d3d12/d3d12.spec @@ -1,8 +1,8 @@ -100 stub GetBehaviorValue -101 stdcall D3D12CreateDevice(ptr long ptr ptr) -102 stdcall D3D12GetDebugInterface(ptr ptr) -103 stub D3D12CoreCreateLayeredDevice -104 stub D3D12CoreGetLayeredDeviceSize -105 stub D3D12CoreRegisterLayers -106 stdcall D3D12CreateRootSignatureDeserializer(ptr long ptr ptr) -107 stdcall D3D12SerializeRootSignature(ptr long ptr ptr) +@ stub GetBehaviorValue +@ stdcall D3D12CreateDevice(ptr long ptr ptr) +@ stdcall D3D12GetDebugInterface(ptr ptr) +@ stub D3D12CoreCreateLayeredDevice +@ stub D3D12CoreGetLayeredDeviceSize +@ stub D3D12CoreRegisterLayers +@ stdcall D3D12CreateRootSignatureDeserializer(ptr long ptr ptr) +@ stdcall D3D12SerializeRootSignature(ptr long ptr ptr)
1
0
0
0
Ken Thomases : kernel32: Remove some duplicate code.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 4dd5e533b10a93a20637961ad2ba22b4195f5767 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4dd5e533b10a93a20637961a…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Mar 6 18:54:58 2019 -0600 kernel32: Remove some duplicate code. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/process.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 89b561e..09f0433 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -344,11 +344,6 @@ static enum binary_type get_binary_info( HANDLE hfile, pe_image_info_t *info ) case 2: return BINARY_UNIX_EXE; case 8: return BINARY_UNIX_LIB; } - switch(header.macho.filetype) - { - case 2: return BINARY_UNIX_EXE; - case 8: return BINARY_UNIX_LIB; - } } return BINARY_UNKNOWN; }
1
0
0
0
Jacek Caban : rpcrt4/tests: Avoid type redefinition.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 994976dcb3f42a370f0419fbd3c3fe7980d0e297 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=994976dcb3f42a370f0419fb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Mar 7 14:00:51 2019 +0100 rpcrt4/tests: Avoid type redefinition. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46680
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rpcrt4/tests/server.c | 2 +- dlls/rpcrt4/tests/server.idl | 50 ++++++++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index d68918b..e6555fa 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -27,7 +27,7 @@ #include <netfw.h> #include "wine/test.h" #include "server.h" -#define SKIP_STRUCT_DECLS +#define SKIP_TYPE_DECLS #include "server_interp.h" #include "server_defines.h" diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl index 143d506..afda2ed 100644 --- a/dlls/rpcrt4/tests/server.idl +++ b/dlls/rpcrt4/tests/server.idl @@ -37,16 +37,16 @@ import "objidl.idl"; #define ISERVER_UUID 00000000-4114-0704-2301-000000000000 #endif -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct tag_vector { int x; int y; int z; } vector_t; -cpp_quote("#endif") typedef int fnprintf(const char *format, ...); +cpp_quote("#endif") [ uuid(ISERVER_UUID), @@ -58,7 +58,7 @@ cpp_quote("#if 0") typedef wchar_t WCHAR; cpp_quote("#endif") -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef [string] char *str_t; typedef [string] WCHAR *wstr_t; @@ -121,7 +121,7 @@ cpp_quote("#endif") double ptypes_sum(ptypes_t *ptypes); int dot_pvectors(pvectors_t *pvectors); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") /* don't use this anywhere except in sp_t */ typedef struct { @@ -138,7 +138,7 @@ cpp_quote("#endif") int sum_sp(sp_t *sp); double square_sun(sun_t *su); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct test_list { int t; @@ -162,7 +162,7 @@ cpp_quote("#endif") int dot_two_vectors(vector_t vs[2]); void get_number_array([out, length_is(*n)] int x[20], [out] int *n); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { int n; @@ -192,10 +192,12 @@ cpp_quote("#endif") int get_cpsc(int n, [out] cpsc_t *cpsc ); int sum_complex_array(int n, [size_is(n)] refpint_t pi[]); +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef [wire_marshal(int)] void *puint_t; +cpp_quote("#endif") int square_puint(puint_t p); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { [size_is(n)] puint_t *ps; @@ -214,7 +216,7 @@ cpp_quote("#endif") int sum_cpuints(cpuints_t *p); int dot_copy_vectors(vector_t u, vector_t v); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct wire_us *wire_us_t; typedef [wire_marshal(wire_us_t)] struct us us_t; struct us @@ -233,7 +235,7 @@ cpp_quote("#endif") int square_test_us(test_us_t *tus); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef union encu switch (int t) { case ENCU_I: int i; @@ -277,7 +279,7 @@ cpp_quote("#endif") int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n); int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { char c; @@ -289,7 +291,7 @@ cpp_quote("#endif") double sum_aligns(aligns_t *a); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { int i; @@ -301,7 +303,7 @@ cpp_quote("#endif") int sum_padded2(padded_t ps[2]); int sum_padded_conf([size_is(n)] padded_t *ps, int n); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { int *p1; @@ -319,7 +321,7 @@ cpp_quote("#endif") int sum_bogus(bogus_t *b); void check_null([unique] int *null); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { str_t s; @@ -334,7 +336,7 @@ cpp_quote("#endif") int str_struct_len(str_struct_t *s); int wstr_struct_len(wstr_struct_t *s); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { unsigned int n; @@ -351,19 +353,19 @@ cpp_quote("#endif") int sum_doub_carr(doub_carr_t *dc); void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { short n; [size_is(n)] short data[]; } user_bstr_t; -cpp_quote("#endif") typedef [unique] user_bstr_t *wire_bstr_t; typedef [wire_marshal(wire_bstr_t)] short *bstr_t; +cpp_quote("#endif") unsigned hash_bstr(bstr_t s); void get_a_bstr([out]bstr_t *s); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { [string, size_is(size)] char *name; @@ -372,15 +374,17 @@ cpp_quote("#ifndef SKIP_STRUCT_DECLS") cpp_quote("#endif") void get_name([in,out] name_t *name); +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef char **str_array_t; - void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names); typedef WCHAR **wstr_array_t; +cpp_quote("#endif") + void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names); void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names); int sum_pcarr2(int n, [size_is(, n)] int **pa); int sum_L1_norms(int n, [size_is(n)] vector_t *vs); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") /* Don't use this except in the get_s123 test. */ typedef struct { @@ -394,7 +398,7 @@ cpp_quote("#endif") type as a return value. */ s123_t *get_s123(void); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef struct { unsigned int length; @@ -408,7 +412,7 @@ cpp_quote("#endif") str_t get_filename(void); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") enum renum { RE0, @@ -435,7 +439,7 @@ cpp_quote("#endif") void stop(void); void stop_autolisten(void); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef union ipu switch(int t) { default: IStream *stream; @@ -447,7 +451,7 @@ cpp_quote("#endif") int sum_ptr_array([in] int *a[2]); int sum_array_ptr([in] int (*a)[2]); -cpp_quote("#ifndef SKIP_STRUCT_DECLS") +cpp_quote("#ifndef SKIP_TYPE_DECLS") typedef [context_handle] void *ctx_handle_t; cpp_quote("#endif")
1
0
0
0
Jactry Zeng : propsys: Partially implement PropVariantToBuffer().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 50a4c4642a6b75024b737bedb25003a45d9798a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=50a4c4642a6b75024b737bed…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Feb 16 00:16:03 2019 +0800 propsys: Partially implement PropVariantToBuffer(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/propsys/propsys.spec | 2 +- dlls/propsys/propvar.c | 26 +++++++++++ dlls/propsys/tests/propsys.c | 106 +++++++++++++++++++++++++++++++++++++++++++ include/propvarutil.h | 1 + 4 files changed, 134 insertions(+), 1 deletion(-) diff --git a/dlls/propsys/propsys.spec b/dlls/propsys/propsys.spec index d9347e2..8416b6d 100644 --- a/dlls/propsys/propsys.spec +++ b/dlls/propsys/propsys.spec @@ -111,7 +111,7 @@ @ stub PropVariantToBooleanVector @ stub PropVariantToBooleanVectorAlloc @ stub PropVariantToBooleanWithDefault -@ stub PropVariantToBuffer +@ stdcall PropVariantToBuffer(ptr ptr long) @ stdcall PropVariantToDouble(ptr ptr) @ stub PropVariantToDoubleVector @ stub PropVariantToDoubleVectorAlloc diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 988cf81..c56a737 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -306,6 +306,32 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret) return hr; } +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb) +{ + HRESULT hr = S_OK; + + TRACE("(%p, %p, %d)\n", propvarIn, ret, cb); + + switch(propvarIn->vt) + { + case VT_VECTOR|VT_UI1: + if(cb > propvarIn->u.caub.cElems) + return E_FAIL; + memcpy(ret, propvarIn->u.caub.pElems, cb); + break; + case VT_ARRAY|VT_UI1: + FIXME("Unsupported type: VT_ARRAY|VT_UI1\n"); + hr = E_NOTIMPL; + break; + default: + WARN("Unexpected type: %x\n", propvarIn->vt); + hr = E_INVALIDARG; + } + + return hr; +} + + HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch) { HRESULT hr; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 059b622..c47729e 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -1407,6 +1407,111 @@ static void test_PropVariantToString(void) SysFreeString(propvar.u.bstrVal); } +static void test_PropVariantToBuffer(void) +{ + PROPVARIANT propvar; + HRESULT hr; + UINT8 data[] = {1,2,3,4,5,6,7,8,9,10}; + INT8 data_int8[] = {1,2,3,4,5,6,7,8,9,10}; + SAFEARRAY *sa; + SAFEARRAYBOUND sabound; + void *pdata; + UINT8 buffer[256]; + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, NULL, 0); /* crash when cb isn't zero */ + ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08x.\n", hr); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 10); + ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + buffer[0] = 99; + hr = PropVariantToBuffer(&propvar, buffer, 11); + ok(hr == E_FAIL, "PropVariantToBuffer returned: 0x%08x.\n", hr); + ok(buffer[0] == 99, "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + hr = InitPropVariantFromBuffer(data, 10, &propvar); + ok(hr == S_OK, "InitVariantFromBuffer failed 0x%08x.\n", hr); + hr = PropVariantToBuffer(&propvar, buffer, 9); + ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08x.\n", hr); + ok(!memcmp(buffer, data, 9) && !buffer[9], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_ARRAY|VT_UI1; + sabound.lLbound = 0; + sabound.cElements = sizeof(data); + sa = NULL; + sa = SafeArrayCreate(VT_UI1, 1, &sabound); + ok(sa != NULL, "SafeArrayCreate failed.\n"); + hr = SafeArrayAccessData(sa, &pdata); + ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr); + memcpy(pdata, data, sizeof(data)); + U(propvar).parray = sa; + buffer[0] = 99; + hr = PropVariantToBuffer(&propvar, buffer, 11); + todo_wine ok(hr == E_FAIL, "PropVariantToBuffer returned: 0x%08x.\n", hr); + ok(buffer[0] == 99, "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + SafeArrayDestroy(sa); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_ARRAY|VT_UI1; + sabound.lLbound = 0; + sabound.cElements = sizeof(data); + sa = NULL; + sa = SafeArrayCreate(VT_UI1, 1, &sabound); + ok(sa != NULL, "SafeArrayCreate failed.\n"); + hr = SafeArrayAccessData(sa, &pdata); + ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr); + memcpy(pdata, data, sizeof(data)); + U(propvar).parray = sa; + hr = PropVariantToBuffer(&propvar, buffer, sizeof(data)); + todo_wine ok(hr == S_OK, "PropVariantToBuffer failed: 0x%08x.\n", hr); + todo_wine ok(!memcmp(buffer, data, 10) && !buffer[10], "got wrong buffer.\n"); + memset(buffer, 0, sizeof(buffer)); + SafeArrayDestroy(sa); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_VECTOR|VT_I1; + U(propvar).caub.pElems = CoTaskMemAlloc(sizeof(data_int8)); + U(propvar).caub.cElems = sizeof(data_int8); + memcpy(U(propvar).caub.pElems, data_int8, sizeof(data_int8)); + hr = PropVariantToBuffer(&propvar, buffer, sizeof(data_int8)); + ok(hr == E_INVALIDARG, "PropVariantToBuffer failed: 0x%08x.\n", hr); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_ARRAY|VT_I1; + sabound.lLbound = 0; + sabound.cElements = sizeof(data_int8); + sa = NULL; + sa = SafeArrayCreate(VT_I1, 1, &sabound); + ok(sa != NULL, "SafeArrayCreate failed.\n"); + hr = SafeArrayAccessData(sa, &pdata); + ok(hr == S_OK, "SafeArrayAccessData failed: 0x%08x.\n", hr); + memcpy(pdata, data_int8, sizeof(data_int8)); + U(propvar).parray = sa; + hr = PropVariantToBuffer(&propvar, buffer, sizeof(data_int8)); + ok(hr == E_INVALIDARG, "PropVariantToBuffer failed: 0x%08x.\n", hr); + SafeArrayDestroy(sa); + PropVariantClear(&propvar); +} + START_TEST(propsys) { test_PSStringFromPropertyKey(); @@ -1424,4 +1529,5 @@ START_TEST(propsys) test_InitPropVariantFromCLSID(); test_PropVariantToDouble(); test_PropVariantToString(); + test_PropVariantToBuffer(); } diff --git a/include/propvarutil.h b/include/propvarutil.h index 4fb12d8..a4eedef 100644 --- a/include/propvarutil.h +++ b/include/propvarutil.h @@ -79,6 +79,7 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret); +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb); HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch); PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault);
1
0
0
0
Jactry Zeng : propsys: Add VT_CLSID support for PropVariantToGUID().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 6d2c277a8b3243c7083d7ba8ba2a5f05b53a85e2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6d2c277a8b3243c7083d7ba8…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Feb 16 00:15:39 2019 +0800 propsys: Add VT_CLSID support for PropVariantToGUID(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/propsys/propvar.c | 3 +++ dlls/propsys/tests/propsys.c | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index ef490be..988cf81 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -739,6 +739,9 @@ HRESULT WINAPI PropVariantToGUID(const PROPVARIANT *ppropvar, GUID *guid) return PROPVAR_WCHARToGUID(ppropvar->u.bstrVal, SysStringLen(ppropvar->u.bstrVal), guid); case VT_LPWSTR: return PROPVAR_WCHARToGUID(ppropvar->u.pwszVal, strlenW(ppropvar->u.pwszVal), guid); + case VT_CLSID: + memcpy(guid, ppropvar->u.puuid, sizeof(*ppropvar->u.puuid)); + return S_OK; default: FIXME("unsupported vt: %d\n", ppropvar->vt); diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 299675d..059b622 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -568,7 +568,7 @@ static void test_PropVariantToGUID(void) hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); PropVariantClear(&propvar); hres = InitPropVariantFromGUIDAsString(&dummy_guid, &propvar); @@ -576,7 +576,7 @@ static void test_PropVariantToGUID(void) hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); ok(propvar.vt == VT_LPWSTR, "incorrect PROPVARIANT type: %d\n", propvar.vt); propvar.u.pwszVal[1] = 'd'; @@ -584,7 +584,7 @@ static void test_PropVariantToGUID(void) propvar.u.pwszVal[3] = 'a'; hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); propvar.u.pwszVal[1] = 'z'; hres = PropVariantToGUID(&propvar, &guid); @@ -597,7 +597,7 @@ static void test_PropVariantToGUID(void) hres = VariantToGUID(&var, &guid); ok(hres == S_OK, "VariantToGUID failed %x\n", hres); - ok(!memcmp(&IID_NULL, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&IID_NULL, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); VariantClear(&var); hres = InitVariantFromGUIDAsString(&dummy_guid, &var); @@ -605,7 +605,7 @@ static void test_PropVariantToGUID(void) hres = VariantToGUID(&var, &guid); ok(hres == S_OK, "VariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); ok(V_VT(&var) == VT_BSTR, "incorrect VARIANT type: %d\n", V_VT(&var)); V_BSTR(&var)[1] = 'z'; @@ -618,7 +618,14 @@ static void test_PropVariantToGUID(void) V_VT(&var) = VT_EMPTY; hres = PropVariantToGUID(&propvar, &guid); ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); - ok(!memcmp(&dummy_guid, &guid, sizeof(GUID)), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); + PropVariantClear(&propvar); + + memset(&guid, 0, sizeof(guid)); + InitPropVariantFromCLSID(&dummy_guid, &propvar); + hres = PropVariantToGUID(&propvar, &guid); + ok(hres == S_OK, "PropVariantToGUID failed %x\n", hres); + ok(IsEqualGUID(&dummy_guid, &guid), "incorrect GUID created: %s\n", wine_dbgstr_guid(&guid)); PropVariantClear(&propvar); }
1
0
0
0
Jactry Zeng : propsys: Implement PropVariantToString().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: e0a829db99276c0ed39dc3775edf1b49d37f973c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e0a829db99276c0ed39dc377…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Feb 16 00:15:12 2019 +0800 propsys: Implement PropVariantToString(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/propsys/propsys.spec | 2 +- dlls/propsys/propvar.c | 25 ++++++++++++ dlls/propsys/tests/propsys.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ include/propvarutil.h | 1 + 4 files changed, 118 insertions(+), 1 deletion(-) diff --git a/dlls/propsys/propsys.spec b/dlls/propsys/propsys.spec index 9193f36..d9347e2 100644 --- a/dlls/propsys/propsys.spec +++ b/dlls/propsys/propsys.spec @@ -133,7 +133,7 @@ @ stub PropVariantToInt64VectorAlloc @ stub PropVariantToInt64WithDefault @ stub PropVariantToStrRet -@ stub PropVariantToString +@ stdcall PropVariantToString(ptr ptr long) @ stdcall PropVariantToStringAlloc(ptr ptr) @ stub PropVariantToStringVector @ stub PropVariantToStringVectorAlloc diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 396afbf..ef490be 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -34,6 +34,7 @@ #include "winuser.h" #include "shlobj.h" #include "propvarutil.h" +#include "strsafe.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -305,6 +306,30 @@ HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret) return hr; } +HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch) +{ + HRESULT hr; + WCHAR *stringW = NULL; + + TRACE("(%p, %p, %d)\n", propvarIn, ret, cch); + + ret[0] = '\0'; + + if(!cch) + return E_INVALIDARG; + + hr = PropVariantToStringAlloc(propvarIn, &stringW); + if(SUCCEEDED(hr)) + { + if(lstrlenW(stringW) >= cch) + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + lstrcpynW(ret, stringW, cch); + CoTaskMemFree(stringW); + } + + return hr; +} + HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) { WCHAR *res = NULL; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index 926dc3d..299675d 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -32,6 +32,7 @@ #include "initguid.h" #include "propsys.h" #include "propvarutil.h" +#include "strsafe.h" #include "wine/test.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); @@ -1310,6 +1311,95 @@ static void test_PropVariantToDouble(void) ok(value == 8.0, "Unexpected value: %f.\n", value); } +static void test_PropVariantToString(void) +{ + PROPVARIANT propvar; + static CHAR string[] = "Wine"; + static WCHAR stringW[] = {'W','i','n','e',0}; + WCHAR bufferW[256] = {0}; + HRESULT hr; + + PropVariantInit(&propvar); + propvar.vt = VT_EMPTY; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, 0); + ok(hr == E_INVALIDARG, "PropVariantToString should fail: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_EMPTY; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_NULL; + U(propvar).pwszVal = stringW; + bufferW[0] = 65; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!bufferW[0], "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_I4; + U(propvar).lVal = 22; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + todo_wine ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + todo_wine ok(!strcmp_wa(bufferW, "22"), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + PropVariantClear(&propvar); + + PropVariantInit(&propvar); + propvar.vt = VT_LPWSTR; + U(propvar).pwszVal = stringW; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPSTR; + U(propvar).pszVal = string; + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPWSTR; + U(propvar).pwszVal = stringW; + hr = PropVariantToString(&propvar, bufferW, 4); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08x.\n", hr); + ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n"); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_LPSTR; + U(propvar).pszVal = string; + hr = PropVariantToString(&propvar, bufferW, 4); + ok(hr == STRSAFE_E_INSUFFICIENT_BUFFER, "PropVariantToString returned: 0x%08x.\n", hr); + ok(!memcmp(bufferW, stringW, 4), "got wrong string.\n"); + memset(bufferW, 0, sizeof(bufferW)); + + PropVariantInit(&propvar); + propvar.vt = VT_BSTR; + propvar.u.bstrVal = SysAllocString(stringW); + hr = PropVariantToString(&propvar, bufferW, ARRAY_SIZE(bufferW)); + ok(hr == S_OK, "PropVariantToString failed: 0x%08x.\n", hr); + ok(!lstrcmpW(bufferW, stringW), "got wrong string: \"%s\".\n", wine_dbgstr_w(bufferW)); + memset(bufferW, 0, sizeof(bufferW)); + SysFreeString(propvar.u.bstrVal); +} + START_TEST(propsys) { test_PSStringFromPropertyKey(); @@ -1326,4 +1416,5 @@ START_TEST(propsys) test_PropVariantToStringWithDefault(); test_InitPropVariantFromCLSID(); test_PropVariantToDouble(); + test_PropVariantToString(); } diff --git a/include/propvarutil.h b/include/propvarutil.h index 80f081c..4fb12d8 100644 --- a/include/propvarutil.h +++ b/include/propvarutil.h @@ -79,6 +79,7 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret); HRESULT WINAPI PropVariantToUInt32(REFPROPVARIANT propvarIn, ULONG *ret); HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret); HRESULT WINAPI PropVariantToBoolean(REFPROPVARIANT propvarIn, BOOL *ret); +HRESULT WINAPI PropVariantToString(REFPROPVARIANT propvarIn, PWSTR ret, UINT cch); PCWSTR WINAPI PropVariantToStringWithDefault(REFPROPVARIANT propvarIn, LPCWSTR pszDefault); HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret);
1
0
0
0
Jactry Zeng : propsys: Add VT_EMPTY support for PropVariantToStringAlloc() .
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 8db8c94155557b07e8bcc54ab0cda2bed34ba28f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8db8c94155557b07e8bcc54a…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Feb 16 00:14:54 2019 +0800 propsys: Add VT_EMPTY support for PropVariantToStringAlloc(). Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/propsys/propvar.c | 1 + dlls/propsys/tests/propsys.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/dlls/propsys/propvar.c b/dlls/propsys/propvar.c index 0edf462..396afbf 100644 --- a/dlls/propsys/propvar.c +++ b/dlls/propsys/propvar.c @@ -314,6 +314,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) switch(propvarIn->vt) { + case VT_EMPTY: case VT_NULL: res = CoTaskMemAlloc(1*sizeof(WCHAR)); res[0] = '\0'; diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c index a9c0a77..926dc3d 100644 --- a/dlls/propsys/tests/propsys.c +++ b/dlls/propsys/tests/propsys.c @@ -641,6 +641,12 @@ static void test_PropVariantToStringAlloc(void) ok(!lstrcmpW(str, topicW), "got %s\n", wine_dbgstr_w(str)); CoTaskMemFree(str); PropVariantClear(&prop); + + prop.vt = VT_EMPTY; + hres = PropVariantToStringAlloc(&prop, &str); + ok(hres == S_OK, "returned %x\n", hres); + ok(!lstrcmpW(str, emptyW), "got %s\n", wine_dbgstr_w(str)); + CoTaskMemFree(str); } static void test_PropVariantCompare(void)
1
0
0
0
Nikolay Sivov : mf: Add support for clock sink notifications.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 338ba122f316a5234831ba8b66f36de8f021aaf8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=338ba122f316a5234831ba8b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 7 10:07:54 2019 +0300 mf: Add support for clock sink notifications. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/session.c | 237 +++++++++++++++++++++++++++++++++++++++++++++++++---- dlls/mf/tests/mf.c | 3 + include/mfidl.idl | 2 + 3 files changed, 224 insertions(+), 18 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=338ba122f316a5234831…
1
0
0
0
Nikolay Sivov : mf: Keep a list of clock state sinks.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: f64f0f266fc2a3d6028763aa4e70f3cd81ec9d80 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f64f0f266fc2a3d6028763aa…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 7 10:07:53 2019 +0300 mf: Keep a list of clock state sinks. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mf/session.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++--- dlls/mf/tests/mf.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+), 4 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 27b2c4c..d2d1d49 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -29,6 +29,7 @@ #include "wine/debug.h" #include "wine/heap.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(mfplat); @@ -39,6 +40,12 @@ struct media_session IMFMediaEventQueue *event_queue; }; +struct clock_sink +{ + struct list entry; + IMFClockStateSink *state_sink; +}; + struct presentation_clock { IMFPresentationClock IMFPresentationClock_iface; @@ -49,6 +56,7 @@ struct presentation_clock IMFPresentationTimeSource *time_source; IMFClockStateSink *time_source_sink; MFCLOCK_STATE state; + struct list sinks; CRITICAL_SECTION cs; }; @@ -335,6 +343,7 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface) { struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); ULONG refcount = InterlockedDecrement(&clock->refcount); + struct clock_sink *sink, *sink2; TRACE("%p, refcount %u.\n", iface, refcount); @@ -344,6 +353,12 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface) IMFPresentationTimeSource_Release(clock->time_source); if (clock->time_source_sink) IMFClockStateSink_Release(clock->time_source_sink); + LIST_FOR_EACH_ENTRY_SAFE(sink, sink2, &clock->sinks, struct clock_sink, entry) + { + list_remove(&sink->entry); + IMFClockStateSink_Release(sink->state_sink); + heap_free(sink); + } DeleteCriticalSection(&clock->cs); heap_free(clock); } @@ -453,17 +468,69 @@ static HRESULT WINAPI present_clock_GetTime(IMFPresentationClock *iface, MFTIME static HRESULT WINAPI present_clock_AddClockStateSink(IMFPresentationClock *iface, IMFClockStateSink *state_sink) { - FIXME("%p, %p.\n", iface, state_sink); + struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); + struct clock_sink *sink, *cur; + HRESULT hr = S_OK; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, state_sink); + + if (!state_sink) + return E_INVALIDARG; + + sink = heap_alloc(sizeof(*sink)); + if (!sink) + return E_OUTOFMEMORY; + + sink->state_sink = state_sink; + IMFClockStateSink_AddRef(sink->state_sink); + + EnterCriticalSection(&clock->cs); + LIST_FOR_EACH_ENTRY(cur, &clock->sinks, struct clock_sink, entry) + { + if (cur->state_sink == state_sink) + { + hr = E_INVALIDARG; + break; + } + } + if (SUCCEEDED(hr)) + list_add_tail(&clock->sinks, &sink->entry); + LeaveCriticalSection(&clock->cs); + + if (FAILED(hr)) + { + IMFClockStateSink_Release(sink->state_sink); + heap_free(sink); + } + + return hr; } static HRESULT WINAPI present_clock_RemoveClockStateSink(IMFPresentationClock *iface, IMFClockStateSink *state_sink) { - FIXME("%p, %p.\n", iface, state_sink); + struct presentation_clock *clock = impl_from_IMFPresentationClock(iface); + struct clock_sink *sink; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, state_sink); + + if (!state_sink) + return E_INVALIDARG; + + EnterCriticalSection(&clock->cs); + LIST_FOR_EACH_ENTRY(sink, &clock->sinks, struct clock_sink, entry) + { + if (sink->state_sink == state_sink) + { + IMFClockStateSink_Release(sink->state_sink); + list_remove(&sink->entry); + heap_free(sink); + break; + } + } + LeaveCriticalSection(&clock->cs); + + return S_OK; } enum clock_command @@ -731,6 +798,7 @@ HRESULT WINAPI MFCreatePresentationClock(IMFPresentationClock **clock) object->IMFTimer_iface.lpVtbl = &presentclocktimervtbl; object->IMFShutdown_iface.lpVtbl = &presentclockshutdownvtbl; object->refcount = 1; + list_init(&object->sinks); InitializeCriticalSection(&object->cs); *clock = &object->IMFPresentationClock_iface; diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index bae674d..42b23d6 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -742,6 +742,67 @@ enum clock_action CLOCK_PAUSE, }; +static HRESULT WINAPI test_clock_sink_QueryInterface(IMFClockStateSink *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IMFClockStateSink) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IMFClockStateSink_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI test_clock_sink_AddRef(IMFClockStateSink *iface) +{ + return 2; +} + +static ULONG WINAPI test_clock_sink_Release(IMFClockStateSink *iface) +{ + return 1; +} + +static HRESULT WINAPI test_clock_sink_OnClockStart(IMFClockStateSink *iface, MFTIME system_time, LONGLONG offset) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI test_clock_sink_OnClockStop(IMFClockStateSink *iface, MFTIME system_time) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI test_clock_sink_OnClockPause(IMFClockStateSink *iface, MFTIME system_time) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI test_clock_sink_OnClockRestart(IMFClockStateSink *iface, MFTIME system_time) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI test_clock_sink_OnClockSetRate(IMFClockStateSink *iface, MFTIME system_time, float rate) +{ + return E_NOTIMPL; +} + +static const IMFClockStateSinkVtbl test_clock_sink_vtbl = +{ + test_clock_sink_QueryInterface, + test_clock_sink_AddRef, + test_clock_sink_Release, + test_clock_sink_OnClockStart, + test_clock_sink_OnClockStop, + test_clock_sink_OnClockPause, + test_clock_sink_OnClockRestart, + test_clock_sink_OnClockSetRate, +}; + static void test_presentation_clock(void) { static const struct clock_state_test @@ -766,6 +827,7 @@ static void test_presentation_clock(void) { CLOCK_STOP, MFCLOCK_STATE_STOPPED, MFCLOCK_STATE_STOPPED, MF_E_CLOCK_STATE_ALREADY_SET }, { CLOCK_PAUSE, MFCLOCK_STATE_STOPPED, MFCLOCK_STATE_STOPPED, MF_E_INVALIDREQUEST }, }; + IMFClockStateSink test_sink = { &test_clock_sink_vtbl }; IMFPresentationTimeSource *time_source; IMFRateControl *rate_control; IMFPresentationClock *clock; @@ -809,6 +871,25 @@ todo_wine todo_wine ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr); + /* Sinks. */ + hr = IMFPresentationClock_AddClockStateSink(clock, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IMFPresentationClock_AddClockStateSink(clock, &test_sink); + ok(hr == S_OK, "Failed to add a sink, hr %#x.\n", hr); + + hr = IMFPresentationClock_AddClockStateSink(clock, &test_sink); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IMFPresentationClock_RemoveClockStateSink(clock, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + hr = IMFPresentationClock_RemoveClockStateSink(clock, &test_sink); + ok(hr == S_OK, "Failed to remove sink, hr %#x.\n", hr); + + hr = IMFPresentationClock_RemoveClockStateSink(clock, &test_sink); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + /* Set default time source. */ hr = MFCreateSystemTimeSource(&time_source); ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr);
1
0
0
0
← Newer
1
...
72
73
74
75
76
77
78
...
110
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200