aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/varutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dutil/varutil.cpp')
-rw-r--r--src/dutil/varutil.cpp274
1 files changed, 274 insertions, 0 deletions
diff --git a/src/dutil/varutil.cpp b/src/dutil/varutil.cpp
new file mode 100644
index 00000000..88716105
--- /dev/null
+++ b/src/dutil/varutil.cpp
@@ -0,0 +1,274 @@
1// 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.
2
3#include "precomp.h"
4
5struct VARIABLE_ENUM_STRUCT
6{
7};
8
9struct VARIABLES_STRUCT
10{
11};
12
13const int VARIABLE_ENUM_HANDLE_BYTES = sizeof(VARIABLE_ENUM_STRUCT);
14const int VARIABLES_HANDLE_BYTES = sizeof(VARIABLES_STRUCT);
15
16// function definitions
17
18/********************************************************************
19VarCreate - creates a variables group.
20********************************************************************/
21extern "C" HRESULT DAPI VarCreate(
22 __out_bcount(VARIABLES_HANDLE_BYTES) VARIABLES_HANDLE* ppVariables
23 )
24{
25 UNREFERENCED_PARAMETER(ppVariables);
26 return E_NOTIMPL;
27}
28
29/********************************************************************
30VarDestroy - destroys a variables group, accepting an optional callback
31 to help free the variable contexts.
32********************************************************************/
33extern "C" void DAPI VarDestroy(
34 __in_bcount(VARIABLES_HANDLE_BYTES) VARIABLES_HANDLE pVariables,
35 __in_opt PFN_FREEVARIABLECONTEXT vpfFreeVariableContext
36 )
37{
38 UNREFERENCED_PARAMETER(pVariables);
39 UNREFERENCED_PARAMETER(vpfFreeVariableContext);
40}
41
42/********************************************************************
43VarFreeValue - frees a variable value.
44********************************************************************/
45extern "C" void DAPI VarFreeValue(
46 __in VARIABLE_VALUE* pValue
47 )
48{
49 UNREFERENCED_PARAMETER(pValue);
50}
51
52/********************************************************************
53VarEscapeString - escapes special characters in wzIn so that it can
54 be used in conditions or variable values.
55********************************************************************/
56extern "C" HRESULT DAPI VarEscapeString(
57 __in_z LPCWSTR wzIn,
58 __out_z LPWSTR* psczOut
59 )
60{
61 UNREFERENCED_PARAMETER(wzIn);
62 UNREFERENCED_PARAMETER(psczOut);
63 return E_NOTIMPL;
64}
65
66/********************************************************************
67VarFormatString - similar to MsiFormatRecord.
68********************************************************************/
69extern "C" HRESULT DAPI VarFormatString(
70 __in C_VARIABLES_HANDLE pVariables,
71 __in_z LPCWSTR wzIn,
72 __out_z_opt LPWSTR* psczOut,
73 __out_opt DWORD* pcchOut
74 )
75{
76 UNREFERENCED_PARAMETER(pVariables);
77 UNREFERENCED_PARAMETER(wzIn);
78 UNREFERENCED_PARAMETER(psczOut);
79 UNREFERENCED_PARAMETER(pcchOut);
80 return E_NOTIMPL;
81}
82
83/********************************************************************
84VarGetFormatted - gets the formatted value of a single variable.
85********************************************************************/
86extern "C" HRESULT DAPI VarGetFormatted(
87 __in C_VARIABLES_HANDLE pVariables,
88 __in_z LPCWSTR wzVariable,
89 __out_z LPWSTR* psczValue
90 )
91{
92 UNREFERENCED_PARAMETER(pVariables);
93 UNREFERENCED_PARAMETER(wzVariable);
94 UNREFERENCED_PARAMETER(psczValue);
95 return E_NOTIMPL;
96}
97
98/********************************************************************
99VarGetNumeric - gets the numeric value of a variable. If the type of
100 the variable is not numeric, it will attempt to
101 convert the value into a number.
102********************************************************************/
103extern "C" HRESULT DAPI VarGetNumeric(
104 __in C_VARIABLES_HANDLE pVariables,
105 __in_z LPCWSTR wzVariable,
106 __out LONGLONG* pllValue
107 )
108{
109 UNREFERENCED_PARAMETER(pVariables);
110 UNREFERENCED_PARAMETER(wzVariable);
111 UNREFERENCED_PARAMETER(pllValue);
112 return E_NOTIMPL;
113}
114
115/********************************************************************
116VarGetString - gets the unformatted string value of a variable. If
117 the type of the variable is not string, it will
118 convert the value to a string.
119********************************************************************/
120extern "C" HRESULT DAPI VarGetString(
121 __in C_VARIABLES_HANDLE pVariables,
122 __in_z LPCWSTR wzVariable,
123 __out_z LPWSTR* psczValue
124 )
125{
126 UNREFERENCED_PARAMETER(pVariables);
127 UNREFERENCED_PARAMETER(wzVariable);
128 UNREFERENCED_PARAMETER(psczValue);
129 return E_NOTIMPL;
130}
131
132/********************************************************************
133VarGetVersion - gets the version value of a variable. If the type of
134 the variable is not version, it will attempt to
135 convert the value into a version.
136********************************************************************/
137extern "C" HRESULT DAPI VarGetVersion(
138 __in C_VARIABLES_HANDLE pVariables,
139 __in_z LPCWSTR wzVariable,
140 __in DWORD64* pqwValue
141 )
142{
143 UNREFERENCED_PARAMETER(pVariables);
144 UNREFERENCED_PARAMETER(wzVariable);
145 UNREFERENCED_PARAMETER(pqwValue);
146 return E_NOTIMPL;
147}
148
149/********************************************************************
150VarGetValue - gets the value of a variable along with its metadata.
151********************************************************************/
152extern "C" HRESULT DAPI VarGetValue(
153 __in C_VARIABLES_HANDLE pVariables,
154 __in_z LPCWSTR wzVariable,
155 __out VARIABLE_VALUE** ppValue
156 )
157{
158 UNREFERENCED_PARAMETER(pVariables);
159 UNREFERENCED_PARAMETER(wzVariable);
160 UNREFERENCED_PARAMETER(ppValue);
161 return E_NOTIMPL;
162}
163
164/********************************************************************
165VarSetNumeric - sets the value of the variable to a number, the type
166 of the variable to numeric, and adds the variable to
167 the group if necessary.
168********************************************************************/
169extern "C" HRESULT DAPI VarSetNumeric(
170 __in VARIABLES_HANDLE pVariables,
171 __in_z LPCWSTR wzVariable,
172 __in LONGLONG llValue
173 )
174{
175 UNREFERENCED_PARAMETER(pVariables);
176 UNREFERENCED_PARAMETER(wzVariable);
177 UNREFERENCED_PARAMETER(llValue);
178 return E_NOTIMPL;
179}
180
181/********************************************************************
182VarSetString - sets the value of the variable to a string, the type
183 of the variable to string, and adds the variable to
184 the group if necessary.
185********************************************************************/
186extern "C" HRESULT DAPI VarSetString(
187 __in VARIABLES_HANDLE pVariables,
188 __in_z LPCWSTR wzVariable,
189 __in_z_opt LPCWSTR wzValue
190 )
191{
192 UNREFERENCED_PARAMETER(pVariables);
193 UNREFERENCED_PARAMETER(wzVariable);
194 UNREFERENCED_PARAMETER(wzValue);
195 return E_NOTIMPL;
196}
197
198/********************************************************************
199VarSetVersion - sets the value of the variable to a version, the type
200 of the variable to version, and adds the variable to
201 the group if necessary.
202********************************************************************/
203extern "C" HRESULT DAPI VarSetVersion(
204 __in VARIABLES_HANDLE pVariables,
205 __in_z LPCWSTR wzVariable,
206 __in DWORD64 qwValue
207 )
208{
209 UNREFERENCED_PARAMETER(pVariables);
210 UNREFERENCED_PARAMETER(wzVariable);
211 UNREFERENCED_PARAMETER(qwValue);
212 return E_NOTIMPL;
213}
214
215/********************************************************************
216VarSetValue - sets the value of the variable along with its metadata.
217 Also adds the variable to the group if necessary.
218********************************************************************/
219extern "C" HRESULT DAPI VarSetValue(
220 __in VARIABLES_HANDLE pVariables,
221 __in_z LPCWSTR wzVariable,
222 __in VARIABLE_VALUE* pValue
223 )
224{
225 UNREFERENCED_PARAMETER(pVariables);
226 UNREFERENCED_PARAMETER(wzVariable);
227 UNREFERENCED_PARAMETER(pValue);
228 return E_NOTIMPL;
229}
230
231/********************************************************************
232VarStartEnum - starts the enumeration of the variable group. There
233 is no guarantee for the order of the variable enumeration.
234
235NOTE: caller is responsible for calling VarFinishEnum even if function fails
236********************************************************************/
237extern "C" HRESULT DAPI VarStartEnum(
238 __in VARIABLES_HANDLE pVariables,
239 __out_bcount(VARIABLE_ENUM_HANDLE_BYTES) VARIABLE_ENUM_HANDLE* ppEnum,
240 __out VARIABLE_VALUE** ppValue
241 )
242{
243 UNREFERENCED_PARAMETER(pVariables);
244 UNREFERENCED_PARAMETER(ppEnum);
245 UNREFERENCED_PARAMETER(ppValue);
246 return E_NOTIMPL;
247}
248
249/********************************************************************
250VarNextVariable - continues the enumeration of the variable group. It
251 will fail if any variables were added or removed
252 during the enumeration.
253
254NOTE: caller is responsible for calling VarFinishEnum even if function fails
255********************************************************************/
256extern "C" HRESULT DAPI VarNextVariable(
257 __in_bcount(VARIABLE_ENUM_HANDLE_BYTES) VARIABLE_ENUM_HANDLE pEnum,
258 __out VARIABLE_VALUE** ppValue
259 )
260{
261 UNREFERENCED_PARAMETER(pEnum);
262 UNREFERENCED_PARAMETER(ppValue);
263 return E_NOTIMPL;
264}
265
266/********************************************************************
267VarFinishEnum - cleans up resources used for the enumeration.
268********************************************************************/
269extern "C" void DAPI VarFinishEnum(
270 __in_bcount(VARIABLE_ENUM_HANDLE_BYTES) VARIABLE_ENUM_HANDLE pEnum
271 )
272{
273 UNREFERENCED_PARAMETER(pEnum);
274}