dotnet/wpf · info · COMException

0x80041700

0x80041700

Error message

Filter has no more chunks to return.

What it means

PackageFilter implements the Windows IFilter protocol over the parts of an XPS/OPC package. GetChunk iterates filters for each package part; once every filter has been exhausted (_progress == Progress.FilteringCompleted) the protocol-mandated result FILTER_E_END_OF_CHUNKS (0x80041700) is thrown as a COMException. This is a normal terminal signal, not a bug — it tells the caller indexing is complete.

Solutions

  1. Treat HRESULT 0x80041700 (FILTER_E_END_OF_CHUNKS) as the end-of-enumeration sentinel and stop calling GetChunk, not as a failure.
  2. Check COMException.HResult in the catch block and break the chunk loop on FILTER_E_END_OF_CHUNKS.
  3. Consume every chunk (GetText/GetValue) before advancing so iteration state stays consistent.

Example fix

// before
while (true) { filter.GetChunk(out chunk); ProcessChunk(chunk); }
// after
while (true)
{
    try { filter.GetChunk(out chunk); }
    catch (COMException e) when (e.HResult == unchecked((int)0x80041700)) { break; } // end of chunks
    ProcessChunk(chunk);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Exhaustion is only discovered by calling GetChunk; track iteration state yourself:
bool chunksRemaining = true;

Try / catch

try { filter.GetChunk(out chunk); }
catch (COMException e) when (e.HResult == unchecked((int)0x80041700))
{ /* FILTER_E_END_OF_CHUNKS: stop iterating — not an error */ }

Prevention

When it happens

Trigger: Calling GetChunk() after the last chunk of the package has already been returned, i.e. a subsequent iteration call when all parts of the package have been filtered.

Common situations: Search/indexing drivers (Windows Search, SQL full-text) that call GetChunk in a loop; the error is the documented stop condition — callers that treat it as a failure instead of loop termination get spurious errors.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/26997b6b80635288. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/PackageFilter.cs:120

        /// Non-fatal exceptions from external filters, identified for all practical purposes
        /// with COMException and IOException, are `swallowed by this method.
        /// </para>
        /// </remarks>
        public STAT_CHUNK GetChunk()
        {
            //
            // _progress is Progress.FilteringNotStarted initially and
            // subsequently gets updated in MoveToNextFilter().
            //

            if (_progress == Progress.FilteringNotStarted)
            {
                MoveToNextFilter();
            }

            if (_progress == Progress.FilteringCompleted)
            {
                throw new COMException(SR.FilterEndOfChunks, 
                    (int)FilterErrorCode.FILTER_E_END_OF_CHUNKS);
            }
                
            while(true)
            {
                try
                {
                    STAT_CHUNK chunk = _currentFilter.GetChunk();

                    //
                    // No exception raised. 
                    // If _currentFilter is internal filter,
                    // this might be end of chunks if chunk.idChunk is 0. 
                    //

                    if (!_isInternalFilter || chunk.idChunk != 0)
                    {
                        //

View on GitHub (pinned to 81131a70a4)