FIX: Your WinFX application crashes when you try to use the FileRecordSequence.WriteRestartArea method that is included in the WinFX SDK (899424)



The information in this article applies to:

  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Datacenter Edition for Itanium-based Systems

SYMPTOMS

When you try to use the FileRecordSequence.WriteRestartArea method that is included in the Microsoft WinFX software development kit (SDK), your WinFX application unexpectedly crashes.

CAUSE

This problem occurs when an invalid log sequence number (LSN) is passed in the TxfLog.dll file and an E_INVALIDARG error occurs.

RESOLUTION

To resolve this problem, apply Windows Server 2003 COM+ 1.5 Rollup Package 6. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

897667 Availability of Windows Server 2003 Post-Service Pack 1 COM+ 1.5 Hotfix Rollup Package 6

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

Compile and run the following Microsoft Visual C# code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO.Log;
using System.IO;

            public class Crash
            {
                        public static void Main(string [] args)
                        {
                                    FileRecordSequence sequence = new FileRecordSequence("test.log");

                                    SequenceNumber undoNext = SequenceNumber.Invalid;
                                    SequenceNumber previous = SequenceNumber.Invalid;
                                    WriteFlags flags = WriteFlags.ForceAppend;

 

                                    // Append some data to the sequence.
                                    System.Collections.Generic.IList<ArraySegment<byte>> data = CreateData(1);
                                    SequenceNumber num = sequence.Append(data, undoNext, previous, flags);
                                    num = sequence.Append(data, undoNext, previous, flags);
                                    num = sequence.Append(data, undoNext, previous, flags);

                                    SequenceNumber newBase = new SequenceNumber(new byte[]{2,3,4,2,3,4,2,3});

                                    try
                                    {
                                                sequence.WriteRestartArea(CreateData(2), newBase);
                                                System.Console.WriteLine("RestartArea Written");
                                    }
                                    catch
                                    {
                                                System.Console.WriteLine("Exception");
			}           
	}

	private static System.Collections.Generic.IList<ArraySegment<byte>> CreateData(int size)
            {
		byte[] array = new byte[size];
		for (int i = 0; i < size; i++)
		{
			array[i] = 1;
		}
		
		ArraySegment<byte>[] segments = new ArraySegment<byte>[1];
		segments[0] = new ArraySegment<byte>(array);
		return Array.AsReadOnly<ArraySegment<byte>>(segments);
	
	}
}
For more information about the WinFX Software Developer Kit, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:7/11/2005
Keywords:kbBug kbtshoot kbfix kbprb KB899424 kbAudITPRO kbAudDeveloper