« Previous Next »

Thread: Logs: about the sc-win32-status field

Last post 01-17-2008 12:56 PM by remye06. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 01-09-2008, 11:11 AM

    • remye06
    • Not Ranked
    • Joined on 12-20-2007, 11:49 AM
    • Posts 8

    Logs: about the sc-win32-status field

    Hello everybody,

    I'd like to tell you about the sc-win32-status field of the W3C Logging in IIS, which has become very useful in IIS7 (on Server 2008) since it makes you know about a transfer being complete or not. In other words, you can make sure that a file download was successfully terminated ('0') and not aborted ('64') by the client, without need of any ActiveX component or anything else on the client side.

    Although this field was already present in previous versions of IIS, it didn't seem to be reliable at all (i.e. always returning '0' error code, depending on the versions of Windows&IIS).

    You can refer to the "NET HELPMSG" command to get information about the error code the Win32 Status returns.

    However, something getting me lost is that I still can't figure out how to get this value from a HttpModule. The fact that the HttpApplication.LogRequest event was specifically included in the new IIS API leads me to think there's a way to retrieve this information, and I'd love that someone could tell me about it because I've been looking for it 2 whole days along so far >_<

    Here's some accurate documentation I managed to find:

     - http://msdn2.microsoft.com/en-us/library/aa814385(VS.85).aspx (maybe useable from C# code ?)

     - http://blogs.msdn.com/david.wang/archive/2006/04/15/HOWTO-Get-Field-Data-for-Custom-Logging-with-ISAPI-Filter.aspx (IIS6 related)

     

     Thank you !

  • 01-14-2008, 8:18 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Logs: about the sc-win32-status field

    Easiest way would be to use some tool like logparser to parse the IIS log files - there is no easy way to get this from a module - consider that with buffering on, response is flushed after all modules have already finished executing.  If you really want to get this from a module, there is a trace-event that fires called GENERAL_FLUSH_RESPONSE_END (only in vista sp1 and ws08) which contains the code which can be registered using GL_TRACE_EVENT.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 01-16-2008, 10:42 AM In reply to

    • remye06
    • Not Ranked
    • Joined on 12-20-2007, 11:49 AM
    • Posts 8

    Re: Logs: about the sc-win32-status field

    Hi, thanks for your reply !

     I've googled the GENERAL_FLUSH_RESPONSE_END event for awhile and ended up finding it was triggered by the "IIS: WWW Server" provider. I played with ETW and have been able to catch it with a verbosity level of 4. Though I didn't test the LogMan "create api" feature yet, I am afraid of the huge amount of times (2558) this event fires in case of a complete transfer, against 4 times for a cancelled one. As a result, I get a 45+MB size dump file (using the "tracerpt" command)...

    By the way, I guess I lead you to some misunderstanding with my first post, actually I absolutely don't care of getting the G_F_R_E Error Code from a module, avoiding logfile parsing being my main aim. Could you please give me some hint about a way to programmatically "catch" that event for each request ?

    I feel like I'm almost done !

  • 01-17-2008, 3:36 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Logs: about the sc-win32-status field

    So, you don't want to get error code from a module or do log file parsing, what do you want then?

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 01-17-2008, 12:56 PM In reply to

    • remye06
    • Not Ranked
    • Joined on 12-20-2007, 11:49 AM
    • Posts 8

    Re: Logs: about the sc-win32-status field

    Well, by saying that I don't care, I mean that even a managed Win32 service would do the trick to me.

    But since it is going to be plugged into an heavy load production env, I guess the best is to design my own native global iis7 module.

    Thanks a lot for your time !

    PS: I found a IIS Trace Consumer c++ sample on the web, which gives me a good start, but "howto" links about dev/deployment of _global_ modules would be appreciated ;-)

Page 1 of 1 (5 items)
Microsoft Communities