-
-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Labels
ImprovementNativearea: corehelp wantedWe won't work on this immediately, but we will accept PRsWe won't work on this immediately, but we will accept PRs
Description
One can also add Wine metadata to the context if the app is ran under that:
{
// Add WINE version metadata if running under WINE
HMODULE hntdll;
typedef const char* (CDECL* wine_get_version_t)();
typedef const char* (CDECL* wine_get_build_id_t)();
typedef void (CDECL* wine_get_host_version_t)(const char** sysname, const char** release);
wine_get_version_t wine_get_version;
wine_get_build_id_t wine_get_build_id;
wine_get_host_version_t wine_get_host_version;
if ((hntdll = GetModuleHandleA("ntdll.dll")) && (wine_get_version = reinterpret_cast<wine_get_version_t>(GetProcAddress(hntdll, "wine_get_version"))))
{
sentry_value_t wine_ctx = sentry_value_new_object();
sentry_value_set_by_key(wine_ctx, "version", sentry_value_new_string(wine_get_version())); // example: 7.11
if (wine_get_build_id = reinterpret_cast<wine_get_build_id_t>(GetProcAddress(hntdll, "wine_get_build_id")))
sentry_value_set_by_key(wine_ctx, "build", sentry_value_new_string(wine_get_build_id())); // example: wine-7.11
if (wine_get_host_version = reinterpret_cast<wine_get_host_version_t>(GetProcAddress(hntdll, "wine_get_host_version")))
{
const char* sysname; // example: Linux
const char* release; // example: 5.16.20-2-MANJARO
wine_get_host_version(&sysname, &release);
sentry_value_set_by_key(wine_ctx, "sysname", sentry_value_new_string(sysname));
sentry_value_set_by_key(wine_ctx, "release", sentry_value_new_string(release));
}
sentry_set_context("wine", wine_ctx);
}
}Originally posted by @p0358 in #943 (comment)
Adding this to Sentry must essentially follow the same steps as in this PR: #963
Metadata
Metadata
Assignees
Labels
ImprovementNativearea: corehelp wantedWe won't work on this immediately, but we will accept PRsWe won't work on this immediately, but we will accept PRs
Projects
Status
Backlog