main
h 98 lines 2.89 KB
Raw
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 WCHAR chPrefix;
23 DWORD dwMajor;
24 DWORD dwMinor;
25 DWORD dwPatch;
26 DWORD dwRevision;
27 DWORD cReleaseLabels;
28 VERUTIL_VERSION_RELEASE_LABEL* rgReleaseLabels;
29 SIZE_T cchMetadataOffset;
30 BOOL fInvalid;
31 BOOL fHasMajor;
32 BOOL fHasMinor;
33 BOOL fHasPatch;
34 BOOL fHasRevision;
35 } VERUTIL_VERSION;
36
37 /*******************************************************************
38 VerCompareParsedVersions - compares the Verutil versions.
39
40 *******************************************************************/
41 HRESULT DAPI VerCompareParsedVersions(
42 __in_opt VERUTIL_VERSION* pVersion1,
43 __in_opt VERUTIL_VERSION* pVersion2,
44 __out int* pnResult
45 );
46
47 /*******************************************************************
48 VerCompareStringVersions - parses the strings with VerParseVersion and then
49 compares the Verutil versions with VerCompareParsedVersions.
50
51 *******************************************************************/
52 HRESULT DAPI VerCompareStringVersions(
53 __in_z LPCWSTR wzVersion1,
54 __in_z LPCWSTR wzVersion2,
55 __in BOOL fStrict,
56 __out int* pnResult
57 );
58
59 /********************************************************************
60 VerCopyVersion - copies the given Verutil version.
61
62 *******************************************************************/
63 HRESULT DAPI VerCopyVersion(
64 __in VERUTIL_VERSION* pSource,
65 __out VERUTIL_VERSION** ppVersion
66 );
67
68 /********************************************************************
69 VerFreeVersion - frees any memory associated with a Verutil version.
70
71 *******************************************************************/
72 void DAPI VerFreeVersion(
73 __in VERUTIL_VERSION* pVersion
74 );
75
76 /*******************************************************************
77 VerParseVersion - parses the string into a Verutil version.
78
79 *******************************************************************/
80 HRESULT DAPI VerParseVersion(
81 __in_z LPCWSTR wzVersion,
82 __in SIZE_T cchVersion,
83 __in BOOL fStrict,
84 __out VERUTIL_VERSION** ppVersion
85 );
86
87 /*******************************************************************
88 VerParseVersion - parses the QWORD into a Verutil version.
89
90 *******************************************************************/
91 HRESULT DAPI VerVersionFromQword(
92 __in DWORD64 qwVersion,
93 __out VERUTIL_VERSION** ppVersion
94 );
95
96 #ifdef __cplusplus
97 }
98 #endif