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
July 2006
----- 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
5 participants
857 discussions
Start a n
N
ew thread
Robert Shearman : ntdll: Use a common condition value for the major, minor and service pack version numbers.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: 31d9341e8ecbbef9be54d1ceffeba9cc21793183 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=31d9341e8ecbbef9be54d1c…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Jul 17 12:09:27 2006 +0100 ntdll: Use a common condition value for the major, minor and service pack version numbers. --- dlls/kernel/tests/version.c | 16 +++++------- dlls/ntdll/version.c | 59 +++++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/dlls/kernel/tests/version.c b/dlls/kernel/tests/version.c index 46f61da..73ba665 100644 --- a/dlls/kernel/tests/version.c +++ b/dlls/kernel/tests/version.c @@ -53,7 +53,7 @@ START_TEST(version) ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION, pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); ret = pVerifyVersionInfoA(&info, VER_BUILDNUMBER | VER_MAJORVERSION | VER_MINORVERSION/* | VER_PLATFORMID | VER_SERVICEPACKMAJOR | @@ -101,7 +101,7 @@ START_TEST(version) info.wServicePackMinor++; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(!ret && (GetLastError() == ERROR_OLD_WIN_VERSION), + ok(!ret && (GetLastError() == ERROR_OLD_WIN_VERSION), "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld\n", GetLastError()); /* test the failure hierarchy for the four version fields */ @@ -110,7 +110,7 @@ START_TEST(version) info.wServicePackMajor++; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(!ret && (GetLastError() == ERROR_OLD_WIN_VERSION), + ok(!ret && (GetLastError() == ERROR_OLD_WIN_VERSION), "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld\n", GetLastError()); GetVersionEx((OSVERSIONINFO *)&info); @@ -129,10 +129,9 @@ START_TEST(version) ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); - /* shows that build number fits into the hierarchy after major version, but before minor version */ GetVersionEx((OSVERSIONINFO *)&info); info.dwBuildNumber++; ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -142,13 +141,12 @@ START_TEST(version) ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); /* test bad dwOSVersionInfoSize */ GetVersionEx((OSVERSIONINFO *)&info); info.dwOSVersionInfoSize = 0; ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, - pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); - todo_wine ok(!ret && (GetLastError() == ERROR_OLD_WIN_VERSION), - "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %ld\n", GetLastError()); + pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)); + ok(ret, "VerifyVersionInfoA failed with error %ld\n", GetLastError()); } diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index ee828b6..a5b9d45 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -642,29 +642,44 @@ NTSTATUS WINAPI RtlVerifyVersionInfo( co if (status != STATUS_SUCCESS) return status; } - if(dwTypeMask & VER_MAJORVERSION) - { - status = version_compare_values(ver.dwMajorVersion, info->dwMajorVersion, dwlConditionMask >> 1*3 & 0x07); - if (status != STATUS_SUCCESS) - return status; - } - if(dwTypeMask & VER_MINORVERSION) - { - status = version_compare_values(ver.dwMinorVersion, info->dwMinorVersion, dwlConditionMask >> 0*3 & 0x07); - if (status != STATUS_SUCCESS) - return status; - } - if(dwTypeMask & VER_SERVICEPACKMAJOR) - { - status = version_compare_values(ver.wServicePackMajor, info->wServicePackMajor, dwlConditionMask >> 5*3 & 0x07); - if (status != STATUS_SUCCESS) - return status; - } - if(dwTypeMask & VER_SERVICEPACKMINOR) + + if(dwTypeMask & (VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR|VER_SERVICEPACKMINOR)) { - status = version_compare_values(ver.wServicePackMinor, info->wServicePackMinor, dwlConditionMask >> 4*3 & 0x07); - if (status != STATUS_SUCCESS) - return status; + unsigned char condition = 0; + + if(dwTypeMask & VER_MAJORVERSION) + condition = dwlConditionMask >> 1*3 & 0x07; + else if(dwTypeMask & VER_MINORVERSION) + condition = dwlConditionMask >> 0*3 & 0x07; + else if(dwTypeMask & VER_SERVICEPACKMAJOR) + condition = dwlConditionMask >> 5*3 & 0x07; + else if(dwTypeMask & VER_SERVICEPACKMINOR) + condition = dwlConditionMask >> 4*3 & 0x07; + + if(dwTypeMask & VER_MAJORVERSION) + { + status = version_compare_values(ver.dwMajorVersion, info->dwMajorVersion, condition); + if (status != STATUS_SUCCESS) + return status; + } + if(dwTypeMask & VER_MINORVERSION) + { + status = version_compare_values(ver.dwMinorVersion, info->dwMinorVersion, condition); + if (status != STATUS_SUCCESS) + return status; + } + if(dwTypeMask & VER_SERVICEPACKMAJOR) + { + status = version_compare_values(ver.wServicePackMajor, info->wServicePackMajor, condition); + if (status != STATUS_SUCCESS) + return status; + } + if(dwTypeMask & VER_SERVICEPACKMINOR) + { + status = version_compare_values(ver.wServicePackMinor, info->wServicePackMinor, condition); + if (status != STATUS_SUCCESS) + return status; + } } return STATUS_SUCCESS;
1
0
0
0
Robert Shearman : ntdll: Reduce duplicated code in RtlVerifyVersionInfo by calling a function for comparing the values .
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: 644e079d57394ea0667150efb6fb886048f9feaf URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=644e079d57394ea0667150e…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Jul 17 12:08:50 2006 +0100 ntdll: Reduce duplicated code in RtlVerifyVersionInfo by calling a function for comparing the values. --- dlls/ntdll/version.c | 198 +++++++++++++++----------------------------------- 1 files changed, 59 insertions(+), 139 deletions(-) diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index fe738b2..ee828b6 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -562,6 +562,30 @@ BOOLEAN WINAPI RtlGetNtProductType( LPDW } +static inline NTSTATUS version_compare_values(ULONG left, ULONG right, UCHAR condition) +{ + switch (condition) { + case VER_EQUAL: + if (left != right) return STATUS_REVISION_MISMATCH; + break; + case VER_GREATER: + if (left <= right) return STATUS_REVISION_MISMATCH; + break; + case VER_GREATER_EQUAL: + if (left < right) return STATUS_REVISION_MISMATCH; + break; + case VER_LESS: + if (left >= right) return STATUS_REVISION_MISMATCH; + break; + case VER_LESS_EQUAL: + if (left > right) return STATUS_REVISION_MISMATCH; + break; + default: + return STATUS_INVALID_PARAMETER; + } + return STATUS_SUCCESS; +} + /****************************************************************************** * RtlVerifyVersionInfo (NTDLL.@) */ @@ -587,25 +611,11 @@ NTSTATUS WINAPI RtlVerifyVersionInfo( co if(!(dwTypeMask && dwlConditionMask)) return STATUS_INVALID_PARAMETER; if(dwTypeMask & VER_PRODUCT_TYPE) - switch(dwlConditionMask >> 7*3 & 0x07) { - case VER_EQUAL: - if(ver.wProductType != info->wProductType) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.wProductType <= info->wProductType) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.wProductType < info->wProductType) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.wProductType >= info->wProductType) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.wProductType > info->wProductType) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.wProductType, info->wProductType, dwlConditionMask >> 7*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_SUITENAME) switch(dwlConditionMask >> 6*3 & 0x07) { @@ -621,131 +631,41 @@ NTSTATUS WINAPI RtlVerifyVersionInfo( co return STATUS_INVALID_PARAMETER; } if(dwTypeMask & VER_PLATFORMID) - switch(dwlConditionMask >> 3*3 & 0x07) - { - case VER_EQUAL: - if(ver.dwPlatformId != info->dwPlatformId) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.dwPlatformId <= info->dwPlatformId) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.dwPlatformId < info->dwPlatformId) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.dwPlatformId >= info->dwPlatformId) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.dwPlatformId > info->dwPlatformId) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.dwPlatformId, info->dwPlatformId, dwlConditionMask >> 3*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_BUILDNUMBER) - switch(dwlConditionMask >> 2*3 & 0x07) - { - case VER_EQUAL: - if(ver.dwBuildNumber != info->dwBuildNumber) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.dwBuildNumber <= info->dwBuildNumber) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.dwBuildNumber < info->dwBuildNumber) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.dwBuildNumber >= info->dwBuildNumber) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.dwBuildNumber > info->dwBuildNumber) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.dwBuildNumber, info->dwBuildNumber, dwlConditionMask >> 2*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_MAJORVERSION) - switch(dwlConditionMask >> 1*3 & 0x07) - { - case VER_EQUAL: - if(ver.dwMajorVersion != info->dwMajorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.dwMajorVersion <= info->dwMajorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.dwMajorVersion < info->dwMajorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.dwMajorVersion >= info->dwMajorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.dwMajorVersion > info->dwMajorVersion) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.dwMajorVersion, info->dwMajorVersion, dwlConditionMask >> 1*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_MINORVERSION) - switch(dwlConditionMask >> 0*3 & 0x07) - { - case VER_EQUAL: - if(ver.dwMinorVersion != info->dwMinorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.dwMinorVersion <= info->dwMinorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.dwMinorVersion < info->dwMinorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.dwMinorVersion >= info->dwMinorVersion) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.dwMinorVersion > info->dwMinorVersion) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.dwMinorVersion, info->dwMinorVersion, dwlConditionMask >> 0*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_SERVICEPACKMAJOR) - switch(dwlConditionMask >> 5*3 & 0x07) - { - case VER_EQUAL: - if(ver.wServicePackMajor != info->wServicePackMajor) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.wServicePackMajor <= info->wServicePackMajor) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.wServicePackMajor < info->wServicePackMajor) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.wServicePackMajor >= info->wServicePackMajor) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.wServicePackMajor > info->wServicePackMajor) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.wServicePackMajor, info->wServicePackMajor, dwlConditionMask >> 5*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } if(dwTypeMask & VER_SERVICEPACKMINOR) - switch(dwlConditionMask >> 4*3 & 0x07) - { - case VER_EQUAL: - if(ver.wServicePackMinor != info->wServicePackMinor) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER: - if(ver.wServicePackMinor <= info->wServicePackMinor) return STATUS_REVISION_MISMATCH; - break; - case VER_GREATER_EQUAL: - if(ver.wServicePackMinor < info->wServicePackMinor) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS: - if(ver.wServicePackMinor >= info->wServicePackMinor) return STATUS_REVISION_MISMATCH; - break; - case VER_LESS_EQUAL: - if(ver.wServicePackMinor > info->wServicePackMinor) return STATUS_REVISION_MISMATCH; - break; - default: - return STATUS_INVALID_PARAMETER; - } + { + status = version_compare_values(ver.wServicePackMinor, info->wServicePackMinor, dwlConditionMask >> 4*3 & 0x07); + if (status != STATUS_SUCCESS) + return status; + } return STATUS_SUCCESS; }
1
0
0
0
Robert Shearman : oleaut32: Test the return value of VarCat in the tests.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: c793bfe028d3604a603cc0d709b171b7b86f4d12 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=c793bfe028d3604a603cc0d…
Author: Robert Shearman <rob(a)codeweavers.com> Date: Mon Jul 17 12:08:45 2006 +0100 oleaut32: Test the return value of VarCat in the tests. --- dlls/oleaut32/tests/vartest.c | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 5b1941e..642bd94 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -5259,7 +5259,8 @@ static void test_VarCat(void) V_BSTR(&left) = SysAllocString(sz12); V_BSTR(&right) = SysAllocString(sz34); V_BSTR(&expected) = SysAllocString(sz1234); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_BSTR concat with VT_BSTR failed to return correct result\n"); @@ -5270,7 +5271,10 @@ static void test_VarCat(void) /* Test if expression is VT_ERROR */ V_VT(&left) = VT_ERROR; V_VT(&right) = VT_BSTR; - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + todo_wine { + ok(hres == DISP_E_TYPEMISMATCH, "VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx\n", hres); + } ok(V_VT(&result) == VT_EMPTY, "VarCat: VT_ERROR concat with VT_BSTR should have returned VT_EMPTY\n"); @@ -5280,7 +5284,10 @@ static void test_VarCat(void) V_VT(&left) = VT_BSTR; V_VT(&right) = VT_ERROR; - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + todo_wine { + ok(hres == DISP_E_TYPEMISMATCH, "VarCat should have returned DISP_E_TYPEMISMATCH instead of 0x%08lx\n", hres); + } ok(V_VT(&result) == VT_EMPTY, "VarCat: VT_BSTR concat with VT_ERROR should have returned VT_EMPTY\n"); @@ -5296,7 +5303,8 @@ static void test_VarCat(void) V_INT(&left) = 12; V_BOOL(&right) = TRUE; V_BSTR(&expected) = SysAllocString(sz12_true); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_INT concat with VT_BOOL (TRUE) returned inncorrect result\n"); @@ -5311,7 +5319,8 @@ static void test_VarCat(void) V_INT(&left) = 12; V_BOOL(&right) = FALSE; V_BSTR(&expected) = SysAllocString(sz12_false); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_INT concat with VT_BOOL (FALSE) returned inncorrect result\n"); @@ -5327,7 +5336,8 @@ static void test_VarCat(void) V_INT(&left) = 12; V_INT(&right) = 34; V_BSTR(&expected) = SysAllocString(sz1234); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: NUMBER concat with NUMBER returned inncorrect result\n"); @@ -5340,7 +5350,8 @@ static void test_VarCat(void) V_VT(&right) = VT_BSTR; V_INT(&left) = 12; V_BSTR(&right) = SysAllocString(sz34); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: NUMBER concat with VT_BSTR, inncorrect result\n"); @@ -5352,7 +5363,8 @@ static void test_VarCat(void) V_VT(&right) = VT_INT; V_BSTR(&left) = SysAllocString(sz12); V_INT(&right) = 34; - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_BSTR concat with NUMBER, inncorrect result\n"); @@ -5367,7 +5379,8 @@ static void test_VarCat(void) V_BSTR(&left) = SysAllocString(sz12); V_DATE(&right) = 29494.0; V_BSTR(&expected)= SysAllocString(sz12_date); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_BSTR concat with VT_DATE returned inncorrect result\n"); @@ -5382,7 +5395,8 @@ static void test_VarCat(void) V_DATE(&left) = 29494.0; V_BSTR(&right) = SysAllocString(sz12); V_BSTR(&expected)= SysAllocString(date_sz12); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&expected,lcid,0) == VARCMP_EQ, "VarCat: VT_DATE concat with VT_BSTR returned inncorrect result\n"); @@ -5398,7 +5412,8 @@ static void test_VarCat(void) V_BSTR(&left) = SysAllocString(sz_empty); V_BSTR(&right) = SysAllocString(sz_empty); V_BSTR(&expected)= SysAllocString(sz_empty); - VarCat(&left,&right,&result); + hres = VarCat(&left,&right,&result); + ok(hres == S_OK, "VarCat failed with error 0x%08lx\n", hres); ok(VarCmp(&result,&left,lcid,0) == VARCMP_EQ, "VarCat: EMPTY concat with EMPTY did not return empty VT_BSTR\n");
1
0
0
0
Aric Stewart : wineboot: Copy windows file protection files at boot time.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: b8183db2ec49c0548eefb1db2803150d7bb289e4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=b8183db2ec49c0548eefb1d…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Sat Jul 15 13:54:57 2006 +0900 wineboot: Copy windows file protection files at boot time. --- programs/wineboot/Makefile.in | 2 - programs/wineboot/wineboot.c | 84 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletions(-) diff --git a/programs/wineboot/Makefile.in b/programs/wineboot/Makefile.in index 4dc8754..1bfcafd 100644 --- a/programs/wineboot/Makefile.in +++ b/programs/wineboot/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = wineboot.exe APPMODE = -mconsole -IMPORTS = advapi32 kernel32 +IMPORTS = version advapi32 kernel32 C_SRCS = \ wineboot.c diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 7e14af9..2fa3c2d 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -525,6 +525,88 @@ end: return res==ERROR_SUCCESS?TRUE:FALSE; } +/* + * WFP is Windows File Protection, in NT5 and Windows 2000 it maintains a cache + * of known good dlls and scans through and replaces corrupted DLLs with these + * known good versions. The only programs that should install into this dll + * cache are Windows Updates and IE (which is treated like a Windows Update) + * + * Implementing this allows installing ie in win2k mode to actaully install the + * system dlls that we expect and need + */ +static int ProcessWindowsFileProtection(void) +{ + WIN32_FIND_DATA finddata; + LPSTR custom_dllcache = NULL; + static const CHAR default_dllcache[] = "C:\\Windows\\System32\\dllcache"; + HANDLE find_handle; + BOOL find_rc; + DWORD rc; + HKEY hkey; + LPCSTR dllcache; + CHAR find_string[MAX_PATH]; + CHAR windowsdir[MAX_PATH]; + + rc = RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", &hkey ); + if (rc == ERROR_SUCCESS) + { + DWORD sz = 0; + rc = RegQueryValueEx( hkey, "SFCDllCacheDir", 0, NULL, NULL, &sz); + if (rc == ERROR_MORE_DATA) + { + sz++; + custom_dllcache = HeapAlloc(GetProcessHeap(),0,sz); + RegQueryValueEx( hkey, "SFCDllCacheDir", 0, NULL, (LPBYTE)custom_dllcache, &sz); + } + } + RegCloseKey(hkey); + + if (custom_dllcache) + dllcache = custom_dllcache; + else + dllcache = default_dllcache; + + strcpy(find_string,dllcache); + strcat(find_string,"\\*.*"); + + GetWindowsDirectory(windowsdir,MAX_PATH); + + find_handle = FindFirstFile(find_string,&finddata); + find_rc = find_handle != INVALID_HANDLE_VALUE; + while (find_rc) + { + CHAR targetpath[MAX_PATH]; + CHAR currentpath[MAX_PATH]; + UINT sz; + UINT sz2; + CHAR tempfile[MAX_PATH]; + + if (strcmp(finddata.cFileName,".") == 0 || + strcmp(finddata.cFileName,"..") == 0) + { + find_rc = FindNextFile(find_handle,&finddata); + continue; + } + + sz = MAX_PATH; + sz2 = MAX_PATH; + VerFindFile(VFFF_ISSHAREDFILE, finddata.cFileName, windowsdir, + windowsdir, currentpath, &sz, targetpath,&sz2); + sz = MAX_PATH; + rc = VerInstallFile(0, finddata.cFileName, finddata.cFileName, + (LPSTR) dllcache, targetpath, currentpath, tempfile,&sz); + if (rc != ERROR_SUCCESS) + { + WINE_ERR("WFP: %s error 0x%lx\n",finddata.cFileName,rc); + DeleteFile(tempfile); + } + find_rc = FindNextFile(find_handle,&finddata); + } + FindClose(find_handle); + HeapFree(GetProcessHeap(),0,custom_dllcache); + return 1; +} + struct op_mask { BOOL w9xonly; /* Perform only operations done on Windows 9x */ BOOL ntonly; /* Perform only operations done on Windows NT */ @@ -593,6 +675,8 @@ int main( int argc, char *argv[] ) (ops.ntonly || !ops.prelogin || ProcessRunKeys( HKEY_LOCAL_MACHINE, runkeys_names[RUNKEY_RUNSERVICESONCE], TRUE, FALSE )) && + (ops.ntonly || !ops.prelogin || + ProcessWindowsFileProtection()) && (ops.ntonly || !ops.prelogin || !ops.startup || ProcessRunKeys( HKEY_LOCAL_MACHINE, runkeys_names[RUNKEY_RUNSERVICES], FALSE, FALSE )) &&
1
0
0
0
Mike McCormack : msi: Tidy up MsiCreateAndVerifyInstallerDirectory a bit.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: 33ec7eb5e07c35d9d9806da9bf3aeb85269584de URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=33ec7eb5e07c35d9d9806da…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Mon Jul 17 17:45:04 2006 +0900 msi: Tidy up MsiCreateAndVerifyInstallerDirectory a bit. --- dlls/msi/msi.c | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index d7741f5..241287c 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1810,26 +1810,32 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR return ERROR_SUCCESS; } +/*********************************************************************** + * MsiCreateAndVerifyInstallerDirectory [MSI.@] + * + * Notes: undocumented + */ UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved) { WCHAR path[MAX_PATH]; - if(dwReserved) { - FIXME("Don't know how to handle argument %ld\n", dwReserved); - return ERROR_CALL_NOT_IMPLEMENTED; + TRACE("%ld\n", dwReserved); + + if (dwReserved) + { + FIXME("dwReserved=%ld\n", dwReserved); + return ERROR_INVALID_PARAMETER; } - if(!GetWindowsDirectoryW(path, MAX_PATH)) { - FIXME("GetWindowsDirectory failed unexpected! Error %ld\n", - GetLastError()); - return ERROR_CALL_NOT_IMPLEMENTED; - } + if (!GetWindowsDirectoryW(path, MAX_PATH)) + return ERROR_FUNCTION_FAILED; - strcatW(path, installerW); + lstrcatW(path, installerW); - CreateDirectoryW(path, NULL); + if (!CreateDirectoryW(path, NULL)) + return ERROR_FUNCTION_FAILED; - return 0; + return ERROR_SUCCESS; } /***********************************************************************
1
0
0
0
Mike McCormack : msi: Implement MsiConfigureFeatureA using MsiConfigureFeatureW.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: f6170beb479532fefe9da42316cf9c8bc0543d2b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=f6170beb479532fefe9da42…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Mon Jul 17 17:44:29 2006 +0900 msi: Implement MsiConfigureFeatureA using MsiConfigureFeatureW. --- dlls/msi/msi.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index a3f7a32..d7741f5 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1779,8 +1779,26 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR s */ UINT WINAPI MsiConfigureFeatureA(LPCSTR szProduct, LPCSTR szFeature, INSTALLSTATE eInstallState) { - FIXME("%s %s %i\n", debugstr_a(szProduct), debugstr_a(szFeature), eInstallState); - return ERROR_SUCCESS; + LPWSTR prod, feat = NULL; + UINT r = ERROR_OUTOFMEMORY; + + TRACE("%s %s %i\n", debugstr_a(szProduct), debugstr_a(szFeature), eInstallState); + + prod = strdupAtoW( szProduct ); + if (szProduct && !prod) + goto end; + + feat = strdupAtoW( szFeature ); + if (szFeature && !feat) + goto end; + + r = MsiConfigureFeatureW(prod, feat, eInstallState); + +end: + msi_free(feat); + msi_free(prod); + + return r; } /***********************************************************************
1
0
0
0
Mike McCormack : msi: Cleanup traces, remove unnecessary includes.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: 741b47fd2678c8b0ee8f4d4e22b6a05dfbb23ec4 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=741b47fd2678c8b0ee8f4d4…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sat Jul 15 13:56:09 2006 +0900 msi: Cleanup traces, remove unnecessary includes. --- dlls/msi/install.c | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index a09782d..8724c95 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -29,8 +29,6 @@ #include "wine/debug.h" #include "msi.h" #include "msidefs.h" #include "msipriv.h" -#include "winuser.h" -#include "wine/unicode.h" #include "action.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -333,19 +331,19 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *pack MSIFOLDER *folder; MSIFILE *file; - TRACE("(%p %s %s)\n",package, debugstr_w(szFolder),debugstr_w(szFolderPath)); + TRACE("%p %s %s\n",package, debugstr_w(szFolder),debugstr_w(szFolderPath)); attrib = GetFileAttributesW(szFolderPath); + /* native MSI tests writeability by making temporary files at each drive */ if ( attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_OFFLINE || - attrib & FILE_ATTRIBUTE_READONLY)) /* actually native MSI tests writeability by making temporary files at each drive */ + attrib & FILE_ATTRIBUTE_READONLY)) return ERROR_FUNCTION_FAILED; path = resolve_folder(package,szFolder,FALSE,FALSE,&folder); if (!path) return ERROR_DIRECTORY; - msi_free(folder->Property); folder->Property = build_directory_name(2, szFolderPath, NULL); @@ -405,7 +403,7 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE MSIPACKAGE *package; UINT ret; - TRACE("(%s %s)\n",debugstr_w(szFolder),debugstr_w(szFolderPath)); + TRACE("%s %s\n",debugstr_w(szFolder),debugstr_w(szFolderPath)); if ( !szFolder || !szFolderPath ) return ERROR_INVALID_PARAMETER; @@ -452,7 +450,6 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE * Not in the state: FALSE * */ - BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) { BOOL r = FALSE; @@ -532,7 +529,7 @@ UINT WINAPI MSI_SetFeatureStateW(MSIPACK UINT rc = ERROR_SUCCESS; MSIFEATURE *feature, *child; - TRACE(" %s to %i\n",debugstr_w(szFeature), iState); + TRACE("%s %i\n", debugstr_w(szFeature), iState); feature = get_loaded_feature(package,szFeature); if (!feature) @@ -566,7 +563,7 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDL MSIPACKAGE* package; UINT rc = ERROR_SUCCESS; - TRACE(" %s to %i\n",debugstr_w(szFeature), iState); + TRACE("%s %i\n",debugstr_w(szFeature), iState); package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) @@ -625,8 +622,7 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDL MSIPACKAGE* package; UINT ret; - TRACE("%ld %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, -piAction); + TRACE("%ld %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction); package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) @@ -753,7 +749,6 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE h { MSIPACKAGE* package; LANGID langid; - LPWSTR buffer; static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; @@ -761,10 +756,7 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE h if (!package) return ERROR_INVALID_HANDLE; - buffer = msi_dup_property( package, szProductLanguage ); - langid = atoiW(buffer); - - msi_free(buffer); - msiobj_release (&package->hdr); + langid = msi_get_property_int( package, szProductLanguage, 0 ); + msiobj_release( &package->hdr ); return langid; }
1
0
0
0
Mike McCormack : msi: Move msi_get_property_int() to helpers.c
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: 2ec80faabe929fe75e1f38952ad16e604652ea36 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=2ec80faabe929fe75e1f389…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sat Jul 15 13:55:44 2006 +0900 msi: Move msi_get_property_int() to helpers.c --- dlls/msi/action.c | 8 -------- dlls/msi/action.h | 1 + dlls/msi/helpers.c | 8 ++++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 51a5872..6723f9f 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -292,14 +292,6 @@ static void ui_actioninfo(MSIPACKAGE *pa msiobj_release(&row->hdr); } -static int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def ) -{ - LPWSTR str = msi_dup_property( package, prop ); - int val = str ? atoiW( str ) : def; - msi_free( str ); - return val; -} - static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine ) { LPCWSTR ptr,ptr2; diff --git a/dlls/msi/action.h b/dlls/msi/action.h index 31ac28e..8edfbb0 100644 --- a/dlls/msi/action.h +++ b/dlls/msi/action.h @@ -257,6 +257,7 @@ extern UINT ACTION_RegisterMIMEInfo(MSIP extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ); extern LPWSTR msi_dup_record_field(MSIRECORD *row, INT index); extern LPWSTR msi_dup_property(MSIPACKAGE *package, LPCWSTR prop); +extern int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def ); extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source, BOOL set_prop, MSIFOLDER **folder); extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ); diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index c40a851..51184d5 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -92,6 +92,14 @@ LPWSTR msi_dup_property(MSIPACKAGE *pack return str; } +int msi_get_property_int( MSIPACKAGE *package, LPCWSTR prop, int def ) +{ + LPWSTR str = msi_dup_property( package, prop ); + int val = str ? atoiW( str ) : def; + msi_free( str ); + return val; +} + MSICOMPONENT* get_loaded_component( MSIPACKAGE* package, LPCWSTR Component ) { MSICOMPONENT *comp;
1
0
0
0
Mike McCormack : msi: Add support for INSTALLSTATE_ADVERTISED to MsiQueryFeatureState.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: a5a91d17a474a4f44356c04a90f1db51cafa5a04 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a5a91d17a474a4f44356c04…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sat Jul 15 11:05:20 2006 +0900 msi: Add support for INSTALLSTATE_ADVERTISED to MsiQueryFeatureState. --- dlls/msi/msi.c | 64 +++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 49 insertions(+), 15 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index b8aeba2..a3f7a32 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1117,10 +1117,12 @@ end: */ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) { - WCHAR squishProduct[GUID_SIZE], buffer[MAX_FEATURE_CHARS+2]; + WCHAR squishProduct[GUID_SIZE], comp[39]; + GUID guid; + LPWSTR components, p, parent_feature; UINT rc; - DWORD sz, type; HKEY hkey; + INSTALLSTATE r; TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature)); @@ -1130,30 +1132,62 @@ INSTALLSTATE WINAPI MsiQueryFeatureState if (!squash_guid( szProduct, squishProduct )) return INSTALLSTATE_INVALIDARG; + /* check that it's installed at all */ rc = MSIREG_OpenUserFeaturesKey(szProduct, &hkey, FALSE); if (rc != ERROR_SUCCESS) return INSTALLSTATE_UNKNOWN; - buffer[0] = 0; - sz = sizeof buffer; - type = 0; - rc = RegQueryValueExW(hkey, szFeature, NULL, &type, (LPBYTE) buffer, &sz); + parent_feature = msi_reg_get_val_str( hkey, szFeature ); RegCloseKey(hkey); - TRACE("rc = %d buffer = %s\n", rc, debugstr_w(buffer)); + if (!parent_feature) + return INSTALLSTATE_UNKNOWN; + + r = (parent_feature[0] == 6) ? INSTALLSTATE_ABSENT : INSTALLSTATE_LOCAL; + msi_free(parent_feature); + if (r == INSTALLSTATE_ABSENT) + return r; - if (rc != ERROR_SUCCESS || sz == 0 || type != REG_SZ) + /* now check if it's complete or advertised */ + rc = MSIREG_OpenFeaturesKey(szProduct, &hkey, FALSE); + if (rc != ERROR_SUCCESS) return INSTALLSTATE_UNKNOWN; - if (buffer[0] == 6) - return INSTALLSTATE_ABSENT; + components = msi_reg_get_val_str( hkey, szFeature ); + RegCloseKey(hkey); - /* FIXME: - * Return INSTALLSTATE_ADVERTISED when - * the components exist in the registry, but not on the disk. - */ + TRACE("rc = %d buffer = %s\n", rc, debugstr_w(components)); - return INSTALLSTATE_LOCAL; + if (!components) + { + ERR("components missing %s %s\n", + debugstr_w(szProduct), debugstr_w(szFeature)); + return INSTALLSTATE_UNKNOWN; + } + + r = INSTALLSTATE_LOCAL; + for( p = components; (*p != 2) && (lstrlenW(p) > GUID_SIZE); p += GUID_SIZE) + { + if (!decode_base85_guid( p, &guid )) + { + ERR("%s\n", debugstr_w(p)); + break; + } + StringFromGUID2(&guid, comp, 39); + r = MsiGetComponentPathW(szProduct, comp, NULL, 0); + if (r != INSTALLSTATE_LOCAL && r != INSTALLSTATE_SOURCE) + { + TRACE("component %s state %d\n", debugstr_guid(&guid), r); + r = INSTALLSTATE_ADVERTISED; + } + } + + if (r == INSTALLSTATE_LOCAL && *p != 2) + ERR("%s -> %s\n", debugstr_w(szFeature), debugstr_w(components)); + + msi_free(components); + + return r; } /******************************************************************
1
0
0
0
Mike McCormack : msi: MsiGetComponentPath cannot return INSTALLSTATE_ADVERTISED.
by Alexandre Julliard
17 Jul '06
17 Jul '06
Module: wine Branch: refs/heads/master Commit: baa6efa56f684b96bf8c28640653281928a8bf0b URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=baa6efa56f684b96bf8c286…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Sat Jul 15 11:05:02 2006 +0900 msi: MsiGetComponentPath cannot return INSTALLSTATE_ADVERTISED. --- dlls/msi/msi.c | 33 ++------------------------------- 1 files changed, 2 insertions(+), 31 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 5d29a11..b8aeba2 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -986,10 +986,8 @@ INSTALLSTATE WINAPI MSI_GetComponentPath { WCHAR squished_pc[GUID_SIZE], squished_comp[GUID_SIZE]; UINT rc; - INSTALLSTATE rrc = INSTALLSTATE_UNKNOWN; HKEY hkey = 0; LPWSTR path = NULL; - DWORD sz, type; TRACE("%s %s %p %p\n", debugstr_w(szProduct), debugstr_w(szComponent), lpPathBuf, pcchBuf); @@ -1013,24 +1011,7 @@ INSTALLSTATE WINAPI MSI_GetComponentPath if( rc != ERROR_SUCCESS ) return INSTALLSTATE_UNKNOWN; - sz = 0; - type = 0; - rc = RegQueryValueExW( hkey, squished_pc, NULL, &type, NULL, &sz ); - if( rc == ERROR_SUCCESS && type == REG_SZ ) - { - sz += sizeof(WCHAR); - path = msi_alloc( sz ); - if( path ) - { - path[0] = 0; - rc = RegQueryValueExW( hkey, squished_pc, NULL, NULL, (LPVOID) path, &sz ); - if( rc != ERROR_SUCCESS ) - { - msi_free( path ); - path = NULL; - } - } - } + path = msi_reg_get_val_str( hkey, squished_pc ); RegCloseKey(hkey); TRACE("found path of (%s:%s)(%s)\n", debugstr_w(szComponent), @@ -1040,22 +1021,12 @@ INSTALLSTATE WINAPI MSI_GetComponentPath return INSTALLSTATE_UNKNOWN; if (path[0]=='0') - { FIXME("Registry entry.. check entry\n"); - rrc = INSTALLSTATE_LOCAL; - } - else - { - if ( GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES ) - rrc = INSTALLSTATE_LOCAL; - else - rrc = INSTALLSTATE_ABSENT; - } msi_strcpy_to_awstring( path, lpPathBuf, pcchBuf ); msi_free( path ); - return rrc; + return INSTALLSTATE_LOCAL; } /******************************************************************
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
86
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
Results per page:
10
25
50
100
200