ReactOS
0.4.17-dev-573-g8315b8c
variant.h
Go to the documentation of this file.
1
/*
2
* Variant Inlines
3
*
4
* Copyright 2003 Jon Griffiths
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
*/
20
21
#include "
windef.h
"
22
#include "
winerror.h
"
23
#include "
objbase.h
"
24
#include "
oleauto.h
"
25
#include <math.h>
26
27
/* Get just the type from a variant pointer */
28
#define V_TYPE(v) (V_VT((v)) & VT_TYPEMASK)
29
30
/* Flags set in V_VT, other than the actual type value */
31
#define VT_EXTRA_TYPE (VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED)
32
33
/* Get the extra flags from a variant pointer */
34
#define V_EXTRA_TYPE(v) (V_VT((v)) & VT_EXTRA_TYPE)
35
36
/* Missing in Windows but useful VTBIT_* defines */
37
#define VTBIT_BOOL (1 << VT_BSTR)
38
#define VTBIT_BSTR (1 << VT_BSTR)
39
#define VTBIT_DATE (1 << VT_DATE)
40
#define VTBIT_DISPATCH (1 << VT_DISPATCH)
41
#define VTBIT_EMPTY (1 << VT_EMPTY)
42
#define VTBIT_ERROR (1 << VT_ERROR)
43
#define VTBIT_INT (1 << VT_INT)
44
#define VTBIT_NULL (1 << VT_NULL)
45
#define VTBIT_UINT (1 << VT_UINT)
46
#define VTBIT_UNKNOWN (1 << VT_UNKNOWN)
47
#define VTBIT_VARIANT (1 << VT_VARIANT)
48
#define VTBIT_15 (1 << 15)
/* no variant type with this number */
49
50
/* Size constraints */
51
#define I1_MAX 0x7f
52
#define I1_MIN ((-I1_MAX)-1)
53
#define UI1_MAX 0xff
54
#define UI1_MIN 0
55
#define I2_MAX 0x7fff
56
#define I2_MIN ((-I2_MAX)-1)
57
#define UI2_MAX 0xffff
58
#define UI2_MIN 0
59
#define I4_MAX 0x7fffffff
60
#define I4_MIN ((-I4_MAX)-1)
61
#define UI4_MAX 0xffffffff
62
#define UI4_MIN 0
63
#define I8_MAX (((LONGLONG)I4_MAX << 32) | UI4_MAX)
64
#define I8_MIN ((-I8_MAX)-1)
65
#define UI8_MAX (((ULONGLONG)UI4_MAX << 32) | UI4_MAX)
66
#define UI8_MIN 0
67
#define DATE_MAX 2958465
68
#define DATE_MIN -657434
69
#define R4_MAX 3.402823567797336e38
70
#define R4_MIN 1.40129846432481707e-45
71
#define R8_MAX 1.79769313486231470e+308
72
#define R8_MIN 4.94065645841246544e-324
73
74
/* Value of sign for a positive decimal number */
75
#define DECIMAL_POS 0
76
77
#define DEC_MAX_SCALE 28
/* Maximum scale for a decimal */
78
79
/* Internal flags for low level conversion functions */
80
#define VAR_BOOLONOFF 0x0400
/* Convert bool to "On"/"Off" */
81
#define VAR_BOOLYESNO 0x0800
/* Convert bool to "Yes"/"No" */
82
#define VAR_NEGATIVE 0x1000
/* Number is negative */
83
84
unsigned
int
get_type_size
(
ULONG
*,
VARTYPE
);
85
HRESULT
VARIANT_ClearInd
(
VARIANTARG
*);
86
BOOL
get_date_format
(
LCID
,
DWORD
,
const
SYSTEMTIME
*,
87
const
WCHAR
*,
WCHAR
*,
int
);
VARTYPE
unsigned short VARTYPE
Definition:
compat.h:2254
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
HRESULT
Definition:
metahost.idl:58
objbase.h
oleauto.h
WCHAR
short WCHAR
Definition:
pedump.c:58
LCID
DWORD LCID
Definition:
nls.h:13
_SYSTEMTIME
Definition:
minwinbase.h:255
tagVARIANT
Definition:
compat.h:2378
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
get_type_size
unsigned int get_type_size(ULONG *, VARTYPE)
Definition:
usrmarshal.c:207
VARIANT_ClearInd
HRESULT VARIANT_ClearInd(VARIANTARG *)
Definition:
variant.c:554
get_date_format
BOOL get_date_format(LCID, DWORD, const SYSTEMTIME *, const WCHAR *, WCHAR *, int)
Definition:
vartype.c:6729
windef.h
winerror.h
dll
win32
oleaut32
variant.h
Generated on Sat Aug 1 2026 06:06:39 for ReactOS by
1.9.6