aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/verutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/dutil/verutil.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dutil/verutil.cpp b/src/dutil/verutil.cpp
index 835dde81..fdb5a10a 100644
--- a/src/dutil/verutil.cpp
+++ b/src/dutil/verutil.cpp
@@ -40,8 +40,8 @@ static HRESULT CompareVersionSubstring(
40 40
41 41
42DAPI_(HRESULT) VerCompareParsedVersions( 42DAPI_(HRESULT) VerCompareParsedVersions(
43 __in VERUTIL_VERSION* pVersion1, 43 __in_opt VERUTIL_VERSION* pVersion1,
44 __in VERUTIL_VERSION* pVersion2, 44 __in_opt VERUTIL_VERSION* pVersion2,
45 __out int* pnResult 45 __out int* pnResult
46 ) 46 )
47{ 47{
@@ -50,8 +50,8 @@ DAPI_(HRESULT) VerCompareParsedVersions(
50 DWORD cMaxReleaseLabels = 0; 50 DWORD cMaxReleaseLabels = 0;
51 BOOL fCompareMetadata = FALSE; 51 BOOL fCompareMetadata = FALSE;
52 52
53 if (!pVersion1 || !pVersion1->sczVersion || 53 if (pVersion1 && !pVersion1->sczVersion ||
54 !pVersion2 || !pVersion2->sczVersion) 54 pVersion2 && !pVersion2->sczVersion)
55 { 55 {
56 ExitFunction1(hr = E_INVALIDARG); 56 ExitFunction1(hr = E_INVALIDARG);
57 } 57 }
@@ -60,6 +60,14 @@ DAPI_(HRESULT) VerCompareParsedVersions(
60 { 60 {
61 ExitFunction1(nResult = 0); 61 ExitFunction1(nResult = 0);
62 } 62 }
63 else if (pVersion1 && !pVersion2)
64 {
65 ExitFunction1(nResult = 1);
66 }
67 else if (!pVersion1 && pVersion2)
68 {
69 ExitFunction1(nResult = -1);
70 }
63 71
64 nResult = CompareDword(pVersion1->dwMajor, pVersion2->dwMajor); 72 nResult = CompareDword(pVersion1->dwMajor, pVersion2->dwMajor);
65 if (0 != nResult) 73 if (0 != nResult)