diff options
Diffstat (limited to 'src/dutil/deputil.cpp')
| -rw-r--r-- | src/dutil/deputil.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dutil/deputil.cpp b/src/dutil/deputil.cpp index 362b3345..2e6d6a6c 100644 --- a/src/dutil/deputil.cpp +++ b/src/dutil/deputil.cpp | |||
| @@ -122,9 +122,7 @@ DAPI_(HRESULT) DepCheckDependency( | |||
| 122 | LPWSTR sczKey = NULL; | 122 | LPWSTR sczKey = NULL; |
| 123 | HKEY hkKey = NULL; | 123 | HKEY hkKey = NULL; |
| 124 | DWORD64 dw64Version = 0; | 124 | DWORD64 dw64Version = 0; |
| 125 | int cchMinVersion = 0; | ||
| 126 | DWORD64 dw64MinVersion = 0; | 125 | DWORD64 dw64MinVersion = 0; |
| 127 | int cchMaxVersion = 0; | ||
| 128 | DWORD64 dw64MaxVersion = 0; | 126 | DWORD64 dw64MaxVersion = 0; |
| 129 | BOOL fAllowEqual = FALSE; | 127 | BOOL fAllowEqual = FALSE; |
| 130 | LPWSTR sczName = NULL; | 128 | LPWSTR sczName = NULL; |
| @@ -171,10 +169,9 @@ DAPI_(HRESULT) DepCheckDependency( | |||
| 171 | // Check MinVersion if provided. | 169 | // Check MinVersion if provided. |
| 172 | if (wzMinVersion) | 170 | if (wzMinVersion) |
| 173 | { | 171 | { |
| 174 | cchMinVersion = lstrlenW(wzMinVersion); | 172 | if (*wzMinVersion) |
| 175 | if (0 < cchMinVersion) | ||
| 176 | { | 173 | { |
| 177 | hr = FileVersionFromStringEx(wzMinVersion, cchMinVersion, &dw64MinVersion); | 174 | hr = FileVersionFromStringEx(wzMinVersion, 0, &dw64MinVersion); |
| 178 | DepExitOnFailure(hr, "Failed to get the 64-bit version number from \"%ls\".", wzMinVersion); | 175 | DepExitOnFailure(hr, "Failed to get the 64-bit version number from \"%ls\".", wzMinVersion); |
| 179 | 176 | ||
| 180 | fAllowEqual = iAttributes & RequiresAttributesMinVersionInclusive; | 177 | fAllowEqual = iAttributes & RequiresAttributesMinVersionInclusive; |
| @@ -206,10 +203,9 @@ DAPI_(HRESULT) DepCheckDependency( | |||
| 206 | // Check MaxVersion if provided. | 203 | // Check MaxVersion if provided. |
| 207 | if (wzMaxVersion) | 204 | if (wzMaxVersion) |
| 208 | { | 205 | { |
| 209 | cchMaxVersion = lstrlenW(wzMaxVersion); | 206 | if (*wzMaxVersion) |
| 210 | if (0 < cchMaxVersion) | ||
| 211 | { | 207 | { |
| 212 | hr = FileVersionFromStringEx(wzMaxVersion, cchMaxVersion, &dw64MaxVersion); | 208 | hr = FileVersionFromStringEx(wzMaxVersion, 0, &dw64MaxVersion); |
| 213 | DepExitOnFailure(hr, "Failed to get the 64-bit version number from \"%ls\".", wzMaxVersion); | 209 | DepExitOnFailure(hr, "Failed to get the 64-bit version number from \"%ls\".", wzMaxVersion); |
| 214 | 210 | ||
| 215 | fAllowEqual = iAttributes & RequiresAttributesMaxVersionInclusive; | 211 | fAllowEqual = iAttributes & RequiresAttributesMaxVersionInclusive; |
