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
April 2018
----- 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
542 discussions
Start a n
N
ew thread
Austin English : ntdll: Add DbgUiRemoteBreakin() stub.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: e13f59085f8a3787abd4e3f3eabae1a7e607a3c0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e13f59085f8a3787abd4e3f3…
Author: Austin English <austinenglish(a)gmail.com> Date: Mon Apr 23 16:24:30 2018 -0500 ntdll: Add DbgUiRemoteBreakin() stub. Signed-off-by: Austin English <austinenglish(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/misc.c | 8 ++++++++ dlls/ntdll/ntdll.spec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c index 8f0c51c..88e8b33 100644 --- a/dlls/ntdll/misc.c +++ b/dlls/ntdll/misc.c @@ -476,3 +476,11 @@ ULONG WINAPI EtwEventWrite( REGHANDLE handle, const EVENT_DESCRIPTOR *descriptor FIXME("(%s, %p, %u, %p): stub\n", wine_dbgstr_longlong(handle), descriptor, count, data); return ERROR_SUCCESS; } + +/*********************************************************************** + * DbgUiRemoteBreakin (NTDLL.@) + */ +void WINAPI DbgUiRemoteBreakin( void *arg ) +{ + FIXME("stub\n"); +} diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 8744704..c260b0d 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -36,7 +36,7 @@ # @ stub DbgUiDebugActiveProcess # @ stub DbgUiGetThreadDebugObject # @ stub DbgUiIssueRemoteBreakin -# @ stub DbgUiRemoteBreakin +@ stdcall DbgUiRemoteBreakin(ptr) # @ stub DbgUiSetThreadDebugObject # @ stub DbgUiStopDebugging @ stub DbgUiWaitStateChange
1
0
0
0
Valentin Gabriel Mitrea : d3dx9: Fix D3DCompile() call.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 970009fed70c76bdf15789865de5eb2aa2b481d1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=970009fed70c76bdf1578986…
Author: Valentin Gabriel Mitrea <mitrea.valentin(a)gmail.com> Date: Tue Apr 24 18:20:45 2018 +0300 d3dx9: Fix D3DCompile() call. When using D3DCompile() with an fx profile, the entry point parameter is not used. So, it should be set to NULL. Signed-off-by: Valentin Gabriel Mitrea <mitrea.valentin(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 94f7b07..33197de 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -6590,7 +6590,7 @@ static HRESULT d3dx9_base_effect_init(struct d3dx9_base_effect *base, { TRACE("HLSL ASCII effect, trying to compile it.\n"); hr = D3DCompile(data, data_size, NULL, defines, include, - "main", "fx_2_0", compile_flags, eflags, &bytecode, &temp_errors); + NULL, "fx_2_0", compile_flags, eflags, &bytecode, &temp_errors); if (FAILED(hr)) { WARN("Failed to compile ASCII effect.\n");
1
0
0
0
Louis Lenders : winmm: Return error in waveOutMessage if either dwParam1 or dwParam2 is null.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: d7bd861ae6d3ec24ff69def9ab7115ebb13d554d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7bd861ae6d3ec24ff69def9…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Tue Apr 24 11:52:18 2018 +0200 winmm: Return error in waveOutMessage if either dwParam1 or dwParam2 is null. Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winmm/tests/wave.c | 10 ++++++++++ dlls/winmm/waveform.c | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c index 2a12752..8d7dfd6 100644 --- a/dlls/winmm/tests/wave.c +++ b/dlls/winmm/tests/wave.c @@ -1440,6 +1440,16 @@ static void wave_out_tests(void) ok((ndev == 0 && (preferred == -1 || broken(preferred != -1))) || preferred < ndev, "Got invalid preferred device: 0x%x\n", preferred); + rc = waveOutMessage((HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, + (DWORD_PTR)-1 , 0); + ok(rc == MMSYSERR_INVALPARAM || rc == MMSYSERR_BADDEVICEID, /* w2008+wvista */ + "waveOutMessage(DRVM_MAPPER_PREFERRED_GET) failed: %u\n", rc); + + rc = waveOutMessage((HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, + 0, (DWORD_PTR)&status); + ok(rc == MMSYSERR_INVALPARAM || rc == MMSYSERR_BADDEVICEID, /* w2008+wvista */ + "waveOutMessage(DRVM_MAPPER_PREFERRED_GET) failed: %u\n", rc); + rc=waveOutGetDevCapsA(ndev+1,&capsA,sizeof(capsA)); ok(rc==MMSYSERR_BADDEVICEID, "waveOutGetDevCapsA(%s): MMSYSERR_BADDEVICEID expected, got %s\n", diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index 7308519..26fed17 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -3262,17 +3262,17 @@ UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, case DRV_QUERYMAPPABLE: return MMSYSERR_NOERROR; case DRVM_MAPPER_PREFERRED_GET: - if(dwParam1) { - if(g_outmmdevices_count > 0) - /* Device 0 is always the default device */ - *(DWORD *)dwParam1 = 0; - else - *(DWORD *)dwParam1 = -1; - } + if(!dwParam1 || !dwParam2) + return MMSYSERR_INVALPARAM; - if(dwParam2) - /* Status flags */ - *(DWORD *)dwParam2 = 0; + if(g_outmmdevices_count > 0) + /* Device 0 is always the default device */ + *(DWORD *)dwParam1 = 0; + else + *(DWORD *)dwParam1 = -1; + + /* Status flags */ + *(DWORD *)dwParam2 = 0; return MMSYSERR_NOERROR; }
1
0
0
0
Zebediah Figura : msi: Make MsiSetComponentState() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 11702a31d2a31bfc5ac13e5d7995b2e71578f25f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=11702a31d2a31bfc5ac13e5d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:18 2018 -0500 msi: Make MsiSetComponentState() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 23 ++++------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 19 +++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index b19b647..63ffbfe 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -1313,33 +1313,18 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, MSIPACKAGE* package; UINT ret; + if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; - - hr = remote_SetComponentState(remote, component, iState); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetComponentState(remote, szComponent, iState); } ret = MSI_SetComponentStateW(package, szComponent, iState); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 18b8601..b1b2cb4 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2540,10 +2540,9 @@ UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, return MsiGetComponentStateW(hinst, component, installed, action); } -HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) +UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state) { - UINT r = MsiSetComponentStateW(hinst, component, state); - return HRESULT_FROM_WIN32(r); + return MsiSetComponentStateW(hinst, component, state); } HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b2c9352..2f9ba5d 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -719,6 +719,25 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_SOURCE); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_SOURCE, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 5996487..132f140 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -84,7 +84,7 @@ interface IWineMsiRemote UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); + UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value );
1
0
0
0
Zebediah Figura : msi: Make MsiGetComponentState() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 35b1b87dc90b5d0700ec0893bc3918e15a43b07d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35b1b87dc90b5d0700ec0893…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:17 2018 -0500 msi: Make MsiGetComponentState() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 25 +++++++------------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 31 +++++++++++++++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 1ff3ad9..b19b647 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -1359,33 +1359,22 @@ UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, TRACE("%d %s %p %p\n", hInstall, debugstr_w(szComponent), piInstalled, piAction); + if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; - - hr = remote_GetComponentState(remote, component, piInstalled, piAction); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER; - return ERROR_SUCCESS; + return remote_GetComponentState(remote, szComponent, piInstalled, piAction); } ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index f8b150b..18b8601 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2534,11 +2534,10 @@ UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTA return MsiSetFeatureStateW(hinst, feature, state); } -HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, +UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetComponentStateW(hinst, component, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetComponentStateW(hinst, component, installed, action); } HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b30953a..b2c9352 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -655,6 +655,8 @@ static void test_feature_states(MSIHANDLE hinst) INSTALLSTATE state, action; UINT r; + /* test feature states */ + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); @@ -688,6 +690,35 @@ static void test_feature_states(MSIHANDLE hinst) r = MsiGetFeatureStateA(hinst, "One", &state, &action); ok(hinst, !r, "got %u\n", r); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + /* test component states */ + + r = MsiGetComponentStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "dangler", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_UNKNOWN, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "component", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 8bdc10d..5996487 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -83,7 +83,7 @@ interface IWineMsiRemote UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); - HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level );
1
0
0
0
Zebediah Figura : msi: Make MsiSetFeatureState() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 863680d5edcdb9fd62910cd7266658d2e3a0e743 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=863680d5edcdb9fd62910cd7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:16 2018 -0500 msi: Make MsiSetFeatureState() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 26 ++++---------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 17 +++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 706fdb4..1ff3ad9 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -685,9 +685,6 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, szwFeature = strdupAtoW(szFeature); - if (!szwFeature) - return ERROR_FUNCTION_FAILED; - rc = MsiSetFeatureStateW(hInstall,szwFeature, iState); msi_free(szwFeature); @@ -818,33 +815,18 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, TRACE("%s %i\n",debugstr_w(szFeature), iState); + if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; - - hr = remote_SetFeatureState(remote, feature, iState); - - SysFreeString(feature); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetFeatureState(remote, szFeature, iState); } rc = MSI_SetFeatureStateW(package,szFeature,iState); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index ec05d43..f8b150b 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2529,10 +2529,9 @@ UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, return MsiGetFeatureStateW(hinst, feature, installed, action); } -HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) +UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state) { - UINT r = MsiSetFeatureStateW(hinst, feature, state); - return HRESULT_FROM_WIN32(r); + return MsiSetFeatureStateW(hinst, feature, state); } HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index ef4e282..b30953a 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -671,6 +671,23 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_ADVERTISED); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_ADVERTISED, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); } /* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 091ef16..8bdc10d 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -82,7 +82,7 @@ interface IWineMsiRemote BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); + UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language );
1
0
0
0
Zebediah Figura : msi: Make MsiGetFeatureState() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 9f428f592dc949d528c149692addf8e34f3f005b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9f428f592dc949d528c14969…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:15 2018 -0500 msi: Make MsiGetFeatureState() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 25 +++++++------------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 24 ++++++++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 17a0cd5..706fdb4 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -964,33 +964,22 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, TRACE("%d %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction); + if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature; if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE; - feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; - - hr = remote_GetFeatureState(remote, feature, piInstalled, piAction); - - SysFreeString(feature); + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER; - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_GetFeatureState(remote, szFeature, piInstalled, piAction); } ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 6d2610d..ec05d43 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2523,11 +2523,10 @@ UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) return MsiSetMode(hinst, mode, state); } -HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, +UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetFeatureStateW(hinst, feature, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetFeatureStateW(hinst, feature, installed, action); } HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 5f2ff5d..ef4e282 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -650,6 +650,29 @@ static void test_mode(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); } +static void test_feature_states(MSIHANDLE hinst) +{ + INSTALLSTATE state, action; + UINT r; + + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -678,6 +701,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_doaction(hinst); test_targetpath(hinst); test_mode(hinst); + test_feature_states(hinst); return ERROR_SUCCESS; } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index c4c7e88..091ef16 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -81,7 +81,7 @@ interface IWineMsiRemote UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); - HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state );
1
0
0
0
Zebediah Figura : msi: Make MsiSetMode() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 1723536058c73b71894f60ab2c030e78948abe45 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1723536058c73b71894f60ab…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:14 2018 -0500 msi: Make MsiSetMode() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 13 +------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 9 +++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 3ac151d..17a0cd5 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -644,22 +644,11 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) if (!package) { MSIHANDLE remote; - HRESULT hr; if (!(remote = msi_get_remote(hInstall))) return FALSE; - hr = remote_SetMode(remote, iRunMode, fState); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetMode(remote, iRunMode, fState); } switch (iRunMode) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 3ea5afc..6d2610d 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2518,10 +2518,9 @@ BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) return MsiGetMode(hinst, mode); } -HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) +UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) { - UINT r = MsiSetMode(hinst, mode, state); - return HRESULT_FROM_WIN32(r); + return MsiSetMode(hinst, mode, state); } HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index d596f1e..5f2ff5d 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -642,6 +642,14 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, sz == srcsz, "got size %u\n", sz); } +static void test_mode(MSIHANDLE hinst) +{ + UINT r; + + r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE); + ok(hinst, !r, "got %u\n", r); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -669,6 +677,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_db(hinst); test_doaction(hinst); test_targetpath(hinst); + test_mode(hinst); return ERROR_SUCCESS; } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 7282c77..c4c7e88 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -80,7 +80,7 @@ interface IWineMsiRemote UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); - HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); + UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
1
0
0
0
Zebediah Figura : msi: Make MsiGetMode() RPC-compatible.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: 9091c3dcf2e4c7775926c0a7a3f82f2e491eb849 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9091c3dcf2e4c7775926c0a7…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Apr 23 23:18:13 2018 -0500 msi: Make MsiGetMode() RPC-compatible. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msi/install.c | 9 +-------- dlls/msi/package.c | 5 ++--- dlls/msi/winemsi.idl | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 88b3ff5..3ac151d 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -561,18 +561,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) if (!package) { MSIHANDLE remote; - BOOL ret; - HRESULT hr; if (!(remote = msi_get_remote(hInstall))) return FALSE; - hr = remote_GetMode(remote, iRunMode, &ret); - - if (hr == S_OK) - return ret; - - return FALSE; + return remote_GetMode(remote, iRunMode); } switch (iRunMode) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 1790918..3ea5afc 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2513,10 +2513,9 @@ UINT __cdecl remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value return r; } -HRESULT __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL *ret) +BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) { - *ret = MsiGetMode(hinst, mode); - return S_OK; + return MsiGetMode(hinst, mode); } HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 06db52e..7282c77 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -79,7 +79,7 @@ interface IWineMsiRemote UINT remote_GetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); - HRESULT remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [out] BOOL *ret ); + BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state );
1
0
0
0
Dmitry Timoshkov : mstask/tests: Add some tests for trigger management.
by Alexandre Julliard
24 Apr '18
24 Apr '18
Module: wine Branch: master Commit: fffed17f8057011adcb3e19e3833582a4d8ef649 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fffed17f8057011adcb3e19e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Apr 24 16:14:05 2018 +0800 mstask/tests: Add some tests for trigger management. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mstask/tests/task_trigger.c | 82 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 77 insertions(+), 5 deletions(-) diff --git a/dlls/mstask/tests/task_trigger.c b/dlls/mstask/tests/task_trigger.c index 0a68a19..a1b5597 100644 --- a/dlls/mstask/tests/task_trigger.c +++ b/dlls/mstask/tests/task_trigger.c @@ -2,6 +2,7 @@ * Test suite for Task interface * * Copyright (C) 2008 Google (Roy Shea) + * Copyright (C) 2018 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,10 +36,6 @@ static BOOL setup_trigger(void) HRESULT hres; const WCHAR task_name[] = {'T','e','s','t','i','n','g', 0}; - hres = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, - &IID_ITaskScheduler, (void **) &test_task_scheduler); - if(hres != S_OK) - return FALSE; hres = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, &CLSID_CTask, &IID_ITask, (IUnknown**)&test_task); if(hres != S_OK) @@ -60,7 +57,6 @@ static void cleanup_trigger(void) { ITaskTrigger_Release(test_trigger); ITask_Release(test_task); - ITaskScheduler_Release(test_task_scheduler); } static BOOL compare_trigger_state(TASK_TRIGGER found_state, @@ -376,10 +372,86 @@ static void test_SetTrigger_GetTrigger(void) return; } +static void test_task_trigger(void) +{ + static const WCHAR task_name[] = { 'T','e','s','t','i','n','g',0 }; + HRESULT hr; + ITask *task; + ITaskTrigger *trigger, *trigger2; + WORD count, idx; + DWORD ref; + + hr = ITaskScheduler_NewWorkItem(test_task_scheduler, task_name, &CLSID_CTask, + &IID_ITask, (IUnknown **)&task); + ok(hr == S_OK, "got %#x\n", hr); + + count = 0xdead; + hr = ITask_GetTriggerCount(task, &count); + ok(hr == S_OK, "got %#x\n", hr); + ok(count == 0, "got %u\n", count); + + hr = ITask_DeleteTrigger(task, 0); + ok(hr == SCHED_E_TRIGGER_NOT_FOUND, "got %#x\n", hr); + + hr = ITask_GetTrigger(task, 0, &trigger); + ok(hr == SCHED_E_TRIGGER_NOT_FOUND, "got %#x\n", hr); + + idx = 0xdead; + hr = ITask_CreateTrigger(task, &idx, &trigger); + ok(hr == S_OK, "got %#x\n", hr); + ok(idx == 0, "got %u\n", idx); + + hr = ITask_GetTrigger(task, 0, &trigger2); + ok(hr == S_OK, "got %#x\n", hr); + ok(trigger != trigger2, "%p != %p\n", trigger, trigger2); + + ref = ITaskTrigger_Release(trigger2); + ok(ref == 0, "got %u\n", ref); + + ref = ITaskTrigger_Release(trigger); + ok(ref == 0, "got %u\n", ref); + + count = 0xdead; + hr = ITask_GetTriggerCount(task, &count); + ok(hr == S_OK, "got %#x\n", hr); + ok(count == 1, "got %u\n", count); + + hr = ITask_DeleteTrigger(task, 0); + ok(hr == S_OK, "got %#x\n", hr); + + idx = 0xdead; + hr = ITask_CreateTrigger(task, &idx, &trigger); + ok(hr == S_OK, "got %#x\n", hr); + ok(idx == 0, "got %u\n", idx); + + hr = ITask_DeleteTrigger(task, 0); + ok(hr == S_OK, "got %#x\n", hr); + + count = 0xdead; + hr = ITask_GetTriggerCount(task, &count); + ok(hr == S_OK, "got %#x\n", hr); + ok(count == 0, "got %u\n", count); + + ref = ITaskTrigger_Release(trigger); + ok(ref == 0, "got %u\n", ref); + + ref = ITask_Release(task); + ok(ref == 0, "got %u\n", ref); +} START_TEST(task_trigger) { + HRESULT hr; + CoInitialize(NULL); + + hr = CoCreateInstance(&CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER, + &IID_ITaskScheduler, (void **)&test_task_scheduler); + ok(hr == S_OK, "error creating TaskScheduler instance %#x\n", hr); + test_SetTrigger_GetTrigger(); + test_task_trigger(); + + ITaskScheduler_Release(test_task_scheduler); CoUninitialize(); }
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
55
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
Results per page:
10
25
50
100
200