Skip to content

Commit c88d9a9

Browse files
committed
Clean up
1 parent 1e00c40 commit c88d9a9

2 files changed

Lines changed: 13 additions & 29 deletions

File tree

src/backends/native/minidump/sentry_minidump_windows.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
# include "sentry_minidump_writer.h"
1212
# include "sentry_string.h"
1313

14+
/**
15+
* On Xbox, MiniDumpWriteDump is provided by xgameplatform.lib
16+
* (linked by the Xbox toolchain), not dbghelp.lib.
17+
*/
1418
# if !defined(_GAMING_XBOX)
15-
// On Xbox console MiniDumpWriteDump is supplied by xgameplatform.lib
16-
// (linked by the Xbox toolchain), not dbghelp.lib.
1719
# pragma comment(lib, "dbghelp.lib")
1820
# endif
1921

src/backends/native/sentry_crash_daemon.c

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,10 +1726,10 @@ get_thread_name(HANDLE hThread, sentry_thread_context_windows_t *tctx)
17261726
static void
17271727
enumerate_threads_from_process(sentry_crash_context_t *ctx)
17281728
{
1729-
#ifdef SENTRY_PLATFORM_XBOX
1729+
# ifdef SENTRY_PLATFORM_XBOX
17301730
(void)ctx;
17311731
return;
1732-
#else
1732+
# else
17331733
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
17341734
if (hSnapshot == INVALID_HANDLE_VALUE) {
17351735
SENTRY_WARN("CreateToolhelp32Snapshot failed");
@@ -1826,7 +1826,7 @@ enumerate_threads_from_process(sentry_crash_context_t *ctx)
18261826
ctx->platform.num_threads = thread_count;
18271827
SENTRY_DEBUGF("Enumerated %u threads from process %d", thread_count,
18281828
ctx->crashed_pid);
1829-
#endif // SENTRY_PLATFORM_XBOX
1829+
# endif // SENTRY_PLATFORM_XBOX
18301830
}
18311831
#endif // SENTRY_PLATFORM_WINDOWS
18321832

@@ -3611,16 +3611,9 @@ sentry__crash_daemon_start(pid_t app_pid, uint64_t app_tid, HANDLE event_handle,
36113611
#ifdef SENTRY_CRASH_DAEMON_STANDALONE
36123612

36133613
# if defined(SENTRY_PLATFORM_XBOX)
3614-
// Forward-declare the two XGameRuntime entry points we need rather than
3615-
// #include <XGameRuntime.h> — that header (transitively) requires C++11
3616-
// and the daemon is compiled as C.
36173614
extern HRESULT XGameRuntimeInitialize(void);
36183615
extern void XGameRuntimeUninitialize(void);
36193616

3620-
// Forward declared here; implemented by the downstream SDK (sentry-xbox's
3621-
// sentry_transport_xbox.cpp) and linked into the daemon. The same contract
3622-
// is already assumed by sentry_http_transport_winhttp.c under
3623-
// SENTRY_PLATFORM_XBOX.
36243617
extern bool sentry__xbox_ensure_network_initialized(void);
36253618

36263619
static DWORD WINAPI
@@ -3676,31 +3669,20 @@ main(int argc, char **argv)
36763669
HANDLE ready_event_handle = (HANDLE)(uintptr_t)ready_event_val;
36773670

36783671
# if defined(SENTRY_PLATFORM_XBOX)
3679-
// XGameRuntime must be initialized before any XGameRuntime / XNetworking
3680-
// API call. Without this, the Xbox transport's connectivity check fails
3681-
// and the daemon cannot upload crash reports.
3672+
// Required before any XNetworking call the transport makes at
3673+
// crash-upload time.
36823674
HRESULT init_hr = XGameRuntimeInitialize();
36833675
if (FAILED(init_hr)) {
36843676
fprintf(stderr,
36853677
"sentry-crash: XGameRuntimeInitialize failed: 0x%08lX\n",
36863678
(unsigned long)init_hr);
36873679
return 1;
36883680
}
3689-
// Pre-warm XNetworking on a detached thread so the daemon can enter
3690-
// sentry__crash_daemon_main() immediately and signal ready to the parent
3691-
// within SENTRY_CRASH_DAEMON_READY_TIMEOUT_MS. Per GDK docs, network
3692-
// initialization "usually takes a couple of seconds on both resume and
3693-
// title launch and varies, based on console type and the user's network
3694-
// environment" — near-instant on dev kits but non-trivial on retail
3695-
// cold-boots (MS provides xbconfig NetworkInitDelayInSeconds up to 30s
3696-
// for simulating this). Running the warm-up inline would push the
3697-
// daemon's ready signal past the parent's timeout on retail hardware.
3698-
// The transport's send-time call to sentry__xbox_ensure_network_initialized
3699-
// will pick up (or race with, safely) the background warm-up result.
3700-
HANDLE prewarm_thread = CreateThread(
3681+
3682+
HANDLE network_prewarm_thread = CreateThread(
37013683
NULL, 0, sentry__xbox_network_prewarm_thread_proc, NULL, 0, NULL);
3702-
if (prewarm_thread) {
3703-
CloseHandle(prewarm_thread);
3684+
if (network_prewarm_thread) {
3685+
CloseHandle(network_prewarm_thread);
37043686
}
37053687
# endif
37063688

0 commit comments

Comments
 (0)