{"record":{"id":"2d94b279d5ed2b9e","repo":"JanDeDobbeleer/oh-my-posh","slug":"get-size-0x-08x","errorCode":null,"errorMessage":"get_Size: 0x%08x","messagePattern":"get_Size: 0x%08x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/runtime/smtc_windows.go","lineNumber":274,"sourceCode":"\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)\n\n\tvar size uint32\n\tif hr := comCall(sessions, vectorViewGetSize, uintptr(unsafe.Pointer(&size))); hr != 0 {\n\t\treturn nil, fmt.Errorf(\"get_Size: 0x%08x\", hr)\n\t}\n\n\tfor i := uint32(0); i < size; i++ {\n\t\tvar session unsafe.Pointer\n\t\tif hr := comCall(sessions, vectorViewGetAt, uintptr(i), uintptr(unsafe.Pointer(&session))); hr != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tinfo, ok := readMediaSession(session, player)\n\t\tcomRelease(session)\n\t\tif ok {\n\t\t\treturn info, nil\n\t\t}\n\t}\n\n\t// No matching session in the SMTC list — surface a closed status so the\n\t// caller hides cleanly, mirroring the PowerShell script's contract.\n\treturn &MediaInfo{Status: \"closed\"}, nil\n}","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/runtime/smtc_windows.go#L256-L292","documentation":"After obtaining the sessions vector view, the code asks for its element count via the IVectorView get_Size slot. A non-zero HRESULT is wrapped as \"get_Size: 0x%08x\" - the session collection size could not be read.","triggerScenarios":"The vectorViewGetSize vtable call on the IVectorView of sessions returns a failing HRESULT, usually from an invalid collection pointer or ABI/vtable-slot mismatch.","commonSituations":"Windows builds whose WinRT metadata layout differs from the hardcoded vtable offsets; a corrupted or early-released collection object.","solutions":["Retry the query - transient COM issues often clear.","If deterministic, verify the hardcoded vtable slot indices (vectorViewGetSize) against the actual IVectorView`1 ABI for the running Windows version.","Confirm the sessions object wasn't double-released (defer comRelease ordering) in modified code."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Gate on environment before calling\nif runtime.GOOS != \"windows\" { skipMediaSegment() }","typeGuard":null,"tryCatchPattern":"info, err := env.QueryMediaPlayer(player)\nif err != nil && strings.Contains(err.Error(), \"get_Size\") {\n    return templateWithoutMedia\n}","preventionTips":["Keep oh-my-posh and Windows in versions known to work together","Treat collection-access HRESULT errors as 'no sessions available'","Test the media segment after major Windows updates"],"tags":["windows","com","winrt"],"backgroundTag":"com-hresult-failure","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}