VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "NTHeader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim st As IMAGE_NT_HEADERS, fOwner As PE
Private Type Objects
    FileHeader As FileHeader
    OptionalHeader As OptionalHeader
End Type
Dim Objs As Objects
Friend Property Get Struct() As IMAGE_NT_HEADERS
Struct = st
End Property
Friend Property Let Struct(n As IMAGE_NT_HEADERS)
st = n
End Property
Friend Sub SetOwner(cOwner As PE)
Set fOwner = cOwner
End Sub
Friend Property Get Owner() As PE
Set Owner = fOwner
End Property
'***********************************************************************
'**********Common Routines For Memory Mapping**************************
Property Get Length() As Long
Length = Len(st)
End Property
Property Get Pointer() As Long
Pointer = VarPtr(st)
End Property
Function Fill(ByVal hMem As Long) As Boolean
On Error Resume Next
If IsBadCodePtr(hMem) Then Exit Function
CopyMemory ByVal Pointer, ByVal hMem, Length
'*********Fill Dependent Classes From Internal Structure****
Fill = True
FileHeader.Fill VarPtr(st.FileHeader)
OptionalHeader.Fill VarPtr(st.OptionalHeader)
End Function
Function CopyTo(ByVal hMem As Long) As Boolean
If IsBadCodePtr(hMem) Then Exit Function
CopyTo = True
CopyMemory ByVal hMem, st, Length
End Function
'***************End Of Common Routine**************************************
'**************************************************************************
Property Get Signature() As Long
Signature = st.Signature
End Property
Property Get FileHeader() As FileHeader
If Objs.FileHeader Is Nothing Then
    Set Objs.FileHeader = New FileHeader
    Objs.FileHeader.SetOwner Me
End If
Set FileHeader = Objs.FileHeader
End Property
Property Get OptionalHeader() As OptionalHeader
If Objs.OptionalHeader Is Nothing Then
    Set Objs.OptionalHeader = New OptionalHeader
    Objs.OptionalHeader.SetOwner Me
End If
Set OptionalHeader = Objs.OptionalHeader
    
End Property
