{"record":{"id":"973720c24e8ab6f3","repo":"JanDeDobbeleer/oh-my-posh","slug":"requestasync-0x-08x","errorCode":null,"errorMessage":"RequestAsync: 0x%08x","messagePattern":"RequestAsync: 0x%08x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/runtime/smtc_windows.go","lineNumber":252,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer classID.Close()\n\n\tvar factory unsafe.Pointer\n\thr, _, _ = procRoGetActivationFactory.Call(\n\t\tuintptr(classID),\n\t\tuintptr(unsafe.Pointer(&iidSMTCSessionManagerStatics)),\n\t\tuintptr(unsafe.Pointer(&factory)),\n\t)\n\tif hr != 0 {\n\t\treturn nil, fmt.Errorf(\"RoGetActivationFactory: 0x%08x\", hr)\n\t}\n\tdefer comRelease(factory)\n\n\tvar asyncOp unsafe.Pointer\n\tif hr := comCall(factory, staticsRequestAsync, uintptr(unsafe.Pointer(&asyncOp))); hr != 0 {\n\t\treturn nil, fmt.Errorf(\"RequestAsync: 0x%08x\", hr)\n\t}\n\tdefer comRelease(asyncOp)\n\n\tif err := awaitAsync(asyncOp); err != nil {\n\t\treturn nil, fmt.Errorf(\"await RequestAsync: %w\", err)\n\t}\n\n\tvar manager unsafe.Pointer\n\tif hr := comCall(asyncOp, asyncOpGetResults, uintptr(unsafe.Pointer(&manager))); hr != 0 {\n\t\treturn nil, fmt.Errorf(\"GetResults manager: 0x%08x\", hr)\n\t}\n\tdefer comRelease(manager)\n\n\tvar sessions unsafe.Pointer\n\tif hr := comCall(manager, managerGetSessions, uintptr(unsafe.Pointer(&sessions))); hr != 0 {\n\t\treturn nil, fmt.Errorf(\"GetSessions: 0x%08x\", hr)\n\t}\n\tdefer comRelease(sessions)","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/runtime/smtc_windows.go#L234-L270","documentation":"queryMediaPlayer calls the Windows SMTC (SystemMediaTransportControls) WinRT API via COM. After obtaining the GlobalSystemMediaTransportControlsSessionManager activation factory, it invokes the statics RequestAsync method. A non-zero HRESULT from that vtable call is wrapped as \"RequestAsync: 0x%08x\", meaning the async operation could not even be started.","triggerScenarios":"The COM vtable call to IGlobalSystemMediaTransportControlsSessionManagerStatics.RequestAsync returns a failing HRESULT - e.g. COM apartment issues from RoInitialize, the Windows runtime being unavailable/degraded, or the media session service not present.","commonSituations":"Running on stripped-down Windows installs (Server Core, LTSC without media features) or inside environments where the Windows.Media.Control WinRT type cannot activate; also when COM threading state is corrupted by prior unbalanced RoInitialize calls in the same thread.","solutions":["Verify the OS is a full desktop Windows install where SMTC is available (Windows 10/11 with media features enabled).","Confirm the error HRESULT code: 0x80004005 (E_FAIL) or 0x80040154 (REGDB_E_CLASSNOTREG) indicates the media control class is missing - update/repair Windows.","Retry rendering the prompt after the media player starts; transient COM failures can resolve.","Check for a locked/hung SMTC service (restart 'Windows Media Player Network Sharing Service' / reboot)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Windows only: confirm SMTC is usable before rendering the media segment\nif runtime.GOOS != \"windows\" { skipMediaSegment() }\n// hresult check helper for custom integrations\nhr := invokeRequestAsync()\nif hr != 0 { skipMediaSegment() }","typeGuard":"func mediaSegmentSupported() bool { return runtime.GOOS == \"windows\" }","tryCatchPattern":"info, err := env.QueryMediaPlayer(player)\nif err != nil {\n    // \"RequestAsync: 0x%08x\" - degrade gracefully, omit media info\n    return templateWithoutMedia\n}","preventionTips":["Only enable the media segment on desktop Windows 10/11 installs","Treat any HRESULT-prefixed media error as 'no media info' rather than a prompt failure","Keep Windows media features enabled on machines using the media segment"],"tags":["windows","com","winrt","media"],"backgroundTag":"com-hresult-failure","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}