89
89
VixError Vix_TranslateCOMError(HRESULT comError);
90
VixError Vix_TranslateGuestRegistryError(int systemError);
92
93
#endif // VIX_HIDE_BORA_DEPENDENCIES
97
* This is an expanded view of a VixError
98
* Every VixError is a 64-bit int, so it can fit into this struct.
100
* The flags, extraErrorType, and extraError are all optional. They
101
* do not have to be set for any error. In fact, these are guaranteed
102
* to be all 0 when the error is VIX_OK. This means that any program
103
* that checks (VIX_OK == err) or (VIX_OK != err) will always work.
105
* The basic error field is a Vix error value, and it's the lsb
106
* of the new struct. This means that a 64-bit error can be assigned
107
* enum constant, like an integer. For example, err = VIX_E_FAIL; works.
108
* This just leaves the flags and extraError fields as 0.
111
#include "vmware_pack_begin.h"
112
struct VixErrorFields {
117
uint8 extraErrorType;
120
#include "vmware_pack_end.h"
124
* These are the flags for a Vix error.
127
VIX_ERRORFLAG_GUEST = 0x0001,
128
VIX_ERRORFLAG_REMOTE = 0x0002,
132
* These are the types of extra error in a Vix error.
135
VIX_ERROREXTRATYPE_NONE = 0,
136
VIX_ERROREXTRATYPE_SNAPSHOT = 1,
137
VIX_ERROREXTRATYPE_DISKLIB = 2,
138
VIX_ERROREXTRATYPE_WINDOWS = 3,
139
VIX_ERROREXTRATYPE_LINUX = 4,
140
VIX_ERROREXTRATYPE_FILE = 5,
141
VIX_ERROREXTRATYPE_VMDB = 6,
142
VIX_ERROREXTRATYPE_AIO = 7,
143
VIX_ERROREXTRATYPE_CRYPTO = 8,
144
VIX_ERROREXTRATYPE_KEYSAFE = 9,
145
VIX_ERROREXTRATYPE_BLOCKLIST = 10,
146
VIX_ERROREXTRATYPE_V2I = 11,
147
VIX_ERROREXTRATYPE_MSGPOST = 12,
152
* These are the types of extra error in a Vix error.
154
#define VIX_ERROR_BASE_ERROR(err) ((VixErrorFields *) &err)->error
155
#define VIX_ERROR_EXTRA_ERROR(err) ((VixErrorFields *) &err)->extraError
156
#define VIX_ERROR_EXTRA_ERROR_TYPE(err) ((VixErrorFields *) &err)->extraErrorType
157
#define VIX_ERROR_FROM_GUEST(err) (((VixErrorFields *) &err)->flags & VIX_ERRORFLAG_GUEST)
158
#define VIX_ERROR_FROM_REMOTE(err) (((VixErrorFields *) &err)->flags & VIX_ERRORFLAG_REMOTE)
159
#define VIX_ERROR_SET_FROM_GUEST(err) (((VixErrorFields *) &err)->flags |= VIX_ERRORFLAG_GUEST)
160
#define VIX_ERROR_SET_FROM_REMOTE(err) (((VixErrorFields *) &err)->flags |= VIX_ERRORFLAG_REMOTE)
162
#define VIX_SET_GUEST_WINDOWS_ERROR(err, vixError, winError) \
165
VIX_ERROR_BASE_ERROR(err) = vixError; \
166
VIX_ERROR_EXTRA_ERROR(err) = winError; \
167
VIX_ERROR_EXTRA_ERROR_TYPE(err) = VIX_ERROREXTRATYPE_WINDOWS; \
168
VIX_ERROR_SET_FROM_GUEST(err); \
171
#define VIX_ERROR_SET_ADDITIONAL_ERROR(err, vixError, additionalError) \
173
err = additionalError; \
174
err = (err << 32) | vixError; \
95
178
* This defines additional error codes.
96
179
* The public error codes are defined in vix.h
105
188
/* File Errors */
106
189
VIX_E_DIRECTORY_NOT_EMPTY = 20006,
191
VIX_E_GUEST_AUTH_MULIPLE_MAPPINGS = 20007,
193
/* Guest Reg Errors */
194
VIX_E_REG_KEY_INVALID = 20008,
195
VIX_E_REG_KEY_HAS_SUBKEYS = 20009,
196
VIX_E_REG_VALUE_NOT_FOUND = 20010,
197
VIX_E_REG_KEY_ALREADY_EXISTS = 20011,
199
/* Generic Guest Errors */
200
VIX_E_HGFS_MOUNT_FAIL = 20050,
109
203
VIX_E_REG_INCORRECT_VALUE_TYPE = 25000
110
204
/* WARNING. Do not exceed 2**16 */
181
275
VIX_PROPERTY_GUEST_CHANGE_FILE_ATTRIBUTES_ENABLED = 4555,
182
276
VIX_PROPERTY_GUEST_INITIATE_FILE_TRANSFER_FROM_GUEST_ENABLED = 4556,
183
277
VIX_PROPERTY_GUEST_INITIATE_FILE_TRANSFER_TO_GUEST_ENABLED = 4557,
278
VIX_PROPERTY_GUEST_ADD_AUTH_PRINICPAL_ENABLED = 4558,
279
VIX_PROPERTY_GUEST_REMOVE_AUTH_PRINICPAL_ENABLED = 4559,
280
VIX_PROPERTY_GUEST_LIST_AUTH_PRINICPALS_ENABLED = 4560,
281
VIX_PROPERTY_GUEST_LIST_MAPPED_PRINICPALS_ENABLED = 4561,
282
VIX_PROPERTY_GUEST_CREATE_REGISTRY_KEY_ENABLED = 4562,
283
VIX_PROPERTY_GUEST_LIST_REGISTRY_KEYS_ENABLED = 4563,
284
VIX_PROPERTY_GUEST_DELETE_REGISTRY_KEY_ENABLED = 4564,
285
VIX_PROPERTY_GUEST_SET_REGISTRY_VALUE_ENABLED = 4565,
286
VIX_PROPERTY_GUEST_LIST_REGISTRY_VALUES_ENABLED = 4566,
287
VIX_PROPERTY_GUEST_DELETE_REGISTRY_VALUE_ENABLED = 4567,
476
580
VIX_FILE_ATTRIBUTE_SET_UNIX_PERMISSIONS = 0x0040,
584
* Principal types for IdProvider management.
586
typedef enum VixGuestAuthPrincipalType {
587
VIX_GUEST_AUTH_PRINCIPAL_TYPE_NONE = 0,
588
VIX_GUEST_AUTH_PRINCIPAL_TYPE_NAMED = 1,
589
VIX_GUEST_AUTH_PRINCIPAL_TYPE_ANY = 2,
590
} VixGuestAuthPrincipalType;
593
* Types for Windows Registry Management.
597
* In a 64 bit Windows OS, the registry has two views: 32 bit and 64 bit.
598
* Normally using "registry redirection", 32 bit applications automatically
599
* access the 32 bit view, while 64 bit applications access 64 bit view.
600
* However, applications can pass a flag to specifically access either 32
601
* or 64 bit registry view, irrespective of their own bitness.
603
* NOTE: 32 bit windows will ignore these flags if passed.
605
* Based on the above, and on the fact that in our case 32 bit tools run only
606
* on 32 bit windows and 64 bit tools run only on 64 bit windows, we get the
607
* following registry view access matrix:
608
* Application wowNative wow32 wow64
609
* ----------- -------- ----- -----
610
* 32 bit tools 32 bit view 32 bit view 32 bit view
611
* 64 bit tools 64 bit view 32 bit view 64 bit view
612
* So in essence, we always access 32 bit view UNLESS its 64 bit tools and user
613
* has specified either wowNative or wow64 as the registry access flag.
616
typedef enum VixRegKeyWowBitness {
617
VIX_REGISTRY_KEY_WOW_NATIVE = 0,
618
VIX_REGISTRY_KEY_WOW_32 = 1,
619
VIX_REGISTRY_KEY_WOW_64 = 2,
620
} VixRegKeyWowBitness;
622
typedef enum VixRegValueDataType {
623
VIX_REGISTRY_VALUE_DWORD = 0,
624
VIX_REGISTRY_VALUE_QWORD = 1,
625
VIX_REGISTRY_VALUE_STRING = 2,
626
VIX_REGISTRY_VALUE_EXPAND_STRING = 3,
627
VIX_REGISTRY_VALUE_MULTI_STRING = 4,
628
VIX_REGISTRY_VALUE_BINARY = 5,
629
} VixRegValueDataType;
481
632
*-----------------------------------------------------------------------------