/*++

Copyright (c) Microsoft Corporation. All rights reserved.

Module Name:

    Wdftriage.h

Environment:

    user mode

NOTE: This header is generated by stubwork.

      To modify contents, add or remove <shared> or <umdf>
      tags in the corresponding .x and .y template files.

--*/

#pragma once

#ifndef WDF_EXTERN_C
  #ifdef __cplusplus
    #define WDF_EXTERN_C       extern "C"
    #define WDF_EXTERN_C_START extern "C" {
    #define WDF_EXTERN_C_END   }
  #else
    #define WDF_EXTERN_C
    #define WDF_EXTERN_C_START
    #define WDF_EXTERN_C_END
  #endif
#endif

WDF_EXTERN_C_START

#define WDF_01_TRIAGE_INFO_MAJOR_VERSION    1
#define WDF_01_TRIAGE_INFO_MINOR_VERSION    0

typedef struct _WDFOBJECT_TRIAGE_INFO {
    ULONG   RawObjectSize; // value
    ULONG   ObjectType;
    ULONG   TotalObjectSize; 
    ULONG   ChildListHead;
    ULONG   ChildEntry;
    ULONG   Globals;
    ULONG   ParentObject;
} WDFOBJECT_TRIAGE_INFO, *PWDFOBJECT_TRIAGE_INFO;

typedef struct _WDFCONTEXT_TRIAGE_INFO {
    ULONG   HeaderSize; // value
    ULONG   NextHeader;
    ULONG   Object;
    ULONG   TypeInfoPtr;
    ULONG   Context;
} WDFCONTEXT_TRIAGE_INFO, *PWDFCONTEXT_TRIAGE_INFO;

typedef struct _WDFCONTEXTTYPE_TRIAGE_INFO {
    ULONG   TypeInfoSize; // value
    ULONG   ContextSize;
    ULONG   ContextName;
} WDFCONTEXTTYPE_TRIAGE_INFO, *PWDFCONTEXTTYPE_TRIAGE_INFO;

typedef struct _WDFQUEUE_TRIAGE_INFO {
    ULONG   QueueSize; // value
    ULONG   IrpQueue1;
    ULONG   IrpQueue2;
    ULONG   RequestList1;
    ULONG   RequestList2;
    ULONG   FwdProgressContext;
    ULONG   PkgIo;
} WDFQUEUE_TRIAGE_INFO, *PWDFQUEUE_TRIAGE_INFO;

typedef struct _WDFFWDPROGRESS_TRIAGE_INFO {
    ULONG   ReservedRequestList;
    ULONG   ReservedRequestInUseList;
    ULONG   PendedIrpList;
} WDFFWDPROGRESS_TRIAGE_INFO, *PWDFFWDPROGRESS_TRIAGE_INFO;

typedef struct _WDFIRPQUEUE_TRIAGE_INFO {
    ULONG   IrpQueueSize; // value
    ULONG   IrpListHeader;
    ULONG   IrpListEntry;
    ULONG   IrpContext;
} WDFIRPQUEUE_TRIAGE_INFO, *PWDFIRPQUEUE_TRIAGE_INFO;
    
typedef struct _WDFREQUEST_TRIAGE_INFO {
    ULONG   RequestSize; // value
    ULONG   CsqContext;
    ULONG   FxIrp;  // WDF irp wrapper, see below.
    ULONG   ListEntryQueueOwned;
    ULONG   ListEntryQueueOwned2;
    ULONG   RequestListEntry;
    ULONG   FwdProgressList;
} WDFREQUEST_TRIAGE_INFO, *PWDFREQUEST_TRIAGE_INFO;

typedef struct _WDFDEVICE_TRIAGE_INFO {
    ULONG   DeviceInitSize; // value
    ULONG   DeviceDriver;
} WDFDEVICE_TRIAGE_INFO, *PWDFDEVICE_TRIAGE_INFO;

typedef struct _WDFIRP_TRIAGE_INFO {
    ULONG   FxIrpSize; // value
    ULONG   IrpPtr;
} WDFIRP_TRIAGE_INFO, *PWDFIRP_TRIAGE_INFO;

typedef struct _WDF_TRIAGE_INFO {
    //
    // Version.
    //
    ULONG                       WdfMajorVersion;
    ULONG                       WdfMinorVersion;
    ULONG                       TriageInfoMajorVersion;
    ULONG                       TriageInfoMinorVersion;

    //
    // Reserved pointer.
    //
    PVOID                       Reserved;

    //
    // WDF objects triage info.
    //
    PWDFOBJECT_TRIAGE_INFO      WdfObjectTriageInfo;
    PWDFCONTEXT_TRIAGE_INFO     WdfContextTriageInfo;
    PWDFCONTEXTTYPE_TRIAGE_INFO WdfContextTypeTriageInfo;
    PWDFQUEUE_TRIAGE_INFO       WdfQueueTriageInfo;
    PWDFFWDPROGRESS_TRIAGE_INFO WdfFwdProgressTriageInfo;
    PWDFIRPQUEUE_TRIAGE_INFO    WdfIrpQueueTriageInfo;
    PWDFREQUEST_TRIAGE_INFO     WdfRequestTriageInfo;
    PWDFDEVICE_TRIAGE_INFO      WdfDeviceTriageInfo;
    PWDFIRP_TRIAGE_INFO         WdfIrpTriageInfo;

} WDF_TRIAGE_INFO, *PWDF_TRIAGE_INFO;
WDF_EXTERN_C_END

