{"record":{"id":"03a0c0020a06ac2e","repo":"dotnet/wpf","slug":"0x80041705","errorCode":"0x80041705","errorMessage":"GetText operation is not supported on current chunk.","messagePattern":"GetText operation is not supported on current chunk\\.","errorType":"error_code","errorClass":"COMException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/CorePropertiesFilter.cs","lineNumber":129,"sourceCode":"                CorePropertyEnumerator.CurrentPropId\n                );\n\n            // GetValue() call pending from this point on\n            // for the current GetChunk call.\n            _pendingGetValue = true;\n\n            return chunk;\n        }\n\n        /// <summary>\n        /// Gets text content corresponding to current chunk.\n        /// </summary>\n        /// <param name=\"bufferCharacterCount\"></param>\n        /// <returns></returns>\n        /// <remarks>Not supported in indexing of core properties.</remarks>\n        public string GetText(int bufferCharacterCount)\n        {\n            throw new COMException(SR.FilterGetTextNotSupported,\n                (int)FilterErrorCode.FILTER_E_NO_TEXT);\n        }\n\n        /// <summary>\n        /// Gets the property value corresponding to current chunk.\n        /// </summary>\n        /// <returns>Property value</returns>\n        public object GetValue()\n        {\n            // If GetValue() is already called for current chunk,\n            // return error with FILTER_E_NO_MORE_VALUES.\n            if (!_pendingGetValue)\n            {\n                throw new COMException(SR.FilterGetValueAlreadyCalledOnCurrentChunk,\n                    (int)FilterErrorCode.FILTER_E_NO_MORE_VALUES);\n            }\n\n            // No GetValue() call pending from this point on","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/CorePropertiesFilter.cs#L111-L147","documentation":"CorePropertiesFilter implements the legacy IFilter COM interface to let indexers read OPC core properties. Chunks it emits are property chunks only, so GetText always throws a COMException with FILTER_E_NO_TEXT (0x80041705) — text extraction is intentionally not supported for core properties.","triggerScenarios":"An IFilter consumer (indexer or custom code) calls GetText on the current chunk returned by CorePropertiesFilter.GetChunk instead of calling GetValue.","commonSituations":"Writing a search indexer over XPS/OPC documents; porting native IFilter host code that assumes all chunks have text; using Windows Search SDK against document core-properties chunks.","solutions":["Call GetValue() on the chunk to obtain the property value instead of GetText().","Check the chunk's attributes (chunkType) before calling and only call GetText for text chunks (cChunkType == CHUNK_TEXT).","Catch COMException with HResult 0x80041705 and treat it as 'no text available' rather than a fatal failure."],"exampleFix":"// before\nstring text = filter.GetText(4096);\n// after\nif (chunk.flags == CHUNKSTATE.CHUNK_VALUE)\n{\n    object value = filter.GetValue();\n}\nelse\n{\n    string text = filter.GetText(4096);\n}","handlingStrategy":"type-guard","validationCode":"bool canGetText = (chunk.flags & CHUNKSTATE.CHUNK_TEXT) != 0;","typeGuard":"static bool IsTextChunk(FILTERCHUNK c) => c.flags == CHUNKSTATE.CHUNK_TEXT;","tryCatchPattern":"try { text = filter.GetText(len); } catch (COMException ex) when (ex.HResult == unchecked((int)0x80041705)) { text = null; }","preventionTips":["Check chunk type/flags before GetText","Use GetValue for property chunks from packaging filters","Treat FILTER_E_NO_TEXT as expected control flow in indexer loops"],"tags":["com","ifilter","indexing","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}