Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


Cause

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

↑ Back to the top


Resolution

Service pack information

To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
889100 How to obtain the latest service pack for Windows Server 2003

Hotfix information

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

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Windows Server 2003 Service Pack 2.

↑ Back to the top


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);
	
	}
}

↑ Back to the top


Keywords: kbqfe, kbwinserv2003sp2fix, kbbug, kbtshoot, kbfix, kbprb, KB899424

↑ Back to the top

Article Info
Article ID : 899424
Revision : 7
Created on : 3/22/2007
Published on : 3/22/2007
Exists online : False
Views : 368