diff options
Diffstat (limited to 'src/engine/variant.h')
-rw-r--r-- | src/engine/variant.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/engine/variant.h b/src/engine/variant.h new file mode 100644 index 00000000..9259f05a --- /dev/null +++ b/src/engine/variant.h | |||
@@ -0,0 +1,102 @@ | |||
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) | ||
6 | extern "C" { | ||
7 | #endif | ||
8 | |||
9 | |||
10 | // constants | ||
11 | |||
12 | enum BURN_VARIANT_TYPE | ||
13 | { | ||
14 | BURN_VARIANT_TYPE_NONE, | ||
15 | BURN_VARIANT_TYPE_NUMERIC, | ||
16 | BURN_VARIANT_TYPE_STRING, | ||
17 | BURN_VARIANT_TYPE_VERSION, | ||
18 | }; | ||
19 | |||
20 | |||
21 | // struct | ||
22 | |||
23 | typedef struct _BURN_VARIANT | ||
24 | { | ||
25 | union | ||
26 | { | ||
27 | LONGLONG llValue; | ||
28 | DWORD64 qwValue; | ||
29 | LPWSTR sczValue; | ||
30 | BYTE encryptionPadding[CRYP_ENCRYPT_MEMORY_SIZE]; | ||
31 | }; | ||
32 | BURN_VARIANT_TYPE Type; | ||
33 | BOOL fEncryptValue; | ||
34 | } BURN_VARIANT; | ||
35 | |||
36 | |||
37 | // function declarations | ||
38 | |||
39 | void BVariantUninitialize( | ||
40 | __in BURN_VARIANT* pVariant | ||
41 | ); | ||
42 | HRESULT BVariantGetNumeric( | ||
43 | __in BURN_VARIANT* pVariant, | ||
44 | __out LONGLONG* pllValue | ||
45 | ); | ||
46 | HRESULT BVariantGetString( | ||
47 | __in BURN_VARIANT* pVariant, | ||
48 | __out_z LPWSTR* psczValue | ||
49 | ); | ||
50 | HRESULT BVariantGetVersion( | ||
51 | __in BURN_VARIANT* pVariant, | ||
52 | __out DWORD64* pqwValue | ||
53 | ); | ||
54 | HRESULT BVariantSetNumeric( | ||
55 | __in BURN_VARIANT* pVariant, | ||
56 | __in LONGLONG llValue | ||
57 | ); | ||
58 | HRESULT BVariantSetString( | ||
59 | __in BURN_VARIANT* pVariant, | ||
60 | __in_z_opt LPCWSTR wzValue, | ||
61 | __in DWORD_PTR cchValue | ||
62 | ); | ||
63 | HRESULT BVariantSetVersion( | ||
64 | __in BURN_VARIANT* pVariant, | ||
65 | __in DWORD64 qwValue | ||
66 | ); | ||
67 | /******************************************************************** | ||
68 | BVariantSetValue - Convenience function that calls BVariantUninitialize, | ||
69 | BVariantSetNumeric, BVariantSetString, or | ||
70 | BVariantSetVersion based on the type of pValue. | ||
71 | The encryption state of pVariant is preserved. | ||
72 | ********************************************************************/ | ||
73 | HRESULT BVariantSetValue( | ||
74 | __in BURN_VARIANT* pVariant, | ||
75 | __in BURN_VARIANT* pValue | ||
76 | ); | ||
77 | /******************************************************************** | ||
78 | BVariantCopy - creates a copy of pSource. | ||
79 | The encryption state of pTarget is set to | ||
80 | the encryption state of pSource. | ||
81 | ********************************************************************/ | ||
82 | HRESULT BVariantCopy( | ||
83 | __in BURN_VARIANT* pSource, | ||
84 | __out BURN_VARIANT* pTarget | ||
85 | ); | ||
86 | HRESULT BVariantChangeType( | ||
87 | __in BURN_VARIANT* pVariant, | ||
88 | __in BURN_VARIANT_TYPE type | ||
89 | ); | ||
90 | /******************************************************************** | ||
91 | BVariantSetEncryption - sets the encryption state of pVariant. | ||
92 | If the encryption state matches the requested | ||
93 | state, this function does nothing. | ||
94 | ********************************************************************/ | ||
95 | HRESULT BVariantSetEncryption( | ||
96 | __in BURN_VARIANT* pVariant, | ||
97 | __in BOOL fEncrypt | ||
98 | ); | ||
99 | |||
100 | #if defined(__cplusplus) | ||
101 | } | ||
102 | #endif | ||