aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/aclutil.h154
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/apputil.h45
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/apuputil.h87
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/atomutil.h146
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/buffutil.h91
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/butil.h60
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/cabcutil.h62
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/cabutil.h56
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/certutil.h66
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/conutil.h80
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/cryputil.h106
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/deputil.h147
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dictutil.h69
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dirutil.h59
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dlutil.h59
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dpiutil.h120
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dutil.h190
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/dutilsources.h76
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/eseutil.h223
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/fileutil.h247
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/gdiputil.h39
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/guidutil.h21
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/iis7util.h222
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/inetutil.h39
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/iniutil.h79
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/jsonutil.h112
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/locutil.h120
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/logutil.h192
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/memutil.h80
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/metautil.h52
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/monutil.h108
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/osutil.h42
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/pathutil.h252
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/perfutil.h24
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/polcutil.h39
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/procutil.h75
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/regutil.h246
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/resrutil.h43
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/reswutil.h31
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/rexutil.h54
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/rmutil.h46
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/rssutil.h89
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/sceutil.h273
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/sczutil.h30
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/shelutil.h47
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h136
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/srputil.h45
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/strutil.h316
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/svcutil.h21
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/thmutil.h765
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/timeutil.h38
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/uncutil.h20
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/uriutil.h100
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/userutil.h32
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/verutil.h93
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/wiutil.h402
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/wuautil.h19
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/xmlutil.h167
58 files changed, 6652 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/aclutil.h b/src/libs/dutil/WixToolset.DUtil/inc/aclutil.h
new file mode 100644
index 00000000..ac03f9a8
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/aclutil.h
@@ -0,0 +1,154 @@
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#include <aclapi.h>
6#include <sddl.h>
7
8#define ReleaseSid(x) if (x) { AclFreeSid(x); }
9#define ReleaseNullSid(x) if (x) { AclFreeSid(x); x = NULL; }
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15// structs
16struct ACL_ACCESS
17{
18 BOOL fDenyAccess;
19 DWORD dwAccessMask;
20
21 // TODO: consider using a union
22 LPCWSTR pwzAccountName; // NOTE: the last three items in this structure are ignored if this is not NULL
23
24 SID_IDENTIFIER_AUTHORITY sia; // used if pwzAccountName is NULL
25 BYTE nSubAuthorityCount;
26 DWORD nSubAuthority[8];
27};
28
29struct ACL_ACE
30{
31 DWORD dwFlags;
32 DWORD dwMask;
33 PSID psid;
34};
35
36
37// functions
38HRESULT DAPI AclCheckAccess(
39 __in HANDLE hToken,
40 __in ACL_ACCESS* paa
41 );
42HRESULT DAPI AclCheckAdministratorAccess(
43 __in HANDLE hToken
44 );
45HRESULT DAPI AclCheckLocalSystemAccess(
46 __in HANDLE hToken
47 );
48
49HRESULT DAPI AclGetWellKnownSid(
50 __in WELL_KNOWN_SID_TYPE wkst,
51 __deref_out PSID* ppsid
52 );
53HRESULT DAPI AclGetAccountSid(
54 __in_opt LPCWSTR wzSystem,
55 __in_z LPCWSTR wzAccount,
56 __deref_out PSID* ppsid
57 );
58HRESULT DAPI AclGetAccountSidString(
59 __in_z LPCWSTR wzSystem,
60 __in_z LPCWSTR wzAccount,
61 __deref_out_z LPWSTR* ppwzSid
62 );
63
64HRESULT DAPI AclCreateDacl(
65 __in_ecount(cDeny) ACL_ACE rgaaDeny[],
66 __in DWORD cDeny,
67 __in_ecount(cAllow) ACL_ACE rgaaAllow[],
68 __in DWORD cAllow,
69 __deref_out ACL** ppAcl
70 );
71HRESULT DAPI AclAddToDacl(
72 __in ACL* pAcl,
73 __in_ecount_opt(cDeny) const ACL_ACE rgaaDeny[],
74 __in DWORD cDeny,
75 __in_ecount_opt(cAllow) const ACL_ACE rgaaAllow[],
76 __in DWORD cAllow,
77 __deref_out ACL** ppAclNew
78 );
79HRESULT DAPI AclMergeDacls(
80 __in const ACL* pAcl1,
81 __in const ACL* pAcl2,
82 __deref_out ACL** ppAclNew
83 );
84HRESULT DAPI AclCreateDaclOld(
85 __in_ecount(cAclAccesses) ACL_ACCESS* paa,
86 __in DWORD cAclAccesses,
87 __deref_out ACL** ppAcl
88 );
89HRESULT DAPI AclCreateSecurityDescriptor(
90 __in_ecount(cAclAccesses) ACL_ACCESS* paa,
91 __in DWORD cAclAccesses,
92 __deref_out SECURITY_DESCRIPTOR** ppsd
93 );
94HRESULT DAPI AclCreateSecurityDescriptorFromDacl(
95 __in ACL* pACL,
96 __deref_out SECURITY_DESCRIPTOR** ppsd
97 );
98HRESULT __cdecl AclCreateSecurityDescriptorFromString(
99 __deref_out SECURITY_DESCRIPTOR** ppsd,
100 __in_z __format_string LPCWSTR wzSddlFormat,
101 ...
102 );
103HRESULT DAPI AclDuplicateSecurityDescriptor(
104 __in SECURITY_DESCRIPTOR* psd,
105 __deref_out SECURITY_DESCRIPTOR** ppsd
106 );
107HRESULT DAPI AclGetSecurityDescriptor(
108 __in_z LPCWSTR wzObject,
109 __in SE_OBJECT_TYPE sot,
110 __in SECURITY_INFORMATION securityInformation,
111 __deref_out SECURITY_DESCRIPTOR** ppsd
112 );
113HRESULT DAPI AclSetSecurityWithRetry(
114 __in_z LPCWSTR wzObject,
115 __in SE_OBJECT_TYPE sot,
116 __in SECURITY_INFORMATION securityInformation,
117 __in_opt PSID psidOwner,
118 __in_opt PSID psidGroup,
119 __in_opt PACL pDacl,
120 __in_opt PACL pSacl,
121 __in DWORD cRetry,
122 __in DWORD dwWaitMilliseconds
123 );
124
125HRESULT DAPI AclFreeSid(
126 __in PSID psid
127 );
128HRESULT DAPI AclFreeDacl(
129 __in ACL* pACL
130 );
131HRESULT DAPI AclFreeSecurityDescriptor(
132 __in SECURITY_DESCRIPTOR* psd
133 );
134
135HRESULT DAPI AclAddAdminToSecurityDescriptor(
136 __in SECURITY_DESCRIPTOR* pSecurity,
137 __deref_out SECURITY_DESCRIPTOR** ppSecurityNew
138 );
139
140// Following code in acl2util.cpp due to dependency on crypt32.dll.
141HRESULT DAPI AclCalculateServiceSidString(
142 __in LPCWSTR wzServiceName,
143 __in SIZE_T cchServiceName,
144 __deref_out_z LPWSTR* psczSid
145 );
146HRESULT DAPI AclGetAccountSidStringEx(
147 __in_z LPCWSTR wzSystem,
148 __in_z LPCWSTR wzAccount,
149 __deref_out_z LPWSTR* psczSid
150 );
151
152#ifdef __cplusplus
153}
154#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/apputil.h b/src/libs/dutil/WixToolset.DUtil/inc/apputil.h
new file mode 100644
index 00000000..1a1e14f7
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/apputil.h
@@ -0,0 +1,45 @@
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
6extern "C" {
7#endif
8
9// functions
10
11/********************************************************************
12AppFreeCommandLineArgs - frees argv from AppParseCommandLine.
13
14********************************************************************/
15void DAPI AppFreeCommandLineArgs(
16 __in LPWSTR* argv
17 );
18
19void DAPI AppInitialize(
20 __in_ecount(cSafelyLoadSystemDlls) LPCWSTR rgsczSafelyLoadSystemDlls[],
21 __in DWORD cSafelyLoadSystemDlls
22 );
23
24/********************************************************************
25AppInitializeUnsafe - initializes without the full standard safety
26 precautions for an application.
27
28********************************************************************/
29void DAPI AppInitializeUnsafe();
30
31/********************************************************************
32AppParseCommandLine - parses the command line using CommandLineToArgvW.
33 The caller must free the value of pArgv on success
34 by calling AppFreeCommandLineArgs.
35
36********************************************************************/
37DAPI_(HRESULT) AppParseCommandLine(
38 __in LPCWSTR wzCommandLine,
39 __in int* argc,
40 __in LPWSTR** pArgv
41 );
42
43#ifdef __cplusplus
44}
45#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/apuputil.h b/src/libs/dutil/WixToolset.DUtil/inc/apuputil.h
new file mode 100644
index 00000000..f26a12b7
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/apuputil.h
@@ -0,0 +1,87 @@
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
6extern "C" {
7#endif
8
9#define ReleaseApupChain(p) if (p) { ApupFreeChain(p); p = NULL; }
10#define ReleaseNullApupChain(p) if (p) { ApupFreeChain(p); p = NULL; }
11
12
13const LPCWSTR APPLICATION_SYNDICATION_NAMESPACE = L"http://appsyndication.org/2006/appsyn";
14
15typedef enum APUP_HASH_ALGORITHM
16{
17 APUP_HASH_ALGORITHM_UNKNOWN,
18 APUP_HASH_ALGORITHM_MD5,
19 APUP_HASH_ALGORITHM_SHA1,
20 APUP_HASH_ALGORITHM_SHA256,
21 APUP_HASH_ALGORITHM_SHA512,
22} APUP_HASH_ALGORITHM;
23
24
25struct APPLICATION_UPDATE_ENCLOSURE
26{
27 LPWSTR wzUrl;
28 LPWSTR wzLocalName;
29 DWORD64 dw64Size;
30
31 BYTE* rgbDigest;
32 DWORD cbDigest;
33 APUP_HASH_ALGORITHM digestAlgorithm;
34
35 BOOL fInstaller;
36};
37
38
39struct APPLICATION_UPDATE_ENTRY
40{
41 LPWSTR wzApplicationId;
42 LPWSTR wzApplicationType;
43 LPWSTR wzTitle;
44 LPWSTR wzSummary;
45 LPWSTR wzContentType;
46 LPWSTR wzContent;
47
48 LPWSTR wzUpgradeId;
49 BOOL fUpgradeExclusive;
50 VERUTIL_VERSION* pVersion;
51 VERUTIL_VERSION* pUpgradeVersion;
52
53 DWORD64 dw64TotalSize;
54
55 DWORD cEnclosures;
56 APPLICATION_UPDATE_ENCLOSURE* rgEnclosures;
57};
58
59
60struct APPLICATION_UPDATE_CHAIN
61{
62 LPWSTR wzDefaultApplicationId;
63 LPWSTR wzDefaultApplicationType;
64
65 DWORD cEntries;
66 APPLICATION_UPDATE_ENTRY* rgEntries;
67};
68
69
70HRESULT DAPI ApupAllocChainFromAtom(
71 __in ATOM_FEED* pFeed,
72 __out APPLICATION_UPDATE_CHAIN** ppChain
73 );
74
75HRESULT DAPI ApupFilterChain(
76 __in APPLICATION_UPDATE_CHAIN* pChain,
77 __in VERUTIL_VERSION* pVersion,
78 __out APPLICATION_UPDATE_CHAIN** ppFilteredChain
79 );
80
81void DAPI ApupFreeChain(
82 __in APPLICATION_UPDATE_CHAIN* pChain
83 );
84
85#ifdef __cplusplus
86}
87#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/atomutil.h b/src/libs/dutil/WixToolset.DUtil/inc/atomutil.h
new file mode 100644
index 00000000..9acfc1d5
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/atomutil.h
@@ -0,0 +1,146 @@
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
6extern "C" {
7#endif
8
9#define ReleaseAtomFeed(p) if (p) { AtomFreeFeed(p); }
10#define ReleaseNullAtomFeed(p) if (p) { AtomFreeFeed(p); p = NULL; }
11
12
13struct ATOM_UNKNOWN_ATTRIBUTE
14{
15 LPWSTR wzNamespace;
16 LPWSTR wzAttribute;
17 LPWSTR wzValue;
18
19 ATOM_UNKNOWN_ATTRIBUTE* pNext;
20};
21
22struct ATOM_UNKNOWN_ELEMENT
23{
24 LPWSTR wzNamespace;
25 LPWSTR wzElement;
26 LPWSTR wzValue;
27
28 ATOM_UNKNOWN_ATTRIBUTE* pAttributes;
29 ATOM_UNKNOWN_ELEMENT* pNext;
30};
31
32struct ATOM_LINK
33{
34 LPWSTR wzRel;
35 LPWSTR wzTitle;
36 LPWSTR wzType;
37 LPWSTR wzUrl;
38 LPWSTR wzValue;
39 DWORD64 dw64Length;
40
41 ATOM_UNKNOWN_ATTRIBUTE* pUnknownAttributes;
42 ATOM_UNKNOWN_ELEMENT* pUnknownElements;
43};
44
45struct ATOM_CONTENT
46{
47 LPWSTR wzType;
48 LPWSTR wzUrl;
49 LPWSTR wzValue;
50
51 ATOM_UNKNOWN_ELEMENT* pUnknownElements;
52};
53
54struct ATOM_AUTHOR
55{
56 LPWSTR wzName;
57 LPWSTR wzEmail;
58 LPWSTR wzUrl;
59};
60
61struct ATOM_CATEGORY
62{
63 LPWSTR wzLabel;
64 LPWSTR wzScheme;
65 LPWSTR wzTerm;
66
67 ATOM_UNKNOWN_ELEMENT* pUnknownElements;
68};
69
70struct ATOM_ENTRY
71{
72 LPWSTR wzId;
73 LPWSTR wzSummary;
74 LPWSTR wzTitle;
75 FILETIME ftPublished;
76 FILETIME ftUpdated;
77
78 ATOM_CONTENT* pContent;
79
80 DWORD cAuthors;
81 ATOM_AUTHOR* rgAuthors;
82
83 DWORD cCategories;
84 ATOM_CATEGORY* rgCategories;
85
86 DWORD cLinks;
87 ATOM_LINK* rgLinks;
88
89 IXMLDOMNode* pixn;
90 ATOM_UNKNOWN_ELEMENT* pUnknownElements;
91};
92
93struct ATOM_FEED
94{
95 LPWSTR wzGenerator;
96 LPWSTR wzIcon;
97 LPWSTR wzId;
98 LPWSTR wzLogo;
99 LPWSTR wzSubtitle;
100 LPWSTR wzTitle;
101 FILETIME ftUpdated;
102
103 DWORD cAuthors;
104 ATOM_AUTHOR* rgAuthors;
105
106 DWORD cCategories;
107 ATOM_CATEGORY* rgCategories;
108
109 DWORD cEntries;
110 ATOM_ENTRY* rgEntries;
111
112 DWORD cLinks;
113 ATOM_LINK* rgLinks;
114
115 IXMLDOMNode* pixn;
116 ATOM_UNKNOWN_ELEMENT* pUnknownElements;
117};
118
119HRESULT DAPI AtomInitialize(
120 );
121
122void DAPI AtomUninitialize(
123 );
124
125HRESULT DAPI AtomParseFromString(
126 __in_z LPCWSTR wzAtomString,
127 __out ATOM_FEED **ppFeed
128 );
129
130HRESULT DAPI AtomParseFromFile(
131 __in_z LPCWSTR wzAtomFile,
132 __out ATOM_FEED **ppFeed
133 );
134
135HRESULT DAPI AtomParseFromDocument(
136 __in IXMLDOMDocument* pixdDocument,
137 __out ATOM_FEED **ppFeed
138 );
139
140void DAPI AtomFreeFeed(
141 __in_xcount(pFeed->cItems) ATOM_FEED* pFeed
142 );
143
144#ifdef __cplusplus
145}
146#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/buffutil.h b/src/libs/dutil/WixToolset.DUtil/inc/buffutil.h
new file mode 100644
index 00000000..322209e6
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/buffutil.h
@@ -0,0 +1,91 @@
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
6extern "C" {
7#endif
8
9
10// macro definitions
11
12#define ReleaseBuffer ReleaseMem
13#define ReleaseNullBuffer ReleaseNullMem
14#define BuffFree MemFree
15
16
17// function declarations
18
19HRESULT BuffReadNumber(
20 __in_bcount(cbBuffer) const BYTE* pbBuffer,
21 __in SIZE_T cbBuffer,
22 __inout SIZE_T* piBuffer,
23 __out DWORD* pdw
24 );
25HRESULT BuffReadNumber64(
26 __in_bcount(cbBuffer) const BYTE* pbBuffer,
27 __in SIZE_T cbBuffer,
28 __inout SIZE_T* piBuffer,
29 __out DWORD64* pdw64
30 );
31HRESULT BuffReadPointer(
32 __in_bcount(cbBuffer) const BYTE* pbBuffer,
33 __in SIZE_T cbBuffer,
34 __inout SIZE_T* piBuffer,
35 __out DWORD_PTR* pdw
36);
37HRESULT BuffReadString(
38 __in_bcount(cbBuffer) const BYTE* pbBuffer,
39 __in SIZE_T cbBuffer,
40 __inout SIZE_T* piBuffer,
41 __deref_out_z LPWSTR* pscz
42 );
43HRESULT BuffReadStringAnsi(
44 __in_bcount(cbBuffer) const BYTE* pbBuffer,
45 __in SIZE_T cbBuffer,
46 __inout SIZE_T* piBuffer,
47 __deref_out_z LPSTR* pscz
48 );
49HRESULT BuffReadStream(
50 __in_bcount(cbBuffer) const BYTE* pbBuffer,
51 __in SIZE_T cbBuffer,
52 __inout SIZE_T* piBuffer,
53 __deref_inout_bcount(*pcbStream) BYTE** ppbStream,
54 __out SIZE_T* pcbStream
55 );
56
57HRESULT BuffWriteNumber(
58 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
59 __inout SIZE_T* piBuffer,
60 __in DWORD dw
61 );
62HRESULT BuffWriteNumber64(
63 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
64 __inout SIZE_T* piBuffer,
65 __in DWORD64 dw64
66 );
67HRESULT BuffWritePointer(
68 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
69 __inout SIZE_T* piBuffer,
70 __in DWORD_PTR dw
71);
72HRESULT BuffWriteString(
73 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
74 __inout SIZE_T* piBuffer,
75 __in_z_opt LPCWSTR scz
76 );
77HRESULT BuffWriteStringAnsi(
78 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
79 __inout SIZE_T* piBuffer,
80 __in_z_opt LPCSTR scz
81 );
82HRESULT BuffWriteStream(
83 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
84 __inout SIZE_T* piBuffer,
85 __in_bcount(cbStream) const BYTE* pbStream,
86 __in SIZE_T cbStream
87 );
88
89#ifdef __cplusplus
90}
91#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/butil.h b/src/libs/dutil/WixToolset.DUtil/inc/butil.h
new file mode 100644
index 00000000..d1ec73bc
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/butil.h
@@ -0,0 +1,60 @@
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
6extern "C" {
7#endif
8
9enum BUNDLE_INSTALL_CONTEXT
10{
11 BUNDLE_INSTALL_CONTEXT_MACHINE,
12 BUNDLE_INSTALL_CONTEXT_USER,
13};
14
15
16/********************************************************************
17BundleGetBundleInfo - Queries the bundle installation metadata for a given property
18
19RETURNS:
20 E_INVALIDARG
21 An invalid parameter was passed to the function.
22 HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT)
23 The bundle is not installed
24 HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY)
25 The property is unrecognized
26 HRESULT_FROM_WIN32(ERROR_MORE_DATA)
27 A buffer is too small to hold the requested data.
28 E_NOTIMPL:
29 Tried to read a bundle attribute for a type which has not been implemented
30
31 All other returns are unexpected returns from other dutil methods.
32********************************************************************/
33HRESULT DAPI BundleGetBundleInfo(
34 __in_z LPCWSTR szBundleId, // Bundle code
35 __in_z LPCWSTR szAttribute, // attribute name
36 __out_ecount_opt(*pcchValueBuf) LPWSTR lpValueBuf, // returned value, NULL if not desired
37 __inout_opt LPDWORD pcchValueBuf // in/out buffer character count
38 );
39
40/********************************************************************
41BundleEnumRelatedBundle - Queries the bundle installation metadata for installs with the given upgrade code
42
43NOTE: lpBundleIdBuff is a buffer to receive the bundle GUID. This buffer must be 39 characters long.
44 The first 38 characters are for the GUID, and the last character is for the terminating null character.
45RETURNS:
46 E_INVALIDARG
47 An invalid parameter was passed to the function.
48
49 All other returns are unexpected returns from other dutil methods.
50********************************************************************/
51HRESULT DAPI BundleEnumRelatedBundle(
52 __in_z LPCWSTR lpUpgradeCode,
53 __in BUNDLE_INSTALL_CONTEXT context,
54 __inout PDWORD pdwStartIndex,
55 __out_ecount(MAX_GUID_CHARS+1) LPWSTR lpBundleIdBuf
56 );
57
58#ifdef __cplusplus
59}
60#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/cabcutil.h b/src/libs/dutil/WixToolset.DUtil/inc/cabcutil.h
new file mode 100644
index 00000000..4f0c7b13
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/cabcutil.h
@@ -0,0 +1,62 @@
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#include <fci.h>
6#include <fcntl.h>
7#include <msi.h>
8
9// Callback from PFNFCIGETNEXTCABINET CabCGetNextCabinet method
10// First argument is the name of splitting cabinet without extension e.g. "cab1"
11// Second argument is name of the new cabinet that would be formed by splitting e.g. "cab1b.cab"
12// Third argument is the file token of the first file present in the splitting cabinet
13typedef void (__stdcall * FileSplitCabNamesCallback)(LPWSTR, LPWSTR, LPWSTR);
14
15#define CAB_MAX_SIZE 0x7FFFFFFF // (see KB: Q174866)
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21extern const int CABC_HANDLE_BYTES;
22
23// time vs. space trade-off
24typedef enum COMPRESSION_TYPE
25{
26 COMPRESSION_TYPE_NONE, // fastest
27 COMPRESSION_TYPE_LOW,
28 COMPRESSION_TYPE_MEDIUM,
29 COMPRESSION_TYPE_HIGH, // smallest
30 COMPRESSION_TYPE_MSZIP
31} COMPRESSION_TYPE;
32
33// functions
34HRESULT DAPI CabCBegin(
35 __in_z LPCWSTR wzCab,
36 __in_z LPCWSTR wzCabDir,
37 __in DWORD dwMaxFiles,
38 __in DWORD dwMaxSize,
39 __in DWORD dwMaxThresh,
40 __in COMPRESSION_TYPE ct,
41 __out_bcount(CABC_HANDLE_BYTES) HANDLE *phContext
42 );
43HRESULT DAPI CabCNextCab(
44 __in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
45 );
46HRESULT DAPI CabCAddFile(
47 __in_z LPCWSTR wzFile,
48 __in_z_opt LPCWSTR wzToken,
49 __in_opt PMSIFILEHASHINFO pmfHash,
50 __in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
51 );
52HRESULT DAPI CabCFinish(
53 __in_bcount(CABC_HANDLE_BYTES) HANDLE hContext,
54 __in_opt FileSplitCabNamesCallback fileSplitCabNamesCallback
55 );
56void DAPI CabCCancel(
57 __in_bcount(CABC_HANDLE_BYTES) HANDLE hContext
58 );
59
60#ifdef __cplusplus
61}
62#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/cabutil.h b/src/libs/dutil/WixToolset.DUtil/inc/cabutil.h
new file mode 100644
index 00000000..0bedba80
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/cabutil.h
@@ -0,0 +1,56 @@
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#include <fdi.h>
6#include <sys\stat.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12// structs
13
14
15// callback function prototypes
16typedef HRESULT (*CAB_CALLBACK_OPEN_FILE)(LPCWSTR wzFile, INT_PTR* ppFile);
17typedef HRESULT (*CAB_CALLBACK_READ_FILE)(INT_PTR pFile, LPVOID pvData, DWORD cbData, DWORD* pcbRead);
18typedef HRESULT (*CAB_CALLBACK_WRITE_FILE)(INT_PTR pFile, LPVOID pvData, DWORD cbData, DWORD* pcbRead);
19typedef LONG (*CAB_CALLBACK_SEEK_FILE)(INT_PTR pFile, DWORD dwMove, DWORD dwMoveMethod);
20typedef HRESULT (*CAB_CALLBACK_CLOSE_FILE)(INT_PTR pFile);
21
22typedef HRESULT (*CAB_CALLBACK_BEGIN_FILE)(LPCWSTR wzFileId, FILETIME* pftFileTime, DWORD cbFileSize, LPVOID pvContext, INT_PTR* ppFile);
23typedef HRESULT (*CAB_CALLBACK_END_FILE)(LPCWSTR wzFileId, LPVOID pvContext, INT_PTR pFile);
24typedef HRESULT (*CAB_CALLBACK_PROGRESS)(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext);
25
26// function type with calling convention of __stdcall that .NET 1.1 understands only
27// .NET 2.0 will not need this
28typedef INT_PTR (FAR __stdcall *STDCALL_PFNFDINOTIFY)(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin);
29
30
31// functions
32HRESULT DAPI CabInitialize(
33 __in BOOL fDelayLoad
34 );
35void DAPI CabUninitialize(
36 );
37
38HRESULT DAPI CabExtract(
39 __in_z LPCWSTR wzCabinet,
40 __in_z LPCWSTR wzExtractFile,
41 __in_z LPCWSTR wzExtractDir,
42 __in_opt CAB_CALLBACK_PROGRESS pfnProgress,
43 __in_opt LPVOID pvContext,
44 __in DWORD64 dw64EmbeddedOffset
45 );
46
47HRESULT DAPI CabEnumerate(
48 __in_z LPCWSTR wzCabinet,
49 __in_z LPCWSTR wzEnumerateFile,
50 __in STDCALL_PFNFDINOTIFY pfnNotify,
51 __in DWORD64 dw64EmbeddedOffset
52 );
53
54#ifdef __cplusplus
55}
56#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/certutil.h b/src/libs/dutil/WixToolset.DUtil/inc/certutil.h
new file mode 100644
index 00000000..8565c1cf
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/certutil.h
@@ -0,0 +1,66 @@
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#define ReleaseCertStore(p) if (p) { ::CertCloseStore(p, 0); p = NULL; }
6#define ReleaseCertContext(p) if (p) { ::CertFreeCertificateContext(p); p = NULL; }
7#define ReleaseCertChain(p) if (p) { ::CertFreeCertificateChain(p); p = NULL; }
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13HRESULT DAPI CertReadProperty(
14 __in PCCERT_CONTEXT pCertContext,
15 __in DWORD dwProperty,
16 __out_bcount(*pcbValue) LPVOID pvValue,
17 __out_opt DWORD* pcbValue
18 );
19
20HRESULT DAPI CertGetAuthenticodeSigningTimestamp(
21 __in CMSG_SIGNER_INFO* pSignerInfo,
22 __out FILETIME* pft
23 );
24
25HRESULT DAPI GetCryptProvFromCert(
26 __in_opt HWND hwnd,
27 __in PCCERT_CONTEXT pCert,
28 __out HCRYPTPROV *phCryptProv,
29 __out DWORD *pdwKeySpec,
30 __in BOOL *pfDidCryptAcquire,
31 __deref_opt_out LPWSTR *ppwszTmpContainer,
32 __deref_opt_out LPWSTR *ppwszProviderName,
33 __out DWORD *pdwProviderType
34 );
35
36HRESULT DAPI FreeCryptProvFromCert(
37 __in BOOL fAcquired,
38 __in HCRYPTPROV hProv,
39 __in_opt LPWSTR pwszCapiProvider,
40 __in DWORD dwProviderType,
41 __in_opt LPWSTR pwszTmpContainer
42 );
43
44HRESULT DAPI GetProvSecurityDesc(
45 __in HCRYPTPROV hProv,
46 __deref_out SECURITY_DESCRIPTOR** pSecurity
47 );
48
49HRESULT DAPI SetProvSecurityDesc(
50 __in HCRYPTPROV hProv,
51 __in SECURITY_DESCRIPTOR* pSecurity
52 );
53
54BOOL DAPI CertHasPrivateKey(
55 __in PCCERT_CONTEXT pCertContext,
56 __out_opt DWORD* pdwKeySpec
57 );
58
59HRESULT DAPI CertInstallSingleCertificate(
60 __in HCERTSTORE hStore,
61 __in PCCERT_CONTEXT pCertContext,
62 __in LPCWSTR wzName
63 );
64#ifdef __cplusplus
65}
66#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/conutil.h b/src/libs/dutil/WixToolset.DUtil/inc/conutil.h
new file mode 100644
index 00000000..38aaea84
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/conutil.h
@@ -0,0 +1,80 @@
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
6extern "C" {
7#endif
8
9#define ConsoleExitOnFailureSource(d, x, c, f, ...) if (FAILED(x)) { ConsoleWriteError(x, c, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
10#define ConsoleExitOnLastErrorSource(d, x, c, f, ...) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (FAILED(x)) { ConsoleWriteError(x, c, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; } }
11#define ConsoleExitOnNullSource(d, p, x, e, c, f, ...) if (NULL == p) { x = e; ConsoleWriteError(x, c, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
12#define ConsoleExitOnNullWithLastErrorSource(d, p, x, c, f, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } ConsoleWriteError(x, c, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
13#define ConsoleExitWithLastErrorSource(d, x, c, f, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } ConsoleWriteError(x, c, f, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
14
15
16#define ConsoleExitOnFailure(x, c, f, ...) ConsoleExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, c, f, __VA_ARGS__)
17#define ConsoleExitOnLastError(x, c, f, ...) ConsoleExitOnLastErrorSource(DUTIL_SOURCE_DEFAULT, x, c, f, __VA_ARGS__)
18#define ConsoleExitOnNull(p, x, e, c, f, ...) ConsoleExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, c, f, __VA_ARGS__)
19#define ConsoleExitOnNullWithLastError(p, x, c, f, ...) ConsoleExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, c, f, __VA_ARGS__)
20#define ConsoleExitWithLastError(x, c, f, ...) ConsoleExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, c, f, __VA_ARGS__)
21
22// enums
23typedef enum CONSOLE_COLOR { CONSOLE_COLOR_NORMAL, CONSOLE_COLOR_RED, CONSOLE_COLOR_YELLOW, CONSOLE_COLOR_GREEN } CONSOLE_COLOR;
24
25// structs
26
27// functions
28HRESULT DAPI ConsoleInitialize();
29void DAPI ConsoleUninitialize();
30
31void DAPI ConsoleGreen();
32void DAPI ConsoleRed();
33void DAPI ConsoleYellow();
34void DAPI ConsoleNormal();
35
36HRESULT DAPI ConsoleWrite(
37 CONSOLE_COLOR cc,
38 __in_z __format_string LPCSTR szFormat,
39 ...
40 );
41HRESULT DAPI ConsoleWriteLine(
42 CONSOLE_COLOR cc,
43 __in_z __format_string LPCSTR szFormat,
44 ...
45 );
46HRESULT DAPI ConsoleWriteError(
47 HRESULT hrError,
48 CONSOLE_COLOR cc,
49 __in_z __format_string LPCSTR szFormat,
50 ...
51 );
52
53HRESULT DAPI ConsoleReadW(
54 __deref_out_z LPWSTR* ppwzBuffer
55 );
56
57HRESULT DAPI ConsoleReadStringA(
58 __deref_inout_ecount_part(cchCharBuffer,*pcchNumCharReturn) LPSTR* szCharBuffer,
59 CONST DWORD cchCharBuffer,
60 __out DWORD* pcchNumCharReturn
61 );
62HRESULT DAPI ConsoleReadStringW(
63 __deref_inout_ecount_part(cchCharBuffer,*pcchNumCharReturn) LPWSTR* szCharBuffer,
64 CONST DWORD cchCharBuffer,
65 __out DWORD* pcchNumCharReturn
66 );
67
68HRESULT DAPI ConsoleReadNonBlockingW(
69 __deref_out_ecount_opt(*pcchSize) LPWSTR* ppwzBuffer,
70 __out DWORD* pcchSize,
71 BOOL fReadLine
72 );
73
74HRESULT DAPI ConsoleSetReadHidden(void);
75HRESULT DAPI ConsoleSetReadNormal(void);
76
77#ifdef __cplusplus
78}
79#endif
80
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/cryputil.h b/src/libs/dutil/WixToolset.DUtil/inc/cryputil.h
new file mode 100644
index 00000000..02492d8a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/cryputil.h
@@ -0,0 +1,106 @@
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#define ReleaseCryptMsg(p) if (p) { ::CryptMsgClose(p); p = NULL; }
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11
12// Use CRYPTPROTECTMEMORY_BLOCK_SIZE, because it's larger and thus more restrictive than RTL_ENCRYPT_MEMORY_SIZE.
13#define CRYP_ENCRYPT_MEMORY_SIZE CRYPTPROTECTMEMORY_BLOCK_SIZE
14#define MD5_HASH_LEN 16
15#define SHA1_HASH_LEN 20
16#define SHA256_HASH_LEN 32
17#define SHA512_HASH_LEN 64
18
19typedef NTSTATUS (APIENTRY *PFN_RTLENCRYPTMEMORY)(
20 __inout PVOID Memory,
21 __in ULONG MemoryLength,
22 __in ULONG OptionFlags
23 );
24
25typedef NTSTATUS (APIENTRY *PFN_RTLDECRYPTMEMORY)(
26 __inout PVOID Memory,
27 __in ULONG MemoryLength,
28 __in ULONG OptionFlags
29 );
30
31typedef BOOL (APIENTRY *PFN_CRYPTPROTECTMEMORY)(
32 __inout LPVOID pData,
33 __in DWORD cbData,
34 __in DWORD dwFlags
35 );
36
37typedef BOOL (APIENTRY *PFN_CRYPTUNPROTECTMEMORY)(
38 __inout LPVOID pData,
39 __in DWORD cbData,
40 __in DWORD dwFlags
41 );
42
43// function declarations
44
45HRESULT DAPI CrypInitialize();
46void DAPI CrypUninitialize();
47
48HRESULT DAPI CrypDecodeObject(
49 __in_z LPCSTR szStructType,
50 __in_ecount(cbData) const BYTE* pbData,
51 __in DWORD cbData,
52 __in DWORD dwFlags,
53 __out LPVOID* ppvObject,
54 __out_opt DWORD* pcbObject
55 );
56
57HRESULT DAPI CrypMsgGetParam(
58 __in HCRYPTMSG hCryptMsg,
59 __in DWORD dwType,
60 __in DWORD dwIndex,
61 __out LPVOID* ppvData,
62 __out_opt DWORD* pcbData
63 );
64
65HRESULT DAPI CrypHashFile(
66 __in_z LPCWSTR wzFilePath,
67 __in DWORD dwProvType,
68 __in ALG_ID algid,
69 __out_bcount(cbHash) BYTE* pbHash,
70 __in DWORD cbHash,
71 __out_opt DWORD64* pqwBytesHashed
72 );
73
74HRESULT DAPI CrypHashFileHandle(
75 __in HANDLE hFile,
76 __in DWORD dwProvType,
77 __in ALG_ID algid,
78 __out_bcount(cbHash) BYTE* pbHash,
79 __in DWORD cbHash,
80 __out_opt DWORD64* pqwBytesHashed
81 );
82
83HRESULT DAPI CrypHashBuffer(
84 __in_bcount(cbBuffer) const BYTE* pbBuffer,
85 __in SIZE_T cbBuffer,
86 __in DWORD dwProvType,
87 __in ALG_ID algid,
88 __out_bcount(cbHash) BYTE* pbHash,
89 __in DWORD cbHash
90 );
91
92HRESULT DAPI CrypEncryptMemory(
93 __inout LPVOID pData,
94 __in DWORD cbData,
95 __in DWORD dwFlags
96 );
97
98HRESULT DAPI CrypDecryptMemory(
99 __inout LPVOID pData,
100 __in DWORD cbData,
101 __in DWORD dwFlags
102 );
103
104#ifdef __cplusplus
105}
106#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/deputil.h b/src/libs/dutil/WixToolset.DUtil/inc/deputil.h
new file mode 100644
index 00000000..bfe235f3
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/deputil.h
@@ -0,0 +1,147 @@
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
6extern "C" {
7#endif
8
9#define ReleaseDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); }
10#define ReleaseNullDependencyArray(rg, c) if (rg) { DepDependencyArrayFree(rg, c); rg = NULL; }
11
12typedef struct _DEPENDENCY
13{
14 LPWSTR sczKey;
15 LPWSTR sczName;
16} DEPENDENCY;
17
18
19/***************************************************************************
20 DepGetProviderInformation - gets the various pieces of data registered
21 with a dependency.
22
23 Note: Returns E_NOTFOUND if the dependency was not found.
24***************************************************************************/
25DAPI_(HRESULT) DepGetProviderInformation(
26 __in HKEY hkHive,
27 __in_z LPCWSTR wzProviderKey,
28 __deref_out_z_opt LPWSTR* psczId,
29 __deref_out_z_opt LPWSTR* psczName,
30 __deref_out_z_opt LPWSTR* psczVersion
31 );
32
33/***************************************************************************
34 DepCheckDependency - Checks that the dependency is registered and within
35 the proper version range.
36
37 Note: Returns E_NOTFOUND if the dependency was not found.
38***************************************************************************/
39DAPI_(HRESULT) DepCheckDependency(
40 __in HKEY hkHive,
41 __in_z LPCWSTR wzProviderKey,
42 __in_z_opt LPCWSTR wzMinVersion,
43 __in_z_opt LPCWSTR wzMaxVersion,
44 __in int iAttributes,
45 __in STRINGDICT_HANDLE sdDependencies,
46 __deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies,
47 __inout LPUINT pcDependencies
48 );
49
50/***************************************************************************
51 DepCheckDependents - Checks if any dependents are still installed for the
52 given provider key.
53
54***************************************************************************/
55DAPI_(HRESULT) DepCheckDependents(
56 __in HKEY hkHive,
57 __in_z LPCWSTR wzProviderKey,
58 __reserved int iAttributes,
59 __in C_STRINGDICT_HANDLE sdIgnoredDependents,
60 __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents,
61 __inout LPUINT pcDependents
62 );
63
64/***************************************************************************
65 DepRegisterDependency - Registers the dependency provider.
66
67***************************************************************************/
68DAPI_(HRESULT) DepRegisterDependency(
69 __in HKEY hkHive,
70 __in_z LPCWSTR wzProviderKey,
71 __in_z LPCWSTR wzVersion,
72 __in_z LPCWSTR wzDisplayName,
73 __in_z_opt LPCWSTR wzId,
74 __in int iAttributes
75 );
76
77/***************************************************************************
78 DepDependentExists - Determines if a dependent is registered.
79
80 Note: Returns S_OK if dependent is registered.
81 Returns E_FILENOTFOUND if dependent is not registered
82***************************************************************************/
83DAPI_(HRESULT) DepDependentExists(
84 __in HKEY hkHive,
85 __in_z LPCWSTR wzDependencyProviderKey,
86 __in_z LPCWSTR wzProviderKey
87 );
88
89/***************************************************************************
90 DepRegisterDependent - Registers a dependent under the dependency provider.
91
92***************************************************************************/
93DAPI_(HRESULT) DepRegisterDependent(
94 __in HKEY hkHive,
95 __in_z LPCWSTR wzDependencyProviderKey,
96 __in_z LPCWSTR wzProviderKey,
97 __in_z_opt LPCWSTR wzMinVersion,
98 __in_z_opt LPCWSTR wzMaxVersion,
99 __in int iAttributes
100 );
101
102/***************************************************************************
103 DepUnregisterDependency - Removes the dependency provider.
104
105 Note: Caller should call CheckDependents prior to remove a dependency.
106 Returns E_FILENOTFOUND if the dependency is not registered.
107***************************************************************************/
108DAPI_(HRESULT) DepUnregisterDependency(
109 __in HKEY hkHive,
110 __in_z LPCWSTR wzProviderKey
111 );
112
113/***************************************************************************
114 DepUnregisterDependent - Removes a dependent under the dependency provider.
115
116 Note: Returns E_FILENOTFOUND if neither the dependency or dependent are
117 registered.
118 ***************************************************************************/
119DAPI_(HRESULT) DepUnregisterDependent(
120 __in HKEY hkHive,
121 __in_z LPCWSTR wzDependencyProviderKey,
122 __in_z LPCWSTR wzProviderKey
123 );
124
125/***************************************************************************
126 DependencyArrayAlloc - Allocates or expands an array of DEPENDENCY structs.
127
128***************************************************************************/
129DAPI_(HRESULT) DepDependencyArrayAlloc(
130 __deref_inout_ecount_opt(*pcDependencies) DEPENDENCY** prgDependencies,
131 __inout LPUINT pcDependencies,
132 __in_z LPCWSTR wzKey,
133 __in_z_opt LPCWSTR wzName
134 );
135
136/***************************************************************************
137 DepDependencyArrayFree - Frees an array of DEPENDENCY structs.
138
139***************************************************************************/
140DAPI_(void) DepDependencyArrayFree(
141 __in_ecount(cDependencies) DEPENDENCY* rgDependencies,
142 __in UINT cDependencies
143 );
144
145#ifdef __cplusplus
146}
147#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dictutil.h b/src/libs/dutil/WixToolset.DUtil/inc/dictutil.h
new file mode 100644
index 00000000..f0a3bb5a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dictutil.h
@@ -0,0 +1,69 @@
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
6extern "C" {
7#endif
8
9#define ReleaseDict(sdh) if (sdh) { DictDestroy(sdh); }
10#define ReleaseNullDict(sdh) if (sdh) { DictDestroy(sdh); sdh = NULL; }
11
12typedef void* STRINGDICT_HANDLE;
13typedef const void* C_STRINGDICT_HANDLE;
14
15extern const int STRINGDICT_HANDLE_BYTES;
16
17typedef enum DICT_FLAG
18{
19 DICT_FLAG_NONE = 0,
20 DICT_FLAG_CASEINSENSITIVE = 1
21} DICT_FLAG;
22
23HRESULT DAPI DictCreateWithEmbeddedKey(
24 __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
25 __in DWORD dwNumExpectedItems,
26 __in_opt void **ppvArray,
27 __in size_t cByteOffset,
28 __in DICT_FLAG dfFlags
29 );
30HRESULT DAPI DictCreateStringList(
31 __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
32 __in DWORD dwNumExpectedItems,
33 __in DICT_FLAG dfFlags
34 );
35HRESULT DAPI DictCreateStringListFromArray(
36 __out_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE* psdHandle,
37 __in_ecount(cStringArray) const LPCWSTR* rgwzStringArray,
38 __in const DWORD cStringArray,
39 __in DICT_FLAG dfFlags
40 );
41HRESULT DAPI DictCompareStringListToArray(
42 __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdStringList,
43 __in_ecount(cStringArray) const LPCWSTR* rgwzStringArray,
44 __in const DWORD cStringArray
45 );
46HRESULT DAPI DictAddKey(
47 __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle,
48 __in_z LPCWSTR szString
49 );
50HRESULT DAPI DictAddValue(
51 __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle,
52 __in void *pvValue
53 );
54HRESULT DAPI DictKeyExists(
55 __in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle,
56 __in_z LPCWSTR szString
57 );
58HRESULT DAPI DictGetValue(
59 __in_bcount(STRINGDICT_HANDLE_BYTES) C_STRINGDICT_HANDLE sdHandle,
60 __in_z LPCWSTR szString,
61 __out void **ppvValue
62 );
63void DAPI DictDestroy(
64 __in_bcount(STRINGDICT_HANDLE_BYTES) STRINGDICT_HANDLE sdHandle
65 );
66
67#ifdef __cplusplus
68}
69#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dirutil.h b/src/libs/dutil/WixToolset.DUtil/inc/dirutil.h
new file mode 100644
index 00000000..539b3a73
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dirutil.h
@@ -0,0 +1,59 @@
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
5typedef enum DIR_DELETE
6{
7 DIR_DELETE_FILES = 1,
8 DIR_DELETE_RECURSE = 2,
9 DIR_DELETE_SCHEDULE = 4,
10} DIR_DELETE;
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16BOOL DAPI DirExists(
17 __in_z LPCWSTR wzPath,
18 __out_opt DWORD *pdwAttributes
19 );
20
21HRESULT DAPI DirCreateTempPath(
22 __in_z LPCWSTR wzPrefix,
23 __out_ecount_z(cchPath) LPWSTR wzPath,
24 __in DWORD cchPath
25 );
26
27HRESULT DAPI DirEnsureExists(
28 __in_z LPCWSTR wzPath,
29 __in_opt LPSECURITY_ATTRIBUTES psa
30 );
31
32HRESULT DAPI DirEnsureDelete(
33 __in_z LPCWSTR wzPath,
34 __in BOOL fDeleteFiles,
35 __in BOOL fRecurse
36 );
37
38HRESULT DAPI DirEnsureDeleteEx(
39 __in_z LPCWSTR wzPath,
40 __in DWORD dwFlags
41 );
42
43DWORD DAPI DirDeleteEmptyDirectoriesToRoot(
44 __in_z LPCWSTR wzPath,
45 __in DWORD dwFlags
46 );
47
48HRESULT DAPI DirGetCurrent(
49 __deref_out_z LPWSTR* psczCurrentDirectory
50 );
51
52HRESULT DAPI DirSetCurrent(
53 __in_z LPCWSTR wzDirectory
54 );
55
56#ifdef __cplusplus
57}
58#endif
59
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dlutil.h b/src/libs/dutil/WixToolset.DUtil/inc/dlutil.h
new file mode 100644
index 00000000..3e95103a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dlutil.h
@@ -0,0 +1,59 @@
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
6extern "C" {
7#endif
8
9typedef HRESULT (WINAPI *LPAUTHENTICATION_ROUTINE)(
10 __in LPVOID pVoid,
11 __in HINTERNET hUrl,
12 __in long lHttpCode,
13 __out BOOL* pfRetrySend,
14 __out BOOL* pfRetry
15 );
16
17typedef int (WINAPI *LPCANCEL_ROUTINE)(
18 __in HRESULT hrError,
19 __in_z_opt LPCWSTR wzError,
20 __in BOOL fAllowRetry,
21 __in_opt LPVOID pvContext
22 );
23
24// structs
25typedef struct _DOWNLOAD_SOURCE
26{
27 LPWSTR sczUrl;
28 LPWSTR sczUser;
29 LPWSTR sczPassword;
30} DOWNLOAD_SOURCE;
31
32typedef struct _DOWNLOAD_CACHE_CALLBACK
33{
34 LPPROGRESS_ROUTINE pfnProgress;
35 LPCANCEL_ROUTINE pfnCancel;
36 LPVOID pv;
37} DOWNLOAD_CACHE_CALLBACK;
38
39typedef struct _DOWNLOAD_AUTHENTICATION_CALLBACK
40{
41 LPAUTHENTICATION_ROUTINE pfnAuthenticate;
42 LPVOID pv;
43} DOWNLOAD_AUTHENTICATION_CALLBACK;
44
45
46// functions
47
48HRESULT DAPI DownloadUrl(
49 __in DOWNLOAD_SOURCE* pDownloadSource,
50 __in DWORD64 dw64AuthoredDownloadSize,
51 __in LPCWSTR wzDestinationPath,
52 __in_opt DOWNLOAD_CACHE_CALLBACK* pCache,
53 __in_opt DOWNLOAD_AUTHENTICATION_CALLBACK* pAuthenticate
54 );
55
56
57#ifdef __cplusplus
58}
59#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dpiutil.h b/src/libs/dutil/WixToolset.DUtil/inc/dpiutil.h
new file mode 100644
index 00000000..b30e2332
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dpiutil.h
@@ -0,0 +1,120 @@
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
6extern "C" {
7#endif
8
9// from WinUser.h
10#ifndef WM_DPICHANGED
11#define WM_DPICHANGED 0x02E0
12#endif
13#ifndef USER_DEFAULT_SCREEN_DPI
14#define USER_DEFAULT_SCREEN_DPI 96
15#endif
16
17typedef enum DPIU_AWARENESS
18{
19 DPIU_AWARENESS_NONE = 0x0,
20 DPIU_AWARENESS_SYSTEM = 0x1,
21 DPIU_AWARENESS_PERMONITOR = 0x2,
22 DPIU_AWARENESS_PERMONITORV2 = 0x4,
23 DPIU_AWARENESS_GDISCALED = 0x8,
24} DPIU_PROCESS_AWARENESS;
25
26typedef struct _DPIU_MONITOR_CONTEXT
27{
28 UINT nDpi;
29 MONITORINFOEXW mi;
30} DPIU_MONITOR_CONTEXT;
31
32typedef struct _DPIU_WINDOW_CONTEXT
33{
34 UINT nDpi;
35} DPIU_WINDOW_CONTEXT;
36
37typedef BOOL (APIENTRY* PFN_ADJUSTWINDOWRECTEXFORDPI)(
38 __in LPRECT lpRect,
39 __in DWORD dwStyle,
40 __in BOOL bMenu,
41 __in DWORD dwExStyle,
42 __in UINT dpi
43 );
44typedef UINT (APIENTRY *PFN_GETDPIFORWINDOW)(
45 __in HWND hwnd
46 );
47typedef BOOL (APIENTRY* PFN_SETPROCESSDPIAWARE)();
48typedef BOOL (APIENTRY* PFN_SETPROCESSDPIAWARENESSCONTEXT)(
49 __in DPI_AWARENESS_CONTEXT value
50 );
51
52#ifdef DPI_ENUMS_DECLARED
53typedef HRESULT(APIENTRY* PFN_GETDPIFORMONITOR)(
54 __in HMONITOR hmonitor,
55 __in MONITOR_DPI_TYPE dpiType,
56 __in UINT* dpiX,
57 __in UINT* dpiY
58 );
59typedef HRESULT(APIENTRY* PFN_SETPROCESSDPIAWARENESS)(
60 __in PROCESS_DPI_AWARENESS value
61 );
62#endif
63
64void DAPI DpiuInitialize();
65void DAPI DpiuUninitialize();
66
67/********************************************************************
68 DpiuAdjustWindowRect - calculate the required size of the window rectangle,
69 based on the desired size of the client rectangle
70 and the provided DPI.
71
72*******************************************************************/
73void DAPI DpiuAdjustWindowRect(
74 __in RECT* pWindowRect,
75 __in DWORD dwStyle,
76 __in BOOL fMenu,
77 __in DWORD dwExStyle,
78 __in UINT nDpi
79 );
80
81/********************************************************************
82 DpiuGetMonitorContextFromPoint - get the DPI context of the monitor from the given point.
83
84*******************************************************************/
85HRESULT DAPI DpiuGetMonitorContextFromPoint(
86 __in const POINT* pt,
87 __out DPIU_MONITOR_CONTEXT** ppMonitorContext
88 );
89
90/********************************************************************
91 DpiuGetWindowContext - get the DPI context of the given window.
92
93*******************************************************************/
94void DAPI DpiuGetWindowContext(
95 __in HWND hWnd,
96 __in DPIU_WINDOW_CONTEXT* pWindowContext
97 );
98
99/********************************************************************
100 DpiuScaleValue - scale the value to the target DPI.
101
102*******************************************************************/
103int DAPI DpiuScaleValue(
104 __in int nDefaultDpiValue,
105 __in UINT nTargetDpi
106 );
107
108/********************************************************************
109 DpiuSetProcessDpiAwareness - set the process DPI awareness. The ranking is
110 PERMONITORV2 > PERMONITOR > SYSTEM > GDISCALED > NONE.
111
112*******************************************************************/
113HRESULT DAPI DpiuSetProcessDpiAwareness(
114 __in DPIU_AWARENESS supportedAwareness,
115 __in_opt DPIU_AWARENESS* pSelectedAwareness
116 );
117
118#ifdef __cplusplus
119}
120#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dutil.h b/src/libs/dutil/WixToolset.DUtil/inc/dutil.h
new file mode 100644
index 00000000..fc9ec0f4
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dutil.h
@@ -0,0 +1,190 @@
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#include "dutilsources.h"
5
6#define DAPI __stdcall
7#define DAPIV __cdecl // used only for functions taking variable length arguments
8
9#define DAPI_(type) EXTERN_C type DAPI
10#define DAPIV_(type) EXTERN_C type DAPIV
11
12
13// asserts and traces
14typedef BOOL (DAPI *DUTIL_ASSERTDISPLAYFUNCTION)(__in_z LPCSTR sz);
15
16typedef void (CALLBACK *DUTIL_CALLBACK_TRACEERROR)(
17 __in_z LPCSTR szFile,
18 __in int iLine,
19 __in REPORT_LEVEL rl,
20 __in UINT source,
21 __in HRESULT hrError,
22 __in_z __format_string LPCSTR szFormat,
23 __in va_list args
24 );
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/********************************************************************
31 DutilInitialize - initialize dutil.
32
33*******************************************************************/
34HRESULT DAPI DutilInitialize(
35 __in_opt DUTIL_CALLBACK_TRACEERROR pfnTraceErrorCallback
36 );
37
38/********************************************************************
39 DutilUninitialize - uninitialize dutil.
40
41*******************************************************************/
42void DAPI DutilUninitialize();
43
44void DAPI Dutil_SetAssertModule(__in HMODULE hAssertModule);
45void DAPI Dutil_SetAssertDisplayFunction(__in DUTIL_ASSERTDISPLAYFUNCTION pfn);
46void DAPI Dutil_Assert(__in_z LPCSTR szFile, __in int iLine);
47void DAPI Dutil_AssertSz(__in_z LPCSTR szFile, __in int iLine, __in_z __format_string LPCSTR szMessage);
48
49void DAPI Dutil_TraceSetLevel(__in REPORT_LEVEL ll, __in BOOL fTraceFilenames);
50REPORT_LEVEL DAPI Dutil_TraceGetLevel();
51void DAPIV Dutil_Trace(__in_z LPCSTR szFile, __in int iLine, __in REPORT_LEVEL rl, __in_z __format_string LPCSTR szMessage, ...);
52void DAPIV Dutil_TraceError(__in_z LPCSTR szFile, __in int iLine, __in REPORT_LEVEL rl, __in HRESULT hr, __in_z __format_string LPCSTR szMessage, ...);
53void DAPIV Dutil_TraceErrorSource(__in_z LPCSTR szFile, __in int iLine, __in REPORT_LEVEL rl, __in UINT source, __in HRESULT hr, __in_z __format_string LPCSTR szMessage, ...);
54void DAPI Dutil_RootFailure(__in_z LPCSTR szFile, __in int iLine, __in HRESULT hrError);
55
56#ifdef __cplusplus
57}
58#endif
59
60
61#ifdef DEBUG
62
63#define AssertSetModule(m) (void)Dutil_SetAssertModule(m)
64#define AssertSetDisplayFunction(pfn) (void)Dutil_SetAssertDisplayFunction(pfn)
65#define Assert(f) ((f) ? (void)0 : (void)Dutil_Assert(__FILE__, __LINE__))
66#define AssertSz(f, sz) ((f) ? (void)0 : (void)Dutil_AssertSz(__FILE__, __LINE__, sz))
67
68#define TraceSetLevel(l, f) (void)Dutil_TraceSetLevel(l, f)
69#define TraceGetLevel() (REPORT_LEVEL)Dutil_TraceGetLevel()
70#define Trace(l, f, ...) (void)Dutil_Trace(__FILE__, __LINE__, l, f, __VA_ARGS__)
71#define TraceError(x, f, ...) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_ERROR, x, f, __VA_ARGS__)
72#define TraceErrorDebug(x, f, ...) (void)Dutil_TraceError(__FILE__, __LINE__, REPORT_DEBUG, x, f, __VA_ARGS__)
73
74#else // !DEBUG
75
76#define AssertSetModule(m)
77#define AssertSetDisplayFunction(pfn)
78#define Assert(f)
79#define AssertSz(f, sz)
80
81#define TraceSetLevel(l, f)
82#define Trace(l, f, ...)
83#define TraceError(x, f, ...)
84#define TraceErrorDebug(x, f, ...)
85
86#endif // DEBUG
87
88// DUTIL_SOURCE_DEFAULT can be overriden
89#ifndef DUTIL_SOURCE_DEFAULT
90#define DUTIL_SOURCE_DEFAULT DUTIL_SOURCE_UNKNOWN
91#endif
92
93// Exit macros
94#define ExitFunction() { goto LExit; }
95#define ExitFunction1(x) { x; goto LExit; }
96
97#define ExitFunctionWithLastError(x) { x = HRESULT_FROM_WIN32(::GetLastError()); goto LExit; }
98
99#define ExitTraceSource(d, x, s, ...) { TraceError(x, s, __VA_ARGS__); (void)Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_ERROR, d, x, s, __VA_ARGS__); }
100#define ExitTraceDebugSource(d, x, s, ...) { TraceErrorDebug(x, s, __VA_ARGS__); (void)Dutil_TraceErrorSource(__FILE__, __LINE__, REPORT_DEBUG, d, x, s, __VA_ARGS__); }
101
102#define ExitOnLastErrorSource(d, x, s, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; } }
103#define ExitOnLastErrorDebugTraceSource(d, x, s, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceDebugSource(d, x, s, __VA_ARGS__); goto LExit; } }
104#define ExitWithLastErrorSource(d, x, s, ...) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
105#define ExitOnFailureSource(d, x, s, ...) if (FAILED(x)) { ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
106#define ExitOnRootFailureSource(d, x, s, ...) if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
107#define ExitOnFailureDebugTraceSource(d, x, s, ...) if (FAILED(x)) { ExitTraceDebugSource(d, x, s, __VA_ARGS__); goto LExit; }
108#define ExitOnNullSource(d, p, x, e, s, ...) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
109#define ExitOnNullWithLastErrorSource(d, p, x, s, ...) if (NULL == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
110#define ExitOnNullDebugTraceSource(d, p, x, e, s, ...) if (NULL == p) { x = e; Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceDebugSource(d, x, s, __VA_ARGS__); goto LExit; }
111#define ExitOnInvalidHandleWithLastErrorSource(d, p, x, s, ...) if (INVALID_HANDLE_VALUE == p) { DWORD Dutil_er = ::GetLastError(); x = HRESULT_FROM_WIN32(Dutil_er); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
112#define ExitOnWin32ErrorSource(d, e, x, s, ...) if (ERROR_SUCCESS != e) { x = HRESULT_FROM_WIN32(e); if (!FAILED(x)) { x = E_FAIL; } Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; }
113
114#define ExitOnLastError(x, s, ...) ExitOnLastErrorSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
115#define ExitOnLastErrorDebugTrace(x, s, ...) ExitOnLastErrorDebugTraceSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
116#define ExitWithLastError(x, s, ...) ExitWithLastErrorSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
117#define ExitOnFailure(x, s, ...) ExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
118#define ExitOnRootFailure(x, s, ...) ExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
119#define ExitOnFailureDebugTrace(x, s, ...) ExitOnFailureDebugTraceSource(DUTIL_SOURCE_DEFAULT, x, s, __VA_ARGS__)
120#define ExitOnNull(p, x, e, s, ...) ExitOnNullSource(DUTIL_SOURCE_DEFAULT, p, x, e, s, __VA_ARGS__)
121#define ExitOnNullWithLastError(p, x, s, ...) ExitOnNullWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, s, __VA_ARGS__)
122#define ExitOnNullDebugTrace(p, x, e, s, ...) ExitOnNullDebugTraceSource(DUTIL_SOURCE_DEFAULT, p, x, e, s, __VA_ARGS__)
123#define ExitOnInvalidHandleWithLastError(p, x, s, ...) ExitOnInvalidHandleWithLastErrorSource(DUTIL_SOURCE_DEFAULT, p, x, s, __VA_ARGS__)
124#define ExitOnWin32Error(e, x, s, ...) ExitOnWin32ErrorSource(DUTIL_SOURCE_DEFAULT, e, x, s, __VA_ARGS__)
125
126// release macros
127#define ReleaseObject(x) if (x) { x->Release(); }
128#define ReleaseObjectArray(prg, cel) if (prg) { for (DWORD Dutil_ReleaseObjectArrayIndex = 0; Dutil_ReleaseObjectArrayIndex < cel; ++Dutil_ReleaseObjectArrayIndex) { ReleaseObject(prg[Dutil_ReleaseObjectArrayIndex]); } ReleaseMem(prg); }
129#define ReleaseVariant(x) { ::VariantClear(&x); }
130#define ReleaseNullObject(x) if (x) { (x)->Release(); x = NULL; }
131#define ReleaseCertificate(x) if (x) { ::CertFreeCertificateContext(x); x=NULL; }
132#define ReleaseHandle(x) if (x) { ::CloseHandle(x); x = NULL; }
133
134
135// useful defines and macros
136#define Unused(x) ((void)x)
137
138#ifndef countof
139#if 1
140#define countof(ary) (sizeof(ary) / sizeof(ary[0]))
141#else
142#ifndef __cplusplus
143#define countof(ary) (sizeof(ary) / sizeof(ary[0]))
144#else
145template<typename T> static char countofVerify(void const *, T) throw() { return 0; }
146template<typename T> static void countofVerify(T *const, T *const *) throw() {};
147#define countof(arr) (sizeof(countofVerify(arr,&(arr))) * sizeof(arr)/sizeof(*(arr)))
148#endif
149#endif
150#endif
151
152#define roundup(x, n) roundup_typed(x, n, DWORD)
153#define roundup_typed(x, n, t) (((t)(x) + ((t)(n) - 1)) & ~((t)(n) - 1))
154
155#define HRESULT_FROM_RPC(x) ((HRESULT) ((x) | FACILITY_RPC))
156
157#ifndef MAXSIZE_T
158#define MAXSIZE_T ((SIZE_T)~((SIZE_T)0))
159#endif
160
161typedef const BYTE* LPCBYTE;
162
163#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
164#define E_PATHNOTFOUND HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)
165#define E_INVALIDDATA HRESULT_FROM_WIN32(ERROR_INVALID_DATA)
166#define E_INVALIDSTATE HRESULT_FROM_WIN32(ERROR_INVALID_STATE)
167#define E_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
168#define E_MOREDATA HRESULT_FROM_WIN32(ERROR_MORE_DATA)
169#define E_NOMOREITEMS HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS)
170#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
171#define E_MODNOTFOUND HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND)
172#define E_BADCONFIGURATION HRESULT_FROM_WIN32(ERROR_BAD_CONFIGURATION)
173
174#define AddRefAndRelease(x) { x->AddRef(); x->Release(); }
175
176#define MAKEDWORD(lo, hi) ((DWORD)MAKELONG(lo, hi))
177#define MAKEQWORDVERSION(mj, mi, b, r) (((DWORD64)MAKELONG(r, b)) | (((DWORD64)MAKELONG(mi, mj)) << 32))
178
179
180#ifdef __cplusplus
181extern "C" {
182#endif
183
184// other functions
185HRESULT DAPI LoadSystemLibrary(__in_z LPCWSTR wzModuleName, __out HMODULE *phModule);
186HRESULT DAPI LoadSystemLibraryWithPath(__in_z LPCWSTR wzModuleName, __out HMODULE *phModule, __deref_out_z_opt LPWSTR* psczPath);
187
188#ifdef __cplusplus
189}
190#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/dutilsources.h b/src/libs/dutil/WixToolset.DUtil/inc/dutilsources.h
new file mode 100644
index 00000000..7d512cb3
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/dutilsources.h
@@ -0,0 +1,76 @@
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
4typedef enum DUTIL_SOURCE
5{
6 DUTIL_SOURCE_UNKNOWN,
7 DUTIL_SOURCE_ACLUTIL,
8 DUTIL_SOURCE_APPUTIL,
9 DUTIL_SOURCE_APUPUTIL,
10 DUTIL_SOURCE_ATOMUTIL,
11 DUTIL_SOURCE_BUFFUTIL,
12 DUTIL_SOURCE_BUTIL,
13 DUTIL_SOURCE_CABCUTIL,
14 DUTIL_SOURCE_CABUTIL,
15 DUTIL_SOURCE_CERTUTIL,
16 DUTIL_SOURCE_CONUTIL,
17 DUTIL_SOURCE_CRYPUTIL,
18 DUTIL_SOURCE_DEPUTIL,
19 DUTIL_SOURCE_DICTUTIL,
20 DUTIL_SOURCE_DIRUTIL,
21 DUTIL_SOURCE_DLUTIL,
22 DUTIL_SOURCE_DPIUTIL,
23 DUTIL_SOURCE_DUTIL,
24 DUTIL_SOURCE_ESEUTIL,
25 DUTIL_SOURCE_FILEUTIL,
26 DUTIL_SOURCE_GDIPUTIL,
27 DUTIL_SOURCE_GUIDUTIL,
28 DUTIL_SOURCE_IIS7UTIL,
29 DUTIL_SOURCE_INETUTIL,
30 DUTIL_SOURCE_INIUTIL,
31 DUTIL_SOURCE_JSONUTIL,
32 DUTIL_SOURCE_LOCUTIL,
33 DUTIL_SOURCE_LOGUTIL,
34 DUTIL_SOURCE_MEMUTIL,
35 DUTIL_SOURCE_METAUTIL,
36 DUTIL_SOURCE_MONUTIL,
37 DUTIL_SOURCE_OSUTIL,
38 DUTIL_SOURCE_PATHUTIL,
39 DUTIL_SOURCE_PERFUTIL,
40 DUTIL_SOURCE_POLCUTIL,
41 DUTIL_SOURCE_PROCUTIL,
42 DUTIL_SOURCE_REGUTIL,
43 DUTIL_SOURCE_RESRUTIL,
44 DUTIL_SOURCE_RESWUTIL,
45 DUTIL_SOURCE_REXUTIL,
46 DUTIL_SOURCE_RMUTIL,
47 DUTIL_SOURCE_RSSUTIL,
48 DUTIL_SOURCE_SCEUTIL,
49 DUTIL_SOURCE_SCZUTIL,
50 DUTIL_SOURCE_SHELUTIL,
51 DUTIL_SOURCE_SQLUTIL,
52 DUTIL_SOURCE_SRPUTIL,
53 DUTIL_SOURCE_STRUTIL,
54 DUTIL_SOURCE_SVCUTIL,
55 DUTIL_SOURCE_THMUTIL,
56 DUTIL_SOURCE_TIMEUTIL,
57 DUTIL_SOURCE_UNCUTIL,
58 DUTIL_SOURCE_URIUTIL,
59 DUTIL_SOURCE_USERUTIL,
60 DUTIL_SOURCE_WIUTIL,
61 DUTIL_SOURCE_WUAUTIL,
62 DUTIL_SOURCE_XMLUTIL,
63 DUTIL_SOURCE_VERUTIL,
64
65 DUTIL_SOURCE_EXTERNAL = 256,
66} DUTIL_SOURCE;
67
68typedef enum REPORT_LEVEL
69{
70 REPORT_NONE, // turns off report (only valid for XXXSetLevel())
71 REPORT_WARNING, // written if want only warnings or reporting is on in general
72 REPORT_STANDARD, // written if reporting is on
73 REPORT_VERBOSE, // written only if verbose reporting is on
74 REPORT_DEBUG, // reporting useful when debugging code
75 REPORT_ERROR, // always gets reported, but can never be specified
76} REPORT_LEVEL;
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/eseutil.h b/src/libs/dutil/WixToolset.DUtil/inc/eseutil.h
new file mode 100644
index 00000000..bea47b2b
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/eseutil.h
@@ -0,0 +1,223 @@
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
6extern "C" {
7#endif
8
9#define ReleaseEseQuery(pqh) if (pqh) { EseFinishQuery(pqh); }
10#define ReleaseNullEseQuery(pqh) if (pqh) { EseFinishQuery(pqh); pqh = NULL; }
11
12struct ESE_COLUMN_SCHEMA
13{
14 JET_COLUMNID jcColumn;
15 LPCWSTR pszName;
16 JET_COLTYP jcColumnType;
17 BOOL fKey; // If this column is part of the key of the table
18 BOOL fFixed;
19 BOOL fNullable;
20 BOOL fAutoIncrement;
21};
22
23struct ESE_TABLE_SCHEMA
24{
25 JET_TABLEID jtTable;
26 LPCWSTR pszName;
27 DWORD dwColumns;
28 ESE_COLUMN_SCHEMA *pcsColumns;
29};
30
31struct ESE_DATABASE_SCHEMA
32{
33 DWORD dwTables;
34 ESE_TABLE_SCHEMA *ptsTables;
35};
36
37typedef enum ESE_QUERY_TYPE
38{
39 ESE_QUERY_EXACT,
40 ESE_QUERY_FROM_TOP,
41 ESE_QUERY_FROM_BOTTOM
42} ESE_QUERY_TYPE;
43
44typedef void* ESE_QUERY_HANDLE;
45
46HRESULT DAPI EseBeginSession(
47 __out JET_INSTANCE *pjiInstance,
48 __out JET_SESID *pjsSession,
49 __in_z LPCWSTR pszInstance,
50 __in_z LPCWSTR pszPath
51 );
52HRESULT DAPI EseEndSession(
53 __in JET_INSTANCE jiInstance,
54 __in JET_SESID jsSession
55 );
56HRESULT DAPI EseEnsureDatabase(
57 __in JET_SESID jsSession,
58 __in_z LPCWSTR pszFile,
59 __in ESE_DATABASE_SCHEMA *pdsSchema,
60 __out JET_DBID* pjdbDb,
61 __in BOOL fExclusive,
62 __in BOOL fReadonly
63 );
64HRESULT DAPI EseCloseDatabase(
65 __in JET_SESID jsSession,
66 __in JET_DBID jdbDb
67 );
68HRESULT DAPI EseCreateTable(
69 __in JET_SESID jsSession,
70 __in JET_DBID jdbDb,
71 __in_z LPCWSTR pszTable,
72 __out JET_TABLEID *pjtTable
73 );
74HRESULT DAPI EseOpenTable(
75 __in JET_SESID jsSession,
76 __in JET_DBID jdbDb,
77 __in_z LPCWSTR pszTable,
78 __out JET_TABLEID *pjtTable
79 );
80HRESULT DAPI EseCloseTable(
81 __in JET_SESID jsSession,
82 __in JET_TABLEID jtTable
83 );
84HRESULT DAPI EseEnsureColumn(
85 __in JET_SESID jsSession,
86 __in JET_TABLEID jtTable,
87 __in_z LPCWSTR pszColumnName,
88 __in JET_COLTYP jcColumnType,
89 __in ULONG ulColumnSize,
90 __in BOOL fFixed,
91 __in BOOL fNullable,
92 __out_opt JET_COLUMNID *pjcColumn
93 );
94HRESULT DAPI EseGetColumn(
95 __in JET_SESID jsSession,
96 __in JET_TABLEID jtTable,
97 __in_z LPCWSTR pszColumnName,
98 __out JET_COLUMNID *pjcColumn
99 );
100HRESULT DAPI EseMoveCursor(
101 __in JET_SESID jsSession,
102 __in JET_TABLEID jtTable,
103 __in LONG lRow
104 );
105HRESULT DAPI EseDeleteRow(
106 __in JET_SESID jsSession,
107 __in JET_TABLEID jtTable
108 );
109HRESULT DAPI EseBeginTransaction(
110 __in JET_SESID jsSession
111 );
112HRESULT DAPI EseRollbackTransaction(
113 __in JET_SESID jsSession,
114 __in BOOL fAll
115 );
116HRESULT DAPI EseCommitTransaction(
117 __in JET_SESID jsSession
118 );
119HRESULT DAPI EsePrepareUpdate(
120 __in JET_SESID jsSession,
121 __in JET_TABLEID jtTable,
122 __in ULONG ulPrep
123 );
124HRESULT DAPI EseFinishUpdate(
125 __in JET_SESID jsSession,
126 __in JET_TABLEID jtTable,
127 __in BOOL fSeekToInsertedRecord
128 );
129HRESULT DAPI EseSetColumnBinary(
130 __in JET_SESID jsSession,
131 __in ESE_TABLE_SCHEMA tsTable,
132 __in DWORD dwColumn,
133 __in_bcount(cbBuffer) const BYTE* pbBuffer,
134 __in SIZE_T cbBuffer
135 );
136HRESULT DAPI EseSetColumnDword(
137 __in JET_SESID jsSession,
138 __in ESE_TABLE_SCHEMA tsTable,
139 __in DWORD dwColumn,
140 __in DWORD dwValue
141 );
142HRESULT DAPI EseSetColumnBool(
143 __in JET_SESID jsSession,
144 __in ESE_TABLE_SCHEMA tsTable,
145 __in DWORD dwColumn,
146 __in BOOL fValue
147 );
148HRESULT DAPI EseSetColumnString(
149 __in JET_SESID jsSession,
150 __in ESE_TABLE_SCHEMA tsTable,
151 __in DWORD dwColumn,
152 __in_z LPCWSTR pszValue
153 );
154HRESULT DAPI EseSetColumnEmpty(
155 __in JET_SESID jsSession,
156 __in ESE_TABLE_SCHEMA tsTable,
157 __in DWORD dwColumn
158 );
159HRESULT DAPI EseGetColumnBinary(
160 __in JET_SESID jsSession,
161 __in ESE_TABLE_SCHEMA tsTable,
162 __in DWORD dwColumn,
163 __deref_inout_bcount(*piBuffer) BYTE** ppbBuffer,
164 __inout SIZE_T* piBuffer
165 );
166HRESULT DAPI EseGetColumnDword(
167 __in JET_SESID jsSession,
168 __in ESE_TABLE_SCHEMA tsTable,
169 __in DWORD dwColumn,
170 __out DWORD *pdwValue
171 );
172HRESULT DAPI EseGetColumnBool(
173 __in JET_SESID jsSession,
174 __in ESE_TABLE_SCHEMA tsTable,
175 __in DWORD dwColumn,
176 __out BOOL *pfValue
177 );
178HRESULT DAPI EseGetColumnString(
179 __in JET_SESID jsSession,
180 __in ESE_TABLE_SCHEMA tsTable,
181 __in DWORD dwColumn,
182 __out LPWSTR *ppszValue
183 );
184
185// Call this once for each key column in the table
186HRESULT DAPI EseBeginQuery(
187 __in JET_SESID jsSession,
188 __in JET_TABLEID jtTable,
189 __in ESE_QUERY_TYPE qtQueryType,
190 __out ESE_QUERY_HANDLE *peqhHandle
191 );
192HRESULT DAPI EseSetQueryColumnBinary(
193 __in ESE_QUERY_HANDLE eqhHandle,
194 __in_bcount(cbBuffer) const BYTE* pbBuffer,
195 __in SIZE_T cbBuffer,
196 __in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
197 );
198HRESULT DAPI EseSetQueryColumnDword(
199 __in ESE_QUERY_HANDLE eqhHandle,
200 __in DWORD dwData,
201 __in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
202 );
203HRESULT DAPI EseSetQueryColumnBool(
204 __in ESE_QUERY_HANDLE eqhHandle,
205 __in BOOL fValue,
206 __in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
207 );
208HRESULT DAPI EseSetQueryColumnString(
209 __in ESE_QUERY_HANDLE eqhHandle,
210 __in_z LPCWSTR pszString,
211 __in BOOL fFinal // If this is true, all other key columns in the query will be set to "*"
212 );
213HRESULT DAPI EseFinishQuery(
214 __in ESE_QUERY_HANDLE eqhHandle
215 );
216// Once all columns have been set up, call this and read the result
217HRESULT DAPI EseRunQuery(
218 __in ESE_QUERY_HANDLE eqhHandle
219 );
220
221#ifdef __cplusplus
222}
223#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/fileutil.h b/src/libs/dutil/WixToolset.DUtil/inc/fileutil.h
new file mode 100644
index 00000000..d3e326f7
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/fileutil.h
@@ -0,0 +1,247 @@
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
6extern "C" {
7#endif
8
9#define ReleaseFile(h) if (INVALID_HANDLE_VALUE != h) { ::CloseHandle(h); h = INVALID_HANDLE_VALUE; }
10#define ReleaseFileHandle(h) if (INVALID_HANDLE_VALUE != h) { ::CloseHandle(h); h = INVALID_HANDLE_VALUE; }
11#define ReleaseFileFindHandle(h) if (INVALID_HANDLE_VALUE != h) { ::FindClose(h); h = INVALID_HANDLE_VALUE; }
12
13#define FILEMAKEVERSION(major, minor, build, revision) static_cast<DWORD64>((static_cast<DWORD64>(major & 0xFFFF) << 48) \
14 | (static_cast<DWORD64>(minor & 0xFFFF) << 32) \
15 | (static_cast<DWORD64>(build & 0xFFFF) << 16) \
16 | (static_cast<DWORD64>(revision & 0xFFFF)))
17
18typedef enum FILE_ARCHITECTURE
19{
20 FILE_ARCHITECTURE_UNKNOWN,
21 FILE_ARCHITECTURE_X86,
22 FILE_ARCHITECTURE_X64,
23 FILE_ARCHITECTURE_IA64,
24} FILE_ARCHITECTURE;
25
26typedef enum FILE_ENCODING
27{
28 FILE_ENCODING_UNSPECIFIED = 0,
29 // TODO: distinguish between non-BOM utf-8 and ANSI in the future?
30 FILE_ENCODING_UTF8,
31 FILE_ENCODING_UTF8_WITH_BOM,
32 FILE_ENCODING_UTF16,
33 FILE_ENCODING_UTF16_WITH_BOM,
34} FILE_ENCODING;
35
36
37LPWSTR DAPI FileFromPath(
38 __in_z LPCWSTR wzPath
39 );
40HRESULT DAPI FileResolvePath(
41 __in_z LPCWSTR wzRelativePath,
42 __out LPWSTR *ppwzFullPath
43 );
44HRESULT DAPI FileStripExtension(
45 __in_z LPCWSTR wzFileName,
46 __out LPWSTR *ppwzFileNameNoExtension
47 );
48HRESULT DAPI FileChangeExtension(
49 __in_z LPCWSTR wzFileName,
50 __in_z LPCWSTR wzNewExtension,
51 __out LPWSTR *ppwzFileNameNewExtension
52 );
53HRESULT DAPI FileAddSuffixToBaseName(
54 __in_z LPCWSTR wzFileName,
55 __in_z LPCWSTR wzSuffix,
56 __out_z LPWSTR* psczNewFileName
57 );
58HRESULT DAPI FileVersionFromString(
59 __in_z LPCWSTR wzVersion,
60 __out DWORD *pdwVerMajor,
61 __out DWORD* pdwVerMinor
62 );
63HRESULT DAPI FileVersionFromStringEx(
64 __in_z LPCWSTR wzVersion,
65 __in SIZE_T cchVersion,
66 __out DWORD64* pqwVersion
67 );
68HRESULT DAPI FileVersionToStringEx(
69 __in DWORD64 qwVersion,
70 __out LPWSTR* psczVersion
71 );
72HRESULT DAPI FileSetPointer(
73 __in HANDLE hFile,
74 __in DWORD64 dw64Move,
75 __out_opt DWORD64* pdw64NewPosition,
76 __in DWORD dwMoveMethod
77 );
78HRESULT DAPI FileSize(
79 __in_z LPCWSTR pwzFileName,
80 __out LONGLONG* pllSize
81 );
82HRESULT DAPI FileSizeByHandle(
83 __in HANDLE hFile,
84 __out LONGLONG* pllSize
85 );
86BOOL DAPI FileExistsEx(
87 __in_z LPCWSTR wzPath,
88 __out_opt DWORD *pdwAttributes
89 );
90BOOL DAPI FileExistsAfterRestart(
91 __in_z LPCWSTR wzPath,
92 __out_opt DWORD *pdwAttributes
93 );
94HRESULT DAPI FileRemoveFromPendingRename(
95 __in_z LPCWSTR wzPath
96 );
97HRESULT DAPI FileRead(
98 __deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
99 __out SIZE_T* pcbDest,
100 __in_z LPCWSTR wzSrcPath
101 );
102HRESULT DAPI FileReadEx(
103 __deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
104 __out SIZE_T* pcbDest,
105 __in_z LPCWSTR wzSrcPath,
106 __in DWORD dwShareMode
107 );
108HRESULT DAPI FileReadUntil(
109 __deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
110 __out_range(<=, cbMaxRead) SIZE_T* pcbDest,
111 __in_z LPCWSTR wzSrcPath,
112 __in DWORD cbMaxRead
113 );
114HRESULT DAPI FileReadPartial(
115 __deref_out_bcount_full(*pcbDest) LPBYTE* ppbDest,
116 __out_range(<=, cbMaxRead) SIZE_T* pcbDest,
117 __in_z LPCWSTR wzSrcPath,
118 __in BOOL fSeek,
119 __in DWORD cbStartPosition,
120 __in DWORD cbMaxRead,
121 __in BOOL fPartialOK
122 );
123HRESULT DAPI FileReadPartialEx(
124 __deref_inout_bcount_full(*pcbDest) LPBYTE* ppbDest,
125 __out_range(<=, cbMaxRead) SIZE_T* pcbDest,
126 __in_z LPCWSTR wzSrcPath,
127 __in BOOL fSeek,
128 __in DWORD cbStartPosition,
129 __in DWORD cbMaxRead,
130 __in BOOL fPartialOK,
131 __in DWORD dwShareMode
132 );
133HRESULT DAPI FileReadHandle(
134 __in HANDLE hFile,
135 __in_bcount(cbDest) LPBYTE pbDest,
136 __in SIZE_T cbDest
137 );
138HRESULT DAPI FileWrite(
139 __in_z LPCWSTR pwzFileName,
140 __in DWORD dwFlagsAndAttributes,
141 __in_bcount_opt(cbData) LPCBYTE pbData,
142 __in SIZE_T cbData,
143 __out_opt HANDLE* pHandle
144 );
145HRESULT DAPI FileWriteHandle(
146 __in HANDLE hFile,
147 __in_bcount_opt(cbData) LPCBYTE pbData,
148 __in SIZE_T cbData
149 );
150HRESULT DAPI FileCopyUsingHandles(
151 __in HANDLE hSource,
152 __in HANDLE hTarget,
153 __in DWORD64 cbCopy,
154 __out_opt DWORD64* pcbCopied
155 );
156HRESULT DAPI FileCopyUsingHandlesWithProgress(
157 __in HANDLE hSource,
158 __in HANDLE hTarget,
159 __in DWORD64 cbCopy,
160 __in_opt LPPROGRESS_ROUTINE lpProgressRoutine,
161 __in_opt LPVOID lpData
162 );
163HRESULT DAPI FileEnsureCopy(
164 __in_z LPCWSTR wzSource,
165 __in_z LPCWSTR wzTarget,
166 __in BOOL fOverwrite
167 );
168HRESULT DAPI FileEnsureCopyWithRetry(
169 __in LPCWSTR wzSource,
170 __in LPCWSTR wzTarget,
171 __in BOOL fOverwrite,
172 __in DWORD cRetry,
173 __in DWORD dwWaitMilliseconds
174 );
175HRESULT DAPI FileEnsureMove(
176 __in_z LPCWSTR wzSource,
177 __in_z LPCWSTR wzTarget,
178 __in BOOL fOverwrite,
179 __in BOOL fAllowCopy
180 );
181HRESULT DAPI FileEnsureMoveWithRetry(
182 __in LPCWSTR wzSource,
183 __in LPCWSTR wzTarget,
184 __in BOOL fOverwrite,
185 __in BOOL fAllowCopy,
186 __in DWORD cRetry,
187 __in DWORD dwWaitMilliseconds
188 );
189HRESULT DAPI FileCreateTemp(
190 __in_z LPCWSTR wzPrefix,
191 __in_z LPCWSTR wzExtension,
192 __deref_opt_out_z LPWSTR* ppwzTempFile,
193 __out_opt HANDLE* phTempFile
194 );
195HRESULT DAPI FileCreateTempW(
196 __in_z LPCWSTR wzPrefix,
197 __in_z LPCWSTR wzExtension,
198 __deref_opt_out_z LPWSTR* ppwzTempFile,
199 __out_opt HANDLE* phTempFile
200 );
201HRESULT DAPI FileVersion(
202 __in_z LPCWSTR wzFilename,
203 __out DWORD *pdwVerMajor,
204 __out DWORD* pdwVerMinor
205 );
206HRESULT DAPI FileIsSame(
207 __in_z LPCWSTR wzFile1,
208 __in_z LPCWSTR wzFile2,
209 __out LPBOOL lpfSameFile
210 );
211HRESULT DAPI FileEnsureDelete(
212 __in_z LPCWSTR wzFile
213 );
214HRESULT DAPI FileGetTime(
215 __in_z LPCWSTR wzFile,
216 __out_opt LPFILETIME lpCreationTime,
217 __out_opt LPFILETIME lpLastAccessTime,
218 __out_opt LPFILETIME lpLastWriteTime
219 );
220HRESULT DAPI FileSetTime(
221 __in_z LPCWSTR wzFile,
222 __in_opt const FILETIME *lpCreationTime,
223 __in_opt const FILETIME *lpLastAccessTime,
224 __in_opt const FILETIME *lpLastWriteTime
225 );
226HRESULT DAPI FileResetTime(
227 __in_z LPCWSTR wzFile
228 );
229HRESULT DAPI FileExecutableArchitecture(
230 __in_z LPCWSTR wzFile,
231 __out FILE_ARCHITECTURE *pArchitecture
232 );
233HRESULT DAPI FileToString(
234 __in_z LPCWSTR wzFile,
235 __out LPWSTR *psczString,
236 __out_opt FILE_ENCODING *pfeEncoding
237 );
238HRESULT DAPI FileFromString(
239 __in_z LPCWSTR wzFile,
240 __in DWORD dwFlagsAndAttributes,
241 __in_z LPCWSTR sczString,
242 __in FILE_ENCODING feEncoding
243 );
244
245#ifdef __cplusplus
246}
247#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/gdiputil.h b/src/libs/dutil/WixToolset.DUtil/inc/gdiputil.h
new file mode 100644
index 00000000..f2145828
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/gdiputil.h
@@ -0,0 +1,39 @@
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#define ExitOnGdipFailureSource(d, g, x, s, ...) { x = GdipHresultFromStatus(g); if (FAILED(x)) { Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, s, __VA_ARGS__); goto LExit; } }
6#define ExitOnGdipFailure(g, x, s, ...) ExitOnGdipFailureSource(DUTIL_SOURCE_DEFAULT, g, x, s, __VA_ARGS__)
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12HRESULT DAPI GdipInitialize(
13 __in const Gdiplus::GdiplusStartupInput* pInput,
14 __out ULONG_PTR* pToken,
15 __out_opt Gdiplus::GdiplusStartupOutput *pOutput
16 );
17
18void DAPI GdipUninitialize(
19 __in ULONG_PTR token
20 );
21
22HRESULT DAPI GdipBitmapFromResource(
23 __in_opt HINSTANCE hinst,
24 __in_z LPCSTR szId,
25 __out Gdiplus::Bitmap **ppBitmap
26 );
27
28HRESULT DAPI GdipBitmapFromFile(
29 __in_z LPCWSTR wzFileName,
30 __out Gdiplus::Bitmap **ppBitmap
31 );
32
33HRESULT DAPI GdipHresultFromStatus(
34 __in Gdiplus::Status gs
35 );
36
37#ifdef __cplusplus
38}
39#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/guidutil.h b/src/libs/dutil/WixToolset.DUtil/inc/guidutil.h
new file mode 100644
index 00000000..478a464f
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/guidutil.h
@@ -0,0 +1,21 @@
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
6extern "C" {
7#endif
8
9#define GUID_STRING_LENGTH 39
10
11HRESULT DAPI GuidFixedCreate(
12 _Out_z_cap_c_(GUID_STRING_LENGTH) WCHAR* wzGuid
13 );
14
15HRESULT DAPI GuidCreate(
16 __deref_out_z LPWSTR* psczGuid
17 );
18
19#ifdef __cplusplus
20}
21#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/iis7util.h b/src/libs/dutil/WixToolset.DUtil/inc/iis7util.h
new file mode 100644
index 00000000..3572b4e9
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/iis7util.h
@@ -0,0 +1,222 @@
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
6extern "C" {
7#endif
8
9// IIS Config schema names
10#define IIS_CONFIG_ADD L"add"
11#define IIS_CONFIG_ALLOWED L"allowed"
12#define IIS_CONFIG_APPHOST_ROOT L"MACHINE/WEBROOT/APPHOST"
13#define IIS_CONFIG_APPLICATION L"application"
14#define IIS_CONFIG_APPPOOL L"applicationPool"
15#define IIS_CONFIG_APPPOOL_AUTO L"autoStart"
16#define IIS_CONFIG_APPPOOL_SECTION L"system.applicationHost/applicationPools"
17#define IIS_CONFIG_AUTOSTART L"serverAutoStart"
18#define IIS_CONFIG_BINDING L"binding"
19#define IIS_CONFIG_BINDINGINFO L"bindingInformation"
20#define IIS_CONFIG_BINDINGS L"bindings"
21#define IIS_CONFIG_DESC L"description"
22#define IIS_CONFIG_EXECUTABLE L"scriptProcessor"
23#define IIS_CONFIG_ENABLED L"enabled"
24#define IIS_CONFIG_ENABLE32 L"enable32BitAppOnWin64"
25#define IIS_CONFIG_FILEEXT L"fileExtension"
26#define IIS_CONFIG_FILTER L"filter"
27#define IIS_CONFIG_GROUPID L"groupId"
28#define IIS_CONFIG_HEADERS L"customHeaders"
29#define IIS_CONFIG_HTTPERRORS_SECTION L"system.webServer/httpErrors"
30#define IIS_CONFIG_ID L"id"
31#define IIS_CONFIG_ISAPI_SECTION L"system.webServer/isapiFilters"
32#define IIS_CONFIG_HTTPPROTO_SECTION L"system.webServer/httpProtocol"
33#define IIS_CONFIG_LOG_SECTION L"system.applicationHost/log"
34#define IIS_CONFIG_LOG_UTF8 L"logInUTF8"
35#define IIS_CONFIG_LIMITS L"limits"
36#define IIS_CONFIG_PIPELINEMODE L"managedPipelineMode"
37#define IIS_CONFIG_MANAGEDRUNTIMEVERSION L"managedRuntimeVersion"
38#define IIS_CONFIG_WEBLOG L"logFile"
39#define IIS_CONFIG_LOGFORMAT L"logFormat"
40#define IIS_CONFIG_MIMEMAP L"mimeMap"
41#define IIS_CONFIG_MIMETYPE L"mimeType"
42#define IIS_CONFIG_MODULES L"modules"
43#define IIS_CONFIG_NAME L"name"
44#define IIS_CONFIG_PATH L"path"
45#define IIS_CONFIG_PHYSPATH L"physicalPath"
46#define IIS_CONFIG_PROTOCOL L"protocol"
47#define IIS_CONFIG_RESTRICTION_SECTION L"system.webServer/security/isapiCgiRestriction"
48#define IIS_CONFIG_SITE L"site"
49#define IIS_CONFIG_SITE_ID L"id"
50#define IIS_CONFIG_SITES_SECTION L"system.applicationHost/sites"
51#define IIS_CONFIG_CONNECTTIMEOUT L"connectionTimeout"
52#define IIS_CONFIG_VDIR L"virtualDirectory"
53#define IIS_CONFIG_VALUE L"value"
54#define IIS_CONFIG_VERBS L"verb"
55#define IIS_CONFIG_WEBLIMITS_SECTION L"system.applicationHost/webLimits"
56#define IIS_CONFIG_WEBLIMITS_MAXBAND L"maxGlobalBandwidth"
57#define IIS_CONFIG_TRUE L"true"
58#define IIS_CONFIG_FALSE L"false"
59#define IIS_CONFIG_ERROR L"error"
60#define IIS_CONFIG_STATUSCODE L"statusCode"
61#define IIS_CONFIG_SUBSTATUS L"subStatusCode"
62#define IIS_CONFIG_LANGPATH L"prefixLanguageFilePath"
63#define IIS_CONFIG_RESPMODE L"responseMode"
64#define IIS_CONFIG_CLEAR L"clear"
65#define IIS_CONFIG_RECYCLING L"recycling"
66#define IIS_CONFIG_PEROIDRESTART L"periodicRestart"
67#define IIS_CONFIG_TIME L"time"
68#define IIS_CONFIG_REQUESTS L"requests"
69#define IIS_CONFIG_SCHEDULE L"schedule"
70#define IIS_CONFIG_MEMORY L"memory"
71#define IIS_CONFIG_PRIVMEMORY L"privateMemory"
72#define IIS_CONFIG_PROCESSMODEL L"processModel"
73#define IIS_CONFIG_IDLETIMEOUT L"idleTimeout"
74#define IIS_CONFIG_QUEUELENGTH L"queueLength"
75#define IIS_CONFIG_IDENITITYTYPE L"identityType"
76#define IIS_CONFIG_LOCALSYSTEM L"LocalSystem"
77#define IIS_CONFIG_LOCALSERVICE L"LocalService"
78#define IIS_CONFIG_NETWORKSERVICE L"NetworkService"
79#define IIS_CONFIG_SPECIFICUSER L"SpecificUser"
80#define IIS_CONFIG_APPLICATIONPOOLIDENTITY L"ApplicationPoolIdentity"
81#define IIS_CONFIG_USERNAME L"userName"
82#define IIS_CONFIG_PASSWORD L"password"
83#define IIS_CONFIG_CPU L"cpu"
84#define IIS_CONFIG_LIMIT L"limit"
85#define IIS_CONFIG_CPU_ACTION L"action"
86#define IIS_CONFIG_KILLW3WP L"KillW3wp"
87#define IIS_CONFIG_NOACTION L"NoAction"
88#define IIS_CONFIG_RESETINTERVAL L"resetInterval"
89#define IIS_CONFIG_MAXWRKPROCESSES L"maxProcesses"
90#define IIS_CONFIG_HANDLERS_SECTION L"system.webServer/handlers"
91#define IIS_CONFIG_DEFAULTDOC_SECTION L"system.webServer/defaultDocument"
92#define IIS_CONFIG_ASP_SECTION L"system.webServer/asp"
93#define IIS_CONFIG_SCRIPTERROR L"scriptErrorSentToBrowser"
94#define IIS_CONFIG_STATICCONTENT_SECTION L"system.webServer/staticContent"
95#define IIS_CONFIG_HTTPEXPIRES L"httpExpires"
96#define IIS_CONFIG_MAXAGE L"cacheControlMaxAge"
97#define IIS_CONFIG_CLIENTCACHE L"clientCache"
98#define IIS_CONFIG_CACHECONTROLMODE L"cacheControlMode"
99#define IIS_CONFIG_USEMAXAGE L"UseMaxAge"
100#define IIS_CONFIG_USEEXPIRES L"UseExpires"
101#define IIS_CONFIG_CACHECUST L"cacheControlCustom"
102#define IIS_CONFIG_ASP_SECTION L"system.webServer/asp"
103#define IIS_CONFIG_SESSION L"session"
104#define IIS_CONFIG_ALLOWSTATE L"allowSessionState"
105#define IIS_CONFIG_TIMEOUT L"timeout"
106#define IIS_CONFIG_BUFFERING L"bufferingOn"
107#define IIS_CONFIG_PARENTPATHS L"enableParentPaths"
108#define IIS_CONFIG_SCRIPTLANG L"scriptLanguage"
109#define IIS_CONFIG_SCRIPTTIMEOUT L"scriptTimeout"
110#define IIS_CONFIG_LIMITS L"limits"
111#define IIS_CONFIG_ALLOWDEBUG L"appAllowDebugging"
112#define IIS_CONFIG_ALLOWCLIENTDEBUG L"appAllowClientDebug"
113#define IIS_CONFIG_CERTIFICATEHASH L"certificateHash"
114#define IIS_CONFIG_CERTIFICATESTORENAME L"certificateStoreName"
115#define IIS_CONFIG_HTTPLOGGING_SECTION L"system.webServer/httpLogging"
116#define IIS_CONFIG_DONTLOG L"dontLog"
117
118typedef BOOL (CALLBACK* ENUMAPHOSTELEMENTPROC)(IAppHostElement*, LPVOID);
119typedef BOOL (CALLBACK* VARIANTCOMPARATORPROC)(VARIANT*, VARIANT*);
120
121HRESULT DAPI Iis7PutPropertyVariant(
122 __in IAppHostElement *pElement,
123 __in LPCWSTR wzPropName,
124 __in VARIANT vtPut
125 );
126
127HRESULT DAPI Iis7PutPropertyInteger(
128 __in IAppHostElement *pElement,
129 __in LPCWSTR wzPropName,
130 __in DWORD dValue
131 );
132
133HRESULT DAPI Iis7PutPropertyString(
134 __in IAppHostElement *pElement,
135 __in LPCWSTR wzPropName,
136 __in LPCWSTR wzString
137 );
138
139HRESULT DAPI Iis7PutPropertyBool(
140 __in IAppHostElement *pElement,
141 __in LPCWSTR wzPropName,
142 __in BOOL fValue);
143
144HRESULT DAPI Iis7GetPropertyVariant(
145 __in IAppHostElement *pElement,
146 __in LPCWSTR wzPropName,
147 __in VARIANT* vtGet
148 );
149
150HRESULT DAPI Iis7GetPropertyString(
151 __in IAppHostElement *pElement,
152 __in LPCWSTR wzPropName,
153 __in LPWSTR* psczGet
154 );
155
156struct IIS7_APPHOSTELEMENTCOMPARISON
157{
158 LPCWSTR sczElementName;
159 LPCWSTR sczAttributeName;
160 VARIANT* pvAttributeValue;
161 VARIANTCOMPARATORPROC pComparator;
162};
163
164BOOL DAPI Iis7IsMatchingAppHostElement(
165 __in IAppHostElement *pElement,
166 __in IIS7_APPHOSTELEMENTCOMPARISON* pComparison
167 );
168
169HRESULT DAPI Iis7FindAppHostElementString(
170 __in IAppHostElementCollection *pCollection,
171 __in LPCWSTR wzElementName,
172 __in LPCWSTR wzAttributeName,
173 __in LPCWSTR wzAttributeValue,
174 __out IAppHostElement** ppElement,
175 __out DWORD* pdwIndex
176 );
177
178HRESULT DAPI Iis7FindAppHostElementPath(
179 __in IAppHostElementCollection *pCollection,
180 __in LPCWSTR wzElementName,
181 __in LPCWSTR wzAttributeName,
182 __in LPCWSTR wzAttributeValue,
183 __out IAppHostElement** ppElement,
184 __out DWORD* pdwIndex
185 );
186
187HRESULT DAPI Iis7FindAppHostElementInteger(
188 __in IAppHostElementCollection *pCollection,
189 __in LPCWSTR wzElementName,
190 __in LPCWSTR wzAttributeName,
191 __in DWORD dwAttributeValue,
192 __out IAppHostElement** ppElement,
193 __out DWORD* pdwIndex
194 );
195
196HRESULT DAPI Iis7FindAppHostElementVariant(
197 __in IAppHostElementCollection *pCollection,
198 __in LPCWSTR wzElementName,
199 __in LPCWSTR wzAttributeName,
200 __in VARIANT* pvAttributeValue,
201 __out IAppHostElement** ppElement,
202 __out DWORD* pdwIndex
203 );
204
205HRESULT DAPI Iis7EnumAppHostElements(
206 __in IAppHostElementCollection *pCollection,
207 __in ENUMAPHOSTELEMENTPROC pCallback,
208 __in LPVOID pContext,
209 __out IAppHostElement** ppElement,
210 __out DWORD* pdwIndex
211 );
212
213HRESULT DAPI Iis7FindAppHostMethod(
214 __in IAppHostMethodCollection *pCollection,
215 __in LPCWSTR wzMethodName,
216 __out IAppHostMethod** ppMethod,
217 __out DWORD* pdwIndex
218 );
219
220#ifdef __cplusplus
221}
222#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/inetutil.h b/src/libs/dutil/WixToolset.DUtil/inc/inetutil.h
new file mode 100644
index 00000000..19ace88b
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/inetutil.h
@@ -0,0 +1,39 @@
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
6extern "C" {
7#endif
8
9#define ReleaseInternet(h) if (h) { ::InternetCloseHandle(h); h = NULL; }
10#define ReleaseNullInternet(h) if (h) { ::InternetCloseHandle(h); h = NULL; }
11
12
13// functions
14HRESULT DAPI InternetGetSizeByHandle(
15 __in HINTERNET hiFile,
16 __out LONGLONG* pllSize
17 );
18
19HRESULT DAPI InternetGetCreateTimeByHandle(
20 __in HINTERNET hiFile,
21 __out LPFILETIME pft
22 );
23
24HRESULT DAPI InternetQueryInfoString(
25 __in HINTERNET h,
26 __in DWORD dwInfo,
27 __deref_out_z LPWSTR* psczValue
28 );
29
30HRESULT DAPI InternetQueryInfoNumber(
31 __in HINTERNET h,
32 __in DWORD dwInfo,
33 __inout LONG* plInfo
34 );
35
36#ifdef __cplusplus
37}
38#endif
39
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/iniutil.h b/src/libs/dutil/WixToolset.DUtil/inc/iniutil.h
new file mode 100644
index 00000000..c8503155
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/iniutil.h
@@ -0,0 +1,79 @@
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
6extern "C" {
7#endif
8
9#define ReleaseIni(ih) if (ih) { IniUninitialize(ih); }
10#define ReleaseNullIni(ih) if (ih) { IniUninitialize(ih); ih = NULL; }
11
12typedef void* INI_HANDLE;
13typedef const void* C_INI_HANDLE;
14
15extern const int INI_HANDLE_BYTES;
16
17struct INI_VALUE
18{
19 LPCWSTR wzName;
20 LPCWSTR wzValue;
21
22 DWORD dwLineNumber;
23};
24
25HRESULT DAPI IniInitialize(
26 __out_bcount(INI_HANDLE_BYTES) INI_HANDLE* piHandle
27 );
28void DAPI IniUninitialize(
29 __in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle
30 );
31HRESULT DAPI IniSetOpenTag(
32 __inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
33 __in_z_opt LPCWSTR wzOpenTagPrefix,
34 __in_z_opt LPCWSTR wzOpenTagPostfix
35 );
36HRESULT DAPI IniSetValueStyle(
37 __inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
38 __in_z_opt LPCWSTR wzValuePrefix,
39 __in_z_opt LPCWSTR wzValueSeparator
40 );
41HRESULT DAPI IniSetValueSeparatorException(
42 __inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
43 __in_z LPCWSTR wzValueNamePrefix
44 );
45HRESULT DAPI IniSetCommentStyle(
46 __inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
47 __in_z_opt LPCWSTR wzLinePrefix
48 );
49HRESULT DAPI IniParse(
50 __inout_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
51 __in LPCWSTR wzPath,
52 __out_opt FILE_ENCODING *pfeEncodingFound
53 );
54// Gets the full value array, this includes values that may have been deleted
55// (their value will be NULL)
56HRESULT DAPI IniGetValueList(
57 __in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
58 __deref_out_ecount_opt(*pcValues) INI_VALUE** prgivValues,
59 __out DWORD *pcValues
60 );
61HRESULT DAPI IniGetValue(
62 __in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
63 __in LPCWSTR wzValueName,
64 __deref_out_z LPWSTR* psczValue
65 );
66HRESULT DAPI IniSetValue(
67 __in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
68 __in LPCWSTR wzValueName,
69 __in_z_opt LPCWSTR wzValue
70 );
71HRESULT DAPI IniWriteFile(
72 __in_bcount(INI_HANDLE_BYTES) INI_HANDLE piHandle,
73 __in_z_opt LPCWSTR wzPath,
74 __in FILE_ENCODING feOverrideEncoding
75 );
76
77#ifdef __cplusplus
78}
79#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/jsonutil.h b/src/libs/dutil/WixToolset.DUtil/inc/jsonutil.h
new file mode 100644
index 00000000..b05e9970
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/jsonutil.h
@@ -0,0 +1,112 @@
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
6extern "C" {
7#endif
8
9typedef enum JSON_TOKEN
10{
11 JSON_TOKEN_NONE,
12 JSON_TOKEN_ARRAY_START,
13 JSON_TOKEN_ARRAY_VALUE,
14 JSON_TOKEN_ARRAY_END,
15 JSON_TOKEN_OBJECT_START,
16 JSON_TOKEN_OBJECT_KEY,
17 JSON_TOKEN_OBJECT_VALUE,
18 JSON_TOKEN_OBJECT_END,
19 JSON_TOKEN_VALUE,
20} JSON_TOKEN;
21
22typedef struct _JSON_VALUE
23{
24} JSON_VALUE;
25
26typedef struct _JSON_READER
27{
28 CRITICAL_SECTION cs;
29 LPWSTR sczJson;
30
31 LPWSTR pwz;
32 JSON_TOKEN token;
33} JSON_READER;
34
35typedef struct _JSON_WRITER
36{
37 CRITICAL_SECTION cs;
38 LPWSTR sczJson;
39
40 JSON_TOKEN* rgTokenStack;
41 DWORD cTokens;
42 DWORD cMaxTokens;
43} JSON_WRITER;
44
45
46DAPI_(HRESULT) JsonInitializeReader(
47 __in_z LPCWSTR wzJson,
48 __in JSON_READER* pReader
49 );
50
51DAPI_(void) JsonUninitializeReader(
52 __in JSON_READER* pReader
53 );
54
55DAPI_(HRESULT) JsonReadNext(
56 __in JSON_READER* pReader,
57 __out JSON_TOKEN* pToken,
58 __out JSON_VALUE* pValue
59 );
60
61DAPI_(HRESULT) JsonReadValue(
62 __in JSON_READER* pReader,
63 __in JSON_VALUE* pValue
64 );
65
66DAPI_(HRESULT) JsonInitializeWriter(
67 __in JSON_WRITER* pWriter
68 );
69
70DAPI_(void) JsonUninitializeWriter(
71 __in JSON_WRITER* pWriter
72 );
73
74DAPI_(HRESULT) JsonWriteBool(
75 __in JSON_WRITER* pWriter,
76 __in BOOL fValue
77 );
78
79DAPI_(HRESULT) JsonWriteNumber(
80 __in JSON_WRITER* pWriter,
81 __in DWORD dwValue
82 );
83
84DAPI_(HRESULT) JsonWriteString(
85 __in JSON_WRITER* pWriter,
86 __in_z LPCWSTR wzValue
87 );
88
89DAPI_(HRESULT) JsonWriteArrayStart(
90 __in JSON_WRITER* pWriter
91 );
92
93DAPI_(HRESULT) JsonWriteArrayEnd(
94 __in JSON_WRITER* pWriter
95 );
96
97DAPI_(HRESULT) JsonWriteObjectStart(
98 __in JSON_WRITER* pWriter
99 );
100
101DAPI_(HRESULT) JsonWriteObjectKey(
102 __in JSON_WRITER* pWriter,
103 __in_z LPCWSTR wzKey
104 );
105
106DAPI_(HRESULT) JsonWriteObjectEnd(
107 __in JSON_WRITER* pWriter
108 );
109
110#ifdef __cplusplus
111}
112#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/locutil.h b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h
new file mode 100644
index 00000000..38ddda20
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h
@@ -0,0 +1,120 @@
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
6extern "C" {
7#endif
8
9struct LOC_STRING
10{
11 LPWSTR wzId;
12 LPWSTR wzText;
13 BOOL bOverridable;
14};
15
16const int LOC_CONTROL_NOT_SET = INT_MAX;
17
18struct LOC_CONTROL
19{
20 LPWSTR wzControl;
21 int nX;
22 int nY;
23 int nWidth;
24 int nHeight;
25 LPWSTR wzText;
26};
27
28const int WIX_LOCALIZATION_LANGUAGE_NOT_SET = INT_MAX;
29
30struct WIX_LOCALIZATION
31{
32 DWORD dwLangId;
33
34 DWORD cLocStrings;
35 LOC_STRING* rgLocStrings;
36
37 DWORD cLocControls;
38 LOC_CONTROL* rgLocControls;
39};
40
41/********************************************************************
42 LocProbeForFile - Searches for a localization file on disk.
43
44*******************************************************************/
45HRESULT DAPI LocProbeForFile(
46 __in_z LPCWSTR wzBasePath,
47 __in_z LPCWSTR wzLocFileName,
48 __in_z_opt LPCWSTR wzLanguage,
49 __inout LPWSTR* psczPath
50 );
51
52/********************************************************************
53 LocLoadFromFile - Loads a localization file
54
55*******************************************************************/
56HRESULT DAPI LocLoadFromFile(
57 __in_z LPCWSTR wzWxlFile,
58 __out WIX_LOCALIZATION** ppWixLoc
59 );
60
61/********************************************************************
62 LocLoadFromResource - loads a localization file from a module's data
63 resource.
64
65 NOTE: The resource data must be UTF-8 encoded.
66*******************************************************************/
67HRESULT DAPI LocLoadFromResource(
68 __in HMODULE hModule,
69 __in_z LPCSTR szResource,
70 __out WIX_LOCALIZATION** ppWixLoc
71 );
72
73/********************************************************************
74 LocFree - free memory allocated when loading a localization file
75
76*******************************************************************/
77void DAPI LocFree(
78 __in_opt WIX_LOCALIZATION* pWixLoc
79 );
80
81/********************************************************************
82 LocLocalizeString - replace any #(loc.id) in a string with the
83 correct sub string
84*******************************************************************/
85HRESULT DAPI LocLocalizeString(
86 __in const WIX_LOCALIZATION* pWixLoc,
87 __inout LPWSTR* psczInput
88 );
89
90/********************************************************************
91 LocGetControl - returns a control's localization information
92*******************************************************************/
93HRESULT DAPI LocGetControl(
94 __in const WIX_LOCALIZATION* pWixLoc,
95 __in_z LPCWSTR wzId,
96 __out LOC_CONTROL** ppLocControl
97 );
98
99/********************************************************************
100LocGetString - returns a string's localization information
101*******************************************************************/
102extern "C" HRESULT DAPI LocGetString(
103 __in const WIX_LOCALIZATION* pWixLoc,
104 __in_z LPCWSTR wzId,
105 __out LOC_STRING** ppLocString
106 );
107
108/********************************************************************
109LocAddString - adds a localization string
110*******************************************************************/
111extern "C" HRESULT DAPI LocAddString(
112 __in WIX_LOCALIZATION* pWixLoc,
113 __in_z LPCWSTR wzId,
114 __in_z LPCWSTR wzLocString,
115 __in BOOL bOverridable
116 );
117
118#ifdef __cplusplus
119}
120#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/logutil.h b/src/libs/dutil/WixToolset.DUtil/inc/logutil.h
new file mode 100644
index 00000000..426506ee
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/logutil.h
@@ -0,0 +1,192 @@
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
6extern "C" {
7#endif
8
9#define LogExitOnFailureSource(d, x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
10#define LogExitOnRootFailureSource(d, x, i, f, ...) if (FAILED(x)) { LogErrorId(x, i, __VA_ARGS__); Dutil_RootFailure(__FILE__, __LINE__, x); ExitTraceSource(d, x, f, __VA_ARGS__); goto LExit; }
11
12#define LogExitOnFailure(x, i, f, ...) LogExitOnFailureSource(DUTIL_SOURCE_DEFAULT, x, i, f, __VA_ARGS__)
13#define LogExitOnRootFailure(x, i, f, ...) LogExitOnRootFailureSource(DUTIL_SOURCE_DEFAULT, x, i, f, __VA_ARGS__)
14
15typedef HRESULT (DAPI *PFN_LOGSTRINGWORKRAW)(
16 __in_z LPCSTR szString,
17 __in_opt LPVOID pvContext
18 );
19
20// enums
21
22// structs
23
24// functions
25BOOL DAPI IsLogInitialized();
26
27BOOL DAPI IsLogOpen();
28
29void DAPI LogInitialize(
30 __in HMODULE hModule
31 );
32
33HRESULT DAPI LogOpen(
34 __in_z_opt LPCWSTR wzDirectory,
35 __in_z LPCWSTR wzLog,
36 __in_z_opt LPCWSTR wzPostfix,
37 __in_z_opt LPCWSTR wzExt,
38 __in BOOL fAppend,
39 __in BOOL fHeader,
40 __out_z_opt LPWSTR* psczLogPath
41 );
42
43void DAPI LogDisable();
44
45void DAPI LogRedirect(
46 __in_opt PFN_LOGSTRINGWORKRAW vpfLogStringWorkRaw,
47 __in_opt LPVOID pvContext
48 );
49
50HRESULT DAPI LogRename(
51 __in_z LPCWSTR wzNewPath
52 );
53
54void DAPI LogClose(
55 __in BOOL fFooter
56 );
57
58void DAPI LogUninitialize(
59 __in BOOL fFooter
60 );
61
62BOOL DAPI LogIsOpen();
63
64HRESULT DAPI LogSetSpecialParams(
65 __in_z_opt LPCWSTR wzSpecialBeginLine,
66 __in_z_opt LPCWSTR wzSpecialAfterTimeStamp,
67 __in_z_opt LPCWSTR wzSpecialEndLine
68 );
69
70REPORT_LEVEL DAPI LogSetLevel(
71 __in REPORT_LEVEL rl,
72 __in BOOL fLogChange
73 );
74
75REPORT_LEVEL DAPI LogGetLevel();
76
77HRESULT DAPI LogGetPath(
78 __out_ecount_z(cchLogPath) LPWSTR pwzLogPath,
79 __in DWORD cchLogPath
80 );
81
82HANDLE DAPI LogGetHandle();
83
84HRESULT DAPIV LogString(
85 __in REPORT_LEVEL rl,
86 __in_z __format_string LPCSTR szFormat,
87 ...
88 );
89
90HRESULT DAPI LogStringArgs(
91 __in REPORT_LEVEL rl,
92 __in_z __format_string LPCSTR szFormat,
93 __in va_list args
94 );
95
96HRESULT DAPIV LogStringLine(
97 __in REPORT_LEVEL rl,
98 __in_z __format_string LPCSTR szFormat,
99 ...
100 );
101
102HRESULT DAPI LogStringLineArgs(
103 __in REPORT_LEVEL rl,
104 __in_z __format_string LPCSTR szFormat,
105 __in va_list args
106 );
107
108HRESULT DAPI LogIdModuleArgs(
109 __in REPORT_LEVEL rl,
110 __in DWORD dwLogId,
111 __in_opt HMODULE hModule,
112 __in va_list args
113 );
114
115/*
116 * Wraps LogIdModuleArgs, so inline to save the function call
117 */
118
119inline HRESULT LogId(
120 __in REPORT_LEVEL rl,
121 __in DWORD dwLogId,
122 ...
123 )
124{
125 HRESULT hr = S_OK;
126 va_list args;
127
128 va_start(args, dwLogId);
129 hr = LogIdModuleArgs(rl, dwLogId, NULL, args);
130 va_end(args);
131
132 return hr;
133}
134
135
136/*
137 * Wraps LogIdModuleArgs, so inline to save the function call
138 */
139
140inline HRESULT LogIdArgs(
141 __in REPORT_LEVEL rl,
142 __in DWORD dwLogId,
143 __in va_list args
144 )
145{
146 return LogIdModuleArgs(rl, dwLogId, NULL, args);
147}
148
149HRESULT DAPIV LogErrorString(
150 __in HRESULT hrError,
151 __in_z __format_string LPCSTR szFormat,
152 ...
153 );
154
155HRESULT DAPI LogErrorStringArgs(
156 __in HRESULT hrError,
157 __in_z __format_string LPCSTR szFormat,
158 __in va_list args
159 );
160
161HRESULT DAPI LogErrorIdModule(
162 __in HRESULT hrError,
163 __in DWORD dwLogId,
164 __in_opt HMODULE hModule,
165 __in_z_opt LPCWSTR wzString1,
166 __in_z_opt LPCWSTR wzString2,
167 __in_z_opt LPCWSTR wzString3
168 );
169
170inline HRESULT LogErrorId(
171 __in HRESULT hrError,
172 __in DWORD dwLogId,
173 __in_z_opt LPCWSTR wzString1 = NULL,
174 __in_z_opt LPCWSTR wzString2 = NULL,
175 __in_z_opt LPCWSTR wzString3 = NULL
176 )
177{
178 return LogErrorIdModule(hrError, dwLogId, NULL, wzString1, wzString2, wzString3);
179}
180
181HRESULT DAPI LogHeader();
182
183HRESULT DAPI LogFooter();
184
185HRESULT LogStringWorkRaw(
186 __in_z LPCSTR szLogData
187 );
188
189#ifdef __cplusplus
190}
191#endif
192
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/memutil.h b/src/libs/dutil/WixToolset.DUtil/inc/memutil.h
new file mode 100644
index 00000000..49f86e0a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/memutil.h
@@ -0,0 +1,80 @@
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
6extern "C" {
7#endif
8
9#define ReleaseMem(p) if (p) { MemFree(p); }
10#define ReleaseNullMem(p) if (p) { MemFree(p); p = NULL; }
11
12HRESULT DAPI MemInitialize();
13void DAPI MemUninitialize();
14
15LPVOID DAPI MemAlloc(
16 __in SIZE_T cbSize,
17 __in BOOL fZero
18 );
19LPVOID DAPI MemReAlloc(
20 __in LPVOID pv,
21 __in SIZE_T cbSize,
22 __in BOOL fZero
23 );
24HRESULT DAPI MemReAllocSecure(
25 __in LPVOID pv,
26 __in SIZE_T cbSize,
27 __in BOOL fZero,
28 __deref_out LPVOID* ppvNew
29 );
30HRESULT DAPI MemAllocArray(
31 __inout LPVOID* ppvArray,
32 __in SIZE_T cbArrayType,
33 __in DWORD dwItemCount
34 );
35HRESULT DAPI MemReAllocArray(
36 __inout LPVOID* ppvArray,
37 __in DWORD cArray,
38 __in SIZE_T cbArrayType,
39 __in DWORD dwNewItemCount
40 );
41HRESULT DAPI MemEnsureArraySize(
42 __deref_inout_bcount(cArray * cbArrayType) LPVOID* ppvArray,
43 __in DWORD cArray,
44 __in SIZE_T cbArrayType,
45 __in DWORD dwGrowthCount
46 );
47HRESULT DAPI MemInsertIntoArray(
48 __deref_inout_bcount((cExistingArray + cInsertItems) * cbArrayType) LPVOID* ppvArray,
49 __in DWORD dwInsertIndex,
50 __in DWORD cInsertItems,
51 __in DWORD cExistingArray,
52 __in SIZE_T cbArrayType,
53 __in DWORD dwGrowthCount
54 );
55void DAPI MemRemoveFromArray(
56 __inout_bcount((cExistingArray) * cbArrayType) LPVOID pvArray,
57 __in DWORD dwRemoveIndex,
58 __in DWORD cRemoveItems,
59 __in DWORD cExistingArray,
60 __in SIZE_T cbArrayType,
61 __in BOOL fPreserveOrder
62 );
63void DAPI MemArraySwapItems(
64 __inout_bcount(cbArrayType) LPVOID pvArray,
65 __in DWORD dwIndex1,
66 __in DWORD dwIndex2,
67 __in SIZE_T cbArrayType
68 );
69
70HRESULT DAPI MemFree(
71 __in LPVOID pv
72 );
73SIZE_T DAPI MemSize(
74 __in LPCVOID pv
75 );
76
77#ifdef __cplusplus
78}
79#endif
80
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/metautil.h b/src/libs/dutil/WixToolset.DUtil/inc/metautil.h
new file mode 100644
index 00000000..31f9ff5c
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/metautil.h
@@ -0,0 +1,52 @@
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#include <iadmw.h>
6#include <iiscnfg.h>
7#include <iwamreg.h>
8#include <mddefw.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14// structs
15
16// prototypes
17HRESULT DAPI MetaFindWebBase(
18 __in IMSAdminBaseW* piMetabase,
19 __in_z LPCWSTR wzIP,
20 __in int iPort,
21 __in_z LPCWSTR wzHeader,
22 __in BOOL fSecure,
23 __out_ecount(cchWebBase) LPWSTR wzWebBase,
24 __in DWORD cchWebBase
25 );
26HRESULT DAPI MetaFindFreeWebBase(
27 __in IMSAdminBaseW* piMetabase,
28 __out_ecount(cchWebBase) LPWSTR wzWebBase,
29 __in DWORD cchWebBase
30 );
31
32HRESULT DAPI MetaOpenKey(
33 __in IMSAdminBaseW* piMetabase,
34 __in METADATA_HANDLE mhKey,
35 __in_z LPCWSTR wzKey,
36 __in DWORD dwAccess,
37 __in DWORD cRetries,
38 __out METADATA_HANDLE* pmh
39 );
40HRESULT DAPI MetaGetValue(
41 __in IMSAdminBaseW* piMetabase,
42 __in METADATA_HANDLE mhKey,
43 __in_z LPCWSTR wzKey,
44 __inout METADATA_RECORD* pmr
45 );
46void DAPI MetaFreeValue(
47 __in METADATA_RECORD* pmr
48 );
49
50#ifdef __cplusplus
51}
52#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/monutil.h b/src/libs/dutil/WixToolset.DUtil/inc/monutil.h
new file mode 100644
index 00000000..f644e205
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/monutil.h
@@ -0,0 +1,108 @@
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
6extern "C" {
7#endif
8
9#define ReleaseMon(mh) if (mh) { MonDestroy(mh); }
10#define ReleaseNullMon(mh) if (mh) { MonDestroy(mh); mh = NULL; }
11
12typedef void* MON_HANDLE;
13typedef const void* C_MON_HANDLE;
14
15// Defined in regutil.h
16enum REG_KEY_BITNESS;
17
18extern const int MON_HANDLE_BYTES;
19
20// Note: callbacks must be implemented in a thread-safe manner. They will be called asynchronously by a MonUtil-spawned thread.
21// They must also be written to return as soon as possible - they are called from the waiter thread
22typedef void (*PFN_MONGENERAL)(
23 __in HRESULT hr,
24 __in_opt LPVOID pvContext
25 );
26// This callback is not specific to any wait - it will notify client of any drive status changes, such as removable drive insertion / removal
27typedef void (*PFN_MONDRIVESTATUS)(
28 __in WCHAR chDrive,
29 __in BOOL fArriving,
30 __in_opt LPVOID pvContext
31 );
32// Note if these fire with a failed result it means an error has occurred with the wait, and so the wait will stay in the list and be retried. When waits start succeeding again,
33// MonUtil will notify of changes, because it may have not noticed changes during the interval for which the wait had failed. This behavior can result in false positive notifications,
34// so all consumers of MonUtil should be designed with this in mind.
35typedef void (*PFN_MONDIRECTORY)(
36 __in HRESULT hr,
37 __in_z LPCWSTR wzPath,
38 __in BOOL fRecursive,
39 __in_opt LPVOID pvContext,
40 __in_opt LPVOID pvDirectoryContext
41 );
42typedef void (*PFN_MONREGKEY)(
43 __in HRESULT hr,
44 __in HKEY hkRoot,
45 __in_z LPCWSTR wzSubKey,
46 __in REG_KEY_BITNESS kbKeyBitness,
47 __in BOOL fRecursive,
48 __in_opt LPVOID pvContext,
49 __in_opt LPVOID pvRegKeyContext
50 );
51
52// Silence period allows you to avoid lots of notifications when a lot of writes are going on in a directory
53// MonUtil will wait until the directory has been "silent" for at least dwSilencePeriodInMs milliseconds
54// The drawback to setting this to a value higher than zero is that even single write notifications
55// are delayed by this amount
56HRESULT DAPI MonCreate(
57 __out_bcount(MON_HANDLE_BYTES) MON_HANDLE *pHandle,
58 __in PFN_MONGENERAL vpfMonGeneral,
59 __in_opt PFN_MONDRIVESTATUS vpfMonDriveStatus,
60 __in_opt PFN_MONDIRECTORY vpfMonDirectory,
61 __in_opt PFN_MONREGKEY vpfMonRegKey,
62 __in_opt LPVOID pvContext
63 );
64// Don't add multiple identical waits! Not only is it wasteful and will cause multiple fires for the exact same change, it will also
65// result in slightly odd behavior when you remove a duplicated wait (removing a wait may or may not remove multiple waits)
66// This is due to the way coordinator thread and waiter threads handle removing, and while it is possible to solve, doing so would complicate the code.
67// So instead, de-dupe your wait requests before sending them to MonUtil.
68// Special notes for network waits: MonUtil can send false positive notifications (i.e. notifications when nothing had changed) if connection
69// to the share is lost and reconnected, because MonUtil can't know for sure whether changes occurred while the connection was lost.
70// Also, MonUtil will very every 20 minutes retry even successful network waits, because the underlying Win32 API cannot notify us if a remote server
71// had its network cable unplugged or similar sudden failure. When we retry the successful network waits, we will also send a false positive notification,
72// because it's impossible for MonUtil to detect if we're reconnecting to a server that had died and come back to life, or if we're reconnecting to a server that had
73// been up all along. For both of the above reasons, clients of MonUtil must be written to do very, very little work in the case of false positive network waits.
74HRESULT DAPI MonAddDirectory(
75 __in_bcount(MON_HANDLE_BYTES) MON_HANDLE handle,
76 __in_z LPCWSTR wzPath,
77 __in BOOL fRecursive,
78 __in DWORD dwSilencePeriodInMs,
79 __in_opt LPVOID pvDirectoryContext
80 );
81HRESULT DAPI MonAddRegKey(
82 __in_bcount(MON_HANDLE_BYTES) MON_HANDLE handle,
83 __in HKEY hkRoot,
84 __in_z LPCWSTR wzSubKey,
85 __in REG_KEY_BITNESS kbKeyBitness,
86 __in BOOL fRecursive,
87 __in DWORD dwSilencePeriodInMs,
88 __in_opt LPVOID pvRegKeyContext
89 );
90HRESULT DAPI MonRemoveDirectory(
91 __in_bcount(MON_HANDLE_BYTES) MON_HANDLE handle,
92 __in_z LPCWSTR wzPath,
93 __in BOOL fRecursive
94 );
95HRESULT DAPI MonRemoveRegKey(
96 __in_bcount(MON_HANDLE_BYTES) MON_HANDLE handle,
97 __in HKEY hkRoot,
98 __in_z LPCWSTR wzSubKey,
99 __in REG_KEY_BITNESS kbKeyBitness,
100 __in BOOL fRecursive
101 );
102void DAPI MonDestroy(
103 __in_bcount(MON_HANDLE_BYTES) MON_HANDLE handle
104 );
105
106#ifdef __cplusplus
107}
108#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/osutil.h b/src/libs/dutil/WixToolset.DUtil/inc/osutil.h
new file mode 100644
index 00000000..2cce6f63
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/osutil.h
@@ -0,0 +1,42 @@
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
6extern "C" {
7#endif
8
9typedef enum OS_VERSION
10{
11 OS_VERSION_UNKNOWN,
12 OS_VERSION_WINNT,
13 OS_VERSION_WIN2000,
14 OS_VERSION_WINXP,
15 OS_VERSION_WIN2003,
16 OS_VERSION_VISTA,
17 OS_VERSION_WIN2008,
18 OS_VERSION_WIN7,
19 OS_VERSION_WIN2008_R2,
20 OS_VERSION_FUTURE
21} OS_VERSION;
22
23void DAPI OsGetVersion(
24 __out OS_VERSION* pVersion,
25 __out DWORD* pdwServicePack
26 );
27HRESULT DAPI OsCouldRunPrivileged(
28 __out BOOL* pfPrivileged
29 );
30HRESULT DAPI OsIsRunningPrivileged(
31 __out BOOL* pfPrivileged
32 );
33HRESULT DAPI OsIsUacEnabled(
34 __out BOOL* pfUacEnabled
35 );
36HRESULT DAPI OsRtlGetVersion(
37 __inout RTL_OSVERSIONINFOEXW* pOvix
38 );
39
40#ifdef __cplusplus
41}
42#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h b/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h
new file mode 100644
index 00000000..579b8454
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/pathutil.h
@@ -0,0 +1,252 @@
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
6extern "C" {
7#endif
8
9typedef enum PATH_EXPAND
10{
11 PATH_EXPAND_ENVIRONMENT = 0x0001,
12 PATH_EXPAND_FULLPATH = 0x0002,
13} PATH_EXPAND;
14
15
16/*******************************************************************
17 PathCommandLineAppend - appends a command line argument on to a
18 string such that ::CommandLineToArgv() will shred them correctly
19 (i.e. quote arguments with spaces in them).
20********************************************************************/
21DAPI_(HRESULT) PathCommandLineAppend(
22 __deref_inout_z LPWSTR* psczCommandLine,
23 __in_z LPCWSTR wzArgument
24 );
25
26/*******************************************************************
27 PathFile - returns a pointer to the file part of the path.
28********************************************************************/
29DAPI_(LPWSTR) PathFile(
30 __in_z LPCWSTR wzPath
31 );
32
33/*******************************************************************
34 PathExtension - returns a pointer to the extension part of the path
35 (including the dot).
36********************************************************************/
37DAPI_(LPCWSTR) PathExtension(
38 __in_z LPCWSTR wzPath
39 );
40
41/*******************************************************************
42 PathGetDirectory - extracts the directory from a path.
43********************************************************************/
44DAPI_(HRESULT) PathGetDirectory(
45 __in_z LPCWSTR wzPath,
46 __out_z LPWSTR *psczDirectory
47 );
48
49/*******************************************************************
50PathGetParentPath - extracts the parent directory from a full path.
51********************************************************************/
52DAPI_(HRESULT) PathGetParentPath(
53 __in_z LPCWSTR wzPath,
54 __out_z LPWSTR *psczDirectory
55 );
56
57/*******************************************************************
58 PathExpand - gets the full path to a file resolving environment
59 variables along the way.
60********************************************************************/
61DAPI_(HRESULT) PathExpand(
62 __out LPWSTR *psczFullPath,
63 __in_z LPCWSTR wzRelativePath,
64 __in DWORD dwResolveFlags
65 );
66
67/*******************************************************************
68 PathPrefix - prefixes a full path with \\?\ or \\?\UNC as
69 appropriate.
70********************************************************************/
71DAPI_(HRESULT) PathPrefix(
72 __inout LPWSTR *psczFullPath
73 );
74
75/*******************************************************************
76 PathFixedBackslashTerminate - appends a \ if path does not have it
77 already, but fails if the buffer is
78 insufficient.
79********************************************************************/
80DAPI_(HRESULT) PathFixedBackslashTerminate(
81 __inout_ecount_z(cchPath) LPWSTR wzPath,
82 __in SIZE_T cchPath
83 );
84
85/*******************************************************************
86 PathBackslashTerminate - appends a \ if path does not have it
87 already.
88********************************************************************/
89DAPI_(HRESULT) PathBackslashTerminate(
90 __inout LPWSTR* psczPath
91 );
92
93/*******************************************************************
94 PathForCurrentProcess - gets the full path to the currently executing
95 process or (optionally) a module inside the process.
96********************************************************************/
97DAPI_(HRESULT) PathForCurrentProcess(
98 __inout LPWSTR *psczFullPath,
99 __in_opt HMODULE hModule
100 );
101
102/*******************************************************************
103 PathRelativeToModule - gets the name of a file in the same
104 directory as the current process or (optionally) a module inside
105 the process
106********************************************************************/
107DAPI_(HRESULT) PathRelativeToModule(
108 __inout LPWSTR *psczFullPath,
109 __in_opt LPCWSTR wzFileName,
110 __in_opt HMODULE hModule
111 );
112
113/*******************************************************************
114 PathCreateTempFile
115
116 Note: if wzDirectory is null, ::GetTempPath() will be used instead.
117 if wzFileNameTemplate is null, GetTempFileName() will be used instead.
118*******************************************************************/
119DAPI_(HRESULT) PathCreateTempFile(
120 __in_opt LPCWSTR wzDirectory,
121 __in_opt __format_string LPCWSTR wzFileNameTemplate,
122 __in DWORD dwUniqueCount,
123 __in DWORD dwFileAttributes,
124 __out_opt LPWSTR* psczTempFile,
125 __out_opt HANDLE* phTempFile
126 );
127
128/*******************************************************************
129 PathCreateTimeBasedTempFile - creates an empty temp file based on current
130 system time
131********************************************************************/
132DAPI_(HRESULT) PathCreateTimeBasedTempFile(
133 __in_z_opt LPCWSTR wzDirectory,
134 __in_z LPCWSTR wzPrefix,
135 __in_z_opt LPCWSTR wzPostfix,
136 __in_z LPCWSTR wzExtension,
137 __deref_opt_out_z LPWSTR* psczTempFile,
138 __out_opt HANDLE* phTempFile
139 );
140
141/*******************************************************************
142 PathCreateTempDirectory
143
144 Note: if wzDirectory is null, ::GetTempPath() will be used instead.
145*******************************************************************/
146DAPI_(HRESULT) PathCreateTempDirectory(
147 __in_opt LPCWSTR wzDirectory,
148 __in __format_string LPCWSTR wzDirectoryNameTemplate,
149 __in DWORD dwUniqueCount,
150 __out LPWSTR* psczTempDirectory
151 );
152
153/*******************************************************************
154 PathGetKnownFolder - returns the path to a well-known shell folder
155
156*******************************************************************/
157DAPI_(HRESULT) PathGetKnownFolder(
158 __in int csidl,
159 __out LPWSTR* psczKnownFolder
160 );
161
162/*******************************************************************
163 PathIsAbsolute - returns true if the path is absolute; false
164 otherwise.
165*******************************************************************/
166DAPI_(BOOL) PathIsAbsolute(
167 __in_z LPCWSTR wzPath
168 );
169
170/*******************************************************************
171 PathConcat - like .NET's Path.Combine, lets you build up a path
172 one piece -- file or directory -- at a time.
173*******************************************************************/
174DAPI_(HRESULT) PathConcat(
175 __in_opt LPCWSTR wzPath1,
176 __in_opt LPCWSTR wzPath2,
177 __deref_out_z LPWSTR* psczCombined
178 );
179
180/*******************************************************************
181 PathConcatCch - like .NET's Path.Combine, lets you build up a path
182 one piece -- file or directory -- at a time.
183*******************************************************************/
184DAPI_(HRESULT) PathConcatCch(
185 __in_opt LPCWSTR wzPath1,
186 __in SIZE_T cchPath1,
187 __in_opt LPCWSTR wzPath2,
188 __in SIZE_T cchPath2,
189 __deref_out_z LPWSTR* psczCombined
190 );
191
192/*******************************************************************
193 PathEnsureQuoted - ensures that a path is quoted; optionally,
194 this function also terminates a directory with a backslash
195 if it is not already.
196*******************************************************************/
197DAPI_(HRESULT) PathEnsureQuoted(
198 __inout LPWSTR* ppszPath,
199 __in BOOL fDirectory
200 );
201
202/*******************************************************************
203 PathCompare - compares the fully expanded path of the two paths using
204 ::CompareStringW().
205*******************************************************************/
206DAPI_(HRESULT) PathCompare(
207 __in_z LPCWSTR wzPath1,
208 __in_z LPCWSTR wzPath2,
209 __out int* pnResult
210 );
211
212/*******************************************************************
213 PathCompress - sets the compression state on an existing file or
214 directory. A no-op on file systems that don't
215 support compression.
216*******************************************************************/
217DAPI_(HRESULT) PathCompress(
218 __in_z LPCWSTR wzPath
219 );
220
221/*******************************************************************
222 PathGetHierarchyArray - allocates an array containing,
223 in order, every parent directory of the specified path,
224 ending with the actual input path
225 This function also works with registry subkeys
226*******************************************************************/
227DAPI_(HRESULT) PathGetHierarchyArray(
228 __in_z LPCWSTR wzPath,
229 __deref_inout_ecount_opt(*pcPathArray) LPWSTR **prgsczPathArray,
230 __inout LPUINT pcPathArray
231 );
232
233/*******************************************************************
234 PathCanonicalizePath - wrapper around PathCanonicalizeW.
235*******************************************************************/
236DAPI_(HRESULT) PathCanonicalizePath(
237 __in_z LPCWSTR wzPath,
238 __deref_out_z LPWSTR* psczCanonicalized
239 );
240
241/*******************************************************************
242PathDirectoryContainsPath - checks if wzPath is located inside
243 wzDirectory.
244*******************************************************************/
245DAPI_(HRESULT) PathDirectoryContainsPath(
246 __in_z LPCWSTR wzDirectory,
247 __in_z LPCWSTR wzPath
248 );
249
250#ifdef __cplusplus
251}
252#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/perfutil.h b/src/libs/dutil/WixToolset.DUtil/inc/perfutil.h
new file mode 100644
index 00000000..7557511d
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/perfutil.h
@@ -0,0 +1,24 @@
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
6extern "C" {
7#endif
8
9// structs
10
11
12// functions
13void DAPI PerfInitialize(
14 );
15void DAPI PerfClickTime(
16 __out_opt LARGE_INTEGER* pliElapsed
17 );
18double DAPI PerfConvertToSeconds(
19 __in const LARGE_INTEGER* pli
20 );
21
22#ifdef __cplusplus
23}
24#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/polcutil.h b/src/libs/dutil/WixToolset.DUtil/inc/polcutil.h
new file mode 100644
index 00000000..13618043
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/polcutil.h
@@ -0,0 +1,39 @@
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
6extern "C" {
7#endif
8
9const LPCWSTR POLICY_BURN_REGISTRY_PATH = L"WiX\\Burn";
10
11/********************************************************************
12PolcReadNumber - reads a number from policy.
13
14NOTE: S_FALSE returned if policy not set.
15NOTE: out is set to default on S_FALSE or any error.
16********************************************************************/
17HRESULT DAPI PolcReadNumber(
18 __in_z LPCWSTR wzPolicyPath,
19 __in_z LPCWSTR wzPolicyName,
20 __in DWORD dwDefault,
21 __out DWORD* pdw
22 );
23
24/********************************************************************
25PolcReadString - reads a string from policy.
26
27NOTE: S_FALSE returned if policy not set.
28NOTE: out is set to default on S_FALSE or any error.
29********************************************************************/
30HRESULT DAPI PolcReadString(
31 __in_z LPCWSTR wzPolicyPath,
32 __in_z LPCWSTR wzPolicyName,
33 __in_z_opt LPCWSTR wzDefault,
34 __deref_out_z LPWSTR* pscz
35 );
36
37#ifdef __cplusplus
38}
39#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/procutil.h b/src/libs/dutil/WixToolset.DUtil/inc/procutil.h
new file mode 100644
index 00000000..00f3f358
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/procutil.h
@@ -0,0 +1,75 @@
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
6extern "C" {
7#endif
8
9// structs
10typedef struct _PROC_FILESYSTEMREDIRECTION
11{
12 BOOL fDisabled;
13 LPVOID pvRevertState;
14} PROC_FILESYSTEMREDIRECTION;
15
16HRESULT DAPI ProcElevated(
17 __in HANDLE hProcess,
18 __out BOOL* pfElevated
19 );
20
21HRESULT DAPI ProcWow64(
22 __in HANDLE hProcess,
23 __out BOOL* pfWow64
24 );
25HRESULT DAPI ProcDisableWowFileSystemRedirection(
26 __in PROC_FILESYSTEMREDIRECTION* pfsr
27 );
28HRESULT DAPI ProcRevertWowFileSystemRedirection(
29 __in PROC_FILESYSTEMREDIRECTION* pfsr
30 );
31
32HRESULT DAPI ProcExec(
33 __in_z LPCWSTR wzExecutablePath,
34 __in_z_opt LPCWSTR wzCommandLine,
35 __in int nCmdShow,
36 __out HANDLE *phProcess
37 );
38HRESULT DAPI ProcExecute(
39 __in_z LPWSTR wzCommand,
40 __out HANDLE *phProcess,
41 __out_opt HANDLE *phChildStdIn,
42 __out_opt HANDLE *phChildStdOutErr
43 );
44HRESULT DAPI ProcWaitForCompletion(
45 __in HANDLE hProcess,
46 __in DWORD dwTimeout,
47 __out DWORD *pReturnCode
48 );
49HRESULT DAPI ProcWaitForIds(
50 __in_ecount(cProcessIds) const DWORD* pdwProcessIds,
51 __in DWORD cProcessIds,
52 __in DWORD dwMilliseconds
53 );
54HRESULT DAPI ProcCloseIds(
55 __in_ecount(cProcessIds) const DWORD* pdwProcessIds,
56 __in DWORD cProcessIds
57 );
58
59// following code in proc2utl.cpp due to dependency on PSAPI.DLL.
60HRESULT DAPI ProcFindAllIdsFromExeName(
61 __in_z LPCWSTR wzExeName,
62 __out DWORD** ppdwProcessIds,
63 __out DWORD* pcProcessIds
64 );
65
66// following code in proc3utl.cpp due to dependency on Wtsapi32.DLL.
67HRESULT DAPI ProcExecuteAsInteractiveUser(
68 __in_z LPCWSTR wzExecutablePath,
69 __in_z LPCWSTR wzCommand,
70 __out HANDLE *phProcess
71 );
72
73#ifdef __cplusplus
74}
75#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/regutil.h b/src/libs/dutil/WixToolset.DUtil/inc/regutil.h
new file mode 100644
index 00000000..75284940
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/regutil.h
@@ -0,0 +1,246 @@
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
6extern "C" {
7#endif
8
9
10#define ReleaseRegKey(h) if (h) { ::RegCloseKey(h); h = NULL; }
11
12typedef enum REG_KEY_BITNESS
13{
14 REG_KEY_DEFAULT = 0,
15 REG_KEY_32BIT = 1,
16 REG_KEY_64BIT = 2
17} REG_KEY_BITNESS;
18
19typedef LSTATUS (APIENTRY *PFN_REGCREATEKEYEXW)(
20 __in HKEY hKey,
21 __in LPCWSTR lpSubKey,
22 __reserved DWORD Reserved,
23 __in_opt LPWSTR lpClass,
24 __in DWORD dwOptions,
25 __in REGSAM samDesired,
26 __in_opt CONST LPSECURITY_ATTRIBUTES lpSecurityAttributes,
27 __out PHKEY phkResult,
28 __out_opt LPDWORD lpdwDisposition
29 );
30typedef LSTATUS (APIENTRY *PFN_REGOPENKEYEXW)(
31 __in HKEY hKey,
32 __in_opt LPCWSTR lpSubKey,
33 __reserved DWORD ulOptions,
34 __in REGSAM samDesired,
35 __out PHKEY phkResult
36 );
37typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYEXW)(
38 __in HKEY hKey,
39 __in LPCWSTR lpSubKey,
40 __in REGSAM samDesired,
41 __reserved DWORD Reserved
42 );
43typedef LSTATUS (APIENTRY *PFN_REGDELETEKEYW)(
44 __in HKEY hKey,
45 __in LPCWSTR lpSubKey
46 );
47typedef LSTATUS (APIENTRY *PFN_REGENUMKEYEXW)(
48 __in HKEY hKey,
49 __in DWORD dwIndex,
50 __out LPWSTR lpName,
51 __inout LPDWORD lpcName,
52 __reserved LPDWORD lpReserved,
53 __inout_opt LPWSTR lpClass,
54 __inout_opt LPDWORD lpcClass,
55 __out_opt PFILETIME lpftLastWriteTime
56 );
57typedef LSTATUS (APIENTRY *PFN_REGENUMVALUEW)(
58 __in HKEY hKey,
59 __in DWORD dwIndex,
60 __out LPWSTR lpValueName,
61 __inout LPDWORD lpcchValueName,
62 __reserved LPDWORD lpReserved,
63 __out_opt LPDWORD lpType,
64 __out_opt LPBYTE lpData,
65 __out_opt LPDWORD lpcbData
66 );
67typedef LSTATUS (APIENTRY *PFN_REGQUERYINFOKEYW)(
68 __in HKEY hKey,
69 __out_opt LPWSTR lpClass,
70 __inout_opt LPDWORD lpcClass,
71 __reserved LPDWORD lpReserved,
72 __out_opt LPDWORD lpcSubKeys,
73 __out_opt LPDWORD lpcMaxSubKeyLen,
74 __out_opt LPDWORD lpcMaxClassLen,
75 __out_opt LPDWORD lpcValues,
76 __out_opt LPDWORD lpcMaxValueNameLen,
77 __out_opt LPDWORD lpcMaxValueLen,
78 __out_opt LPDWORD lpcbSecurityDescriptor,
79 __out_opt PFILETIME lpftLastWriteTime
80 );
81typedef LSTATUS (APIENTRY *PFN_REGQUERYVALUEEXW)(
82 __in HKEY hKey,
83 __in_opt LPCWSTR lpValueName,
84 __reserved LPDWORD lpReserved,
85 __out_opt LPDWORD lpType,
86 __out_bcount_part_opt(*lpcbData, *lpcbData) __out_data_source(REGISTRY) LPBYTE lpData,
87 __inout_opt LPDWORD lpcbData
88 );
89typedef LSTATUS (APIENTRY *PFN_REGSETVALUEEXW)(
90 __in HKEY hKey,
91 __in_opt LPCWSTR lpValueName,
92 __reserved DWORD Reserved,
93 __in DWORD dwType,
94 __in_bcount_opt(cbData) CONST BYTE* lpData,
95 __in DWORD cbData
96 );
97typedef LSTATUS (APIENTRY *PFN_REGDELETEVALUEW)(
98 __in HKEY hKey,
99 __in_opt LPCWSTR lpValueName
100 );
101
102HRESULT DAPI RegInitialize();
103void DAPI RegUninitialize();
104
105void DAPI RegFunctionOverride(
106 __in_opt PFN_REGCREATEKEYEXW pfnRegCreateKeyExW,
107 __in_opt PFN_REGOPENKEYEXW pfnRegOpenKeyExW,
108 __in_opt PFN_REGDELETEKEYEXW pfnRegDeleteKeyExW,
109 __in_opt PFN_REGENUMKEYEXW pfnRegEnumKeyExW,
110 __in_opt PFN_REGENUMVALUEW pfnRegEnumValueW,
111 __in_opt PFN_REGQUERYINFOKEYW pfnRegQueryInfoKeyW,
112 __in_opt PFN_REGQUERYVALUEEXW pfnRegQueryValueExW,
113 __in_opt PFN_REGSETVALUEEXW pfnRegSetValueExW,
114 __in_opt PFN_REGDELETEVALUEW pfnRegDeleteValueW
115 );
116HRESULT DAPI RegCreate(
117 __in HKEY hkRoot,
118 __in_z LPCWSTR wzSubKey,
119 __in DWORD dwAccess,
120 __out HKEY* phk
121 );
122HRESULT DAPI RegCreateEx(
123 __in HKEY hkRoot,
124 __in_z LPCWSTR wzSubKey,
125 __in DWORD dwAccess,
126 __in BOOL fVolatile,
127 __in_opt SECURITY_ATTRIBUTES* pSecurityAttributes,
128 __out HKEY* phk,
129 __out_opt BOOL* pfCreated
130 );
131HRESULT DAPI RegOpen(
132 __in HKEY hkRoot,
133 __in_z LPCWSTR wzSubKey,
134 __in DWORD dwAccess,
135 __out HKEY* phk
136 );
137HRESULT DAPI RegDelete(
138 __in HKEY hkRoot,
139 __in_z LPCWSTR wzSubKey,
140 __in REG_KEY_BITNESS kbKeyBitness,
141 __in BOOL fDeleteTree
142 );
143HRESULT DAPI RegKeyEnum(
144 __in HKEY hk,
145 __in DWORD dwIndex,
146 __deref_out_z LPWSTR* psczKey
147 );
148HRESULT DAPI RegValueEnum(
149 __in HKEY hk,
150 __in DWORD dwIndex,
151 __deref_out_z LPWSTR* psczName,
152 __out_opt DWORD *pdwType
153 );
154HRESULT DAPI RegGetType(
155 __in HKEY hk,
156 __in_z_opt LPCWSTR wzName,
157 __out DWORD *pdwType
158 );
159HRESULT DAPI RegReadBinary(
160 __in HKEY hk,
161 __in_z_opt LPCWSTR wzName,
162 __deref_out_bcount_opt(*pcbBuffer) BYTE** ppbBuffer,
163 __out SIZE_T *pcbBuffer
164 );
165HRESULT DAPI RegReadString(
166 __in HKEY hk,
167 __in_z_opt LPCWSTR wzName,
168 __deref_out_z LPWSTR* psczValue
169 );
170HRESULT DAPI RegReadStringArray(
171 __in HKEY hk,
172 __in_z_opt LPCWSTR wzName,
173 __deref_out_ecount_opt(*pcStrings) LPWSTR** prgsczStrings,
174 __out DWORD *pcStrings
175 );
176HRESULT DAPI RegReadVersion(
177 __in HKEY hk,
178 __in_z_opt LPCWSTR wzName,
179 __out DWORD64* pdw64Version
180 );
181HRESULT DAPI RegReadNumber(
182 __in HKEY hk,
183 __in_z_opt LPCWSTR wzName,
184 __out DWORD* pdwValue
185 );
186HRESULT DAPI RegReadQword(
187 __in HKEY hk,
188 __in_z_opt LPCWSTR wzName,
189 __out DWORD64* pqwValue
190 );
191HRESULT DAPI RegWriteBinary(
192 __in HKEY hk,
193 __in_z_opt LPCWSTR wzName,
194 __in_bcount(cbBuffer) const BYTE *pbBuffer,
195 __in DWORD cbBuffer
196 );
197HRESULT DAPI RegWriteString(
198 __in HKEY hk,
199 __in_z_opt LPCWSTR wzName,
200 __in_z_opt LPCWSTR wzValue
201 );
202HRESULT DAPI RegWriteStringArray(
203 __in HKEY hk,
204 __in_z_opt LPCWSTR wzName,
205 __in_ecount(cStrings) LPWSTR *rgwzStrings,
206 __in DWORD cStrings
207 );
208HRESULT DAPI RegWriteStringFormatted(
209 __in HKEY hk,
210 __in_z_opt LPCWSTR wzName,
211 __in __format_string LPCWSTR szFormat,
212 ...
213 );
214HRESULT DAPI RegWriteNumber(
215 __in HKEY hk,
216 __in_z_opt LPCWSTR wzName,
217 __in DWORD dwValue
218 );
219HRESULT DAPI RegWriteQword(
220 __in HKEY hk,
221 __in_z_opt LPCWSTR wzName,
222 __in DWORD64 qwValue
223 );
224HRESULT DAPI RegQueryKey(
225 __in HKEY hk,
226 __out_opt DWORD* pcSubKeys,
227 __out_opt DWORD* pcValues
228 );
229HRESULT DAPI RegKeyReadNumber(
230 __in HKEY hk,
231 __in_z LPCWSTR wzSubKey,
232 __in_z_opt LPCWSTR wzName,
233 __in BOOL f64Bit,
234 __out DWORD* pdwValue
235 );
236BOOL DAPI RegValueExists(
237 __in HKEY hk,
238 __in_z LPCWSTR wzSubKey,
239 __in_z_opt LPCWSTR wzName,
240 __in BOOL f64Bit
241 );
242
243#ifdef __cplusplus
244}
245#endif
246
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/resrutil.h b/src/libs/dutil/WixToolset.DUtil/inc/resrutil.h
new file mode 100644
index 00000000..1f4d8e17
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/resrutil.h
@@ -0,0 +1,43 @@
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
6extern "C" {
7#endif
8
9HRESULT DAPI ResGetStringLangId(
10 __in_opt LPCWSTR wzPath,
11 __in UINT uID,
12 __out WORD *pwLangId
13 );
14
15HRESULT DAPI ResReadString(
16 __in HINSTANCE hinst,
17 __in UINT uID,
18 __deref_out_z LPWSTR* ppwzString
19 );
20
21HRESULT DAPI ResReadStringAnsi(
22 __in HINSTANCE hinst,
23 __in UINT uID,
24 __deref_out_z LPSTR* ppszString
25 );
26
27HRESULT DAPI ResReadData(
28 __in_opt HINSTANCE hinst,
29 __in_z LPCSTR szDataName,
30 __deref_out_bcount(*pcb) PVOID *ppv,
31 __out DWORD *pcb
32 );
33
34HRESULT DAPI ResExportDataToFile(
35 __in_z LPCSTR szDataName,
36 __in_z LPCWSTR wzTargetFile,
37 __in DWORD dwCreationDisposition
38 );
39
40#ifdef __cplusplus
41}
42#endif
43
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/reswutil.h b/src/libs/dutil/WixToolset.DUtil/inc/reswutil.h
new file mode 100644
index 00000000..31435ae2
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/reswutil.h
@@ -0,0 +1,31 @@
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
6extern "C" {
7#endif
8
9HRESULT DAPI ResWriteString(
10 __in_z LPCWSTR wzResourceFile,
11 __in DWORD dwDataId,
12 __in_z LPCWSTR wzData,
13 __in WORD wLangId
14 );
15
16HRESULT DAPI ResWriteData(
17 __in_z LPCWSTR wzResourceFile,
18 __in_z LPCSTR szDataName,
19 __in PVOID pData,
20 __in DWORD cbData
21 );
22
23HRESULT DAPI ResImportDataFromFile(
24 __in_z LPCWSTR wzTargetFile,
25 __in_z LPCWSTR wzSourceFile,
26 __in_z LPCSTR szDataName
27 );
28
29#ifdef __cplusplus
30}
31#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/rexutil.h b/src/libs/dutil/WixToolset.DUtil/inc/rexutil.h
new file mode 100644
index 00000000..77f5604a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/rexutil.h
@@ -0,0 +1,54 @@
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#include <sys\stat.h>
6#include <fdi.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12// defines
13#define FILETABLESIZE 40
14
15// structs
16struct MEM_FILE
17{
18 LPCBYTE vpStart;
19 UINT uiCurrent;
20 UINT uiLength;
21};
22
23typedef enum FAKE_FILE_TYPE { NORMAL_FILE, MEMORY_FILE } FAKE_FILE_TYPE;
24
25typedef HRESULT (*REX_CALLBACK_PROGRESS)(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext);
26typedef VOID (*REX_CALLBACK_WRITE)(UINT cb);
27
28
29struct FAKE_FILE // used __in internal file table
30{
31 BOOL fUsed;
32 FAKE_FILE_TYPE fftType;
33 MEM_FILE mfFile; // State for memory file
34 HANDLE hFile; // Handle for disk file
35};
36
37// functions
38HRESULT RexInitialize();
39void RexUninitialize();
40
41HRESULT RexExtract(
42 __in_z LPCSTR szResource,
43 __in_z LPCWSTR wzExtractId,
44 __in_z LPCWSTR wzExtractDir,
45 __in_z LPCWSTR wzExtractName,
46 __in REX_CALLBACK_PROGRESS pfnProgress,
47 __in REX_CALLBACK_WRITE pfnWrite,
48 __in LPVOID pvContext
49 );
50
51#ifdef __cplusplus
52}
53#endif
54
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/rmutil.h b/src/libs/dutil/WixToolset.DUtil/inc/rmutil.h
new file mode 100644
index 00000000..ce7bf254
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/rmutil.h
@@ -0,0 +1,46 @@
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
6extern "C" {
7#endif
8
9typedef struct _RMU_SESSION *PRMU_SESSION;
10
11HRESULT DAPI RmuJoinSession(
12 __out PRMU_SESSION *ppSession,
13 __in_z LPCWSTR wzSessionKey
14 );
15
16HRESULT DAPI RmuAddFile(
17 __in PRMU_SESSION pSession,
18 __in_z LPCWSTR wzPath
19 );
20
21HRESULT DAPI RmuAddProcessById(
22 __in PRMU_SESSION pSession,
23 __in DWORD dwProcessId
24 );
25
26HRESULT DAPI RmuAddProcessesByName(
27 __in PRMU_SESSION pSession,
28 __in_z LPCWSTR wzProcessName
29 );
30
31HRESULT DAPI RmuAddService(
32 __in PRMU_SESSION pSession,
33 __in_z LPCWSTR wzServiceName
34 );
35
36HRESULT DAPI RmuRegisterResources(
37 __in PRMU_SESSION pSession
38 );
39
40HRESULT DAPI RmuEndSession(
41 __in PRMU_SESSION pSession
42 );
43
44#ifdef __cplusplus
45}
46#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/rssutil.h b/src/libs/dutil/WixToolset.DUtil/inc/rssutil.h
new file mode 100644
index 00000000..064ab147
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/rssutil.h
@@ -0,0 +1,89 @@
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
6extern "C" {
7#endif
8
9#define ReleaseRssChannel(p) if (p) { RssFreeChannel(p); }
10#define ReleaseNullRssChannel(p) if (p) { RssFreeChannel(p); p = NULL; }
11
12
13struct RSS_UNKNOWN_ATTRIBUTE
14{
15 LPWSTR wzNamespace;
16 LPWSTR wzAttribute;
17 LPWSTR wzValue;
18
19 RSS_UNKNOWN_ATTRIBUTE* pNext;
20};
21
22struct RSS_UNKNOWN_ELEMENT
23{
24 LPWSTR wzNamespace;
25 LPWSTR wzElement;
26 LPWSTR wzValue;
27
28 RSS_UNKNOWN_ATTRIBUTE* pAttributes;
29 RSS_UNKNOWN_ELEMENT* pNext;
30};
31
32struct RSS_ITEM
33{
34 LPWSTR wzTitle;
35 LPWSTR wzLink;
36 LPWSTR wzDescription;
37
38 LPWSTR wzGuid;
39 FILETIME ftPublished;
40
41 LPWSTR wzEnclosureUrl;
42 DWORD dwEnclosureSize;
43 LPWSTR wzEnclosureType;
44
45 RSS_UNKNOWN_ELEMENT* pUnknownElements;
46};
47
48struct RSS_CHANNEL
49{
50 LPWSTR wzTitle;
51 LPWSTR wzLink;
52 LPWSTR wzDescription;
53 DWORD dwTimeToLive;
54
55 RSS_UNKNOWN_ELEMENT* pUnknownElements;
56
57 DWORD cItems;
58 RSS_ITEM rgItems[1];
59};
60
61HRESULT DAPI RssInitialize(
62 );
63
64void DAPI RssUninitialize(
65 );
66
67HRESULT DAPI RssParseFromString(
68 __in_z LPCWSTR wzRssString,
69 __out RSS_CHANNEL **ppChannel
70 );
71
72HRESULT DAPI RssParseFromFile(
73 __in_z LPCWSTR wzRssFile,
74 __out RSS_CHANNEL **ppChannel
75 );
76
77// Adding this until we have the updated specstrings.h
78#ifndef __in_xcount
79#define __in_xcount(size)
80#endif
81
82void DAPI RssFreeChannel(
83 __in_xcount(pChannel->cItems) RSS_CHANNEL *pChannel
84 );
85
86#ifdef __cplusplus
87}
88#endif
89
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/sceutil.h b/src/libs/dutil/WixToolset.DUtil/inc/sceutil.h
new file mode 100644
index 00000000..9d14eecf
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/sceutil.h
@@ -0,0 +1,273 @@
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
6extern "C" {
7#endif
8
9#include <sqlce_oledb.h>
10#include <sqlce_sync.h>
11#include <sqlce_err.h>
12
13typedef void* SCE_DATABASE_HANDLE;
14typedef void* SCE_ROW_HANDLE;
15typedef void* SCE_QUERY_HANDLE;
16typedef void* SCE_QUERY_RESULTS_HANDLE;
17
18extern const int SCE_ROW_HANDLE_BYTES;
19extern const int SCE_QUERY_HANDLE_BYTES;
20extern const int SCE_QUERY_RESULTS_HANDLE_BYTES;
21
22#define ReleaseSceRow(prrh) if (prrh) { SceFreeRow(prrh); }
23#define ReleaseNullSceRow(prrh) if (prrh) { SceFreeRow(prrh); prrh = NULL; }
24#define ReleaseSceQuery(pqh) if (pqh) { SceFreeQuery(pqh); }
25#define ReleaseNullSceQuery(pqh) if (pqh) { SceFreeQuery(pqh); pqh = NULL; }
26#define ReleaseSceQueryResults(pqh) if (pqh) { SceFreeQueryResults(pqh); }
27#define ReleaseNullSceQueryResults(pqh) if (pqh) { SceFreeQueryResults(pqh); pqh = NULL; }
28
29struct SCE_COLUMN_SCHEMA
30{
31 LPCWSTR wzName;
32 DBTYPE dbtColumnType;
33 DWORD dwLength;
34 BOOL fPrimaryKey; // If this column is the primary key
35 BOOL fNullable;
36 BOOL fAutoIncrement;
37 BOOL fDescending; // If this column should be descending when used in an index (default is ascending)
38
39 LPWSTR wzRelationName;
40 DWORD dwForeignKeyTable;
41 DWORD dwForeignKeyColumn;
42};
43
44struct SCE_INDEX_SCHEMA
45{
46 LPWSTR wzName;
47
48 DWORD *rgColumns;
49 DWORD cColumns;
50};
51
52struct SCE_TABLE_SCHEMA
53{
54 LPCWSTR wzName;
55 DWORD cColumns;
56 SCE_COLUMN_SCHEMA *rgColumns;
57
58 DWORD cIndexes;
59 SCE_INDEX_SCHEMA *rgIndexes;
60
61 // Internal to SCEUtil - consumers shouldn't access or modify
62 // TODO: enforce / hide in a handle of some sort?
63 IRowset *pIRowset;
64 IRowsetChange *pIRowsetChange;
65};
66
67struct SCE_DATABASE_SCHEMA
68{
69 DWORD cTables;
70 SCE_TABLE_SCHEMA *rgTables;
71};
72
73struct SCE_DATABASE
74{
75 SCE_DATABASE_HANDLE sdbHandle;
76 SCE_DATABASE_SCHEMA *pdsSchema;
77};
78
79HRESULT DAPI SceCreateDatabase(
80 __in_z LPCWSTR sczFile,
81 __in_z_opt LPCWSTR wzSqlCeDllPath,
82 __deref_out SCE_DATABASE **ppDatabase
83 );
84HRESULT DAPI SceOpenDatabase(
85 __in_z LPCWSTR sczFile,
86 __in_z_opt LPCWSTR wzSqlCeDllPath,
87 __in LPCWSTR wzSchemaType,
88 __in DWORD dwExpectedVersion,
89 __deref_out SCE_DATABASE **ppDatabase,
90 __in BOOL fReadOnly
91 );
92HRESULT DAPI SceEnsureDatabase(
93 __in_z LPCWSTR sczFile,
94 __in_z_opt LPCWSTR wzSqlCeDllPath,
95 __in LPCWSTR wzSchemaType,
96 __in DWORD dwExpectedVersion,
97 __in SCE_DATABASE_SCHEMA *pdsSchema,
98 __deref_out SCE_DATABASE **ppDatabase
99 );
100HRESULT DAPI SceIsTableEmpty(
101 __in SCE_DATABASE *pDatabase,
102 __in DWORD dwTableIndex,
103 __out BOOL *pfEmpty
104 );
105HRESULT DAPI SceGetFirstRow(
106 __in SCE_DATABASE *pDatabase,
107 __in DWORD dwTableIndex,
108 __deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
109 );
110HRESULT DAPI SceGetNextRow(
111 __in SCE_DATABASE *pDatabase,
112 __in DWORD dwTableIndex,
113 __deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
114 );
115HRESULT DAPI SceBeginTransaction(
116 __in SCE_DATABASE *pDatabase
117 );
118HRESULT DAPI SceCommitTransaction(
119 __in SCE_DATABASE *pDatabase
120 );
121HRESULT DAPI SceRollbackTransaction(
122 __in SCE_DATABASE *pDatabase
123 );
124HRESULT DAPI SceDeleteRow(
125 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
126 );
127HRESULT DAPI ScePrepareInsert(
128 __in SCE_DATABASE *pDatabase,
129 __in DWORD dwTableIndex,
130 __deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
131 );
132HRESULT DAPI SceFinishUpdate(
133 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle
134 );
135HRESULT DAPI SceSetColumnBinary(
136 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
137 __in DWORD dwColumnIndex,
138 __in_bcount(cbBuffer) const BYTE* pbBuffer,
139 __in SIZE_T cbBuffer
140 );
141HRESULT DAPI SceSetColumnDword(
142 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
143 __in DWORD dwColumnIndex,
144 __in const DWORD dwValue
145 );
146HRESULT DAPI SceSetColumnQword(
147 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
148 __in DWORD dwColumnIndex,
149 __in const DWORD64 qwValue
150 );
151HRESULT DAPI SceSetColumnBool(
152 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
153 __in DWORD dwColumnIndex,
154 __in const BOOL fValue
155 );
156HRESULT DAPI SceSetColumnString(
157 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
158 __in DWORD dwColumnIndex,
159 __in_z_opt LPCWSTR wzValue
160 );
161HRESULT DAPI SceSetColumnSystemTime(
162 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
163 __in DWORD dwColumnIndex,
164 __in const SYSTEMTIME *pst
165 );
166HRESULT DAPI SceSetColumnNull(
167 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
168 __in DWORD dwColumnIndex
169 );
170HRESULT DAPI SceGetColumnBinary(
171 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
172 __in DWORD dwColumnIndex,
173 __out_opt BYTE **ppbBuffer,
174 __inout SIZE_T *pcbBuffer
175 );
176HRESULT DAPI SceGetColumnDword(
177 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
178 __in DWORD dwColumnIndex,
179 __out DWORD *pdwValue
180 );
181HRESULT DAPI SceGetColumnQword(
182 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
183 __in DWORD dwColumnIndex,
184 __out DWORD64 *pqwValue
185 );
186HRESULT DAPI SceGetColumnBool(
187 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
188 __in DWORD dwColumnIndex,
189 __out BOOL *pfValue
190 );
191HRESULT DAPI SceGetColumnString(
192 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
193 __in DWORD dwColumnIndex,
194 __out_z LPWSTR *psczValue
195 );
196HRESULT DAPI SceGetColumnSystemTime(
197 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle,
198 __in DWORD dwColumnIndex,
199 __out SYSTEMTIME *pst
200 );
201HRESULT DAPI SceBeginQuery(
202 __in SCE_DATABASE *pDatabase,
203 __in DWORD dwTableIndex,
204 __in DWORD dwIndex,
205 __deref_out_bcount(SCE_QUERY_HANDLE_BYTES) SCE_QUERY_HANDLE *psqhHandle
206 );
207HRESULT DAPI SceSetQueryColumnBinary(
208 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
209 __in_bcount(cbBuffer) const BYTE* pbBuffer,
210 __in SIZE_T cbBuffer
211 );
212HRESULT DAPI SceSetQueryColumnDword(
213 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
214 __in const DWORD dwValue
215 );
216HRESULT DAPI SceSetQueryColumnQword(
217 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
218 __in const DWORD64 qwValue
219 );
220HRESULT DAPI SceSetQueryColumnBool(
221 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
222 __in const BOOL fValue
223 );
224HRESULT DAPI SceSetQueryColumnString(
225 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle,
226 __in_z_opt LPCWSTR wzString
227 );
228HRESULT DAPI SceSetQueryColumnSystemTime(
229 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowHandle,
230 __in const SYSTEMTIME *pst
231 );
232HRESULT DAPI SceSetQueryColumnEmpty(
233 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle
234 );
235HRESULT DAPI SceRunQueryExact(
236 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE *psqhHandle,
237 __deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
238 );
239HRESULT DAPI SceRunQueryRange(
240 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE *psqhHandle,
241 __deref_out_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE *psqrhHandle
242 );
243HRESULT DAPI SceGetNextResultRow(
244 __in_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE sqrhHandle,
245 __deref_out_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE *pRowHandle
246 );
247void DAPI SceCloseTable(
248 __in SCE_TABLE_SCHEMA *pTable
249 );
250// Returns whether the data in the database changed. Ignores schema changes.
251BOOL DAPI SceDatabaseChanged(
252 __in SCE_DATABASE *pDatabase
253 );
254// Resets the database changed flag
255void DAPI SceResetDatabaseChanged(
256 __in SCE_DATABASE *pDatabase
257 );
258HRESULT DAPI SceCloseDatabase(
259 __in SCE_DATABASE *pDatabase
260 );
261void DAPI SceFreeRow(
262 __in_bcount(SCE_ROW_HANDLE_BYTES) SCE_ROW_HANDLE rowReadHandle
263 );
264void DAPI SceFreeQuery(
265 __in_bcount(SCE_QUERY_BYTES) SCE_QUERY_HANDLE sqhHandle
266 );
267void DAPI SceFreeQueryResults(
268 __in_bcount(SCE_QUERY_RESULTS_BYTES) SCE_QUERY_RESULTS_HANDLE sqrhHandle
269 );
270
271#ifdef __cplusplus
272}
273#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h b/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h
new file mode 100644
index 00000000..fcfbd13a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/sczutil.h
@@ -0,0 +1,30 @@
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
6class PSCZ
7{
8public:
9 PSCZ() : m_scz(NULL) { }
10
11 ~PSCZ() { ReleaseNullStr(m_scz); }
12
13 operator LPWSTR() { return m_scz; }
14
15 operator LPCWSTR() { return m_scz; }
16
17 operator bool() { return NULL != m_scz; }
18
19 LPWSTR* operator &() { return &m_scz; }
20
21 bool operator !() { return !m_scz; }
22
23 WCHAR operator *() { return *m_scz; }
24
25 LPWSTR Detach() { LPWSTR scz = m_scz; m_scz = NULL; return scz; }
26
27private:
28 LPWSTR m_scz;
29};
30#endif //__cplusplus
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/shelutil.h b/src/libs/dutil/WixToolset.DUtil/inc/shelutil.h
new file mode 100644
index 00000000..0b9f539d
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/shelutil.h
@@ -0,0 +1,47 @@
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#ifndef REFKNOWNFOLDERID
6#define REFKNOWNFOLDERID REFGUID
7#endif
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef BOOL (STDAPICALLTYPE *PFN_SHELLEXECUTEEXW)(
14 __inout LPSHELLEXECUTEINFOW lpExecInfo
15 );
16
17void DAPI ShelFunctionOverride(
18 __in_opt PFN_SHELLEXECUTEEXW pfnShellExecuteExW
19 );
20HRESULT DAPI ShelExec(
21 __in_z LPCWSTR wzTargetPath,
22 __in_z_opt LPCWSTR wzParameters,
23 __in_z_opt LPCWSTR wzVerb,
24 __in_z_opt LPCWSTR wzWorkingDirectory,
25 __in int nShowCmd,
26 __in_opt HWND hwndParent,
27 __out_opt HANDLE* phProcess
28 );
29HRESULT DAPI ShelExecUnelevated(
30 __in_z LPCWSTR wzTargetPath,
31 __in_z_opt LPCWSTR wzParameters,
32 __in_z_opt LPCWSTR wzVerb,
33 __in_z_opt LPCWSTR wzWorkingDirectory,
34 __in int nShowCmd
35 );
36HRESULT DAPI ShelGetFolder(
37 __out_z LPWSTR* psczFolderPath,
38 __in int csidlFolder
39 );
40HRESULT DAPI ShelGetKnownFolder(
41 __out_z LPWSTR* psczFolderPath,
42 __in REFKNOWNFOLDERID rfidFolder
43 );
44
45#ifdef __cplusplus
46}
47#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h b/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h
new file mode 100644
index 00000000..ddf09323
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h
@@ -0,0 +1,136 @@
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#include <cguid.h>
6#include <oledberr.h>
7#include <sqloledb.h>
8
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14// Adding this until the SQL annotations are published to specstrings.h
15#ifndef __sql_command
16#define __sql_command
17#endif
18
19// structs
20struct SQL_FILESPEC
21{
22 WCHAR wzName[MAX_PATH];
23 WCHAR wzFilename[MAX_PATH];
24 WCHAR wzSize[MAX_PATH];
25 WCHAR wzMaxSize[MAX_PATH];
26 WCHAR wzGrow[MAX_PATH];
27};
28
29
30// functions
31HRESULT DAPI SqlConnectDatabase(
32 __in_z LPCWSTR wzServer,
33 __in_z LPCWSTR wzInstance,
34 __in_z LPCWSTR wzDatabase,
35 __in BOOL fIntegratedAuth,
36 __in_z LPCWSTR wzUser,
37 __in_z LPCWSTR wzPassword,
38 __out IDBCreateSession** ppidbSession
39 );
40HRESULT DAPI SqlStartTransaction(
41 __in IDBCreateSession* pidbSession,
42 __out IDBCreateCommand** ppidbCommand,
43 __out ITransaction** ppit
44 );
45HRESULT DAPI SqlEndTransaction(
46 __in ITransaction* pit,
47 __in BOOL fCommit
48 );
49HRESULT DAPI SqlDatabaseExists(
50 __in_z LPCWSTR wzServer,
51 __in_z LPCWSTR wzInstance,
52 __in_z LPCWSTR wzDatabase,
53 __in BOOL fIntegratedAuth,
54 __in_z LPCWSTR wzUser,
55 __in_z LPCWSTR wzPassword,
56 __out_opt BSTR* pbstrErrorDescription
57 );
58HRESULT DAPI SqlSessionDatabaseExists(
59 __in IDBCreateSession* pidbSession,
60 __in_z LPCWSTR wzDatabase,
61 __out_opt BSTR* pbstrErrorDescription
62 );
63HRESULT DAPI SqlDatabaseEnsureExists(
64 __in_z LPCWSTR wzServer,
65 __in_z LPCWSTR wzInstance,
66 __in_z LPCWSTR wzDatabase,
67 __in BOOL fIntegratedAuth,
68 __in_z LPCWSTR wzUser,
69 __in_z LPCWSTR wzPassword,
70 __in_opt const SQL_FILESPEC* psfDatabase,
71 __in_opt const SQL_FILESPEC* psfLog,
72 __out_opt BSTR* pbstrErrorDescription
73 );
74HRESULT DAPI SqlSessionDatabaseEnsureExists(
75 __in IDBCreateSession* pidbSession,
76 __in_z LPCWSTR wzDatabase,
77 __in_opt const SQL_FILESPEC* psfDatabase,
78 __in_opt const SQL_FILESPEC* psfLog,
79 __out_opt BSTR* pbstrErrorDescription
80 );
81HRESULT DAPI SqlCreateDatabase(
82 __in_z LPCWSTR wzServer,
83 __in_z LPCWSTR wzInstance,
84 __in_z LPCWSTR wzDatabase,
85 __in BOOL fIntegratedAuth,
86 __in_z LPCWSTR wzUser,
87 __in_z LPCWSTR wzPassword,
88 __in_opt const SQL_FILESPEC* psfDatabase,
89 __in_opt const SQL_FILESPEC* psfLog,
90 __out_opt BSTR* pbstrErrorDescription
91 );
92HRESULT DAPI SqlSessionCreateDatabase(
93 __in IDBCreateSession* pidbSession,
94 __in_z LPCWSTR wzDatabase,
95 __in_opt const SQL_FILESPEC* psfDatabase,
96 __in_opt const SQL_FILESPEC* psfLog,
97 __out_opt BSTR* pbstrErrorDescription
98 );
99HRESULT DAPI SqlDropDatabase(
100 __in_z LPCWSTR wzServer,
101 __in_z LPCWSTR wzInstance,
102 __in_z LPCWSTR wzDatabase,
103 __in BOOL fIntegratedAuth,
104 __in_z LPCWSTR wzUser,
105 __in_z LPCWSTR wzPassword,
106 __out_opt BSTR* pbstrErrorDescription
107 );
108HRESULT DAPI SqlSessionDropDatabase(
109 __in IDBCreateSession* pidbSession,
110 __in_z LPCWSTR wzDatabase,
111 __out_opt BSTR* pbstrErrorDescription
112 );
113HRESULT DAPI SqlSessionExecuteQuery(
114 __in IDBCreateSession* pidbSession,
115 __in __sql_command LPCWSTR wzSql,
116 __out_opt IRowset** ppirs,
117 __out_opt DBROWCOUNT* pcRows,
118 __out_opt BSTR* pbstrErrorDescription
119 );
120HRESULT DAPI SqlCommandExecuteQuery(
121 __in IDBCreateCommand* pidbCommand,
122 __in __sql_command LPCWSTR wzSql,
123 __out IRowset** ppirs,
124 __out DBROWCOUNT* pcRows
125 );
126HRESULT DAPI SqlGetErrorInfo(
127 __in IUnknown* pObjectWithError,
128 __in REFIID IID_InterfaceWithError,
129 __in DWORD dwLocaleId,
130 __out_opt BSTR* pbstrErrorSource,
131 __out_opt BSTR* pbstrErrorDescription
132 );
133
134#ifdef __cplusplus
135}
136#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/srputil.h b/src/libs/dutil/WixToolset.DUtil/inc/srputil.h
new file mode 100644
index 00000000..95e96231
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/srputil.h
@@ -0,0 +1,45 @@
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
6extern "C" {
7#endif
8
9
10typedef enum SRP_ACTION
11{
12 SRP_ACTION_UNKNOWN,
13 SRP_ACTION_UNINSTALL,
14 SRP_ACTION_INSTALL,
15 SRP_ACTION_MODIFY,
16} SRP_ACTION;
17
18
19/********************************************************************
20 SrpInitialize - initializes system restore point functionality.
21
22*******************************************************************/
23DAPI_(HRESULT) SrpInitialize(
24 __in BOOL fInitializeComSecurity
25 );
26
27/********************************************************************
28 SrpUninitialize - uninitializes system restore point functionality.
29
30*******************************************************************/
31DAPI_(void) SrpUninitialize();
32
33/********************************************************************
34 SrpCreateRestorePoint - creates a system restore point.
35
36*******************************************************************/
37DAPI_(HRESULT) SrpCreateRestorePoint(
38 __in_z LPCWSTR wzApplicationName,
39 __in SRP_ACTION action
40 );
41
42#ifdef __cplusplus
43}
44#endif
45
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/strutil.h b/src/libs/dutil/WixToolset.DUtil/inc/strutil.h
new file mode 100644
index 00000000..1cff9ab8
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/strutil.h
@@ -0,0 +1,316 @@
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
6extern "C" {
7#endif
8
9#define ReleaseStr(pwz) if (pwz) { StrFree(pwz); }
10#define ReleaseNullStr(pwz) if (pwz) { StrFree(pwz); pwz = NULL; }
11#define ReleaseBSTR(bstr) if (bstr) { ::SysFreeString(bstr); }
12#define ReleaseNullBSTR(bstr) if (bstr) { ::SysFreeString(bstr); bstr = NULL; }
13#define ReleaseStrArray(rg, c) { if (rg) { StrArrayFree(rg, c); } }
14#define ReleaseNullStrArray(rg, c) { if (rg) { StrArrayFree(rg, c); c = 0; rg = NULL; } }
15#define ReleaseNullStrSecure(pwz) if (pwz) { StrSecureZeroFreeString(pwz); pwz = NULL; }
16
17#define DeclareConstBSTR(bstr_const, wz) const WCHAR bstr_const[] = { 0x00, 0x00, sizeof(wz)-sizeof(WCHAR), 0x00, wz }
18#define UseConstBSTR(bstr_const) const_cast<BSTR>(bstr_const + 4)
19
20HRESULT DAPI StrAlloc(
21 __deref_out_ecount_part(cch, 0) LPWSTR* ppwz,
22 __in SIZE_T cch
23 );
24HRESULT DAPI StrAllocSecure(
25 __deref_out_ecount_part(cch, 0) LPWSTR* ppwz,
26 __in SIZE_T cch
27 );
28HRESULT DAPI StrTrimCapacity(
29 __deref_out_z LPWSTR* ppwz
30 );
31HRESULT DAPI StrTrimWhitespace(
32 __deref_out_z LPWSTR* ppwz,
33 __in_z LPCWSTR wzSource
34 );
35HRESULT DAPI StrAnsiAlloc(
36 __deref_out_ecount_part(cch, 0) LPSTR* ppz,
37 __in SIZE_T cch
38 );
39HRESULT DAPI StrAnsiTrimCapacity(
40 __deref_out_z LPSTR* ppz
41 );
42HRESULT DAPI StrAnsiTrimWhitespace(
43 __deref_out_z LPSTR* ppz,
44 __in_z LPCSTR szSource
45 );
46HRESULT DAPI StrAllocString(
47 __deref_out_ecount_z(cchSource+1) LPWSTR* ppwz,
48 __in_z LPCWSTR wzSource,
49 __in SIZE_T cchSource
50 );
51HRESULT DAPI StrAllocStringSecure(
52 __deref_out_ecount_z(cchSource + 1) LPWSTR* ppwz,
53 __in_z LPCWSTR wzSource,
54 __in SIZE_T cchSource
55 );
56HRESULT DAPI StrAnsiAllocString(
57 __deref_out_ecount_z(cchSource+1) LPSTR* ppsz,
58 __in_z LPCWSTR wzSource,
59 __in SIZE_T cchSource,
60 __in UINT uiCodepage
61 );
62HRESULT DAPI StrAllocStringAnsi(
63 __deref_out_ecount_z(cchSource+1) LPWSTR* ppwz,
64 __in_z LPCSTR szSource,
65 __in SIZE_T cchSource,
66 __in UINT uiCodepage
67 );
68HRESULT DAPI StrAnsiAllocStringAnsi(
69 __deref_out_ecount_z(cchSource+1) LPSTR* ppsz,
70 __in_z LPCSTR szSource,
71 __in SIZE_T cchSource
72 );
73HRESULT DAPI StrAllocPrefix(
74 __deref_out_z LPWSTR* ppwz,
75 __in_z LPCWSTR wzPrefix,
76 __in SIZE_T cchPrefix
77 );
78HRESULT DAPI StrAllocConcat(
79 __deref_out_z LPWSTR* ppwz,
80 __in_z LPCWSTR wzSource,
81 __in SIZE_T cchSource
82 );
83HRESULT DAPI StrAllocConcatSecure(
84 __deref_out_z LPWSTR* ppwz,
85 __in_z LPCWSTR wzSource,
86 __in SIZE_T cchSource
87 );
88HRESULT DAPI StrAnsiAllocConcat(
89 __deref_out_z LPSTR* ppz,
90 __in_z LPCSTR pzSource,
91 __in SIZE_T cchSource
92 );
93HRESULT __cdecl StrAllocFormatted(
94 __deref_out_z LPWSTR* ppwz,
95 __in __format_string LPCWSTR wzFormat,
96 ...
97 );
98HRESULT __cdecl StrAllocConcatFormatted(
99 __deref_out_z LPWSTR* ppwz,
100 __in __format_string LPCWSTR wzFormat,
101 ...
102 );
103HRESULT __cdecl StrAllocConcatFormattedSecure(
104 __deref_out_z LPWSTR* ppwz,
105 __in __format_string LPCWSTR wzFormat,
106 ...
107 );
108HRESULT __cdecl StrAllocFormattedSecure(
109 __deref_out_z LPWSTR* ppwz,
110 __in __format_string LPCWSTR wzFormat,
111 ...
112 );
113HRESULT __cdecl StrAnsiAllocFormatted(
114 __deref_out_z LPSTR* ppsz,
115 __in __format_string LPCSTR szFormat,
116 ...
117 );
118HRESULT DAPI StrAllocFormattedArgs(
119 __deref_out_z LPWSTR* ppwz,
120 __in __format_string LPCWSTR wzFormat,
121 __in va_list args
122 );
123HRESULT DAPI StrAllocFormattedArgsSecure(
124 __deref_out_z LPWSTR* ppwz,
125 __in __format_string LPCWSTR wzFormat,
126 __in va_list args
127 );
128HRESULT DAPI StrAnsiAllocFormattedArgs(
129 __deref_out_z LPSTR* ppsz,
130 __in __format_string LPCSTR szFormat,
131 __in va_list args
132 );
133HRESULT DAPI StrAllocFromError(
134 __inout LPWSTR *ppwzMessage,
135 __in HRESULT hrError,
136 __in_opt HMODULE hModule,
137 ...
138 );
139
140HRESULT DAPI StrMaxLength(
141 __in LPCVOID p,
142 __out SIZE_T* pcbch
143 );
144HRESULT DAPI StrSize(
145 __in LPCVOID p,
146 __out SIZE_T* pcbb
147 );
148
149HRESULT DAPI StrFree(
150 __in LPVOID p
151 );
152
153
154HRESULT DAPI StrReplaceStringAll(
155 __inout LPWSTR* ppwzOriginal,
156 __in_z LPCWSTR wzOldSubString,
157 __in_z LPCWSTR wzNewSubString
158 );
159HRESULT DAPI StrReplaceString(
160 __inout LPWSTR* ppwzOriginal,
161 __inout DWORD* pdwStartIndex,
162 __in_z LPCWSTR wzOldSubString,
163 __in_z LPCWSTR wzNewSubString
164 );
165
166HRESULT DAPI StrHexEncode(
167 __in_ecount(cbSource) const BYTE* pbSource,
168 __in SIZE_T cbSource,
169 __out_ecount(cchDest) LPWSTR wzDest,
170 __in SIZE_T cchDest
171 );
172HRESULT DAPI StrAllocHexEncode(
173 __in_ecount(cbSource) const BYTE* pbSource,
174 __in SIZE_T cbSource,
175 __deref_out_ecount_z(2*(cbSource+1)) LPWSTR* ppwzDest
176 );
177HRESULT DAPI StrHexDecode(
178 __in_z LPCWSTR wzSource,
179 __out_bcount(cbDest) BYTE* pbDest,
180 __in SIZE_T cbDest
181 );
182HRESULT DAPI StrAllocHexDecode(
183 __in_z LPCWSTR wzSource,
184 __out_bcount(*pcbDest) BYTE** ppbDest,
185 __out_opt DWORD* pcbDest
186 );
187
188HRESULT DAPI StrAllocBase85Encode(
189 __in_bcount_opt(cbSource) const BYTE* pbSource,
190 __in SIZE_T cbSource,
191 __deref_out_z LPWSTR* pwzDest
192 );
193HRESULT DAPI StrAllocBase85Decode(
194 __in_z LPCWSTR wzSource,
195 __deref_out_bcount(*pcbDest) BYTE** ppbDest,
196 __out SIZE_T* pcbDest
197);
198
199HRESULT DAPI MultiSzLen(
200 __in_ecount(*pcch) __nullnullterminated LPCWSTR pwzMultiSz,
201 __out SIZE_T* pcch
202 );
203HRESULT DAPI MultiSzPrepend(
204 __deref_inout_ecount(*pcchMultiSz) __nullnullterminated LPWSTR* ppwzMultiSz,
205 __inout_opt SIZE_T* pcchMultiSz,
206 __in __nullnullterminated LPCWSTR pwzInsert
207 );
208HRESULT DAPI MultiSzFindSubstring(
209 __in __nullnullterminated LPCWSTR pwzMultiSz,
210 __in __nullnullterminated LPCWSTR pwzSubstring,
211 __out_opt DWORD_PTR* pdwIndex,
212 __deref_opt_out __nullnullterminated LPCWSTR* ppwzFoundIn
213 );
214HRESULT DAPI MultiSzFindString(
215 __in __nullnullterminated LPCWSTR pwzMultiSz,
216 __in __nullnullterminated LPCWSTR pwzString,
217 __out_opt DWORD_PTR* pdwIndex,
218 __deref_opt_out __nullnullterminated LPCWSTR* ppwzFound
219 );
220HRESULT DAPI MultiSzRemoveString(
221 __deref_inout __nullnullterminated LPWSTR* ppwzMultiSz,
222 __in DWORD_PTR dwIndex
223 );
224HRESULT DAPI MultiSzInsertString(
225 __deref_inout __nullnullterminated LPWSTR* ppwzMultiSz,
226 __inout_opt SIZE_T* pcchMultiSz,
227 __in DWORD_PTR dwIndex,
228 __in_z LPCWSTR pwzInsert
229 );
230HRESULT DAPI MultiSzReplaceString(
231 __deref_inout __nullnullterminated LPWSTR* ppwzMultiSz,
232 __in DWORD_PTR dwIndex,
233 __in_z LPCWSTR pwzString
234 );
235
236LPCWSTR DAPI wcsistr(
237 __in_z LPCWSTR wzString,
238 __in_z LPCWSTR wzCharSet
239 );
240
241HRESULT DAPI StrStringToInt16(
242 __in_z LPCWSTR wzIn,
243 __in DWORD cchIn,
244 __out SHORT* psOut
245 );
246HRESULT DAPI StrStringToUInt16(
247 __in_z LPCWSTR wzIn,
248 __in DWORD cchIn,
249 __out USHORT* pusOut
250 );
251HRESULT DAPI StrStringToInt32(
252 __in_z LPCWSTR wzIn,
253 __in DWORD cchIn,
254 __out INT* piOut
255 );
256HRESULT DAPI StrStringToUInt32(
257 __in_z LPCWSTR wzIn,
258 __in DWORD cchIn,
259 __out UINT* puiOut
260 );
261HRESULT DAPI StrStringToInt64(
262 __in_z LPCWSTR wzIn,
263 __in DWORD cchIn,
264 __out LONGLONG* pllOut
265 );
266HRESULT DAPI StrStringToUInt64(
267 __in_z LPCWSTR wzIn,
268 __in DWORD cchIn,
269 __out ULONGLONG* pullOut
270 );
271void DAPI StrStringToUpper(
272 __inout_z LPWSTR wzIn
273 );
274void DAPI StrStringToLower(
275 __inout_z LPWSTR wzIn
276 );
277HRESULT DAPI StrAllocStringToUpperInvariant(
278 __deref_out_z LPWSTR* pscz,
279 __in_z LPCWSTR wzSource,
280 __in SIZE_T cchSource
281 );
282HRESULT DAPI StrAllocStringToLowerInvariant(
283 __deref_out_z LPWSTR* pscz,
284 __in_z LPCWSTR wzSource,
285 __in SIZE_T cchSource
286 );
287
288HRESULT DAPI StrArrayAllocString(
289 __deref_inout_ecount_opt(*pcStrArray) LPWSTR **prgsczStrArray,
290 __inout LPUINT pcStrArray,
291 __in_z LPCWSTR wzSource,
292 __in SIZE_T cchSource
293 );
294
295HRESULT DAPI StrArrayFree(
296 __in_ecount(cStrArray) LPWSTR *rgsczStrArray,
297 __in UINT cStrArray
298 );
299
300HRESULT DAPI StrSplitAllocArray(
301 __deref_inout_ecount_opt(*pcStrArray) LPWSTR **prgsczStrArray,
302 __inout LPUINT pcStrArray,
303 __in_z LPCWSTR wzSource,
304 __in_z LPCWSTR wzDelim
305 );
306
307HRESULT DAPI StrSecureZeroString(
308 __in LPWSTR pwz
309 );
310HRESULT DAPI StrSecureZeroFreeString(
311 __in LPWSTR pwz
312 );
313
314#ifdef __cplusplus
315}
316#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/svcutil.h b/src/libs/dutil/WixToolset.DUtil/inc/svcutil.h
new file mode 100644
index 00000000..80d6326c
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/svcutil.h
@@ -0,0 +1,21 @@
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
6extern "C" {
7#endif
8
9
10#define ReleaseServiceHandle(h) if (h) { ::CloseServiceHandle(h); h = NULL; }
11
12
13HRESULT DAPI SvcQueryConfig(
14 __in SC_HANDLE sch,
15 __out QUERY_SERVICE_CONFIGW** ppConfig
16 );
17
18
19#ifdef __cplusplus
20}
21#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h
new file mode 100644
index 00000000..d3dd6d21
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h
@@ -0,0 +1,765 @@
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
6extern "C" {
7#endif
8
9#define ReleaseTheme(p) if (p) { ThemeFree(p); p = NULL; }
10
11typedef HRESULT(CALLBACK *PFNTHM_EVALUATE_VARIABLE_CONDITION)(
12 __in_z LPCWSTR wzCondition,
13 __out BOOL* pf,
14 __in_opt LPVOID pvContext
15 );
16typedef HRESULT(CALLBACK *PFNTHM_FORMAT_VARIABLE_STRING)(
17 __in_z LPCWSTR wzFormat,
18 __inout LPWSTR* psczOut,
19 __in_opt LPVOID pvContext
20 );
21typedef HRESULT(CALLBACK *PFNTHM_GET_VARIABLE_NUMERIC)(
22 __in_z LPCWSTR wzVariable,
23 __out LONGLONG* pllValue,
24 __in_opt LPVOID pvContext
25 );
26typedef HRESULT(CALLBACK *PFNTHM_SET_VARIABLE_NUMERIC)(
27 __in_z LPCWSTR wzVariable,
28 __in LONGLONG llValue,
29 __in_opt LPVOID pvContext
30 );
31typedef HRESULT(CALLBACK *PFNTHM_GET_VARIABLE_STRING)(
32 __in_z LPCWSTR wzVariable,
33 __inout LPWSTR* psczValue,
34 __in_opt LPVOID pvContext
35 );
36typedef HRESULT(CALLBACK *PFNTHM_SET_VARIABLE_STRING)(
37 __in_z LPCWSTR wzVariable,
38 __in_z_opt LPCWSTR wzValue,
39 __in BOOL fFormatted,
40 __in_opt LPVOID pvContext
41 );
42
43typedef enum THEME_ACTION_TYPE
44{
45 THEME_ACTION_TYPE_BROWSE_DIRECTORY,
46 THEME_ACTION_TYPE_CHANGE_PAGE,
47 THEME_ACTION_TYPE_CLOSE_WINDOW,
48} THEME_ACTION_TYPE;
49
50typedef enum THEME_CONTROL_DATA
51{
52 THEME_CONTROL_DATA_HOVER = 1,
53} THEME_CONTROL_DATA;
54
55typedef enum THEME_CONTROL_TYPE
56{
57 THEME_CONTROL_TYPE_UNKNOWN,
58 THEME_CONTROL_TYPE_BILLBOARD,
59 THEME_CONTROL_TYPE_BUTTON,
60 THEME_CONTROL_TYPE_CHECKBOX,
61 THEME_CONTROL_TYPE_COMBOBOX,
62 THEME_CONTROL_TYPE_COMMANDLINK,
63 THEME_CONTROL_TYPE_EDITBOX,
64 THEME_CONTROL_TYPE_HYPERLINK,
65 THEME_CONTROL_TYPE_HYPERTEXT,
66 THEME_CONTROL_TYPE_IMAGE,
67 THEME_CONTROL_TYPE_LABEL,
68 THEME_CONTROL_TYPE_PANEL,
69 THEME_CONTROL_TYPE_PROGRESSBAR,
70 THEME_CONTROL_TYPE_RADIOBUTTON,
71 THEME_CONTROL_TYPE_RICHEDIT,
72 THEME_CONTROL_TYPE_STATIC,
73 THEME_CONTROL_TYPE_LISTVIEW,
74 THEME_CONTROL_TYPE_TREEVIEW,
75 THEME_CONTROL_TYPE_TAB,
76} THEME_CONTROL_TYPE;
77
78typedef enum THEME_SHOW_PAGE_REASON
79{
80 THEME_SHOW_PAGE_REASON_DEFAULT,
81 THEME_SHOW_PAGE_REASON_CANCEL,
82 THEME_SHOW_PAGE_REASON_REFRESH,
83} THEME_SHOW_PAGE_REASON;
84
85typedef enum THEME_WINDOW_INITIAL_POSITION
86{
87 THEME_WINDOW_INITIAL_POSITION_DEFAULT,
88 THEME_WINDOW_INITIAL_POSITION_CENTER_MONITOR_FROM_COORDINATES,
89} THEME_WINDOW_INITIAL_POSITION;
90
91
92struct THEME_COLUMN
93{
94 LPWSTR pszName;
95 UINT uStringId;
96 int nDefaultDpiBaseWidth;
97 int nBaseWidth;
98 int nWidth;
99 BOOL fExpands;
100};
101
102
103struct THEME_TAB
104{
105 LPWSTR pszName;
106 UINT uStringId;
107};
108
109struct THEME_ACTION
110{
111 LPWSTR sczCondition;
112 THEME_ACTION_TYPE type;
113 union
114 {
115 struct
116 {
117 LPWSTR sczVariableName;
118 } BrowseDirectory;
119 struct
120 {
121 LPWSTR sczPageName;
122 BOOL fCancel;
123 } ChangePage;
124 };
125};
126
127struct THEME_CONDITIONAL_TEXT
128{
129 LPWSTR sczCondition;
130 LPWSTR sczText;
131};
132
133// THEME_ASSIGN_CONTROL_ID - Used to apply a specific id to a named control (usually
134// to set the WM_COMMAND).
135struct THEME_ASSIGN_CONTROL_ID
136{
137 WORD wId; // id to apply to control
138 LPCWSTR wzName; // name of control to match
139};
140
141const DWORD THEME_FIRST_ASSIGN_CONTROL_ID = 1024; // Recommended first control id to be assigned.
142
143struct THEME_CONTROL
144{
145 THEME_CONTROL_TYPE type;
146
147 WORD wId;
148 WORD wPageId;
149
150 LPWSTR sczName; // optional name for control, used to apply control id and link the control to a variable.
151 LPWSTR sczText;
152 LPWSTR sczTooltip;
153 LPWSTR sczNote; // optional text for command link
154 int nDefaultDpiX;
155 int nDefaultDpiY;
156 int nDefaultDpiHeight;
157 int nDefaultDpiWidth;
158 int nX;
159 int nY;
160 int nHeight;
161 int nWidth;
162 int nSourceX;
163 int nSourceY;
164 UINT uStringId;
165
166 LPWSTR sczEnableCondition;
167 LPWSTR sczVisibleCondition;
168 BOOL fDisableVariableFunctionality;
169
170 HBITMAP hImage;
171 HICON hIcon;
172
173 // Don't free these; it's just a handle to the central image lists stored in THEME. The handle is freed once, there.
174 HIMAGELIST rghImageList[4];
175
176 DWORD dwStyle;
177 DWORD dwExtendedStyle;
178 DWORD dwInternalStyle;
179
180 DWORD dwFontId;
181
182 // child controls
183 DWORD cControls;
184 THEME_CONTROL* rgControls;
185
186 // Used by billboard controls
187 WORD wBillboardInterval;
188 BOOL fBillboardLoops;
189
190 // Used by button and command link controls
191 THEME_ACTION* rgActions;
192 DWORD cActions;
193 THEME_ACTION* pDefaultAction;
194
195 // Used by hyperlink and owner-drawn button controls
196 DWORD dwFontHoverId;
197 DWORD dwFontSelectedId;
198
199 // Used by listview controls
200 THEME_COLUMN *ptcColumns;
201 DWORD cColumns;
202
203 // Used by radio button controls
204 BOOL fLastRadioButton;
205 LPWSTR sczValue;
206 LPWSTR sczVariable;
207
208 // Used by tab controls
209 THEME_TAB *pttTabs;
210 DWORD cTabs;
211
212 // Used by controls that have text
213 DWORD cConditionalText;
214 THEME_CONDITIONAL_TEXT* rgConditionalText;
215
216 // Used by command link controls
217 DWORD cConditionalNotes;
218 THEME_CONDITIONAL_TEXT* rgConditionalNotes;
219
220 // state variables that should be ignored
221 HWND hWnd;
222 DWORD dwData; // type specific data
223};
224
225
226struct THEME_IMAGELIST
227{
228 LPWSTR sczName;
229
230 HIMAGELIST hImageList;
231};
232
233struct THEME_SAVEDVARIABLE
234{
235 LPWSTR wzName;
236 LPWSTR sczValue;
237};
238
239struct THEME_PAGE
240{
241 WORD wId;
242 LPWSTR sczName;
243
244 DWORD cControlIndices;
245
246 DWORD cSavedVariables;
247 THEME_SAVEDVARIABLE* rgSavedVariables;
248};
249
250struct THEME_FONT_INSTANCE
251{
252 UINT nDpi;
253 HFONT hFont;
254};
255
256struct THEME_FONT
257{
258 LONG lfHeight;
259 LONG lfWeight;
260 BYTE lfUnderline;
261 BYTE lfQuality;
262 LPWSTR sczFaceName;
263
264 COLORREF crForeground;
265 HBRUSH hForeground;
266 COLORREF crBackground;
267 HBRUSH hBackground;
268
269 DWORD cFontInstances;
270 THEME_FONT_INSTANCE* rgFontInstances;
271};
272
273
274struct THEME
275{
276 WORD wId;
277
278 BOOL fAutoResize;
279 BOOL fForceResize;
280
281 DWORD dwStyle;
282 DWORD dwFontId;
283 HANDLE hIcon;
284 LPWSTR sczCaption;
285 int nDefaultDpiHeight;
286 int nDefaultDpiMinimumHeight;
287 int nDefaultDpiWidth;
288 int nDefaultDpiMinimumWidth;
289 int nHeight;
290 int nMinimumHeight;
291 int nWidth;
292 int nMinimumWidth;
293 int nWindowHeight;
294 int nWindowWidth;
295 int nSourceX;
296 int nSourceY;
297 UINT uStringId;
298
299 HBITMAP hImage;
300
301 DWORD cFonts;
302 THEME_FONT* rgFonts;
303
304 DWORD cPages;
305 THEME_PAGE* rgPages;
306
307 DWORD cImageLists;
308 THEME_IMAGELIST* rgImageLists;
309
310 DWORD cControls;
311 THEME_CONTROL* rgControls;
312
313 // internal state variables -- do not use outside ThmUtil.cpp
314 HWND hwndParent; // parent for loaded controls
315 HWND hwndHover; // current hwnd hovered over
316 DWORD dwCurrentPageId;
317 HWND hwndTooltip;
318
319 UINT nDpi;
320
321 // callback functions
322 PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition;
323 PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString;
324 PFNTHM_GET_VARIABLE_NUMERIC pfnGetNumericVariable;
325 PFNTHM_SET_VARIABLE_NUMERIC pfnSetNumericVariable;
326 PFNTHM_GET_VARIABLE_STRING pfnGetStringVariable;
327 PFNTHM_SET_VARIABLE_STRING pfnSetStringVariable;
328
329 LPVOID pvVariableContext;
330};
331
332
333/********************************************************************
334 ThemeInitialize - initialized theme management.
335
336*******************************************************************/
337HRESULT DAPI ThemeInitialize(
338 __in_opt HMODULE hModule
339 );
340
341/********************************************************************
342 ThemeUninitialize - uninitialize theme management.
343
344*******************************************************************/
345void DAPI ThemeUninitialize();
346
347/********************************************************************
348 ThemeLoadFromFile - loads a theme from a loose file.
349
350 *******************************************************************/
351HRESULT DAPI ThemeLoadFromFile(
352 __in_z LPCWSTR wzThemeFile,
353 __out THEME** ppTheme
354 );
355
356/********************************************************************
357 ThemeLoadFromResource - loads a theme from a module's data resource.
358
359 NOTE: The resource data must be UTF-8 encoded.
360*******************************************************************/
361HRESULT DAPI ThemeLoadFromResource(
362 __in_opt HMODULE hModule,
363 __in_z LPCSTR szResource,
364 __out THEME** ppTheme
365 );
366
367/********************************************************************
368 ThemeFree - frees any memory associated with a theme.
369
370*******************************************************************/
371void DAPI ThemeFree(
372 __in THEME* pTheme
373 );
374
375/********************************************************************
376ThemeRegisterVariableCallbacks - registers a context and callbacks
377 for working with variables.
378
379*******************************************************************/
380HRESULT DAPI ThemeRegisterVariableCallbacks(
381 __in THEME* pTheme,
382 __in_opt PFNTHM_EVALUATE_VARIABLE_CONDITION pfnEvaluateCondition,
383 __in_opt PFNTHM_FORMAT_VARIABLE_STRING pfnFormatString,
384 __in_opt PFNTHM_GET_VARIABLE_NUMERIC pfnGetNumericVariable,
385 __in_opt PFNTHM_SET_VARIABLE_NUMERIC pfnSetNumericVariable,
386 __in_opt PFNTHM_GET_VARIABLE_STRING pfnGetStringVariable,
387 __in_opt PFNTHM_SET_VARIABLE_STRING pfnSetStringVariable,
388 __in_opt LPVOID pvContext
389 );
390
391/********************************************************************
392 ThemeCreateParentWindow - creates a parent window for the theme.
393
394*******************************************************************/
395HRESULT DAPI ThemeCreateParentWindow(
396 __in THEME* pTheme,
397 __in DWORD dwExStyle,
398 __in LPCWSTR szClassName,
399 __in LPCWSTR szWindowName,
400 __in DWORD dwStyle,
401 __in int x,
402 __in int y,
403 __in_opt HWND hwndParent,
404 __in_opt HINSTANCE hInstance,
405 __in_opt LPVOID lpParam,
406 __in THEME_WINDOW_INITIAL_POSITION initialPosition,
407 __out_opt HWND* phWnd
408 );
409
410/********************************************************************
411 ThemeLoadControls - creates the windows for all the theme controls
412 using the window created in ThemeCreateParentWindow.
413
414*******************************************************************/
415HRESULT DAPI ThemeLoadControls(
416 __in THEME* pTheme,
417 __in_ecount_opt(cAssignControlIds) const THEME_ASSIGN_CONTROL_ID* rgAssignControlIds,
418 __in DWORD cAssignControlIds
419 );
420
421/********************************************************************
422 ThemeUnloadControls - resets all the theme control windows so the theme
423 controls can be reloaded.
424
425*******************************************************************/
426void DAPI ThemeUnloadControls(
427 __in THEME* pTheme
428 );
429
430/********************************************************************
431 ThemeLocalize - Localizes all of the strings in the theme.
432
433*******************************************************************/
434HRESULT DAPI ThemeLocalize(
435 __in THEME *pTheme,
436 __in const WIX_LOCALIZATION *pLocStringSet
437 );
438
439HRESULT DAPI ThemeLoadStrings(
440 __in THEME* pTheme,
441 __in HMODULE hResModule
442 );
443
444/********************************************************************
445 ThemeLoadRichEditFromFile - Attach a richedit control to a RTF file.
446
447 *******************************************************************/
448HRESULT DAPI ThemeLoadRichEditFromFile(
449 __in THEME* pTheme,
450 __in DWORD dwControl,
451 __in_z LPCWSTR wzFileName,
452 __in HMODULE hModule
453 );
454
455/********************************************************************
456 ThemeLoadRichEditFromResource - Attach a richedit control to resource data.
457
458 *******************************************************************/
459HRESULT DAPI ThemeLoadRichEditFromResource(
460 __in THEME* pTheme,
461 __in DWORD dwControl,
462 __in_z LPCSTR szResourceName,
463 __in HMODULE hModule
464 );
465
466/********************************************************************
467 ThemeLoadRichEditFromResourceToHWnd - Attach a richedit control (by
468 HWND) to resource data.
469
470 *******************************************************************/
471HRESULT DAPI ThemeLoadRichEditFromResourceToHWnd(
472 __in HWND hWnd,
473 __in_z LPCSTR szResourceName,
474 __in HMODULE hModule
475 );
476
477/********************************************************************
478 ThemeHandleKeyboardMessage - will translate the message using the active
479 accelerator table.
480
481*******************************************************************/
482BOOL DAPI ThemeHandleKeyboardMessage(
483 __in_opt THEME* pTheme,
484 __in HWND hWnd,
485 __in MSG* pMsg
486 );
487
488/********************************************************************
489 ThemeDefWindowProc - replacement for DefWindowProc() when using theme.
490
491*******************************************************************/
492LRESULT CALLBACK ThemeDefWindowProc(
493 __in_opt THEME* pTheme,
494 __in HWND hWnd,
495 __in UINT uMsg,
496 __in WPARAM wParam,
497 __in LPARAM lParam
498 );
499
500/********************************************************************
501 ThemeGetPageIds - gets the page ids for the theme via page names.
502
503*******************************************************************/
504void DAPI ThemeGetPageIds(
505 __in const THEME* pTheme,
506 __in_ecount(cGetPages) LPCWSTR* rgwzFindNames,
507 __inout_ecount(cGetPages) DWORD* rgdwPageIds,
508 __in DWORD cGetPages
509 );
510
511/********************************************************************
512 ThemeGetPage - gets a theme page by id.
513
514 *******************************************************************/
515THEME_PAGE* DAPI ThemeGetPage(
516 __in const THEME* pTheme,
517 __in DWORD dwPage
518 );
519
520/********************************************************************
521 ThemeShowPage - shows or hides all of the controls in the page at one time.
522
523 *******************************************************************/
524HRESULT DAPI ThemeShowPage(
525 __in THEME* pTheme,
526 __in DWORD dwPage,
527 __in int nCmdShow
528 );
529
530/********************************************************************
531ThemeShowPageEx - shows or hides all of the controls in the page at one time.
532 When using variables, TSPR_CANCEL reverts any changes made.
533 TSPR_REFRESH forces reevaluation of conditions.
534 It is expected that the current page is hidden before
535 showing a new page.
536
537*******************************************************************/
538HRESULT DAPI ThemeShowPageEx(
539 __in THEME* pTheme,
540 __in DWORD dwPage,
541 __in int nCmdShow,
542 __in THEME_SHOW_PAGE_REASON reason
543 );
544
545
546/********************************************************************
547ThemeShowChild - shows a control's specified child control, hiding the rest.
548
549*******************************************************************/
550void DAPI ThemeShowChild(
551 __in THEME* pTheme,
552 __in THEME_CONTROL* pParentControl,
553 __in DWORD dwIndex
554 );
555
556/********************************************************************
557 ThemeControlExists - check if a control with the specified id exists.
558
559 *******************************************************************/
560BOOL DAPI ThemeControlExists(
561 __in const THEME* pTheme,
562 __in DWORD dwControl
563 );
564
565/********************************************************************
566 ThemeControlEnable - enables/disables a control.
567
568 *******************************************************************/
569void DAPI ThemeControlEnable(
570 __in THEME* pTheme,
571 __in DWORD dwControl,
572 __in BOOL fEnable
573 );
574
575/********************************************************************
576 ThemeControlEnabled - returns whether a control is enabled/disabled.
577
578 *******************************************************************/
579BOOL DAPI ThemeControlEnabled(
580 __in THEME* pTheme,
581 __in DWORD dwControl
582 );
583
584/********************************************************************
585 ThemeControlElevates - sets/removes the shield icon on a control.
586
587 *******************************************************************/
588void DAPI ThemeControlElevates(
589 __in THEME* pTheme,
590 __in DWORD dwControl,
591 __in BOOL fElevates
592 );
593
594/********************************************************************
595 ThemeShowControl - shows/hides a control.
596
597 *******************************************************************/
598void DAPI ThemeShowControl(
599 __in THEME* pTheme,
600 __in DWORD dwControl,
601 __in int nCmdShow
602 );
603
604/********************************************************************
605ThemeShowControlEx - shows/hides a control with support for
606conditional text and notes.
607
608*******************************************************************/
609void DAPI ThemeShowControlEx(
610 __in THEME* pTheme,
611 __in DWORD dwControl,
612 __in int nCmdShow
613 );
614
615/********************************************************************
616 ThemeControlVisible - returns whether a control is visible.
617
618 *******************************************************************/
619BOOL DAPI ThemeControlVisible(
620 __in THEME* pTheme,
621 __in DWORD dwControl
622 );
623
624BOOL DAPI ThemePostControlMessage(
625 __in THEME* pTheme,
626 __in DWORD dwControl,
627 __in UINT Msg,
628 __in WPARAM wParam,
629 __in LPARAM lParam
630 );
631
632LRESULT DAPI ThemeSendControlMessage(
633 __in const THEME* pTheme,
634 __in DWORD dwControl,
635 __in UINT Msg,
636 __in WPARAM wParam,
637 __in LPARAM lParam
638 );
639
640/********************************************************************
641 ThemeDrawBackground - draws the theme background.
642
643*******************************************************************/
644HRESULT DAPI ThemeDrawBackground(
645 __in THEME* pTheme,
646 __in PAINTSTRUCT* pps
647 );
648
649/********************************************************************
650 ThemeDrawControl - draw an owner drawn control.
651
652*******************************************************************/
653HRESULT DAPI ThemeDrawControl(
654 __in THEME* pTheme,
655 __in DRAWITEMSTRUCT* pdis
656 );
657
658/********************************************************************
659 ThemeHoverControl - mark a control as hover.
660
661*******************************************************************/
662BOOL DAPI ThemeHoverControl(
663 __in THEME* pTheme,
664 __in HWND hwndParent,
665 __in HWND hwndControl
666 );
667
668/********************************************************************
669 ThemeIsControlChecked - gets whether a control is checked. Only
670 really useful for checkbox controls.
671
672*******************************************************************/
673BOOL DAPI ThemeIsControlChecked(
674 __in THEME* pTheme,
675 __in DWORD dwControl
676 );
677
678/********************************************************************
679 ThemeSetControlColor - sets the color of text for a control.
680
681*******************************************************************/
682BOOL DAPI ThemeSetControlColor(
683 __in THEME* pTheme,
684 __in HDC hdc,
685 __in HWND hWnd,
686 __out HBRUSH* phBackgroundBrush
687 );
688
689/********************************************************************
690 ThemeSetProgressControl - sets the current percentage complete in a
691 progress bar control.
692
693*******************************************************************/
694HRESULT DAPI ThemeSetProgressControl(
695 __in THEME* pTheme,
696 __in DWORD dwControl,
697 __in DWORD dwProgressPercentage
698 );
699
700/********************************************************************
701 ThemeSetProgressControlColor - sets the current color of a
702 progress bar control.
703
704*******************************************************************/
705HRESULT DAPI ThemeSetProgressControlColor(
706 __in THEME* pTheme,
707 __in DWORD dwControl,
708 __in DWORD dwColorIndex
709 );
710
711/********************************************************************
712 ThemeSetTextControl - sets the text of a control.
713
714*******************************************************************/
715HRESULT DAPI ThemeSetTextControl(
716 __in const THEME* pTheme,
717 __in DWORD dwControl,
718 __in_z_opt LPCWSTR wzText
719 );
720
721/********************************************************************
722ThemeSetTextControl - sets the text of a control and optionally
723 invalidates the control.
724
725*******************************************************************/
726HRESULT DAPI ThemeSetTextControlEx(
727 __in const THEME* pTheme,
728 __in DWORD dwControl,
729 __in BOOL fUpdate,
730 __in_z_opt LPCWSTR wzText
731 );
732
733/********************************************************************
734 ThemeGetTextControl - gets the text of a control.
735
736*******************************************************************/
737HRESULT DAPI ThemeGetTextControl(
738 __in const THEME* pTheme,
739 __in DWORD dwControl,
740 __inout_z LPWSTR* psczText
741 );
742
743/********************************************************************
744 ThemeUpdateCaption - updates the caption in the theme.
745
746*******************************************************************/
747HRESULT DAPI ThemeUpdateCaption(
748 __in THEME* pTheme,
749 __in_z LPCWSTR wzCaption
750 );
751
752/********************************************************************
753 ThemeSetFocus - set the focus to the control supplied or the next
754 enabled control if it is disabled.
755
756*******************************************************************/
757void DAPI ThemeSetFocus(
758 __in THEME* pTheme,
759 __in DWORD dwControl
760 );
761
762#ifdef __cplusplus
763}
764#endif
765
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/timeutil.h b/src/libs/dutil/WixToolset.DUtil/inc/timeutil.h
new file mode 100644
index 00000000..3655c00a
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/timeutil.h
@@ -0,0 +1,38 @@
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
6extern "C" {
7#endif
8
9HRESULT DAPI TimeFromString(
10 __in_z LPCWSTR wzTime,
11 __out FILETIME* pFileTime
12 );
13HRESULT DAPI TimeFromString3339(
14 __in_z LPCWSTR wzTime,
15 __out FILETIME* pFileTime
16 );
17HRESULT DAPI TimeCurrentTime(
18 __deref_out_z LPWSTR* ppwz,
19 __in BOOL fGMT
20 );
21HRESULT DAPI TimeCurrentDateTime(
22 __deref_out_z LPWSTR* ppwz,
23 __in BOOL fGMT
24 );
25HRESULT DAPI TimeSystemDateTime(
26 __deref_out_z LPWSTR* ppwz,
27 __in const SYSTEMTIME *pst,
28 __in BOOL fGMT
29 );
30HRESULT DAPI TimeSystemToDateTimeString(
31 __deref_out_z LPWSTR* ppwz,
32 __in const SYSTEMTIME *pst,
33 __in LCID locale
34 );
35
36#ifdef __cplusplus
37}
38#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/uncutil.h b/src/libs/dutil/WixToolset.DUtil/inc/uncutil.h
new file mode 100644
index 00000000..6516a801
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/uncutil.h
@@ -0,0 +1,20 @@
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
6extern "C" {
7#endif
8
9/*******************************************************************
10 UncConvertFromMountedDrive - Converts the string in-place from a
11 mounted drive path to a UNC path
12*******************************************************************/
13DAPI_(HRESULT) UncConvertFromMountedDrive(
14 __inout LPWSTR *psczUNCPath,
15 __in LPCWSTR sczMountedDrivePath
16 );
17
18#ifdef __cplusplus
19}
20#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/uriutil.h b/src/libs/dutil/WixToolset.DUtil/inc/uriutil.h
new file mode 100644
index 00000000..d6dfdd6b
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/uriutil.h
@@ -0,0 +1,100 @@
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#include "wininet.h"
6
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef enum URI_PROTOCOL
13{
14 URI_PROTOCOL_UNKNOWN,
15 URI_PROTOCOL_FILE,
16 URI_PROTOCOL_FTP,
17 URI_PROTOCOL_HTTP,
18 URI_PROTOCOL_HTTPS,
19 URI_PROTOCOL_LOCAL,
20 URI_PROTOCOL_UNC
21} URI_PROTOCOL;
22
23typedef struct _URI_INFO
24{
25 INTERNET_SCHEME scheme;
26 LPWSTR sczHostName;
27 INTERNET_PORT port;
28 LPWSTR sczUser;
29 LPWSTR sczPassword;
30 LPWSTR sczPath;
31 LPWSTR sczQueryString;
32} URI_INFO;
33
34
35HRESULT DAPI UriCanonicalize(
36 __inout_z LPWSTR* psczUri
37 );
38
39HRESULT DAPI UriCrack(
40 __in_z LPCWSTR wzUri,
41 __out_opt INTERNET_SCHEME* pScheme,
42 __deref_opt_out_z LPWSTR* psczHostName,
43 __out_opt INTERNET_PORT* pPort,
44 __deref_opt_out_z LPWSTR* psczUser,
45 __deref_opt_out_z LPWSTR* psczPassword,
46 __deref_opt_out_z LPWSTR* psczPath,
47 __deref_opt_out_z LPWSTR* psczQueryString
48 );
49
50HRESULT DAPI UriCrackEx(
51 __in_z LPCWSTR wzUri,
52 __in URI_INFO* pUriInfo
53 );
54
55void DAPI UriInfoUninitialize(
56 __in URI_INFO* pUriInfo
57 );
58
59HRESULT DAPI UriCreate(
60 __inout_z LPWSTR* psczUri,
61 __in INTERNET_SCHEME scheme,
62 __in_z_opt LPWSTR wzHostName,
63 __in INTERNET_PORT port,
64 __in_z_opt LPWSTR wzUser,
65 __in_z_opt LPWSTR wzPassword,
66 __in_z_opt LPWSTR wzPath,
67 __in_z_opt LPWSTR wzQueryString
68 );
69
70HRESULT DAPI UriCanonicalize(
71 __inout_z LPWSTR* psczUri
72 );
73
74HRESULT DAPI UriFile(
75 __deref_out_z LPWSTR* psczFile,
76 __in_z LPCWSTR wzUri
77 );
78
79HRESULT DAPI UriProtocol(
80 __in_z LPCWSTR wzUri,
81 __out URI_PROTOCOL* pProtocol
82 );
83
84HRESULT DAPI UriRoot(
85 __in_z LPCWSTR wzUri,
86 __out LPWSTR* ppwzRoot,
87 __out_opt URI_PROTOCOL* pProtocol
88 );
89
90HRESULT DAPI UriResolve(
91 __in_z LPCWSTR wzUri,
92 __in_opt LPCWSTR wzBaseUri,
93 __out LPWSTR* ppwzResolvedUri,
94 __out_opt URI_PROTOCOL* pResolvedProtocol
95 );
96
97#ifdef __cplusplus
98}
99#endif
100
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/userutil.h b/src/libs/dutil/WixToolset.DUtil/inc/userutil.h
new file mode 100644
index 00000000..2c86d229
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/userutil.h
@@ -0,0 +1,32 @@
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
6extern "C" {
7#endif
8
9HRESULT DAPI UserBuildDomainUserName(
10 __out_ecount_z(cchDest) LPWSTR wzDest,
11 __in int cchDest,
12 __in_z LPCWSTR pwzName,
13 __in_z LPCWSTR pwzDomain
14 );
15
16HRESULT DAPI UserCheckIsMember(
17 __in_z LPCWSTR pwzName,
18 __in_z LPCWSTR pwzDomain,
19 __in_z LPCWSTR pwzGroupName,
20 __in_z LPCWSTR pwzGroupDomain,
21 __out LPBOOL lpfMember
22 );
23
24HRESULT DAPI UserCreateADsPath(
25 __in_z LPCWSTR wzObjectDomain,
26 __in_z LPCWSTR wzObjectName,
27 __out BSTR *pbstrAdsPath
28 );
29
30#ifdef __cplusplus
31}
32#endif
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
6extern "C" {
7#endif
8
9#define ReleaseVerutilVersion(p) if (p) { VerFreeVersion(p); p = NULL; }
10
11typedef 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
19typedef 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*******************************************************************/
36HRESULT 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*******************************************************************/
47HRESULT 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*******************************************************************/
58HRESULT 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*******************************************************************/
67void DAPI VerFreeVersion(
68 __in VERUTIL_VERSION* pVersion
69 );
70
71/*******************************************************************
72 VerParseVersion - parses the string into a Verutil version.
73
74*******************************************************************/
75HRESULT 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*******************************************************************/
86HRESULT DAPI VerVersionFromQword(
87 __in DWORD64 qwVersion,
88 __out VERUTIL_VERSION** ppVersion
89 );
90
91#ifdef __cplusplus
92}
93#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h
new file mode 100644
index 00000000..9c2de209
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h
@@ -0,0 +1,402 @@
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
6extern "C" {
7#endif
8
9// constants
10
11#define IDNOACTION 0
12#define WIU_MB_OKIGNORECANCELRETRY 0xE
13
14#define MAX_DARWIN_KEY 73
15#define MAX_DARWIN_COLUMN 255
16
17#define WIU_LOG_DEFAULT INSTALLLOGMODE_FATALEXIT | INSTALLLOGMODE_ERROR | INSTALLLOGMODE_WARNING | \
18 INSTALLLOGMODE_USER | INSTALLLOGMODE_INFO | INSTALLLOGMODE_RESOLVESOURCE | \
19 INSTALLLOGMODE_OUTOFDISKSPACE | INSTALLLOGMODE_ACTIONSTART | \
20 INSTALLLOGMODE_ACTIONDATA | INSTALLLOGMODE_COMMONDATA | INSTALLLOGMODE_PROPERTYDUMP
21
22#define ReleaseMsi(h) if (h) { ::MsiCloseHandle(h); }
23#define ReleaseNullMsi(h) if (h) { ::MsiCloseHandle(h); h = NULL; }
24
25
26typedef enum WIU_RESTART
27{
28 WIU_RESTART_NONE,
29 WIU_RESTART_REQUIRED,
30 WIU_RESTART_INITIATED,
31} WIU_RESTART;
32
33typedef enum WIU_MSI_EXECUTE_MESSAGE_TYPE
34{
35 WIU_MSI_EXECUTE_MESSAGE_NONE,
36 WIU_MSI_EXECUTE_MESSAGE_PROGRESS,
37 WIU_MSI_EXECUTE_MESSAGE_ERROR,
38 WIU_MSI_EXECUTE_MESSAGE_MSI_MESSAGE,
39 WIU_MSI_EXECUTE_MESSAGE_MSI_FILES_IN_USE,
40} WIU_MSI_EXECUTE_MESSAGE_TYPE;
41
42
43// structures
44
45typedef struct _WIU_MSI_EXECUTE_MESSAGE
46{
47 WIU_MSI_EXECUTE_MESSAGE_TYPE type;
48 DWORD dwAllowedResults;
49
50 DWORD cData;
51 LPCWSTR* rgwzData;
52
53 INT nResultRecommendation; // recommended return result for this message based on analysis of real world installs.
54
55 union
56 {
57 struct
58 {
59 DWORD dwPercentage;
60 } progress;
61 struct
62 {
63 DWORD dwErrorCode;
64 LPCWSTR wzMessage;
65 } error;
66 struct
67 {
68 INSTALLMESSAGE mt;
69 LPCWSTR wzMessage;
70 } msiMessage;
71 struct
72 {
73 DWORD cFiles;
74 LPCWSTR* rgwzFiles;
75 } msiFilesInUse;
76 };
77} WIU_MSI_EXECUTE_MESSAGE;
78
79typedef struct _WIU_MSI_PROGRESS
80{
81 DWORD dwTotal;
82 DWORD dwCompleted;
83 DWORD dwStep;
84 BOOL fMoveForward;
85 BOOL fEnableActionData;
86 BOOL fScriptInProgress;
87} WIU_MSI_PROGRESS;
88
89
90typedef int (*PFN_MSIEXECUTEMESSAGEHANDLER)(
91 __in WIU_MSI_EXECUTE_MESSAGE* pMessage,
92 __in_opt LPVOID pvContext
93 );
94
95typedef struct _WIU_MSI_EXECUTE_CONTEXT
96{
97 BOOL fRollback;
98 PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler;
99 LPVOID pvContext;
100 WIU_MSI_PROGRESS rgMsiProgress[64];
101 DWORD dwCurrentProgressIndex;
102
103 INSTALLUILEVEL previousInstallUILevel;
104 HWND hwndPreviousParentWindow;
105 INSTALLUI_HANDLERW pfnPreviousExternalUI;
106 INSTALLUI_HANDLER_RECORD pfnPreviousExternalUIRecord;
107
108 BOOL fSetPreviousExternalUIRecord;
109 BOOL fSetPreviousExternalUI;
110} WIU_MSI_EXECUTE_CONTEXT;
111
112
113// typedefs
114typedef UINT (WINAPI *PFN_MSIENABLELOGW)(
115 __in DWORD dwLogMode,
116 __in_z LPCWSTR szLogFile,
117 __in DWORD dwLogAttributes
118 );
119typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOW)(
120 __in LPCWSTR szProductCode,
121 __in LPCWSTR szProperty,
122 __out_ecount_opt(*pcchValue) LPWSTR szValue,
123 __inout LPDWORD pcchValue
124 );
125typedef INSTALLSTATE (WINAPI *PFN_MSIGETCOMPONENTPATHW)(
126 __in LPCWSTR szProduct,
127 __in LPCWSTR szComponent,
128 __out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
129 __inout_opt LPDWORD pcchBuf
130 );
131typedef INSTALLSTATE (WINAPI *PFN_MSILOCATECOMPONENTW)(
132 __in LPCWSTR szComponent,
133 __out_ecount_opt(*pcchBuf) LPWSTR lpPathBuf,
134 __inout_opt LPDWORD pcchBuf
135 );
136typedef UINT (WINAPI *PFN_MSIGETPRODUCTINFOEXW)(
137 __in LPCWSTR szProductCode,
138 __in_opt LPCWSTR szUserSid,
139 __in MSIINSTALLCONTEXT dwContext,
140 __in LPCWSTR szProperty,
141 __out_ecount_opt(*pcchValue) LPWSTR szValue,
142 __inout_opt LPDWORD pcchValue
143 );
144typedef INSTALLSTATE (WINAPI *PFN_MSIQUERYFEATURESTATEW)(
145 __in LPCWSTR szProduct,
146 __in LPCWSTR szFeature
147 );
148typedef UINT (WINAPI *PFN_MSIGETPATCHINFOEXW)(
149 __in_z LPCWSTR wzPatchCode,
150 __in_z LPCWSTR wzProductCode,
151 __in_z_opt LPCWSTR wzUserSid,
152 __in MSIINSTALLCONTEXT dwContext,
153 __in_z LPCWSTR wzProperty,
154 __out_opt LPWSTR wzValue,
155 __inout DWORD* pcchValue
156 );
157typedef UINT (WINAPI *PFN_MSIDETERMINEPATCHSEQUENCEW)(
158 __in_z LPCWSTR wzProductCode,
159 __in_z_opt LPCWSTR wzUserSid,
160 __in MSIINSTALLCONTEXT context,
161 __in DWORD cPatchInfo,
162 __in PMSIPATCHSEQUENCEINFOW pPatchInfo
163 );
164typedef UINT (WINAPI *PFN_MSIDETERMINEAPPLICABLEPATCHESW)(
165 __in_z LPCWSTR wzProductPackagePath,
166 __in DWORD cPatchInfo,
167 __in PMSIPATCHSEQUENCEINFOW pPatchInfo
168 );
169typedef UINT (WINAPI *PFN_MSIINSTALLPRODUCTW)(
170 __in LPCWSTR szPackagePath,
171 __in_opt LPCWSTR szCommandLine
172 );
173typedef UINT (WINAPI *PFN_MSICONFIGUREPRODUCTEXW)(
174 __in LPCWSTR szProduct,
175 __in int iInstallLevel,
176 __in INSTALLSTATE eInstallState,
177 __in_opt LPCWSTR szCommandLine
178 );
179typedef UINT (WINAPI *PFN_MSIREMOVEPATCHESW)(
180 __in_z LPCWSTR wzPatchList,
181 __in_z LPCWSTR wzProductCode,
182 __in INSTALLTYPE eUninstallType,
183 __in_z_opt LPCWSTR szPropertyList
184 );
185typedef INSTALLUILEVEL (WINAPI *PFN_MSISETINTERNALUI)(
186 __in INSTALLUILEVEL dwUILevel,
187 __inout_opt HWND *phWnd
188 );
189typedef UINT (WINAPI *PFN_MSISETEXTERNALUIRECORD)(
190 __in_opt INSTALLUI_HANDLER_RECORD puiHandler,
191 __in DWORD dwMessageFilter,
192 __in_opt LPVOID pvContext,
193 __out_opt PINSTALLUI_HANDLER_RECORD ppuiPrevHandler
194 );
195typedef INSTALLUI_HANDLERW (WINAPI *PFN_MSISETEXTERNALUIW)(
196 __in_opt INSTALLUI_HANDLERW puiHandler,
197 __in DWORD dwMessageFilter,
198 __in_opt LPVOID pvContext
199 );
200typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSW)(
201 __in DWORD iProductIndex,
202 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
203 );
204typedef UINT (WINAPI *PFN_MSIENUMPRODUCTSEXW)(
205 __in_z_opt LPCWSTR wzProductCode,
206 __in_z_opt LPCWSTR wzUserSid,
207 __in DWORD dwContext,
208 __in DWORD dwIndex,
209 __out_opt WCHAR wzInstalledProductCode[39],
210 __out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
211 __out_opt LPWSTR wzSid,
212 __inout_opt LPDWORD pcchSid
213 );
214
215typedef UINT (WINAPI *PFN_MSIENUMRELATEDPRODUCTSW)(
216 __in LPCWSTR lpUpgradeCode,
217 __reserved DWORD dwReserved,
218 __in DWORD iProductIndex,
219 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR lpProductBuf
220 );
221typedef UINT (WINAPI *PFN_MSISOURCELISTADDSOURCEEXW)(
222 __in LPCWSTR szProductCodeOrPatchCode,
223 __in_opt LPCWSTR szUserSid,
224 __in MSIINSTALLCONTEXT dwContext,
225 __in DWORD dwOptions,
226 __in LPCWSTR szSource,
227 __in_opt DWORD dwIndex
228 );
229typedef UINT(WINAPI* PFN_MSIBEGINTRANSACTIONW)(
230 __in LPCWSTR szName,
231 __in DWORD dwTransactionAttributes,
232 __out MSIHANDLE* phTransactionHandle,
233 __out HANDLE* phChangeOfOwnerEvent
234 );
235typedef UINT(WINAPI* PFN_MSIENDTRANSACTION)(
236 __in DWORD dwTransactionState
237 );
238
239
240HRESULT DAPI WiuInitialize(
241 );
242void DAPI WiuUninitialize(
243 );
244void DAPI WiuFunctionOverride(
245 __in_opt PFN_MSIENABLELOGW pfnMsiEnableLogW,
246 __in_opt PFN_MSIGETCOMPONENTPATHW pfnMsiGetComponentPathW,
247 __in_opt PFN_MSILOCATECOMPONENTW pfnMsiLocateComponentW,
248 __in_opt PFN_MSIQUERYFEATURESTATEW pfnMsiQueryFeatureStateW,
249 __in_opt PFN_MSIGETPRODUCTINFOW pfnMsiGetProductInfoW,
250 __in_opt PFN_MSIGETPRODUCTINFOEXW pfnMsiGetProductInfoExW,
251 __in_opt PFN_MSIINSTALLPRODUCTW pfnMsiInstallProductW,
252 __in_opt PFN_MSICONFIGUREPRODUCTEXW pfnMsiConfigureProductExW,
253 __in_opt PFN_MSISETINTERNALUI pfnMsiSetInternalUI,
254 __in_opt PFN_MSISETEXTERNALUIW pfnMsiSetExternalUIW,
255 __in_opt PFN_MSIENUMRELATEDPRODUCTSW pfnMsiEnumRelatedProductsW,
256 __in_opt PFN_MSISETEXTERNALUIRECORD pfnMsiSetExternalUIRecord,
257 __in_opt PFN_MSISOURCELISTADDSOURCEEXW pfnMsiSourceListAddSourceExW
258 );
259HRESULT DAPI WiuGetComponentPath(
260 __in_z LPCWSTR wzProductCode,
261 __in_z LPCWSTR wzComponentId,
262 __out INSTALLSTATE* pInstallState,
263 __out_z LPWSTR* psczValue
264 );
265HRESULT DAPI WiuLocateComponent(
266 __in_z LPCWSTR wzComponentId,
267 __out INSTALLSTATE* pInstallState,
268 __out_z LPWSTR* psczValue
269 );
270HRESULT DAPI WiuQueryFeatureState(
271 __in_z LPCWSTR wzProduct,
272 __in_z LPCWSTR wzFeature,
273 __out INSTALLSTATE* pInstallState
274 );
275HRESULT DAPI WiuGetProductInfo(
276 __in_z LPCWSTR wzProductCode,
277 __in_z LPCWSTR wzProperty,
278 __out LPWSTR* psczValue
279 );
280HRESULT DAPI WiuGetProductInfoEx(
281 __in_z LPCWSTR wzProductCode,
282 __in_z_opt LPCWSTR wzUserSid,
283 __in MSIINSTALLCONTEXT dwContext,
284 __in_z LPCWSTR wzProperty,
285 __out LPWSTR* psczValue
286 );
287HRESULT DAPI WiuGetProductProperty(
288 __in MSIHANDLE hProduct,
289 __in_z LPCWSTR wzProperty,
290 __out LPWSTR* psczValue
291 );
292HRESULT DAPI WiuGetPatchInfoEx(
293 __in_z LPCWSTR wzPatchCode,
294 __in_z LPCWSTR wzProductCode,
295 __in_z_opt LPCWSTR wzUserSid,
296 __in MSIINSTALLCONTEXT dwContext,
297 __in_z LPCWSTR wzProperty,
298 __out LPWSTR* psczValue
299 );
300HRESULT DAPI WiuDeterminePatchSequence(
301 __in_z LPCWSTR wzProductCode,
302 __in_z_opt LPCWSTR wzUserSid,
303 __in MSIINSTALLCONTEXT context,
304 __in PMSIPATCHSEQUENCEINFOW pPatchInfo,
305 __in DWORD cPatchInfo
306 );
307HRESULT DAPI WiuDetermineApplicablePatches(
308 __in_z LPCWSTR wzProductPackagePath,
309 __in PMSIPATCHSEQUENCEINFOW pPatchInfo,
310 __in DWORD cPatchInfo
311 );
312HRESULT DAPI WiuEnumProducts(
313 __in DWORD iProductIndex,
314 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
315 );
316HRESULT DAPI WiuEnumProductsEx(
317 __in_z_opt LPCWSTR wzProductCode,
318 __in_z_opt LPCWSTR wzUserSid,
319 __in DWORD dwContext,
320 __in DWORD dwIndex,
321 __out_opt WCHAR wzInstalledProductCode[39],
322 __out_opt MSIINSTALLCONTEXT *pdwInstalledContext,
323 __out_opt LPWSTR wzSid,
324 __inout_opt LPDWORD pcchSid
325 );
326HRESULT DAPI WiuEnumRelatedProducts(
327 __in_z LPCWSTR wzUpgradeCode,
328 __in DWORD iProductIndex,
329 __out_ecount(MAX_GUID_CHARS + 1) LPWSTR wzProductCode
330 );
331HRESULT DAPI WiuEnumRelatedProductCodes(
332 __in_z LPCWSTR wzUpgradeCode,
333 __deref_out_ecount_opt(*pcRelatedProducts) LPWSTR** prgsczProductCodes,
334 __out DWORD* pcRelatedProducts,
335 __in BOOL fReturnHighestVersionOnly
336 );
337HRESULT DAPI WiuEnableLog(
338 __in DWORD dwLogMode,
339 __in_z LPCWSTR wzLogFile,
340 __in DWORD dwLogAttributes
341 );
342HRESULT DAPI WiuInitializeInternalUI(
343 __in INSTALLUILEVEL internalUILevel,
344 __in_opt HWND hwndParent,
345 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
346 );
347HRESULT DAPI WiuInitializeExternalUI(
348 __in PFN_MSIEXECUTEMESSAGEHANDLER pfnMessageHandler,
349 __in INSTALLUILEVEL internalUILevel,
350 __in_opt HWND hwndParent,
351 __in LPVOID pvContext,
352 __in BOOL fRollback,
353 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
354 );
355void DAPI WiuUninitializeExternalUI(
356 __in WIU_MSI_EXECUTE_CONTEXT* pExecuteContext
357 );
358HRESULT DAPI WiuConfigureProductEx(
359 __in_z LPCWSTR wzProduct,
360 __in int iInstallLevel,
361 __in INSTALLSTATE eInstallState,
362 __in_z LPCWSTR wzCommandLine,
363 __out WIU_RESTART* pRestart
364 );
365HRESULT DAPI WiuInstallProduct(
366 __in_z LPCWSTR wzPackagPath,
367 __in_z LPCWSTR wzCommandLine,
368 __out WIU_RESTART* pRestart
369 );
370HRESULT DAPI WiuRemovePatches(
371 __in_z LPCWSTR wzPatchList,
372 __in_z LPCWSTR wzProductCode,
373 __in_z LPCWSTR wzPropertyList,
374 __out WIU_RESTART* pRestart
375 );
376HRESULT DAPI WiuSourceListAddSourceEx(
377 __in_z LPCWSTR wzProductCodeOrPatchCode,
378 __in_z_opt LPCWSTR wzUserSid,
379 __in MSIINSTALLCONTEXT dwContext,
380 __in DWORD dwCode,
381 __in_z LPCWSTR wzSource,
382 __in_opt DWORD dwIndex
383 );
384HRESULT DAPI WiuBeginTransaction(
385 __in_z LPCWSTR szName,
386 __in DWORD dwTransactionAttributes,
387 __out MSIHANDLE* phTransactionHandle,
388 __out HANDLE* phChangeOfOwnerEvent,
389 __in DWORD dwLogMode,
390 __in_z LPCWSTR szLogPath
391 );
392HRESULT DAPI WiuEndTransaction(
393 __in DWORD dwTransactionState,
394 __in DWORD dwLogMode,
395 __in_z LPCWSTR szLogPath
396 );
397BOOL DAPI WiuIsMsiTransactionSupported(
398 );
399
400#ifdef __cplusplus
401}
402#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/wuautil.h b/src/libs/dutil/WixToolset.DUtil/inc/wuautil.h
new file mode 100644
index 00000000..b239c4e6
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/wuautil.h
@@ -0,0 +1,19 @@
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#if defined(__cplusplus)
6extern "C" {
7#endif
8
9HRESULT DAPI WuaPauseAutomaticUpdates();
10
11HRESULT DAPI WuaResumeAutomaticUpdates();
12
13HRESULT DAPI WuaRestartRequired(
14 __out BOOL* pfRestartRequired
15 );
16
17#if defined(__cplusplus)
18}
19#endif
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/xmlutil.h b/src/libs/dutil/WixToolset.DUtil/inc/xmlutil.h
new file mode 100644
index 00000000..ba92ada9
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/xmlutil.h
@@ -0,0 +1,167 @@
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
5extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument = {0x2933BF90, 0x7B36, 0x11d2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
6extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument20 = {0xF6D90F11, 0x9C73, 0x11D3, {0xB3, 0x2E, 0x00, 0xC0, 0x4F, 0x99, 0x0B, 0xB4}};
7extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument26 = {0xf5078f1b, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};
8extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument30 = {0xf5078f32, 0xc551, 0x11d3, {0x89, 0xb9, 0x00, 0x00, 0xf8, 0x1f, 0xe2, 0x21}};
9extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument40 = {0x88d969c0, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
10extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument50 = {0x88d969e5, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
11extern __declspec(selectany) const CLSID XmlUtil_CLSID_DOMDocument60 = {0x88d96a05, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
12extern __declspec(selectany) const CLSID XmlUtil_CLSID_XMLSchemaCache = {0x88d969c2, 0xf192, 0x11d4, {0xa6, 0x5f, 0x00, 0x40, 0x96, 0x32, 0x51, 0xe5}};
13
14extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument = {0x2933BF81, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
15extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMDocument2 = {0x2933BF95, 0x7B36, 0x11D2, {0xB2, 0x0E, 0x00, 0xC0, 0x4F, 0x98, 0x3E, 0x60}};
16extern __declspec(selectany) const IID XmlUtil_IID_IXMLDOMSchemaCollection = {0x373984C8, 0xB845, 0x449B, {0x91, 0xE7, 0x45, 0xAC, 0x83, 0x03, 0x6A, 0xDE}};
17
18typedef enum XML_LOAD_ATTRIBUTE
19{
20 XML_LOAD_PRESERVE_WHITESPACE = 1,
21} XML_LOAD_ATTRIBUTE;
22
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28HRESULT DAPI XmlInitialize();
29void DAPI XmlUninitialize();
30
31HRESULT DAPI XmlCreateElement(
32 __in IXMLDOMDocument *pixdDocument,
33 __in_z LPCWSTR wzElementName,
34 __out IXMLDOMElement **ppixnElement
35 );
36HRESULT DAPI XmlCreateDocument(
37 __in_opt LPCWSTR pwzElementName,
38 __out IXMLDOMDocument** ppixdDocument,
39 __out_opt IXMLDOMElement** ppixeRootElement = NULL
40 );
41HRESULT DAPI XmlLoadDocument(
42 __in_z LPCWSTR wzDocument,
43 __out IXMLDOMDocument** ppixdDocument
44 );
45HRESULT DAPI XmlLoadDocumentEx(
46 __in_z LPCWSTR wzDocument,
47 __in DWORD dwAttributes,
48 __out IXMLDOMDocument** ppixdDocument
49 );
50HRESULT DAPI XmlLoadDocumentFromFile(
51 __in_z LPCWSTR wzPath,
52 __out IXMLDOMDocument** ppixdDocument
53 );
54HRESULT DAPI XmlLoadDocumentFromBuffer(
55 __in_bcount(cbSource) const BYTE* pbSource,
56 __in SIZE_T cbSource,
57 __out IXMLDOMDocument** ppixdDocument
58 );
59HRESULT DAPI XmlLoadDocumentFromFileEx(
60 __in_z LPCWSTR wzPath,
61 __in DWORD dwAttributes,
62 __out IXMLDOMDocument** ppixdDocument
63 );
64HRESULT DAPI XmlSelectSingleNode(
65 __in IXMLDOMNode* pixnParent,
66 __in_z LPCWSTR wzXPath,
67 __out IXMLDOMNode **ppixnChild
68 );
69HRESULT DAPI XmlSetAttribute(
70 __in IXMLDOMNode* pixnNode,
71 __in_z LPCWSTR pwzAttribute,
72 __in_z LPCWSTR pwzAttributeValue
73 );
74HRESULT DAPI XmlCreateTextNode(
75 __in IXMLDOMDocument *pixdDocument,
76 __in_z LPCWSTR wzText,
77 __out IXMLDOMText **ppixnTextNode
78 );
79HRESULT DAPI XmlGetText(
80 __in IXMLDOMNode* pixnNode,
81 __deref_out_z BSTR* pbstrText
82 );
83HRESULT DAPI XmlGetAttribute(
84 __in IXMLDOMNode* pixnNode,
85 __in_z LPCWSTR pwzAttribute,
86 __deref_out_z BSTR* pbstrAttributeValue
87 );
88HRESULT DAPI XmlGetAttributeEx(
89 __in IXMLDOMNode* pixnNode,
90 __in_z LPCWSTR wzAttribute,
91 __deref_out_z LPWSTR* psczAttributeValue
92 );
93HRESULT DAPI XmlGetYesNoAttribute(
94 __in IXMLDOMNode* pixnNode,
95 __in_z LPCWSTR wzAttribute,
96 __out BOOL* pfYes
97 );
98HRESULT DAPI XmlGetAttributeNumber(
99 __in IXMLDOMNode* pixnNode,
100 __in_z LPCWSTR pwzAttribute,
101 __out DWORD* pdwValue
102 );
103HRESULT DAPI XmlGetAttributeNumberBase(
104 __in IXMLDOMNode* pixnNode,
105 __in_z LPCWSTR pwzAttribute,
106 __in int nBase,
107 __out DWORD* pdwValue
108 );
109HRESULT DAPI XmlGetAttributeLargeNumber(
110 __in IXMLDOMNode* pixnNode,
111 __in_z LPCWSTR pwzAttribute,
112 __out DWORD64* pdw64Value
113 );
114HRESULT DAPI XmlGetNamedItem(
115 __in IXMLDOMNamedNodeMap *pixnmAttributes,
116 __in_opt LPCWSTR wzName,
117 __out IXMLDOMNode **ppixnNamedItem
118 );
119HRESULT DAPI XmlSetText(
120 __in IXMLDOMNode* pixnNode,
121 __in_z LPCWSTR pwzText
122 );
123HRESULT DAPI XmlSetTextNumber(
124 __in IXMLDOMNode *pixnNode,
125 __in DWORD dwValue
126 );
127HRESULT DAPI XmlCreateChild(
128 __in IXMLDOMNode* pixnParent,
129 __in_z LPCWSTR pwzElementType,
130 __out IXMLDOMNode** ppixnChild
131 );
132HRESULT DAPI XmlRemoveAttribute(
133 __in IXMLDOMNode* pixnNode,
134 __in_z LPCWSTR pwzAttribute
135 );
136HRESULT DAPI XmlSelectNodes(
137 __in IXMLDOMNode* pixnParent,
138 __in_z LPCWSTR wzXPath,
139 __out IXMLDOMNodeList **ppixnChild
140 );
141HRESULT DAPI XmlNextAttribute(
142 __in IXMLDOMNamedNodeMap* pixnnm,
143 __out IXMLDOMNode** pixnAttribute,
144 __deref_opt_out_z_opt BSTR* pbstrAttribute
145 );
146HRESULT DAPI XmlNextElement(
147 __in IXMLDOMNodeList* pixnl,
148 __out IXMLDOMNode** pixnElement,
149 __deref_opt_out_z_opt BSTR* pbstrElement
150 );
151HRESULT DAPI XmlRemoveChildren(
152 __in IXMLDOMNode* pixnSource,
153 __in_z LPCWSTR pwzXPath
154 );
155HRESULT DAPI XmlSaveDocument(
156 __in IXMLDOMDocument* pixdDocument,
157 __inout LPCWSTR wzPath
158 );
159HRESULT DAPI XmlSaveDocumentToBuffer(
160 __in IXMLDOMDocument* pixdDocument,
161 __deref_out_bcount(*pcbDest) BYTE** ppbDest,
162 __out DWORD* pcbDest
163 );
164
165#ifdef __cplusplus
166}
167#endif