home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / EliteXp®_P21651610152009.psc / FileHeader.cls < prev    next >
Text File  |  2009-10-15  |  2KB  |  68 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "FileHeader"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Dim st As IMAGE_FILE_HEADER, fOwner As NtHeader
  15.  
  16. Friend Property Get Struct() As IMAGE_FILE_HEADER
  17. Struct = st
  18. End Property
  19. Friend Property Let Struct(n As IMAGE_FILE_HEADER)
  20. Dim hdr As IMAGE_NT_HEADERS
  21. hdr = Owner.Struct
  22. hdr.FileHeader = n
  23. st = n
  24. Owner.Struct = hdr
  25. End Property
  26. Friend Sub SetOwner(cOwner As NtHeader)
  27. Set fOwner = cOwner
  28. End Sub
  29. Friend Property Get Owner() As NtHeader
  30. Set Owner = fOwner
  31. End Property
  32. '***********************************************************************
  33. '**********Common Routines For Memory Mapping**************************
  34. Property Get Length() As Long
  35. Length = Len(st)
  36. End Property
  37. Property Get Pointer() As Long
  38. Pointer = VarPtr(st)
  39. End Property
  40. Function Fill(ByVal hMem As Long) As Boolean
  41. On Error Resume Next
  42. If IsBadCodePtr(hMem) Then Exit Function
  43. CopyMemory ByVal Pointer, ByVal hMem, Length
  44. End Function
  45. '***************End Of Common Routine**************************************
  46. '**************************************************************************
  47.  
  48. Property Get Characteristics() As Long
  49. Characteristics = st.Characteristics
  50. End Property
  51. Property Get Machine() As Long
  52. Machine = st.Machine
  53. End Property
  54. Property Get NumberOfSections() As Long
  55. NumberOfSections = st.NumberOfSections
  56. End Property
  57. Property Get PointerToSymbolTable() As Long
  58. PointerToSymbolTable = st.PointerToSymbolTable
  59. End Property
  60. Property Get SizeOfOptionalHeader() As Long
  61. SizeOfOptionalHeader = st.SizeOfOptionalHeader
  62. End Property
  63. Property Get TimeDateStamp() As Long
  64. TimeDateStamp = st.TimeDateStamp
  65. End Property
  66.  
  67.  
  68.