Microsoft KB Archive/899424

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

Article ID: 899424

Article Last Modified on 3/22/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * 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.



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



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



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(&quot;test.log&quot;);

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

// Append some data to the sequence. System.Collections.Generic.IList 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(&quot;RestartArea Written&quot;); }                                   catch {                                               System.Console.WriteLine(&quot;Exception&quot;); }              }

private static System.Collections.Generic.IList CreateData(int size) {       byte[] array = new byte[size]; for (int i = 0; i < size; i++) {           array[i] = 1; }       ArraySegment [] segments = new ArraySegment [1]; segments[0] = new ArraySegment (array); return Array.AsReadOnly(segments); } }

Keywords: kbqfe kbbug kbtshoot kbfix kbprb KB899424

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.