#include "msgid.h"
#include "msgfmt.h"
#include "msgList.h"
+#if defined VMX86_SERVER && !defined VMCORE
+#include "voblib.h"
+#endif
#define INVALID_MSG_CODE (-1)
void Msg_Append(const char *idFmt,
...) PRINTF_DECL(1, 2);
void Msg_AppendStr(const char *id);
+void Msg_AppendMsgList(const MsgList *msgs);
+
+static INLINE void
+Msg_AppendVobContext(void)
+{
+#if defined VMX86_SERVER && !defined VMCORE
+ /* inline to avoid lib/vob dependency unless necessary */
+ MsgList *msgs = NULL;
+
+ VobLib_CurrentContextMsgAppend(&msgs);
+ Msg_AppendMsgList(msgs);
+
+ MsgList_Free(msgs);
+#endif
+}
+
void Msg_Post(MsgSeverity severity,
const char *idFmt,
...) PRINTF_DECL(2, 3);
unsigned Msg_Question(Msg_String const *buttons,
int defaultAnswer,
const char *idFmt, ...) PRINTF_DECL(3, 4);
-void Msg_AppendMsgList(const MsgList *msgs);
/*
* Unfortunately, gcc warns about both NULL and "" being passed as format
* These are the flags set in the request Flags field.
*/
enum {
- VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS = 0x01,
- VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE = 0x02,
- VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x04,
- VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT = 0x08,
- VIX_REQUESTMSG_INCLUDES_AUTH_DATA_V1 = 0x10,
- VIX_REQUESTMSG_REQUIRES_VMDB_NOTIFICATION = 0x20,
- VIX_REQUESTMSG_ESCAPE_XML_DATA = 0x40,
- VIX_REQUESTMSG_HAS_HASHED_SHARED_SECRET = 0x80,
+ VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS = 0x001,
+ VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE = 0x002,
+ VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x004,
+ VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT = 0x008,
+ VIX_REQUESTMSG_INCLUDES_AUTH_DATA_V1 = 0x010,
+ VIX_REQUESTMSG_REQUIRES_VMDB_NOTIFICATION = 0x020,
+ VIX_REQUESTMSG_ESCAPE_XML_DATA = 0x040,
+ VIX_REQUESTMSG_HAS_HASHED_SHARED_SECRET = 0x080,
+ VIX_REQUESTMSG_VIGOR_COMMAND = 0x100,
};
#endif // _MSC_VER
+#if defined(__GNUC__)
/*
* GET_CURRENT_RIP
*
- * Return an approximation of the current instruction pointer. For example for a
- * function call
- * foo.c
- * L123: Foo(GET_CURRENT_RIP())
+ * Returns the current instruction pointer. In the example below:
+ *
+ * foo.c
+ * L123: Foo(GET_CURRENT_RIP())
*
- * The return value from GET_CURRENT_RIP will point a debugger to L123.
+ * the return value from GET_CURRENT_RIP will point a debugger to L123.
*/
-#if defined(__GNUC__)
-#define GET_CURRENT_RIP() ({ \
- void *__rip; \
- asm("lea 0(%%rip), %0;\n\t" \
- : "=r" (__rip)); \
- __rip; \
+#define GET_CURRENT_RIP() ({ \
+ void *__rip; \
+ asm("lea 0(%%rip), %0;\n\t" \
+ : "=r" (__rip)); \
+ __rip; \
})
+
+/*
+ * GET_CURRENT_LOCATION
+ *
+ * Updates the arguments with the values of the %rip, %rbp, and %rsp
+ * registers at the current code location where the macro is invoked.
+ */
+#define GET_CURRENT_LOCATION(rip, rbp, rsp) \
+ asm("lea 0(%%rip), %0\n" \
+ "mov %%rbp, %1\n" \
+ "mov %%rsp, %2\n" \
+ : "=r" (rip), "=r" (rbp), "=r" (rsp))
+
#endif
/*
#endif
/*
- * Only support Linux right now.
- *
- * On Windows, the SAML impersonation story is too shaky to trust,
- * and without that, there's no reason to support AliasManager APIs.
- *
* No support for open-vm-tools.
*/
-#if defined(linux) && !defined(OPEN_VM_TOOLS)
+#if (defined(_WIN32) || defined(linux)) && !defined(OPEN_VM_TOOLS)
#define SUPPORT_VGAUTH 1
#else
#define SUPPORT_VGAUTH 0