[HOWTO] Capturing IMAPIv2 Software Traces

Hello everyone!

While we have strived to increase the quality of the error reporting in IMAPIv2, we realize that there are still some problems that are difficult to debug by error codes alone. Additionally, there will still be some generic error messages coming out that don't make it easy to track down the problem. To assist in debugging, we have built software tracing into IMAPIv2. Software tracing allows the component to send tracing messages that will be logged if and only if a trace has been initiated by the user on the given component. These logs can then be used by us at Microsoft to hopefully help track down issues.

Theoretically, this process is as simple as:

1. Start software tracing on a set of GUIDs

2. Run the problematic application/script/code

3. Stop software tracing

This will output a log file that can be analyzed (only with the correct symbols) and may help determine the issue.

To start a software tracing session you simply need the following:

1. tracelog.exe (which is available in the Windows Vista SDK at http://www.microsoft.com/downloads/details.aspx familyid=7614FE22-8A64-4DFB-AA0C-DB53035F40A0&displaylang=en)

2. the IMAPIv2-specific GUIDs

Starting a software tracing session is as simple as:

· tracelog.exe -start <trace name> -guid <guid text file> -f <output file> -flags 0xffff -level 5

To stop the trace you simply run:

· tracelog.exe -stop <trace name>

The IMAPIv2 GUIDs text file should contain the following data:

F8036571,42D9,480A,BABB,DE7833CB059C FileSystemImageTracing
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e90 IMAPI2.dll
1FF10429,99AE,45bb,8A67,C9E945B9FB6C ImapiV1Shim
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e91 MsftDiscMaster2
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e92 MsftEnumDiscRecorder2
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e93 MsftDiscRecorder2
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e94 MsftUtils
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e95 MsftConnectionPointContainer
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e96 MsftWriteEngine2
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e97 MsftDiscFormat2Erase
0e85a5a5,4d5c,44b7,8bda,5b7ab54f7e98 MsftDiscFormat2Data

(If you want to narrow the trace down to a certain component, you can trim GUIDs from this list)

So, for example,

  • all the files are located in the same directory
  • the above GUIDs were in a file called imapiv2-guids.txt
  • the desired output file was called imapiv2-trace.bin
  • the problematic application was test.exe

You could simply run the following from a command line to produce a log file:

1. tracelog.exe -start IMAPI2trace -guid imapiv2-guids.txt -f imapiv2-trace.bin -flags 0xffff -level 5

2. test.exe

3. tracelog.exe -stop IMAPI2trace

Then imapiv2-trace.bin could be provided in response to a post here for analysis and hopefully we could better help you with the issue you're experiencing with IMAPIv2!

If you have any questions or part of this document is not clear, please feel free to ask!

Garrett Jacobson
SDE, Optical Platform Group




Answer this question

[HOWTO] Capturing IMAPIv2 Software Traces

  • Jayender .v s

    Ok, I'll be the first guinea pig :-)

    Where should I send the bin file Is there a viewer


    This is what the output will look like:

    C:\save\imapi\imapi2sample2003 - Copy\Debug>tracelog.exe -start sonyTrace -guid
    imapiv2-guids.txt -f sonyTrace.bin -flags 0xffff -level 5
    Logger Started...
    Enabling trace to logger 17
    Operation Status: 0L The operation completed successfully.

    Logger Name: sonyTrace
    Logger Id: 0x11
    Logger Thread Id: 00001098
    Guid: 0113ad06-a1c6-11db-be0e-0013a927d6b7
    Buffer Size: 64 Kb
    Maximum Buffers: 26
    Minimum Buffers: 4
    Number of Buffers: 4
    Free Buffers: 2
    Buffers Written: 1
    Events Lost: 0
    Log Buffers Lost: 0
    Real Time Buffers Lost: 0
    AgeLimit: 0
    Real Time Consumers: 0
    ClockType: PerfCounter
    Log Mode: Sequential
    Maximum File Size: not set
    Buffer Flush Timer: not set
    Log Filename: C:\save\imapi\imapi2sample2003 - Copy\Debug\sonyTrace.bi
    n

    C:\save\imapi\imapi2sample2003 - Copy\Debug>imapi2sample.exe -write C:\temp\Burn

    Adding C:\temp\Burn - Time: 00:01:25
    Supported file systems: ISO9660 Joliet UDF
    Number of Files: 120
    Number of Directorys: 23
    Image ready to write

    Finishing writing operation...Failed to write stream
    Returned 80004005: U
    DataWriter FAILED for drive index 0
    Returned 80004005: U
    - Total Time: 00:01:26
    Returned 80004005: U

    C:\save\imapi\imapi2sample2003 - Copy\Debug>tracelog.exe -stop sonyTrace
    Operation Status: 0L The operation completed successfully.

    Logger Name: sonyTrace
    Logger Id: 0x11
    Logger Thread Id: 00001098
    Guid: 0113ad06-a1c6-11db-be0e-0013a927d6b7
    Buffer Size: 64 Kb
    Maximum Buffers: 26
    Minimum Buffers: 4
    Number of Buffers: 7
    Free Buffers: 7
    Buffers Written: 86
    Events Lost: 0
    Log Buffers Lost: 0
    Real Time Buffers Lost: 0
    AgeLimit: 0
    Real Time Consumers: 0
    ClockType: PerfCounter
    Log Mode: Sequential
    Maximum File Size: not set
    Buffer Flush Timer: not set
    Log Filename: C:\save\imapi\imapi2sample2003 - Copy\Debug\sonyTrace.bin





  • Cooly

    There's a viewer, but it does no good without the private symbol files....so the .bin file is really only useful to people with full symbol access.

    If you send the .bin file (you may need to rename it to .txt or something less binary sounding so it has a lower chance of getting marked by an AV/spam program) to our email address: optissue@microsoft.com, I'd be glad to take a look at it!



  • [HOWTO] Capturing IMAPIv2 Software Traces