diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/verutil.h')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/verutil.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/verutil.h b/src/libs/dutil/WixToolset.DUtil/inc/verutil.h new file mode 100644 index 00000000..5247bb61 --- /dev/null +++ b/src/libs/dutil/WixToolset.DUtil/inc/verutil.h | |||
@@ -0,0 +1,93 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | |||
5 | #ifdef __cplusplus | ||
6 | extern "C" { | ||
7 | #endif | ||
8 | |||
9 | #define ReleaseVerutilVersion(p) if (p) { VerFreeVersion(p); p = NULL; } | ||
10 | |||
11 | typedef struct _VERUTIL_VERSION_RELEASE_LABEL | ||
12 | { | ||
13 | BOOL fNumeric; | ||
14 | DWORD dwValue; | ||
15 | SIZE_T cchLabelOffset; | ||
16 | int cchLabel; | ||
17 | } VERUTIL_VERSION_RELEASE_LABEL; | ||
18 | |||
19 | typedef struct _VERUTIL_VERSION | ||
20 | { | ||
21 | LPWSTR sczVersion; | ||
22 | DWORD dwMajor; | ||
23 | DWORD dwMinor; | ||
24 | DWORD dwPatch; | ||
25 | DWORD dwRevision; | ||
26 | DWORD cReleaseLabels; | ||
27 | VERUTIL_VERSION_RELEASE_LABEL* rgReleaseLabels; | ||
28 | SIZE_T cchMetadataOffset; | ||
29 | BOOL fInvalid; | ||
30 | } VERUTIL_VERSION; | ||
31 | |||
32 | /******************************************************************* | ||
33 | VerCompareParsedVersions - compares the Verutil versions. | ||
34 | |||
35 | *******************************************************************/ | ||
36 | HRESULT DAPI VerCompareParsedVersions( | ||
37 | __in_opt VERUTIL_VERSION* pVersion1, | ||
38 | __in_opt VERUTIL_VERSION* pVersion2, | ||
39 | __out int* pnResult | ||
40 | ); | ||
41 | |||
42 | /******************************************************************* | ||
43 | VerCompareStringVersions - parses the strings with VerParseVersion and then | ||
44 | compares the Verutil versions with VerCompareParsedVersions. | ||
45 | |||
46 | *******************************************************************/ | ||
47 | HRESULT DAPI VerCompareStringVersions( | ||
48 | __in_z LPCWSTR wzVersion1, | ||
49 | __in_z LPCWSTR wzVersion2, | ||
50 | __in BOOL fStrict, | ||
51 | __out int* pnResult | ||
52 | ); | ||
53 | |||
54 | /******************************************************************** | ||
55 | VerCopyVersion - copies the given Verutil version. | ||
56 | |||
57 | *******************************************************************/ | ||
58 | HRESULT DAPI VerCopyVersion( | ||
59 | __in VERUTIL_VERSION* pSource, | ||
60 | __out VERUTIL_VERSION** ppVersion | ||
61 | ); | ||
62 | |||
63 | /******************************************************************** | ||
64 | VerFreeVersion - frees any memory associated with a Verutil version. | ||
65 | |||
66 | *******************************************************************/ | ||
67 | void DAPI VerFreeVersion( | ||
68 | __in VERUTIL_VERSION* pVersion | ||
69 | ); | ||
70 | |||
71 | /******************************************************************* | ||
72 | VerParseVersion - parses the string into a Verutil version. | ||
73 | |||
74 | *******************************************************************/ | ||
75 | HRESULT DAPI VerParseVersion( | ||
76 | __in_z LPCWSTR wzVersion, | ||
77 | __in SIZE_T cchVersion, | ||
78 | __in BOOL fStrict, | ||
79 | __out VERUTIL_VERSION** ppVersion | ||
80 | ); | ||
81 | |||
82 | /******************************************************************* | ||
83 | VerParseVersion - parses the QWORD into a Verutil version. | ||
84 | |||
85 | *******************************************************************/ | ||
86 | HRESULT DAPI VerVersionFromQword( | ||
87 | __in DWORD64 qwVersion, | ||
88 | __out VERUTIL_VERSION** ppVersion | ||
89 | ); | ||
90 | |||
91 | #ifdef __cplusplus | ||
92 | } | ||
93 | #endif | ||